summaryrefslogtreecommitdiffstats
path: root/clang/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
commit84037d3d0a1592237a9cb9f578baf93559d3ef55 (patch)
tree95e8f68ef239da0077151db4325cb723da1f6888 /clang/lib/CodeGen/CodeGenModule.cpp
parent2a843827a29c9d52dba5a4566a03b07cf8554274 (diff)
downloadbcm5719-llvm-84037d3d0a1592237a9cb9f578baf93559d3ef55.tar.gz
bcm5719-llvm-84037d3d0a1592237a9cb9f578baf93559d3ef55.zip
fix PR10415, tidying up IR representation of module level inline asm
to avoid extraneous \n's. llvm-svn: 135862
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a4fce926ec2..d7b6c7ec3df 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud