Anastasia added inline comments.

================
Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:38
+typedef uint cl_mem_fence_flags;
+#define CLK_GLOBAL_MEM_FENCE   0x02
+
----------------
Should we add this conditionally if the base header is not included?

In the subsequent patches where you will add other functions, we should make 
sure that the base header indeed contains the declarations we use in tablegen.


================
Comment at: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp:727
+  }
+  return S.Context.getEnumType(Result.getAsSingle<EnumDecl>());
+}
----------------
I think we should add an assert that Result.getAsSingle<EnumDecl>() indeed 
holds. Consider if instead of using base header the types are defined manually 
and they are regular integers, not enums.


================
Comment at: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp:739
+  }
+  return S.Context.getTypedefType(Result.getAsSingle<TypedefNameDecl>());
+}
----------------
Same here, let's add an assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96051/new/

https://reviews.llvm.org/D96051

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

Reply via email to