Skip to content

Commit f4e7d17

Browse files
kr-2003anutosh491
authored andcommitted
added check for cling in CppInterOp.cpp
1 parent d44f424 commit f4e7d17

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
@@ -3672,6 +3672,14 @@ namespace Cpp {
36723672
complete_column);
36733673
}
36743674

3675-
int Undo(unsigned N) { return getInterp().undo(N); }
3675+
int Undo(unsigned N) {
3676+
#ifdef CPPINTEROP_USE_CLING
3677+
llvm::logAllUnhandledErrors(Undo(N), llvm::errs(),
3678+
"Undo not implemented in Cling");
3679+
return compat::Interpreter::kFailure;
3680+
#else
3681+
return getInterp().undo(N);
3682+
#endif
3683+
}
36763684

36773685
} // 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)