Re: [PATCH] D18478: python bindings: expose the clang version string

2016-05-11 Thread John Törnblom via cfe-commits
john.tornblom added a comment.

Any suggestions on how to test this? Just check for non-empty string?


http://reviews.llvm.org/D18478



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D18478: python bindings: expose the clang version string

2016-03-25 Thread John Törnblom via cfe-commits
john.tornblom created this revision.
john.tornblom added reviewers: eliben, compnerd.
john.tornblom added a subscriber: cfe-commits.

http://reviews.llvm.org/D18478

Files:
  bindings/python/clang/cindex.py

Index: bindings/python/clang/cindex.py
===
--- bindings/python/clang/cindex.py
+++ bindings/python/clang/cindex.py
@@ -3007,6 +3007,9 @@
Type,
Type.from_result),
 
+  ("clang_getClangVersion",
+   [], _CXString),
+
   ("clang_getCompletionAvailability",
[c_void_p],
c_int),
@@ -3625,6 +3628,16 @@
 
 return True
 
+@property
+def version_string(self):
+"""Return a version string, suitable for showing to a user
+
+The version string is not intended to be parsed, and the format is not
+guaranteed to be stable.
+"""
+version = self.lib.clang_getClangVersion()
+return version.spelling
+
 def register_enumerations():
 for name, value in clang.enumerations.TokenKinds:
 TokenKind.register(value, name)


Index: bindings/python/clang/cindex.py
===
--- bindings/python/clang/cindex.py
+++ bindings/python/clang/cindex.py
@@ -3007,6 +3007,9 @@
Type,
Type.from_result),
 
+  ("clang_getClangVersion",
+   [], _CXString),
+
   ("clang_getCompletionAvailability",
[c_void_p],
c_int),
@@ -3625,6 +3628,16 @@
 
 return True
 
+@property
+def version_string(self):
+"""Return a version string, suitable for showing to a user
+
+The version string is not intended to be parsed, and the format is not
+guaranteed to be stable.
+"""
+version = self.lib.clang_getClangVersion()
+return version.spelling
+
 def register_enumerations():
 for name, value in clang.enumerations.TokenKinds:
 TokenKind.register(value, name)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits