aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/ConstantsScanner.h8
-rw-r--r--include/llvm/Analysis/Expressions.h12
-rw-r--r--include/llvm/Analysis/InstForest.h12
-rw-r--r--include/llvm/Analysis/ModuleAnalyzer.h1
-rw-r--r--include/llvm/Assembly/CachedWriter.h2
-rw-r--r--include/llvm/Assembly/Writer.h6
-rw-r--r--include/llvm/BasicBlock.h10
-rw-r--r--include/llvm/CodeGen/InstrForest.h6
-rw-r--r--include/llvm/CodeGen/InstrSelection.h1
-rw-r--r--include/llvm/CodeGen/InstrSelectionSupport.h4
-rw-r--r--include/llvm/CodeGen/MachineInstr.h6
-rw-r--r--include/llvm/ConstantHandling.h106
-rw-r--r--include/llvm/Constants.h (renamed from include/llvm/ConstPoolVals.h)218
-rw-r--r--include/llvm/GlobalVariable.h18
-rw-r--r--include/llvm/Module.h12
-rw-r--r--include/llvm/SymbolTable.h4
-rw-r--r--include/llvm/Target/MachineInstrInfo.h2
-rw-r--r--include/llvm/Target/TargetData.h2
-rw-r--r--include/llvm/Target/TargetInstrInfo.h2
-rw-r--r--include/llvm/Transforms/IPO/ConstantMerge.h4
-rw-r--r--include/llvm/Value.h8
-rw-r--r--include/llvm/iMemory.h2
-rw-r--r--include/llvm/iTerminators.h12
-rw-r--r--lib/Analysis/Expressions.cpp82
-rw-r--r--lib/Analysis/InductionVariable.cpp16
-rw-r--r--lib/Analysis/LiveVar/ValueSet.cpp6
-rw-r--r--lib/Analysis/ModuleAnalyzer.cpp1
-rw-r--r--lib/AsmParser/ParserInternals.h2
-rw-r--r--lib/AsmParser/llvmAsmParser.y78
-rw-r--r--lib/Bytecode/Reader/ConstantReader.cpp57
-rw-r--r--lib/Bytecode/Reader/InstructionReader.cpp2
-rw-r--r--lib/Bytecode/Reader/Reader.cpp14
-rw-r--r--lib/Bytecode/Reader/ReaderInternals.h6
-rw-r--r--lib/Bytecode/Writer/ConstantWriter.cpp30
-rw-r--r--lib/Bytecode/Writer/SlotCalculator.cpp12
-rw-r--r--lib/Bytecode/Writer/Writer.cpp8
-rw-r--r--lib/Bytecode/Writer/WriterInternals.h2
-rw-r--r--lib/CodeGen/InstrSelection/InstrForest.cpp6
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp36
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp75
-rw-r--r--lib/Linker/LinkModules.cpp32
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrForest.cpp6
-rw-r--r--lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp36
-rw-r--r--lib/Target/SparcV9/LiveVar/ValueSet.cpp6
-rw-r--r--lib/Target/SparcV9/SparcV9AsmPrinter.cpp70
-rw-r--r--lib/Target/SparcV9/SparcV9InstrInfo.cpp10
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp61
-rw-r--r--lib/Target/TargetData.cpp6
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp31
-rw-r--r--lib/Transforms/HoistPHIConstants.cpp39
-rw-r--r--lib/Transforms/IPO/ConstantMerge.cpp8
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp8
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp2
-rw-r--r--lib/Transforms/IPO/MutateStructTypes.cpp10
-rw-r--r--lib/Transforms/Instrumentation/TraceValues.cpp4
-rw-r--r--lib/Transforms/LevelRaise.cpp9
-rw-r--r--lib/Transforms/Scalar/ConstantProp.cpp24
-rw-r--r--lib/Transforms/Scalar/DCE.cpp6
-rw-r--r--lib/Transforms/Scalar/InductionVars.cpp20
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp46
-rw-r--r--lib/Transforms/Scalar/SymbolStripping.cpp2
-rw-r--r--lib/Transforms/TransformInternals.cpp10
-rw-r--r--lib/Transforms/TransformInternals.h8
-rw-r--r--lib/Transforms/Utils/Linker.cpp32
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp4
-rw-r--r--lib/VMCore/AsmWriter.cpp16
-rw-r--r--lib/VMCore/BasicBlock.cpp6
-rw-r--r--lib/VMCore/ConstPoolVals.cpp234
-rw-r--r--lib/VMCore/ConstantFold.cpp236
-rw-r--r--lib/VMCore/ConstantFold.h106
-rw-r--r--lib/VMCore/ConstantFolding.h106
-rw-r--r--lib/VMCore/Function.cpp6
-rw-r--r--lib/VMCore/Linker.cpp32
-rw-r--r--lib/VMCore/Module.cpp16
-rw-r--r--lib/VMCore/SlotCalculator.cpp12
-rw-r--r--lib/VMCore/SymbolTable.cpp6
-rw-r--r--lib/VMCore/Type.cpp8
-rw-r--r--lib/VMCore/Value.cpp1
-rw-r--r--lib/VMCore/iMemory.cpp12
-rw-r--r--lib/VMCore/iSwitch.cpp2
80 files changed, 1082 insertions, 1098 deletions
diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h
index 4c86834d21..ebe85e8e7d 100644
--- a/include/llvm/Analysis/ConstantsScanner.h
+++ b/include/llvm/Analysis/ConstantsScanner.h
@@ -12,10 +12,10 @@
#include "llvm/Method.h"
#include "llvm/Instruction.h"
#include <iterator>
-class ConstPoolVal;
+class Constant;
class constant_iterator
- : public std::forward_iterator<const ConstPoolVal, ptrdiff_t> {
+ : public std::forward_iterator<const Constant, ptrdiff_t> {
Method::inst_const_iterator InstI; // Method instruction iterator
unsigned OpIdx; // Operand index
@@ -24,7 +24,7 @@ class constant_iterator
inline bool isAtConstant() const {
assert(!InstI.atEnd() && OpIdx < InstI->getNumOperands() &&
"isAtConstant called with invalid arguments!");
- return isa<ConstPoolVal>(InstI->getOperand(OpIdx));
+ return isa<Constant>(InstI->getOperand(OpIdx));
}
public:
@@ -45,7 +45,7 @@ public:
inline pointer operator*() const {
assert(isAtConstant() && "Dereferenced an iterator at the end!");
- return cast<ConstPoolVal>(InstI->getOperand(OpIdx));
+ return cast<Constant>(InstI->getOperand(OpIdx));
}
inline pointer operator->() const { return operator*(); }
diff --git a/include/llvm/Analysis/Expressions.h b/include/llvm/Analysis/Expressions.h
index 9ddd5863b5..f64f8f14f8 100644
--- a/include/llvm/Analysis/Expressions.h
+++ b/include/llvm/Analysis/Expressions.h
@@ -13,7 +13,7 @@
#include <assert.h>
class Type;
class Value;
-class ConstPoolInt;
+class ConstantInt;
namespace analysis {
@@ -35,16 +35,16 @@ struct ExprType {
ScaledLinear, // Expr is scaled linear exp, Value is Scale*Var+Offset
} ExprTy;
- const ConstPoolInt *Offset; // Offset of expr, or null if 0
- Value *Var; // Var referenced, if Linear or above (null if 0)
- const ConstPoolInt *Scale; // Scale of var if ScaledLinear expr (null if 1)
+ const ConstantInt *Offset; // Offset of expr, or null if 0
+ Value *Var; // Var referenced, if Linear or above (null if 0)
+ const ConstantInt *Scale; // Scale of var if ScaledLinear expr (null if 1)
- inline ExprType(const ConstPoolInt *CPV = 0) {
+ inline ExprType(const ConstantInt *CPV = 0) {
Offset = CPV; Var = 0; Scale = 0;
ExprTy = Constant;
}
ExprType(Value *Val); // Create a linear or constant expression
- ExprType(const ConstPoolInt *scale, Value *var, const ConstPoolInt *offset);
+ ExprType(const ConstantInt *scale, Value *var, const ConstantInt *offset);
// If this expression has an intrinsic type, return it. If it is zero, return
// the specified type.
diff --git a/include/llvm/Analysis/InstForest.h b/include/llvm/Analysis/InstForest.h
index 497bb46188..e8ab0aae08 100644
--- a/include/llvm/Analysis/InstForest.h
+++ b/include/llvm/Analysis/InstForest.h
@@ -73,11 +73,11 @@ public:
inline bool isTemporary() const { return getNodeType() == TemporaryNode; }
// Accessors for different node types...
- inline ConstPoolVal *getConstant() {
- return cast<ConstPoolVal>(getValue());
+ inline Constant *getConstant() {
+ return cast<Constant>(getValue());
}
- inline const ConstPoolVal *getConstant() const {
- return cast<const ConstPoolVal>(getValue());
+ inline const Constant *getConstant() const {
+ return cast<const Constant>(getValue());
}
inline BasicBlock *getBasicBlock() {
return cast<BasicBlock>(getValue());
@@ -230,10 +230,10 @@ InstTreeNode<Payload>::InstTreeNode(InstForest<Payload> &IF, Value *V,
getTreeData().first.first = V; // Save tree node
if (!isa<Instruction>(V)) {
- assert((isa<ConstPoolVal>(V) || isa<BasicBlock>(V) ||
+ assert((isa<Constant>(V) || isa<BasicBlock>(V) ||
isa<MethodArgument>(V) || isa<GlobalVariable>(V)) &&
"Unrecognized value type for InstForest Partition!");
- if (isa<ConstPoolVal>(V))
+ if (isa<Constant>(V))
getTreeData().first.second = ConstNode;
else if (isa<BasicBlock>(V))
getTreeData().first.second = BasicBlockNode;
diff --git a/include/llvm/Analysis/ModuleAnalyzer.h b/include/llvm/Analysis/ModuleAnalyzer.h
index ecda28ed72..a0baa8a7dd 100644
--- a/include/llvm/Analysis/ModuleAnalyzer.h
+++ b/include/llvm/Analysis/ModuleAnalyzer.h
@@ -16,7 +16,6 @@ class Module;
class Method;
class BasicBlock;
class Instruction;
-class ConstPoolVal;
class MethodType;
class MethodArgument;
diff --git a/include/llvm/Assembly/CachedWriter.h b/include/llvm/Assembly/CachedWriter.h
index af1b246fa6..b5171b4097 100644
--- a/include/llvm/Assembly/CachedWriter.h
+++ b/include/llvm/Assembly/CachedWriter.h
@@ -53,7 +53,7 @@ public:
inline CachedWriter &operator<<(const Instruction *X) {
return *this << (const Value*)X;
}
- inline CachedWriter &operator<<(const ConstPoolVal *X) {
+ inline CachedWriter &operator<<(const Constant *X) {
return *this << (const Value*)X;
}
inline CachedWriter &operator<<(const Type *X) {
diff --git a/include/llvm/Assembly/Writer.h b/include/llvm/Assembly/Writer.h
index 1db5cd3689..02c9fd0cc1 100644
--- a/include/llvm/Assembly/Writer.h
+++ b/include/llvm/Assembly/Writer.h
@@ -35,7 +35,7 @@ void WriteToAssembly(const GlobalVariable *G, ostream &o);
void WriteToAssembly(const Method *Method, ostream &o);
void WriteToAssembly(const BasicBlock *BB, ostream &o);
void WriteToAssembly(const Instruction *In, ostream &o);
-void WriteToAssembly(const ConstPoolVal *V, ostream &o);
+void WriteToAssembly(const Constant *V, ostream &o);
// WriteTypeSymbolic - This attempts to write the specified type as a symbolic
// type, iff there is an entry in the modules symbol table for the specified
@@ -86,7 +86,7 @@ inline ostream &operator<<(ostream &o, const Instruction *I) {
WriteToAssembly(I, o); return o;
}
-inline ostream &operator<<(ostream &o, const ConstPoolVal *I) {
+inline ostream &operator<<(ostream &o, const Constant *I) {
WriteToAssembly(I, o); return o;
}
@@ -99,7 +99,7 @@ inline ostream &operator<<(ostream &o, const Type *T) {
inline ostream &operator<<(ostream &o, const Value *I) {
switch (I->getValueType()) {
case Value::TypeVal: return o << cast<const Type>(I);
- case Value::ConstantVal: WriteToAssembly(cast<ConstPoolVal>(I) , o); break;
+ case Value::ConstantVal: WriteToAssembly(cast<Constant>(I) , o); break;
case Value::MethodArgumentVal: return o << I->getType() << " "<< I->getName();
case Value::InstructionVal:WriteToAssembly(cast<Instruction>(I) , o); break;
case Value::BasicBlockVal: WriteToAssembly(cast<BasicBlock>(I) , o); break;
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index df9447fb09..50de364f3e 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -115,12 +115,12 @@ public:
return V->getValueType() == Value::BasicBlockVal;
}
- // hasConstantPoolReferences() - This predicate is true if there is a
+ // hasConstantReferences() - This predicate is true if there is a
// reference to this basic block in the constant pool for this method. For
// example, if a block is reached through a switch table, that table resides
// in the constant pool, and the basic block is reference from it.
//
- bool hasConstantPoolReferences() const;
+ bool hasConstantReferences() const;
// dropAllReferences() - This function causes all the subinstructions to "let
// go" of all references that they are maintaining. This allows one to
@@ -165,7 +165,7 @@ public:
public:
typedef PredIterator<_Ptr,_USE_iterator> _Self;
- inline void advancePastConstPool() {
+ inline void advancePastConstants() {
// TODO: This is bad
// Loop to ignore constant pool references
while (It != BB->use_end() && !isa<TerminatorInst>(*It))
@@ -173,7 +173,7 @@ public:
}
inline PredIterator(_Ptr *bb) : BB(bb), It(bb->use_begin()) {
- advancePastConstPool();
+ advancePastConstants();
}
inline PredIterator(_Ptr *bb, bool) : BB(bb), It(bb->use_end()) {}
@@ -186,7 +186,7 @@ public:
inline pointer *operator->() const { return &(operator*()); }
inline _Self& operator++() { // Preincrement
- ++It; advancePastConstPool();
+ ++It; advancePastConstants();
return *this;
}
diff --git a/include/llvm/CodeGen/InstrForest.h b/include/llvm/CodeGen/InstrForest.h
index e7bd3ad145..aa101f934d 100644
--- a/include/llvm/CodeGen/InstrForest.h
+++ b/include/llvm/CodeGen/InstrForest.h
@@ -30,7 +30,7 @@
#include <hash_map>
#include <hash_set>
-class ConstPoolVal;
+class Constant;
class BasicBlock;
class Method;
class InstrTreeNode;
@@ -205,11 +205,11 @@ protected:
class ConstantNode : public InstrTreeNode {
public:
- ConstantNode(ConstPoolVal *constVal)
+ ConstantNode(Constant *constVal)
: InstrTreeNode(NTConstNode, (Value*)constVal) {
opLabel = ConstantNodeOp;
}
- ConstPoolVal *getConstVal() const { return (ConstPoolVal*) val;}
+ Constant *getConstVal() const { return (Constant*) val;}
protected:
virtual void dumpNode(int indent) const;
};
diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h
index 1f68e38dd5..27e3ebe553 100644
--- a/include/llvm/CodeGen/InstrSelection.h
+++ b/include/llvm/CodeGen/InstrSelection.h
@@ -19,7 +19,6 @@ class InstrForest;
class MachineInstr;
class InstructionNode;
class TmpInstruction;
-class ConstPoolVal;
class TargetMachine;
diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h
index 7d11e206b5..90b3af713d 100644
--- a/include/llvm/CodeGen/InstrSelectionSupport.h
+++ b/include/llvm/CodeGen/InstrSelectionSupport.h
@@ -21,7 +21,7 @@ class InstrForest;
class MachineInstr;
class InstructionNode;
class TmpInstruction;
-class ConstPoolVal;
+class Constant;
class TargetMachine;
//************************ Exported Functions ******************************/
@@ -54,7 +54,7 @@ int64_t GetConstantValueAsSignedInt (const Value *V,
//---------------------------------------------------------------------------
Value* FoldGetElemChain (const InstructionNode* getElemInstrNode,
- vector<ConstPoolVal*>& chainIdxVec);
+ vector<Constant*>& chainIdxVec);
//------------------------------------------------------------------------
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index a20431848e..7c347a43ca 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -529,7 +529,7 @@ private:
unsigned currentOptionalArgsSize;
unsigned maxOptionalArgsSize;
unsigned currentTmpValuesSize;
- hash_set<const ConstPoolVal*> constantsForConstPool;
+ hash_set<const Constant*> constantsForConstPool;
hash_map<const Value*, int> offsets;
// hash_map<const Value*, int> offsetsFromSP;
@@ -572,7 +572,7 @@ public:
inline unsigned getMaxOptionalArgsSize() const { return maxOptionalArgsSize;}
inline unsigned getCurrentOptionalArgsSize() const
{ return currentOptionalArg