summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-08-04 21:24:07 +0000
committerEric Christopher <echristo@gmail.com>2014-08-04 21:24:07 +0000
commitacc8ef273b1c3796b0fc7f19aa347115b4bc2ea4 (patch)
treec9b1c80e7a14d625ee613e489cb635ab3e48a699 /llvm
parent5908ab4dd6595a7bcbe3d4952a3ca5630b262088 (diff)
downloadbcm5719-llvm-acc8ef273b1c3796b0fc7f19aa347115b4bc2ea4.tar.gz
bcm5719-llvm-acc8ef273b1c3796b0fc7f19aa347115b4bc2ea4.zip
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
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Target/TargetMachine.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index d48f746805b..3b0c60d35ba 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/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<TargetSubtargetInfo *>(TM->getSubtargetImpl());
+ }
mutable TargetOptions Options;
OpenPOWER on IntegriCloud