diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 | 
| commit | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch) | |
| tree | 0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp | |
| parent | 1799696096df87b52968b8996d00c91e0a5de8d9 (diff) | |
| parent | cfca06d7963fa0909f90483b42a6d7d194d01e08 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp | 30 | 
1 files changed, 16 insertions, 14 deletions
| diff --git a/contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp b/contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp index 564ce7870592..2cf1afbc6af5 100644 --- a/contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp +++ b/contrib/llvm-project/llvm/tools/llvm-diff/DifferenceEngine.cpp @@ -14,10 +14,10 @@  #include "DifferenceEngine.h"  #include "llvm/ADT/DenseMap.h"  #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/SmallString.h"  #include "llvm/ADT/SmallVector.h"  #include "llvm/ADT/StringSet.h"  #include "llvm/IR/CFG.h" -#include "llvm/IR/CallSite.h"  #include "llvm/IR/Constants.h"  #include "llvm/IR/Function.h"  #include "llvm/IR/Instructions.h" @@ -222,9 +222,9 @@ class FunctionDifferenceEngine {    bool matchForBlockDiff(Instruction *L, Instruction *R);    void runBlockDiff(BasicBlock::iterator LI, BasicBlock::iterator RI); -  bool diffCallSites(CallSite L, CallSite R, bool Complain) { +  bool diffCallSites(CallBase &L, CallBase &R, bool Complain) {      // FIXME: call attributes -    if (!equivalentAsOperands(L.getCalledValue(), R.getCalledValue())) { +    if (!equivalentAsOperands(L.getCalledOperand(), R.getCalledOperand())) {        if (Complain) Engine.log("called functions differ");        return true;      } @@ -233,10 +233,10 @@ class FunctionDifferenceEngine {        return true;      }      for (unsigned I = 0, E = L.arg_size(); I != E; ++I) -      if (!equivalentAsOperands(L.getArgument(I), R.getArgument(I))) { +      if (!equivalentAsOperands(L.getArgOperand(I), R.getArgOperand(I))) {          if (Complain)            Engine.logf("arguments %l and %r differ") -            << L.getArgument(I) << R.getArgument(I); +              << L.getArgOperand(I) << R.getArgOperand(I);          return true;        }      return false; @@ -258,7 +258,7 @@ class FunctionDifferenceEngine {          return true;        }      } else if (isa<CallInst>(L)) { -      return diffCallSites(CallSite(L), CallSite(R), Complain); +      return diffCallSites(cast<CallInst>(*L), cast<CallInst>(*R), Complain);      } else if (isa<PHINode>(L)) {        // FIXME: implement. @@ -273,14 +273,14 @@ class FunctionDifferenceEngine {      // Terminators.      } else if (isa<InvokeInst>(L)) { -      InvokeInst *LI = cast<InvokeInst>(L); -      InvokeInst *RI = cast<InvokeInst>(R); -      if (diffCallSites(CallSite(LI), CallSite(RI), Complain)) +      InvokeInst &LI = cast<InvokeInst>(*L); +      InvokeInst &RI = cast<InvokeInst>(*R); +      if (diffCallSites(LI, RI, Complain))          return true;        if (TryUnify) { -        tryUnify(LI->getNormalDest(), RI->getNormalDest()); -        tryUnify(LI->getUnwindDest(), RI->getUnwindDest()); +        tryUnify(LI.getNormalDest(), RI.getNormalDest()); +        tryUnify(LI.getUnwindDest(), RI.getUnwindDest());        }        return false; @@ -577,7 +577,7 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,    DiffLogBuilder Diff(Engine.getConsumer());    // Drop trailing matches. -  while (Path.back() == DC_match) +  while (Path.size() && Path.back() == DC_match)      Path.pop_back();    // Skip leading matches. @@ -638,7 +638,8 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,      if (!isa<CallInst>(*I)) return;      CallInst *LCall = cast<CallInst>(&*I);      InvokeInst *RInvoke = cast<InvokeInst>(RTerm); -    if (!equivalentAsOperands(LCall->getCalledValue(), RInvoke->getCalledValue())) +    if (!equivalentAsOperands(LCall->getCalledOperand(), +                              RInvoke->getCalledOperand()))        return;      if (!LCall->use_empty())        Values[LCall] = RInvoke; @@ -651,7 +652,8 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,      if (!isa<CallInst>(*I)) return;      CallInst *RCall = cast<CallInst>(I);      InvokeInst *LInvoke = cast<InvokeInst>(LTerm); -    if (!equivalentAsOperands(LInvoke->getCalledValue(), RCall->getCalledValue())) +    if (!equivalentAsOperands(LInvoke->getCalledOperand(), +                              RCall->getCalledOperand()))        return;      if (!LInvoke->use_empty())        Values[LInvoke] = RCall; | 
