From dd2d3faf197b89d5a9805027b02c9aec2de7fb1e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 23 Jan 2006 23:08:37 +0000 Subject: [PATCH] Add support for linking inline asm llvm-svn: 25560 --- llvm/lib/Linker/LinkModules.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 8295418cd7f3..482a63abdc7d 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -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.