[PATCH] D19189: Expose the list of available features in MCSubtargetInfo
Johan Engelen via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 23 02:07:22 PDT 2016
johanengelen added a comment.
I don't know how I missed "ToggleFeature", thanks very much for pointing me in that direction!
With the current interface, I think I can already do what I want:
auto *mcinfo = gTargetMachine->getMCSubtargetInfo();
auto SavedFeatbits = mcinfo->getFeatureBits();
auto NewFeatbits = mcinfo->ApplyFeatureFlag("feature to query");
bool FeatureFound = (SavedFeatbits == NewFeatbits);
mcinfo->setFeatureBits(SavedFeatbits);
Do you think it still makes sense to add a `bool MCSubtargetInfo::QueryFeatureFlag(StringRef FS)` ?
http://reviews.llvm.org/D19189
More information about the llvm-commits
mailing list