diff options
| author | Kazu Hirata <kazu@google.com> | 2021-02-25 19:54:36 -0800 |
|---|---|---|
| committer | Kazu Hirata <kazu@google.com> | 2021-02-25 19:54:36 -0800 |
| commit | edd92e018a7ba764f0e217ba8fd155ee1c12cf6a (patch) | |
| tree | 1468f45e8b027053e403d0befbc3689ad71a7c37 /llvm/utils/TableGen/CallingConvEmitter.cpp | |
| parent | 67360decc3d4bda363c2fa2550eb1c2b876c8cf0 (diff) | |
[TableGen] Use ListSeparator (NFC)
Diffstat (limited to 'llvm/utils/TableGen/CallingConvEmitter.cpp')
| -rw-r--r-- | llvm/utils/TableGen/CallingConvEmitter.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/llvm/utils/TableGen/CallingConvEmitter.cpp b/llvm/utils/TableGen/CallingConvEmitter.cpp index 9e997483d21d..127ae6247bd9 100644 --- a/llvm/utils/TableGen/CallingConvEmitter.cpp +++ b/llvm/utils/TableGen/CallingConvEmitter.cpp @@ -131,10 +131,9 @@ void CallingConvEmitter::EmitAction(Record *Action, O << IndentStr << "static const MCPhysReg RegList" << ++Counter << "[] = {\n"; O << IndentStr << " "; - for (unsigned i = 0, e = RegList->size(); i != e; ++i) { - if (i != 0) O << ", "; - O << getQualifiedName(RegList->getElementAsRecord(i)); - } + ListSeparator LS; + for (unsigned i = 0, e = RegList->size(); i != e; ++i) + O << LS << getQualifiedName(RegList->getElementAsRecord(i)); O << "\n" << IndentStr << "};\n"; O << IndentStr << "if (unsigned Reg = State.AllocateReg(RegList" << Counter << ")) {\n"; @@ -162,19 +161,17 @@ void CallingConvEmitter::EmitAction(Record *Action, O << IndentStr << "static const MCPhysReg RegList" << RegListNumber << "[] = {\n"; O << IndentStr << " "; - for (unsigned i = 0, e = RegList->size(); i != e; ++i) { - if (i != 0) O << ", "; - O << getQualifiedName(RegList->getElementAsRecord(i)); - } + ListSeparator LS; + for (unsigned i = 0, e = RegList->size(); i != e; ++i) + O << LS << getQualifiedName(RegList->getElementAsRecord(i)); O << "\n" << IndentStr << "};\n"; O << IndentStr << "static const MCPhysReg RegList" << ShadowRegListNumber << "[] = {\n"; O << IndentStr << " "; - for (unsigned i = 0, e = ShadowRegList->size(); i != e; ++i) { - if (i != 0) O << ", "; - O << getQualifiedName(ShadowRegList->getElementAsRecord(i)); - } + ListSeparator LSS; + for (unsigned i = 0, e = ShadowRegList->size(); i != e; ++i) + O << LSS << getQualifiedName(ShadowRegList->getElementAsRecord(i)); O << "\n" << IndentStr << "};\n"; O << IndentStr << "if (unsigned Reg = State.AllocateReg(RegList" @@ -220,10 +217,9 @@ void CallingConvEmitter::EmitAction(Record *Action, O << IndentStr << "static const MCPhysReg ShadowRegList" << ShadowRegListNumber << "[] = {\n"; O << IndentStr << " "; - for (unsigned i = 0, e = ShadowRegList->size(); i != e; ++i) { - if (i != 0) O << ", "; - O << getQualifiedName(ShadowRegList->getElementAsRecord(i)); - } + ListSeparator LS; + for (unsigned i = 0, e = ShadowRegList->size(); i != e; ++i) + O << LS << getQualifiedName(ShadowRegList->getElementAsRecord(i)); O << "\n" << IndentStr << "};\n"; O << IndentStr << "unsigned Offset" << ++Counter |
