diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-18 18:13:55 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-18 18:13:55 +0000 |
commit | a606d955de3b0f777131d74162eb6f11b5f95d75 (patch) | |
tree | b45dd853d37e5f5df32d4138143e9c562c4ff53b /utils/TableGen | |
parent | df50d7e238c4802eb2de04646b8f7ff7327730a0 (diff) | |
download | llvm-a606d955de3b0f777131d74162eb6f11b5f95d75.tar.gz llvm-a606d955de3b0f777131d74162eb6f11b5f95d75.tar.bz2 llvm-a606d955de3b0f777131d74162eb6f11b5f95d75.tar.xz |
Start TargetRegisterClass indices at 0 instead of 1, so that
MachineRegisterInfo doesn't have to confusingly allocate an extra
entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/InstrInfoEmitter.cpp | 3 | ||||
-rw-r--r-- | utils/TableGen/RegisterInfoEmitter.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp index e66192a221..f28af1589d 100644 --- a/utils/TableGen/InstrInfoEmitter.cpp +++ b/utils/TableGen/InstrInfoEmitter.cpp @@ -92,7 +92,8 @@ InstrInfoEmitter::GetOperandInfo(const CodeGenInstruction &Inst) { else if (OpR->isSubClassOf("PointerLikeRegClass")) Res += utostr(OpR->getValueAsInt("RegClassKind")) + ", "; else - Res += "0, "; + // -1 means the operand does not have a fixed register class. + Res += "-1, "; // Fill in applicable flags. Res += "0"; diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp index 26957472c0..a3ca0bc552 100644 --- a/utils/TableGen/RegisterInfoEmitter.cpp +++ b/utils/TableGen/RegisterInfoEmitter.cpp @@ -96,7 +96,7 @@ void RegisterInfoEmitter::runHeader(raw_ostream &OS) { for (unsigned i = 0, e = RegisterClasses.size(); i != e; ++i) { if (i) OS << ",\n"; OS << " " << RegisterClasses[i].getName() << "RegClassID"; - OS << " = " << (i+1); + OS << " = " << i; } OS << "\n };\n\n"; |