diff options
Diffstat (limited to 'lib/Target/PowerPC/PPCTargetMachine.h')
-rw-r--r-- | lib/Target/PowerPC/PPCTargetMachine.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCTargetMachine.h b/lib/Target/PowerPC/PPCTargetMachine.h index ac2c2aa723..58fd55d552 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.h +++ b/lib/Target/PowerPC/PPCTargetMachine.h @@ -41,7 +41,13 @@ class PPCTargetMachine : public LLVMTargetMachine { protected: virtual const TargetAsmInfo *createTargetAsmInfo() const; - + + // To avoid having target depend on the asmprinter stuff libraries, asmprinter + // set this functions to ctor pointer at startup time if they are linked in. + typedef FunctionPass *(*AsmPrinterCtorFn)(std::ostream &o, + PPCTargetMachine &tm); + static AsmPrinterCtorFn AsmPrinterCtor; + public: PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit); @@ -63,7 +69,11 @@ public: virtual const PPCMachOWriterInfo *getMachOWriterInfo() const { return &MachOWriterInfo; } - + + static void registerAsmPrinter(AsmPrinterCtorFn F) { + AsmPrinterCtor = F; + } + // Pass Pipeline Configuration virtual bool addInstSelector(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); |