The issue is that we were calling clang_getCompletionBriefComment
unconditionally. New we check if this function is available before calling it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164464
91177308-0d34-0410-b5e6-
96231b3b80d8
@property
def briefComment(self):
- return conf.lib.clang_getCompletionBriefComment(self.obj)
+ if conf.function_exists("clang_getCompletionBriefComment"):
+ return conf.lib.clang_getCompletionBriefComment(self.obj)
+ return _CXString()
def __repr__(self):
return " | ".join([str(a) for a in self]) \
return library
+ def function_exists(self, name):
+ try:
+ getattr(self.lib, name)
+ except AttributeError:
+ return False
+
+ return True
def register_enumerations():
for name, value in clang.enumerations.TokenKinds: