diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-07-07 19:24:15 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-07-07 19:24:15 +0000 |
| commit | b1ca9cbceb9968ac5e58522707e0c31395beb5b6 (patch) | |
| tree | d36633297446939118d8e9da554bf54f369f0ebd /llvm/lib/Bytecode | |
| parent | 48d80e18f983b8f97a715b540b47883f60069e8d (diff) | |
| download | bcm5719-llvm-b1ca9cbceb9968ac5e58522707e0c31395beb5b6.tar.gz bcm5719-llvm-b1ca9cbceb9968ac5e58522707e0c31395beb5b6.zip | |
Broad superficial changes:
* Renamed getOpcode to getOpcodeName
* Changed getOpcodeName to return a const char * instead of string
* Added a getOpcode method to replace getInstType
* Changed code to use getOpcode instead of getInstType
llvm-svn: 152
Diffstat (limited to 'llvm/lib/Bytecode')
| -rw-r--r-- | llvm/lib/Bytecode/Reader/ReaderInternals.h | 2 | ||||
| -rw-r--r-- | llvm/lib/Bytecode/Writer/InstructionWriter.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Bytecode/Reader/ReaderInternals.h b/llvm/lib/Bytecode/Reader/ReaderInternals.h index fffcdb83c7a..c73b6c06e7e 100644 --- a/llvm/lib/Bytecode/Reader/ReaderInternals.h +++ b/llvm/lib/Bytecode/Reader/ReaderInternals.h @@ -94,7 +94,7 @@ public: struct InstPlaceHolderHelper : public Instruction { InstPlaceHolderHelper(const Type *Ty) : Instruction(Ty, UserOp1, "") {} - virtual string getOpcode() const { return "placeholder"; } + virtual const char *getOpcodeName() const { return "placeholder"; } virtual Instruction *clone() const { abort(); return 0; } }; diff --git a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp index 0cd93c04fdb..3bd9a0902b6 100644 --- a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp +++ b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp @@ -29,7 +29,7 @@ static void outputInstructionFormat0(const Instruction *I, const SlotCalculator &Table, unsigned Type, vector<uchar> &Out) { // Opcode must have top two bits clear... - output_vbr(I->getInstType(), Out); // Instruction Opcode ID + output_vbr(I->getOpcode(), Out); // Instruction Opcode ID output_vbr(Type, Out); // Result type unsigned NumArgs = I->getNumOperands(); @@ -51,7 +51,7 @@ static void outputInstructionFormat0(const Instruction *I, static void outputInstructionFormat1(const Instruction *I, const SlotCalculator &Table, int *Slots, unsigned Type, vector<uchar> &Out) { - unsigned IType = I->getInstType(); // Instruction Opcode ID + unsigned IType = I->getOpcode(); // Instruction Opcode ID // bits Instruction format: // -------------------------- @@ -72,7 +72,7 @@ static void outputInstructionFormat1(const Instruction *I, static void outputInstructionFormat2(const Instruction *I, const SlotCalculator &Table, int *Slots, unsigned Type, vector<uchar> &Out) { - unsigned IType = I->getInstType(); // Instruction Opcode ID + unsigned IType = I->getOpcode(); // Instruction Opcode ID // bits Instruction format: // -------------------------- @@ -96,7 +96,7 @@ static void outputInstructionFormat2(const Instruction *I, static void outputInstructionFormat3(const Instruction *I, const SlotCalculator &Table, int *Slots, unsigned Type, vector<uchar> &Out) { - unsigned IType = I->getInstType(); // Instruction Opcode ID + unsigned IType = I->getOpcode(); // Instruction Opcode ID // bits Instruction format: // -------------------------- @@ -115,7 +115,7 @@ static void outputInstructionFormat3(const Instruction *I, } bool BytecodeWriter::processInstruction(const Instruction *I) { - assert(I->getInstType() < 64 && "Opcode too big???"); + assert(I->getOpcode() < 64 && "Opcode too big???"); unsigned NumOperands = I->getNumOperands(); int MaxOpSlot = 0; @@ -136,8 +136,8 @@ bool BytecodeWriter::processInstruction(const Instruction *I) { // we take the type of the instruction itself. // const Type *Ty = NumOperands ? I->getOperand(0)->getType() : I->getType(); - if (I->getInstType() == Instruction::Malloc || - I->getInstType() == Instruction::Alloca) + if (I->getOpcode() == Instruction::Malloc || + I->getOpcode() == Instruction::Alloca) Ty = I->getType(); // Malloc & Alloca ALWAYS want to encode the return type unsigned Type; |

