Add support for linking inline asm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-01-23 23:08:37 +00:00
parent 9771aeafca
commit e1b2e14f92

View 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.