Skip to content

Commit

Permalink
Use getCalledFunction (rust-lang#991)
Browse files Browse the repository at this point in the history
* use getCalledFunction
  • Loading branch information
tgymnich authored Feb 12, 2023
1 parent ce11d52 commit 23d6ecc
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions enzyme/Enzyme/TraceGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,12 @@ class TraceGenerator final : public llvm::InstVisitor<TraceGenerator> {
if (tutils->hasDynamicTraceInterface())
args.push_back(tutils->getDynamicTraceInterface());

Function *samplefn = Logic.CreateTrace(
call.getCalledFunction(), tutils->generativeFunctions, tutils->mode,
tutils->hasDynamicTraceInterface());
Function *called = getFunctionFromCall(&call);
assert(called);

#if LLVM_VERSION_MAJOR >= 11
Value *called = call.getCalledOperand();
#else
Value *called = call.getCalledValue();
#endif
Function *samplefn =
Logic.CreateTrace(called, tutils->generativeFunctions, tutils->mode,
tutils->hasDynamicTraceInterface());

Instruction *tracecall;
switch (mode) {
Expand Down

0 comments on commit 23d6ecc

Please sign in to comment.