[PATCH] D36806: Switch to cantFail(), since it does the same assertion.
Stephen Hines via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 30 19:04:07 PDT 2017
srhines updated this revision to Diff 113351.
srhines added a comment.
Switch to using ErrMsg in cantFail().
https://reviews.llvm.org/D36806
Files:
lib/Tooling/Core/Replacement.cpp
Index: lib/Tooling/Core/Replacement.cpp
===================================================================
--- lib/Tooling/Core/Replacement.cpp
+++ lib/Tooling/Core/Replacement.cpp
@@ -498,12 +498,11 @@
return MergedRanges;
tooling::Replacements FakeReplaces;
for (const auto &R : MergedRanges) {
- auto Err = FakeReplaces.add(Replacement(Replaces.begin()->getFilePath(),
- R.getOffset(), R.getLength(),
- std::string(R.getLength(), ' ')));
- assert(!Err &&
- "Replacements must not conflict since ranges have been merged.");
- llvm::consumeError(std::move(Err));
+ llvm::cantFail(
+ FakeReplaces.add(Replacement(Replaces.begin()->getFilePath(),
+ R.getOffset(), R.getLength(),
+ std::string(R.getLength(), ' '))),
+ "Replacements must not conflict since ranges have been merged.");
}
return FakeReplaces.merge(Replaces).getAffectedRanges();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36806.113351.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170831/34012e35/attachment-0001.bin>
More information about the cfe-commits
mailing list