From 8716cdfb527c97b3d1d3e9e26fe4c0fca7182884 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 28 Oct 2001 21:24:50 +0000 Subject: [PATCH] Added a constant pool to record values that need to be emitted in the assembly code. llvm-svn: 999 --- llvm/include/llvm/CodeGen/MachineInstr.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index eea3f0331224..83798aed22f0 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -20,6 +20,8 @@ #include "llvm/Support/DataTypes.h" #include "llvm/Support/NonCopyable.h" #include "llvm/Target/MachineInstrInfo.h" +#include "hash_map" +#include "hash_set" template class ValOpIterator; @@ -110,7 +112,7 @@ public: return (unsigned) regNum; } inline int64_t getImmedValue () const { - assert(opType >= MO_SignExtendedImmed || opType <= MO_PCRelativeDisp); + assert(opType == MO_SignExtendedImmed || opType == MO_UnextendedImmed); return immedVal; } inline bool opIsDef () const { @@ -512,6 +514,7 @@ private: unsigned automaticVarsSize; unsigned regSpillsSize; unsigned optionalOutgoingArgsSize; + hash_set constantsForConstPool; hash_map offsetsFromFP; hash_map offsetsFromSP; @@ -529,7 +532,12 @@ public: inline unsigned getAutomaticVarsSize() const { return automaticVarsSize; } inline unsigned getRegSpillsSize() const { return regSpillsSize; } inline unsigned getOptionalOutgoingArgsSize() const - { return optionalOutgoingArgsSize;} + { return optionalOutgoingArgsSize; } + inline const hash_set& + getConstantPoolValues() const {return constantsForConstPool;} + + void addToConstantPool (const ConstPoolVal* constVal) + { constantsForConstPool.insert(constVal); } inline void markAsLeafMethod() { compiledAsLeaf = true; }