summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-02-13 19:52:28 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-02-13 19:52:28 +0000
commit048e16ff8f4f4524fbf545511ce46c63d0c6dc0e (patch)
treef43e8690d48bdfb6385b2426ee9809bc73d55163 /llvm/lib/Target/ARM
parentabde3cc16cced4e15e6103f0d4e446b6f518f52c (diff)
downloadbcm5719-llvm-048e16ff8f4f4524fbf545511ce46c63d0c6dc0e.tar.gz
bcm5719-llvm-048e16ff8f4f4524fbf545511ce46c63d0c6dc0e.zip
Add ABI information to ARM subtarget.
llvm-svn: 34245
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.cpp14
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h10
-rw-r--r--llvm/lib/Target/ARM/ARMTargetMachine.cpp8
3 files changed, 24 insertions, 8 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp
index 27889c7818d..4363697d3e3 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.cpp
+++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp
@@ -26,8 +26,9 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS)
, HasVFP2(false)
, UseThumbBacktraces(false)
, IsR9Reserved(false)
- , stackAlignment(8)
- , TargetType(isELF) { // Default to ELF unless otherwise specified.
+ , stackAlignment(4)
+ , TargetType(isELF) // Default to ELF unless otherwise specified.
+ , TargetABI(ARM_ABI_APCS) {
// Determine default and user specified characteristics
std::string CPU = "generic";
@@ -49,9 +50,14 @@ ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS)
#endif
}
+ if (TT.find("eabi") != std::string::npos)
+ TargetABI = ARM_ABI_AAPCS;
+
+ if (isAAPCS_ABI())
+ stackAlignment = 8;
+
if (isTargetDarwin()) {
UseThumbBacktraces = true;
IsR9Reserved = true;
- stackAlignment = 4;
- }
+ }
}
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 33e440b0cf4..88ceaef7b66 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -42,7 +42,7 @@ protected:
/// IsR9Reserved - True if R9 is a not available as general purpose register.
bool IsR9Reserved;
-
+
/// stackAlignment - The minimum alignment known to hold of the stack frame on
/// entry to the function and which must be maintained by every function.
unsigned stackAlignment;
@@ -52,6 +52,11 @@ protected:
isELF, isDarwin
} TargetType;
+ enum {
+ ARM_ABI_APCS,
+ ARM_ABI_AAPCS // ARM EABI
+ } TargetABI;
+
/// This constructor initializes the data members to match that
/// of the specified module.
///
@@ -71,6 +76,9 @@ protected:
bool isTargetDarwin() const { return TargetType == isDarwin; }
bool isTargetELF() const { return TargetType == isELF; }
+ bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; }
+ bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; }
+
bool isThumb() const { return IsThumb; }
bool useThumbBacktraces() const { return UseThumbBacktraces; }
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp
index 442d25ecc25..31884045225 100644
--- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp
@@ -34,13 +34,15 @@ namespace {
///
ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
: Subtarget(M, FS),
- DataLayout(Subtarget.isTargetDarwin() ?
+ DataLayout(Subtarget.isAPCS_ABI() ?
+ //APCS ABI
(Subtarget.isThumb() ?
std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32-A:32") :
std::string("e-p:32:32-d:32:32-l:32:32")) :
+ //AAPCS ABI
(Subtarget.isThumb() ?
- std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") :
- std::string("e-p:32:32-d:32:64-l:64:64"))),
+ std::string("e-p:32:32-d:64:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") :
+ std::string("e-p:32:32-d:64:64-l:64:64"))),
InstrInfo(Subtarget),
FrameInfo(Subtarget) {}
OpenPOWER on IntegriCloud