aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/CodeGenRegisters.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-06-06 12:08:01 +0000
committerDuncan Sands <baldrick@free.fr>2008-06-06 12:08:01 +0000
commit83ec4b6711980242ef3c55a4fa36b2d7a39c1bfb (patch)
tree318323f012863299f9ae063e79a47985c2e8dc4b /utils/TableGen/CodeGenRegisters.h
parentcc41940dff771c98321d601e04e60dc8c67b6e87 (diff)
downloadexternal_llvm-83ec4b6711980242ef3c55a4fa36b2d7a39c1bfb.zip
external_llvm-83ec4b6711980242ef3c55a4fa36b2d7a39c1bfb.tar.gz
external_llvm-83ec4b6711980242ef3c55a4fa36b2d7a39c1bfb.tar.bz2
Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenRegisters.h')
-rw-r--r--utils/TableGen/CodeGenRegisters.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h
index 0f1b501..6f8682b 100644
--- a/utils/TableGen/CodeGenRegisters.h
+++ b/utils/TableGen/CodeGenRegisters.h
@@ -36,7 +36,7 @@ namespace llvm {
Record *TheDef;
std::string Namespace;
std::vector<Record*> Elements;
- std::vector<MVT::ValueType> VTs;
+ std::vector<MVT::SimpleValueType> VTs;
unsigned SpillSize;
unsigned SpillAlignment;
int CopyCost;
@@ -44,10 +44,10 @@ namespace llvm {
std::string MethodProtos, MethodBodies;
const std::string &getName() const;
- const std::vector<MVT::ValueType> &getValueTypes() const { return VTs; }
+ const std::vector<MVT::SimpleValueType> &getValueTypes() const {return VTs;}
unsigned getNumValueTypes() const { return VTs.size(); }
- MVT::ValueType getValueTypeNum(unsigned VTNum) const {
+ MVT::SimpleValueType getValueTypeNum(unsigned VTNum) const {
if (VTNum < VTs.size())
return VTs[VTNum];
assert(0 && "VTNum greater than number of ValueTypes in RegClass!");