MSPGCC renamed ISR vectors from vector_<address> to __isr_<number>. This patch makes...
authorAnton Korobeynikov <asl@math.spbu.ru>
Mon, 26 Nov 2012 18:59:10 +0000 (18:59 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Mon, 26 Nov 2012 18:59:10 +0000 (18:59 +0000)
Patch by Job Noorman!

llvm-svn: 168598

clang/lib/CodeGen/TargetInfo.cpp

index 1814e1f..4cff081 100644 (file)
@@ -3789,9 +3789,9 @@ void MSP430TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
       F->addFnAttr(llvm::Attributes::NoInline);
 
       // Step 3: Emit ISR vector alias.
-      unsigned Num = attr->getNumber() + 0xffe0;
+      unsigned Num = attr->getNumber() / 2;
       new llvm::GlobalAlias(GV->getType(), llvm::Function::ExternalLinkage,
-                            "vector_" + Twine::utohexstr(Num),
+                            "__isr_" + Twine(Num),
                             GV, &M.getModule());
     }
   }