diff options
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/DarwinTargetAsmInfo.h | 2 | ||||
-rw-r--r-- | include/llvm/Target/Target.td | 1 | ||||
-rw-r--r-- | include/llvm/Target/TargetAsmInfo.h | 26 | ||||
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 2 | ||||
-rw-r--r-- | include/llvm/Target/TargetMachine.h | 8 | ||||
-rw-r--r-- | include/llvm/Target/TargetRegisterInfo.h | 30 | ||||
-rw-r--r-- | include/llvm/Target/TargetSelect.h | 65 |
7 files changed, 115 insertions, 19 deletions
diff --git a/include/llvm/Target/DarwinTargetAsmInfo.h b/include/llvm/Target/DarwinTargetAsmInfo.h index 6241ffe29b8f2..171a6b3e1177d 100644 --- a/include/llvm/Target/DarwinTargetAsmInfo.h +++ b/include/llvm/Target/DarwinTargetAsmInfo.h @@ -23,7 +23,7 @@ namespace llvm { class Type; class Mangler; - struct DarwinTargetAsmInfo: public TargetAsmInfo { + struct DarwinTargetAsmInfo : public TargetAsmInfo { const Section* TextCoalSection; const Section* ConstTextCoalSection; const Section* ConstDataCoalSection; diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 3f1cdd27ca394..ebd826a6f4a16 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -274,6 +274,7 @@ def unknown; class Operand<ValueType ty> { ValueType Type = ty; string PrintMethod = "printOperand"; + string AsmOperandLowerMethod = ?; dag MIOperandInfo = (ops); } diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index f223f4765f988..670b0996cc350 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -130,7 +130,6 @@ namespace llvm { private: mutable StringMap<Section> Sections; mutable SectionFlags::FlagsStringsMapType FlagsStrings; - void fillDefaultValues(); protected: /// TM - The current TargetMachine. const TargetMachine &TM; @@ -278,6 +277,10 @@ namespace llvm { /// use '\1' as the first character. const char *StringConstantPrefix; // Defaults to ".str" + /// AllowQuotesInName - This is true if the assembler allows for complex + /// symbol names to be surrounded in quotes. This defaults to false. + bool AllowQuotesInName; + //===--- Data Emission Directives -------------------------------------===// /// ZeroDirective - this should be set to the directive used to get some @@ -308,8 +311,7 @@ namespace llvm { /// directives for various sizes and non-default address spaces. virtual const char *getASDirective(unsigned size, unsigned AS) const { - assert (AS > 0 - && "Dont know the directives for default addr space"); + assert(AS > 0 && "Dont know the directives for default addr space"); return NULL; } @@ -472,10 +474,6 @@ namespace llvm { /// encode inline subroutine information. bool DwarfUsesInlineInfoSection; // Defaults to false. - /// SupportsMacInfo - true if the Dwarf output supports macro information - /// - bool SupportsMacInfoSection; // Defaults to true - /// NonLocalEHFrameLabel - If set, the EH_frame label needs to be non-local. /// bool NonLocalEHFrameLabel; // Defaults to false. @@ -536,9 +534,9 @@ namespace llvm { /// const char *DwarfRangesSection; // Defaults to ".debug_ranges". - /// DwarfMacInfoSection - Section directive for Dwarf info. + /// DwarfMacroInfoSection - Section directive for DWARF macro info. /// - const char *DwarfMacInfoSection; // Defaults to ".debug_macinfo". + const char *DwarfMacroInfoSection; // Defaults to ".debug_macinfo". /// DwarfEHFrameSection - Section directive for Exception frames. /// @@ -749,6 +747,9 @@ namespace llvm { const char *getStringConstantPrefix() const { return StringConstantPrefix; } + bool doesAllowQuotesInName() const { + return AllowQuotesInName; + } const char *getZeroDirective() const { return ZeroDirective; } @@ -866,9 +867,6 @@ namespace llvm { bool doesDwarfUsesInlineInfoSection() const { return DwarfUsesInlineInfoSection; } - bool doesSupportMacInfoSection() const { - return SupportsMacInfoSection; - } bool doesRequireNonLocalEHFrameLabel() const { return NonLocalEHFrameLabel; } @@ -914,8 +912,8 @@ namespace llvm { const char *getDwarfRangesSection() const { return DwarfRangesSection; } - const char *getDwarfMacInfoSection() const { - return DwarfMacInfoSection; + const char *getDwarfMacroInfoSection() const { + return DwarfMacroInfoSection; } const char *getDwarfEHFrameSection() const { return DwarfEHFrameSection; diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 47dcc6c8e48f3..40b0e7be480b4 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -30,7 +30,7 @@ #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/CodeGen/DebugLoc.h" +#include "llvm/Support/DebugLoc.h" #include "llvm/Target/TargetMachine.h" #include <climits> #include <map> diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index a8db68c597892..33fc45161a6ea 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -78,11 +78,13 @@ namespace CodeGenOpt { }; } + +// Possible float ABI settings. Used with FloatABIType in TargetOptions.h. namespace FloatABI { enum ABIType { - Default, - Soft, - Hard + Default, // Target-specific (either soft of hard depending on triple, etc). + Soft, // Soft float. + Hard // Hard float. }; } diff --git a/include/llvm/Target/TargetRegisterInfo.h b/include/llvm/Target/TargetRegisterInfo.h index 0218bfdb2ae39..91e8f80fd108d 100644 --- a/include/llvm/Target/TargetRegisterInfo.h +++ b/include/llvm/Target/TargetRegisterInfo.h @@ -519,6 +519,36 @@ public: return NULL; } + /// getAllocationOrder - Returns the register allocation order for a specified + /// register class in the form of a pair of TargetRegisterClass iterators. + virtual std::pair<TargetRegisterClass::iterator,TargetRegisterClass::iterator> + getAllocationOrder(const TargetRegisterClass *RC, + unsigned HintType, unsigned HintReg, + const MachineFunction &MF) const { + return std::make_pair(RC->allocation_order_begin(MF), + RC->allocation_order_end(MF)); + } + + /// ResolveRegAllocHint - Resolves the specified register allocation hint + /// to a physical register. Returns the physical register if it is successful. + virtual unsigned ResolveRegAllocHint(unsigned Type, unsigned Reg, + const MachineFunction &MF) const { + if (Type == 0 && Reg && isPhysicalRegister(Reg)) + return Reg; + return 0; + } + + /// UpdateRegAllocHint - A callback to allow target a chance to update + /// register allocation hints when a register is "changed" (e.g. coalesced) + /// to another register. e.g. On ARM, some virtual registers should target + /// register pairs, if one of pair is coalesced to another register, the + /// allocation hint of the other half of the pair should be changed to point + /// to the new register. + virtual void UpdateRegAllocHint(unsigned Reg, unsigned NewReg, + MachineFunction &MF) const { + // Do nothing. + } + /// targetHandlesStackFrameRounding - Returns true if the target is /// responsible for rounding up the stack frame (probably at emitPrologue /// time). diff --git a/include/llvm/Target/TargetSelect.h b/include/llvm/Target/TargetSelect.h new file mode 100644 index 0000000000000..8544eed76be7e --- /dev/null +++ b/include/llvm/Target/TargetSelect.h @@ -0,0 +1,65 @@ +//===- TargetSelect.h - Target Selection & Registration -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file provides utilities to make sure that certain classes of targets are +// linked into the main application executable, and initialize them as +// appropriate. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TARGET_TARGETSELECT_H +#define LLVM_TARGET_TARGETSELECT_H + +#include "llvm/Config/config.h" + +namespace llvm { + // Declare all of the target-initialization functions that are available. +#define LLVM_TARGET(TargetName) void Initialize##TargetName##Target(); +#include "llvm/Config/Targets.def" + + // Declare all of the available asm-printer initialization functions. + // Declare all of the target-initialization functions. +#define LLVM_ASM_PRINTER(TargetName) void Initialize##TargetName##AsmPrinter(); +#include "llvm/Config/AsmPrinters.def" + + /// InitializeAllTargets - The main program should call this function if it + /// wants to link in all available targets that LLVM is configured to support. + inline void InitializeAllTargets() { +#define LLVM_TARGET(TargetName) llvm::Initialize##TargetName##Target(); +#include "llvm/Config/Targets.def" + } + + /// InitializeAllAsmPrinters - The main program should call this function if + /// it wants all asm printers that LLVM is configured to support. This will + /// cause them to be linked into its executable. + inline void InitializeAllAsmPrinters() { +#define LLVM_ASM_PRINTER(TargetName) Initialize##TargetName##AsmPrinter(); +#include "llvm/Config/AsmPrinters.def" + } + + + /// InitializeNativeTarget - The main program should call this function to + /// initialize the native target corresponding to the host. This is useful + /// for JIT applications to ensure that the target gets linked in correctly. + inline bool InitializeNativeTarget() { + // If we have a native target, initialize it to ensure it is linked in. +#ifdef LLVM_NATIVE_ARCH +#define DoInit2(TARG, MOD) llvm::Initialize ## TARG ## MOD() +#define DoInit(T, M) DoInit2(T, M) + DoInit(LLVM_NATIVE_ARCH, Target); + return false; +#undef DoInit +#undef DoInit2 +#else + return true; +#endif + } +} + +#endif |