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
This commit is contained in:
Eric Christopher 2014-08-04 21:24:07 +00:00
parent 82c93451f3
commit ffa13eafbf

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;