[llvm-branch-commits] [llvm-branch] r100005 - in /llvm/branches/ggreif/const-CallSite/lib: Transforms/IPO/DeadArgumentElimination.cpp Transforms/Scalar/SCCP.cpp VMCore/Function.cpp
Gabor Greif
ggreif at gmail.com
Wed Mar 31 05:22:21 PDT 2010
Author: ggreif
Date: Wed Mar 31 07:22:21 2010
New Revision: 100005
URL: http://llvm.org/viewvc/llvm-project?rev=100005&view=rev
Log:
use ImmutableCallSite (plus some 80-col fixes)
Modified:
llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp
llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp
llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp
Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=100005&r1=100004&r2=100005&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed Mar 31 07:22:21 2010
@@ -310,8 +310,8 @@
/// RetValNum is the return value number to use when this use is used in a
/// return instruction. This is used in the recursion, you should always leave
/// it at 0.
-DAE::Liveness DAE::SurveyUse(Value::const_use_iterator U, UseVector &MaybeLiveUses,
- unsigned RetValNum) {
+DAE::Liveness DAE::SurveyUse(Value::const_use_iterator U,
+ UseVector &MaybeLiveUses, unsigned RetValNum) {
const User *V = *U;
if (const ReturnInst *RI = dyn_cast<ReturnInst>(V)) {
// The value is returned from a function. It's only live when the
@@ -343,7 +343,7 @@
return Result;
}
- if (CallSiteBase<> CS = V) {
+ if (ImmutableCallSite CS = V) {
const Function *F = CS.getCalledFunction();
if (F) {
// Used in a direct call.
@@ -431,10 +431,11 @@
unsigned NumLiveRetVals = 0;
const Type *STy = dyn_cast<StructType>(F.getReturnType());
// Loop all uses of the function.
- for (Value::const_use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
+ for (Value::const_use_iterator I = F.use_begin(), E = F.use_end();
+ I != E; ++I) {
// If the function is PASSED IN as an argument, its address has been
// taken.
- CallSiteBase<> CS(*I);
+ ImmutableCallSite CS(*I);
if (!CS || !CS.isCallee(I)) {
MarkLive(F);
return;
@@ -690,7 +691,8 @@
AttributesVec.push_back(AttributeWithIndex::get(~0, FnAttrs));
// Reconstruct the AttributesList based on the vector we constructed.
- AttrListPtr NewPAL = AttrListPtr::get(AttributesVec.begin(), AttributesVec.end());
+ AttrListPtr NewPAL = AttrListPtr::get(AttributesVec.begin(),
+ AttributesVec.end());
// Work around LLVM bug PR56: the CWriter cannot emit varargs functions which
// have zero fixed arguments.
Modified: llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp?rev=100005&r1=100004&r2=100005&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/Transforms/Scalar/SCCP.cpp Wed Mar 31 07:22:21 2010
@@ -1717,7 +1717,7 @@
return true; // Storing addr of GV.
} else if (isa<InvokeInst>(U) || isa<CallInst>(U)) {
// Make sure we are calling the function, not passing the address.
- CallSiteBase<> CS(static_cast<const Instruction*>(U));
+ ImmutableCallSite CS(cast<Instruction>(U));
if (!CS.isCallee(UI))
return true;
} else if (const LoadInst *LI = dyn_cast<LoadInst>(U)) {
Modified: llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp?rev=100005&r1=100004&r2=100005&view=diff
==============================================================================
--- llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp (original)
+++ llvm/branches/ggreif/const-CallSite/lib/VMCore/Function.cpp Wed Mar 31 07:22:21 2010
@@ -408,7 +408,7 @@
const User *U = *I;
if (!isa<CallInst>(U) && !isa<InvokeInst>(U))
return PutOffender ? (*PutOffender = U, true) : true;
- CallSiteBase<> CS(static_cast<const Instruction*>(U));
+ ImmutableCallSite CS(cast<Instruction>(U));
if (!CS.isCallee(I))
return PutOffender ? (*PutOffender = U, true) : true;
}
More information about the llvm-branch-commits
mailing list