From: Eric Christopher Date: Mon, 4 Aug 2014 21:24:07 +0000 (+0000) Subject: Reimplement the temporary non-const getSubtargetImpl routine so X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=ffa13eafbf7f968774c3178f3efb85edeb9b105e Reimplement the temporary non-const getSubtargetImpl routine so that we can avoid implementing it on every target. Thanks to Richard Smith for the suggestions! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214780 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index d48f746805b..3b0c60d35ba 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -100,7 +100,10 @@ public: virtual const TargetSubtargetInfo *getSubtargetImpl() const { return nullptr; } - virtual TargetSubtargetInfo *getSubtargetImpl() { return nullptr; } + virtual TargetSubtargetInfo *getSubtargetImpl() { + const TargetMachine *TM = this; + return const_cast(TM->getSubtargetImpl()); + } mutable TargetOptions Options;