Skip to content

Commit 363e96b

Browse files
committed
[Clang][TableGen] Add explicit symbol visibility macros to code generated
Update ClangAttrEmitter tablegen to add explicit symbol visibility macros to function declarations it creates. Both AnnotateFunctions and Attribute example plugins require clang::AnnotateAttr TableGen created functions to be exported from the Clang shared library.
1 parent 3b3accb commit 363e96b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,7 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
27622762
}
27632763

27642764
if (Header)
2765-
OS << "class " << R.getName() << "Attr : public " << SuperName << " {\n";
2765+
OS << "class CLANG_ABI " << R.getName() << "Attr : public " << SuperName << " {\n";
27662766
else
27672767
OS << "\n// " << R.getName() << "Attr implementation\n\n";
27682768

@@ -3220,7 +3220,8 @@ void clang::EmitClangAttrClass(const RecordKeeper &Records, raw_ostream &OS) {
32203220
emitSourceFileHeader("Attribute classes' definitions", OS, Records);
32213221

32223222
OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n";
3223-
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n";
3223+
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n";
3224+
OS << "#include \"clang/Support/Compiler.h\"\n\n";
32243225

32253226
emitAttributes(Records, OS, true);
32263227

0 commit comments

Comments
 (0)