mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
The TargetObjInfo object goes here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class TargetAsmInfo;
|
class TargetAsmInfo;
|
||||||
|
class TargetObjInfo;
|
||||||
class TargetData;
|
class TargetData;
|
||||||
class TargetSubtarget;
|
class TargetSubtarget;
|
||||||
class TargetInstrInfo;
|
class TargetInstrInfo;
|
||||||
@@ -66,7 +67,7 @@ class TargetMachine {
|
|||||||
TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
|
TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
|
||||||
void operator=(const TargetMachine &); // DO NOT IMPLEMENT
|
void operator=(const TargetMachine &); // DO NOT IMPLEMENT
|
||||||
protected: // Can only create subclasses.
|
protected: // Can only create subclasses.
|
||||||
TargetMachine() : AsmInfo(NULL) { }
|
TargetMachine() : AsmInfo(NULL), ObjInfo(NULL) { }
|
||||||
|
|
||||||
/// getSubtargetImpl - virtual method implemented by subclasses that returns
|
/// getSubtargetImpl - virtual method implemented by subclasses that returns
|
||||||
/// a reference to that target's TargetSubtarget-derived member variable.
|
/// a reference to that target's TargetSubtarget-derived member variable.
|
||||||
@@ -75,11 +76,19 @@ protected: // Can only create subclasses.
|
|||||||
/// AsmInfo - Contains target specific asm information.
|
/// AsmInfo - Contains target specific asm information.
|
||||||
///
|
///
|
||||||
mutable const TargetAsmInfo *AsmInfo;
|
mutable const TargetAsmInfo *AsmInfo;
|
||||||
|
|
||||||
/// createTargetAsmInfo - Create a new instance of target specific asm
|
/// createTargetAsmInfo - Create a new instance of target specific asm
|
||||||
/// information.
|
/// information.
|
||||||
virtual const TargetAsmInfo *createTargetAsmInfo() const { return NULL; }
|
virtual const TargetAsmInfo *createTargetAsmInfo() const { return NULL; }
|
||||||
|
|
||||||
|
/// ObjInfo - Contains target specific object file information.
|
||||||
|
///
|
||||||
|
mutable const TargetObjInfo *ObjInfo;
|
||||||
|
|
||||||
|
/// createTargetObjInfo - Create a new instance of target specific object
|
||||||
|
/// information.
|
||||||
|
virtual const TargetObjInfo *createTargetObjInfo() const { return NULL; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~TargetMachine();
|
virtual ~TargetMachine();
|
||||||
|
|
||||||
@@ -107,7 +116,6 @@ public:
|
|||||||
virtual TargetLowering *getTargetLowering() const { return 0; }
|
virtual TargetLowering *getTargetLowering() const { return 0; }
|
||||||
virtual const TargetData *getTargetData() const { return 0; }
|
virtual const TargetData *getTargetData() const { return 0; }
|
||||||
|
|
||||||
|
|
||||||
/// getTargetAsmInfo - Return target specific asm information.
|
/// getTargetAsmInfo - Return target specific asm information.
|
||||||
///
|
///
|
||||||
const TargetAsmInfo *getTargetAsmInfo() const {
|
const TargetAsmInfo *getTargetAsmInfo() const {
|
||||||
@@ -115,6 +123,13 @@ public:
|
|||||||
return AsmInfo;
|
return AsmInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getTargetObjInfo - Return target specific object information.
|
||||||
|
///
|
||||||
|
const TargetObjInfo *getTargetObjInfo() const {
|
||||||
|
if (!ObjInfo) ObjInfo = createTargetObjInfo();
|
||||||
|
return ObjInfo;
|
||||||
|
}
|
||||||
|
|
||||||
/// getSubtarget - This method returns a pointer to the specified type of
|
/// getSubtarget - This method returns a pointer to the specified type of
|
||||||
/// TargetSubtarget. In debug builds, it verifies that the object being
|
/// TargetSubtarget. In debug builds, it verifies that the object being
|
||||||
/// returned is of the correct type.
|
/// returned is of the correct type.
|
||||||
|
Reference in New Issue
Block a user