Skip to content

Commit c5cb120

Browse files
committed
fixup! clangll: Add bindings to CXEvalResult
1 parent 48df912 commit c5cb120

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/clang.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,20 @@ pub struct EvalResult {
12701270
x: CXEvalResult,
12711271
}
12721272

1273+
#[cfg(feature = "llvm_stable")]
1274+
impl EvalResult {
1275+
pub fn new(_: Cursor) -> Self {
1276+
EvalResult {
1277+
x: ::std::ptr::null_mut(),
1278+
}
1279+
}
1280+
1281+
pub fn as_int(&self) -> Option<i32> {
1282+
None
1283+
}
1284+
}
1285+
1286+
#[cfg(not(feature = "llvm_stable"))]
12731287
impl EvalResult {
12741288
pub fn new(cursor: Cursor) -> Self {
12751289
EvalResult {
@@ -1291,6 +1305,7 @@ impl EvalResult {
12911305
}
12921306
}
12931307

1308+
#[cfg(not(feature = "llvm_stable"))]
12941309
impl Drop for EvalResult {
12951310
fn drop(&mut self) {
12961311
unsafe { clang_EvalResult_dispose(self.x) };

src/clangll.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1447,10 +1447,16 @@ extern "C" {
14471447
offset: *mut c_uint);
14481448
pub fn clang_indexLoc_getCXSourceLocation(loc: CXIdxLoc) ->
14491449
CXSourceLocation;
1450+
#[cfg(not(feature="llvm_stable"))]
14501451
pub fn clang_Cursor_Evaluate(C: CXCursor) -> CXEvalResult;
1452+
#[cfg(not(feature="llvm_stable"))]
14511453
pub fn clang_EvalResult_getKind(E: CXEvalResult) -> Enum_CXEvalResultKind;
1454+
#[cfg(not(feature="llvm_stable"))]
14521455
pub fn clang_EvalResult_getAsInt(E: CXEvalResult) -> c_int;
1456+
#[cfg(not(feature="llvm_stable"))]
14531457
pub fn clang_EvalResult_getAsDouble(E: CXEvalResult) -> c_double;
1458+
#[cfg(not(feature="llvm_stable"))]
14541459
pub fn clang_EvalResult_getAsStr(E: CXEvalResult) -> *const c_char;
1460+
#[cfg(not(feature="llvm_stable"))]
14551461
pub fn clang_EvalResult_dispose(E: CXEvalResult);
14561462
}

0 commit comments

Comments
 (0)