[IR] Refactor attribute methods in Function class (NFC)

Rename the functions that query the optimization kind attributes.

Differential revision: https://reviews.llvm.org/D60287

llvm-svn: 357731
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp
index fc110c6..6de72bb 100644
--- a/llvm/lib/CodeGen/SafeStack.cpp
+++ b/llvm/lib/CodeGen/SafeStack.cpp
@@ -728,7 +728,7 @@
   if (!isa<CallInst>(UnsafeStackPtr))
     return;
 
-  if(F.optForNone())
+  if(F.hasOptNone())
     return;
 
   CallSite CS(UnsafeStackPtr);