aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-15 06:00:16 +0000
committerChris Lattner <sabre@nondot.org>2010-03-15 06:00:16 +0000
commit3f9bead0ceee0144652f43591c0a911f2e61bc32 (patch)
treedc66a0d042a020fd18baa16e52fe5e205ef0e073 /utils/TableGen/CodeGenTarget.cpp
parentdfb9216b1ab6aeef9e065b2e1d3a74f2c518bc1c (diff)
downloadexternal_llvm-3f9bead0ceee0144652f43591c0a911f2e61bc32.zip
external_llvm-3f9bead0ceee0144652f43591c0a911f2e61bc32.tar.gz
external_llvm-3f9bead0ceee0144652f43591c0a911f2e61bc32.tar.bz2
Completely rewrite tblgen's type inference mechanism,
changing the primary datastructure from being a "std::vector<unsigned char>" to being a new TypeSet class that actually has (gasp) invariants! This changes more things than I remember, but one major innovation here is that it enforces that named input values agree in type with their output values. This also eliminates code that transparently assumes (in some cases) that SDNodeXForm input/output types are the same, because this is wrong in many case. This also eliminates a bug which caused a lot of ambiguous patterns to go undetected, where a register class would sometimes pick the first possible type, causing an ambiguous pattern to get arbitrary results. With all the recent target changes, this causes no functionality change! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--utils/TableGen/CodeGenTarget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index 2688091..ec6a31f 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -184,16 +184,16 @@ void CodeGenTarget::ReadRegisterClasses() const {
RegisterClasses.assign(RegClasses.begin(), RegClasses.end());
}
-std::vector<unsigned char> CodeGenTarget::getRegisterVTs(Record *R) const {
- std::vector<unsigned char> Result;
+std::vector<MVT::SimpleValueType> CodeGenTarget::
+getRegisterVTs(Record *R) const {
+ std::vector<MVT::SimpleValueType> Result;
const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
for (unsigned i = 0, e = RCs.size(); i != e; ++i) {
const CodeGenRegisterClass &RC = RegisterClasses[i];
for (unsigned ei = 0, ee = RC.Elements.size(); ei != ee; ++ei) {
if (R == RC.Elements[ei]) {
const std::vector<MVT::SimpleValueType> &InVTs = RC.getValueTypes();
- for (unsigned i = 0, e = InVTs.size(); i != e; ++i)
- Result.push_back(InVTs[i]);
+ Result.insert(Result.end(), InVTs.begin(), InVTs.end());
}
}
}