[llvm-commits] CVS: llvm/include/llvm/Target/TargetMachine.h
Bill Wendling
isanbard at gmail.com
Tue Jan 16 19:48:45 PST 2007
Changes in directory llvm/include/llvm/Target:
TargetMachine.h updated: 1.71 -> 1.72
---
Log message:
The TargetObjInfo object goes here.
---
Diffs of the changes: (+18 -3)
TargetMachine.h | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
Index: llvm/include/llvm/Target/TargetMachine.h
diff -u llvm/include/llvm/Target/TargetMachine.h:1.71 llvm/include/llvm/Target/TargetMachine.h:1.72
--- llvm/include/llvm/Target/TargetMachine.h:1.71 Thu Sep 7 18:39:26 2006
+++ llvm/include/llvm/Target/TargetMachine.h Tue Jan 16 21:48:29 2007
@@ -21,6 +21,7 @@
namespace llvm {
class TargetAsmInfo;
+class TargetObjInfo;
class TargetData;
class TargetSubtarget;
class TargetInstrInfo;
@@ -66,7 +67,7 @@
TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
void operator=(const TargetMachine &); // DO NOT IMPLEMENT
protected: // Can only create subclasses.
- TargetMachine() : AsmInfo(NULL) { }
+ TargetMachine() : AsmInfo(NULL), ObjInfo(NULL) { }
/// getSubtargetImpl - virtual method implemented by subclasses that returns
/// a reference to that target's TargetSubtarget-derived member variable.
@@ -75,11 +76,19 @@
/// AsmInfo - Contains target specific asm information.
///
mutable const TargetAsmInfo *AsmInfo;
-
+
/// createTargetAsmInfo - Create a new instance of target specific asm
/// information.
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:
virtual ~TargetMachine();
@@ -107,7 +116,6 @@
virtual TargetLowering *getTargetLowering() const { return 0; }
virtual const TargetData *getTargetData() const { return 0; }
-
/// getTargetAsmInfo - Return target specific asm information.
///
const TargetAsmInfo *getTargetAsmInfo() const {
@@ -115,6 +123,13 @@
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
/// TargetSubtarget. In debug builds, it verifies that the object being
/// returned is of the correct type.
More information about the llvm-commits
mailing list