[llvm] r360775 - [MergeICmps] Fix r360771.
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Wed May 15 07:00:45 PDT 2019
Author: courbet
Date: Wed May 15 07:00:45 2019
New Revision: 360775
URL: http://llvm.org/viewvc/llvm-project?rev=360775&view=rev
Log:
[MergeICmps] Fix r360771.
Twine references a StringRef by reference, not value...
Modified:
llvm/trunk/lib/Transforms/Scalar/MergeICmps.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/MergeICmps.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MergeICmps.cpp?rev=360775&r1=360774&r2=360775&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MergeICmps.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MergeICmps.cpp Wed May 15 07:00:45 2019
@@ -544,11 +544,11 @@ class MergedBlockName {
public:
explicit MergedBlockName(ArrayRef<BCECmpBlock> Comparisons)
- : Name(makeTwine(Comparisons)) {}
- const Twine Name;
+ : Name(makeName(Comparisons)) {}
+ const StringRef Name;
private:
- Twine makeTwine(ArrayRef<BCECmpBlock> Comparisons) {
+ StringRef makeName(ArrayRef<BCECmpBlock> Comparisons) {
assert(!Comparisons.empty() && "no basic block");
// Fast path: only one block, or no names at all.
if (Comparisons.size() == 1)
@@ -558,7 +558,7 @@ private:
return i + Cmp.BB->getName().size();
});
if (size == 0)
- return Twine();
+ return StringRef("", 0);
// Slow path: at least two blocks, at least one block with a name.
Scratch.clear();
@@ -576,7 +576,7 @@ private:
append(BB->getName());
}
}
- return Twine(Scratch);
+ return StringRef(Scratch);
}
};
} // namespace
More information about the llvm-commits
mailing list