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/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp
index 448f246..1079c4a 100644
--- a/lib/Transforms/IPO/InlineAlways.cpp
+++ b/lib/Transforms/IPO/InlineAlways.cpp
@@ -63,7 +63,7 @@
   
   for (Module::iterator I = M.begin(), E = M.end();
        I != E; ++I)
-    if (!I->isDeclaration() && !I->hasNote(Attribute::AlwaysInline))
+    if (!I->isDeclaration() && !I->hasFnAttr(Attribute::AlwaysInline))
       NeverInline.insert(I);
 
   return false;
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index b19494a..02cae2a 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -65,7 +65,7 @@
   
   for (Module::iterator I = M.begin(), E = M.end();
        I != E; ++I)
-    if (!I->isDeclaration() && I->hasNote(Attribute::NoInline))
+    if (!I->isDeclaration() && I->hasFnAttr(Attribute::NoInline))
       NeverInline.insert(I);
 
   // Get llvm.noinline
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index abc1094..c267272 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -141,7 +141,8 @@
         
         int CurrentThreshold = InlineThreshold;
         Function *Fn = CS.getCaller();
-        if (Fn && !Fn->isDeclaration() && Fn->hasNote(Attribute::OptimizeForSize)
+        if (Fn && !Fn->isDeclaration() 
+            && Fn->hasFnAttr(Attribute::OptimizeForSize)
             && InlineThreshold != 50) {
           CurrentThreshold = 50;
         }
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 15eaa78..fbfe297 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -430,7 +430,7 @@
   Function *F = loopHeader->getParent();
 
   // Do not unswitch if the function is optimized for size.
-  if (!F->isDeclaration() && F->hasNote(Attribute::OptimizeForSize))
+  if (!F->isDeclaration() && F->hasFnAttr(Attribute::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 55755c1..d0b5185 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -222,7 +222,7 @@
   if (CalleeFI.NeverInline)
     return 2000000000;
 
-  if (!Callee->isDeclaration() && Callee->hasNote(Attribute::AlwaysInline))
+  if (!Callee->isDeclaration() && Callee->hasFnAttr(Attribute::AlwaysInline))
     return -2000000000;
     
   // Add to the inline quality for properties that make the call valuable to