forked from OSchip/llvm-project
parent
ef9e01eada
commit
dfd511e9bc
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue