Skip to content

Commit 12b2bd6

Browse files
fsfodvgvassilev
authored andcommitted
[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 39ac8b2 commit 12b2bd6

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
@@ -2756,7 +2756,7 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
27562756
}
27572757

27582758
if (Header)
2759-
OS << "class " << R.getName() << "Attr : public " << SuperName << " {\n";
2759+
OS << "class CLANG_ABI " << R.getName() << "Attr : public " << SuperName << " {\n";
27602760
else
27612761
OS << "\n// " << R.getName() << "Attr implementation\n\n";
27622762

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

32163216
OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n";
3217-
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n";
3217+
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n";
3218+
OS << "#include \"clang/Support/Compiler.h\"\n\n";
32183219

32193220
emitAttributes(Records, OS, true);
32203221

0 commit comments

Comments
 (0)