[llvm-commits] CVS: llvm/lib/Target/ARM/ARMSubtarget.cpp ARMSubtarget.h ARMTargetMachine.cpp
Lauro Ramos Venancio
lauro.venancio at gmail.com
Tue Feb 13 11:52:46 PST 2007
Changes in directory llvm/lib/Target/ARM:
ARMSubtarget.cpp updated: 1.2 -> 1.3
ARMSubtarget.h updated: 1.2 -> 1.3
ARMTargetMachine.cpp updated: 1.21 -> 1.22
---
Log message:
Add ABI information to ARM subtarget.
---
Diffs of the changes: (+24 -8)
ARMSubtarget.cpp | 14 ++++++++++----
ARMSubtarget.h | 10 +++++++++-
ARMTargetMachine.cpp | 8 +++++---
3 files changed, 24 insertions(+), 8 deletions(-)
Index: llvm/lib/Target/ARM/ARMSubtarget.cpp
diff -u llvm/lib/Target/ARM/ARMSubtarget.cpp:1.2 llvm/lib/Target/ARM/ARMSubtarget.cpp:1.3
--- llvm/lib/Target/ARM/ARMSubtarget.cpp:1.2 Fri Jan 19 13:22:40 2007
+++ llvm/lib/Target/ARM/ARMSubtarget.cpp Tue Feb 13 13:52:28 2007
@@ -26,8 +26,9 @@
, 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 @@
#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;
- }
+ }
}
Index: llvm/lib/Target/ARM/ARMSubtarget.h
diff -u llvm/lib/Target/ARM/ARMSubtarget.h:1.2 llvm/lib/Target/ARM/ARMSubtarget.h:1.3
--- llvm/lib/Target/ARM/ARMSubtarget.h:1.2 Fri Jan 19 13:22:40 2007
+++ llvm/lib/Target/ARM/ARMSubtarget.h Tue Feb 13 13:52:28 2007
@@ -42,7 +42,7 @@
/// 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 @@
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 @@
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; }
Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp
diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.22
--- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 Tue Feb 13 08:07:13 2007
+++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 13:52:28 2007
@@ -34,13 +34,15 @@
///
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) {}
More information about the llvm-commits
mailing list