Reimplement the temporary non-const getSubtargetImpl routine so

that we can avoid implementing it on every target. Thanks to Richard
Smith for the suggestions!

llvm-svn: 214780
This commit is contained in:
Eric Christopher 2014-08-04 21:24:07 +00:00
parent 5908ab4dd6
commit acc8ef273b
1 changed files with 4 additions and 1 deletions
llvm/include/llvm/Target

View File

@ -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<TargetSubtargetInfo *>(TM->getSubtargetImpl());
}
mutable TargetOptions Options;