aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-02-08 00:33:21 +0000
committerAnders Carlsson <andersca@mac.com>2008-02-08 00:33:21 +0000
commitdfab6cb59a703f2ce4d58371652ce879f4c85a09 (patch)
tree08c333c7a2c28c6541b8d0328d13420ed8e90686 /CodeGen/ModuleBuilder.cpp
parent3f9424f3206b834b5dd0e7c403348651ab6fafbb (diff)
Put back the top-level asm code; all tests pass now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/ModuleBuilder.cpp')
-rw-r--r--CodeGen/ModuleBuilder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/CodeGen/ModuleBuilder.cpp b/CodeGen/ModuleBuilder.cpp
index 50d6fedadd..06467488a5 100644
--- a/CodeGen/ModuleBuilder.cpp
+++ b/CodeGen/ModuleBuilder.cpp
@@ -70,6 +70,15 @@ namespace {
Builder->WarnUnsupported(LSD, "linkage spec");
// FIXME: implement C++ linkage, C linkage works mostly by C
// language reuse already.
+ } else if (FileScopeAsmDecl *AD = dyn_cast<FileScopeAsmDecl>(D)) {
+ std::string AsmString(AD->getAsmString()->getStrData(),
+ AD->getAsmString()->getByteLength());
+
+ const std::string &S = Builder->getModule().getModuleInlineAsm();
+ if (S.empty())
+ Builder->getModule().setModuleInlineAsm(AsmString);
+ else
+ Builder->getModule().setModuleInlineAsm(S + '\n' + AsmString);
} else {
assert(isa<TypeDecl>(D) && "Unknown top level decl");
// TODO: handle debug info?