From 43ea505fb07e303721d92f2b2bdda6e601868523 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 18 Dec 2009 23:42:08 +0000 Subject: [PATCH] Eliminate unnecessary LLVMContexts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91729 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/SparsePropagation.h | 7 ++----- include/llvm/Analysis/ValueTracking.h | 1 - include/llvm/Transforms/Utils/Cloning.h | 1 - include/llvm/Transforms/Utils/Local.h | 1 - lib/Analysis/SparsePropagation.cpp | 3 +-- 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/include/llvm/Analysis/SparsePropagation.h b/include/llvm/Analysis/SparsePropagation.h index 677d41d80b2..c3c2f4b0668 100644 --- a/include/llvm/Analysis/SparsePropagation.h +++ b/include/llvm/Analysis/SparsePropagation.h @@ -30,7 +30,6 @@ namespace llvm { class BasicBlock; class Function; class SparseSolver; - class LLVMContext; class raw_ostream; template class SmallVectorImpl; @@ -120,8 +119,6 @@ class SparseSolver { /// compute transfer functions. AbstractLatticeFunction *LatticeFunc; - LLVMContext *Context; - DenseMap ValueState; // The state each value is in. SmallPtrSet BBExecutable; // The bbs that are executable. @@ -137,8 +134,8 @@ class SparseSolver { SparseSolver(const SparseSolver&); // DO NOT IMPLEMENT void operator=(const SparseSolver&); // DO NOT IMPLEMENT public: - explicit SparseSolver(AbstractLatticeFunction *Lattice, LLVMContext *C) - : LatticeFunc(Lattice), Context(C) {} + explicit SparseSolver(AbstractLatticeFunction *Lattice) + : LatticeFunc(Lattice) {} ~SparseSolver() { delete LatticeFunc; } diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h index 5f3c671d0f4..7c673c3c2fb 100644 --- a/include/llvm/Analysis/ValueTracking.h +++ b/include/llvm/Analysis/ValueTracking.h @@ -24,7 +24,6 @@ namespace llvm { class Instruction; class APInt; class TargetData; - class LLVMContext; /// ComputeMaskedBits - Determine which of the bits specified in Mask are /// known to be either zero or one and return them in the KnownZero/KnownOne diff --git a/include/llvm/Transforms/Utils/Cloning.h b/include/llvm/Transforms/Utils/Cloning.h index e9099f878b3..7fbbef9c342 100644 --- a/include/llvm/Transforms/Utils/Cloning.h +++ b/include/llvm/Transforms/Utils/Cloning.h @@ -38,7 +38,6 @@ class CallGraph; class TargetData; class Loop; class LoopInfo; -class LLVMContext; class AllocaInst; template class SmallVectorImpl; diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index e6687bb2489..2cdd31fb14d 100644 --- a/include/llvm/Transforms/Utils/Local.h +++ b/include/llvm/Transforms/Utils/Local.h @@ -27,7 +27,6 @@ class PHINode; class AllocaInst; class ConstantExpr; class TargetData; -class LLVMContext; struct DbgInfoIntrinsic; template class SmallVectorImpl; diff --git a/lib/Analysis/SparsePropagation.cpp b/lib/Analysis/SparsePropagation.cpp index d7bcac2b1e2..487bdad6dc3 100644 --- a/lib/Analysis/SparsePropagation.cpp +++ b/lib/Analysis/SparsePropagation.cpp @@ -17,7 +17,6 @@ #include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -155,7 +154,7 @@ void SparseSolver::getFeasibleSuccessors(TerminatorInst &TI, } // Constant condition variables mean the branch can only go a single way - Succs[C == ConstantInt::getFalse(*Context)] = true; + Succs[C->isNullValue()] = true; return; } -- 2.34.1