Skip to content

Commit 55d3089

Browse files
author
kr-2003
committed
added check for cling in CppInterOp.cpp
1 parent 650d762 commit 55d3089

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/Interpreter/CppInterOp.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3616,6 +3616,14 @@ namespace Cpp {
36163616
complete_column);
36173617
}
36183618

3619-
int Undo(unsigned N) { return getInterp().undo(N); }
3619+
int Undo(unsigned N) {
3620+
#ifdef CPPINTEROP_USE_CLING
3621+
llvm::logAllUnhandledErrors(Undo(N), llvm::errs(),
3622+
"Undo not implemented in Cling");
3623+
return compat::Interpreter::kFailure;
3624+
#else
3625+
return getInterp().undo(N);
3626+
#endif
3627+
}
36203628

36213629
} // end namespace Cpp

lib/Interpreter/CppInterOpInterpreter.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,18 +430,12 @@ class Interpreter {
430430
}
431431

432432
CompilationResult undo(unsigned N = 1) {
433-
#ifdef CPPINTEROP_USE_CLING
434-
llvm::logAllUnhandledErrors(Undo(N), llvm::errs(),
435-
"Undo not implemented in Cling");
436-
return kFailure;
437-
#else
438433
if (llvm::Error Err = Undo(N)) {
439434
llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(),
440435
"Failed to undo via ::undo");
441436
return kFailure;
442437
}
443438
return kSuccess;
444-
#endif
445439
}
446440

447441
}; // Interpreter

0 commit comments

Comments
 (0)