summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-12-03 22:26:30 +0000
committerChris Lattner <sabre@nondot.org>2001-12-03 22:26:30 +0000
commite9bb2df410f7a22decad9a883f7139d5857c1520 (patch)
treef6ca07fb5f5de1df8a2572142a707f56bf25c6e6 /include
parent9ef18310beaabe7abfa712a3c761036ea2d17caa (diff)
downloadllvm-e9bb2df410f7a22decad9a883f7139d5857c1520.tar.gz
llvm-e9bb2df410f7a22decad9a883f7139d5857c1520.tar.bz2
llvm-e9bb2df410f7a22decad9a883f7139d5857c1520.tar.xz
Rename ConstPoolVal -> Constant
Rename ConstPool* -> Constant* Rename ConstPoolVals.h -> ConstantVals.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-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
23 files changed, 228 insertions, 230 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 currentOptionalArgsSize;}
- inline const hash_set<const ConstPoolVal*>&
+ inline const hash_set<const Constant*>&
getConstantPoolValues() const {return constantsForConstPool;}
//
@@ -580,7 +580,7 @@ public:
//
void initializeFrameLayout (const TargetMachine& target);
- void addToConstantPool (const ConstPoolVal* constVal)
+ void addToConstantPool (const Constant* constVal)
{ constantsForConstPool.insert(constVal); }
inline void markAsLeafMethod() { compiledAsLeaf = true; }
diff --git a/include/llvm/ConstantHandling.h b/include/llvm/ConstantHandling.h
index 72632ee5df..bd59780ef2 100644
--- a/include/llvm/ConstantHandling.h
+++ b/include/llvm/ConstantHandling.h
@@ -5,10 +5,10 @@
//
// Unfortunately we can't overload operators on pointer types (like this:)
//
-// inline bool operator==(const ConstPoolVal *V1, const ConstPoolVal *V2)
+// inline bool operator==(const Constant *V1, const Constant *V2)
//
// so we must make due with references, even though it leads to some butt ugly
-// looking code downstream. *sigh* (ex: ConstPoolVal *Result = *V1 + *v2; )
+// looking code downstream. *sigh* (ex: Constant *Result = *V1 + *v2; )
//
//===----------------------------------------------------------------------===//
//
@@ -33,7 +33,7 @@
#ifndef LLVM_OPT_CONSTANTHANDLING_H
#define LLVM_OPT_CONSTANTHANDLING_H
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
#include "llvm/Instruction.h"
#include "llvm/Type.h"
class PointerType;
@@ -44,15 +44,15 @@ namespace opt {
// Implement == and != directly...
//===----------------------------------------------------------------------===//
-inline ConstPoolBool *operator==(const ConstPoolVal &V1,
- const ConstPoolVal &V2) {
+inline ConstantBool *operator==(const Constant &V1,
+ const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
- return ConstPoolBool::get(&V1 == &V2);
+ return ConstantBool::get(&V1 == &V2);
}
-inline ConstPoolBool *operator!=(const ConstPoolVal &V1,
- const ConstPoolVal &V2) {
- return ConstPoolBool::get(&V1 != &V2);
+inline ConstantBool *operator!=(const Constant &V1,
+ const Constant &V2) {
+ return ConstantBool::get(&V1 != &V2);
}
//===----------------------------------------------------------------------===//
@@ -66,35 +66,35 @@ public:
static AnnotationID AID; // AnnotationID for this class
// Unary Operators...
- virtual ConstPoolVal *op_not(const ConstPoolVal *V) const = 0;
+ virtual Constant *op_not(const Constant *V) const = 0;
// Binary Operators...
- virtual ConstPoolVal *add(const ConstPoolVal *V1,
- const ConstPoolVal *V2) const = 0;
- virtual ConstPoolVal *sub(const ConstPoolVal *V1,
- const ConstPoolVal *V2) const = 0;
- virtual ConstPoolVal *mul(const ConstPoolVal *V1,
- const ConstPoolVal *V2) const = 0;
+ virtual Constant *add(const Constant *V1,
+ const Constant *V2) const = 0;
+ virtual Constant *sub(const Constant *V1,
+ const Constant *V2) const = 0;
+ virtual Constant *mul(const Constant *V1,
+ const Constant *V2) const = 0;
- virtual ConstPoolBool *lessthan(const ConstPoolVal *V1,
- const ConstPoolVal *V2) const = 0;
+ virtual ConstantBool *lessthan(const Constant *V1,
+ const Constant *V2) const = 0;
// Casting operators. ick
- virtual ConstPoolBool *castToBool (const ConstPoolVal *V) const = 0;
- virtual ConstPoolSInt *castToSByte (const ConstPoolVal *V) const = 0;
- virtual ConstPoolUInt *castToUByte (const ConstPoolVal *V) const = 0;
- virtual ConstPoolSInt *castToShort (const ConstPoolVal *V) const = 0;
- virtual ConstPoolUInt *castToUShort(const ConstPoolVal *V) const = 0;
- virtual ConstPoolSInt *castToInt (const ConstPoolVal *V) const = 0;
- virtual ConstPoolUInt *castToUInt (const ConstPoolVal *V) const = 0;
- virtual ConstPoolSInt *castToLong (const ConstPoolVal *V) const = 0;
- virtual ConstPoolUInt *castToULong (const ConstPoolVal *V) const = 0;
- virtual ConstPoolFP *castToFloat (const ConstPoolVal *V) const = 0;
- virtual ConstPoolFP *castToDouble(const ConstPoolVal *V) const = 0;
- virtual ConstPoolPointer *castToPointer(const ConstPoolVal *V,
- const PointerType *Ty) const = 0;
-
- inline ConstPoolVal *castTo(const ConstPoolVal *V, const Type *Ty) const {
+ virtual ConstantBool *castToBool (const Constant *V) const = 0;
+ virtual ConstantSInt *castToSByte (const Constant *V) const = 0;
+ virtual ConstantUInt *castToUByte (const Constant *V) const = 0;
+ virtual ConstantSInt *castToShort (const Constant *V) const = 0;
+ virtual ConstantUInt *castToUShort(const Constant *V) const = 0;
+ virtual ConstantSInt *castToInt (const Constant *V) const = 0;
+ virtual ConstantUInt *castToUInt (const Constant *V) const = 0;
+ virtual ConstantSInt *castToLong (const Constant *V) const = 0;
+ virtual ConstantUInt *castToULong (const Constant *V) const = 0;
+ virtual ConstantFP *castToFloat (const Constant *V) const = 0;
+ virtual ConstantFP *castToDouble(const Constant *V) const = 0;
+ virtual ConstantPointer *castToPointer(const Constant *V,
+ const PointerType *Ty) const = 0;
+
+ inline Constant *castTo(const Constant *V, const Type *Ty) const {
switch (Ty->getPrimitiveID()) {
case Type::BoolTyID: return castToBool(V);
case Type::UByteTyID: return castToUByte(V);
@@ -116,7 +116,7 @@ public:
// we just want to make sure to hit the cache instead of doing it indirectly,
// if possible...
//
- static inline ConstRules *get(const ConstPoolVal &V) {
+ static inline ConstRules *get(const Constant &V) {
return (ConstRules*)V.getType()->getOrCreateAnnotation(AID);
}
private :
@@ -127,29 +127,29 @@ private :
};
-inline ConstPoolVal *operator!(const ConstPoolVal &V) {
+inline Constant *operator!(const Constant &V) {
return ConstRules::get(V)->op_not(&V);
}
-inline ConstPoolVal *operator+(const ConstPoolVal &V1, const ConstPoolVal &V2) {
+inline Constant *operator+(const Constant &V1, const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
return ConstRules::get(V1)->add(&V1, &V2);
}
-inline ConstPoolVal *operator-(const ConstPoolVal &V1, const ConstPoolVal &V2) {
+inline Constant *operator-(const Constant &V1, const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
return ConstRules::get(V1)->sub(&V1, &V2);
}
-inline ConstPoolVal *operator*(const ConstPoolVal &V1, const ConstPoolVal &V2) {
+inline Constant *operator*(const Constant &V1, const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
return ConstRules::get(V1)->mul(&V1, &V2);
}
-inline ConstPoolBool *operator<(const ConstPoolVal &V1,
- const ConstPoolVal &V2) {
+inline ConstantBool *operator<(const Constant &V1,
+ const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
return ConstRules::get(V1)->lessthan(&V1, &V2);
}
@@ -159,18 +159,18 @@ inline ConstPoolBool *operator<(const ConstPoolVal &V1,
// Implement 'derived' operators based on what we already have...
//===----------------------------------------------------------------------===//
-inline ConstPoolBool *operator>(const ConstPoolVal &V1,
- const ConstPoolVal &V2) {
+inline ConstantBool *operator>(const Constant &V1,
+ const Constant &V2) {
return V2 < V1;
}
-inline ConstPoolBool *operator>=(const ConstPoolVal &V1,
- const ConstPoolVal &V2) {
+inline ConstantBool *operator>=(const Constant &V1,
+ const Constant &V2) {
return (V1 < V2)->inverted(); // !(V1 < V2)
}
-inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
- const ConstPoolVal &V2) {
+inline ConstantBool *operator<=(const Constant &V1,
+ const Constant &V2) {
return (V1 > V2)->inverted(); // !(V1 > V2)
}
@@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
// Implement higher level instruction folding type instructions
//===----------------------------------------------------------------------===//
-inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V,
- const Type *DestTy) {
+inline Constant *ConstantFoldCastInstruction(const Constant *V,
+ const Type *DestTy) {
return ConstRules::get(*V)->castTo(V, DestTy);
}
-inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
- const ConstPoolVal *V) {
+inline Constant *ConstantFoldUnaryInstruction(unsigned Opcode,
+ const Constant *V) {
switch (Opcode) {
case Instruction::Not: return !*V;
// TODO: Handle get element ptr instruction here in the future? GEP null?
@@ -193,9 +193,9 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
return 0;
}
-inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
- const ConstPoolVal *V1,
- const ConstPoolVal *V2) {
+inline Constant *ConstantFoldBinaryInstruction(unsigned Opcode,
+ const Constant *V1,
+ const Constant *V2) {
switch (Opcode) {
case Instruction::Add: return *V1 + *V2;
case Instruction::Sub: return *V1 - *V2;
diff --git a/include/llvm/ConstPoolVals.h b/include/llvm/Constants.h
index c1348294c6..08fc8b369b 100644
--- a/include/llvm/ConstPoolVals.h
+++ b/include/llvm/Constants.h
@@ -1,6 +1,6 @@
-//===-- llvm/ConstPoolVals.h - Constant Value nodes --------------*- C++ -*--=//
+//===-- llvm/ConstantVals.h - Constant Value nodes ---------------*- C++ -*--=//
//
-// This file contains the declarations for the ConstPoolVal class and all of
+// This file contains the declarations for the Constant class and all of
// its subclasses, which represent the different type of constant pool values
//
//===----------------------------------------------------------------------===//
@@ -16,13 +16,13 @@ class StructType;
class PointerType;
//===----------------------------------------------------------------------===//
-// ConstPoolVal Class
+// Constant Class
//===----------------------------------------------------------------------===//
-class ConstPoolVal : public User {
+class Constant : public User {
protected:
- inline ConstPoolVal(const Type *Ty) : User(Ty, Value::ConstantVal) {}
- ~ConstPoolVal() {}
+ inline Constant(const Type *Ty) : User(Ty, Value::ConstantVal) {}
+ ~Constant() {}
// destroyConstant - Called if some element of this constant is no longer
// valid. At this point only other constants may be on the use_list for this
@@ -41,14 +41,14 @@ public:
virtual string getStrValue() const = 0;
// Static constructor to get a '0' constant of arbitrary type...
- static ConstPoolVal *getNullConstant(const Type *Ty);
+ static Constant *getNullConstant(const Type *Ty);
// isNullValue - Return true if this is the value that would be returned by
// getNullConstant.
virtual bool isNullValue() const = 0;
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolVal *) { return true; }
+ static inline bool classof(const Constant *) { return true; }
static inline bool classof(const Value *V) {
return V->getValueType() == Value::ConstantVal;
}
@@ -61,22 +61,22 @@ public:
//===----------------------------------------------------------------------===//
//===---------------------------------------------------------------------------
-// ConstPoolBool - Boolean Values
+// ConstantBool - Boolean Values
//
-class ConstPoolBool : public ConstPoolVal {
+class ConstantBool : public Constant {
bool Val;
- ConstPoolBool(const ConstPoolBool &); // DO NOT IMPLEMENT
- ConstPoolBool(bool V);
- ~ConstPoolBool() {}
+ ConstantBool(const ConstantBool &); // DO NOT IMPLEMENT
+ ConstantBool(bool V);
+ ~ConstantBool() {}
public:
- static ConstPoolBool *True, *False; // The True & False values
+ static ConstantBool *True, *False; // The True & False values
// Factory objects - Return objects of the specified value
- static ConstPoolBool *get(bool Value) { return Value ? True : False; }
- static ConstPoolBool *get(const Type *Ty, bool Value) { return get(Value); }
+ static ConstantBool *get(bool Value) { return Value ? True : False; }
+ static ConstantBool *get(const Type *Ty, bool Value) { return get(Value); }
// inverted - Return the opposite value of the current value.
- inline ConstPoolBool *inverted() const { return (this==True) ? False : True; }
+ inline ConstantBool *inverted() const { return (this==True) ? False : True; }
virtual string getStrValue() const;
inline bool getValue() const { return Val; }
@@ -86,29 +86,29 @@ public:
virtual bool isNullValue() const { return this == False; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolBool *) { return true; }
- static bool classof(const ConstPoolVal *CPV) {
+ static inline bool classof(const ConstantBool *) { return true; }
+ static bool classof(const Constant *CPV) {
return (CPV == True) | (CPV == False);
}
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolInt - Superclass of ConstPoolSInt & ConstPoolUInt, to make dealing
+// ConstantInt - Superclass of ConstantSInt & ConstantUInt, to make dealing
// with integral constants easier.
//
-class ConstPoolInt : public ConstPoolVal {
+class ConstantInt : public Constant {
protected:
union {
int64_t Signed;
uint64_t Unsigned;
} Val;
- ConstPoolInt(const ConstPoolInt &); // DO NOT IMPLEMENT
- ConstPoolInt(const Type *Ty, uint64_t V);
- ~ConstPoolInt() {}
+ ConstantInt(const ConstantInt &); // DO NOT IMPLEMENT
+ ConstantInt(const Type *Ty, uint64_t V);
+ ~ConstantInt() {}
public:
// equalsInt - Provide a helper method that can be used to determine if the
// constant contained within is equal to a constant. This only works for very
@@ -120,34 +120,34 @@ public:
return Val.Unsigned == V;
}
- // ConstPoolInt::get static method: return a constant pool int with the
+ // ConstantInt::get static method: return a constant pool int with the
// specified value. as above, we work only with very small values here.
//
- static ConstPoolInt *get(const Type *Ty, unsigned char V);
+ static ConstantInt *get(const Type *Ty, unsigned char V);
// isNullValue - Return true if this is the value that would be returned by
// getNullConstant.
virtual bool isNullValue() const { return Val.Unsigned == 0; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolInt *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantInt *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolSInt - Signed Integer Values [sbyte, short, int, long]
+// ConstantSInt - Signed Integer Values [sbyte, short, int, long]
//
-class ConstPoolSInt : public ConstPoolInt {
- ConstPoolSInt(const ConstPoolSInt &); // DO NOT IMPLEMENT
+class ConstantSInt : public ConstantInt {
+ ConstantSInt(const ConstantSInt &); // DO NOT IMPLEMENT
protected:
- ConstPoolSInt(const Type *Ty, int64_t V);
- ~ConstPoolSInt() {}
+ ConstantSInt(const Type *Ty, int64_t V);
+ ~ConstantSInt() {}
public:
- static ConstPoolSInt *get(const Type *Ty, int64_t V);
+ static ConstantSInt *get(const Type *Ty, int64_t V);
virtual string getStrValue() const;
@@ -155,23 +155,23 @@ public:
inline int64_t getValue() const { return Val.Signed; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolSInt *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantSInt *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolUInt - Unsigned Integer Values [ubyte, ushort, uint, ulong]
+// ConstantUInt - Unsigned Integer Values [ubyte, ushort, uint, ulong]
//
-class ConstPoolUInt : public ConstPoolInt {
- ConstPoolUInt(const ConstPoolUInt &); // DO NOT IMPLEMENT
+class ConstantUInt : public ConstantInt {
+ ConstantUInt(const ConstantUInt &); // DO NOT IMPLEMENT
protected:
- ConstPoolUInt(const Type *Ty, uint64_t V);
- ~ConstPoolUInt() {}
+ ConstantUInt(const Type *Ty, uint64_t V);
+ ~ConstantUInt() {}
public:
- static ConstPoolUInt *get(const Type *Ty, uint64_t V);
+ static ConstantUInt *get(const Type *Ty, uint64_t V);
virtual string getStrValue() const;
@@ -179,25 +179,25 @@ public:
inline uint64_t getValue() const { return Val.Unsigned; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolUInt *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantUInt *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolFP - Floating Point Values [float, double]
+// ConstantFP - Floating Point Values [float, double]
//
-class ConstPoolFP : public ConstPoolVal {
+class ConstantFP : public Constant {
double Val;
- ConstPoolFP(const ConstPoolFP &); // DO NOT IMPLEMENT
+ ConstantFP(const ConstantFP &); // DO NOT IMPLEMENT
protected:
- ConstPoolFP(const Type *Ty, double V);
- ~ConstPoolFP() {}
+ ConstantFP(const Type *Ty, double V);
+ ~ConstantFP() {}
public:
- static ConstPoolFP *get(const Type *Ty, double V);
+ static ConstantFP *get(const Type *Ty, double V);
virtual string getStrValue() const;
@@ -209,27 +209,27 @@ public:
virtual bool isNullValue() const { return Val == 0; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolFP *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantFP *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolArray - Constant Array Declarations
+// ConstantArray - Constant Array Declarations
//
-class ConstPoolArray : public ConstPoolVal {
- ConstPoolArray(const ConstPoolArray &); // DO NOT IMPLEMENT
+class ConstantArray : public Constant {
+ ConstantArray(const ConstantArray &); // DO NOT IMPLEMENT
protected:
- ConstPoolArray(const ArrayType *T, const vector<ConstPoolVal*> &Val);
- ~ConstPoolArray() {}
+ ConstantArray(const ArrayType *T, const vector<Constant*> &Val);
+ ~ConstantArray() {}
virtual void destroyConstant();
public:
- static ConstPoolArray *get(const ArrayType *T, const vector<ConstPoolVal*> &);
- static ConstPoolArray *get(const string &Initializer);
+ static ConstantArray *get(const ArrayType *T, const vector<Constant*> &);
+ static ConstantArray *get(const string &Initializer);
virtual string getStrValue() const;
@@ -240,27 +240,27 @@ public:
virtual bool isNullValue() const { return false; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolArray *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantArray *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolStruct - Constant Struct Declarations
+// ConstantStruct - Constant Struct Declarations
//
-class ConstPoolStruct : public ConstPoolVal {
- ConstPoolStruct(const ConstPoolStruct &); // DO NOT IMPLEMENT
+class ConstantStruct : public Constant {
+ ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT
protected:
- ConstPoolStruct(const StructType *T, const vector<ConstPoolVal*> &Val);
- ~ConstPoolStruct() {}
+ ConstantStruct(const StructType *T, const vector<Constant*> &Val);
+ ~ConstantStruct() {}
virtual void destroyConstant();
public:
- static ConstPoolStruct *get(const StructType *T,
- const vector<ConstPoolVal*> &V);
+ static ConstantStruct *get(const StructType *T,
+ const vector<Constant*> &V);
virtual string getStrValue() const;
@@ -271,25 +271,25 @@ public:
virtual bool isNullValue() const { return false; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolStruct *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantStruct *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
//===---------------------------------------------------------------------------
-// ConstPoolPointer - Constant Pointer Declarations
+// ConstantPointer - Constant Pointer Declarations
//
-// The ConstPoolPointer class represents a null pointer of a specific type. For
-// a more specific/useful instance, a subclass of ConstPoolPointer should be
+// The ConstantPointer class represents a null pointer of a specific type. For
+// a more specific/useful instance, a subclass of ConstantPointer should be
// used.
//
-class ConstPoolPointer : public ConstPoolVal {
- ConstPoolPointer(const ConstPoolPointer &); // DO NOT IMPLEMENT
+class ConstantPointer : public Constant {
+ ConstantPointer(const ConstantPointer &); // DO NOT IMPLEMENT
protected:
- inline ConstPoolPointer(const PointerType *T) : ConstPoolVal((const Type*)T){}
- ~ConstPoolPointer() {}
+ inline ConstantPointer(const PointerType *T) : Constant((const Type*)T){}
+ ~ConstantPointer() {}
public:
virtual string getStrValue() const = 0;
@@ -298,57 +298,57 @@ public:
virtual bool isNullValue() const { return false; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolPointer *) { return true; }
- static bool classof(const ConstPoolVal *CPV); // defined in CPV.cpp
+ static inline bool classof(const ConstantPointer *) { return true; }
+ static bool classof(const Constant *CPV); // defined in CPV.cpp
static inline bool classof(const Value *V) {
- return isa<ConstPoolVal>(V) && classof(cast<ConstPoolVal>(V));
+ return isa<Constant>(V) && classof(cast<Constant>(V));
}
};
-// ConstPoolPointerNull - a constant pointer value that points to null
+// ConstantPointerNull - a constant pointer value that points to null
//
-class ConstPoolPointerNull : public ConstPoolPointer {
- ConstPoolPointerNull(const ConstPoolPointerNull &); // DO NOT IMPLEMENT
+class ConstantPointerNull : public ConstantPointer {
+ ConstantPointerNull(const ConstantPointerNull &); // DO NOT IMPLEMENT
protected:
- inline ConstPoolPointerNull(const PointerType *T) : ConstPoolPointer(T) {}
- inline ~ConstPoolPointerNull() {}
+ inline ConstantPointerNull(const PointerType *T) : ConstantPointer(T) {}
+ inline ~ConstantPointerNull() {}
public:
virtual string getStrValue() const;
- static ConstPoolPointerNull *get(const PointerType *T);
+ static ConstantPointerNull *get(const PointerType *T);
// isNullValue - Return true if this is the value that would be returned by
// getNullConstant.
virtual bool isNullValue() const { return true; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolPointerNull *) { return true; }
- static inline bool classof(const ConstPoolPointer *P) {
+ static inline bool classof(const ConstantPointerNull *) { return true; }
+ static inline bool classof(const ConstantPointer *P) {
return P->getNumOperands() == 0;
}
- static inline bool classof(const ConstPoolVal *CPV) {
- return isa<ConstPoolPointer>(CPV) && classof(cast<ConstPoolPointer>(CPV));
+ static inline bool classof(const Constant *CPV) {
+ return isa<ConstantPointer>(CPV) && classof(cast<ConstantPointer>(CPV));
}
static inline bool classof(const Value *V) {
- return isa<ConstPoolPointer>(V) && classof(cast<ConstPoolPointer>(V));
+ return isa<ConstantPointer>(V) && classof(cast<ConstantPointer>(V));
}
};
-// ConstPoolPointerRef - a constant pointer value that is initialized to
+// ConstantPointerRef - a constant pointer value that is initialized to
// point to a global value, which lies at a constant, fixed address.
//
-class ConstPoolPointerRef : public ConstPoolPointer {
+class ConstantPointerRef : public ConstantPointer {
friend class Module; // Modules maintain these references
- ConstPoolPointerRef(const ConstPoolPointerRef &); // DNI!
+ ConstantPointerRef(const ConstantPointerRef &); // DNI!
protected:
- ConstPoolPointerRef(GlobalValue *GV);
- ~ConstPoolPointerRef() {}
+ ConstantPointerRef(GlobalValue *GV);
+ ~ConstantPointerRef() {}
virtual void destroyConstant() { destroyConstantImpl(); }
public:
- static ConstPoolPointerRef *get(GlobalValue *GV);
+ static ConstantPointerRef *get(GlobalValue *GV);
virtual string getStrValue() const;
@@ -360,15 +360,15 @@ public:
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ConstPoolPointerRef *) { return true; }
- static inline bool classof(const ConstPoolPointer *CPV) {
+ static inline bool classof(const ConstantPointerRef *) { return true; }
+ static inline bool classof(const ConstantPointer *CPV) {
return CPV->getNumOperands() == 1;
}
- static inline bool classof(const ConstPoolVal *CPV) {
- return isa<ConstPoolPointer>(CPV) && classof(cast<ConstPoolPointer>(CPV));
+ static inline bool classof(const Constant *CPV) {
+ return isa<ConstantPointer>(CPV) && classof(cast<ConstantPointer>(CPV));
}
static inline bool classof(const Value *V) {
- return isa<ConstPoolPointer>(V) && classof(cast<ConstPoolPointer>(V));
+ return isa<ConstantPointer>(V) && classof(cast<ConstantPointer>(V));
}
// WARNING: Only to be used by Bytecode & Assembly Parsers! USER CODE SHOULD
diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h
index 2be424dbd5..f46fa359cb 100644
--- a/include/llvm/GlobalVariable.h
+++ b/include/llvm/GlobalVariable.h
@@ -15,17 +15,17 @@
#include "llvm/GlobalValue.h"
class Module;
-class ConstPoolVal;
+class Constant;
class PointerType;
class GlobalVariable : public GlobalValue {
friend class ValueHolder<GlobalVariable, Module, Module>;
void setParent(Module *parent) { Parent = parent; }
- bool Constant; // Is this a global constant?
+ bool isConstantGlobal; // Is this a global constant?
public:
GlobalVariable(const Type *Ty, bool isConstant, bool isInternal,
- ConstPoolVal *Initializer = 0, const string &Name = "");
+ Constant *Initializer = 0, const string &Name = "");
~GlobalVariable() {}
// Specialize setName to handle symbol table majik...
@@ -35,15 +35,15 @@ public:
// an initializer is specified.
//
inline bool hasInitializer() const { return !Operands.empty(); }
- inline ConstPoolVal *getInitializer() const {
+ inline Constant *getInitializer() const {
assert(hasInitializer() && "GV doesn't have initializer!");
- return (ConstPoolVal*)Operands[0].get();
+ return (Constant*)Operands[0].get();
}
- inline ConstPoolVal *getInitializer() {
+ inline Constant *getInitializer() {
assert(hasInitializer() && "GV doesn't have initializer!");
- return (ConstPoolVal*)Operands[0].get();
+ return (Constant*)Operands[0].get();
}
- inline void setInitializer(ConstPoolVal *CPV) {
+ inline void setInitializer(Constant *CPV) {
if (CPV == 0) {
if (hasInitializer()) Operands.pop_back();
} else {
@@ -57,7 +57,7 @@ public:
// runtime execution of the program. Assigning a value into the constant
// leads to undefined behavior.
//
- inline bool isConstant() const { return Constant; }
+ inline bool isConstant() const { return isConstantGlobal; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const GlobalVariable *) { return true; }
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index 60032474ca..92f137eb95 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -17,8 +17,8 @@
#include "llvm/ValueHolder.h"
class Method;
class GlobalVariable;
-class GlobalValueRefMap; // Used by ConstPoolVals.cpp
-class ConstPoolPointerRef;
+class GlobalValueRefMap; // Used by ConstantVals.cpp
+class ConstantPointerRef;
class Module : public Value, public SymTabValue {
public:
@@ -44,10 +44,10 @@ private:
GlobalValueRefMap *GVRefMap;
// Accessor for the underlying GlobalValRefMap... only through the
- // ConstPoolPointerRef class...
- friend class ConstPoolPointerRef;
- void mutateConstPoolPointerRef(GlobalValue *OldGV, GlobalValue *NewGV);
- ConstPoolPointerRef *getConstPoolPointerRef(GlobalValue *GV);
+ // ConstantPointerRef class...
+ friend class ConstantPointerRef;
+ void mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV);
+ ConstantPointerRef *getConstantPointerRef(GlobalValue *GV);
public:
Module();
diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h
index ee53f6d5a3..243631161c 100644
--- a/include/llvm/SymbolTable.h
+++ b/include/llvm/SymbolTable.h
@@ -21,7 +21,7 @@
#ifndef NDEBUG // Only for assertions
#include "llvm/Type.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
#endif
class Type;
@@ -64,7 +64,7 @@ public:
// (constant/type)s.
//
inline void insert(const string &Name, Value *V) {
- assert((isa<Type>(V) || isa<ConstPoolVal>(V)) &&
+ assert((isa<Type>(V) || isa<Constant>(V)) &&
"Can only insert types and constants here!");
insertEntry(Name, V->getType(), V);
}
diff --git a/include/llvm/Target/MachineInstrInfo.h b/include/llvm/Target/MachineInstrInfo.h
index 01cb2d991a..b03993e6ce 100644
--- a/include/llvm/Target/MachineInstrInfo.h
+++ b/include/llvm/Target/MachineInstrInfo.h
@@ -240,7 +240,7 @@ public:
//-------------------------------------------------------------------------
// Create an instruction sequence to put the constant `val' into
- // the virtual register `dest'. `val' may be a ConstPoolVal or a
+ // the virtual register `dest'. `val' may be a Constant or a
// GlobalValue, viz., the constant address of a global variable or function.
// The generated instructions are returned in `minstrVec'.
// Any temp. registers (TmpInstruction) created are returned in `tempVec'.
diff --git a/include/llvm/Target/TargetData.h b/include/llvm/Target/TargetData.h
index f1b4ef9e1a..5dd41bfd6a 100644
--- a/include/llvm/Target/TargetData.h
+++ b/include/llvm/Target/TargetData.h
@@ -61,7 +61,7 @@ public:
// stores that include the implicit form of getelementptr.
//
unsigned getIndexedOffset(const Type *Ty,
- const vector<ConstPoolVal*> &Indices) const;
+ const vector<Constant*> &Indices) const;
inline const StructLayout *getStructLayout(const StructType *Ty) const {
return (const StructLayout*)((const Type*)Ty)->getOrCreateAnnotation(AID);
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h
index 01cb2d991a..b03993e6ce 100644
--- a/include/llvm/Target/TargetInstrInfo.h
+++ b/include/llvm/Target/TargetInstrInfo.h
@@ -240,7 +240,7 @@ public:
//-------------------------------------------------------------------------
// Create an instruction sequence to put the constant `val' into
- // the virtual register `dest'. `val' may be a ConstPoolVal or a
+ // the virtual register `dest'. `val' may be a Constant or a
// GlobalValue, viz., the constant address of a global variable or function.
// The generated instructions are returned in `minstrVec'.
// Any temp. registers (TmpInstruction) created are returned in `tempVec'.
diff --git a/include/llvm/Transforms/IPO/ConstantMerge.h b/include/llvm/Transforms/IPO/ConstantMerge.h
index 4ebbfd3d93..6eed771288 100644
--- a/include/llvm/Transforms/IPO/ConstantMerge.h
+++ b/include/llvm/Transforms/IPO/ConstantMerge.h
@@ -19,12 +19,12 @@
#include "llvm/Pass.h"
#include <map>
-class ConstPoolVal;
+class Constant;
class GlobalVariable;
class ConstantMerge : public Pass {
protected:
- map<ConstPoolVal*, GlobalVariable*> Constants;
+ map<Constant*, GlobalVariable*> Constants;
unsigned LastConstantSeen;
public:
inline ConstantMerge() : LastConstantSeen(0) {}
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index 771bb22d32..8a0014c85a 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -18,7 +18,7 @@
class User;
class Type;
-class ConstPoolVal;
+class Constant;
class MethodArgument;
class Instruction;
class BasicBlock;
@@ -39,7 +39,7 @@ class Value : public Annotable, // Values are annotable
public:
enum ValueTy {
TypeVal, // This is an instance of Type
- ConstantVal, // This is an instance of ConstPoolVal
+ ConstantVal, // This is an instance of Constant
MethodArgumentVal, // This is an instance of MethodArgument
InstructionVal, // This is an instance of Instruction
BasicBlockVal, // This is an instance of BasicBlock
@@ -250,10 +250,10 @@ template <> inline bool isa<Type, const Value*>(const Value *Val) {
template <> inline bool isa<Type, Value*>(Value *Val) {
return Val->getValueType() == Value::TypeVal;
}
-template <> inline bool isa<ConstPoolVal, const Value*>(const Value *Val) {
+template <> inline bool isa<Constant, const Value*>(const Value *Val) {
return Val->getValueType() == Value::ConstantVal;
}
-template <> inline bool isa<ConstPoolVal, Value*>(Value *Val) {
+template <> inline bool isa<Constant, Value*>(Value *Val) {
return Val->getValueType() == Value::ConstantVal;
}
template <> inline bool isa<MethodArgument, const Value*>(const Value *Val) {
diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h
index 5fc5986e63..8f356bf1f7 100644
--- a/include/llvm/iMemory.h
+++ b/include/llvm/iMemory.h
@@ -177,7 +177,7 @@ public:
const vector<Value*> &Indices,
bool AllowStructLeaf = false);
- const vector<ConstPoolVal*> getIndicesBROKEN() const;
+ const vector<Constant*> getIndicesBROKEN() const;
inline op_iterator idx_begin() {
diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h
index 6fdf3604ea..ebd8b873dd 100644
--- a/include/llvm/iTerminators.h
+++ b/include/llvm/iTerminators.h
@@ -12,7 +12,7 @@
#include "llvm/InstrTypes.h"
#include "llvm/BasicBlock.h"
-#include "llvm/ConstPoolVals.h"
+#include "llvm/ConstantVals.h"
//===----------------------------------------------------------------------===//
// Classes to represent Basic Block "Terminator" instructions
@@ -151,7 +151,7 @@ public:
return cast<BasicBlock>(Operands[1]);
}
- void dest_push_back(ConstPoolVal *OnVal, BasicBlock *Dest);
+ void dest_push_back(Constant *OnVal, BasicBlock *Dest);
virtual const char *getOpcodeName() const { return "switch"; }
@@ -170,13 +170,13 @@ public:
// getSuccessorValue - Return the value associated with the specified
// successor. WARNING: This does not gracefully accept idx's out of range!
- inline const ConstPoolVal *getSuccessorValue(unsigned idx) const {
+ inline const Constant *getSuccessorValue(unsigned idx) const {
assert(idx < getNumSuccessors() && "Successor # out of range!");
- return cast<const ConstPoolVal>(Operands[idx*2]);
+ return cast<const Constant>(Operands[idx*2]);
}
- inline ConstPoolVal *getSuccessorValue(unsigned idx) {
+ inline Constant *getSuccessorValue(unsigned idx) {
assert(idx < getNumSuccessors() && "Successor # out of range!");
- return cast<ConstPoolVal>(Operands[idx*2]);
+ return cast<Constant>(Operands[idx*2]);
}
virtual unsigned getNumSuccessors() const { return Operands.size()/2; }