mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
108f92e376
commit
cb7f483d8c
@ -52,10 +52,10 @@ template<> struct ilist_traits<Argument>
|
||||
};
|
||||
|
||||
typedef unsigned FunctionNotes;
|
||||
const FunctionNotes FP_None = 0;
|
||||
const FunctionNotes FP_NoInline = 1<<0;
|
||||
const FunctionNotes FP_AlwaysInline = 1<<1;
|
||||
const FunctionNotes FP_OptimizeForSize = 1<<2;
|
||||
const FunctionNotes FN_NOTE_None = 0;
|
||||
const FunctionNotes FN_NOTE_NoInline = 1<<0;
|
||||
const FunctionNotes FN_NOTE_AlwaysInline = 1<<1;
|
||||
const FunctionNotes FN_NOTE_OptimizeForSize = 1<<2;
|
||||
|
||||
class Function : public GlobalValue, public Annotable,
|
||||
public ilist_node<Function> {
|
||||
@ -155,13 +155,13 @@ public:
|
||||
///
|
||||
void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; }
|
||||
|
||||
/// getNotes - Return this function properties
|
||||
/// getNotes - Return function notes
|
||||
///
|
||||
const FunctionNotes &getNotes() const { return Notes; }
|
||||
|
||||
/// setNotes - Set properties for this function
|
||||
/// setNotes - Set notes for this function
|
||||
///
|
||||
void setNotes(const FunctionNotes P) { Notes = P;}
|
||||
void setNotes(const FunctionNotes P) { Notes = Notes | P;}
|
||||
|
||||
/// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
|
||||
/// to use during code generation.
|
||||
|
@ -4125,9 +4125,9 @@ yyreduce:
|
||||
#line 1298 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y"
|
||||
{
|
||||
FunctionNotes tmp = (yyvsp[(1) - (3)].FunctionNotes) | (yyvsp[(3) - (3)].FunctionNotes);
|
||||
if ((yyvsp[(3) - (3)].FunctionNotes) == FP_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FP_AlwaysInline))
|
||||
if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_AlwaysInline))
|
||||
GEN_ERROR("Function Notes may include only one inline notes!")
|
||||
if ((yyvsp[(3) - (3)].FunctionNotes) == FP_AlwaysInline && ((yyvsp[(1) - (3)].FunctionNotes) & FP_NoInline))
|
||||
if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_AlwaysInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_NoInline))
|
||||
GEN_ERROR("Function Notes may include only one inline notes!")
|
||||
(yyval.FunctionNotes) = tmp;
|
||||
CHECK_FOR_ERROR
|
||||
@ -4136,22 +4136,22 @@ yyreduce:
|
||||
|
||||
case 130:
|
||||
#line 1309 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y"
|
||||
{ (yyval.FunctionNotes) = FP_NoInline; ;}
|
||||
{ (yyval.FunctionNotes) = FN_NOTE_NoInline; ;}
|
||||
break;
|
||||
|
||||
case 131:
|
||||
#line 1310 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y"
|
||||
{ (yyval.FunctionNotes) = FP_AlwaysInline; ;}
|
||||
{ (yyval.FunctionNotes) = FN_NOTE_AlwaysInline; ;}
|
||||
break;
|
||||
|
||||
case 132:
|
||||
#line 1311 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y"
|
||||
{ (yyval.FunctionNotes) = FP_OptimizeForSize; ;}
|
||||
{ (yyval.FunctionNotes) = FN_NOTE_OptimizeForSize; ;}
|
||||
break;
|
||||
|
||||
case 133:
|
||||
#line 1314 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y"
|
||||
{ (yyval.FunctionNotes) = FP_None; ;}
|
||||
{ (yyval.FunctionNotes) = FN_NOTE_None; ;}
|
||||
break;
|
||||
|
||||
case 134:
|
||||
|
@ -1297,21 +1297,21 @@ OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
|
||||
FuncNoteList : FuncNote { $$ = $1; }
|
||||
| FuncNoteList ',' FuncNote {
|
||||
FunctionNotes tmp = $1 | $3;
|
||||
if ($3 == FP_NoInline && ($1 & FP_AlwaysInline))
|
||||
if ($3 == FN_NOTE_NoInline && ($1 & FN_NOTE_AlwaysInline))
|
||||
GEN_ERROR("Function Notes may include only one inline notes!")
|
||||
if ($3 == FP_AlwaysInline && ($1 & FP_NoInline))
|
||||
if ($3 == FN_NOTE_AlwaysInline && ($1 & FN_NOTE_NoInline))
|
||||
GEN_ERROR("Function Notes may include only one inline notes!")
|
||||
$$ = tmp;
|
||||
CHECK_FOR_ERROR
|
||||
}
|
||||
;
|
||||
|
||||
FuncNote : INLINE '=' NEVER { $$ = FP_NoInline; }
|
||||
| INLINE '=' ALWAYS { $$ = FP_AlwaysInline; }
|
||||
| OPTIMIZEFORSIZE { $$ = FP_OptimizeForSize; }
|
||||
FuncNote : INLINE '=' NEVER { $$ = FN_NOTE_NoInline; }
|
||||
| INLINE '=' ALWAYS { $$ = FN_NOTE_AlwaysInline; }
|
||||
| OPTIMIZEFORSIZE { $$ = FN_NOTE_OptimizeForSize; }
|
||||
;
|
||||
|
||||
OptFuncNotes : /* empty */ { $$ = FP_None; }
|
||||
OptFuncNotes : /* empty */ { $$ = FN_NOTE_None; }
|
||||
| FNNOTE '(' FuncNoteList ')' {
|
||||
$$ = $3;
|
||||
}
|
||||
|
@ -1297,21 +1297,21 @@ OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; }
|
||||
FuncNoteList : FuncNote { $$ = $1; }
|
||||
| FuncNoteList ',' FuncNote {
|
||||
FunctionNotes tmp = $1 | $3;
|
||||
if ($3 == FP_NoInline && ($1 & FP_AlwaysInline))
|
||||
if ($3 == FN_NOTE_NoInline && ($1 & FN_NOTE_AlwaysInline))
|
||||
GEN_ERROR("Function Notes may include only one inline notes!")
|
||||
if ($3 == FP_AlwaysInline && ($1 & FP_NoInline))
|
||||
if ($3 == FN_NOTE_AlwaysInline && ($1 & FN_NOTE_NoInline))
|
||||
GEN_ERROR("Function Notes may include only one inline notes!")
|
||||
$$ = tmp;
|
||||
CHECK_FOR_ERROR
|
||||
}
|
||||
;
|
||||
|
||||
FuncNote : INLINE '=' NEVER { $$ = FP_NoInline; }
|
||||
| INLINE '=' ALWAYS { $$ = FP_AlwaysInline; }
|
||||
| OPTIMIZEFORSIZE { $$ = FP_OptimizeForSize; }
|
||||
FuncNote : INLINE '=' NEVER { $$ = FN_NOTE_NoInline; }
|
||||
| INLINE '=' ALWAYS { $$ = FN_NOTE_AlwaysInline; }
|
||||
| OPTIMIZEFORSIZE { $$ = FN_NOTE_OptimizeForSize; }
|
||||
;
|
||||
|
||||
OptFuncNotes : /* empty */ { $$ = FP_None; }
|
||||
OptFuncNotes : /* empty */ { $$ = FN_NOTE_None; }
|
||||
| FNNOTE '(' FuncNoteList ')' {
|
||||
$$ = $3;
|
||||
}
|
||||
|
@ -142,9 +142,9 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
|
||||
|
||||
Function *Fn = CS.getCalledFunction();
|
||||
bool AlwaysInline = false;
|
||||
if (Fn && (Fn->getNotes() & FP_AlwaysInline))
|
||||
if (Fn && (Fn->getNotes() & FN_NOTE_AlwaysInline))
|
||||
AlwaysInline = true;
|
||||
if (Fn && (Fn->getNotes() & FP_NoInline))
|
||||
if (Fn && (Fn->getNotes() & FN_NOTE_NoInline))
|
||||
DOUT << "NOT Inlining: inline=never is set" << *CS.getInstruction();
|
||||
else if (!AlwaysInline
|
||||
&& InlineCost >= (int)(InlineThreshold * FudgeFactor)) {
|
||||
|
@ -1396,11 +1396,11 @@ void AssemblyWriter::printFunction(const Function *F) {
|
||||
if (F->hasGC())
|
||||
Out << " gc \"" << F->getGC() << '"';
|
||||
FunctionNotes FNotes = F->getNotes();
|
||||
if (FNotes != FP_None) {
|
||||
if (FNotes != FN_NOTE_None) {
|
||||
Out << " notes(";
|
||||
if (FNotes & FP_AlwaysInline)
|
||||
if (FNotes & FN_NOTE_AlwaysInline)
|
||||
Out << "inline=always";
|
||||
else if (FNotes & FP_NoInline)
|
||||
else if (FNotes & FN_NOTE_NoInline)
|
||||
Out << "inline=never";
|
||||
Out << ")";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user