diff options
-rw-r--r-- | clang/bindings/python/clang/cindex.py | 1 | ||||
-rw-r--r-- | clang/include/clang-c/Index.h | 3 | ||||
-rw-r--r-- | clang/test/Index/attributes-cuda.cu | 7 | ||||
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 2 | ||||
-rw-r--r-- | clang/tools/libclang/CXCursor.cpp | 1 |
5 files changed, 11 insertions, 3 deletions
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py index ebe28fb08a4..68f7e48fc66 100644 --- a/clang/bindings/python/clang/cindex.py +++ b/clang/bindings/python/clang/cindex.py @@ -1086,6 +1086,7 @@ CursorKind.CUDACONSTANT_ATTR = CursorKind(412) CursorKind.CUDADEVICE_ATTR = CursorKind(413) CursorKind.CUDAGLOBAL_ATTR = CursorKind(414) CursorKind.CUDAHOST_ATTR = CursorKind(415) +CursorKind.CUDASHARED_ATTR = CursorKind(416) ### # Preprocessing diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 972f42e69a4..15ccc3b2088 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -2236,7 +2236,8 @@ enum CXCursorKind { CXCursor_CUDADeviceAttr = 413, CXCursor_CUDAGlobalAttr = 414, CXCursor_CUDAHostAttr = 415, - CXCursor_LastAttr = CXCursor_CUDAHostAttr, + CXCursor_CUDASharedAttr = 416, + CXCursor_LastAttr = CXCursor_CUDASharedAttr, /* Preprocessing */ CXCursor_PreprocessingDirective = 500, diff --git a/clang/test/Index/attributes-cuda.cu b/clang/test/Index/attributes-cuda.cu index 953ef3d51fe..824bdb4c883 100644 --- a/clang/test/Index/attributes-cuda.cu +++ b/clang/test/Index/attributes-cuda.cu @@ -3,6 +3,7 @@ __attribute__((device)) void f_device(); __attribute__((global)) void f_global(); __attribute__((constant)) int* g_constant; +__attribute__((shared)) float *g_shared; __attribute__((host)) void f_host(); // CHECK: attributes-cuda.cu:3:30: FunctionDecl=f_device:3:30 @@ -11,5 +12,7 @@ __attribute__((host)) void f_host(); // CHECK-NEXT: attributes-cuda.cu:4:16: attribute(global) // CHECK: attributes-cuda.cu:5:32: VarDecl=g_constant:5:32 (Definition) // CHECK-NEXT: attributes-cuda.cu:5:16: attribute(constant) -// CHECK: attributes-cuda.cu:6:28: FunctionDecl=f_host:6:28 -// CHECK-NEXT: attributes-cuda.cu:6:16: attribute(host) +// CHECK: attributes-cuda.cu:6:32: VarDecl=g_shared:6:32 (Definition) +// CHECK-NEXT: attributes-cuda.cu:6:16: attribute(shared) +// CHECK: attributes-cuda.cu:7:28: FunctionDecl=f_host:7:28 +// CHECK-NEXT: attributes-cuda.cu:7:16: attribute(host) diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index d898f90ca62..f1886e0735b 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -4052,6 +4052,8 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) { return cxstring::createRef("attribute(global)"); case CXCursor_CUDAHostAttr: return cxstring::createRef("attribute(host)"); + case CXCursor_CUDASharedAttr: + return cxstring::createRef("attribute(shared)"); case CXCursor_PreprocessingDirective: return cxstring::createRef("preprocessing directive"); case CXCursor_MacroDefinition: diff --git a/clang/tools/libclang/CXCursor.cpp b/clang/tools/libclang/CXCursor.cpp index a20cc4ad3d0..db310087902 100644 --- a/clang/tools/libclang/CXCursor.cpp +++ b/clang/tools/libclang/CXCursor.cpp @@ -57,6 +57,7 @@ static CXCursorKind GetCursorKind(const Attr *A) { case attr::CUDADevice: return CXCursor_CUDADeviceAttr; case attr::CUDAGlobal: return CXCursor_CUDAGlobalAttr; case attr::CUDAHost: return CXCursor_CUDAHostAttr; + case attr::CUDAShared: return CXCursor_CUDASharedAttr; } return CXCursor_UnexposedAttr; |