summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-01 08:21:08 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-01 08:21:08 +0000
commitc8b82ccbcf3b2e2384d2c0b5176e7b0b40b7f82f (patch)
treef83b4be77578085e4ad3be52f2979d0d7ba5d6c6 /lib/VMCore/Function.cpp
parent2d7820cb782d6f2ee74b3c9e90438229324f84cd (diff)
downloadexternal_llvm-c8b82ccbcf3b2e2384d2c0b5176e7b0b40b7f82f.zip
external_llvm-c8b82ccbcf3b2e2384d2c0b5176e7b0b40b7f82f.tar.gz
external_llvm-c8b82ccbcf3b2e2384d2c0b5176e7b0b40b7f82f.tar.bz2
Introduce ImmutableCallSite, useful for contexts where no mutation
is necessary. Inherits from new templated baseclass CallSiteBase<> which is highly customizable. Base CallSite on it too, in a configuration that allows full mutation. Adapt some call sites in analyses to employ ImmutableCallSite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index b55a371..8f94efc 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -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;
}