aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-04 22:19:18 +0000
committerChris Lattner <sabre@nondot.org>2002-04-04 22:19:18 +0000
commit2aac6bf66a4f4486e14ee5bdc96277ec770afdc7 (patch)
tree7c0149ec42632ae549ecdb13e45c1ec780eb3063 /lib
parent3d0dceb733fe8d5d916eab58d923eb7ff491d6c6 (diff)
downloadexternal_llvm-2aac6bf66a4f4486e14ee5bdc96277ec770afdc7.zip
external_llvm-2aac6bf66a4f4486e14ee5bdc96277ec770afdc7.tar.gz
external_llvm-2aac6bf66a4f4486e14ee5bdc96277ec770afdc7.tar.bz2
s/MethodType/FunctionType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AsmParser/ParserInternals.h12
-rw-r--r--lib/Bytecode/Reader/InstructionReader.cpp12
-rw-r--r--lib/Bytecode/Writer/InstructionWriter.cpp4
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp6
-rw-r--r--lib/Target/SparcV9/SparcV9RegInfo.cpp6
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp10
-rw-r--r--lib/Transforms/Instrumentation/TraceValues.cpp4
-rw-r--r--lib/VMCore/iCall.cpp16
8 files changed, 34 insertions, 36 deletions
diff --git a/lib/AsmParser/ParserInternals.h b/lib/AsmParser/ParserInternals.h
index e1e2c49..2291a5a 100644
--- a/lib/AsmParser/ParserInternals.h
+++ b/lib/AsmParser/ParserInternals.h
@@ -15,7 +15,7 @@
#include "llvm/BasicBlock.h"
#include "llvm/ConstantVals.h"
#include "llvm/iOther.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Assembly/Parser.h"
#include "Support/StringExtras.h"
@@ -174,9 +174,9 @@ struct BBPlaceHolderHelper : public BasicBlock {
}
};
-struct MethPlaceHolderHelper : public Method {
- MethPlaceHolderHelper(const Type *Ty) : Method(cast<const MethodType>(Ty),
- true) {}
+struct MethPlaceHolderHelper : public Function {
+ MethPlaceHolderHelper(const Type *Ty)
+ : Function(cast<FunctionType>(Ty), true) {}
};
typedef PlaceholderValue<InstPlaceHolderHelper> ValuePlaceHolder;
@@ -185,7 +185,7 @@ typedef PlaceholderValue<BBPlaceHolderHelper> BBPlaceHolder;
static inline ValID &getValIDFromPlaceHolder(const Value *Val) {
const Type *Ty = Val->getType();
if (isa<PointerType>(Ty) &&
- isa<MethodType>(cast<PointerType>(Ty)->getElementType()))
+ isa<FunctionType>(cast<PointerType>(Ty)->getElementType()))
Ty = cast<PointerType>(Ty)->getElementType();
switch (Ty->getPrimitiveID()) {
@@ -197,7 +197,7 @@ static inline ValID &getValIDFromPlaceHolder(const Value *Val) {
static inline int getLineNumFromPlaceHolder(const Value *Val) {
const Type *Ty = Val->getType();
if (isa<PointerType>(Ty) &&
- isa<MethodType>(cast<PointerType>(Ty)->getElementType()))
+ isa<FunctionType>(cast<PointerType>(Ty)->getElementType()))
Ty = cast<PointerType>(Ty)->getElementType();
switch (Ty->getPrimitiveID()) {
diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp
index 8402db5..2d28db1 100644
--- a/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/lib/Bytecode/Reader/InstructionReader.cpp
@@ -230,14 +230,14 @@ 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->getElementType());
+ FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
if (MTy == 0) return failure(true);
vector<Value *> Params;
- const MethodType::ParamTypes &PL = MTy->getParamTypes();
+ const FunctionType::ParamTypes &PL = MTy->getParamTypes();
if (!MTy->isVarArg()) {
- MethodType::ParamTypes::const_iterator It = PL.begin();
+ FunctionType::ParamTypes::const_iterator It = PL.begin();
switch (Raw.NumOperands) {
case 0: cerr << "Invalid call instruction encountered!\n";
@@ -290,11 +290,11 @@ 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->getElementType());
+ FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
if (MTy == 0) return failure(true);
vector<Value *> Params;
- const MethodType::ParamTypes &PL = MTy->getParamTypes();
+ const FunctionType::ParamTypes &PL = MTy->getParamTypes();
vector<unsigned> &args = *Raw.VarArgs;
BasicBlock *Normal, *Except;
@@ -305,7 +305,7 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
Normal = cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2));
Except = cast<BasicBlock>(getValue(Type::LabelTy, args[0]));
- MethodType::ParamTypes::const_iterator It = PL.begin();
+ FunctionType::ParamTypes::const_iterator It = PL.begin();
for (unsigned i = 1; i < args.size(); i++) {
if (It == PL.end()) return failure(true);
// TODO: Check getValue for null!
diff --git a/lib/Bytecode/Writer/InstructionWriter.cpp b/lib/Bytecode/Writer/InstructionWriter.cpp
index f047ab5..0be903a 100644
--- a/lib/Bytecode/Writer/InstructionWriter.cpp
+++ b/lib/Bytecode/Writer/InstructionWriter.cpp
@@ -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->getElementType())->isVarArg()) {
+ if (cast<FunctionType>(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->getElementType())->isVarArg()) {
+ if (cast<FunctionType>(Ty->getElementType())->isVarArg()) {
outputInstrVarArgsCall(I, Table, Type, Out);
return;
}
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index 18b4a0a..7b6e597 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -327,9 +327,9 @@ ChooseAddInstructionByType(const Type* resultType)
MachineOpCode opCode = INVALID_OPCODE;
if (resultType->isIntegral() ||
- resultType->isPointerType() ||
- resultType->isLabelType() ||
- isa<MethodType>(resultType) ||
+ isa<PointerType>(resultType) ||
+ isa<FunctionType>(resultType) ||
+ resultType == Type::LabelTy ||
resultType == Type::BoolTy)
{
opCode = ADD;
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp
index 434816e..8ec2399 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -264,10 +264,8 @@ bool UltraSparcRegInfo::isVarArgCall(const MachineInstr *CallMI) const {
const MachineOperand & calleeOp = CallMI->getOperand(0);
Value *calleeVal = calleeOp.getVRegValue();
- PointerType *PT = cast<PointerType> (calleeVal->getType());
- MethodType *MT = cast<MethodType>(PT->getElementType());
-
- return MT->isVarArg();
+ PointerType *PT = cast<PointerType>(calleeVal->getType());
+ return cast<FunctionType>(PT->getElementType())->isVarArg();
}
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index cd76bdb..790f68f 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -832,7 +832,7 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
if (OpNum == 0) {
PointerType *PTy = dyn_cast<PointerType>(Ty);
if (PTy == 0) return false; // Can't convert to a non-pointer type...
- MethodType *MTy = dyn_cast<MethodType>(PTy->getElementType());
+ FunctionType *MTy = dyn_cast<FunctionType>(PTy->getElementType());
if (MTy == 0) return false; // Can't convert to a non ptr to method...
// Perform sanity checks to make sure that new method type has the
@@ -858,7 +858,7 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
// reason for this is that we prefer to have resolved methods but casted
// arguments if possible.
//
- const MethodType::ParamTypes &PTs = MTy->getParamTypes();
+ const FunctionType::ParamTypes &PTs = MTy->getParamTypes();
for (unsigned i = 0, NA = PTs.size(); i < NA; ++i)
if (!PTs[i]->isLosslesslyConvertableTo(I->getOperand(i+1)->getType()))
return false; // Operands must have compatible types!
@@ -871,7 +871,7 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
}
const PointerType *MPtr = cast<PointerType>(I->getOperand(0)->getType());
- const MethodType *MTy = cast<MethodType>(MPtr->getElementType());
+ const FunctionType *MTy = cast<FunctionType>(MPtr->getElementType());
if (!MTy->isVarArg()) return false;
if ((OpNum-1) < MTy->getParamTypes().size())
@@ -1100,8 +1100,8 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
if (Meth == OldVal) { // Changing the method pointer?
PointerType *NewPTy = cast<PointerType>(NewVal->getType());
- MethodType *NewTy = cast<MethodType>(NewPTy->getElementType());
- const MethodType::ParamTypes &PTs = NewTy->getParamTypes();
+ FunctionType *NewTy = cast<FunctionType>(NewPTy->getElementType());
+ const FunctionType::ParamTypes &PTs = NewTy->getParamTypes();
// Get an iterator to the call instruction so that we can insert casts for
// operands if needbe. Note that we do not require operands to be
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index e064caa..e31aeb8 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -67,8 +67,8 @@ Pass *createTraceValuesPassForBasicBlocks() { // Trace BB's and methods
//
bool InsertTraceCode::doInitialization(Module *M) {
const Type *SBP = PointerType::get(Type::SByteTy);
- const MethodType *MTy =
- MethodType::get(Type::IntTy, vector<const Type*>(1, SBP), true);
+ const FunctionType *MTy =
+ FunctionType::get(Type::IntTy, vector<const Type*>(1, SBP), true);
PrintfFunc = M->getOrInsertFunction("printf", MTy);
return false;
diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp
index 37eb24e..d757ea2 100644
--- a/lib/VMCore/iCall.cpp
+++ b/lib/VMCore/iCall.cpp
@@ -15,16 +15,16 @@
CallInst::CallInst(Value *Meth, const std::vector<Value*> &params,
const std::string &Name)
- : Instruction(cast<MethodType>(cast<PointerType>(Meth->getType())
+ : Instruction(cast<FunctionType>(cast<PointerType>(Meth->getType())
->getElementType())->getReturnType(),
Instruction::Call, Name) {
Operands.reserve(1+params.size());
Operands.push_back(Use(Meth, this));
- const MethodType *MTy =
- cast<MethodType>(cast<PointerType>(Meth->getType())->getElementType());
+ const FunctionType *MTy =
+ cast<FunctionType>(cast<PointerType>(Meth->getType())->getElementType());
- const MethodType::ParamTypes &PL = MTy->getParamTypes();
+ const FunctionType::ParamTypes &PL = MTy->getParamTypes();
assert((params.size() == PL.size()) ||
(MTy->isVarArg() && params.size() >= PL.size()) &&
"Calling a function with bad signature");
@@ -47,17 +47,17 @@ InvokeInst::InvokeInst(Value *Meth, BasicBlock *IfNormal, \
BasicBlock *IfException,
const std::vector<Value*> &params,
const std::string &Name)
- : TerminatorInst(cast<MethodType>(cast<PointerType>(Meth->getType())
+ : TerminatorInst(cast<FunctionType>(cast<PointerType>(Meth->getType())
->getElementType())->getReturnType(),
Instruction::Invoke, Name) {
Operands.reserve(3+params.size());
Operands.push_back(Use(Meth, this));
Operands.push_back(Use(IfNormal, this));
Operands.push_back(Use(IfException, this));
- const MethodType *MTy =
- cast<MethodType>(cast<PointerType>(Meth->getType())->getElementType());
+ const FunctionType *MTy =
+ cast<FunctionType>(cast<PointerType>(Meth->getType())->getElementType());
- const MethodType::ParamTypes &PL = MTy->getParamTypes();
+ const FunctionType::ParamTypes &PL = MTy->getParamTypes();
assert((params.size() == PL.size()) ||
(MTy->isVarArg() && params.size() > PL.size()) &&
"Calling a function with bad signature");