Fix broken isCopy handling in TrimLiveIntervalToLastUse.
[oota-llvm.git] / lib / VMCore / Function.cpp
index b55a371d6900a2c2ce969b1210e86690c001c1ee..8f94efc6673a8cab23a28db256e410c97fea5327 100644 (file)
@@ -408,7 +408,7 @@ bool Function::hasAddressTaken(const User* *PutOffender) const {
     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;
   }