diff --git a/llvm/include/llvm/Constant.h b/llvm/include/llvm/Constant.h new file mode 100644 index 000000000000..572d1d15ca92 --- /dev/null +++ b/llvm/include/llvm/Constant.h @@ -0,0 +1,47 @@ +//===-- llvm/Constant.h - Constant class definition --------------*- C++ -*--=// +// +// This file contains the declaration of the Constant class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CONSTANT_H +#define LLVM_CONSTANT_H + +#include "llvm/User.h" + +class Constant : public User { +protected: + 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 + // constant. Any constants on our Use list must also be destroy'd. The + // implementation must be sure to remove the constant from the list of + // available cached constants. Implementations should call + // destroyConstantImpl as the last thing they do, to destroy all users and + // delete this. + // + virtual void destroyConstant() { assert(0 && "Not reached!"); } + void destroyConstantImpl(); +public: + // Specialize setName to handle symbol table majik... + virtual void setName(const std::string &name, SymbolTable *ST = 0); + + // Static constructor to get a '0' constant of arbitrary type... + static Constant *getNullValue(const Type *Ty); + + // isNullValue - Return true if this is the value that would be returned by + // getNullValue. + virtual bool isNullValue() const = 0; + + virtual void print(std::ostream &O) const; + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const Constant *) { return true; } + static inline bool classof(const Value *V) { + return V->getValueType() == Value::ConstantVal; + } +}; + +#endif diff --git a/llvm/include/llvm/ConstantHandling.h b/llvm/include/llvm/ConstantHandling.h index 1479fe01ef88..14231cb6abfb 100644 --- a/llvm/include/llvm/ConstantHandling.h +++ b/llvm/include/llvm/ConstantHandling.h @@ -33,7 +33,7 @@ #ifndef LLVM_CONSTANTHANDLING_H #define LLVM_CONSTANTHANDLING_H -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Instruction.h" #include "llvm/Type.h" class PointerType; diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h index 1253974da06c..119dd8ffa5b0 100644 --- a/llvm/include/llvm/Constants.h +++ b/llvm/include/llvm/Constants.h @@ -1,65 +1,20 @@ -//===-- llvm/ConstantVals.h - Constant Value nodes ---------------*- C++ -*--=// +//===-- llvm/Constants.h - Constant class subclass definitions ---*- C++ -*--=// // -// This file contains the declarations for the Constant class and all of -// its subclasses, which represent the different type of constant pool values +// This file contains the declarations for the subclasses of Constant, which +// represent the different type of constant pool values // //===----------------------------------------------------------------------===// -#ifndef LLVM_CONSTANT_VALS_H -#define LLVM_CONSTANT_VALS_H +#ifndef LLVM_CONSTANTS_H +#define LLVM_CONSTANTS_H -#include "llvm/User.h" +#include "llvm/Constant.h" #include "Support/DataTypes.h" class ArrayType; class StructType; class PointerType; -//===----------------------------------------------------------------------===// -// Constant Class -//===----------------------------------------------------------------------===// - -class Constant : public User { -protected: - 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 - // constant. Any constants on our Use list must also be destroy'd. The - // implementation must be sure to remove the constant from the list of - // available cached constants. Implementations should call - // destroyConstantImpl as the last thing they do, to destroy all users and - // delete this. - // - virtual void destroyConstant() { assert(0 && "Not reached!"); } - void destroyConstantImpl(); -public: - // Specialize setName to handle symbol table majik... - virtual void setName(const std::string &name, SymbolTable *ST = 0); - - // Static constructor to get a '0' constant of arbitrary type... - static Constant *getNullValue(const Type *Ty); - - // isNullValue - Return true if this is the value that would be returned by - // getNullValue. - virtual bool isNullValue() const = 0; - - virtual void print(std::ostream &O) const; - - // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Constant *) { return true; } - static inline bool classof(const Value *V) { - return V->getValueType() == Value::ConstantVal; - } -}; - - - -//===----------------------------------------------------------------------===// -// Classes to represent constant pool variable defs -//===----------------------------------------------------------------------===// - //===--------------------------------------------------------------------------- // ConstantBool - Boolean Values // diff --git a/llvm/lib/Analysis/DataStructure/FunctionRepBuilder.cpp b/llvm/lib/Analysis/DataStructure/FunctionRepBuilder.cpp index e9b6f199d7e2..1566ca87da0f 100644 --- a/llvm/lib/Analysis/DataStructure/FunctionRepBuilder.cpp +++ b/llvm/lib/Analysis/DataStructure/FunctionRepBuilder.cpp @@ -12,7 +12,7 @@ #include "llvm/iOther.h" #include "llvm/iTerminators.h" #include "llvm/DerivedTypes.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "Support/STLExtras.h" #include diff --git a/llvm/lib/Analysis/InductionVariable.cpp b/llvm/lib/Analysis/InductionVariable.cpp index 3214b79ce600..f0b01e845542 100644 --- a/llvm/lib/Analysis/InductionVariable.cpp +++ b/llvm/lib/Analysis/InductionVariable.cpp @@ -22,7 +22,7 @@ #include "llvm/iPHINode.h" #include "llvm/InstrTypes.h" #include "llvm/Type.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" using analysis::ExprType; diff --git a/llvm/lib/AsmParser/ParserInternals.h b/llvm/lib/AsmParser/ParserInternals.h index 8b10c36e60f5..db84f92f7b04 100644 --- a/llvm/lib/AsmParser/ParserInternals.h +++ b/llvm/lib/AsmParser/ParserInternals.h @@ -13,7 +13,7 @@ #include "llvm/InstrTypes.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/iOther.h" #include "llvm/Function.h" #include "llvm/DerivedTypes.h" diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp index 89beddb95680..4c7ebb119acf 100644 --- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp +++ b/llvm/lib/Bytecode/Reader/ConstantReader.cpp @@ -11,7 +11,7 @@ #include "ReaderInternals.h" #include "llvm/Module.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/GlobalVariable.h" #include #include diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index fff2d02898c4..7418c81bbea1 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/lib/Bytecode/Reader/Reader.cpp @@ -16,7 +16,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/Module.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/Argument.h" diff --git a/llvm/lib/Bytecode/Writer/ConstantWriter.cpp b/llvm/lib/Bytecode/Writer/ConstantWriter.cpp index 296e326445af..d85ee2fe755d 100644 --- a/llvm/lib/Bytecode/Writer/ConstantWriter.cpp +++ b/llvm/lib/Bytecode/Writer/ConstantWriter.cpp @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// #include "WriterInternals.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/SymbolTable.h" #include "llvm/DerivedTypes.h" #include diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 2f427770d908..145004b716da 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -24,7 +24,6 @@ #include "llvm/GlobalVariable.h" #include "llvm/Function.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" #include "llvm/SymbolTable.h" #include "llvm/DerivedTypes.h" #include "Support/STLExtras.h" @@ -78,8 +77,8 @@ void BytecodeWriter::outputConstants(bool isFunction) { unsigned NC = ValNo; // Number of constants for (; NC < Plane.size() && - (isa(Plane[NC]) || - isa(Plane[NC])); NC++) /*empty*/; + (isa(Plane[NC]) || isa(Plane[NC])); NC++) + /*empty*/; NC -= ValNo; // Convert from index into count if (NC == 0) continue; // Skip empty type planes... @@ -125,7 +124,7 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) { // If we have an initializer, output it now. if (GV->hasInitializer()) { - Slot = Table.getValSlot(GV->getInitializer()); + Slot = Table.getValSlot((Value*)GV->getInitializer()); assert(Slot != -1 && "No slot for global var initializer!"); output_vbr((unsigned)Slot, Out); } diff --git a/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp b/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp index e2f45a0285be..8fa59584c028 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp +++ b/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp @@ -24,7 +24,7 @@ #include "llvm/Function.h" #include "llvm/iTerminators.h" #include "llvm/iMemory.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constant.h" #include "llvm/BasicBlock.h" #include "llvm/CodeGen/MachineInstr.h" #include "Support/STLExtras.h" diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index 24efdf1456c6..c042e368c9d8 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -19,7 +19,7 @@ #include "llvm/CodeGen/InstrForest.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/MachineRegInfo.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/BasicBlock.h" #include "llvm/Type.h" diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 91f3e8914472..321003c1fdc0 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -11,7 +11,7 @@ #include "llvm/iTerminators.h" #include "llvm/iMemory.h" #include "llvm/Type.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Assembly/Writer.h" #include "llvm/Target/TargetData.h" #include "llvm/GlobalVariable.h" diff --git a/llvm/lib/Target/Sparc/EmitAssembly.cpp b/llvm/lib/Target/Sparc/EmitAssembly.cpp index 77c9d3183a12..c823e91d1c99 100644 --- a/llvm/lib/Target/Sparc/EmitAssembly.cpp +++ b/llvm/lib/Target/Sparc/EmitAssembly.cpp @@ -15,7 +15,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineCodeForMethod.h" #include "llvm/GlobalVariable.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Annotation.h" #include "llvm/BasicBlock.h" @@ -307,13 +307,13 @@ SparcFunctionAsmPrinter::printOneOperand(const MachineOperand &op) const Value *Val = op.getVRegValue(); if (!Val) toAsm << "\t<*NULL Value*>"; - else if (const BasicBlock *BB = dyn_cast(Val)) + else if (const BasicBlock *BB = dyn_cast(Val)) toAsm << getID(BB); - else if (const Function *M = dyn_cast(Val)) + else if (const Function *M = dyn_cast(Val)) toAsm << getID(M); - else if (const GlobalVariable *GV=dyn_cast(Val)) + else if (const GlobalVariable *GV = dyn_cast(Val)) toAsm << getID(GV); - else if (const Constant *CV = dyn_cast(Val)) + else if (const Constant *CV = dyn_cast(Val)) toAsm << getID(CV); else toAsm << ""; diff --git a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp index aa618c9259ae..354c39aa6bcd 100644 --- a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp +++ b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp @@ -18,7 +18,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineCodeForMethod.h" #include "llvm/Function.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" diff --git a/llvm/lib/Target/Sparc/SparcInstrSelection.cpp b/llvm/lib/Target/Sparc/SparcInstrSelection.cpp index cff0a845c2f0..7054ae9c44d8 100644 --- a/llvm/lib/Target/Sparc/SparcInstrSelection.cpp +++ b/llvm/lib/Target/Sparc/SparcInstrSelection.cpp @@ -25,7 +25,7 @@ #include "llvm/iOther.h" #include "llvm/BasicBlock.h" #include "llvm/Function.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "Support/MathExtras.h" #include using std::vector; diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp index d347730ee0b8..8479c6c8dbda 100644 --- a/llvm/lib/Target/TargetData.cpp +++ b/llvm/lib/Target/TargetData.cpp @@ -12,7 +12,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/DerivedTypes.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" static inline void getTypeInfo(const Type *Ty, const TargetData *TD, unsigned &Size, unsigned char &Alignment); diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp index 181ff70657c1..cd14bb38284e 100644 --- a/llvm/lib/Transforms/ExprTypeConvert.cpp +++ b/llvm/lib/Transforms/ExprTypeConvert.cpp @@ -11,7 +11,7 @@ #include "llvm/iOther.h" #include "llvm/iPHINode.h" #include "llvm/iMemory.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/ConstantHandling.h" #include "llvm/Transforms/Scalar/DCE.h" #include "llvm/Analysis/Expressions.h" diff --git a/llvm/lib/Transforms/IPO/MutateStructTypes.cpp b/llvm/lib/Transforms/IPO/MutateStructTypes.cpp index 2a6d18460d59..5cb3ee0b9019 100644 --- a/llvm/lib/Transforms/IPO/MutateStructTypes.cpp +++ b/llvm/lib/Transforms/IPO/MutateStructTypes.cpp @@ -23,6 +23,7 @@ #include "llvm/iTerminators.h" #include "llvm/iOther.h" #include "llvm/Argument.h" +#include "llvm/Constants.h" #include "Support/STLExtras.h" #include using std::map; diff --git a/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp b/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp index bd67fe1cc973..6ccd043a85cf 100644 --- a/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp +++ b/llvm/lib/Transforms/IPO/OldPoolAllocate.cpp @@ -21,7 +21,7 @@ #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/DerivedTypes.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Argument.h" diff --git a/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp index 41d4a72d7616..0b6d17d683dc 100644 --- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp +++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp @@ -9,7 +9,7 @@ #include "Graph.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/iMemory.h" #include "llvm/iTerminators.h" diff --git a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index b967db64c68d..26fa86661614 100644 --- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -29,7 +29,7 @@ #include "llvm/Support/CFG.h" #include "llvm/Function.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/iMemory.h" #include "llvm/Pass.h" diff --git a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp b/llvm/lib/Transforms/Instrumentation/TraceValues.cpp index d05d33dc721b..7b263c76ad8b 100644 --- a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp +++ b/llvm/lib/Transforms/Instrumentation/TraceValues.cpp @@ -7,7 +7,7 @@ #include "llvm/Transforms/Instrumentation/TraceValues.h" #include "llvm/GlobalVariable.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/iMemory.h" #include "llvm/iTerminators.h" diff --git a/llvm/lib/Transforms/LevelRaise.cpp b/llvm/lib/Transforms/LevelRaise.cpp index f556cedcd8fd..77d06a0946cd 100644 --- a/llvm/lib/Transforms/LevelRaise.cpp +++ b/llvm/lib/Transforms/LevelRaise.cpp @@ -11,7 +11,7 @@ #include "llvm/Function.h" #include "llvm/iOther.h" #include "llvm/iMemory.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Pass.h" #include "llvm/ConstantHandling.h" #include "llvm/Transforms/Scalar/DCE.h" diff --git a/llvm/lib/Transforms/Scalar/ConstantProp.cpp b/llvm/lib/Transforms/Scalar/ConstantProp.cpp index a8cd02fed056..0f1d0aea323a 100644 --- a/llvm/lib/Transforms/Scalar/ConstantProp.cpp +++ b/llvm/lib/Transforms/Scalar/ConstantProp.cpp @@ -30,7 +30,6 @@ #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/Pass.h" -#include "llvm/ConstantVals.h" inline static bool ConstantFoldUnaryInst(BasicBlock *BB, BasicBlock::iterator &II, diff --git a/llvm/lib/Transforms/Scalar/DCE.cpp b/llvm/lib/Transforms/Scalar/DCE.cpp index 0d6f293cd06d..1a3073c3c745 100644 --- a/llvm/lib/Transforms/Scalar/DCE.cpp +++ b/llvm/lib/Transforms/Scalar/DCE.cpp @@ -30,7 +30,7 @@ #include "llvm/BasicBlock.h" #include "llvm/iTerminators.h" #include "llvm/iPHINode.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constant.h" #include "llvm/Support/CFG.h" #include "llvm/Pass.h" #include "Support/STLExtras.h" diff --git a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index 0ec72c65e011..78dcfd50dd64 100644 --- a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/iMemory.h" #include "llvm/iOther.h" #include "llvm/BasicBlock.h" diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index d9b841599266..a115e050d17f 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -12,7 +12,7 @@ #include "llvm/iOther.h" #include "llvm/Type.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Pass.h" #include "llvm/Support/CFG.h" #include "Support/STLExtras.h" diff --git a/llvm/lib/Transforms/Scalar/InductionVars.cpp b/llvm/lib/Transforms/Scalar/InductionVars.cpp index 0225cd5e3d52..ee7c4c8a7271 100644 --- a/llvm/lib/Transforms/Scalar/InductionVars.cpp +++ b/llvm/lib/Transforms/Scalar/InductionVars.cpp @@ -20,7 +20,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar/InductionVars.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Analysis/IntervalPartition.h" #include "llvm/iPHINode.h" #include "llvm/Function.h" diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp index 42524c8be86c..21456a27d0d1 100644 --- a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp +++ b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp @@ -14,7 +14,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/iMemory.h" #include "llvm/iOther.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Pass.h" #include "TransformInternals.h" using std::vector; diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index e723fc833bbe..c68004d24550 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -19,7 +19,7 @@ #include "llvm/ConstantHandling.h" #include "llvm/Function.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/iPHINode.h" #include "llvm/iMemory.h" #include "llvm/iTerminators.h" diff --git a/llvm/lib/Transforms/TransformInternals.cpp b/llvm/lib/Transforms/TransformInternals.cpp index 55b9dda67e65..e5a88c592f5d 100644 --- a/llvm/lib/Transforms/TransformInternals.cpp +++ b/llvm/lib/Transforms/TransformInternals.cpp @@ -7,7 +7,6 @@ #include "TransformInternals.h" #include "llvm/Type.h" -#include "llvm/ConstantVals.h" #include "llvm/Analysis/Expressions.h" #include "llvm/Function.h" #include "llvm/iOther.h" diff --git a/llvm/lib/Transforms/TransformInternals.h b/llvm/lib/Transforms/TransformInternals.h index a93f63ece152..f57ed3ea6ecf 100644 --- a/llvm/lib/Transforms/TransformInternals.h +++ b/llvm/lib/Transforms/TransformInternals.h @@ -12,7 +12,7 @@ #include "llvm/Instruction.h" #include "llvm/Target/TargetData.h" #include "llvm/DerivedTypes.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include #include diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp index 086c6c6b28f0..2de6f81fdf9e 100644 --- a/llvm/lib/Transforms/Utils/Linker.cpp +++ b/llvm/lib/Transforms/Utils/Linker.cpp @@ -17,7 +17,7 @@ #include "llvm/SymbolTable.h" #include "llvm/DerivedTypes.h" #include "llvm/iOther.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/Argument.h" #include using std::cerr; diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 8679701e6a7d..ab9455007773 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -25,7 +25,7 @@ #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constant.h" using std::vector; using std::map; @@ -79,7 +79,7 @@ static inline bool isSafeAlloca(const AllocaInst *AI) { if (MAI->hasIndices()) { // indexed? // Allow the access if there is only one index and the index is // zero. - if (*MAI->idx_begin() != ConstantUInt::get(Type::UIntTy, 0) || + if (*MAI->idx_begin() != Constant::getNullValue(Type::UIntTy) || MAI->idx_begin()+1 != MAI->idx_end()) return false; } diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 51ffbf6784dc..316baf124fac 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -18,7 +18,7 @@ #include "llvm/Function.h" #include "llvm/GlobalVariable.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/iMemory.h" #include "llvm/iTerminators.h" #include "llvm/iPHINode.h" diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp index e126d702b405..bd750df1bfee 100644 --- a/llvm/lib/VMCore/BasicBlock.cpp +++ b/llvm/lib/VMCore/BasicBlock.cpp @@ -76,7 +76,7 @@ void BasicBlock::dropAllReferences() { // bool BasicBlock::hasConstantReferences() const { for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) - if (::isa(*I)) + if (::isa((Value*)*I)) return true; return false; diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 8bf1d9cc199a..7487bb480195 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -1,11 +1,11 @@ -//===-- ConstantVals.cpp - Implement Constant nodes --------------*- C++ -*--=// +//===-- Constants.cpp - Implement Constant nodes -----------------*- C++ -*--=// // // This file implements the Constant* classes... // //===----------------------------------------------------------------------===// #define __STDC_LIMIT_MACROS // Get defs for INT64_MAX and friends... -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/SymbolTable.h" #include "llvm/GlobalValue.h" diff --git a/llvm/lib/VMCore/Module.cpp b/llvm/lib/VMCore/Module.cpp index 08bc38723cea..f06c9e3f60e3 100644 --- a/llvm/lib/VMCore/Module.cpp +++ b/llvm/lib/VMCore/Module.cpp @@ -9,7 +9,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/InstrTypes.h" #include "llvm/Type.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "Support/STLExtras.h" #include "ValueHolderImpl.h" diff --git a/llvm/lib/VMCore/SlotCalculator.cpp b/llvm/lib/VMCore/SlotCalculator.cpp index ce62df9b7211..6dad92609a2e 100644 --- a/llvm/lib/VMCore/SlotCalculator.cpp +++ b/llvm/lib/VMCore/SlotCalculator.cpp @@ -15,8 +15,8 @@ #include "llvm/GlobalVariable.h" #include "llvm/Module.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" #include "llvm/iOther.h" +#include "llvm/Constant.h" #include "llvm/DerivedTypes.h" #include "llvm/SymbolTable.h" #include "llvm/Argument.h" diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 7a17d06ff6a1..3ea928e4eb02 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -6,6 +6,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/SymbolTable.h" +#include "llvm/Constants.h" #include "Support/StringExtras.h" #include "Support/STLExtras.h" #include diff --git a/llvm/lib/VMCore/iMemory.cpp b/llvm/lib/VMCore/iMemory.cpp index 79c697edc8fb..09d9d156bf63 100644 --- a/llvm/lib/VMCore/iMemory.cpp +++ b/llvm/lib/VMCore/iMemory.cpp @@ -5,7 +5,7 @@ //===----------------------------------------------------------------------===// #include "llvm/iMemory.h" -#include "llvm/ConstantVals.h" +#include "llvm/Constants.h" static inline const Type *checkType(const Type *Ty) { assert(Ty && "Invalid indices for type!");