[llvm-commits] [llvm] r140230 - in /llvm/trunk/lib/Target/Mips: MipsSubtarget.cpp MipsSubtarget.h
Akira Hatanaka
ahatanak at gmail.com
Tue Sep 20 19:45:30 PDT 2011
Author: ahatanak
Date: Tue Sep 20 21:45:29 2011
New Revision: 140230
URL: http://llvm.org/viewvc/llvm-project?rev=140230&view=rev
Log:
Set ABI if it hasn't been set on the command line.
Check if architecture & ABI combination is valid.
Modified:
llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp
llvm/trunk/lib/Target/Mips/MipsSubtarget.h
Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp?rev=140230&r1=140229&r2=140230&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSubtarget.cpp Tue Sep 20 21:45:29 2011
@@ -39,6 +39,15 @@
// Initialize scheduling itinerary for the specified CPU.
InstrItins = getInstrItineraryForCPU(CPUName);
+ // Set MipsABI if it hasn't been set yet.
+ if (MipsABI == UnknownABI)
+ MipsABI = hasMips64() ? N64 : O32;
+
+ // Check if Architecture and ABI are compatible.
+ assert(((!hasMips64() && (isABI_O32() || isABI_EABI())) ||
+ (hasMips64() && (isABI_N32() || isABI_N64()))) &&
+ "Invalid Arch & ABI pair.");
+
// Is the target system Linux ?
if (TT.find("linux") == std::string::npos)
IsLinux = false;
Modified: llvm/trunk/lib/Target/Mips/MipsSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSubtarget.h?rev=140230&r1=140229&r2=140230&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSubtarget.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsSubtarget.h Tue Sep 20 21:45:29 2011
@@ -29,7 +29,7 @@
public:
// NOTE: O64 will not be supported.
enum MipsABIEnum {
- O32, N32, N64, EABI
+ UnknownABI, O32, N32, N64, EABI
};
protected:
More information about the llvm-commits
mailing list