Renamed inst_const_iterator -> const_inst_iterator

Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-12-04 00:03:30 +00:00
parent e9bb2df410
commit 7a17675206
53 changed files with 146 additions and 147 deletions

View File

@ -305,7 +305,7 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf,
// Create a placeholder for the global variable reference...
GlobalVariable *GVar =
new GlobalVariable(PT->getValueType(), false, true);
new GlobalVariable(PT->getElementType(), false, true);
// Keep track of the fact that we have a forward ref to recycle it
GlobalRefs.insert(make_pair(make_pair(PT, Slot), GVar));

View File

@ -227,7 +227,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
// Check to make sure we have a pointer to method type
PointerType *PTy = dyn_cast<PointerType>(M->getType());
if (PTy == 0) return failure(true);
MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType());
MethodType *MTy = dyn_cast<MethodType>(PTy->getElementType());
if (MTy == 0) return failure(true);
vector<Value *> Params;
@ -287,7 +287,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
// Check to make sure we have a pointer to method type
PointerType *PTy = dyn_cast<PointerType>(M->getType());
if (PTy == 0) return failure(true);
MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType());
MethodType *MTy = dyn_cast<MethodType>(PTy->getElementType());
if (MTy == 0) return failure(true);
vector<Value *> Params;
@ -351,7 +351,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
vector<Value*> Idx;
if (!isa<PointerType>(Raw.Ty)) return failure(true);
const CompositeType *TopTy =
dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getValueType());
dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getElementType());
switch (Raw.NumOperands) {
case 0: cerr << "Invalid load encountered!\n"; return failure(true);
@ -405,7 +405,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
vector<Value*> Idx;
if (!isa<PointerType>(Raw.Ty)) return failure(true);
const CompositeType *TopTy =
dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getValueType());
dyn_cast<CompositeType>(cast<PointerType>(Raw.Ty)->getElementType());
switch (Raw.NumOperands) {
case 0:

View File

@ -262,7 +262,7 @@ bool BytecodeParser::ParseMethod(const uchar *&Buf, const uchar *EndBuf,
}
const PointerType *PMTy = MethodSignatureList.front().first; // PtrMeth
const MethodType *MTy = dyn_cast<const MethodType>(PMTy->getValueType());
const MethodType *MTy = dyn_cast<const MethodType>(PMTy->getElementType());
if (MTy == 0) return failure(true); // Not ptr to method!
unsigned isInternal;
@ -392,7 +392,7 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
}
const PointerType *PTy = cast<const PointerType>(Ty);
const Type *ElTy = PTy->getValueType();
const Type *ElTy = PTy->getElementType();
Constant *Initializer = 0;
if (VarType & 2) { // Does it have an initalizer?
@ -430,13 +430,13 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
while (MethSignature != Type::VoidTyID) { // List is terminated by Void
const Type *Ty = getType(MethSignature);
if (!Ty || !isa<PointerType>(Ty) ||
!isa<MethodType>(cast<PointerType>(Ty)->getValueType())) {
!isa<MethodType>(cast<PointerType>(Ty)->getElementType())) {
Error = "Method not ptr to meth type! Ty = " + Ty->getDescription();
return failure(true);
}
// We create methods by passing the underlying MethodType to create...
Ty = cast<PointerType>(Ty)->getValueType();
Ty = cast<PointerType>(Ty)->getElementType();
// When the ModuleGlobalInfo section is read, we load the type of each
// method and the 'ModuleValues' slot that it lands in. We then load a

View File

@ -74,7 +74,7 @@ void BytecodeWriter::outputType(const Type *T) {
case Type::PointerTyID: {
const PointerType *PT = cast<const PointerType>(T);
int Slot = Table.getValSlot(PT->getValueType());
int Slot = Table.getValSlot(PT->getElementType());
assert(Slot != -1 && "Type used but not available!!");
output_vbr((unsigned)Slot, Out);
break;

View File

@ -226,13 +226,13 @@ void BytecodeWriter::processInstruction(const Instruction *I) {
NumOperands++;
} else if (const CallInst *CI = dyn_cast<CallInst>(I)) {// Handle VarArg calls
PointerType *Ty = cast<PointerType>(CI->getCalledValue()->getType());
if (cast<MethodType>(Ty->getValueType())->isVarArg()) {
if (cast<MethodType>(Ty->getElementType())->isVarArg()) {
outputInstrVarArgsCall(I, Table, Type, Out);
return;
}
} else if (const InvokeInst *II = dyn_cast<InvokeInst>(I)) { // ... & Invokes
PointerType *Ty = cast<PointerType>(II->getCalledValue()->getType());
if (cast<MethodType>(Ty->getValueType())->isVarArg()) {
if (cast<MethodType>(Ty->getElementType())->isVarArg()) {
outputInstrVarArgsCall(I, Table, Type, Out);
return;
}

View File

@ -237,7 +237,7 @@ int SlotCalculator::insertValue(const Value *D) {
// of const ints), that they are inserted also. Same for global variable
// initializers.
//
for(User::op_const_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I)
for(User::const_op_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I)
if (!isa<GlobalValue>(*I)) // Don't chain insert global values
insertValue(*I);
}