Skip to content

Commit d7979c1

Browse files
authored
[Clang][TableGen] Add explicit symbol visibility macros to code generated (#109362)
Update ClangAttrEmitter TableGen to add explicit symbol visibility macros to attribute class declarations it creates. Both AnnotateFunctions and Attribute example plugins require clang::AnnotateAttr TableGen created functions to be exported from the Clang shared library. This depends on macros to be added in #108276
1 parent 5df3872 commit d7979c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/utils/TableGen/ClangAttrEmitter.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,8 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
27272727
}
27282728

27292729
if (Header)
2730-
OS << "class " << R.getName() << "Attr : public " << SuperName << " {\n";
2730+
OS << "class CLANG_ABI " << R.getName() << "Attr : public " << SuperName
2731+
<< " {\n";
27312732
else
27322733
OS << "\n// " << R.getName() << "Attr implementation\n\n";
27332734

@@ -3185,7 +3186,8 @@ void clang::EmitClangAttrClass(const RecordKeeper &Records, raw_ostream &OS) {
31853186
emitSourceFileHeader("Attribute classes' definitions", OS, Records);
31863187

31873188
OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n";
3188-
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n";
3189+
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n";
3190+
OS << "#include \"clang/Support/Compiler.h\"\n\n";
31893191

31903192
emitAttributes(Records, OS, true);
31913193

0 commit comments

Comments
 (0)