[llvm] r328898 - [Hexagon] Reduce excessive indentation in .s output
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 30 12:30:28 PDT 2018
Author: kparzysz
Date: Fri Mar 30 12:30:28 2018
New Revision: 328898
URL: http://llvm.org/viewvc/llvm-project?rev=328898&view=rev
Log:
[Hexagon] Reduce excessive indentation in .s output
Modified:
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp?rev=328898&r1=328897&r2=328898&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp Fri Mar 30 12:30:28 2018
@@ -69,20 +69,12 @@ void HexagonInstPrinter::printInst(const
OS << "\n";
}
- if (HexagonMCInstrInfo::isInnerLoop(*MI)) {
- if (HexagonMCInstrInfo::isOuterLoop(*MI)) {
- MCInst ME;
- ME.setOpcode(Hexagon::ENDLOOP01);
- printInstruction(&ME, OS);
- } else {
- MCInst ME;
- ME.setOpcode(Hexagon::ENDLOOP0);
- printInstruction(&ME, OS);
- }
- } else if (HexagonMCInstrInfo::isOuterLoop(*MI)) {
- MCInst ME;
- ME.setOpcode(Hexagon::ENDLOOP1);
- printInstruction(&ME, OS);
+ bool IsLoop0 = HexagonMCInstrInfo::isInnerLoop(*MI);
+ bool IsLoop1 = HexagonMCInstrInfo::isOuterLoop(*MI);
+ if (IsLoop0) {
+ OS << (IsLoop1 ? " :endloop01" : " :endloop0");
+ } else if (IsLoop1) {
+ OS << " :endloop1";
}
}
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp?rev=328898&r1=328897&r2=328898&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp Fri Mar 30 12:30:28 2018
@@ -147,7 +147,7 @@ public:
auto PacketBundle = Contents.rsplit('\n');
auto HeadTail = PacketBundle.first.split('\n');
StringRef Separator = "\n";
- StringRef Indent = "\t\t";
+ StringRef Indent = "\t";
OS << "\t{\n";
while (!HeadTail.first.empty()) {
StringRef InstTxt;
@@ -164,7 +164,7 @@ public:
}
if (HexagonMCInstrInfo::isMemReorderDisabled(Inst))
- OS << "\n\t}:mem_noshuf" << PacketBundle.second;
+ OS << "\n\t} :mem_noshuf" << PacketBundle.second;
else
OS << "\t}" << PacketBundle.second;
}
More information about the llvm-commits
mailing list