diff options
author | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-05-13 08:27:08 +0000 |
---|---|---|
committer | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2015-05-13 08:27:08 +0000 |
commit | aba4a34ef23873e66aba9848bdbe5a6fcfbc4705 (patch) | |
tree | 61671b9f7fe934ab14545900ab7301699be96440 /llvm/lib/MC/MCSubtargetInfo.cpp | |
parent | 60c270764e2fe0d2e212dd859f9983fe0cc4eb66 (diff) | |
download | bcm5719-llvm-aba4a34ef23873e66aba9848bdbe5a6fcfbc4705.tar.gz bcm5719-llvm-aba4a34ef23873e66aba9848bdbe5a6fcfbc4705.zip |
Use std::bitset for SubtargetFeatures
Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.
The first two times this was committed (r229831, r233055), it caused several buildbot failures.
At least some of the ARM and MIPS ones were due to gcc/binutils issues, and should now be fixed.
llvm-svn: 237234
Diffstat (limited to 'llvm/lib/MC/MCSubtargetInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCSubtargetInfo.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCSubtargetInfo.cpp b/llvm/lib/MC/MCSubtargetInfo.cpp index daba321c58e..6abdd3acbc5 100644 --- a/llvm/lib/MC/MCSubtargetInfo.cpp +++ b/llvm/lib/MC/MCSubtargetInfo.cpp @@ -63,14 +63,19 @@ MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef C, StringRef FS, /// ToggleFeature - Toggle a feature and returns the re-computed feature /// bits. This version does not change the implied bits. -uint64_t MCSubtargetInfo::ToggleFeature(uint64_t FB) { +FeatureBitset MCSubtargetInfo::ToggleFeature(uint64_t FB) { + FeatureBits.flip(FB); + return FeatureBits; +} + +FeatureBitset MCSubtargetInfo::ToggleFeature(const FeatureBitset &FB) { FeatureBits ^= FB; return FeatureBits; } /// ToggleFeature - Toggle a feature and returns the re-computed feature /// bits. This version will also change all implied bits. -uint64_t MCSubtargetInfo::ToggleFeature(StringRef FS) { +FeatureBitset MCSubtargetInfo::ToggleFeature(StringRef FS) { SubtargetFeatures Features; FeatureBits = Features.ToggleFeature(FeatureBits, FS, ProcFeatures); return FeatureBits; |