aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-09 06:14:26 +0000
committerChris Lattner <sabre@nondot.org>2003-10-09 06:14:26 +0000
commitbf43ac6abf3b4a50ef2ae658628213980d6ae563 (patch)
tree8738852cc4ba45eb61986c4028f16ac2ae4f8993
parent8eb10cef39c7ac99a8992e17f7a4941bfcbeef31 (diff)
downloadexternal_llvm-bf43ac6abf3b4a50ef2ae658628213980d6ae563.zip
external_llvm-bf43ac6abf3b4a50ef2ae658628213980d6ae563.tar.gz
external_llvm-bf43ac6abf3b4a50ef2ae658628213980d6ae563.tar.bz2
Eliminate the instruction placeholder. Simplify a bunch of code.
This results in no significant speedup, but does provide simpler code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8980 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Bytecode/Reader/Reader.cpp2
-rw-r--r--lib/Bytecode/Reader/ReaderInternals.h14
2 files changed, 1 insertions, 15 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 714d813..4011af7 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -134,7 +134,7 @@ Value *BytecodeParser::getValue(unsigned type, unsigned oNum, bool Create) {
if (I != ForwardReferences.end() && I->first == KeyValue)
return I->second; // We have already created this placeholder
- Value *Val = new ValPHolder(getType(type), oNum);
+ Value *Val = new Argument(getType(type));
ForwardReferences.insert(I, std::make_pair(KeyValue, Val));
return Val;
}
diff --git a/lib/Bytecode/Reader/ReaderInternals.h b/lib/Bytecode/Reader/ReaderInternals.h
index d53fcab..410be3a 100644
--- a/lib/Bytecode/Reader/ReaderInternals.h
+++ b/lib/Bytecode/Reader/ReaderInternals.h
@@ -203,20 +203,12 @@ public:
unsigned getID() { return ID; }
};
-struct InstPlaceHolderHelper : public Instruction {
- InstPlaceHolderHelper(const Type *Ty) : Instruction(Ty, UserOp1, "") {}
- virtual const char *getOpcodeName() const { return "placeholder"; }
-
- virtual Instruction *clone() const { abort(); return 0; }
-};
-
struct ConstantPlaceHolderHelper : public Constant {
ConstantPlaceHolderHelper(const Type *Ty)
: Constant(Ty) {}
virtual bool isNullValue() const { return false; }
};
-typedef PlaceholderDef<InstPlaceHolderHelper> ValPHolder;
typedef PlaceholderDef<ConstantPlaceHolderHelper> ConstPHolder;
// Some common errors we find
@@ -225,12 +217,6 @@ static const std::string Error_read = "read(): error reading.";
static const std::string Error_inputdata = "input_data(): error reading.";
static const std::string Error_DestSlot = "No destination slot found.";
-static inline unsigned getValueIDNumberFromPlaceHolder(Value *Val) {
- if (isa<Constant>(Val))
- return ((ConstPHolder*)Val)->getID();
- return ((ValPHolder*)Val)->getID();
-}
-
static inline void readBlock(const unsigned char *&Buf,
const unsigned char *EndBuf,
unsigned &Type, unsigned &Size) {