From c8b82ccbcf3b2e2384d2c0b5176e7b0b40b7f82f Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Thu, 1 Apr 2010 08:21:08 +0000 Subject: 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 --- lib/VMCore/Function.cpp | 2 +- lib/VMCore/Instructions.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/VMCore') 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(U) && !isa(U)) return PutOffender ? (*PutOffender = U, true) : true; - CallSite CS(const_cast(static_cast(U))); + ImmutableCallSite CS(cast(U)); if (!CS.isCallee(I)) return PutOffender ? (*PutOffender = U, true) : true; } diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 11e218c..4609a64 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -43,11 +43,6 @@ using namespace llvm; else \ cast(II)->METHOD -CallSite::CallSite(Instruction *C) { - assert((isa(C) || isa(C)) && "Not a call!"); - I.setPointer(C); - I.setInt(isa(C)); -} CallingConv::ID CallSite::getCallingConv() const { CALLSITE_DELEGATE_GETTER(getCallingConv()); } -- cgit v1.1