[llvm-commits] [llvm] r94539 - /llvm/trunk/include/llvm/Module.h
Duncan Sands
baldrick at free.fr
Tue Jan 26 03:58:04 PST 2010
Author: baldrick
Date: Tue Jan 26 05:58:04 2010
New Revision: 94539
URL: http://llvm.org/viewvc/llvm-project?rev=94539&view=rev
Log:
Tweak the way appendModuleInlineAsm works, so you aren't obliged
to append a newline when using setModuleInlineAsm in case later
someone calls appendModuleInlineAsm - make newline handling fully
automatic. In case anyone is wondering there is only one user of
appendModuleInlineAsm: the dragonegg plugin.
Modified:
llvm/trunk/include/llvm/Module.h
Modified: llvm/trunk/include/llvm/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=94539&r1=94538&r2=94539&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Module.h (original)
+++ llvm/trunk/include/llvm/Module.h Tue Jan 26 05:58:04 2010
@@ -211,11 +211,13 @@
/// 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';
}
/// @}
More information about the llvm-commits
mailing list