Skip to content

Commit 360ff2a

Browse files
[MCA] Fix StringRef::npos and get last padding using back()
1 parent e456be9 commit 360ff2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/tools/llvm-mca/Views/InstructionInfoView.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ void InstructionInfoView::getComment(const MCInst &MCI,
3535
if (Pos = S.find("\n"); Pos != std::string::npos) {
3636
InstrStr = S.take_front(Pos);
3737
// C style comment
38-
if (((PosCmt = InstrStr.find("/*")) != std::string::npos) &&
39-
((Pos = InstrStr.find("*/")) != std::string::npos)) {
38+
if (((PosCmt = InstrStr.find("/*")) != StringRef::npos) &&
39+
((Pos = InstrStr.find("*/")) != StringRef::npos)) {
4040
CommentString = InstrStr.substr(PosCmt, Pos);
4141
return;
4242
}
4343
// C++ style comment
44-
if ((PosCmt = InstrStr.find("//")) != std::string::npos) {
44+
if ((PosCmt = InstrStr.find("//")) != StringRef::npos) {
4545
CommentString = InstrStr.substr(PosCmt);
4646
return;
4747
}
@@ -93,7 +93,7 @@ void InstructionInfoView::printView(raw_ostream &OS) const {
9393
"RThroughput", "MayLoad",
9494
"MayStore", "HasSideEffects (U)"};
9595
SmallVector<StringRef, 8> EndFields;
96-
unsigned LastPadding = 35;
96+
unsigned LastPadding = Paddings.back();
9797
if (PrintFullInfo) {
9898
Fields.push_back("Bypass Latency");
9999
Paddings.push_back(LastPadding += 7);

0 commit comments

Comments
 (0)