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 0b87cd9d..9c46a94e 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -135,6 +135,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 dfd92cee..4877ea70 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 2d46d791..6b942b2a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -888,6 +888,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; @@ -1198,6 +1202,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" { |