namespace llvm {
class TargetAsmInfo;
+class TargetObjInfo;
class TargetData;
class TargetSubtarget;
class TargetInstrInfo;
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.
/// 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();
virtual TargetLowering *getTargetLowering() const { return 0; }
virtual const TargetData *getTargetData() const { return 0; }
-
/// getTargetAsmInfo - Return target specific asm information.
///
const TargetAsmInfo *getTargetAsmInfo() const {
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.