diff options
-rw-r--r-- | src/clang.rs | 4 | ||||
-rw-r--r-- | src/clangll.rs | 1 | ||||
-rw-r--r-- | src/parser.rs | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/clang.rs b/src/clang.rs index a5cf1007..d60de336 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -123,6 +123,10 @@ impl Cursor { } } + pub fn is_inlined_function(&self) -> bool { + unsafe { clang_Cursor_isFunctionInlined(self.x) != 0 } + } + // bitfield pub fn bit_width(&self) -> Option<u32> { unsafe { diff --git a/src/clangll.rs b/src/clangll.rs index 984f0aa5..4d2ae32d 100644 --- a/src/clangll.rs +++ b/src/clangll.rs @@ -1109,6 +1109,7 @@ extern "C" { pub fn clang_Type_getTemplateArgumentAsType(T: CXType, i: c_int) -> CXType; pub fn clang_Cursor_isBitField(C: CXCursor) -> c_uint; + pub fn clang_Cursor_isFunctionInlined(C: CXCursor) -> c_uint; pub fn clang_isVirtualBase(arg1: CXCursor) -> c_uint; pub fn clang_getCXXAccessSpecifier(arg1: CXCursor) -> Enum_CX_CXXAccessSpecifier; diff --git a/src/parser.rs b/src/parser.rs index 3fc03d57..be91d769 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -771,6 +771,10 @@ fn visit_composite(cursor: &Cursor, parent: &Cursor, return CXChildVisit_Continue; } + if cursor.is_inlined_function() { + return CXChildVisit_Continue; + } + // XXX no methods yet for templates if !ci.args.is_empty() { return CXChildVisit_Continue; @@ -999,6 +1003,10 @@ fn visit_top(cursor: &Cursor, return CXChildVisit_Continue; } + if cursor.is_inlined_function() { + return CXChildVisit_Continue; + } + let spelling = cursor.spelling(); if spelling.len() > 8 && &(spelling)[..8] == "operator" { |