aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Attributes.h10
-rw-r--r--lib/AsmParser/llvmAsmParser.cpp.cvs16
-rw-r--r--lib/AsmParser/llvmAsmParser.y16
-rw-r--r--lib/AsmParser/llvmAsmParser.y.cvs16
-rw-r--r--lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp2
-rw-r--r--lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp2
-rw-r--r--lib/Transforms/IPO/InlineAlways.cpp2
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp2
-rw-r--r--lib/Transforms/IPO/Inliner.cpp2
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp2
-rw-r--r--lib/Transforms/Utils/InlineCost.cpp2
-rw-r--r--lib/VMCore/AsmWriter.cpp6
12 files changed, 40 insertions, 38 deletions
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index a503354..0e41694 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -78,12 +78,14 @@ inline Attributes constructAlignmentFromInt(unsigned i) {
std::string getAsString(Attributes Attrs);
} // end namespace ParamAttr
+namespace FnAttr {
/// Function notes are implemented as attributes stored at index ~0 in
/// parameter attribute list.
-const Attributes FN_NOTE_None = 0;
-const Attributes FN_NOTE_NoInline = 1<<0; // inline=never
-const Attributes FN_NOTE_AlwaysInline = 1<<1; // inline=always
-const Attributes FN_NOTE_OptimizeForSize = 1<<2; // opt_size
+const Attributes None = 0;
+const Attributes NoInline = 1<<0; // inline=never
+const Attributes AlwaysInline = 1<<1; // inline=always
+const Attributes OptimizeForSize = 1<<2; // opt_size
+} // end namespace FnAttr
/// This is just a pair of values to associate a set of parameter attributes
/// with a parameter index.
diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs
index 4d8ab74..9fb6134 100644
--- a/lib/AsmParser/llvmAsmParser.cpp.cvs
+++ b/lib/AsmParser/llvmAsmParser.cpp.cvs
@@ -4125,11 +4125,11 @@ yyreduce:
#line 1298 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
{
unsigned tmp = (yyvsp[(1) - (3)].ParamAttrs) | (yyvsp[(3) - (3)].ParamAttrs);
- if ((yyvsp[(3) - (3)].ParamAttrs) == FN_NOTE_NoInline
- && ((yyvsp[(1) - (3)].ParamAttrs) & FN_NOTE_AlwaysInline))
+ if ((yyvsp[(3) - (3)].ParamAttrs) == FnAttr::NoInline
+ && ((yyvsp[(1) - (3)].ParamAttrs) & FnAttr::AlwaysInline))
GEN_ERROR("Function Notes may include only one inline notes!")
- if ((yyvsp[(3) - (3)].ParamAttrs) == FN_NOTE_AlwaysInline
- && ((yyvsp[(1) - (3)].ParamAttrs) & FN_NOTE_NoInline))
+ if ((yyvsp[(3) - (3)].ParamAttrs) == FnAttr::AlwaysInline
+ && ((yyvsp[(1) - (3)].ParamAttrs) & FnAttr::NoInline))
GEN_ERROR("Function Notes may include only one inline notes!")
(yyval.ParamAttrs) = tmp;
CHECK_FOR_ERROR
@@ -4138,22 +4138,22 @@ yyreduce:
case 131:
#line 1311 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = FN_NOTE_NoInline; ;}
+ { (yyval.ParamAttrs) = FnAttr::NoInline; ;}
break;
case 132:
#line 1312 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = FN_NOTE_AlwaysInline; ;}
+ { (yyval.ParamAttrs) = FnAttr::AlwaysInline; ;}
break;
case 133:
#line 1313 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = FN_NOTE_OptimizeForSize; ;}
+ { (yyval.ParamAttrs) = FnAttr::OptimizeForSize; ;}
break;
case 134:
#line 1316 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
- { (yyval.ParamAttrs) = FN_NOTE_None; ;}
+ { (yyval.ParamAttrs) = FnAttr::None; ;}
break;
case 135:
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 5de34a7..2241778 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1297,23 +1297,23 @@ OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
FuncNoteList : FuncNote { $$ = $1; }
| FuncNoteList ',' FuncNote {
unsigned tmp = $1 | $3;
- if ($3 == FN_NOTE_NoInline
- && ($1 & FN_NOTE_AlwaysInline))
+ if ($3 == FnAttr::NoInline
+ && ($1 & FnAttr::AlwaysInline))
GEN_ERROR("Function Notes may include only one inline notes!")
- if ($3 == FN_NOTE_AlwaysInline
- && ($1 & FN_NOTE_NoInline))
+ if ($3 == FnAttr::AlwaysInline
+ && ($1 & FnAttr::NoInline))
GEN_ERROR("Function Notes may include only one inline notes!")
$$ = tmp;
CHECK_FOR_ERROR
}
;
-FuncNote : INLINE '=' NEVER { $$ = FN_NOTE_NoInline; }
- | INLINE '=' ALWAYS { $$ = FN_NOTE_AlwaysInline; }
- | OPTIMIZEFORSIZE { $$ = FN_NOTE_OptimizeForSize; }
+FuncNote : INLINE '=' NEVER { $$ = FnAttr::NoInline; }
+ | INLINE '=' ALWAYS { $$ = FnAttr::AlwaysInline; }
+ | OPTIMIZEFORSIZE { $$ = FnAttr::OptimizeForSize; }
;
-OptFuncNotes : /* empty */ { $$ = FN_NOTE_None; }
+OptFuncNotes : /* empty */ { $$ = FnAttr::None; }
| FNNOTE '(' FuncNoteList ')' {
$$ = $3;
}
diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs
index 5de34a7..2241778 100644
--- a/lib/AsmParser/llvmAsmParser.y.cvs
+++ b/lib/AsmParser/llvmAsmParser.y.cvs
@@ -1297,23 +1297,23 @@ OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
FuncNoteList : FuncNote { $$ = $1; }
| FuncNoteList ',' FuncNote {
unsigned tmp = $1 | $3;
- if ($3 == FN_NOTE_NoInline
- && ($1 & FN_NOTE_AlwaysInline))
+ if ($3 == FnAttr::NoInline
+ && ($1 & FnAttr::AlwaysInline))
GEN_ERROR("Function Notes may include only one inline notes!")
- if ($3 == FN_NOTE_AlwaysInline
- && ($1 & FN_NOTE_NoInline))
+ if ($3 == FnAttr::AlwaysInline
+ && ($1 & FnAttr::NoInline))
GEN_ERROR("Function Notes may include only one inline notes!")
$$ = tmp;
CHECK_FOR_ERROR
}
;
-FuncNote : INLINE '=' NEVER { $$ = FN_NOTE_NoInline; }
- | INLINE '=' ALWAYS { $$ = FN_NOTE_AlwaysInline; }
- | OPTIMIZEFORSIZE { $$ = FN_NOTE_OptimizeForSize; }
+FuncNote : INLINE '=' NEVER { $$ = FnAttr::NoInline; }
+ | INLINE '=' ALWAYS { $$ = FnAttr::AlwaysInline; }
+ | OPTIMIZEFORSIZE { $$ = FnAttr::OptimizeForSize; }
;
-OptFuncNotes : /* empty */ { $$ = FN_NOTE_None; }
+OptFuncNotes : /* empty */ { $$ = FnAttr::None; }
| FNNOTE '(' FuncNoteList ')' {
$$ = $3;
}
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 2c9975e..cada750 100644
--- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -160,7 +160,7 @@ void X86ATTAsmPrinter::emitFunctionHeader(const MachineFunction &MF) {
SwitchToTextSection(SectionName.c_str());
unsigned FnAlign = OptimizeForSize ? 1 : 4;
- if (!F->isDeclaration() && F->hasNote(FN_NOTE_OptimizeForSize))
+ if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
FnAlign = 1;
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
index 7c2713c..3c4612b 100644
--- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
@@ -147,7 +147,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
unsigned FnAlign = OptimizeForSize ? 1 : 4;
- if (!F->isDeclaration() && F->hasNote(FN_NOTE_OptimizeForSize))
+ if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
FnAlign = 1;
switch (F->getLinkage()) {
default: assert(0 && "Unsupported linkage type!");
diff --git a/lib/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp
index ddcc79c..6d95ffd 100644
--- a/lib/Transforms/IPO/InlineAlways.cpp
+++ b/lib/Transforms/IPO/InlineAlways.cpp
@@ -63,7 +63,7 @@ bool AlwaysInliner::doInitialization(CallGraph &CG) {
for (Module::iterator I = M.begin(), E = M.end();
I != E; ++I)
- if (!I->isDeclaration() && !I->hasNote(FN_NOTE_AlwaysInline))
+ if (!I->isDeclaration() && !I->hasNote(FnAttr::AlwaysInline))
NeverInline.insert(I);
return false;
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index 4289767..1cf6c9e 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -65,7 +65,7 @@ bool SimpleInliner::doInitialization(CallGraph &CG) {
for (Module::iterator I = M.begin(), E = M.end();
I != E; ++I)
- if (!I->isDeclaration() && I->hasNote(FN_NOTE_NoInline))
+ if (!I->isDeclaration() && I->hasNote(FnAttr::NoInline))
NeverInline.insert(I);
// Get llvm.noinline
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 7922d6e..5718835 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -141,7 +141,7 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
int CurrentThreshold = InlineThreshold;
Function *Fn = CS.getCaller();
- if (Fn && !Fn->isDeclaration() && Fn->hasNote(FN_NOTE_OptimizeForSize)
+ if (Fn && !Fn->isDeclaration() && Fn->hasNote(FnAttr::OptimizeForSize)
&& InlineThreshold != 50) {
CurrentThreshold = 50;
}
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 4fd3d03..a6f6bd7 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -430,7 +430,7 @@ bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){
Function *F = loopHeader->getParent();
// Do not unswitch if the function is optimized for size.
- if (!F->isDeclaration() && F->hasNote(FN_NOTE_OptimizeForSize))
+ if (!F->isDeclaration() && F->hasNote(FnAttr::OptimizeForSize))
return false;
// Check to see if it would be profitable to unswitch current loop.
diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp
index 6ecd060..c35af25 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -222,7 +222,7 @@ int InlineCostAnalyzer::getInlineCost(CallSite CS,
if (CalleeFI.NeverInline)
return 2000000000;
- if (!Callee->isDeclaration() && Callee->hasNote(FN_NOTE_AlwaysInline))
+ if (!Callee->isDeclaration() && Callee->hasNote(FnAttr::AlwaysInline))
return -2000000000;
// Add to the inline quality for properties that make the call valuable to
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 3b9b669..6cdf725 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1412,12 +1412,12 @@ void AssemblyWriter::printFunction(const Function *F) {
} else {
bool insideNotes = false;
- if (F->hasNote(FN_NOTE_AlwaysInline)) {
+ if (F->hasNote(FnAttr::AlwaysInline)) {
Out << "notes(";
insideNotes = true;
Out << "inline=always";
}
- if (F->hasNote(FN_NOTE_NoInline)) {
+ if (F->hasNote(FnAttr::NoInline)) {
if (insideNotes)
Out << ",";
else {
@@ -1426,7 +1426,7 @@ void AssemblyWriter::printFunction(const Function *F) {
}
Out << "inline=never";
}
- if (F->hasNote(FN_NOTE_OptimizeForSize)) {
+ if (F->hasNote(FnAttr::OptimizeForSize)) {
if (insideNotes)
Out << ",";
else {