summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/llvm-diff
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-12-30 13:13:10 +0000
committerdim <dim@FreeBSD.org>2015-12-30 13:13:10 +0000
commit9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a (patch)
treeb466a4817f79516eb1df8eae92bccf62ecc84003 /contrib/llvm/tools/llvm-diff
parentf09a28d1de99fda4f5517fb12670fc36552f4927 (diff)
parente194cd6d03d91631334d9d5e55b506036f423cc8 (diff)
downloadFreeBSD-src-9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a.zip
FreeBSD-src-9b5bf5c4f53d65d6a48722d7410ed7cb15f5ba3a.tar.gz
Update llvm to trunk r256633.
Diffstat (limited to 'contrib/llvm/tools/llvm-diff')
-rw-r--r--contrib/llvm/tools/llvm-diff/DiffLog.cpp3
-rw-r--r--contrib/llvm/tools/llvm-diff/DiffLog.h10
-rw-r--r--contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp4
3 files changed, 11 insertions, 6 deletions
diff --git a/contrib/llvm/tools/llvm-diff/DiffLog.cpp b/contrib/llvm/tools/llvm-diff/DiffLog.cpp
index 24a1b08..ed86058 100644
--- a/contrib/llvm/tools/llvm-diff/DiffLog.cpp
+++ b/contrib/llvm/tools/llvm-diff/DiffLog.cpp
@@ -20,7 +20,8 @@
using namespace llvm;
LogBuilder::~LogBuilder() {
- consumer.logf(*this);
+ if (consumer)
+ consumer->logf(*this);
}
StringRef LogBuilder::getFormat() const { return Format; }
diff --git a/contrib/llvm/tools/llvm-diff/DiffLog.h b/contrib/llvm/tools/llvm-diff/DiffLog.h
index 8eb53ff..8f28461 100644
--- a/contrib/llvm/tools/llvm-diff/DiffLog.h
+++ b/contrib/llvm/tools/llvm-diff/DiffLog.h
@@ -27,7 +27,7 @@ namespace llvm {
/// A temporary-object class for building up log messages.
class LogBuilder {
- Consumer &consumer;
+ Consumer *consumer;
/// The use of a stored StringRef here is okay because
/// LogBuilder should be used only as a temporary, and as a
@@ -38,8 +38,12 @@ namespace llvm {
SmallVector<Value*, 4> Arguments;
public:
- LogBuilder(Consumer &c, StringRef Format)
- : consumer(c), Format(Format) {}
+ LogBuilder(Consumer &c, StringRef Format) : consumer(&c), Format(Format) {}
+ LogBuilder(LogBuilder &&L)
+ : consumer(L.consumer), Format(L.Format),
+ Arguments(std::move(L.Arguments)) {
+ L.consumer = nullptr;
+ }
LogBuilder &operator<<(Value *V) {
Arguments.push_back(V);
diff --git a/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp b/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
index 7d379ef..456560b 100644
--- a/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
+++ b/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
@@ -599,7 +599,7 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,
TerminatorInst *RTerm = RStart->getParent()->getTerminator();
if (isa<BranchInst>(LTerm) && isa<InvokeInst>(RTerm)) {
if (cast<BranchInst>(LTerm)->isConditional()) return;
- BasicBlock::iterator I = LTerm;
+ BasicBlock::iterator I = LTerm->getIterator();
if (I == LStart->getParent()->begin()) return;
--I;
if (!isa<CallInst>(*I)) return;
@@ -612,7 +612,7 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,
tryUnify(LTerm->getSuccessor(0), RInvoke->getNormalDest());
} else if (isa<InvokeInst>(LTerm) && isa<BranchInst>(RTerm)) {
if (cast<BranchInst>(RTerm)->isConditional()) return;
- BasicBlock::iterator I = RTerm;
+ BasicBlock::iterator I = RTerm->getIterator();
if (I == RStart->getParent()->begin()) return;
--I;
if (!isa<CallInst>(*I)) return;
OpenPOWER on IntegriCloud