r366143 - [OpenCL] Make TableGen'd builtin tables and helper functions static
Tom Stellard via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 15 15:34:20 PDT 2019
Author: tstellar
Date: Mon Jul 15 15:34:19 2019
New Revision: 366143
URL: http://llvm.org/viewvc/llvm-project?rev=366143&view=rev
Log:
[OpenCL] Make TableGen'd builtin tables and helper functions static
Reviewers: Pierre, Anastasia
Reviewed By: Anastasia
Subscribers: yaxunl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64608
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=366143&r1=366142&r2=366143&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon Jul 15 15:34:19 2019
@@ -688,7 +688,7 @@ static void InsertOCLBuiltinDeclarations
unsigned Len) {
for (unsigned i = 0; i < Len; ++i) {
- OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
+ const OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
ASTContext &Context = S.Context;
// Ignore this BIF if the version is incorrect.
Modified: cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp?rev=366143&r1=366142&r2=366143&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp Mon Jul 15 15:34:19 2019
@@ -207,7 +207,7 @@ void BuiltinNameEmitter::GetOverloads()
}
void BuiltinNameEmitter::EmitSignatureTable() {
- OS << "OpenCLType OpenCLSignature[] = {\n";
+ OS << "static const OpenCLType OpenCLSignature[] = {\n";
for (auto &P : SignatureSet) {
OS << "// " << P.second << "\n";
for (Record *R : P.first) {
@@ -222,7 +222,7 @@ void BuiltinNameEmitter::EmitSignatureTa
}
void BuiltinNameEmitter::EmitBuiltinTable() {
- OS << "OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
+ OS << "static const OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
for (auto &i : OverloadInfo) {
StringRef Name = i.first;
OS << "// " << Name << "\n";
@@ -255,7 +255,7 @@ void BuiltinNameEmitter::EmitStringMatch
OS << R"(
// Return 0 if name is not a recognized OpenCL builtin, or an index
// into a table of declarations if it is an OpenCL builtin.
-std::pair<unsigned, unsigned> isOpenCLBuiltin(llvm::StringRef name) {
+static std::pair<unsigned, unsigned> isOpenCLBuiltin(llvm::StringRef name) {
)";
More information about the cfe-commits
mailing list