Don't dereference begin() on an empty vector.
[oota-llvm.git] / lib / Analysis / CodeMetrics.cpp
index acda34ba14b50d07501097a14e13a5dbb4f112dc..9a1ca63c1cf10ef7e3b7a3e71012cecb4b602459 100644 (file)
@@ -196,7 +196,7 @@ void CodeMetrics::analyzeFunction(Function *F, const TargetData *TD) {
   // as volatile if they are live across a setjmp call, and they probably
   // won't do this in callers.
   exposesReturnsTwice = F->callsFunctionThatReturnsTwice() &&
-    !F->hasFnAttr(Attribute::ReturnsTwice);
+    !F->getFnAttributes().hasReturnsTwiceAttr();
 
   // Look at the size of the callee.
   for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)