diff options
author | Devang Patel <dpatel@apple.com> | 2012-01-09 21:30:46 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2012-01-09 21:30:46 +0000 |
commit | d06b01c038e00f6af50a1b6d4c71389037e00212 (patch) | |
tree | a687ea4fb1d300e3de402cc43d2a02331b55e52c | |
parent | 22d20c218aeb14af388bff2346d6d4cc131e8449 (diff) | |
download | external_llvm-d06b01c038e00f6af50a1b6d4c71389037e00212.zip external_llvm-d06b01c038e00f6af50a1b6d4c71389037e00212.tar.gz external_llvm-d06b01c038e00f6af50a1b6d4c71389037e00212.tar.bz2 |
Use descriptive variable name and remove incorrect operand number check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147802 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index 737e948..bdd1c49 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -806,20 +806,17 @@ bool MatchableInfo::Validate(StringRef CommentDelimiter, bool Hack) const { return true; } -/// extractSingletonRegisterForAsmOperand - Extract singleton register, if present, -/// from specified token. +/// extractSingletonRegisterForAsmOperand - Extract singleton register, +/// if present, from specified token. void MatchableInfo:: -extractSingletonRegisterForAsmOperand(unsigned i, const AsmMatcherInfo &Info, +extractSingletonRegisterForAsmOperand(unsigned OperandNo, + const AsmMatcherInfo &Info, std::string &RegisterPrefix) { - StringRef Tok = AsmOperands[i].Token; + StringRef Tok = AsmOperands[OperandNo].Token; if (RegisterPrefix.empty()) { - if (i) { - std::string LoweredTok = Tok.lower(); - if (const CodeGenRegister *Reg = Info.Target.getRegisterByName(LoweredTok)) - AsmOperands[i].SingletonReg = Reg->TheDef; - } else - if (const CodeGenRegister *Reg = Info.Target.getRegisterByName(Tok)) - AsmOperands[i].SingletonReg = Reg->TheDef; + std::string LoweredTok = Tok.lower(); + if (const CodeGenRegister *Reg = Info.Target.getRegisterByName(LoweredTok)) + AsmOperands[OperandNo].SingletonReg = Reg->TheDef; return; } @@ -828,7 +825,7 @@ extractSingletonRegisterForAsmOperand(unsigned i, const AsmMatcherInfo &Info, StringRef RegName = Tok.substr(RegisterPrefix.size()); if (const CodeGenRegister *Reg = Info.Target.getRegisterByName(RegName)) - AsmOperands[i].SingletonReg = Reg->TheDef; + AsmOperands[OperandNo].SingletonReg = Reg->TheDef; // If there is no register prefix (i.e. "%" in "%eax"), then this may // be some random non-register token, just ignore it. |