summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsSubtarget.h
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-08-22 03:18:13 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-08-22 03:18:13 +0000
commite7338cd550a4ccde6796d2987b482ea9f0e239ef (patch)
tree8a7a5d4c5768e1389c53c38dbf0db39827c1c50d /lib/Target/Mips/MipsSubtarget.h
parent6522a9e04bcfa447299f4fd10ee9afffd5834a47 (diff)
downloadllvm-e7338cd550a4ccde6796d2987b482ea9f0e239ef.tar.gz
llvm-e7338cd550a4ccde6796d2987b482ea9f0e239ef.tar.bz2
llvm-e7338cd550a4ccde6796d2987b482ea9f0e239ef.tar.xz
Add register Mips::GP to the list of reserved registers if target is bare-metal
to prevent it from being clobbered. mips uses $gp to access small data section. This bug was originally reported by Carl Norum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsSubtarget.h')
-rw-r--r--lib/Target/Mips/MipsSubtarget.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsSubtarget.h b/lib/Target/Mips/MipsSubtarget.h
index ba15362f07..0595e8dd0c 100644
--- a/lib/Target/Mips/MipsSubtarget.h
+++ b/lib/Target/Mips/MipsSubtarget.h
@@ -65,6 +65,9 @@ protected:
// isLinux - Target system is Linux. Is false we consider ELFOS for now.
bool IsLinux;
+ // UseSmallSection - Small section is used.
+ bool UseSmallSection;
+
/// Features related to the presence of specific instructions.
// HasSEInReg - SEB and SEH (signext in register) instructions.
@@ -109,7 +112,7 @@ public:
/// This constructor initializes the data members to match that
/// of the specified triple.
MipsSubtarget(const std::string &TT, const std::string &CPU,
- const std::string &FS, bool little);
+ const std::string &FS, bool little, Reloc::Model RM);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
@@ -133,6 +136,7 @@ public:
bool inMips16Mode() const { return InMips16Mode; }
bool isAndroid() const { return IsAndroid; }
bool isLinux() const { return IsLinux; }
+ bool useSmallSection() const { return UseSmallSection; }
bool hasStandardEncoding() const { return !inMips16Mode(); }