summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsTargetMachine.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-16 22:38:04 +0000
committerChris Lattner <sabre@nondot.org>2009-06-16 22:38:04 +0000
commite8f1018130e24bd20d193003eddaa7e16e48d4bd (patch)
tree93f9c64ae07890d694e5c9d4c46065cd5468f19c /lib/Target/Mips/MipsTargetMachine.h
parent86ecd50143fd9ee301d2157534dc65185723341c (diff)
downloadllvm-e8f1018130e24bd20d193003eddaa7e16e48d4bd.tar.gz
llvm-e8f1018130e24bd20d193003eddaa7e16e48d4bd.tar.bz2
llvm-e8f1018130e24bd20d193003eddaa7e16e48d4bd.tar.xz
fix a circular dependency between the mips code generator
and its asmprinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsTargetMachine.h')
-rw-r--r--lib/Target/Mips/MipsTargetMachine.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.h b/lib/Target/Mips/MipsTargetMachine.h
index a9e1df27ae..85fafadde7 100644
--- a/lib/Target/Mips/MipsTargetMachine.h
+++ b/lib/Target/Mips/MipsTargetMachine.h
@@ -33,10 +33,23 @@ namespace llvm {
protected:
virtual const TargetAsmInfo *createTargetAsmInfo() const;
-
+ protected:
+ // 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)(raw_ostream &o,
+ MipsTargetMachine &tm,
+ CodeGenOpt::Level OptLevel,
+ bool verbose);
+ static AsmPrinterCtorFn AsmPrinterCtor;
+
public:
MipsTargetMachine(const Module &M, const std::string &FS, bool isLittle);
+ static void registerAsmPrinter(AsmPrinterCtorFn F) {
+ AsmPrinterCtor = F;
+ }
+
virtual const MipsInstrInfo *getInstrInfo() const
{ return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const