aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-09 05:47:46 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-09 05:47:46 +0000
commitffc0e73046f737d75e0a62b3a83ef19bcef111e3 (patch)
tree1f82f6a0b1c1a743dd4c10377858004988a47262 /include/llvm/MC
parent4f4a6fcd165293c347a42b543e5e55aa42a09bb2 (diff)
downloadexternal_llvm-ffc0e73046f737d75e0a62b3a83ef19bcef111e3.zip
external_llvm-ffc0e73046f737d75e0a62b3a83ef19bcef111e3.tar.gz
external_llvm-ffc0e73046f737d75e0a62b3a83ef19bcef111e3.tar.bz2
Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change subtarget state (e.g. .code 16) and it must be reflected in other modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance must be shared. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCSubtargetInfo.h11
-rw-r--r--include/llvm/MC/SubtargetFeature.h6
2 files changed, 16 insertions, 1 deletions
diff --git a/include/llvm/MC/MCSubtargetInfo.h b/include/llvm/MC/MCSubtargetInfo.h
index c66150b..a9e4637 100644
--- a/include/llvm/MC/MCSubtargetInfo.h
+++ b/include/llvm/MC/MCSubtargetInfo.h
@@ -34,7 +34,8 @@ class MCSubtargetInfo {
const unsigned *ForwardingPathes; // Forwarding pathes
unsigned NumFeatures; // Number of processor features
unsigned NumProcs; // Number of processors
- uint64_t FeatureBits; // Feature bits for current CPU
+
+ uint64_t FeatureBits; // Feature bits for current CPU + FS
public:
void InitMCSubtargetInfo(StringRef CPU, StringRef FS,
@@ -54,6 +55,14 @@ public:
/// feature string), recompute and return feature bits.
uint64_t ReInitMCSubtargetInfo(StringRef CPU, StringRef FS);
+ /// ToggleFeature - Toggle a feature and returns the re-computed feature
+ /// bits. This version does not change the implied bits.
+ uint64_t ToggleFeature(uint64_t FB);
+
+ /// ToggleFeature - Toggle a feature and returns the re-computed feature
+ /// bits. This version will also change all implied bits.
+ uint64_t ToggleFeature(StringRef FS);
+
/// getInstrItineraryForCPU - Get scheduling itinerary of a CPU.
///
InstrItineraryData getInstrItineraryForCPU(StringRef CPU) const;
diff --git a/include/llvm/MC/SubtargetFeature.h b/include/llvm/MC/SubtargetFeature.h
index fccff03..1a7dc92 100644
--- a/include/llvm/MC/SubtargetFeature.h
+++ b/include/llvm/MC/SubtargetFeature.h
@@ -82,6 +82,12 @@ public:
/// Adding Features.
void AddFeature(const StringRef String, bool IsEnabled = true);
+ /// ToggleFeature - Toggle a feature and returns the newly updated feature
+ /// bits.
+ uint64_t ToggleFeature(uint64_t Bits, const StringRef String,
+ const SubtargetFeatureKV *FeatureTable,
+ size_t FeatureTableSize);
+
/// Get feature bits of a CPU.
uint64_t getFeatureBits(const StringRef CPU,
const SubtargetFeatureKV *CPUTable,