Skip to content

Commit 73175c5

Browse files
committed
Add wrapper for Undo and fix prototype
1 parent 5619845 commit 73175c5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

include/clang-c/CXCppInterOp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ TInterp_t clang_interpreter_getInterpreterAsPtr(CXInterpreter I);
5656
*/
5757
TInterp_t clang_interpreter_takeInterpreterAsPtr(CXInterpreter I);
5858

59+
/**
60+
* Undo N previous incremental inputs.
61+
*/
62+
CXErrorCode clang_interpreter_Undo(CXInterpreter I, unsigned int N);
63+
5964
/**
6065
* Dispose of the given interpreter context.
6166
*/
@@ -144,7 +149,7 @@ typedef void* CXValue;
144149
*
145150
* \returns a \c CXValue.
146151
*/
147-
CXValue clang_createValue();
152+
CXValue clang_createValue(void);
148153

149154
/**
150155
* Dispose of the given CXValue.

lib/Interpreter/CXCppInterOp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ TInterp_t clang_interpreter_takeInterpreterAsPtr(CXInterpreter I) {
7070
return static_cast<CXInterpreterImpl*>(I)->Interp.release();
7171
}
7272

73+
CXErrorCode clang_interpreter_Undo(CXInterpreter I, unsigned int N) {
74+
return getInterpreter(I)->Undo(N) ? CXError_Failure : CXError_Success;
75+
}
76+
7377
void clang_interpreter_dispose(CXInterpreter I) {
7478
delete I; // NOLINT(*-owning-memory)
7579
}
@@ -113,7 +117,7 @@ enum CXErrorCode clang_interpreter_process(CXInterpreter I, const char* code) {
113117
return CXError_Success;
114118
}
115119

116-
CXValue clang_createValue() {
120+
CXValue clang_createValue(void) {
117121
#ifdef USE_CLING
118122
auto val = std::make_unique<cling::Value>();
119123
#else

0 commit comments

Comments
 (0)