diff options
author | Jyotsna Verma <jverma@codeaurora.org> | 2013-05-07 16:42:15 +0000 |
---|---|---|
committer | Jyotsna Verma <jverma@codeaurora.org> | 2013-05-07 16:42:15 +0000 |
commit | 81fda3b4d55886ba40093e818125679bec126866 (patch) | |
tree | 3325c05661c9a6953fb68eadf45e7721ac08e008 /lib/Target/Hexagon/HexagonTargetObjectFile.cpp | |
parent | 46eb4a61c87642c1bd27ff5f7f05f9ca9c6debc3 (diff) | |
download | llvm-81fda3b4d55886ba40093e818125679bec126866.tar.gz llvm-81fda3b4d55886ba40093e818125679bec126866.tar.bz2 llvm-81fda3b4d55886ba40093e818125679bec126866.tar.xz |
Hexagon: Fix Small Data support to handle -G 0 correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Hexagon/HexagonTargetObjectFile.cpp')
-rw-r--r-- | lib/Target/Hexagon/HexagonTargetObjectFile.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/Hexagon/HexagonTargetObjectFile.cpp b/lib/Target/Hexagon/HexagonTargetObjectFile.cpp index 993fcfaed4..7773cff2d2 100644 --- a/lib/Target/Hexagon/HexagonTargetObjectFile.cpp +++ b/lib/Target/Hexagon/HexagonTargetObjectFile.cpp @@ -25,7 +25,8 @@ using namespace llvm; static cl::opt<int> SmallDataThreshold("hexagon-small-data-threshold", - cl::init(8), cl::Hidden); + cl::init(8), cl::Hidden, + cl::desc("The maximum size of an object in the sdata section")); void HexagonTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM) { @@ -46,6 +47,11 @@ void HexagonTargetObjectFile::Initialize(MCContext &Ctx, static bool IsInSmallSection(uint64_t Size) { return Size > 0 && Size <= (uint64_t)SmallDataThreshold; } + +bool HexagonTargetObjectFile::IsSmallDataEnabled () const { + return SmallDataThreshold > 0; +} + /// IsGlobalInSmallSection - Return true if this global value should be /// placed into small data/bss section. bool HexagonTargetObjectFile::IsGlobalInSmallSection(const GlobalValue *GV, |