summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-23 23:08:37 +0000
committerChris Lattner <sabre@nondot.org>2006-01-23 23:08:37 +0000
commitdd2d3faf197b89d5a9805027b02c9aec2de7fb1e (patch)
tree764b38ae4622fcababc477c8ae2764daddd9f341 /llvm/lib/Linker/LinkModules.cpp
parent37992b34c23f134c4118bc365022502816937970 (diff)
downloadbcm5719-llvm-dd2d3faf197b89d5a9805027b02c9aec2de7fb1e.tar.gz
bcm5719-llvm-dd2d3faf197b89d5a9805027b02c9aec2de7fb1e.zip
Add support for linking inline asm
llvm-svn: 25560
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 8295418cd7f..482a63abdc7 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.
OpenPOWER on IntegriCloud