diff options
author | Eli Bendersky <eliben@google.com> | 2014-05-28 19:29:58 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2014-05-28 19:29:58 +0000 |
commit | f722606af2c9dbc2d24705254bdf89bcc48a7a79 (patch) | |
tree | 72f97592f114a162b4d7b7954c278114b83e4958 /tools | |
parent | 5ff1d8a32b03cd24659fccae6eca1700193bdcbc (diff) | |
download | clang-f722606af2c9dbc2d24705254bdf89bcc48a7a79.tar.gz clang-f722606af2c9dbc2d24705254bdf89bcc48a7a79.tar.bz2 clang-f722606af2c9dbc2d24705254bdf89bcc48a7a79.tar.xz |
Expose CUDA function attributes to the C interface.
Until now all CUDA-specific attributes were represented with
CXCursor_UnexposedAttr; now they are actually implemented, including the Python
bindings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndex.cpp | 8 | ||||
-rw-r--r-- | tools/libclang/CXCursor.cpp | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index bc1174ae3c..ef4ddeab94 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -3879,6 +3879,14 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) { return cxstring::createRef("attribute(const)"); case CXCursor_NoDuplicateAttr: return cxstring::createRef("attribute(noduplicate)"); + case CXCursor_CUDAConstantAttr: + return cxstring::createRef("attribute(constant)"); + case CXCursor_CUDADeviceAttr: + return cxstring::createRef("attribute(device)"); + case CXCursor_CUDAGlobalAttr: + return cxstring::createRef("attribute(global)"); + case CXCursor_CUDAHostAttr: + return cxstring::createRef("attribute(host)"); case CXCursor_PreprocessingDirective: return cxstring::createRef("preprocessing directive"); case CXCursor_MacroDefinition: diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp index fb4ce66d3a..1d4d14ef91 100644 --- a/tools/libclang/CXCursor.cpp +++ b/tools/libclang/CXCursor.cpp @@ -53,6 +53,10 @@ static CXCursorKind GetCursorKind(const Attr *A) { case attr::Pure: return CXCursor_PureAttr; case attr::Const: return CXCursor_ConstAttr; case attr::NoDuplicate: return CXCursor_NoDuplicateAttr; + case attr::CUDAConstant: return CXCursor_CUDAConstantAttr; + case attr::CUDADevice: return CXCursor_CUDADeviceAttr; + case attr::CUDAGlobal: return CXCursor_CUDAGlobalAttr; + case attr::CUDAHost: return CXCursor_CUDAHostAttr; } return CXCursor_UnexposedAttr; |