aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp39
1 files changed, 24 insertions, 15 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index daf3a31..1088236 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1407,28 +1407,37 @@ void AssemblyWriter::printFunction(const Function *F) {
Out << " align " << F->getAlignment();
if (F->hasGC())
Out << " gc \"" << F->getGC() << '"';
- FunctionNotes FNotes = F->getNotes();
- if (FNotes != FN_NOTE_None) {
- Out << " notes(";
- bool NeedComma = false;
- if (FNotes & FN_NOTE_AlwaysInline) {
- NeedComma = true;
+ if (F->isDeclaration()) {
+ Out << "\n";
+ } else {
+
+ bool insideNotes = false;
+ if (F->hasNote(FN_NOTE_AlwaysInline)) {
+ Out << "notes(";
+ insideNotes = true;
Out << "inline=always";
}
- else if (FNotes & FN_NOTE_NoInline) {
- NeedComma = true;
+ if (F->hasNote(FN_NOTE_NoInline)) {
+ if (insideNotes)
+ Out << ",";
+ else {
+ Out << "notes(";
+ insideNotes = true;
+ }
Out << "inline=never";
}
- if (FNotes & FN_NOTE_OptimizeForSize) {
- if (NeedComma)
+ if (F->hasNote(FN_NOTE_OptimizeForSize)) {
+ if (insideNotes)
Out << ",";
+ else {
+ Out << "notes(";
+ insideNotes = true;
+ }
Out << "opt_size";
}
- Out << ")";
- }
- if (F->isDeclaration()) {
- Out << "\n";
- } else {
+ if (insideNotes)
+ Out << ")";
+
Out << " {";
// Output all of its basic blocks... for the function