summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 1b6439b6817..ac94e57c3e1 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3360,15 +3360,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
case Decl::FileScopeAsm: {
auto *AD = cast<FileScopeAsmDecl>(D);
- StringRef AsmString = AD->getAsmString()->getString();
-
- const std::string &S = getModule().getModuleInlineAsm();
- if (S.empty())
- getModule().setModuleInlineAsm(AsmString);
- else if (S.end()[-1] == '\n')
- getModule().setModuleInlineAsm(S + AsmString.str());
- else
- getModule().setModuleInlineAsm(S + '\n' + AsmString.str());
+ getModule().appendModuleInlineAsm(AD->getAsmString()->getString());
break;
}
OpenPOWER on IntegriCloud