diff options
Diffstat (limited to 'lib/Bytecode/Writer')
-rw-r--r-- | lib/Bytecode/Writer/ConstantWriter.cpp | 30 | ||||
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.cpp | 12 | ||||
-rw-r--r-- | lib/Bytecode/Writer/Writer.cpp | 8 | ||||
-rw-r--r-- | lib/Bytecode/Writer/WriterInternals.h | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/lib/Bytecode/Writer/ConstantWriter.cpp b/lib/Bytecode/Writer/ConstantWriter.cpp index 8beb132579..835ef9850b 100644 --- a/lib/Bytecode/Writer/ConstantWriter.cpp +++ b/lib/Bytecode/Writer/ConstantWriter.cpp @@ -10,7 +10,7 @@ //===----------------------------------------------------------------------===// #include "WriterInternals.h" -#include "llvm/ConstPoolVals.h" +#include "llvm/ConstantVals.h" #include "llvm/SymbolTable.h" #include "llvm/DerivedTypes.h" @@ -93,10 +93,10 @@ void BytecodeWriter::outputType(const Type *T) { } } -bool BytecodeWriter::outputConstant(const ConstPoolVal *CPV) { +bool BytecodeWriter::outputConstant(const Constant *CPV) { switch (CPV->getType()->getPrimitiveID()) { case Type::BoolTyID: // Boolean Types - if (cast<const ConstPoolBool>(CPV)->getValue()) + if (cast<const ConstantBool>(CPV)->getValue()) output_vbr((unsigned)1, Out); else output_vbr((unsigned)0, Out); @@ -106,22 +106,22 @@ bool BytecodeWriter::outputConstant(const ConstPoolVal *CPV) { case Type::UShortTyID: case Type::UIntTyID: case Type::ULongTyID: - output_vbr(cast<const ConstPoolUInt>(CPV)->getValue(), Out); + output_vbr(cast<const ConstantUInt>(CPV)->getValue(), Out); break; case Type::SByteTyID: // Signed integer types... case Type::ShortTyID: case Type::IntTyID: case Type::LongTyID: - output_vbr(cast<const ConstPoolSInt>(CPV)->getValue(), Out); + output_vbr(cast<const ConstantSInt>(CPV)->getValue(), Out); break; case Type::TypeTyID: // Serialize type type - assert(0 && "Types should not be in the ConstPool!"); + assert(0 && "Types should not be in the Constant!"); break; case Type::ArrayTyID: { - const ConstPoolArray *CPA = cast<const ConstPoolArray>(CPV); + const ConstantArray *CPA = cast<const ConstantArray>(CPV); unsigned size = CPA->getValues().size(); if (!((const ArrayType *)CPA->getType())->isSized()) output_vbr(size, Out); // Not for sized arrays!!! @@ -135,7 +135,7 @@ bool BytecodeWriter::outputConstant(const ConstPoolVal *CPV) { } case Type::StructTyID: { - const ConstPoolStruct *CPS = cast<const ConstPoolStruct>(CPV); + const ConstantStruct *CPS = cast<const ConstantStruct>(CPV); const vector<Use> &Vals = CPS->getValues(); for (unsigned i = 0; i < Vals.size(); ++i) { @@ -147,28 +147,28 @@ bool BytecodeWriter::outputConstant(const ConstPoolVal *CPV) { } case Type::PointerTyID: { - const ConstPoolPointer *CPP = cast<const ConstPoolPointer>(CPV); - if (isa<ConstPoolPointerNull>(CPP)) { + const ConstantPointer *CPP = cast<const ConstantPointer>(CPV); + if (isa<ConstantPointerNull>(CPP)) { output_vbr((unsigned)0, Out); - } else if (const ConstPoolPointerRef *CPR = - dyn_cast<ConstPoolPointerRef>(CPP)) { + } else if (const ConstantPointerRef *CPR = + dyn_cast<ConstantPointerRef>(CPP)) { output_vbr((unsigned)1, Out); int Slot = Table.getValSlot((Value*)CPR->getValue()); assert(Slot != -1 && "Global used but not available!!"); output_vbr((unsigned)Slot, Out); } else { - assert(0 && "Unknown ConstPoolPointer Subclass!"); + assert(0 && "Unknown ConstantPointer Subclass!"); } break; } case Type::FloatTyID: { // Floating point types... - float Tmp = (float)cast<ConstPoolFP>(CPV)->getValue(); + float Tmp = (float)cast<ConstantFP>(CPV)->getValue(); output_data(&Tmp, &Tmp+1, Out); break; } case Type::DoubleTyID: { - double Tmp = cast<ConstPoolFP>(CPV)->getValue(); + double Tmp = cast<ConstantFP>(CPV)->getValue(); output_data(&Tmp, &Tmp+1, Out); break; } diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index 6fed526bd6..9c5d97a588 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/lib/Bytecode/Writer/SlotCalculator.cpp @@ -15,7 +15,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/Module.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstPoolVals.h" +#include "llvm/ConstantVals.h" #include "llvm/iOther.h" #include "llvm/DerivedTypes.h" #include "llvm/SymbolTable.h" @@ -114,7 +114,7 @@ void SlotCalculator::processSymbolTableConstants(const SymbolTable *ST) { for (SymbolTable::const_iterator I = ST->begin(), E = ST->end(); I != E; ++I) for (SymbolTable::type_const_iterator TI = I->second.begin(), TE = I->second.end(); TI != TE; ++TI) - if (isa<ConstPoolVal>(TI->second)) + if (isa<Constant>(TI->second)) insertValue(TI->second); } @@ -231,7 +231,7 @@ int SlotCalculator::getValSlot(const Value *D) const { int SlotCalculator::insertValue(const Value *D) { - if (isa<ConstPoolVal>(D) || isa<GlobalVariable>(D)) { + if (isa<Constant>(D) || isa<GlobalVariable>(D)) { const User *U = cast<const User>(D); // This makes sure that if a constant has uses (for example an array // of const ints), that they are inserted also. Same for global variable @@ -259,7 +259,7 @@ int SlotCalculator::insertVal(const Value *D, bool dontIgnore = false) { if (!dontIgnore) // Don't ignore nonignorables! if (D->getType() == Type::VoidTy || // Ignore void type nodes (IgnoreNamedNodes && // Ignore named and constants - (D->hasName() || isa<ConstPoolVal>(D)) && !isa<Type>(D))) { + (D->hasName() || isa<Constant>(D)) && !isa<Type>(D))) { SC_DEBUG("ignored value " << D << endl); return -1; // We do need types unconditionally though } @@ -336,8 +336,8 @@ int SlotCalculator::doInsertVal(const Value *D) { SC_DEBUG(" Inserting value [" << Ty << "] = " << D << " slot=" << DestSlot << " ["); - // G = Global, C = ConstPoolVal, T = Type, M = Method, o = other - SC_DEBUG((isa<GlobalVariable>(D) ? "G" : (isa<ConstPoolVal>(D) ? "C" : + // G = Global, C = Constant, T = Type, M = Method, o = other + SC_DEBUG((isa<GlobalVariable>(D) ? "G" : (isa<Constant>(D) ? "C" : (isa<Type>(D) ? "T" : (isa<Method>(D) ? "M" : "o"))))); SC_DEBUG("]\n"); return (int)DestSlot; diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index dd46d88bc9..3091384722 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -27,7 +27,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/Method.h" #include "llvm/BasicBlock.h" -#include "llvm/ConstPoolVals.h" +#include "llvm/ConstantVals.h" #include "llvm/SymbolTable.h" #include "llvm/DerivedTypes.h" #include "Support/STLExtras.h" @@ -81,7 +81,7 @@ void BytecodeWriter::outputConstants(bool isMethod) { unsigned NC = ValNo; // Number of constants for (; NC < Plane.size() && - (isa<ConstPoolVal>(Plane[NC]) || + (isa<Constant>(Plane[NC]) || isa<Type>(Plane[NC])); NC++) /*empty*/; NC -= ValNo; // Convert from index into count if (NC == 0) continue; // Skip empty type planes... @@ -100,9 +100,9 @@ void BytecodeWriter::outputConstants(bool isMethod) { for (unsigned i = ValNo; i < ValNo+NC; ++i) { const Value *V = Plane[i]; - if (const ConstPoolVal *CPV = dyn_cast<ConstPoolVal>(V)) { + if (const Constant *CPV = dyn_cast<Constant>(V)) { //cerr << "Serializing value: <" << V->getType() << ">: " - // << ((const ConstPoolVal*)V)->getStrValue() << ":" + // << ((const Constant*)V)->getStrValue() << ":" // << Out.size() << "\n"; outputConstant(CPV); } else { diff --git a/lib/Bytecode/Writer/WriterInternals.h b/lib/Bytecode/Writer/WriterInternals.h index ff49c1d7fb..8a929870f4 100644 --- a/lib/Bytecode/Writer/WriterInternals.h +++ b/lib/Bytecode/Writer/WriterInternals.h @@ -39,7 +39,7 @@ private : void outputModuleInfoBlock(const Module *C); void outputSymbolTable(const SymbolTable &ST); - bool outputConstant(const ConstPoolVal *CPV); + bool outputConstant(const Constant *CPV); void outputType(const Type *T); }; |