1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Clean up ARM subtarget code by using Triple ADT.

llvm-svn: 123276
This commit is contained in:
Evan Cheng 2011-01-11 21:46:47 +00:00
parent 7b5cf4eafc
commit 05ef00f4dc
6 changed files with 16 additions and 14 deletions

View File

@ -14,14 +14,15 @@
#define DEBUG_TYPE "asm-printer"
#include "ARM.h"
#include "ARMBuildAttrs.h"
#include "ARMAddressingModes.h"
#include "ARMConstantPoolValue.h"
#include "InstPrinter/ARMInstPrinter.h"
#include "ARMAsmPrinter.h"
#include "ARMAddressingModes.h"
#include "ARMBuildAttrs.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMConstantPoolValue.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMTargetMachine.h"
#include "ARMTargetObjectFile.h"
#include "InstPrinter/ARMInstPrinter.h"
#include "llvm/Analysis/DebugInfo.h"
#include "llvm/Constants.h"
#include "llvm/Module.h"

View File

@ -14,6 +14,7 @@
#include "ARMFrameLowering.h"
#include "ARMAddressingModes.h"
#include "ARMBaseInstrInfo.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMMachineFunctionInfo.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"

View File

@ -9,6 +9,7 @@
#include "ARMHazardRecognizer.h"
#include "ARMBaseInstrInfo.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMSubtarget.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/ScheduleDAG.h"

View File

@ -13,6 +13,7 @@
#include "ARMSubtarget.h"
#include "ARMGenSubtarget.inc"
#include "ARMBaseRegisterInfo.h"
#include "llvm/GlobalValue.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/CommandLine.h"
@ -56,7 +57,7 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &FS,
, AllowsUnalignedMem(false)
, stackAlignment(4)
, CPUString("generic")
, TargetType(isELF) // Default to ELF unless otherwise specified.
, TargetTriple(TT)
, TargetABI(ARM_ABI_APCS) {
// Default to soft float ABI
if (FloatABIType == FloatABI::Default)
@ -118,12 +119,6 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &FS,
}
}
if (Len >= 10) {
if (TT.find("-darwin") != std::string::npos)
// arm-darwin
TargetType = isDarwin;
}
if (TT.find("eabi") != std::string::npos)
TargetABI = ARM_ABI_AAPCS;

View File

@ -17,7 +17,7 @@
#include "llvm/Target/TargetInstrItineraries.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetSubtarget.h"
#include "ARMBaseRegisterInfo.h"
#include "llvm/ADT/Triple.h"
#include <string>
namespace llvm {
@ -126,6 +126,9 @@ protected:
/// CPUString - String name of used CPU.
std::string CPUString;
/// TargetTriple - What processor and OS we're targeting.
Triple TargetTriple;
/// Selected instruction itineraries (one entry per itinerary class.)
InstrItineraryData InstrItins;
@ -187,8 +190,8 @@ protected:
bool hasFP16() const { return HasFP16; }
bool hasD16() const { return HasD16; }
bool isTargetDarwin() const { return TargetType == isDarwin; }
bool isTargetELF() const { return TargetType == isELF; }
bool isTargetDarwin() const { return TargetTriple.getOS() == Triple::Darwin; }
bool isTargetELF() const { return !isTargetDarwin(); }
bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; }
bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; }

View File

@ -9,6 +9,7 @@
#include "ARM.h"
#include "ARMAddressingModes.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMSubtarget.h"
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"