Skip to content

Commit

Permalink
[Clang][TableGen] Add explicit symbol visibility macros to code gener…
Browse files Browse the repository at this point in the history
…ated

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.
  • Loading branch information
fsfod committed Sep 19, 2024
1 parent 3b3accb commit 363e96b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clang/utils/TableGen/ClangAttrEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2762,7 +2762,7 @@ static void emitAttributes(const RecordKeeper &Records, raw_ostream &OS,
}

if (Header)
OS << "class " << R.getName() << "Attr : public " << SuperName << " {\n";
OS << "class CLANG_ABI " << R.getName() << "Attr : public " << SuperName << " {\n";
else
OS << "\n// " << R.getName() << "Attr implementation\n\n";

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

OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n";
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n";
OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n";
OS << "#include \"clang/Support/Compiler.h\"\n\n";

emitAttributes(Records, OS, true);

Expand Down

0 comments on commit 363e96b

Please sign in to comment.