Skip to content

Commit f4e51ec

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 c3edeaa commit f4e51ec

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
@@ -2727,7 +2727,7 @@ 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 << " {\n";
27312731
else
27322732
OS << "\n// " << R.getName() << "Attr implementation\n\n";
27332733

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

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

31903191
emitAttributes(Records, OS, true);
31913192

0 commit comments

Comments
 (0)