Support Constant Pool Sections
Add section symbols to the symbol table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74170 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/ELFCodeEmitter.h b/lib/CodeGen/ELFCodeEmitter.h
index c0289da..c309ef7 100644
--- a/lib/CodeGen/ELFCodeEmitter.h
+++ b/lib/CodeGen/ELFCodeEmitter.h
@@ -31,6 +31,14 @@
/// emitted.
std::vector<MachineRelocation> Relocations;
+ /// CPLocations - This is a map of constant pool indices to offsets from the
+ /// start of the section for that constant pool index.
+ std::vector<uintptr_t> CPLocations;
+
+ /// CPSections - This is a map of constant pool indices to the MachOSection
+ /// containing the constant pool entry for that index.
+ std::vector<unsigned> CPSections;
+
/// MBBLocations - This vector is a mapping from MBB ID's to their address.
/// It is filled in by the StartMachineBasicBlock callback and queried by
/// the getMachineBasicBlockAddress callback.
@@ -62,9 +70,10 @@
}
virtual uintptr_t getConstantPoolEntryAddress(unsigned Index) const {
- assert(0 && "CP not implementated yet!");
- return 0;
+ assert(CPLocations.size() > Index && "CP not emitted!");
+ return CPLocations[Index];
}
+
virtual uintptr_t getJumpTableEntryAddress(unsigned Index) const {
assert(0 && "JT not implementated yet!");
return 0;
@@ -86,6 +95,10 @@
abort();
}
+ /// emitConstantPool - For each constant pool entry, figure out which section
+ /// the constant should live in and emit the constant.
+ void emitConstantPool(MachineConstantPool *MCP);
+
virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { }
/// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE!