summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreTargetObjectFile.h
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2013-12-02 10:18:31 +0000
committerRobert Lytton <robert@xmos.com>2013-12-02 10:18:31 +0000
commitff38d37c77ac4195827f6c3efcc0353e20347ea3 (patch)
tree865041c299ddceb6e6c93e9db5f2c49f16ec76ef /llvm/lib/Target/XCore/XCoreTargetObjectFile.h
parent7f4d1c9d112d637ad5b2f6d023040ef219134e92 (diff)
downloadbcm5719-llvm-ff38d37c77ac4195827f6c3efcc0353e20347ea3.tar.gz
bcm5719-llvm-ff38d37c77ac4195827f6c3efcc0353e20347ea3.zip
XCore target: Add large code model
When using large code model: Global objects larger than 'CodeModelLargeSize' bytes are placed in sections named with a trailing ".large" The folded global address of such objects are lowered into the const pool. During inspection it was noted that LowerConstantPool() was using a default offset of zero. A fix was made, but due to only offsets of zero being generated, testing only verifies the change is not detrimental. Correct the flags emitted for explicitly specified sections. We assume the size of the object queried by getSectionForConstant() is never greater than CodeModelLargeSize. To handle greater than CodeModelLargeSize, changes to AsmPrinter would be required. llvm-svn: 196087
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreTargetObjectFile.h')
-rw-r--r--llvm/lib/Target/XCore/XCoreTargetObjectFile.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Target/XCore/XCoreTargetObjectFile.h b/llvm/lib/Target/XCore/XCoreTargetObjectFile.h
index 27875e783b3..bf9798d5085 100644
--- a/llvm/lib/Target/XCore/XCoreTargetObjectFile.h
+++ b/llvm/lib/Target/XCore/XCoreTargetObjectFile.h
@@ -14,11 +14,24 @@
namespace llvm {
+static const unsigned CodeModelLargeSize = 256;
+
class XCoreTargetObjectFile : public TargetLoweringObjectFileELF {
+ const MCSection *BSSSectionLarge;
+ const MCSection *DataSectionLarge;
+ const MCSection *ReadOnlySectionLarge;
public:
void Initialize(MCContext &Ctx, const TargetMachine &TM);
- // TODO: Classify globals as xcore wishes.
+ virtual const MCSection *
+ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
+ Mangler *Mang, const TargetMachine &TM) const;
+
+ virtual const MCSection *
+ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
+ Mangler *Mang, const TargetMachine &TM) const;
+
+ virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
};
} // end namespace llvm
OpenPOWER on IntegriCloud