aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Instruction.h
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-07-14 22:48:20 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-07-14 22:48:20 +0000
commit5814008f4b77774c8563578e1562c9c24a6750c2 (patch)
tree9743ae14c322aa57ec4cf1bb13b7dad94bf23415 /include/llvm/Instruction.h
parent29ab9f83481cd21abf3055c7c32ea1df953ae167 (diff)
downloadexternal_llvm-5814008f4b77774c8563578e1562c9c24a6750c2.zip
external_llvm-5814008f4b77774c8563578e1562c9c24a6750c2.tar.gz
external_llvm-5814008f4b77774c8563578e1562c9c24a6750c2.tar.bz2
Create a static version of Instruction::getOpcodeName(opCode) that
can be invoked with only an opcode (i.e., without an instruction). Move all opCode->opCodeName translations there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instruction.h')
-rw-r--r--include/llvm/Instruction.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 7cdee5d..e13d1b7 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -59,8 +59,11 @@ public:
// Subclass classification... getOpcode() returns a member of
// one of the enums that is coming soon (down below)...
//
- virtual const char *getOpcodeName() const = 0;
unsigned getOpcode() const { return iType; }
+ virtual const char *getOpcodeName() const {
+ return getOpcodeName(getOpcode());
+ }
+ static const char* getOpcodeName(unsigned OpCode);
inline bool isTerminator() const { // Instance of TerminatorInst?
return iType >= FirstTermOp && iType < NumTermOps;