diff options
Diffstat (limited to 'include/llvm/Module.h')
-rw-r--r-- | include/llvm/Module.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Module.h b/include/llvm/Module.h index 3c8055d..8dfb508 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -211,11 +211,13 @@ public: /// Set the module-scope inline assembly blocks. void setModuleInlineAsm(StringRef Asm) { GlobalScopeAsm = Asm; } - /// Append to the module-scope inline assembly blocks, automatically - /// appending a newline to the end. + /// Append to the module-scope inline assembly blocks, automatically inserting + /// a separating newline if necessary. void appendModuleInlineAsm(StringRef Asm) { + if (!GlobalScopeAsm.empty() && + GlobalScopeAsm[GlobalScopeAsm.size()-1] != '\n') + GlobalScopeAsm += '\n'; GlobalScopeAsm += Asm; - GlobalScopeAsm += '\n'; } /// @} |