aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineConstantPool.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-01-13 01:01:31 +0000
committerChris Lattner <sabre@nondot.org>2003-01-13 01:01:31 +0000
commitdb00065fc8ab9fe8b7ac87640c57fd61e922c0f2 (patch)
tree71e2d98f9f05d4bf0fadb7b53a060b04e005f679 /include/llvm/CodeGen/MachineConstantPool.h
parent0d448c03f30d7f4f7fa27fea1478aaf35e954f56 (diff)
downloadexternal_llvm-db00065fc8ab9fe8b7ac87640c57fd61e922c0f2.zip
external_llvm-db00065fc8ab9fe8b7ac87640c57fd61e922c0f2.tar.gz
external_llvm-db00065fc8ab9fe8b7ac87640c57fd61e922c0f2.tar.bz2
Add new files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineConstantPool.h')
-rw-r--r--include/llvm/CodeGen/MachineConstantPool.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h
new file mode 100644
index 0000000..06394ff
--- /dev/null
+++ b/include/llvm/CodeGen/MachineConstantPool.h
@@ -0,0 +1,45 @@
+//===-- CodeGen/MachineConstantPool.h - Abstract Constant Pool --*- C++ -*-===//
+//
+// The MachineConstantPool class keeps track of constants referenced by a
+// function which must be spilled to memory. This is used for constants which
+// are unable to be used directly as operands to instructions, which typically
+// include floating point and large integer constants.
+//
+// Instructions reference the address of these constant pool constants through
+// the use of MO_ConstantPoolIndex values. When emitting assembly or machine
+// code, these virtual address references are converted to refer to the
+// address of the function constant pool values.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_MACHINECONSTANTPOOL_H
+#define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
+
+#include <vector>
+class Constant;
+
+class MachineConstantPool {
+ std::vector<Constant*> Constants;
+public:
+
+ /// getConstantPoolIndex - Create a new entry in the constant pool or return
+ /// an existing one. This should eventually allow sharing of duplicate
+ /// objects in the constant pool, but this is adequate for now.
+ ///
+ unsigned getConstantPoolIndex(Constant *C) {
+ Constants.push_back(C);
+ return Constants.size()-1;
+ }
+
+ const std::vector<Constant*> &getConstants() const { return Constants; }
+
+ /// print - Used by the MachineFunction printer to print information about
+ /// stack objects. Implemented in MachineFunction.cpp
+ ///
+ void print(std::ostream &OS) const;
+
+ /// dump - Call print(std::cerr) to be called from the debugger.
+ void dump() const;
+};
+
+#endif