Fix broken isCopy handling in TrimLiveIntervalToLastUse.
[oota-llvm.git] / lib / VMCore / Function.cpp
index 575381e03035998128e0fa05b5da2a36fb380384..8f94efc6673a8cab23a28db256e410c97fea5327 100644 (file)
@@ -404,11 +404,11 @@ Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
 /// hasAddressTaken - returns true if there are any uses of this function
 /// other than direct calls or invokes to it.
 bool Function::hasAddressTaken(const User* *PutOffender) const {
-  for (Value::use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
+  for (Value::const_use_iterator I = use_begin(), E = use_end(); I != E; ++I) {
     const User *U = *I;
     if (!isa<CallInst>(U) && !isa<InvokeInst>(U))
       return PutOffender ? (*PutOffender = U, true) : true;
-    CallSite CS(const_cast<Instruction*>(static_cast<const Instruction*>(U)));
+    ImmutableCallSite CS(cast<Instruction>(U));
     if (!CS.isCallee(I))
       return PutOffender ? (*PutOffender = U, true) : true;
   }