-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Clang][TableGen] Add explicit symbol visibility macros to code generated #109362
Conversation
@llvm/pr-subscribers-clang Author: Thomas Fransham (fsfod) ChangesUpdate ClangAttrEmitter TableGen to add explicit symbol visibility macros to class declarations it creates. Full diff: https://github.com/llvm/llvm-project/pull/109362.diff 1 Files Affected:
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 87be48c215e230..43c423eb033890 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -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";
@@ -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);
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
8888f7c
to
164b921
Compare
@AaronBallman, ping. |
@fsfod, can you rebase? |
…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.
164b921
to
e395af0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…ated (llvm#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 llvm#108276
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