aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-23 20:04:25 +0000
committerChris Lattner <sabre@nondot.org>2011-07-23 20:04:25 +0000
commit9f5bff086cad25c15b4deb8a7763786097aadccd (patch)
tree8af25dfa78049b73fc5e373602ad6a11d265dc1b /lib/CodeGen/CodeGenModule.cpp
parentab4e83b904d81d8ab1f8c594655822a023cad87d (diff)
fix PR10415, tidying up IR representation of module level inline asm
to avoid extraneous \n's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index a4fce926ec..d7b6c7ec3d 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -2186,6 +2186,8 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
const std::string &S = getModule().getModuleInlineAsm();
if (S.empty())
getModule().setModuleInlineAsm(AsmString);
+ else if (*--S.end() == '\n')
+ getModule().setModuleInlineAsm(S + AsmString.str());
else
getModule().setModuleInlineAsm(S + '\n' + AsmString.str());
break;