summaryrefslogtreecommitdiff
path: root/include/llvm/Value.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-27 18:38:24 +0000
committerChris Lattner <sabre@nondot.org>2004-06-27 18:38:24 +0000
commit7da38ec915010576685200089c75a2135bd3fa97 (patch)
treee9b58bf0ad554b25460dbc85d311744dd1c39529 /include/llvm/Value.h
parent6b5f30f36511d76b306080e09879f993ff9faccd (diff)
downloadllvm-7da38ec915010576685200089c75a2135bd3fa97.tar.gz
llvm-7da38ec915010576685200089c75a2135bd3fa97.tar.bz2
llvm-7da38ec915010576685200089c75a2135bd3fa97.tar.xz
Eliminate the Instruction::iType field, folding it into the Value::VTy field.
This reduces the size of the instruction class by 4 bytes, and means that isa<CallInst>(V) (for example) only needs to do one load from memory instead of two. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Value.h')
-rw-r--r--include/llvm/Value.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index c47c96962f..7d870d6709 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -133,6 +133,11 @@ public:
unsigned getValueType() const {
return SubclassID;
}
+
+private:
+ /// FIXME: this is a gross hack, needed by another gross hack. Eliminate!
+ void setValueType(unsigned VT) { SubclassID = VT; }
+ friend class Instruction;
};
inline std::ostream &operator<<(std::ostream &OS, const Value *V) {
@@ -190,7 +195,7 @@ template <> inline bool isa_impl<Argument, Value>(const Value &Val) {
return Val.getValueType() == Value::ArgumentVal;
}
template <> inline bool isa_impl<Instruction, Value>(const Value &Val) {
- return Val.getValueType() == Value::InstructionVal;
+ return Val.getValueType() >= Value::InstructionVal;
}
template <> inline bool isa_impl<BasicBlock, Value>(const Value &Val) {
return Val.getValueType() == Value::BasicBlockVal;