Implement function notes as function attributes. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs
index a049cea..fa86c18 100644
--- a/lib/AsmParser/llvmAsmParser.y.cvs
+++ b/lib/AsmParser/llvmAsmParser.y.cvs
@@ -1089,8 +1089,6 @@
 %type <UIntVal> OptCallingConv LocalNumber
 %type <Attributes> OptAttributes Attribute
 %type <Attributes> OptFuncAttrs  FuncAttr
-%type <Attributes> OptFuncNotes FuncNote
-%type <Attributes> FuncNoteList
 
 // Basic Block Terminating Operators
 %token <TermOpVal> RET BR SWITCH INVOKE UNWIND UNREACHABLE
@@ -1122,10 +1120,7 @@
 
 // Function Attributes
 %token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST
-%token READNONE READONLY GC
-
-// Function Notes
-%token FNNOTE INLINE ALWAYS NEVER OPTIMIZEFORSIZE
+%token READNONE READONLY GC OPTSIZE NOINLINE ALWAYSINLINE
 
 // Visibility Styles
 %token DEFAULT HIDDEN PROTECTED
@@ -1284,6 +1279,9 @@
               | SIGNEXT  { $$ = Attribute::SExt;     }
               | READNONE { $$ = Attribute::ReadNone; }
               | READONLY { $$ = Attribute::ReadOnly; }
+              | NOINLINE { $$ = Attribute::NoInline }
+              | ALWAYSINLINE { $$ = Attribute::AlwaysInline }
+              | OPTSIZE { $$ = Attribute::OptimizeForSize }
               ;
 
 OptFuncAttrs  : /* empty */ { $$ = Attribute::None; }
@@ -1292,31 +1290,6 @@
               }
               ;
 
-FuncNoteList  : FuncNote { $$ = $1; }
-              | FuncNoteList ',' FuncNote {
-                unsigned tmp = $1 | $3;
-                if ($3 == Attribute::NoInline
-                    && ($1 & Attribute::AlwaysInline))
-                  GEN_ERROR("Function Notes may include only one inline notes!")
-                    if ($3 == Attribute::AlwaysInline
-                        && ($1 & Attribute::NoInline))
-                  GEN_ERROR("Function Notes may include only one inline notes!")
-                $$ = tmp;
-                CHECK_FOR_ERROR
-              }
-              ;
-
-FuncNote      : INLINE '=' NEVER { $$ = Attribute::NoInline; }
-              | INLINE '=' ALWAYS { $$ = Attribute::AlwaysInline; }
-              | OPTIMIZEFORSIZE { $$ = Attribute::OptimizeForSize; }
-              ;
-
-OptFuncNotes  : /* empty */ { $$ = Attribute::None; }
-              | FNNOTE '(' FuncNoteList  ')' {
-                $$ =  $3;
-              }
-              ;
-
 OptGC         : /* empty */ { $$ = 0; }
               | GC STRINGCONSTANT {
                 $$ = $2;
@@ -2332,7 +2305,7 @@
   };
 
 FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
-                  OptFuncAttrs OptSection OptAlign OptGC OptFuncNotes {
+                  OptFuncAttrs OptSection OptAlign OptGC {
   std::string FunctionName(*$3);
   delete $3;  // Free strdup'd memory!
 
@@ -2453,9 +2426,6 @@
     Fn->setGC($10->c_str());
     delete $10;
   }
-  if ($11) {
-    Fn->setNotes($11);
-  }
 
   // Add all of the arguments we parsed to the function...
   if ($5) {                     // Is null if empty...