s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
authorDevang Patel <dpatel@apple.com>
Tue, 2 Sep 2008 22:43:57 +0000 (22:43 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 2 Sep 2008 22:43:57 +0000 (22:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Function.h
lib/AsmParser/llvmAsmParser.cpp.cvs
lib/AsmParser/llvmAsmParser.y
lib/AsmParser/llvmAsmParser.y.cvs
lib/Transforms/IPO/Inliner.cpp
lib/VMCore/AsmWriter.cpp

index 58edab480ac46f64209396b2f5e277b31e2a4afd..d47746d161004341d09174b46aa00b5e1800658a 100644 (file)
@@ -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.
index 45a57998b74eaeda67f3f26aa0713fe9c51e1fc9..80d105908585da86ca4d1841d34513d45ef5c4f2 100644 (file)
@@ -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:
index d004a4e399f57aa32c98eb392849dbe1a6ec0c46..5db76429b513a50d9157f2e8a592aa23a0e2f8b3 100644 (file)
@@ -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;
               }
index d004a4e399f57aa32c98eb392849dbe1a6ec0c46..5db76429b513a50d9157f2e8a592aa23a0e2f8b3 100644 (file)
@@ -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;
               }
index e9ae21f79517e4ed167ea4ed4998033f6b6632ea..845ffd864e3f05813f2d4460d872c69c26c66d18 100644 (file)
@@ -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)) {
index 724b34f460e80dd2462e8fc2f453b10a78138e18..b518b2c177c4fab6e0e042b3392951b6d3cca3c5 100644 (file)
@@ -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 << ")";
   }