Add support for linking inline asm
authorChris Lattner <sabre@nondot.org>
Mon, 23 Jan 2006 23:08:37 +0000 (23:08 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Jan 2006 23:08:37 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25560 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp

index 8295418cd7f30d8e7d86a8d33e165f892f4c024c..482a63abdc7d4bbe2c643c0c0c790acbb5231bd2 100644 (file)
@@ -833,6 +833,13 @@ Linker::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) {
       Dest->getTargetTriple() != Src->getTargetTriple())
     std::cerr << "WARNING: Linking two modules of different target triples!\n";
 
+  if (!Src->getInlineAsm().empty()) {
+    if (Dest->getInlineAsm().empty())
+      Dest->setInlineAsm(Src->getInlineAsm());
+    else
+      Dest->setInlineAsm(Dest->getInlineAsm()+"\n"+Src->getInlineAsm());
+  }
+  
   // Update the destination module's dependent libraries list with the libraries
   // from the source module. There's no opportunity for duplicates here as the
   // Module ensures that duplicate insertions are discarded.