Skip to content

Clang tooling generated visibility macros for Clang #109702

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fsfod
Copy link
Contributor

@fsfod fsfod commented Sep 23, 2024

These changes will be needed to support shared library\DLL builds and plugins on windows by adding explicit visibility macros to public API surface that will dllexport'ed. Another benefit will be reducing the numbers of exported symbols on non windows platforms when the default symbol visibility is set to hidden at a latter time. A previous discussion by @compnerd about the required changes can be found here Supporting LLVM_BUILD_LLVM_DYLIB on Windows

The visibility macros generated here are created by a ids clang tooling based tool that @compnerd wrote and I've extended.
To reduce the numbers of exports and to avoid explicitly deleting more special members than necessary for MSVC only classes with out of line members or static variables have visibility macros added to them. I've included the config file that used to drive the tool for the Clang codebase to add some insight files are or aren't modified. I skipped running clang-format over most of changes just so the diffs are more readable and some files some weird indenting that clang-format to reformat the whole file.
I should add don't intend for this to be merged like this in one big PR unless asked to, I was just asked to post it like this,
These changes also depend on the macros to be added in #108276.

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:ARM backend:AArch64 backend:AMDGPU backend:Hexagon backend:RISC-V backend:PowerPC backend:SystemZ backend:WebAssembly backend:X86 clang-format clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:codegen IR generation bugs: mangling, exceptions, etc. clang:static analyzer xray HLSL HLSL Language Support clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html backend:loongarch clang:analysis clang:openmp OpenMP related changes to Clang labels Sep 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-clangir
@llvm/pr-subscribers-xray
@llvm/pr-subscribers-backend-powerpc
@llvm/pr-subscribers-backend-amdgpu
@llvm/pr-subscribers-backend-hexagon

@llvm/pr-subscribers-backend-aarch64

Author: Thomas Fransham (fsfod)

Changes

The visibility macros generated here are created by a ids clang tooling based tool that @compnerd wrote and I've extended.
To reduce the numbers of exports and to avoid explicitly deleting more special members than necessary for MSVC only classes with out of line members or static variables have visibility macros added to them. I've included the config file that used to drive the tool for the Clang codebase to add some insight files are or aren't modified. I skipped running clang-format over most of changes just so the diffs are more readable and some files some weird indenting that clang-format to reformat the whole file.
These changes also depend on the macros to be added in #108276.


Patch is 1.09 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109702.diff

501 Files Affected:

  • (modified) clang/include/clang/APINotes/APINotesManager.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesReader.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesWriter.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesYAMLCompiler.h (+3-2)
  • (modified) clang/include/clang/APINotes/Types.h (+11-10)
  • (modified) clang/include/clang/ARCMigrate/ARCMT.h (+9-8)
  • (modified) clang/include/clang/ARCMigrate/ARCMTActions.h (+6-5)
  • (modified) clang/include/clang/ARCMigrate/FileRemapper.h (+2-1)
  • (modified) clang/include/clang/AST/APNumericStorage.h (+2-1)
  • (modified) clang/include/clang/AST/APValue.h (+12-11)
  • (modified) clang/include/clang/AST/ASTConcept.h (+4-3)
  • (modified) clang/include/clang/AST/ASTConsumer.h (+2-1)
  • (modified) clang/include/clang/AST/ASTContext.h (+5-4)
  • (modified) clang/include/clang/AST/ASTContextAllocate.h (+5-4)
  • (modified) clang/include/clang/AST/ASTDiagnostic.h (+3-2)
  • (modified) clang/include/clang/AST/ASTDumper.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImportError.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImporter.h (+3-2)
  • (modified) clang/include/clang/AST/ASTImporterLookupTable.h (+2-1)
  • (modified) clang/include/clang/AST/ASTMutationListener.h (+2-1)
  • (modified) clang/include/clang/AST/ASTStructuralEquivalence.h (+2-1)
  • (modified) clang/include/clang/AST/ASTTypeTraits.h (+3-2)
  • (modified) clang/include/clang/AST/ASTUnresolvedSet.h (+2-1)
  • (modified) clang/include/clang/AST/Attr.h (+2-1)
  • (modified) clang/include/clang/AST/Availability.h (+2-1)
  • (modified) clang/include/clang/AST/CXXInheritance.h (+3-2)
  • (modified) clang/include/clang/AST/Comment.h (+7-6)
  • (modified) clang/include/clang/AST/CommentBriefParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentCommandTraits.h (+2-1)
  • (modified) clang/include/clang/AST/CommentLexer.h (+3-2)
  • (modified) clang/include/clang/AST/CommentParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentSema.h (+2-1)
  • (modified) clang/include/clang/AST/ComparisonCategories.h (+5-4)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+86-85)
  • (modified) clang/include/clang/AST/DataCollection.h (+2-1)
  • (modified) clang/include/clang/AST/Decl.h (+35-34)
  • (modified) clang/include/clang/AST/DeclBase.h (+5-4)
  • (modified) clang/include/clang/AST/DeclCXX.h (+33-32)
  • (modified) clang/include/clang/AST/DeclContextInternals.h (+2-1)
  • (modified) clang/include/clang/AST/DeclFriend.h (+2-1)
  • (modified) clang/include/clang/AST/DeclGroup.h (+2-1)
  • (modified) clang/include/clang/AST/DeclID.h (+3-2)
  • (modified) clang/include/clang/AST/DeclObjC.h (+20-19)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+7-6)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+25-24)
  • (modified) clang/include/clang/AST/DeclarationName.h (+7-6)
  • (modified) clang/include/clang/AST/DependentDiagnostic.h (+2-1)
  • (modified) clang/include/clang/AST/Expr.h (+40-39)
  • (modified) clang/include/clang/AST/ExprCXX.h (+44-43)
  • (modified) clang/include/clang/AST/ExprConcepts.h (+7-6)
  • (modified) clang/include/clang/AST/ExprObjC.h (+6-5)
  • (modified) clang/include/clang/AST/ExprOpenMP.h (+3-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+2-1)
  • (modified) clang/include/clang/AST/ExternalASTSource.h (+2-1)
  • (modified) clang/include/clang/AST/FormatString.h (+13-12)
  • (modified) clang/include/clang/AST/JSONNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/LambdaCapture.h (+2-1)
  • (modified) clang/include/clang/AST/LocInfoType.h (+2-1)
  • (modified) clang/include/clang/AST/Mangle.h (+5-4)
  • (modified) clang/include/clang/AST/MangleNumberingContext.h (+2-1)
  • (modified) clang/include/clang/AST/NSAPI.h (+2-1)
  • (modified) clang/include/clang/AST/NestedNameSpecifier.h (+4-3)
  • (modified) clang/include/clang/AST/ODRDiagsEmitter.h (+2-1)
  • (modified) clang/include/clang/AST/ODRHash.h (+3-2)
  • (modified) clang/include/clang/AST/OSLog.h (+2-1)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+34-33)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+58-57)
  • (modified) clang/include/clang/AST/ParentMap.h (+2-1)
  • (modified) clang/include/clang/AST/ParentMapContext.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyDeclStackTrace.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyPrinter.h (+2-1)
  • (modified) clang/include/clang/AST/QualTypeNames.h (+3-2)
  • (modified) clang/include/clang/AST/Randstruct.h (+2-1)
  • (modified) clang/include/clang/AST/RawCommentList.h (+3-2)
  • (modified) clang/include/clang/AST/RecordLayout.h (+2-1)
  • (modified) clang/include/clang/AST/Redeclarable.h (+2-1)
  • (modified) clang/include/clang/AST/SelectorLocationsKind.h (+5-4)
  • (modified) clang/include/clang/AST/Stmt.h (+22-21)
  • (modified) clang/include/clang/AST/StmtCXX.h (+5-4)
  • (modified) clang/include/clang/AST/StmtIterator.h (+2-1)
  • (modified) clang/include/clang/AST/StmtObjC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+80-79)
  • (modified) clang/include/clang/AST/TemplateBase.h (+7-6)
  • (modified) clang/include/clang/AST/TemplateName.h (+6-5)
  • (modified) clang/include/clang/AST/TextNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/Type.h (+71-70)
  • (modified) clang/include/clang/AST/TypeLoc.h (+32-31)
  • (modified) clang/include/clang/AST/VTTBuilder.h (+2-1)
  • (modified) clang/include/clang/AST/VTableBuilder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchFinder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+231-230)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchersInternal.h (+14-13)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Parser.h (+4-3)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Registry.h (+3-2)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/VariantValue.h (+6-5)
  • (modified) clang/include/clang/ASTMatchers/GtestMatchers.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/CalledOnceCheck.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/Consumed.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/Dominators.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/IntervalPartition.h (+6-5)
  • (modified) clang/include/clang/Analysis/Analyses/LiveVariables.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/PostOrderCFGView.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/ReachableCode.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafety.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyLogical.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/UninitializedValues.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h (+5-4)
  • (modified) clang/include/clang/Analysis/AnalysisDeclContext.h (+8-7)
  • (modified) clang/include/clang/Analysis/BodyFarm.h (+2-1)
  • (modified) clang/include/clang/Analysis/CFG.h (+7-6)
  • (modified) clang/include/clang/Analysis/CFGStmtMap.h (+2-1)
  • (modified) clang/include/clang/Analysis/CallGraph.h (+3-2)
  • (modified) clang/include/clang/Analysis/CloneDetection.h (+11-10)
  • (modified) clang/include/clang/Analysis/CodeInjector.h (+2-1)
  • (modified) clang/include/clang/Analysis/ConstructionContext.h (+4-3)
  • (modified) clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h (+5-4)
  • (modified) clang/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/ASTOps.h (+8-7)
  • (modified) clang/include/clang/Analysis/FlowSensitive/AdornedCFG.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Arena.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/CNFFormula.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DebugSupport.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Formula.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Logger.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/RecordOps.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Solver.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Transfer.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Value.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h (+2-1)
  • (modified) clang/include/clang/Analysis/IssueHash.h (+3-2)
  • (modified) clang/include/clang/Analysis/MacroExpansionContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/PathDiagnostic.h (+14-13)
  • (modified) clang/include/clang/Analysis/ProgramPoint.h (+4-3)
  • (modified) clang/include/clang/Analysis/RetainSummaryManager.h (+5-4)
  • (modified) clang/include/clang/Basic/ASTSourceDescriptor.h (+2-1)
  • (modified) clang/include/clang/Basic/AttrSubjectMatchRules.h (+2-1)
  • (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/Attributes.h (+2-1)
  • (modified) clang/include/clang/Basic/Builtins.h (+4-3)
  • (modified) clang/include/clang/Basic/CLWarnings.h (+2-1)
  • (modified) clang/include/clang/Basic/CharInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/Cuda.h (+11-10)
  • (modified) clang/include/clang/Basic/DarwinSDKInfo.h (+4-3)
  • (modified) clang/include/clang/Basic/Diagnostic.h (+18-17)
  • (modified) clang/include/clang/Basic/DiagnosticError.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticIDs.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticOptions.h (+3-2)
  • (modified) clang/include/clang/Basic/ExpressionTraits.h (+3-2)
  • (modified) clang/include/clang/Basic/FileEntry.h (+2-1)
  • (modified) clang/include/clang/Basic/FileManager.h (+2-1)
  • (modified) clang/include/clang/Basic/FileSystemStatCache.h (+3-2)
  • (modified) clang/include/clang/Basic/IdentifierTable.h (+9-8)
  • (modified) clang/include/clang/Basic/LangOptions.h (+4-3)
  • (modified) clang/include/clang/Basic/LangStandard.h (+4-3)
  • (modified) clang/include/clang/Basic/MakeSupport.h (+2-1)
  • (modified) clang/include/clang/Basic/Module.h (+3-2)
  • (modified) clang/include/clang/Basic/NoSanitizeList.h (+2-1)
  • (modified) clang/include/clang/Basic/ObjCRuntime.h (+3-2)
  • (modified) clang/include/clang/Basic/OpenCLOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/OpenMPKinds.h (+27-26)
  • (modified) clang/include/clang/Basic/OperatorKinds.h (+2-1)
  • (modified) clang/include/clang/Basic/OperatorPrecedence.h (+2-1)
  • (modified) clang/include/clang/Basic/ParsedAttrInfo.h (+3-2)
  • (modified) clang/include/clang/Basic/PrettyStackTrace.h (+2-1)
  • (modified) clang/include/clang/Basic/ProfileList.h (+2-1)
  • (modified) clang/include/clang/Basic/SanitizerSpecialCaseList.h (+2-1)
  • (modified) clang/include/clang/Basic/Sanitizers.h (+10-9)
  • (modified) clang/include/clang/Basic/Sarif.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceLocation.h (+5-4)
  • (modified) clang/include/clang/Basic/SourceManager.h (+6-5)
  • (modified) clang/include/clang/Basic/SourceManagerInternals.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceMgrAdapter.h (+2-1)
  • (modified) clang/include/clang/Basic/Specifiers.h (+4-3)
  • (modified) clang/include/clang/Basic/Stack.h (+4-3)
  • (modified) clang/include/clang/Basic/SyncScope.h (+2-1)
  • (modified) clang/include/clang/Basic/TargetID.h (+7-6)
  • (modified) clang/include/clang/Basic/TargetInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/TokenKinds.h (+7-6)
  • (modified) clang/include/clang/Basic/TypeTraits.h (+8-7)
  • (modified) clang/include/clang/Basic/Version.h (+10-9)
  • (modified) clang/include/clang/Basic/XRayInstr.h (+3-2)
  • (modified) clang/include/clang/Basic/XRayLists.h (+2-1)
  • (modified) clang/include/clang/CodeGen/BackendUtil.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CGFunctionInfo.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CodeGenABITypes.h (+21-20)
  • (modified) clang/include/clang/CodeGen/CodeGenAction.h (+8-7)
  • (modified) clang/include/clang/CodeGen/ConstantInitBuilder.h (+5-4)
  • (modified) clang/include/clang/CodeGen/ConstantInitFuture.h (+2-1)
  • (modified) clang/include/clang/CodeGen/ModuleBuilder.h (+3-2)
  • (modified) clang/include/clang/CodeGen/ObjectFilePCHContainerWriter.h (+2-1)
  • (modified) clang/include/clang/CodeGen/SwiftCallingConv.h (+15-14)
  • (modified) clang/include/clang/CrossTU/CrossTranslationUnit.h (+9-8)
  • (modified) clang/include/clang/Driver/Action.h (+29-28)
  • (modified) clang/include/clang/Driver/Compilation.h (+2-1)
  • (modified) clang/include/clang/Driver/Distro.h (+2-1)
  • (modified) clang/include/clang/Driver/Driver.h (+8-7)
  • (modified) clang/include/clang/Driver/Job.h (+4-3)
  • (modified) clang/include/clang/Driver/Multilib.h (+5-4)
  • (modified) clang/include/clang/Driver/MultilibBuilder.h (+3-2)
  • (modified) clang/include/clang/Driver/OffloadBundler.h (+5-4)
  • (modified) clang/include/clang/Driver/OptionUtils.h (+3-2)
  • (modified) clang/include/clang/Driver/Options.h (+2-1)
  • (modified) clang/include/clang/Driver/Phases.h (+2-1)
  • (modified) clang/include/clang/Driver/SanitizerArgs.h (+2-1)
  • (modified) clang/include/clang/Driver/Tool.h (+2-1)
  • (modified) clang/include/clang/Driver/ToolChain.h (+2-1)
  • (modified) clang/include/clang/Driver/Types.h (+26-25)
  • (modified) clang/include/clang/Driver/XRayArgs.h (+2-1)
  • (modified) clang/include/clang/Edit/Commit.h (+3-2)
  • (modified) clang/include/clang/Edit/EditedSource.h (+2-1)
  • (modified) clang/include/clang/Edit/EditsReceiver.h (+2-1)
  • (modified) clang/include/clang/Edit/Rewriters.h (+4-3)
  • (modified) clang/include/clang/ExtractAPI/API.h (+36-35)
  • (modified) clang/include/clang/ExtractAPI/APIIgnoresList.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/DeclarationFragments.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/ExtractAPIActionBase.h (+2-1)
  • (modified) clang/include/clang/ExtractAPI/FrontendActions.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/TypedefUnderlyingTypeResolver.h (+2-1)
  • (modified) clang/include/clang/Format/Format.h (+36-35)
  • (modified) clang/include/clang/Frontend/ASTConsumers.h (+5-4)
  • (modified) clang/include/clang/Frontend/ASTUnit.h (+4-3)
  • (modified) clang/include/clang/Frontend/ChainedDiagnosticConsumer.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInstance.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInvocation.h (+10-9)
  • (modified) clang/include/clang/Frontend/DiagnosticRenderer.h (+3-2)
  • (modified) clang/include/clang/Frontend/FrontendAction.h (+6-5)
  • (modified) clang/include/clang/Frontend/FrontendActions.h (+27-26)
  • (modified) clang/include/clang/Frontend/FrontendOptions.h (+2-1)
  • (modified) clang/include/clang/Frontend/LayoutOverrideSource.h (+2-1)
  • (modified) clang/include/clang/Frontend/LogDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/MultiplexConsumer.h (+3-2)
  • (modified) clang/include/clang/Frontend/PrecompiledPreamble.h (+7-6)
  • (modified) clang/include/clang/Frontend/SARIFDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/SARIFDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticReader.h (+4-3)
  • (modified) clang/include/clang/Frontend/TextDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticBuffer.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/Utils.h (+10-9)
  • (modified) clang/include/clang/Frontend/VerifyDiagnosticConsumer.h (+3-2)
  • (modified) clang/include/clang/FrontendTool/Utils.h (+3-2)
  • (modified) clang/include/clang/Index/CommentToXML.h (+2-1)
  • (modified) clang/include/clang/Index/IndexSymbol.h (+13-12)
  • (modified) clang/include/clang/Index/IndexingAction.h (+8-7)
  • (modified) clang/include/clang/Index/USRGeneration.h (+17-16)
  • (modified) clang/include/clang/IndexSerialization/SerializablePathCollection.h (+4-3)
  • (modified) clang/include/clang/InstallAPI/Context.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/DirectoryScanner.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/DylibVerifier.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/FileList.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Frontend.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/FrontendRecords.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/HeaderFile.h (+6-5)
  • (modified) clang/include/clang/InstallAPI/Library.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Visitor.h (+2-1)
  • (modified) clang/include/clang/Interpreter/CodeCompletion.h (+2-1)
  • (modified) clang/include/clang/Interpreter/Interpreter.h (+3-2)
  • (modified) clang/include/clang/Lex/CodeCompletionHandler.h (+2-1)
  • (modified) clang/include/clang/Lex/DependencyDirectivesScanner.h (+3-2)
  • (modified) clang/include/clang/Lex/DirectoryLookup.h (+3-2)
  • (modified) clang/include/clang/Lex/ExternalPreprocessorSource.h (+2-1)
  • (modified) clang/include/clang/Lex/HeaderMap.h (+3-2)
  • (modified) clang/include/clang/Lex/HeaderSearch.h (+5-4)
  • (modified) clang/include/clang/Lex/Lexer.h (+2-1)
  • (modified) clang/include/clang/Lex/LiteralSupport.h (+7-6)
  • (modified) clang/include/clang/Lex/MacroArgs.h (+2-1)
  • (modified) clang/include/clang/Lex/MacroInfo.h (+5-4)
  • (modified) clang/include/clang/Lex/ModuleLoader.h (+2-1)
  • (modified) clang/include/clang/Lex/ModuleMap.h (+3-2)
  • (modified) clang/include/clang/Lex/PPCallbacks.h (+3-2)
  • (modified) clang/include/clang/Lex/PPConditionalDirectiveRecord.h (+2-1)
  • (modified) clang/include/clang/Lex/Pragma.h (+5-4)
  • (modified) clang/include/clang/Lex/PreprocessingRecord.h (+5-4)
  • (modified) clang/include/clang/Lex/Preprocessor.h (+4-3)
  • (modified) clang/include/clang/Lex/PreprocessorLexer.h (+2-1)
  • (modified) clang/include/clang/Lex/ScratchBuffer.h (+2-1)
  • (modified) clang/include/clang/Lex/Token.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenConcatenation.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenLexer.h (+2-1)
  • (modified) clang/include/clang/Parse/ParseAST.h (+3-2)
  • (modified) clang/include/clang/Parse/Parser.h (+13-12)
  • (modified) clang/include/clang/Parse/RAIIObjectsForParser.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/HTMLRewrite.h (+10-9)
  • (modified) clang/include/clang/Rewrite/Core/Rewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/TokenRewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Frontend/ASTConsumers.h (+4-3)
  • (modified) clang/include/clang/Rewrite/Frontend/FixItRewriter.h (+3-2)
  • (modified) clang/include/clang/Rewrite/Frontend/FrontendActions.h (+8-7)
  • (modified) clang/include/clang/Rewrite/Frontend/Rewriters.h (+4-3)
  • (modified) clang/include/clang/Sema/AnalysisBasedWarnings.h (+3-2)
  • (modified) clang/include/clang/Sema/CodeCompleteConsumer.h (+20-19)
  • (modified) clang/include/clang/Sema/DeclSpec.h (+7-6)
  • (modified) clang/include/clang/Sema/DelayedDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Sema/ExternalSemaSource.h (+2-1)
diff --git a/clang/include/clang/APINotes/APINotesManager.h b/clang/include/clang/APINotes/APINotesManager.h
index 98592438e90eab..05d7930d3a2e7f 100644
--- a/clang/include/clang/APINotes/APINotesManager.h
+++ b/clang/include/clang/APINotes/APINotesManager.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
@@ -41,7 +42,7 @@ class APINotesReader;
 /// external API notes files that correspond to a given header. Its primary
 /// operation is \c findAPINotes(), which finds the API notes reader that
 /// provides information about the declarations at that location.
-class APINotesManager {
+class CLANG_ABI APINotesManager {
   using ReaderEntry = llvm::PointerUnion<DirectoryEntryRef, APINotesReader *>;
 
   SourceManager &SM;
diff --git a/clang/include/clang/APINotes/APINotesReader.h b/clang/include/clang/APINotes/APINotesReader.h
index baf63340640242..58ee2857c7930f 100644
--- a/clang/include/clang/APINotes/APINotesReader.h
+++ b/clang/include/clang/APINotes/APINotesReader.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_READER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/VersionTuple.h"
 #include <memory>
@@ -25,7 +26,7 @@ namespace api_notes {
 
 /// A class that reads API notes data from a binary file that was written by
 /// the \c APINotesWriter.
-class APINotesReader {
+class CLANG_ABI APINotesReader {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesWriter.h b/clang/include/clang/APINotes/APINotesWriter.h
index 3cc16c3d959faf..b8b45a89dcfc8b 100644
--- a/clang/include/clang/APINotes/APINotesWriter.h
+++ b/clang/include/clang/APINotes/APINotesWriter.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_WRITER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/Support/raw_ostream.h"
@@ -29,7 +30,7 @@ namespace api_notes {
 
 /// A class that writes API notes data to a binary representation that can be
 /// read by the \c APINotesReader.
-class APINotesWriter {
+class CLANG_ABI APINotesWriter {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesYAMLCompiler.h b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
index 9c24ed85b6a124..3954cf347e8244 100644
--- a/clang/include/clang/APINotes/APINotesYAMLCompiler.h
+++ b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 #define LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
@@ -22,10 +23,10 @@ namespace api_notes {
 /// Parses the APINotes YAML content and writes the representation back to the
 /// specified stream.  This provides a means of testing the YAML processing of
 /// the APINotes format.
-bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
+CLANG_ABI bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
 
 /// Converts API notes from YAML format to binary format.
-bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
+CLANG_ABI bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
                      llvm::raw_ostream &OS,
                      llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr,
                      void *DiagHandlerCtxt = nullptr);
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 89889910d1a073..574406586c4674 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_TYPES_H
 
 #include "clang/Basic/Specifiers.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include <climits>
@@ -49,7 +50,7 @@ enum class SwiftNewTypeKind {
 /// Describes API notes data for any entity.
 ///
 /// This is used as the base of all API notes.
-class CommonEntityInfo {
+class CLANG_ABI CommonEntityInfo {
 public:
   /// Message to use when this entity is unavailable.
   std::string UnavailableMsg;
@@ -132,7 +133,7 @@ inline bool operator!=(const CommonEntityInfo &LHS,
 }
 
 /// Describes API notes for types.
-class CommonTypeInfo : public CommonEntityInfo {
+class CLANG_ABI CommonTypeInfo : public CommonEntityInfo {
   /// The Swift type to which a given type is bridged.
   ///
   /// Reflects the swift_bridge attribute.
@@ -194,7 +195,7 @@ inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
 
 /// Describes API notes data for an Objective-C class or protocol or a C++
 /// namespace.
-class ContextInfo : public CommonTypeInfo {
+class CLANG_ABI ContextInfo : public CommonTypeInfo {
   /// Whether this class has a default nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasDefaultNullability : 1;
@@ -301,7 +302,7 @@ inline bool operator!=(const ContextInfo &LHS, const ContextInfo &RHS) {
 }
 
 /// API notes for a variable/property.
-class VariableInfo : public CommonEntityInfo {
+class CLANG_ABI VariableInfo : public CommonEntityInfo {
   /// Whether this property has been audited for nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NullabilityAudited : 1;
@@ -358,7 +359,7 @@ inline bool operator!=(const VariableInfo &LHS, const VariableInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C property.
-class ObjCPropertyInfo : public VariableInfo {
+class CLANG_ABI ObjCPropertyInfo : public VariableInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned SwiftImportAsAccessorsSpecified : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -416,7 +417,7 @@ inline bool operator!=(const ObjCPropertyInfo &LHS,
 }
 
 /// Describes a function or method parameter.
-class ParamInfo : public VariableInfo {
+class CLANG_ABI ParamInfo : public VariableInfo {
   /// Whether noescape was specified.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NoEscapeSpecified : 1;
@@ -486,7 +487,7 @@ inline bool operator!=(const ParamInfo &LHS, const ParamInfo &RHS) {
 }
 
 /// API notes for a function or method.
-class FunctionInfo : public CommonEntityInfo {
+class CLANG_ABI FunctionInfo : public CommonEntityInfo {
 private:
   static constexpr const uint64_t NullabilityKindMask = 0x3;
   static constexpr const unsigned NullabilityKindSize = 2;
@@ -606,7 +607,7 @@ inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C method.
-class ObjCMethodInfo : public FunctionInfo {
+class CLANG_ABI ObjCMethodInfo : public FunctionInfo {
 public:
   /// Whether this is a designated initializer of its class.
   LLVM_PREFERRED_TYPE(bool)
@@ -675,7 +676,7 @@ class EnumConstantInfo : public CommonEntityInfo {
 };
 
 /// Describes API notes data for a tag.
-class TagInfo : public CommonTypeInfo {
+class CLANG_ABI TagInfo : public CommonTypeInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasFlagEnum : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -765,7 +766,7 @@ inline bool operator!=(const TagInfo &LHS, const TagInfo &RHS) {
 }
 
 /// Describes API notes data for a typedef.
-class TypedefInfo : public CommonTypeInfo {
+class CLANG_ABI TypedefInfo : public CommonTypeInfo {
 public:
   std::optional<SwiftNewTypeKind> SwiftWrapper;
 
diff --git a/clang/include/clang/ARCMigrate/ARCMT.h b/clang/include/clang/ARCMigrate/ARCMT.h
index 2b950e3d2cc2bf..dc078101e371ff 100644
--- a/clang/include/clang/ARCMigrate/ARCMT.h
+++ b/clang/include/clang/ARCMigrate/ARCMT.h
@@ -12,6 +12,7 @@
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Frontend/CompilerInvocation.h"
+#include "clang/Support/Compiler.h"
 
 namespace clang {
   class ASTContext;
@@ -37,7 +38,7 @@ namespace arcmt {
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
                      DiagnosticConsumer *DiagClient,
@@ -48,7 +49,7 @@ checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
 /// applies automatic modifications to source files to conform to ARC.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 applyTransformations(CompilerInvocation &origCI,
                      const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -65,7 +66,7 @@ applyTransformations(CompilerInvocation &origCI,
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool migrateWithTemporaryFiles(
+CLANG_ABI bool migrateWithTemporaryFiles(
     CompilerInvocation &origCI, const FrontendInputFile &Input,
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
     DiagnosticConsumer *DiagClient, StringRef outputDir,
@@ -75,7 +76,7 @@ bool migrateWithTemporaryFiles(
 /// migrateWithTemporaryFiles produced.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
+CLANG_ABI bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
                        StringRef outputDir,
                        DiagnosticConsumer *DiagClient);
 
@@ -83,17 +84,17 @@ bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
 /// info.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappingsFromFileList(
+CLANG_ABI bool getFileRemappingsFromFileList(
                         std::vector<std::pair<std::string,std::string> > &remap,
                         ArrayRef<StringRef> remapFiles,
                         DiagnosticConsumer *DiagClient);
 
 typedef void (*TransformFn)(MigrationPass &pass);
 
-std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
+CLANG_ABI std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
                                                bool NoFinalizeRemoval);
 
-class MigrationProcess {
+class CLANG_ABI MigrationProcess {
   CompilerInvocation OrigCI;
   std::shared_ptr<PCHContainerOperations> PCHContainerOps;
   DiagnosticConsumer *DiagClient;
@@ -107,7 +108,7 @@ class MigrationProcess {
                    DiagnosticConsumer *diagClient,
                    StringRef outputDir = StringRef());
 
-  class RewriteListener {
+  class CLANG_ABI RewriteListener {
   public:
     virtual ~RewriteListener();
 
diff --git a/clang/include/clang/ARCMigrate/ARCMTActions.h b/clang/include/clang/ARCMigrate/ARCMTActions.h
index 714f4b33db446b..50c6142078f5c8 100644
--- a/clang/include/clang/ARCMigrate/ARCMTActions.h
+++ b/clang/include/clang/ARCMigrate/ARCMTActions.h
@@ -11,12 +11,13 @@
 
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Frontend/FrontendAction.h"
+#include "clang/Support/Compiler.h"
 #include <memory>
 
 namespace clang {
 namespace arcmt {
 
-class CheckAction : public WrapperFrontendAction {
+class CLANG_ABI CheckAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -24,7 +25,7 @@ class CheckAction : public WrapperFrontendAction {
   CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class ModifyAction : public WrapperFrontendAction {
+class CLANG_ABI ModifyAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -32,7 +33,7 @@ class ModifyAction : public WrapperFrontendAction {
   ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class MigrateSourceAction : public ASTFrontendAction {
+class CLANG_ABI MigrateSourceAction : public ASTFrontendAction {
   FileRemapper Remapper;
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
@@ -40,7 +41,7 @@ class MigrateSourceAction : public ASTFrontendAction {
                                                  StringRef InFile) override;
 };
 
-class MigrateAction : public WrapperFrontendAction {
+class CLANG_ABI MigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   std::string PlistOut;
   bool EmitPremigrationARCErrors;
@@ -55,7 +56,7 @@ class MigrateAction : public WrapperFrontendAction {
 };
 
 /// Migrates to modern ObjC syntax.
-class ObjCMigrateAction : public WrapperFrontendAction {
+class CLANG_ABI ObjCMigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   unsigned    ObjCMigAction;
   FileRemapper Remapper;
diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h
index afcee363516a21..3c9f706a75cf38 100644
--- a/clang/include/clang/ARCMigrate/FileRemapper.h
+++ b/clang/include/clang/ARCMigrate/FileRemapper.h
@@ -11,6 +11,7 @@
 
 #include "clang/Basic/FileEntry.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -29,7 +30,7 @@ namespace clang {
 
 namespace arcmt {
 
-class FileRemapper {
+class CLANG_ABI FileRemapper {
   // FIXME: Reuse the same FileManager for multiple ASTContexts.
   std::unique_ptr<FileManager> FileMgr;
 
diff --git a/clang/include/clang/AST/APNumericStorage.h b/clang/include/clang/AST/APNumericStorage.h
index 95eddbcd86e839..ae634d46dfea2b 100644
--- a/clang/include/clang/AST/APNumericStorage.h
+++ b/clang/include/clang/AST/APNumericStorage.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_AST_APNUMERICSTORAGE_H
 #define LLVM_CLANG_AST_APNUMERICSTORAGE_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 
@@ -23,7 +24,7 @@ class ASTContext;
 /// to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
 /// the APFloat/APInt values will never get freed. APNumericStorage uses
 /// ASTContext's allocator for memory allocation.
-class APNumericStorage {
+class CLANG_ABI APNumericStorage {
   union {
     uint64_t VAL;   ///< Used to store the <= 64 bits integer value.
     uint64_t *pVal; ///< Used to store the >64 bits integer value.
diff --git a/clang/include/clang/AST/APValue.h b/clang/include/clang/AST/APValue.h
index c4206b73b11562..fc6baf92a90202 100644
--- a/clang/include/clang/AST/APValue.h
+++ b/clang/include/clang/AST/APValue.h
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_AST_APVALUE_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFixedPoint.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
@@ -41,7 +42,7 @@ template <typename T> class BasicReaderBase;
   class QualType;
 
 /// Symbolic representation of typeid(T) for some type T.
-class TypeInfoLValue {
+class CLANG_ABI TypeInfoLValue {
   const Type *T;
 
 public:
@@ -119,7 +120,7 @@ namespace clang {
 /// APValue - This class implements a discriminated union of [uninitialized]
 /// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
 /// [Vector: N * APValue], [Array: N * APValue]
-class APValue {
+class CLANG_ABI APValue {
   typedef llvm::APFixedPoint APFixedPoint;
   typedef llvm::APSInt APSInt;
   typedef llvm::APFloat APFloat;
@@ -143,7 +144,7 @@ class APValue {
     AddrLabelDiff
   };
 
-  class LValueBase {
+  class CLANG_ABI LValueBase {
     typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                                DynamicAllocLValue>
         PtrTy;
@@ -179,11 +180,11 @@ class APValue {
 
     QualType getType() const;
 
-    friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
+    friend CLANG_ABI bool operator==(const LValueBase &LHS, const LValueBase &RHS);
     friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
       return !(LHS == RHS);
     }
-    friend llvm::hash_code hash_value(const LValueBase &Base);
+    friend CLANG_ABI llvm::hash_code hash_value(const LValueBase &Base);
     friend struct llvm::DenseMapInfo<LValueBase>;
 
   private:
@@ -205,7 +206,7 @@ class APValue {
   typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
 
   /// A non-discriminated union of a base, field, or array index.
-  class LValuePathEntry {
+  class CLANG_ABI LValuePathEntry {
     static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
                   "pointer doesn't fit in 64 bits?");
     uint64_t Value;
@@ -237,7 +238,7 @@ class APValue {
       return llvm::hash_value(A.Value);
     }
   };
-  class LValuePathSerializationHelper {
+  class CLANG_ABI LValuePathSerializationHelper {
     const void *Ty;
 
   public:
@@ -274,7 +275,7 @@ class APValue {
     Vec &operator=(const Vec &) = delete;
     ~Vec() { delete[] Elts; }
   };
-  struct Arr {
+  struct CLANG_ABI Arr {
     APValue *Elts;
     unsigned NumElts, ArrSize;
     Arr(unsigned NumElts, unsigned ArrSize);
@@ -282,7 +283,7 @@ class APValue {
     Arr &operator=(const Arr &) = delete;
     ~Arr();
   };
-  struct StructData {
+  struct CLANG_ABI StructData {
     APValue *Elts;
     unsigned NumBases;
     unsigned NumFields;
@@ -291,7 +292,7 @@ class APValue {
     StructData &operator=(const StructData &) = delete;
     ~StructData();
   };
-  struct UnionData {
+  struct CLANG_ABI UnionData {
     const FieldDecl *Field;
     APValue *Value;
     UnionData();
@@ -702,7 +703,7 @@ class APValue {
 } // end namespace clang.
 
 namespace llvm {
-template<> struct DenseMapInfo<clang::APValue::LValueBase> {
+template<> struct CLANG_ABI DenseMapInfo<clang::APValue::LValueBase> {
   static clang::APValue::LValueBase getEmptyKey();
   static clang::APValue::LValueBase getTombstoneKey();
   static unsigned getHashValue(const clang::APValue::LValueBase &Base);
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index 00500e214f4ce6..59b0a8e9d96a9d 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -18,6 +18,7 @@
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
@@ -32,7 +33,7 @@ struct PrintingPolicy;
 
 /// The result of a constraint satisfaction check, containing the necessary
 /// information to diagnose an unsatisfied constraint.
-class ConstraintSatisfaction : public llvm::FoldingSetNode {
+class CLANG_ABI ConstraintSatisfaction : public llvm::FoldingSetNode {
   // The template-like entity that 'owns' the constraint checked here (can be a
   // constrained entity or a concept).
   const NamedDecl *ConstraintOwner = nullptr;
@@ -84,7 +85,7 @@ using UnsatisfiedConstraintRecord =
 /// necessary information to diagnose an unsatisfied constraint.
 ///
 /// This is safe to store in an AST node, as opposed to ConstraintSatisfaction.
-struct ASTConstraintSatisfaction final :
+struct CLANG_ABI ASTConstraintSatisfaction final :
     llvm::TrailingObjects<ASTConstraintSatisfaction,
                           UnsatisfiedConstraintRecord> {
   std::size_t NumRecords;
@@ -121,7 +122,7 @@ struct ASTConstraintSatisfaction final :
 ///
 ///   template <std::derives_from<Expr> T> void dump();
 ///             ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl)
-class ConceptReference {
+class CLANG_ABI ConceptReference {
   // \brief The optional nested name specifier used when naming the concept.
   NestedNameSpecifierLoc NestedNameSpec;
 
diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h
index 447f2592d23595..735c7e549f5cac 100644
--- a/clang/include/clang/AST/ASTConsumer.h
+++ b/clang/include/clang/AST/ASTConsumer.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CLANG_AST_ASTCONSUMER_H
 #define LLVM_CLANG_AST_ASTCONSUMER_H
 
+#include "clang/Support/Compiler.h"
 namespace clang {
   class ASTContext;
   class CXXMethodDecl;
@@ -31,7 +32,7 @@ namespace clang {
 /// ASTCons...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-backend-arm

Author: Thomas Fransham (fsfod)

Changes

The visibility macros generated here are created by a ids clang tooling based tool that @compnerd wrote and I've extended.
To reduce the numbers of exports and to avoid explicitly deleting more special members than necessary for MSVC only classes with out of line members or static variables have visibility macros added to them. I've included the config file that used to drive the tool for the Clang codebase to add some insight files are or aren't modified. I skipped running clang-format over most of changes just so the diffs are more readable and some files some weird indenting that clang-format to reformat the whole file.
These changes also depend on the macros to be added in #108276.


Patch is 1.09 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109702.diff

501 Files Affected:

  • (modified) clang/include/clang/APINotes/APINotesManager.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesReader.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesWriter.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesYAMLCompiler.h (+3-2)
  • (modified) clang/include/clang/APINotes/Types.h (+11-10)
  • (modified) clang/include/clang/ARCMigrate/ARCMT.h (+9-8)
  • (modified) clang/include/clang/ARCMigrate/ARCMTActions.h (+6-5)
  • (modified) clang/include/clang/ARCMigrate/FileRemapper.h (+2-1)
  • (modified) clang/include/clang/AST/APNumericStorage.h (+2-1)
  • (modified) clang/include/clang/AST/APValue.h (+12-11)
  • (modified) clang/include/clang/AST/ASTConcept.h (+4-3)
  • (modified) clang/include/clang/AST/ASTConsumer.h (+2-1)
  • (modified) clang/include/clang/AST/ASTContext.h (+5-4)
  • (modified) clang/include/clang/AST/ASTContextAllocate.h (+5-4)
  • (modified) clang/include/clang/AST/ASTDiagnostic.h (+3-2)
  • (modified) clang/include/clang/AST/ASTDumper.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImportError.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImporter.h (+3-2)
  • (modified) clang/include/clang/AST/ASTImporterLookupTable.h (+2-1)
  • (modified) clang/include/clang/AST/ASTMutationListener.h (+2-1)
  • (modified) clang/include/clang/AST/ASTStructuralEquivalence.h (+2-1)
  • (modified) clang/include/clang/AST/ASTTypeTraits.h (+3-2)
  • (modified) clang/include/clang/AST/ASTUnresolvedSet.h (+2-1)
  • (modified) clang/include/clang/AST/Attr.h (+2-1)
  • (modified) clang/include/clang/AST/Availability.h (+2-1)
  • (modified) clang/include/clang/AST/CXXInheritance.h (+3-2)
  • (modified) clang/include/clang/AST/Comment.h (+7-6)
  • (modified) clang/include/clang/AST/CommentBriefParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentCommandTraits.h (+2-1)
  • (modified) clang/include/clang/AST/CommentLexer.h (+3-2)
  • (modified) clang/include/clang/AST/CommentParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentSema.h (+2-1)
  • (modified) clang/include/clang/AST/ComparisonCategories.h (+5-4)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+86-85)
  • (modified) clang/include/clang/AST/DataCollection.h (+2-1)
  • (modified) clang/include/clang/AST/Decl.h (+35-34)
  • (modified) clang/include/clang/AST/DeclBase.h (+5-4)
  • (modified) clang/include/clang/AST/DeclCXX.h (+33-32)
  • (modified) clang/include/clang/AST/DeclContextInternals.h (+2-1)
  • (modified) clang/include/clang/AST/DeclFriend.h (+2-1)
  • (modified) clang/include/clang/AST/DeclGroup.h (+2-1)
  • (modified) clang/include/clang/AST/DeclID.h (+3-2)
  • (modified) clang/include/clang/AST/DeclObjC.h (+20-19)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+7-6)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+25-24)
  • (modified) clang/include/clang/AST/DeclarationName.h (+7-6)
  • (modified) clang/include/clang/AST/DependentDiagnostic.h (+2-1)
  • (modified) clang/include/clang/AST/Expr.h (+40-39)
  • (modified) clang/include/clang/AST/ExprCXX.h (+44-43)
  • (modified) clang/include/clang/AST/ExprConcepts.h (+7-6)
  • (modified) clang/include/clang/AST/ExprObjC.h (+6-5)
  • (modified) clang/include/clang/AST/ExprOpenMP.h (+3-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+2-1)
  • (modified) clang/include/clang/AST/ExternalASTSource.h (+2-1)
  • (modified) clang/include/clang/AST/FormatString.h (+13-12)
  • (modified) clang/include/clang/AST/JSONNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/LambdaCapture.h (+2-1)
  • (modified) clang/include/clang/AST/LocInfoType.h (+2-1)
  • (modified) clang/include/clang/AST/Mangle.h (+5-4)
  • (modified) clang/include/clang/AST/MangleNumberingContext.h (+2-1)
  • (modified) clang/include/clang/AST/NSAPI.h (+2-1)
  • (modified) clang/include/clang/AST/NestedNameSpecifier.h (+4-3)
  • (modified) clang/include/clang/AST/ODRDiagsEmitter.h (+2-1)
  • (modified) clang/include/clang/AST/ODRHash.h (+3-2)
  • (modified) clang/include/clang/AST/OSLog.h (+2-1)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+34-33)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+58-57)
  • (modified) clang/include/clang/AST/ParentMap.h (+2-1)
  • (modified) clang/include/clang/AST/ParentMapContext.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyDeclStackTrace.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyPrinter.h (+2-1)
  • (modified) clang/include/clang/AST/QualTypeNames.h (+3-2)
  • (modified) clang/include/clang/AST/Randstruct.h (+2-1)
  • (modified) clang/include/clang/AST/RawCommentList.h (+3-2)
  • (modified) clang/include/clang/AST/RecordLayout.h (+2-1)
  • (modified) clang/include/clang/AST/Redeclarable.h (+2-1)
  • (modified) clang/include/clang/AST/SelectorLocationsKind.h (+5-4)
  • (modified) clang/include/clang/AST/Stmt.h (+22-21)
  • (modified) clang/include/clang/AST/StmtCXX.h (+5-4)
  • (modified) clang/include/clang/AST/StmtIterator.h (+2-1)
  • (modified) clang/include/clang/AST/StmtObjC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+80-79)
  • (modified) clang/include/clang/AST/TemplateBase.h (+7-6)
  • (modified) clang/include/clang/AST/TemplateName.h (+6-5)
  • (modified) clang/include/clang/AST/TextNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/Type.h (+71-70)
  • (modified) clang/include/clang/AST/TypeLoc.h (+32-31)
  • (modified) clang/include/clang/AST/VTTBuilder.h (+2-1)
  • (modified) clang/include/clang/AST/VTableBuilder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchFinder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+231-230)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchersInternal.h (+14-13)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Parser.h (+4-3)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Registry.h (+3-2)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/VariantValue.h (+6-5)
  • (modified) clang/include/clang/ASTMatchers/GtestMatchers.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/CalledOnceCheck.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/Consumed.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/Dominators.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/IntervalPartition.h (+6-5)
  • (modified) clang/include/clang/Analysis/Analyses/LiveVariables.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/PostOrderCFGView.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/ReachableCode.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafety.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyLogical.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/UninitializedValues.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h (+5-4)
  • (modified) clang/include/clang/Analysis/AnalysisDeclContext.h (+8-7)
  • (modified) clang/include/clang/Analysis/BodyFarm.h (+2-1)
  • (modified) clang/include/clang/Analysis/CFG.h (+7-6)
  • (modified) clang/include/clang/Analysis/CFGStmtMap.h (+2-1)
  • (modified) clang/include/clang/Analysis/CallGraph.h (+3-2)
  • (modified) clang/include/clang/Analysis/CloneDetection.h (+11-10)
  • (modified) clang/include/clang/Analysis/CodeInjector.h (+2-1)
  • (modified) clang/include/clang/Analysis/ConstructionContext.h (+4-3)
  • (modified) clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h (+5-4)
  • (modified) clang/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/ASTOps.h (+8-7)
  • (modified) clang/include/clang/Analysis/FlowSensitive/AdornedCFG.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Arena.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/CNFFormula.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DebugSupport.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Formula.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Logger.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/RecordOps.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Solver.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Transfer.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Value.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h (+2-1)
  • (modified) clang/include/clang/Analysis/IssueHash.h (+3-2)
  • (modified) clang/include/clang/Analysis/MacroExpansionContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/PathDiagnostic.h (+14-13)
  • (modified) clang/include/clang/Analysis/ProgramPoint.h (+4-3)
  • (modified) clang/include/clang/Analysis/RetainSummaryManager.h (+5-4)
  • (modified) clang/include/clang/Basic/ASTSourceDescriptor.h (+2-1)
  • (modified) clang/include/clang/Basic/AttrSubjectMatchRules.h (+2-1)
  • (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/Attributes.h (+2-1)
  • (modified) clang/include/clang/Basic/Builtins.h (+4-3)
  • (modified) clang/include/clang/Basic/CLWarnings.h (+2-1)
  • (modified) clang/include/clang/Basic/CharInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/Cuda.h (+11-10)
  • (modified) clang/include/clang/Basic/DarwinSDKInfo.h (+4-3)
  • (modified) clang/include/clang/Basic/Diagnostic.h (+18-17)
  • (modified) clang/include/clang/Basic/DiagnosticError.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticIDs.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticOptions.h (+3-2)
  • (modified) clang/include/clang/Basic/ExpressionTraits.h (+3-2)
  • (modified) clang/include/clang/Basic/FileEntry.h (+2-1)
  • (modified) clang/include/clang/Basic/FileManager.h (+2-1)
  • (modified) clang/include/clang/Basic/FileSystemStatCache.h (+3-2)
  • (modified) clang/include/clang/Basic/IdentifierTable.h (+9-8)
  • (modified) clang/include/clang/Basic/LangOptions.h (+4-3)
  • (modified) clang/include/clang/Basic/LangStandard.h (+4-3)
  • (modified) clang/include/clang/Basic/MakeSupport.h (+2-1)
  • (modified) clang/include/clang/Basic/Module.h (+3-2)
  • (modified) clang/include/clang/Basic/NoSanitizeList.h (+2-1)
  • (modified) clang/include/clang/Basic/ObjCRuntime.h (+3-2)
  • (modified) clang/include/clang/Basic/OpenCLOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/OpenMPKinds.h (+27-26)
  • (modified) clang/include/clang/Basic/OperatorKinds.h (+2-1)
  • (modified) clang/include/clang/Basic/OperatorPrecedence.h (+2-1)
  • (modified) clang/include/clang/Basic/ParsedAttrInfo.h (+3-2)
  • (modified) clang/include/clang/Basic/PrettyStackTrace.h (+2-1)
  • (modified) clang/include/clang/Basic/ProfileList.h (+2-1)
  • (modified) clang/include/clang/Basic/SanitizerSpecialCaseList.h (+2-1)
  • (modified) clang/include/clang/Basic/Sanitizers.h (+10-9)
  • (modified) clang/include/clang/Basic/Sarif.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceLocation.h (+5-4)
  • (modified) clang/include/clang/Basic/SourceManager.h (+6-5)
  • (modified) clang/include/clang/Basic/SourceManagerInternals.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceMgrAdapter.h (+2-1)
  • (modified) clang/include/clang/Basic/Specifiers.h (+4-3)
  • (modified) clang/include/clang/Basic/Stack.h (+4-3)
  • (modified) clang/include/clang/Basic/SyncScope.h (+2-1)
  • (modified) clang/include/clang/Basic/TargetID.h (+7-6)
  • (modified) clang/include/clang/Basic/TargetInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/TokenKinds.h (+7-6)
  • (modified) clang/include/clang/Basic/TypeTraits.h (+8-7)
  • (modified) clang/include/clang/Basic/Version.h (+10-9)
  • (modified) clang/include/clang/Basic/XRayInstr.h (+3-2)
  • (modified) clang/include/clang/Basic/XRayLists.h (+2-1)
  • (modified) clang/include/clang/CodeGen/BackendUtil.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CGFunctionInfo.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CodeGenABITypes.h (+21-20)
  • (modified) clang/include/clang/CodeGen/CodeGenAction.h (+8-7)
  • (modified) clang/include/clang/CodeGen/ConstantInitBuilder.h (+5-4)
  • (modified) clang/include/clang/CodeGen/ConstantInitFuture.h (+2-1)
  • (modified) clang/include/clang/CodeGen/ModuleBuilder.h (+3-2)
  • (modified) clang/include/clang/CodeGen/ObjectFilePCHContainerWriter.h (+2-1)
  • (modified) clang/include/clang/CodeGen/SwiftCallingConv.h (+15-14)
  • (modified) clang/include/clang/CrossTU/CrossTranslationUnit.h (+9-8)
  • (modified) clang/include/clang/Driver/Action.h (+29-28)
  • (modified) clang/include/clang/Driver/Compilation.h (+2-1)
  • (modified) clang/include/clang/Driver/Distro.h (+2-1)
  • (modified) clang/include/clang/Driver/Driver.h (+8-7)
  • (modified) clang/include/clang/Driver/Job.h (+4-3)
  • (modified) clang/include/clang/Driver/Multilib.h (+5-4)
  • (modified) clang/include/clang/Driver/MultilibBuilder.h (+3-2)
  • (modified) clang/include/clang/Driver/OffloadBundler.h (+5-4)
  • (modified) clang/include/clang/Driver/OptionUtils.h (+3-2)
  • (modified) clang/include/clang/Driver/Options.h (+2-1)
  • (modified) clang/include/clang/Driver/Phases.h (+2-1)
  • (modified) clang/include/clang/Driver/SanitizerArgs.h (+2-1)
  • (modified) clang/include/clang/Driver/Tool.h (+2-1)
  • (modified) clang/include/clang/Driver/ToolChain.h (+2-1)
  • (modified) clang/include/clang/Driver/Types.h (+26-25)
  • (modified) clang/include/clang/Driver/XRayArgs.h (+2-1)
  • (modified) clang/include/clang/Edit/Commit.h (+3-2)
  • (modified) clang/include/clang/Edit/EditedSource.h (+2-1)
  • (modified) clang/include/clang/Edit/EditsReceiver.h (+2-1)
  • (modified) clang/include/clang/Edit/Rewriters.h (+4-3)
  • (modified) clang/include/clang/ExtractAPI/API.h (+36-35)
  • (modified) clang/include/clang/ExtractAPI/APIIgnoresList.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/DeclarationFragments.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/ExtractAPIActionBase.h (+2-1)
  • (modified) clang/include/clang/ExtractAPI/FrontendActions.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/TypedefUnderlyingTypeResolver.h (+2-1)
  • (modified) clang/include/clang/Format/Format.h (+36-35)
  • (modified) clang/include/clang/Frontend/ASTConsumers.h (+5-4)
  • (modified) clang/include/clang/Frontend/ASTUnit.h (+4-3)
  • (modified) clang/include/clang/Frontend/ChainedDiagnosticConsumer.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInstance.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInvocation.h (+10-9)
  • (modified) clang/include/clang/Frontend/DiagnosticRenderer.h (+3-2)
  • (modified) clang/include/clang/Frontend/FrontendAction.h (+6-5)
  • (modified) clang/include/clang/Frontend/FrontendActions.h (+27-26)
  • (modified) clang/include/clang/Frontend/FrontendOptions.h (+2-1)
  • (modified) clang/include/clang/Frontend/LayoutOverrideSource.h (+2-1)
  • (modified) clang/include/clang/Frontend/LogDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/MultiplexConsumer.h (+3-2)
  • (modified) clang/include/clang/Frontend/PrecompiledPreamble.h (+7-6)
  • (modified) clang/include/clang/Frontend/SARIFDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/SARIFDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticReader.h (+4-3)
  • (modified) clang/include/clang/Frontend/TextDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticBuffer.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/Utils.h (+10-9)
  • (modified) clang/include/clang/Frontend/VerifyDiagnosticConsumer.h (+3-2)
  • (modified) clang/include/clang/FrontendTool/Utils.h (+3-2)
  • (modified) clang/include/clang/Index/CommentToXML.h (+2-1)
  • (modified) clang/include/clang/Index/IndexSymbol.h (+13-12)
  • (modified) clang/include/clang/Index/IndexingAction.h (+8-7)
  • (modified) clang/include/clang/Index/USRGeneration.h (+17-16)
  • (modified) clang/include/clang/IndexSerialization/SerializablePathCollection.h (+4-3)
  • (modified) clang/include/clang/InstallAPI/Context.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/DirectoryScanner.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/DylibVerifier.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/FileList.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Frontend.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/FrontendRecords.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/HeaderFile.h (+6-5)
  • (modified) clang/include/clang/InstallAPI/Library.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Visitor.h (+2-1)
  • (modified) clang/include/clang/Interpreter/CodeCompletion.h (+2-1)
  • (modified) clang/include/clang/Interpreter/Interpreter.h (+3-2)
  • (modified) clang/include/clang/Lex/CodeCompletionHandler.h (+2-1)
  • (modified) clang/include/clang/Lex/DependencyDirectivesScanner.h (+3-2)
  • (modified) clang/include/clang/Lex/DirectoryLookup.h (+3-2)
  • (modified) clang/include/clang/Lex/ExternalPreprocessorSource.h (+2-1)
  • (modified) clang/include/clang/Lex/HeaderMap.h (+3-2)
  • (modified) clang/include/clang/Lex/HeaderSearch.h (+5-4)
  • (modified) clang/include/clang/Lex/Lexer.h (+2-1)
  • (modified) clang/include/clang/Lex/LiteralSupport.h (+7-6)
  • (modified) clang/include/clang/Lex/MacroArgs.h (+2-1)
  • (modified) clang/include/clang/Lex/MacroInfo.h (+5-4)
  • (modified) clang/include/clang/Lex/ModuleLoader.h (+2-1)
  • (modified) clang/include/clang/Lex/ModuleMap.h (+3-2)
  • (modified) clang/include/clang/Lex/PPCallbacks.h (+3-2)
  • (modified) clang/include/clang/Lex/PPConditionalDirectiveRecord.h (+2-1)
  • (modified) clang/include/clang/Lex/Pragma.h (+5-4)
  • (modified) clang/include/clang/Lex/PreprocessingRecord.h (+5-4)
  • (modified) clang/include/clang/Lex/Preprocessor.h (+4-3)
  • (modified) clang/include/clang/Lex/PreprocessorLexer.h (+2-1)
  • (modified) clang/include/clang/Lex/ScratchBuffer.h (+2-1)
  • (modified) clang/include/clang/Lex/Token.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenConcatenation.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenLexer.h (+2-1)
  • (modified) clang/include/clang/Parse/ParseAST.h (+3-2)
  • (modified) clang/include/clang/Parse/Parser.h (+13-12)
  • (modified) clang/include/clang/Parse/RAIIObjectsForParser.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/HTMLRewrite.h (+10-9)
  • (modified) clang/include/clang/Rewrite/Core/Rewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/TokenRewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Frontend/ASTConsumers.h (+4-3)
  • (modified) clang/include/clang/Rewrite/Frontend/FixItRewriter.h (+3-2)
  • (modified) clang/include/clang/Rewrite/Frontend/FrontendActions.h (+8-7)
  • (modified) clang/include/clang/Rewrite/Frontend/Rewriters.h (+4-3)
  • (modified) clang/include/clang/Sema/AnalysisBasedWarnings.h (+3-2)
  • (modified) clang/include/clang/Sema/CodeCompleteConsumer.h (+20-19)
  • (modified) clang/include/clang/Sema/DeclSpec.h (+7-6)
  • (modified) clang/include/clang/Sema/DelayedDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Sema/ExternalSemaSource.h (+2-1)
diff --git a/clang/include/clang/APINotes/APINotesManager.h b/clang/include/clang/APINotes/APINotesManager.h
index 98592438e90eab..05d7930d3a2e7f 100644
--- a/clang/include/clang/APINotes/APINotesManager.h
+++ b/clang/include/clang/APINotes/APINotesManager.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
@@ -41,7 +42,7 @@ class APINotesReader;
 /// external API notes files that correspond to a given header. Its primary
 /// operation is \c findAPINotes(), which finds the API notes reader that
 /// provides information about the declarations at that location.
-class APINotesManager {
+class CLANG_ABI APINotesManager {
   using ReaderEntry = llvm::PointerUnion<DirectoryEntryRef, APINotesReader *>;
 
   SourceManager &SM;
diff --git a/clang/include/clang/APINotes/APINotesReader.h b/clang/include/clang/APINotes/APINotesReader.h
index baf63340640242..58ee2857c7930f 100644
--- a/clang/include/clang/APINotes/APINotesReader.h
+++ b/clang/include/clang/APINotes/APINotesReader.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_READER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/VersionTuple.h"
 #include <memory>
@@ -25,7 +26,7 @@ namespace api_notes {
 
 /// A class that reads API notes data from a binary file that was written by
 /// the \c APINotesWriter.
-class APINotesReader {
+class CLANG_ABI APINotesReader {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesWriter.h b/clang/include/clang/APINotes/APINotesWriter.h
index 3cc16c3d959faf..b8b45a89dcfc8b 100644
--- a/clang/include/clang/APINotes/APINotesWriter.h
+++ b/clang/include/clang/APINotes/APINotesWriter.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_WRITER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/Support/raw_ostream.h"
@@ -29,7 +30,7 @@ namespace api_notes {
 
 /// A class that writes API notes data to a binary representation that can be
 /// read by the \c APINotesReader.
-class APINotesWriter {
+class CLANG_ABI APINotesWriter {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesYAMLCompiler.h b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
index 9c24ed85b6a124..3954cf347e8244 100644
--- a/clang/include/clang/APINotes/APINotesYAMLCompiler.h
+++ b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 #define LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
@@ -22,10 +23,10 @@ namespace api_notes {
 /// Parses the APINotes YAML content and writes the representation back to the
 /// specified stream.  This provides a means of testing the YAML processing of
 /// the APINotes format.
-bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
+CLANG_ABI bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
 
 /// Converts API notes from YAML format to binary format.
-bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
+CLANG_ABI bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
                      llvm::raw_ostream &OS,
                      llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr,
                      void *DiagHandlerCtxt = nullptr);
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 89889910d1a073..574406586c4674 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_TYPES_H
 
 #include "clang/Basic/Specifiers.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include <climits>
@@ -49,7 +50,7 @@ enum class SwiftNewTypeKind {
 /// Describes API notes data for any entity.
 ///
 /// This is used as the base of all API notes.
-class CommonEntityInfo {
+class CLANG_ABI CommonEntityInfo {
 public:
   /// Message to use when this entity is unavailable.
   std::string UnavailableMsg;
@@ -132,7 +133,7 @@ inline bool operator!=(const CommonEntityInfo &LHS,
 }
 
 /// Describes API notes for types.
-class CommonTypeInfo : public CommonEntityInfo {
+class CLANG_ABI CommonTypeInfo : public CommonEntityInfo {
   /// The Swift type to which a given type is bridged.
   ///
   /// Reflects the swift_bridge attribute.
@@ -194,7 +195,7 @@ inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
 
 /// Describes API notes data for an Objective-C class or protocol or a C++
 /// namespace.
-class ContextInfo : public CommonTypeInfo {
+class CLANG_ABI ContextInfo : public CommonTypeInfo {
   /// Whether this class has a default nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasDefaultNullability : 1;
@@ -301,7 +302,7 @@ inline bool operator!=(const ContextInfo &LHS, const ContextInfo &RHS) {
 }
 
 /// API notes for a variable/property.
-class VariableInfo : public CommonEntityInfo {
+class CLANG_ABI VariableInfo : public CommonEntityInfo {
   /// Whether this property has been audited for nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NullabilityAudited : 1;
@@ -358,7 +359,7 @@ inline bool operator!=(const VariableInfo &LHS, const VariableInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C property.
-class ObjCPropertyInfo : public VariableInfo {
+class CLANG_ABI ObjCPropertyInfo : public VariableInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned SwiftImportAsAccessorsSpecified : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -416,7 +417,7 @@ inline bool operator!=(const ObjCPropertyInfo &LHS,
 }
 
 /// Describes a function or method parameter.
-class ParamInfo : public VariableInfo {
+class CLANG_ABI ParamInfo : public VariableInfo {
   /// Whether noescape was specified.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NoEscapeSpecified : 1;
@@ -486,7 +487,7 @@ inline bool operator!=(const ParamInfo &LHS, const ParamInfo &RHS) {
 }
 
 /// API notes for a function or method.
-class FunctionInfo : public CommonEntityInfo {
+class CLANG_ABI FunctionInfo : public CommonEntityInfo {
 private:
   static constexpr const uint64_t NullabilityKindMask = 0x3;
   static constexpr const unsigned NullabilityKindSize = 2;
@@ -606,7 +607,7 @@ inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C method.
-class ObjCMethodInfo : public FunctionInfo {
+class CLANG_ABI ObjCMethodInfo : public FunctionInfo {
 public:
   /// Whether this is a designated initializer of its class.
   LLVM_PREFERRED_TYPE(bool)
@@ -675,7 +676,7 @@ class EnumConstantInfo : public CommonEntityInfo {
 };
 
 /// Describes API notes data for a tag.
-class TagInfo : public CommonTypeInfo {
+class CLANG_ABI TagInfo : public CommonTypeInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasFlagEnum : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -765,7 +766,7 @@ inline bool operator!=(const TagInfo &LHS, const TagInfo &RHS) {
 }
 
 /// Describes API notes data for a typedef.
-class TypedefInfo : public CommonTypeInfo {
+class CLANG_ABI TypedefInfo : public CommonTypeInfo {
 public:
   std::optional<SwiftNewTypeKind> SwiftWrapper;
 
diff --git a/clang/include/clang/ARCMigrate/ARCMT.h b/clang/include/clang/ARCMigrate/ARCMT.h
index 2b950e3d2cc2bf..dc078101e371ff 100644
--- a/clang/include/clang/ARCMigrate/ARCMT.h
+++ b/clang/include/clang/ARCMigrate/ARCMT.h
@@ -12,6 +12,7 @@
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Frontend/CompilerInvocation.h"
+#include "clang/Support/Compiler.h"
 
 namespace clang {
   class ASTContext;
@@ -37,7 +38,7 @@ namespace arcmt {
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
                      DiagnosticConsumer *DiagClient,
@@ -48,7 +49,7 @@ checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
 /// applies automatic modifications to source files to conform to ARC.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 applyTransformations(CompilerInvocation &origCI,
                      const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -65,7 +66,7 @@ applyTransformations(CompilerInvocation &origCI,
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool migrateWithTemporaryFiles(
+CLANG_ABI bool migrateWithTemporaryFiles(
     CompilerInvocation &origCI, const FrontendInputFile &Input,
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
     DiagnosticConsumer *DiagClient, StringRef outputDir,
@@ -75,7 +76,7 @@ bool migrateWithTemporaryFiles(
 /// migrateWithTemporaryFiles produced.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
+CLANG_ABI bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
                        StringRef outputDir,
                        DiagnosticConsumer *DiagClient);
 
@@ -83,17 +84,17 @@ bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
 /// info.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappingsFromFileList(
+CLANG_ABI bool getFileRemappingsFromFileList(
                         std::vector<std::pair<std::string,std::string> > &remap,
                         ArrayRef<StringRef> remapFiles,
                         DiagnosticConsumer *DiagClient);
 
 typedef void (*TransformFn)(MigrationPass &pass);
 
-std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
+CLANG_ABI std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
                                                bool NoFinalizeRemoval);
 
-class MigrationProcess {
+class CLANG_ABI MigrationProcess {
   CompilerInvocation OrigCI;
   std::shared_ptr<PCHContainerOperations> PCHContainerOps;
   DiagnosticConsumer *DiagClient;
@@ -107,7 +108,7 @@ class MigrationProcess {
                    DiagnosticConsumer *diagClient,
                    StringRef outputDir = StringRef());
 
-  class RewriteListener {
+  class CLANG_ABI RewriteListener {
   public:
     virtual ~RewriteListener();
 
diff --git a/clang/include/clang/ARCMigrate/ARCMTActions.h b/clang/include/clang/ARCMigrate/ARCMTActions.h
index 714f4b33db446b..50c6142078f5c8 100644
--- a/clang/include/clang/ARCMigrate/ARCMTActions.h
+++ b/clang/include/clang/ARCMigrate/ARCMTActions.h
@@ -11,12 +11,13 @@
 
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Frontend/FrontendAction.h"
+#include "clang/Support/Compiler.h"
 #include <memory>
 
 namespace clang {
 namespace arcmt {
 
-class CheckAction : public WrapperFrontendAction {
+class CLANG_ABI CheckAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -24,7 +25,7 @@ class CheckAction : public WrapperFrontendAction {
   CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class ModifyAction : public WrapperFrontendAction {
+class CLANG_ABI ModifyAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -32,7 +33,7 @@ class ModifyAction : public WrapperFrontendAction {
   ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class MigrateSourceAction : public ASTFrontendAction {
+class CLANG_ABI MigrateSourceAction : public ASTFrontendAction {
   FileRemapper Remapper;
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
@@ -40,7 +41,7 @@ class MigrateSourceAction : public ASTFrontendAction {
                                                  StringRef InFile) override;
 };
 
-class MigrateAction : public WrapperFrontendAction {
+class CLANG_ABI MigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   std::string PlistOut;
   bool EmitPremigrationARCErrors;
@@ -55,7 +56,7 @@ class MigrateAction : public WrapperFrontendAction {
 };
 
 /// Migrates to modern ObjC syntax.
-class ObjCMigrateAction : public WrapperFrontendAction {
+class CLANG_ABI ObjCMigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   unsigned    ObjCMigAction;
   FileRemapper Remapper;
diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h
index afcee363516a21..3c9f706a75cf38 100644
--- a/clang/include/clang/ARCMigrate/FileRemapper.h
+++ b/clang/include/clang/ARCMigrate/FileRemapper.h
@@ -11,6 +11,7 @@
 
 #include "clang/Basic/FileEntry.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -29,7 +30,7 @@ namespace clang {
 
 namespace arcmt {
 
-class FileRemapper {
+class CLANG_ABI FileRemapper {
   // FIXME: Reuse the same FileManager for multiple ASTContexts.
   std::unique_ptr<FileManager> FileMgr;
 
diff --git a/clang/include/clang/AST/APNumericStorage.h b/clang/include/clang/AST/APNumericStorage.h
index 95eddbcd86e839..ae634d46dfea2b 100644
--- a/clang/include/clang/AST/APNumericStorage.h
+++ b/clang/include/clang/AST/APNumericStorage.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_AST_APNUMERICSTORAGE_H
 #define LLVM_CLANG_AST_APNUMERICSTORAGE_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 
@@ -23,7 +24,7 @@ class ASTContext;
 /// to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
 /// the APFloat/APInt values will never get freed. APNumericStorage uses
 /// ASTContext's allocator for memory allocation.
-class APNumericStorage {
+class CLANG_ABI APNumericStorage {
   union {
     uint64_t VAL;   ///< Used to store the <= 64 bits integer value.
     uint64_t *pVal; ///< Used to store the >64 bits integer value.
diff --git a/clang/include/clang/AST/APValue.h b/clang/include/clang/AST/APValue.h
index c4206b73b11562..fc6baf92a90202 100644
--- a/clang/include/clang/AST/APValue.h
+++ b/clang/include/clang/AST/APValue.h
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_AST_APVALUE_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFixedPoint.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
@@ -41,7 +42,7 @@ template <typename T> class BasicReaderBase;
   class QualType;
 
 /// Symbolic representation of typeid(T) for some type T.
-class TypeInfoLValue {
+class CLANG_ABI TypeInfoLValue {
   const Type *T;
 
 public:
@@ -119,7 +120,7 @@ namespace clang {
 /// APValue - This class implements a discriminated union of [uninitialized]
 /// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
 /// [Vector: N * APValue], [Array: N * APValue]
-class APValue {
+class CLANG_ABI APValue {
   typedef llvm::APFixedPoint APFixedPoint;
   typedef llvm::APSInt APSInt;
   typedef llvm::APFloat APFloat;
@@ -143,7 +144,7 @@ class APValue {
     AddrLabelDiff
   };
 
-  class LValueBase {
+  class CLANG_ABI LValueBase {
     typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                                DynamicAllocLValue>
         PtrTy;
@@ -179,11 +180,11 @@ class APValue {
 
     QualType getType() const;
 
-    friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
+    friend CLANG_ABI bool operator==(const LValueBase &LHS, const LValueBase &RHS);
     friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
       return !(LHS == RHS);
     }
-    friend llvm::hash_code hash_value(const LValueBase &Base);
+    friend CLANG_ABI llvm::hash_code hash_value(const LValueBase &Base);
     friend struct llvm::DenseMapInfo<LValueBase>;
 
   private:
@@ -205,7 +206,7 @@ class APValue {
   typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
 
   /// A non-discriminated union of a base, field, or array index.
-  class LValuePathEntry {
+  class CLANG_ABI LValuePathEntry {
     static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
                   "pointer doesn't fit in 64 bits?");
     uint64_t Value;
@@ -237,7 +238,7 @@ class APValue {
       return llvm::hash_value(A.Value);
     }
   };
-  class LValuePathSerializationHelper {
+  class CLANG_ABI LValuePathSerializationHelper {
     const void *Ty;
 
   public:
@@ -274,7 +275,7 @@ class APValue {
     Vec &operator=(const Vec &) = delete;
     ~Vec() { delete[] Elts; }
   };
-  struct Arr {
+  struct CLANG_ABI Arr {
     APValue *Elts;
     unsigned NumElts, ArrSize;
     Arr(unsigned NumElts, unsigned ArrSize);
@@ -282,7 +283,7 @@ class APValue {
     Arr &operator=(const Arr &) = delete;
     ~Arr();
   };
-  struct StructData {
+  struct CLANG_ABI StructData {
     APValue *Elts;
     unsigned NumBases;
     unsigned NumFields;
@@ -291,7 +292,7 @@ class APValue {
     StructData &operator=(const StructData &) = delete;
     ~StructData();
   };
-  struct UnionData {
+  struct CLANG_ABI UnionData {
     const FieldDecl *Field;
     APValue *Value;
     UnionData();
@@ -702,7 +703,7 @@ class APValue {
 } // end namespace clang.
 
 namespace llvm {
-template<> struct DenseMapInfo<clang::APValue::LValueBase> {
+template<> struct CLANG_ABI DenseMapInfo<clang::APValue::LValueBase> {
   static clang::APValue::LValueBase getEmptyKey();
   static clang::APValue::LValueBase getTombstoneKey();
   static unsigned getHashValue(const clang::APValue::LValueBase &Base);
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index 00500e214f4ce6..59b0a8e9d96a9d 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -18,6 +18,7 @@
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
@@ -32,7 +33,7 @@ struct PrintingPolicy;
 
 /// The result of a constraint satisfaction check, containing the necessary
 /// information to diagnose an unsatisfied constraint.
-class ConstraintSatisfaction : public llvm::FoldingSetNode {
+class CLANG_ABI ConstraintSatisfaction : public llvm::FoldingSetNode {
   // The template-like entity that 'owns' the constraint checked here (can be a
   // constrained entity or a concept).
   const NamedDecl *ConstraintOwner = nullptr;
@@ -84,7 +85,7 @@ using UnsatisfiedConstraintRecord =
 /// necessary information to diagnose an unsatisfied constraint.
 ///
 /// This is safe to store in an AST node, as opposed to ConstraintSatisfaction.
-struct ASTConstraintSatisfaction final :
+struct CLANG_ABI ASTConstraintSatisfaction final :
     llvm::TrailingObjects<ASTConstraintSatisfaction,
                           UnsatisfiedConstraintRecord> {
   std::size_t NumRecords;
@@ -121,7 +122,7 @@ struct ASTConstraintSatisfaction final :
 ///
 ///   template <std::derives_from<Expr> T> void dump();
 ///             ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl)
-class ConceptReference {
+class CLANG_ABI ConceptReference {
   // \brief The optional nested name specifier used when naming the concept.
   NestedNameSpecifierLoc NestedNameSpec;
 
diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h
index 447f2592d23595..735c7e549f5cac 100644
--- a/clang/include/clang/AST/ASTConsumer.h
+++ b/clang/include/clang/AST/ASTConsumer.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CLANG_AST_ASTCONSUMER_H
 #define LLVM_CLANG_AST_ASTCONSUMER_H
 
+#include "clang/Support/Compiler.h"
 namespace clang {
   class ASTContext;
   class CXXMethodDecl;
@@ -31,7 +32,7 @@ namespace clang {
 /// ASTCons...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-backend-risc-v

Author: Thomas Fransham (fsfod)

Changes

The visibility macros generated here are created by a ids clang tooling based tool that @compnerd wrote and I've extended.
To reduce the numbers of exports and to avoid explicitly deleting more special members than necessary for MSVC only classes with out of line members or static variables have visibility macros added to them. I've included the config file that used to drive the tool for the Clang codebase to add some insight files are or aren't modified. I skipped running clang-format over most of changes just so the diffs are more readable and some files some weird indenting that clang-format to reformat the whole file.
These changes also depend on the macros to be added in #108276.


Patch is 1.09 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109702.diff

501 Files Affected:

  • (modified) clang/include/clang/APINotes/APINotesManager.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesReader.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesWriter.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesYAMLCompiler.h (+3-2)
  • (modified) clang/include/clang/APINotes/Types.h (+11-10)
  • (modified) clang/include/clang/ARCMigrate/ARCMT.h (+9-8)
  • (modified) clang/include/clang/ARCMigrate/ARCMTActions.h (+6-5)
  • (modified) clang/include/clang/ARCMigrate/FileRemapper.h (+2-1)
  • (modified) clang/include/clang/AST/APNumericStorage.h (+2-1)
  • (modified) clang/include/clang/AST/APValue.h (+12-11)
  • (modified) clang/include/clang/AST/ASTConcept.h (+4-3)
  • (modified) clang/include/clang/AST/ASTConsumer.h (+2-1)
  • (modified) clang/include/clang/AST/ASTContext.h (+5-4)
  • (modified) clang/include/clang/AST/ASTContextAllocate.h (+5-4)
  • (modified) clang/include/clang/AST/ASTDiagnostic.h (+3-2)
  • (modified) clang/include/clang/AST/ASTDumper.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImportError.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImporter.h (+3-2)
  • (modified) clang/include/clang/AST/ASTImporterLookupTable.h (+2-1)
  • (modified) clang/include/clang/AST/ASTMutationListener.h (+2-1)
  • (modified) clang/include/clang/AST/ASTStructuralEquivalence.h (+2-1)
  • (modified) clang/include/clang/AST/ASTTypeTraits.h (+3-2)
  • (modified) clang/include/clang/AST/ASTUnresolvedSet.h (+2-1)
  • (modified) clang/include/clang/AST/Attr.h (+2-1)
  • (modified) clang/include/clang/AST/Availability.h (+2-1)
  • (modified) clang/include/clang/AST/CXXInheritance.h (+3-2)
  • (modified) clang/include/clang/AST/Comment.h (+7-6)
  • (modified) clang/include/clang/AST/CommentBriefParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentCommandTraits.h (+2-1)
  • (modified) clang/include/clang/AST/CommentLexer.h (+3-2)
  • (modified) clang/include/clang/AST/CommentParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentSema.h (+2-1)
  • (modified) clang/include/clang/AST/ComparisonCategories.h (+5-4)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+86-85)
  • (modified) clang/include/clang/AST/DataCollection.h (+2-1)
  • (modified) clang/include/clang/AST/Decl.h (+35-34)
  • (modified) clang/include/clang/AST/DeclBase.h (+5-4)
  • (modified) clang/include/clang/AST/DeclCXX.h (+33-32)
  • (modified) clang/include/clang/AST/DeclContextInternals.h (+2-1)
  • (modified) clang/include/clang/AST/DeclFriend.h (+2-1)
  • (modified) clang/include/clang/AST/DeclGroup.h (+2-1)
  • (modified) clang/include/clang/AST/DeclID.h (+3-2)
  • (modified) clang/include/clang/AST/DeclObjC.h (+20-19)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+7-6)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+25-24)
  • (modified) clang/include/clang/AST/DeclarationName.h (+7-6)
  • (modified) clang/include/clang/AST/DependentDiagnostic.h (+2-1)
  • (modified) clang/include/clang/AST/Expr.h (+40-39)
  • (modified) clang/include/clang/AST/ExprCXX.h (+44-43)
  • (modified) clang/include/clang/AST/ExprConcepts.h (+7-6)
  • (modified) clang/include/clang/AST/ExprObjC.h (+6-5)
  • (modified) clang/include/clang/AST/ExprOpenMP.h (+3-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+2-1)
  • (modified) clang/include/clang/AST/ExternalASTSource.h (+2-1)
  • (modified) clang/include/clang/AST/FormatString.h (+13-12)
  • (modified) clang/include/clang/AST/JSONNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/LambdaCapture.h (+2-1)
  • (modified) clang/include/clang/AST/LocInfoType.h (+2-1)
  • (modified) clang/include/clang/AST/Mangle.h (+5-4)
  • (modified) clang/include/clang/AST/MangleNumberingContext.h (+2-1)
  • (modified) clang/include/clang/AST/NSAPI.h (+2-1)
  • (modified) clang/include/clang/AST/NestedNameSpecifier.h (+4-3)
  • (modified) clang/include/clang/AST/ODRDiagsEmitter.h (+2-1)
  • (modified) clang/include/clang/AST/ODRHash.h (+3-2)
  • (modified) clang/include/clang/AST/OSLog.h (+2-1)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+34-33)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+58-57)
  • (modified) clang/include/clang/AST/ParentMap.h (+2-1)
  • (modified) clang/include/clang/AST/ParentMapContext.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyDeclStackTrace.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyPrinter.h (+2-1)
  • (modified) clang/include/clang/AST/QualTypeNames.h (+3-2)
  • (modified) clang/include/clang/AST/Randstruct.h (+2-1)
  • (modified) clang/include/clang/AST/RawCommentList.h (+3-2)
  • (modified) clang/include/clang/AST/RecordLayout.h (+2-1)
  • (modified) clang/include/clang/AST/Redeclarable.h (+2-1)
  • (modified) clang/include/clang/AST/SelectorLocationsKind.h (+5-4)
  • (modified) clang/include/clang/AST/Stmt.h (+22-21)
  • (modified) clang/include/clang/AST/StmtCXX.h (+5-4)
  • (modified) clang/include/clang/AST/StmtIterator.h (+2-1)
  • (modified) clang/include/clang/AST/StmtObjC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+80-79)
  • (modified) clang/include/clang/AST/TemplateBase.h (+7-6)
  • (modified) clang/include/clang/AST/TemplateName.h (+6-5)
  • (modified) clang/include/clang/AST/TextNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/Type.h (+71-70)
  • (modified) clang/include/clang/AST/TypeLoc.h (+32-31)
  • (modified) clang/include/clang/AST/VTTBuilder.h (+2-1)
  • (modified) clang/include/clang/AST/VTableBuilder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchFinder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+231-230)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchersInternal.h (+14-13)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Parser.h (+4-3)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Registry.h (+3-2)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/VariantValue.h (+6-5)
  • (modified) clang/include/clang/ASTMatchers/GtestMatchers.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/CalledOnceCheck.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/Consumed.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/Dominators.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/IntervalPartition.h (+6-5)
  • (modified) clang/include/clang/Analysis/Analyses/LiveVariables.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/PostOrderCFGView.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/ReachableCode.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafety.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyLogical.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/UninitializedValues.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h (+5-4)
  • (modified) clang/include/clang/Analysis/AnalysisDeclContext.h (+8-7)
  • (modified) clang/include/clang/Analysis/BodyFarm.h (+2-1)
  • (modified) clang/include/clang/Analysis/CFG.h (+7-6)
  • (modified) clang/include/clang/Analysis/CFGStmtMap.h (+2-1)
  • (modified) clang/include/clang/Analysis/CallGraph.h (+3-2)
  • (modified) clang/include/clang/Analysis/CloneDetection.h (+11-10)
  • (modified) clang/include/clang/Analysis/CodeInjector.h (+2-1)
  • (modified) clang/include/clang/Analysis/ConstructionContext.h (+4-3)
  • (modified) clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h (+5-4)
  • (modified) clang/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/ASTOps.h (+8-7)
  • (modified) clang/include/clang/Analysis/FlowSensitive/AdornedCFG.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Arena.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/CNFFormula.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DebugSupport.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Formula.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Logger.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/RecordOps.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Solver.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Transfer.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Value.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h (+2-1)
  • (modified) clang/include/clang/Analysis/IssueHash.h (+3-2)
  • (modified) clang/include/clang/Analysis/MacroExpansionContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/PathDiagnostic.h (+14-13)
  • (modified) clang/include/clang/Analysis/ProgramPoint.h (+4-3)
  • (modified) clang/include/clang/Analysis/RetainSummaryManager.h (+5-4)
  • (modified) clang/include/clang/Basic/ASTSourceDescriptor.h (+2-1)
  • (modified) clang/include/clang/Basic/AttrSubjectMatchRules.h (+2-1)
  • (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/Attributes.h (+2-1)
  • (modified) clang/include/clang/Basic/Builtins.h (+4-3)
  • (modified) clang/include/clang/Basic/CLWarnings.h (+2-1)
  • (modified) clang/include/clang/Basic/CharInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/Cuda.h (+11-10)
  • (modified) clang/include/clang/Basic/DarwinSDKInfo.h (+4-3)
  • (modified) clang/include/clang/Basic/Diagnostic.h (+18-17)
  • (modified) clang/include/clang/Basic/DiagnosticError.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticIDs.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticOptions.h (+3-2)
  • (modified) clang/include/clang/Basic/ExpressionTraits.h (+3-2)
  • (modified) clang/include/clang/Basic/FileEntry.h (+2-1)
  • (modified) clang/include/clang/Basic/FileManager.h (+2-1)
  • (modified) clang/include/clang/Basic/FileSystemStatCache.h (+3-2)
  • (modified) clang/include/clang/Basic/IdentifierTable.h (+9-8)
  • (modified) clang/include/clang/Basic/LangOptions.h (+4-3)
  • (modified) clang/include/clang/Basic/LangStandard.h (+4-3)
  • (modified) clang/include/clang/Basic/MakeSupport.h (+2-1)
  • (modified) clang/include/clang/Basic/Module.h (+3-2)
  • (modified) clang/include/clang/Basic/NoSanitizeList.h (+2-1)
  • (modified) clang/include/clang/Basic/ObjCRuntime.h (+3-2)
  • (modified) clang/include/clang/Basic/OpenCLOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/OpenMPKinds.h (+27-26)
  • (modified) clang/include/clang/Basic/OperatorKinds.h (+2-1)
  • (modified) clang/include/clang/Basic/OperatorPrecedence.h (+2-1)
  • (modified) clang/include/clang/Basic/ParsedAttrInfo.h (+3-2)
  • (modified) clang/include/clang/Basic/PrettyStackTrace.h (+2-1)
  • (modified) clang/include/clang/Basic/ProfileList.h (+2-1)
  • (modified) clang/include/clang/Basic/SanitizerSpecialCaseList.h (+2-1)
  • (modified) clang/include/clang/Basic/Sanitizers.h (+10-9)
  • (modified) clang/include/clang/Basic/Sarif.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceLocation.h (+5-4)
  • (modified) clang/include/clang/Basic/SourceManager.h (+6-5)
  • (modified) clang/include/clang/Basic/SourceManagerInternals.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceMgrAdapter.h (+2-1)
  • (modified) clang/include/clang/Basic/Specifiers.h (+4-3)
  • (modified) clang/include/clang/Basic/Stack.h (+4-3)
  • (modified) clang/include/clang/Basic/SyncScope.h (+2-1)
  • (modified) clang/include/clang/Basic/TargetID.h (+7-6)
  • (modified) clang/include/clang/Basic/TargetInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/TokenKinds.h (+7-6)
  • (modified) clang/include/clang/Basic/TypeTraits.h (+8-7)
  • (modified) clang/include/clang/Basic/Version.h (+10-9)
  • (modified) clang/include/clang/Basic/XRayInstr.h (+3-2)
  • (modified) clang/include/clang/Basic/XRayLists.h (+2-1)
  • (modified) clang/include/clang/CodeGen/BackendUtil.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CGFunctionInfo.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CodeGenABITypes.h (+21-20)
  • (modified) clang/include/clang/CodeGen/CodeGenAction.h (+8-7)
  • (modified) clang/include/clang/CodeGen/ConstantInitBuilder.h (+5-4)
  • (modified) clang/include/clang/CodeGen/ConstantInitFuture.h (+2-1)
  • (modified) clang/include/clang/CodeGen/ModuleBuilder.h (+3-2)
  • (modified) clang/include/clang/CodeGen/ObjectFilePCHContainerWriter.h (+2-1)
  • (modified) clang/include/clang/CodeGen/SwiftCallingConv.h (+15-14)
  • (modified) clang/include/clang/CrossTU/CrossTranslationUnit.h (+9-8)
  • (modified) clang/include/clang/Driver/Action.h (+29-28)
  • (modified) clang/include/clang/Driver/Compilation.h (+2-1)
  • (modified) clang/include/clang/Driver/Distro.h (+2-1)
  • (modified) clang/include/clang/Driver/Driver.h (+8-7)
  • (modified) clang/include/clang/Driver/Job.h (+4-3)
  • (modified) clang/include/clang/Driver/Multilib.h (+5-4)
  • (modified) clang/include/clang/Driver/MultilibBuilder.h (+3-2)
  • (modified) clang/include/clang/Driver/OffloadBundler.h (+5-4)
  • (modified) clang/include/clang/Driver/OptionUtils.h (+3-2)
  • (modified) clang/include/clang/Driver/Options.h (+2-1)
  • (modified) clang/include/clang/Driver/Phases.h (+2-1)
  • (modified) clang/include/clang/Driver/SanitizerArgs.h (+2-1)
  • (modified) clang/include/clang/Driver/Tool.h (+2-1)
  • (modified) clang/include/clang/Driver/ToolChain.h (+2-1)
  • (modified) clang/include/clang/Driver/Types.h (+26-25)
  • (modified) clang/include/clang/Driver/XRayArgs.h (+2-1)
  • (modified) clang/include/clang/Edit/Commit.h (+3-2)
  • (modified) clang/include/clang/Edit/EditedSource.h (+2-1)
  • (modified) clang/include/clang/Edit/EditsReceiver.h (+2-1)
  • (modified) clang/include/clang/Edit/Rewriters.h (+4-3)
  • (modified) clang/include/clang/ExtractAPI/API.h (+36-35)
  • (modified) clang/include/clang/ExtractAPI/APIIgnoresList.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/DeclarationFragments.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/ExtractAPIActionBase.h (+2-1)
  • (modified) clang/include/clang/ExtractAPI/FrontendActions.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/TypedefUnderlyingTypeResolver.h (+2-1)
  • (modified) clang/include/clang/Format/Format.h (+36-35)
  • (modified) clang/include/clang/Frontend/ASTConsumers.h (+5-4)
  • (modified) clang/include/clang/Frontend/ASTUnit.h (+4-3)
  • (modified) clang/include/clang/Frontend/ChainedDiagnosticConsumer.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInstance.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInvocation.h (+10-9)
  • (modified) clang/include/clang/Frontend/DiagnosticRenderer.h (+3-2)
  • (modified) clang/include/clang/Frontend/FrontendAction.h (+6-5)
  • (modified) clang/include/clang/Frontend/FrontendActions.h (+27-26)
  • (modified) clang/include/clang/Frontend/FrontendOptions.h (+2-1)
  • (modified) clang/include/clang/Frontend/LayoutOverrideSource.h (+2-1)
  • (modified) clang/include/clang/Frontend/LogDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/MultiplexConsumer.h (+3-2)
  • (modified) clang/include/clang/Frontend/PrecompiledPreamble.h (+7-6)
  • (modified) clang/include/clang/Frontend/SARIFDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/SARIFDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticReader.h (+4-3)
  • (modified) clang/include/clang/Frontend/TextDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticBuffer.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/Utils.h (+10-9)
  • (modified) clang/include/clang/Frontend/VerifyDiagnosticConsumer.h (+3-2)
  • (modified) clang/include/clang/FrontendTool/Utils.h (+3-2)
  • (modified) clang/include/clang/Index/CommentToXML.h (+2-1)
  • (modified) clang/include/clang/Index/IndexSymbol.h (+13-12)
  • (modified) clang/include/clang/Index/IndexingAction.h (+8-7)
  • (modified) clang/include/clang/Index/USRGeneration.h (+17-16)
  • (modified) clang/include/clang/IndexSerialization/SerializablePathCollection.h (+4-3)
  • (modified) clang/include/clang/InstallAPI/Context.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/DirectoryScanner.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/DylibVerifier.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/FileList.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Frontend.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/FrontendRecords.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/HeaderFile.h (+6-5)
  • (modified) clang/include/clang/InstallAPI/Library.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Visitor.h (+2-1)
  • (modified) clang/include/clang/Interpreter/CodeCompletion.h (+2-1)
  • (modified) clang/include/clang/Interpreter/Interpreter.h (+3-2)
  • (modified) clang/include/clang/Lex/CodeCompletionHandler.h (+2-1)
  • (modified) clang/include/clang/Lex/DependencyDirectivesScanner.h (+3-2)
  • (modified) clang/include/clang/Lex/DirectoryLookup.h (+3-2)
  • (modified) clang/include/clang/Lex/ExternalPreprocessorSource.h (+2-1)
  • (modified) clang/include/clang/Lex/HeaderMap.h (+3-2)
  • (modified) clang/include/clang/Lex/HeaderSearch.h (+5-4)
  • (modified) clang/include/clang/Lex/Lexer.h (+2-1)
  • (modified) clang/include/clang/Lex/LiteralSupport.h (+7-6)
  • (modified) clang/include/clang/Lex/MacroArgs.h (+2-1)
  • (modified) clang/include/clang/Lex/MacroInfo.h (+5-4)
  • (modified) clang/include/clang/Lex/ModuleLoader.h (+2-1)
  • (modified) clang/include/clang/Lex/ModuleMap.h (+3-2)
  • (modified) clang/include/clang/Lex/PPCallbacks.h (+3-2)
  • (modified) clang/include/clang/Lex/PPConditionalDirectiveRecord.h (+2-1)
  • (modified) clang/include/clang/Lex/Pragma.h (+5-4)
  • (modified) clang/include/clang/Lex/PreprocessingRecord.h (+5-4)
  • (modified) clang/include/clang/Lex/Preprocessor.h (+4-3)
  • (modified) clang/include/clang/Lex/PreprocessorLexer.h (+2-1)
  • (modified) clang/include/clang/Lex/ScratchBuffer.h (+2-1)
  • (modified) clang/include/clang/Lex/Token.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenConcatenation.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenLexer.h (+2-1)
  • (modified) clang/include/clang/Parse/ParseAST.h (+3-2)
  • (modified) clang/include/clang/Parse/Parser.h (+13-12)
  • (modified) clang/include/clang/Parse/RAIIObjectsForParser.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/HTMLRewrite.h (+10-9)
  • (modified) clang/include/clang/Rewrite/Core/Rewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/TokenRewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Frontend/ASTConsumers.h (+4-3)
  • (modified) clang/include/clang/Rewrite/Frontend/FixItRewriter.h (+3-2)
  • (modified) clang/include/clang/Rewrite/Frontend/FrontendActions.h (+8-7)
  • (modified) clang/include/clang/Rewrite/Frontend/Rewriters.h (+4-3)
  • (modified) clang/include/clang/Sema/AnalysisBasedWarnings.h (+3-2)
  • (modified) clang/include/clang/Sema/CodeCompleteConsumer.h (+20-19)
  • (modified) clang/include/clang/Sema/DeclSpec.h (+7-6)
  • (modified) clang/include/clang/Sema/DelayedDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Sema/ExternalSemaSource.h (+2-1)
diff --git a/clang/include/clang/APINotes/APINotesManager.h b/clang/include/clang/APINotes/APINotesManager.h
index 98592438e90eab..05d7930d3a2e7f 100644
--- a/clang/include/clang/APINotes/APINotesManager.h
+++ b/clang/include/clang/APINotes/APINotesManager.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
@@ -41,7 +42,7 @@ class APINotesReader;
 /// external API notes files that correspond to a given header. Its primary
 /// operation is \c findAPINotes(), which finds the API notes reader that
 /// provides information about the declarations at that location.
-class APINotesManager {
+class CLANG_ABI APINotesManager {
   using ReaderEntry = llvm::PointerUnion<DirectoryEntryRef, APINotesReader *>;
 
   SourceManager &SM;
diff --git a/clang/include/clang/APINotes/APINotesReader.h b/clang/include/clang/APINotes/APINotesReader.h
index baf63340640242..58ee2857c7930f 100644
--- a/clang/include/clang/APINotes/APINotesReader.h
+++ b/clang/include/clang/APINotes/APINotesReader.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_READER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/VersionTuple.h"
 #include <memory>
@@ -25,7 +26,7 @@ namespace api_notes {
 
 /// A class that reads API notes data from a binary file that was written by
 /// the \c APINotesWriter.
-class APINotesReader {
+class CLANG_ABI APINotesReader {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesWriter.h b/clang/include/clang/APINotes/APINotesWriter.h
index 3cc16c3d959faf..b8b45a89dcfc8b 100644
--- a/clang/include/clang/APINotes/APINotesWriter.h
+++ b/clang/include/clang/APINotes/APINotesWriter.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_WRITER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/Support/raw_ostream.h"
@@ -29,7 +30,7 @@ namespace api_notes {
 
 /// A class that writes API notes data to a binary representation that can be
 /// read by the \c APINotesReader.
-class APINotesWriter {
+class CLANG_ABI APINotesWriter {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesYAMLCompiler.h b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
index 9c24ed85b6a124..3954cf347e8244 100644
--- a/clang/include/clang/APINotes/APINotesYAMLCompiler.h
+++ b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 #define LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
@@ -22,10 +23,10 @@ namespace api_notes {
 /// Parses the APINotes YAML content and writes the representation back to the
 /// specified stream.  This provides a means of testing the YAML processing of
 /// the APINotes format.
-bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
+CLANG_ABI bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
 
 /// Converts API notes from YAML format to binary format.
-bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
+CLANG_ABI bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
                      llvm::raw_ostream &OS,
                      llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr,
                      void *DiagHandlerCtxt = nullptr);
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 89889910d1a073..574406586c4674 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_TYPES_H
 
 #include "clang/Basic/Specifiers.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include <climits>
@@ -49,7 +50,7 @@ enum class SwiftNewTypeKind {
 /// Describes API notes data for any entity.
 ///
 /// This is used as the base of all API notes.
-class CommonEntityInfo {
+class CLANG_ABI CommonEntityInfo {
 public:
   /// Message to use when this entity is unavailable.
   std::string UnavailableMsg;
@@ -132,7 +133,7 @@ inline bool operator!=(const CommonEntityInfo &LHS,
 }
 
 /// Describes API notes for types.
-class CommonTypeInfo : public CommonEntityInfo {
+class CLANG_ABI CommonTypeInfo : public CommonEntityInfo {
   /// The Swift type to which a given type is bridged.
   ///
   /// Reflects the swift_bridge attribute.
@@ -194,7 +195,7 @@ inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
 
 /// Describes API notes data for an Objective-C class or protocol or a C++
 /// namespace.
-class ContextInfo : public CommonTypeInfo {
+class CLANG_ABI ContextInfo : public CommonTypeInfo {
   /// Whether this class has a default nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasDefaultNullability : 1;
@@ -301,7 +302,7 @@ inline bool operator!=(const ContextInfo &LHS, const ContextInfo &RHS) {
 }
 
 /// API notes for a variable/property.
-class VariableInfo : public CommonEntityInfo {
+class CLANG_ABI VariableInfo : public CommonEntityInfo {
   /// Whether this property has been audited for nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NullabilityAudited : 1;
@@ -358,7 +359,7 @@ inline bool operator!=(const VariableInfo &LHS, const VariableInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C property.
-class ObjCPropertyInfo : public VariableInfo {
+class CLANG_ABI ObjCPropertyInfo : public VariableInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned SwiftImportAsAccessorsSpecified : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -416,7 +417,7 @@ inline bool operator!=(const ObjCPropertyInfo &LHS,
 }
 
 /// Describes a function or method parameter.
-class ParamInfo : public VariableInfo {
+class CLANG_ABI ParamInfo : public VariableInfo {
   /// Whether noescape was specified.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NoEscapeSpecified : 1;
@@ -486,7 +487,7 @@ inline bool operator!=(const ParamInfo &LHS, const ParamInfo &RHS) {
 }
 
 /// API notes for a function or method.
-class FunctionInfo : public CommonEntityInfo {
+class CLANG_ABI FunctionInfo : public CommonEntityInfo {
 private:
   static constexpr const uint64_t NullabilityKindMask = 0x3;
   static constexpr const unsigned NullabilityKindSize = 2;
@@ -606,7 +607,7 @@ inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C method.
-class ObjCMethodInfo : public FunctionInfo {
+class CLANG_ABI ObjCMethodInfo : public FunctionInfo {
 public:
   /// Whether this is a designated initializer of its class.
   LLVM_PREFERRED_TYPE(bool)
@@ -675,7 +676,7 @@ class EnumConstantInfo : public CommonEntityInfo {
 };
 
 /// Describes API notes data for a tag.
-class TagInfo : public CommonTypeInfo {
+class CLANG_ABI TagInfo : public CommonTypeInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasFlagEnum : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -765,7 +766,7 @@ inline bool operator!=(const TagInfo &LHS, const TagInfo &RHS) {
 }
 
 /// Describes API notes data for a typedef.
-class TypedefInfo : public CommonTypeInfo {
+class CLANG_ABI TypedefInfo : public CommonTypeInfo {
 public:
   std::optional<SwiftNewTypeKind> SwiftWrapper;
 
diff --git a/clang/include/clang/ARCMigrate/ARCMT.h b/clang/include/clang/ARCMigrate/ARCMT.h
index 2b950e3d2cc2bf..dc078101e371ff 100644
--- a/clang/include/clang/ARCMigrate/ARCMT.h
+++ b/clang/include/clang/ARCMigrate/ARCMT.h
@@ -12,6 +12,7 @@
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Frontend/CompilerInvocation.h"
+#include "clang/Support/Compiler.h"
 
 namespace clang {
   class ASTContext;
@@ -37,7 +38,7 @@ namespace arcmt {
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
                      DiagnosticConsumer *DiagClient,
@@ -48,7 +49,7 @@ checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
 /// applies automatic modifications to source files to conform to ARC.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 applyTransformations(CompilerInvocation &origCI,
                      const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -65,7 +66,7 @@ applyTransformations(CompilerInvocation &origCI,
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool migrateWithTemporaryFiles(
+CLANG_ABI bool migrateWithTemporaryFiles(
     CompilerInvocation &origCI, const FrontendInputFile &Input,
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
     DiagnosticConsumer *DiagClient, StringRef outputDir,
@@ -75,7 +76,7 @@ bool migrateWithTemporaryFiles(
 /// migrateWithTemporaryFiles produced.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
+CLANG_ABI bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
                        StringRef outputDir,
                        DiagnosticConsumer *DiagClient);
 
@@ -83,17 +84,17 @@ bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
 /// info.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappingsFromFileList(
+CLANG_ABI bool getFileRemappingsFromFileList(
                         std::vector<std::pair<std::string,std::string> > &remap,
                         ArrayRef<StringRef> remapFiles,
                         DiagnosticConsumer *DiagClient);
 
 typedef void (*TransformFn)(MigrationPass &pass);
 
-std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
+CLANG_ABI std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
                                                bool NoFinalizeRemoval);
 
-class MigrationProcess {
+class CLANG_ABI MigrationProcess {
   CompilerInvocation OrigCI;
   std::shared_ptr<PCHContainerOperations> PCHContainerOps;
   DiagnosticConsumer *DiagClient;
@@ -107,7 +108,7 @@ class MigrationProcess {
                    DiagnosticConsumer *diagClient,
                    StringRef outputDir = StringRef());
 
-  class RewriteListener {
+  class CLANG_ABI RewriteListener {
   public:
     virtual ~RewriteListener();
 
diff --git a/clang/include/clang/ARCMigrate/ARCMTActions.h b/clang/include/clang/ARCMigrate/ARCMTActions.h
index 714f4b33db446b..50c6142078f5c8 100644
--- a/clang/include/clang/ARCMigrate/ARCMTActions.h
+++ b/clang/include/clang/ARCMigrate/ARCMTActions.h
@@ -11,12 +11,13 @@
 
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Frontend/FrontendAction.h"
+#include "clang/Support/Compiler.h"
 #include <memory>
 
 namespace clang {
 namespace arcmt {
 
-class CheckAction : public WrapperFrontendAction {
+class CLANG_ABI CheckAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -24,7 +25,7 @@ class CheckAction : public WrapperFrontendAction {
   CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class ModifyAction : public WrapperFrontendAction {
+class CLANG_ABI ModifyAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -32,7 +33,7 @@ class ModifyAction : public WrapperFrontendAction {
   ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class MigrateSourceAction : public ASTFrontendAction {
+class CLANG_ABI MigrateSourceAction : public ASTFrontendAction {
   FileRemapper Remapper;
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
@@ -40,7 +41,7 @@ class MigrateSourceAction : public ASTFrontendAction {
                                                  StringRef InFile) override;
 };
 
-class MigrateAction : public WrapperFrontendAction {
+class CLANG_ABI MigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   std::string PlistOut;
   bool EmitPremigrationARCErrors;
@@ -55,7 +56,7 @@ class MigrateAction : public WrapperFrontendAction {
 };
 
 /// Migrates to modern ObjC syntax.
-class ObjCMigrateAction : public WrapperFrontendAction {
+class CLANG_ABI ObjCMigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   unsigned    ObjCMigAction;
   FileRemapper Remapper;
diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h
index afcee363516a21..3c9f706a75cf38 100644
--- a/clang/include/clang/ARCMigrate/FileRemapper.h
+++ b/clang/include/clang/ARCMigrate/FileRemapper.h
@@ -11,6 +11,7 @@
 
 #include "clang/Basic/FileEntry.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -29,7 +30,7 @@ namespace clang {
 
 namespace arcmt {
 
-class FileRemapper {
+class CLANG_ABI FileRemapper {
   // FIXME: Reuse the same FileManager for multiple ASTContexts.
   std::unique_ptr<FileManager> FileMgr;
 
diff --git a/clang/include/clang/AST/APNumericStorage.h b/clang/include/clang/AST/APNumericStorage.h
index 95eddbcd86e839..ae634d46dfea2b 100644
--- a/clang/include/clang/AST/APNumericStorage.h
+++ b/clang/include/clang/AST/APNumericStorage.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_AST_APNUMERICSTORAGE_H
 #define LLVM_CLANG_AST_APNUMERICSTORAGE_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 
@@ -23,7 +24,7 @@ class ASTContext;
 /// to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
 /// the APFloat/APInt values will never get freed. APNumericStorage uses
 /// ASTContext's allocator for memory allocation.
-class APNumericStorage {
+class CLANG_ABI APNumericStorage {
   union {
     uint64_t VAL;   ///< Used to store the <= 64 bits integer value.
     uint64_t *pVal; ///< Used to store the >64 bits integer value.
diff --git a/clang/include/clang/AST/APValue.h b/clang/include/clang/AST/APValue.h
index c4206b73b11562..fc6baf92a90202 100644
--- a/clang/include/clang/AST/APValue.h
+++ b/clang/include/clang/AST/APValue.h
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_AST_APVALUE_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFixedPoint.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
@@ -41,7 +42,7 @@ template <typename T> class BasicReaderBase;
   class QualType;
 
 /// Symbolic representation of typeid(T) for some type T.
-class TypeInfoLValue {
+class CLANG_ABI TypeInfoLValue {
   const Type *T;
 
 public:
@@ -119,7 +120,7 @@ namespace clang {
 /// APValue - This class implements a discriminated union of [uninitialized]
 /// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
 /// [Vector: N * APValue], [Array: N * APValue]
-class APValue {
+class CLANG_ABI APValue {
   typedef llvm::APFixedPoint APFixedPoint;
   typedef llvm::APSInt APSInt;
   typedef llvm::APFloat APFloat;
@@ -143,7 +144,7 @@ class APValue {
     AddrLabelDiff
   };
 
-  class LValueBase {
+  class CLANG_ABI LValueBase {
     typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                                DynamicAllocLValue>
         PtrTy;
@@ -179,11 +180,11 @@ class APValue {
 
     QualType getType() const;
 
-    friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
+    friend CLANG_ABI bool operator==(const LValueBase &LHS, const LValueBase &RHS);
     friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
       return !(LHS == RHS);
     }
-    friend llvm::hash_code hash_value(const LValueBase &Base);
+    friend CLANG_ABI llvm::hash_code hash_value(const LValueBase &Base);
     friend struct llvm::DenseMapInfo<LValueBase>;
 
   private:
@@ -205,7 +206,7 @@ class APValue {
   typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
 
   /// A non-discriminated union of a base, field, or array index.
-  class LValuePathEntry {
+  class CLANG_ABI LValuePathEntry {
     static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
                   "pointer doesn't fit in 64 bits?");
     uint64_t Value;
@@ -237,7 +238,7 @@ class APValue {
       return llvm::hash_value(A.Value);
     }
   };
-  class LValuePathSerializationHelper {
+  class CLANG_ABI LValuePathSerializationHelper {
     const void *Ty;
 
   public:
@@ -274,7 +275,7 @@ class APValue {
     Vec &operator=(const Vec &) = delete;
     ~Vec() { delete[] Elts; }
   };
-  struct Arr {
+  struct CLANG_ABI Arr {
     APValue *Elts;
     unsigned NumElts, ArrSize;
     Arr(unsigned NumElts, unsigned ArrSize);
@@ -282,7 +283,7 @@ class APValue {
     Arr &operator=(const Arr &) = delete;
     ~Arr();
   };
-  struct StructData {
+  struct CLANG_ABI StructData {
     APValue *Elts;
     unsigned NumBases;
     unsigned NumFields;
@@ -291,7 +292,7 @@ class APValue {
     StructData &operator=(const StructData &) = delete;
     ~StructData();
   };
-  struct UnionData {
+  struct CLANG_ABI UnionData {
     const FieldDecl *Field;
     APValue *Value;
     UnionData();
@@ -702,7 +703,7 @@ class APValue {
 } // end namespace clang.
 
 namespace llvm {
-template<> struct DenseMapInfo<clang::APValue::LValueBase> {
+template<> struct CLANG_ABI DenseMapInfo<clang::APValue::LValueBase> {
   static clang::APValue::LValueBase getEmptyKey();
   static clang::APValue::LValueBase getTombstoneKey();
   static unsigned getHashValue(const clang::APValue::LValueBase &Base);
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index 00500e214f4ce6..59b0a8e9d96a9d 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -18,6 +18,7 @@
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
@@ -32,7 +33,7 @@ struct PrintingPolicy;
 
 /// The result of a constraint satisfaction check, containing the necessary
 /// information to diagnose an unsatisfied constraint.
-class ConstraintSatisfaction : public llvm::FoldingSetNode {
+class CLANG_ABI ConstraintSatisfaction : public llvm::FoldingSetNode {
   // The template-like entity that 'owns' the constraint checked here (can be a
   // constrained entity or a concept).
   const NamedDecl *ConstraintOwner = nullptr;
@@ -84,7 +85,7 @@ using UnsatisfiedConstraintRecord =
 /// necessary information to diagnose an unsatisfied constraint.
 ///
 /// This is safe to store in an AST node, as opposed to ConstraintSatisfaction.
-struct ASTConstraintSatisfaction final :
+struct CLANG_ABI ASTConstraintSatisfaction final :
     llvm::TrailingObjects<ASTConstraintSatisfaction,
                           UnsatisfiedConstraintRecord> {
   std::size_t NumRecords;
@@ -121,7 +122,7 @@ struct ASTConstraintSatisfaction final :
 ///
 ///   template <std::derives_from<Expr> T> void dump();
 ///             ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl)
-class ConceptReference {
+class CLANG_ABI ConceptReference {
   // \brief The optional nested name specifier used when naming the concept.
   NestedNameSpecifierLoc NestedNameSpec;
 
diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h
index 447f2592d23595..735c7e549f5cac 100644
--- a/clang/include/clang/AST/ASTConsumer.h
+++ b/clang/include/clang/AST/ASTConsumer.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CLANG_AST_ASTCONSUMER_H
 #define LLVM_CLANG_AST_ASTCONSUMER_H
 
+#include "clang/Support/Compiler.h"
 namespace clang {
   class ASTContext;
   class CXXMethodDecl;
@@ -31,7 +32,7 @@ namespace clang {
 /// ASTCons...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-clang

Author: Thomas Fransham (fsfod)

Changes

The visibility macros generated here are created by a ids clang tooling based tool that @compnerd wrote and I've extended.
To reduce the numbers of exports and to avoid explicitly deleting more special members than necessary for MSVC only classes with out of line members or static variables have visibility macros added to them. I've included the config file that used to drive the tool for the Clang codebase to add some insight files are or aren't modified. I skipped running clang-format over most of changes just so the diffs are more readable and some files some weird indenting that clang-format to reformat the whole file.
These changes also depend on the macros to be added in #108276.


Patch is 1.09 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109702.diff

501 Files Affected:

  • (modified) clang/include/clang/APINotes/APINotesManager.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesReader.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesWriter.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesYAMLCompiler.h (+3-2)
  • (modified) clang/include/clang/APINotes/Types.h (+11-10)
  • (modified) clang/include/clang/ARCMigrate/ARCMT.h (+9-8)
  • (modified) clang/include/clang/ARCMigrate/ARCMTActions.h (+6-5)
  • (modified) clang/include/clang/ARCMigrate/FileRemapper.h (+2-1)
  • (modified) clang/include/clang/AST/APNumericStorage.h (+2-1)
  • (modified) clang/include/clang/AST/APValue.h (+12-11)
  • (modified) clang/include/clang/AST/ASTConcept.h (+4-3)
  • (modified) clang/include/clang/AST/ASTConsumer.h (+2-1)
  • (modified) clang/include/clang/AST/ASTContext.h (+5-4)
  • (modified) clang/include/clang/AST/ASTContextAllocate.h (+5-4)
  • (modified) clang/include/clang/AST/ASTDiagnostic.h (+3-2)
  • (modified) clang/include/clang/AST/ASTDumper.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImportError.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImporter.h (+3-2)
  • (modified) clang/include/clang/AST/ASTImporterLookupTable.h (+2-1)
  • (modified) clang/include/clang/AST/ASTMutationListener.h (+2-1)
  • (modified) clang/include/clang/AST/ASTStructuralEquivalence.h (+2-1)
  • (modified) clang/include/clang/AST/ASTTypeTraits.h (+3-2)
  • (modified) clang/include/clang/AST/ASTUnresolvedSet.h (+2-1)
  • (modified) clang/include/clang/AST/Attr.h (+2-1)
  • (modified) clang/include/clang/AST/Availability.h (+2-1)
  • (modified) clang/include/clang/AST/CXXInheritance.h (+3-2)
  • (modified) clang/include/clang/AST/Comment.h (+7-6)
  • (modified) clang/include/clang/AST/CommentBriefParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentCommandTraits.h (+2-1)
  • (modified) clang/include/clang/AST/CommentLexer.h (+3-2)
  • (modified) clang/include/clang/AST/CommentParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentSema.h (+2-1)
  • (modified) clang/include/clang/AST/ComparisonCategories.h (+5-4)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+86-85)
  • (modified) clang/include/clang/AST/DataCollection.h (+2-1)
  • (modified) clang/include/clang/AST/Decl.h (+35-34)
  • (modified) clang/include/clang/AST/DeclBase.h (+5-4)
  • (modified) clang/include/clang/AST/DeclCXX.h (+33-32)
  • (modified) clang/include/clang/AST/DeclContextInternals.h (+2-1)
  • (modified) clang/include/clang/AST/DeclFriend.h (+2-1)
  • (modified) clang/include/clang/AST/DeclGroup.h (+2-1)
  • (modified) clang/include/clang/AST/DeclID.h (+3-2)
  • (modified) clang/include/clang/AST/DeclObjC.h (+20-19)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+7-6)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+25-24)
  • (modified) clang/include/clang/AST/DeclarationName.h (+7-6)
  • (modified) clang/include/clang/AST/DependentDiagnostic.h (+2-1)
  • (modified) clang/include/clang/AST/Expr.h (+40-39)
  • (modified) clang/include/clang/AST/ExprCXX.h (+44-43)
  • (modified) clang/include/clang/AST/ExprConcepts.h (+7-6)
  • (modified) clang/include/clang/AST/ExprObjC.h (+6-5)
  • (modified) clang/include/clang/AST/ExprOpenMP.h (+3-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+2-1)
  • (modified) clang/include/clang/AST/ExternalASTSource.h (+2-1)
  • (modified) clang/include/clang/AST/FormatString.h (+13-12)
  • (modified) clang/include/clang/AST/JSONNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/LambdaCapture.h (+2-1)
  • (modified) clang/include/clang/AST/LocInfoType.h (+2-1)
  • (modified) clang/include/clang/AST/Mangle.h (+5-4)
  • (modified) clang/include/clang/AST/MangleNumberingContext.h (+2-1)
  • (modified) clang/include/clang/AST/NSAPI.h (+2-1)
  • (modified) clang/include/clang/AST/NestedNameSpecifier.h (+4-3)
  • (modified) clang/include/clang/AST/ODRDiagsEmitter.h (+2-1)
  • (modified) clang/include/clang/AST/ODRHash.h (+3-2)
  • (modified) clang/include/clang/AST/OSLog.h (+2-1)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+34-33)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+58-57)
  • (modified) clang/include/clang/AST/ParentMap.h (+2-1)
  • (modified) clang/include/clang/AST/ParentMapContext.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyDeclStackTrace.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyPrinter.h (+2-1)
  • (modified) clang/include/clang/AST/QualTypeNames.h (+3-2)
  • (modified) clang/include/clang/AST/Randstruct.h (+2-1)
  • (modified) clang/include/clang/AST/RawCommentList.h (+3-2)
  • (modified) clang/include/clang/AST/RecordLayout.h (+2-1)
  • (modified) clang/include/clang/AST/Redeclarable.h (+2-1)
  • (modified) clang/include/clang/AST/SelectorLocationsKind.h (+5-4)
  • (modified) clang/include/clang/AST/Stmt.h (+22-21)
  • (modified) clang/include/clang/AST/StmtCXX.h (+5-4)
  • (modified) clang/include/clang/AST/StmtIterator.h (+2-1)
  • (modified) clang/include/clang/AST/StmtObjC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+80-79)
  • (modified) clang/include/clang/AST/TemplateBase.h (+7-6)
  • (modified) clang/include/clang/AST/TemplateName.h (+6-5)
  • (modified) clang/include/clang/AST/TextNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/Type.h (+71-70)
  • (modified) clang/include/clang/AST/TypeLoc.h (+32-31)
  • (modified) clang/include/clang/AST/VTTBuilder.h (+2-1)
  • (modified) clang/include/clang/AST/VTableBuilder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchFinder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+231-230)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchersInternal.h (+14-13)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Parser.h (+4-3)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Registry.h (+3-2)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/VariantValue.h (+6-5)
  • (modified) clang/include/clang/ASTMatchers/GtestMatchers.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/CalledOnceCheck.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/Consumed.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/Dominators.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/IntervalPartition.h (+6-5)
  • (modified) clang/include/clang/Analysis/Analyses/LiveVariables.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/PostOrderCFGView.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/ReachableCode.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafety.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyLogical.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/UninitializedValues.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h (+5-4)
  • (modified) clang/include/clang/Analysis/AnalysisDeclContext.h (+8-7)
  • (modified) clang/include/clang/Analysis/BodyFarm.h (+2-1)
  • (modified) clang/include/clang/Analysis/CFG.h (+7-6)
  • (modified) clang/include/clang/Analysis/CFGStmtMap.h (+2-1)
  • (modified) clang/include/clang/Analysis/CallGraph.h (+3-2)
  • (modified) clang/include/clang/Analysis/CloneDetection.h (+11-10)
  • (modified) clang/include/clang/Analysis/CodeInjector.h (+2-1)
  • (modified) clang/include/clang/Analysis/ConstructionContext.h (+4-3)
  • (modified) clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h (+5-4)
  • (modified) clang/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/ASTOps.h (+8-7)
  • (modified) clang/include/clang/Analysis/FlowSensitive/AdornedCFG.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Arena.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/CNFFormula.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DebugSupport.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Formula.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Logger.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/RecordOps.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Solver.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Transfer.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Value.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h (+2-1)
  • (modified) clang/include/clang/Analysis/IssueHash.h (+3-2)
  • (modified) clang/include/clang/Analysis/MacroExpansionContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/PathDiagnostic.h (+14-13)
  • (modified) clang/include/clang/Analysis/ProgramPoint.h (+4-3)
  • (modified) clang/include/clang/Analysis/RetainSummaryManager.h (+5-4)
  • (modified) clang/include/clang/Basic/ASTSourceDescriptor.h (+2-1)
  • (modified) clang/include/clang/Basic/AttrSubjectMatchRules.h (+2-1)
  • (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/Attributes.h (+2-1)
  • (modified) clang/include/clang/Basic/Builtins.h (+4-3)
  • (modified) clang/include/clang/Basic/CLWarnings.h (+2-1)
  • (modified) clang/include/clang/Basic/CharInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/Cuda.h (+11-10)
  • (modified) clang/include/clang/Basic/DarwinSDKInfo.h (+4-3)
  • (modified) clang/include/clang/Basic/Diagnostic.h (+18-17)
  • (modified) clang/include/clang/Basic/DiagnosticError.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticIDs.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticOptions.h (+3-2)
  • (modified) clang/include/clang/Basic/ExpressionTraits.h (+3-2)
  • (modified) clang/include/clang/Basic/FileEntry.h (+2-1)
  • (modified) clang/include/clang/Basic/FileManager.h (+2-1)
  • (modified) clang/include/clang/Basic/FileSystemStatCache.h (+3-2)
  • (modified) clang/include/clang/Basic/IdentifierTable.h (+9-8)
  • (modified) clang/include/clang/Basic/LangOptions.h (+4-3)
  • (modified) clang/include/clang/Basic/LangStandard.h (+4-3)
  • (modified) clang/include/clang/Basic/MakeSupport.h (+2-1)
  • (modified) clang/include/clang/Basic/Module.h (+3-2)
  • (modified) clang/include/clang/Basic/NoSanitizeList.h (+2-1)
  • (modified) clang/include/clang/Basic/ObjCRuntime.h (+3-2)
  • (modified) clang/include/clang/Basic/OpenCLOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/OpenMPKinds.h (+27-26)
  • (modified) clang/include/clang/Basic/OperatorKinds.h (+2-1)
  • (modified) clang/include/clang/Basic/OperatorPrecedence.h (+2-1)
  • (modified) clang/include/clang/Basic/ParsedAttrInfo.h (+3-2)
  • (modified) clang/include/clang/Basic/PrettyStackTrace.h (+2-1)
  • (modified) clang/include/clang/Basic/ProfileList.h (+2-1)
  • (modified) clang/include/clang/Basic/SanitizerSpecialCaseList.h (+2-1)
  • (modified) clang/include/clang/Basic/Sanitizers.h (+10-9)
  • (modified) clang/include/clang/Basic/Sarif.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceLocation.h (+5-4)
  • (modified) clang/include/clang/Basic/SourceManager.h (+6-5)
  • (modified) clang/include/clang/Basic/SourceManagerInternals.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceMgrAdapter.h (+2-1)
  • (modified) clang/include/clang/Basic/Specifiers.h (+4-3)
  • (modified) clang/include/clang/Basic/Stack.h (+4-3)
  • (modified) clang/include/clang/Basic/SyncScope.h (+2-1)
  • (modified) clang/include/clang/Basic/TargetID.h (+7-6)
  • (modified) clang/include/clang/Basic/TargetInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/TokenKinds.h (+7-6)
  • (modified) clang/include/clang/Basic/TypeTraits.h (+8-7)
  • (modified) clang/include/clang/Basic/Version.h (+10-9)
  • (modified) clang/include/clang/Basic/XRayInstr.h (+3-2)
  • (modified) clang/include/clang/Basic/XRayLists.h (+2-1)
  • (modified) clang/include/clang/CodeGen/BackendUtil.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CGFunctionInfo.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CodeGenABITypes.h (+21-20)
  • (modified) clang/include/clang/CodeGen/CodeGenAction.h (+8-7)
  • (modified) clang/include/clang/CodeGen/ConstantInitBuilder.h (+5-4)
  • (modified) clang/include/clang/CodeGen/ConstantInitFuture.h (+2-1)
  • (modified) clang/include/clang/CodeGen/ModuleBuilder.h (+3-2)
  • (modified) clang/include/clang/CodeGen/ObjectFilePCHContainerWriter.h (+2-1)
  • (modified) clang/include/clang/CodeGen/SwiftCallingConv.h (+15-14)
  • (modified) clang/include/clang/CrossTU/CrossTranslationUnit.h (+9-8)
  • (modified) clang/include/clang/Driver/Action.h (+29-28)
  • (modified) clang/include/clang/Driver/Compilation.h (+2-1)
  • (modified) clang/include/clang/Driver/Distro.h (+2-1)
  • (modified) clang/include/clang/Driver/Driver.h (+8-7)
  • (modified) clang/include/clang/Driver/Job.h (+4-3)
  • (modified) clang/include/clang/Driver/Multilib.h (+5-4)
  • (modified) clang/include/clang/Driver/MultilibBuilder.h (+3-2)
  • (modified) clang/include/clang/Driver/OffloadBundler.h (+5-4)
  • (modified) clang/include/clang/Driver/OptionUtils.h (+3-2)
  • (modified) clang/include/clang/Driver/Options.h (+2-1)
  • (modified) clang/include/clang/Driver/Phases.h (+2-1)
  • (modified) clang/include/clang/Driver/SanitizerArgs.h (+2-1)
  • (modified) clang/include/clang/Driver/Tool.h (+2-1)
  • (modified) clang/include/clang/Driver/ToolChain.h (+2-1)
  • (modified) clang/include/clang/Driver/Types.h (+26-25)
  • (modified) clang/include/clang/Driver/XRayArgs.h (+2-1)
  • (modified) clang/include/clang/Edit/Commit.h (+3-2)
  • (modified) clang/include/clang/Edit/EditedSource.h (+2-1)
  • (modified) clang/include/clang/Edit/EditsReceiver.h (+2-1)
  • (modified) clang/include/clang/Edit/Rewriters.h (+4-3)
  • (modified) clang/include/clang/ExtractAPI/API.h (+36-35)
  • (modified) clang/include/clang/ExtractAPI/APIIgnoresList.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/DeclarationFragments.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/ExtractAPIActionBase.h (+2-1)
  • (modified) clang/include/clang/ExtractAPI/FrontendActions.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/TypedefUnderlyingTypeResolver.h (+2-1)
  • (modified) clang/include/clang/Format/Format.h (+36-35)
  • (modified) clang/include/clang/Frontend/ASTConsumers.h (+5-4)
  • (modified) clang/include/clang/Frontend/ASTUnit.h (+4-3)
  • (modified) clang/include/clang/Frontend/ChainedDiagnosticConsumer.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInstance.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInvocation.h (+10-9)
  • (modified) clang/include/clang/Frontend/DiagnosticRenderer.h (+3-2)
  • (modified) clang/include/clang/Frontend/FrontendAction.h (+6-5)
  • (modified) clang/include/clang/Frontend/FrontendActions.h (+27-26)
  • (modified) clang/include/clang/Frontend/FrontendOptions.h (+2-1)
  • (modified) clang/include/clang/Frontend/LayoutOverrideSource.h (+2-1)
  • (modified) clang/include/clang/Frontend/LogDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/MultiplexConsumer.h (+3-2)
  • (modified) clang/include/clang/Frontend/PrecompiledPreamble.h (+7-6)
  • (modified) clang/include/clang/Frontend/SARIFDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/SARIFDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticReader.h (+4-3)
  • (modified) clang/include/clang/Frontend/TextDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticBuffer.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/Utils.h (+10-9)
  • (modified) clang/include/clang/Frontend/VerifyDiagnosticConsumer.h (+3-2)
  • (modified) clang/include/clang/FrontendTool/Utils.h (+3-2)
  • (modified) clang/include/clang/Index/CommentToXML.h (+2-1)
  • (modified) clang/include/clang/Index/IndexSymbol.h (+13-12)
  • (modified) clang/include/clang/Index/IndexingAction.h (+8-7)
  • (modified) clang/include/clang/Index/USRGeneration.h (+17-16)
  • (modified) clang/include/clang/IndexSerialization/SerializablePathCollection.h (+4-3)
  • (modified) clang/include/clang/InstallAPI/Context.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/DirectoryScanner.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/DylibVerifier.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/FileList.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Frontend.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/FrontendRecords.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/HeaderFile.h (+6-5)
  • (modified) clang/include/clang/InstallAPI/Library.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Visitor.h (+2-1)
  • (modified) clang/include/clang/Interpreter/CodeCompletion.h (+2-1)
  • (modified) clang/include/clang/Interpreter/Interpreter.h (+3-2)
  • (modified) clang/include/clang/Lex/CodeCompletionHandler.h (+2-1)
  • (modified) clang/include/clang/Lex/DependencyDirectivesScanner.h (+3-2)
  • (modified) clang/include/clang/Lex/DirectoryLookup.h (+3-2)
  • (modified) clang/include/clang/Lex/ExternalPreprocessorSource.h (+2-1)
  • (modified) clang/include/clang/Lex/HeaderMap.h (+3-2)
  • (modified) clang/include/clang/Lex/HeaderSearch.h (+5-4)
  • (modified) clang/include/clang/Lex/Lexer.h (+2-1)
  • (modified) clang/include/clang/Lex/LiteralSupport.h (+7-6)
  • (modified) clang/include/clang/Lex/MacroArgs.h (+2-1)
  • (modified) clang/include/clang/Lex/MacroInfo.h (+5-4)
  • (modified) clang/include/clang/Lex/ModuleLoader.h (+2-1)
  • (modified) clang/include/clang/Lex/ModuleMap.h (+3-2)
  • (modified) clang/include/clang/Lex/PPCallbacks.h (+3-2)
  • (modified) clang/include/clang/Lex/PPConditionalDirectiveRecord.h (+2-1)
  • (modified) clang/include/clang/Lex/Pragma.h (+5-4)
  • (modified) clang/include/clang/Lex/PreprocessingRecord.h (+5-4)
  • (modified) clang/include/clang/Lex/Preprocessor.h (+4-3)
  • (modified) clang/include/clang/Lex/PreprocessorLexer.h (+2-1)
  • (modified) clang/include/clang/Lex/ScratchBuffer.h (+2-1)
  • (modified) clang/include/clang/Lex/Token.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenConcatenation.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenLexer.h (+2-1)
  • (modified) clang/include/clang/Parse/ParseAST.h (+3-2)
  • (modified) clang/include/clang/Parse/Parser.h (+13-12)
  • (modified) clang/include/clang/Parse/RAIIObjectsForParser.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/HTMLRewrite.h (+10-9)
  • (modified) clang/include/clang/Rewrite/Core/Rewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/TokenRewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Frontend/ASTConsumers.h (+4-3)
  • (modified) clang/include/clang/Rewrite/Frontend/FixItRewriter.h (+3-2)
  • (modified) clang/include/clang/Rewrite/Frontend/FrontendActions.h (+8-7)
  • (modified) clang/include/clang/Rewrite/Frontend/Rewriters.h (+4-3)
  • (modified) clang/include/clang/Sema/AnalysisBasedWarnings.h (+3-2)
  • (modified) clang/include/clang/Sema/CodeCompleteConsumer.h (+20-19)
  • (modified) clang/include/clang/Sema/DeclSpec.h (+7-6)
  • (modified) clang/include/clang/Sema/DelayedDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Sema/ExternalSemaSource.h (+2-1)
diff --git a/clang/include/clang/APINotes/APINotesManager.h b/clang/include/clang/APINotes/APINotesManager.h
index 98592438e90eab..05d7930d3a2e7f 100644
--- a/clang/include/clang/APINotes/APINotesManager.h
+++ b/clang/include/clang/APINotes/APINotesManager.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
@@ -41,7 +42,7 @@ class APINotesReader;
 /// external API notes files that correspond to a given header. Its primary
 /// operation is \c findAPINotes(), which finds the API notes reader that
 /// provides information about the declarations at that location.
-class APINotesManager {
+class CLANG_ABI APINotesManager {
   using ReaderEntry = llvm::PointerUnion<DirectoryEntryRef, APINotesReader *>;
 
   SourceManager &SM;
diff --git a/clang/include/clang/APINotes/APINotesReader.h b/clang/include/clang/APINotes/APINotesReader.h
index baf63340640242..58ee2857c7930f 100644
--- a/clang/include/clang/APINotes/APINotesReader.h
+++ b/clang/include/clang/APINotes/APINotesReader.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_READER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/VersionTuple.h"
 #include <memory>
@@ -25,7 +26,7 @@ namespace api_notes {
 
 /// A class that reads API notes data from a binary file that was written by
 /// the \c APINotesWriter.
-class APINotesReader {
+class CLANG_ABI APINotesReader {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesWriter.h b/clang/include/clang/APINotes/APINotesWriter.h
index 3cc16c3d959faf..b8b45a89dcfc8b 100644
--- a/clang/include/clang/APINotes/APINotesWriter.h
+++ b/clang/include/clang/APINotes/APINotesWriter.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_WRITER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/Support/raw_ostream.h"
@@ -29,7 +30,7 @@ namespace api_notes {
 
 /// A class that writes API notes data to a binary representation that can be
 /// read by the \c APINotesReader.
-class APINotesWriter {
+class CLANG_ABI APINotesWriter {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesYAMLCompiler.h b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
index 9c24ed85b6a124..3954cf347e8244 100644
--- a/clang/include/clang/APINotes/APINotesYAMLCompiler.h
+++ b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 #define LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
@@ -22,10 +23,10 @@ namespace api_notes {
 /// Parses the APINotes YAML content and writes the representation back to the
 /// specified stream.  This provides a means of testing the YAML processing of
 /// the APINotes format.
-bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
+CLANG_ABI bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
 
 /// Converts API notes from YAML format to binary format.
-bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
+CLANG_ABI bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
                      llvm::raw_ostream &OS,
                      llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr,
                      void *DiagHandlerCtxt = nullptr);
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 89889910d1a073..574406586c4674 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_TYPES_H
 
 #include "clang/Basic/Specifiers.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include <climits>
@@ -49,7 +50,7 @@ enum class SwiftNewTypeKind {
 /// Describes API notes data for any entity.
 ///
 /// This is used as the base of all API notes.
-class CommonEntityInfo {
+class CLANG_ABI CommonEntityInfo {
 public:
   /// Message to use when this entity is unavailable.
   std::string UnavailableMsg;
@@ -132,7 +133,7 @@ inline bool operator!=(const CommonEntityInfo &LHS,
 }
 
 /// Describes API notes for types.
-class CommonTypeInfo : public CommonEntityInfo {
+class CLANG_ABI CommonTypeInfo : public CommonEntityInfo {
   /// The Swift type to which a given type is bridged.
   ///
   /// Reflects the swift_bridge attribute.
@@ -194,7 +195,7 @@ inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
 
 /// Describes API notes data for an Objective-C class or protocol or a C++
 /// namespace.
-class ContextInfo : public CommonTypeInfo {
+class CLANG_ABI ContextInfo : public CommonTypeInfo {
   /// Whether this class has a default nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasDefaultNullability : 1;
@@ -301,7 +302,7 @@ inline bool operator!=(const ContextInfo &LHS, const ContextInfo &RHS) {
 }
 
 /// API notes for a variable/property.
-class VariableInfo : public CommonEntityInfo {
+class CLANG_ABI VariableInfo : public CommonEntityInfo {
   /// Whether this property has been audited for nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NullabilityAudited : 1;
@@ -358,7 +359,7 @@ inline bool operator!=(const VariableInfo &LHS, const VariableInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C property.
-class ObjCPropertyInfo : public VariableInfo {
+class CLANG_ABI ObjCPropertyInfo : public VariableInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned SwiftImportAsAccessorsSpecified : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -416,7 +417,7 @@ inline bool operator!=(const ObjCPropertyInfo &LHS,
 }
 
 /// Describes a function or method parameter.
-class ParamInfo : public VariableInfo {
+class CLANG_ABI ParamInfo : public VariableInfo {
   /// Whether noescape was specified.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NoEscapeSpecified : 1;
@@ -486,7 +487,7 @@ inline bool operator!=(const ParamInfo &LHS, const ParamInfo &RHS) {
 }
 
 /// API notes for a function or method.
-class FunctionInfo : public CommonEntityInfo {
+class CLANG_ABI FunctionInfo : public CommonEntityInfo {
 private:
   static constexpr const uint64_t NullabilityKindMask = 0x3;
   static constexpr const unsigned NullabilityKindSize = 2;
@@ -606,7 +607,7 @@ inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C method.
-class ObjCMethodInfo : public FunctionInfo {
+class CLANG_ABI ObjCMethodInfo : public FunctionInfo {
 public:
   /// Whether this is a designated initializer of its class.
   LLVM_PREFERRED_TYPE(bool)
@@ -675,7 +676,7 @@ class EnumConstantInfo : public CommonEntityInfo {
 };
 
 /// Describes API notes data for a tag.
-class TagInfo : public CommonTypeInfo {
+class CLANG_ABI TagInfo : public CommonTypeInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasFlagEnum : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -765,7 +766,7 @@ inline bool operator!=(const TagInfo &LHS, const TagInfo &RHS) {
 }
 
 /// Describes API notes data for a typedef.
-class TypedefInfo : public CommonTypeInfo {
+class CLANG_ABI TypedefInfo : public CommonTypeInfo {
 public:
   std::optional<SwiftNewTypeKind> SwiftWrapper;
 
diff --git a/clang/include/clang/ARCMigrate/ARCMT.h b/clang/include/clang/ARCMigrate/ARCMT.h
index 2b950e3d2cc2bf..dc078101e371ff 100644
--- a/clang/include/clang/ARCMigrate/ARCMT.h
+++ b/clang/include/clang/ARCMigrate/ARCMT.h
@@ -12,6 +12,7 @@
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Frontend/CompilerInvocation.h"
+#include "clang/Support/Compiler.h"
 
 namespace clang {
   class ASTContext;
@@ -37,7 +38,7 @@ namespace arcmt {
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
                      DiagnosticConsumer *DiagClient,
@@ -48,7 +49,7 @@ checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
 /// applies automatic modifications to source files to conform to ARC.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 applyTransformations(CompilerInvocation &origCI,
                      const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -65,7 +66,7 @@ applyTransformations(CompilerInvocation &origCI,
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool migrateWithTemporaryFiles(
+CLANG_ABI bool migrateWithTemporaryFiles(
     CompilerInvocation &origCI, const FrontendInputFile &Input,
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
     DiagnosticConsumer *DiagClient, StringRef outputDir,
@@ -75,7 +76,7 @@ bool migrateWithTemporaryFiles(
 /// migrateWithTemporaryFiles produced.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
+CLANG_ABI bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
                        StringRef outputDir,
                        DiagnosticConsumer *DiagClient);
 
@@ -83,17 +84,17 @@ bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
 /// info.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappingsFromFileList(
+CLANG_ABI bool getFileRemappingsFromFileList(
                         std::vector<std::pair<std::string,std::string> > &remap,
                         ArrayRef<StringRef> remapFiles,
                         DiagnosticConsumer *DiagClient);
 
 typedef void (*TransformFn)(MigrationPass &pass);
 
-std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
+CLANG_ABI std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
                                                bool NoFinalizeRemoval);
 
-class MigrationProcess {
+class CLANG_ABI MigrationProcess {
   CompilerInvocation OrigCI;
   std::shared_ptr<PCHContainerOperations> PCHContainerOps;
   DiagnosticConsumer *DiagClient;
@@ -107,7 +108,7 @@ class MigrationProcess {
                    DiagnosticConsumer *diagClient,
                    StringRef outputDir = StringRef());
 
-  class RewriteListener {
+  class CLANG_ABI RewriteListener {
   public:
     virtual ~RewriteListener();
 
diff --git a/clang/include/clang/ARCMigrate/ARCMTActions.h b/clang/include/clang/ARCMigrate/ARCMTActions.h
index 714f4b33db446b..50c6142078f5c8 100644
--- a/clang/include/clang/ARCMigrate/ARCMTActions.h
+++ b/clang/include/clang/ARCMigrate/ARCMTActions.h
@@ -11,12 +11,13 @@
 
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Frontend/FrontendAction.h"
+#include "clang/Support/Compiler.h"
 #include <memory>
 
 namespace clang {
 namespace arcmt {
 
-class CheckAction : public WrapperFrontendAction {
+class CLANG_ABI CheckAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -24,7 +25,7 @@ class CheckAction : public WrapperFrontendAction {
   CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class ModifyAction : public WrapperFrontendAction {
+class CLANG_ABI ModifyAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -32,7 +33,7 @@ class ModifyAction : public WrapperFrontendAction {
   ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class MigrateSourceAction : public ASTFrontendAction {
+class CLANG_ABI MigrateSourceAction : public ASTFrontendAction {
   FileRemapper Remapper;
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
@@ -40,7 +41,7 @@ class MigrateSourceAction : public ASTFrontendAction {
                                                  StringRef InFile) override;
 };
 
-class MigrateAction : public WrapperFrontendAction {
+class CLANG_ABI MigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   std::string PlistOut;
   bool EmitPremigrationARCErrors;
@@ -55,7 +56,7 @@ class MigrateAction : public WrapperFrontendAction {
 };
 
 /// Migrates to modern ObjC syntax.
-class ObjCMigrateAction : public WrapperFrontendAction {
+class CLANG_ABI ObjCMigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   unsigned    ObjCMigAction;
   FileRemapper Remapper;
diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h
index afcee363516a21..3c9f706a75cf38 100644
--- a/clang/include/clang/ARCMigrate/FileRemapper.h
+++ b/clang/include/clang/ARCMigrate/FileRemapper.h
@@ -11,6 +11,7 @@
 
 #include "clang/Basic/FileEntry.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -29,7 +30,7 @@ namespace clang {
 
 namespace arcmt {
 
-class FileRemapper {
+class CLANG_ABI FileRemapper {
   // FIXME: Reuse the same FileManager for multiple ASTContexts.
   std::unique_ptr<FileManager> FileMgr;
 
diff --git a/clang/include/clang/AST/APNumericStorage.h b/clang/include/clang/AST/APNumericStorage.h
index 95eddbcd86e839..ae634d46dfea2b 100644
--- a/clang/include/clang/AST/APNumericStorage.h
+++ b/clang/include/clang/AST/APNumericStorage.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_AST_APNUMERICSTORAGE_H
 #define LLVM_CLANG_AST_APNUMERICSTORAGE_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 
@@ -23,7 +24,7 @@ class ASTContext;
 /// to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
 /// the APFloat/APInt values will never get freed. APNumericStorage uses
 /// ASTContext's allocator for memory allocation.
-class APNumericStorage {
+class CLANG_ABI APNumericStorage {
   union {
     uint64_t VAL;   ///< Used to store the <= 64 bits integer value.
     uint64_t *pVal; ///< Used to store the >64 bits integer value.
diff --git a/clang/include/clang/AST/APValue.h b/clang/include/clang/AST/APValue.h
index c4206b73b11562..fc6baf92a90202 100644
--- a/clang/include/clang/AST/APValue.h
+++ b/clang/include/clang/AST/APValue.h
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_AST_APVALUE_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFixedPoint.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
@@ -41,7 +42,7 @@ template <typename T> class BasicReaderBase;
   class QualType;
 
 /// Symbolic representation of typeid(T) for some type T.
-class TypeInfoLValue {
+class CLANG_ABI TypeInfoLValue {
   const Type *T;
 
 public:
@@ -119,7 +120,7 @@ namespace clang {
 /// APValue - This class implements a discriminated union of [uninitialized]
 /// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
 /// [Vector: N * APValue], [Array: N * APValue]
-class APValue {
+class CLANG_ABI APValue {
   typedef llvm::APFixedPoint APFixedPoint;
   typedef llvm::APSInt APSInt;
   typedef llvm::APFloat APFloat;
@@ -143,7 +144,7 @@ class APValue {
     AddrLabelDiff
   };
 
-  class LValueBase {
+  class CLANG_ABI LValueBase {
     typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                                DynamicAllocLValue>
         PtrTy;
@@ -179,11 +180,11 @@ class APValue {
 
     QualType getType() const;
 
-    friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
+    friend CLANG_ABI bool operator==(const LValueBase &LHS, const LValueBase &RHS);
     friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
       return !(LHS == RHS);
     }
-    friend llvm::hash_code hash_value(const LValueBase &Base);
+    friend CLANG_ABI llvm::hash_code hash_value(const LValueBase &Base);
     friend struct llvm::DenseMapInfo<LValueBase>;
 
   private:
@@ -205,7 +206,7 @@ class APValue {
   typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
 
   /// A non-discriminated union of a base, field, or array index.
-  class LValuePathEntry {
+  class CLANG_ABI LValuePathEntry {
     static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
                   "pointer doesn't fit in 64 bits?");
     uint64_t Value;
@@ -237,7 +238,7 @@ class APValue {
       return llvm::hash_value(A.Value);
     }
   };
-  class LValuePathSerializationHelper {
+  class CLANG_ABI LValuePathSerializationHelper {
     const void *Ty;
 
   public:
@@ -274,7 +275,7 @@ class APValue {
     Vec &operator=(const Vec &) = delete;
     ~Vec() { delete[] Elts; }
   };
-  struct Arr {
+  struct CLANG_ABI Arr {
     APValue *Elts;
     unsigned NumElts, ArrSize;
     Arr(unsigned NumElts, unsigned ArrSize);
@@ -282,7 +283,7 @@ class APValue {
     Arr &operator=(const Arr &) = delete;
     ~Arr();
   };
-  struct StructData {
+  struct CLANG_ABI StructData {
     APValue *Elts;
     unsigned NumBases;
     unsigned NumFields;
@@ -291,7 +292,7 @@ class APValue {
     StructData &operator=(const StructData &) = delete;
     ~StructData();
   };
-  struct UnionData {
+  struct CLANG_ABI UnionData {
     const FieldDecl *Field;
     APValue *Value;
     UnionData();
@@ -702,7 +703,7 @@ class APValue {
 } // end namespace clang.
 
 namespace llvm {
-template<> struct DenseMapInfo<clang::APValue::LValueBase> {
+template<> struct CLANG_ABI DenseMapInfo<clang::APValue::LValueBase> {
   static clang::APValue::LValueBase getEmptyKey();
   static clang::APValue::LValueBase getTombstoneKey();
   static unsigned getHashValue(const clang::APValue::LValueBase &Base);
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index 00500e214f4ce6..59b0a8e9d96a9d 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -18,6 +18,7 @@
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
@@ -32,7 +33,7 @@ struct PrintingPolicy;
 
 /// The result of a constraint satisfaction check, containing the necessary
 /// information to diagnose an unsatisfied constraint.
-class ConstraintSatisfaction : public llvm::FoldingSetNode {
+class CLANG_ABI ConstraintSatisfaction : public llvm::FoldingSetNode {
   // The template-like entity that 'owns' the constraint checked here (can be a
   // constrained entity or a concept).
   const NamedDecl *ConstraintOwner = nullptr;
@@ -84,7 +85,7 @@ using UnsatisfiedConstraintRecord =
 /// necessary information to diagnose an unsatisfied constraint.
 ///
 /// This is safe to store in an AST node, as opposed to ConstraintSatisfaction.
-struct ASTConstraintSatisfaction final :
+struct CLANG_ABI ASTConstraintSatisfaction final :
     llvm::TrailingObjects<ASTConstraintSatisfaction,
                           UnsatisfiedConstraintRecord> {
   std::size_t NumRecords;
@@ -121,7 +122,7 @@ struct ASTConstraintSatisfaction final :
 ///
 ///   template <std::derives_from<Expr> T> void dump();
 ///             ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl)
-class ConceptReference {
+class CLANG_ABI ConceptReference {
   // \brief The optional nested name specifier used when naming the concept.
   NestedNameSpecifierLoc NestedNameSpec;
 
diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h
index 447f2592d23595..735c7e549f5cac 100644
--- a/clang/include/clang/AST/ASTConsumer.h
+++ b/clang/include/clang/AST/ASTConsumer.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CLANG_AST_ASTCONSUMER_H
 #define LLVM_CLANG_AST_ASTCONSUMER_H
 
+#include "clang/Support/Compiler.h"
 namespace clang {
   class ASTContext;
   class CXXMethodDecl;
@@ -31,7 +32,7 @@ namespace clang {
 /// ASTCons...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Sep 23, 2024

@llvm/pr-subscribers-hlsl

Author: Thomas Fransham (fsfod)

Changes

The visibility macros generated here are created by a ids clang tooling based tool that @compnerd wrote and I've extended.
To reduce the numbers of exports and to avoid explicitly deleting more special members than necessary for MSVC only classes with out of line members or static variables have visibility macros added to them. I've included the config file that used to drive the tool for the Clang codebase to add some insight files are or aren't modified. I skipped running clang-format over most of changes just so the diffs are more readable and some files some weird indenting that clang-format to reformat the whole file.
These changes also depend on the macros to be added in #108276.


Patch is 1.09 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109702.diff

501 Files Affected:

  • (modified) clang/include/clang/APINotes/APINotesManager.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesReader.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesWriter.h (+2-1)
  • (modified) clang/include/clang/APINotes/APINotesYAMLCompiler.h (+3-2)
  • (modified) clang/include/clang/APINotes/Types.h (+11-10)
  • (modified) clang/include/clang/ARCMigrate/ARCMT.h (+9-8)
  • (modified) clang/include/clang/ARCMigrate/ARCMTActions.h (+6-5)
  • (modified) clang/include/clang/ARCMigrate/FileRemapper.h (+2-1)
  • (modified) clang/include/clang/AST/APNumericStorage.h (+2-1)
  • (modified) clang/include/clang/AST/APValue.h (+12-11)
  • (modified) clang/include/clang/AST/ASTConcept.h (+4-3)
  • (modified) clang/include/clang/AST/ASTConsumer.h (+2-1)
  • (modified) clang/include/clang/AST/ASTContext.h (+5-4)
  • (modified) clang/include/clang/AST/ASTContextAllocate.h (+5-4)
  • (modified) clang/include/clang/AST/ASTDiagnostic.h (+3-2)
  • (modified) clang/include/clang/AST/ASTDumper.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImportError.h (+2-1)
  • (modified) clang/include/clang/AST/ASTImporter.h (+3-2)
  • (modified) clang/include/clang/AST/ASTImporterLookupTable.h (+2-1)
  • (modified) clang/include/clang/AST/ASTMutationListener.h (+2-1)
  • (modified) clang/include/clang/AST/ASTStructuralEquivalence.h (+2-1)
  • (modified) clang/include/clang/AST/ASTTypeTraits.h (+3-2)
  • (modified) clang/include/clang/AST/ASTUnresolvedSet.h (+2-1)
  • (modified) clang/include/clang/AST/Attr.h (+2-1)
  • (modified) clang/include/clang/AST/Availability.h (+2-1)
  • (modified) clang/include/clang/AST/CXXInheritance.h (+3-2)
  • (modified) clang/include/clang/AST/Comment.h (+7-6)
  • (modified) clang/include/clang/AST/CommentBriefParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentCommandTraits.h (+2-1)
  • (modified) clang/include/clang/AST/CommentLexer.h (+3-2)
  • (modified) clang/include/clang/AST/CommentParser.h (+2-1)
  • (modified) clang/include/clang/AST/CommentSema.h (+2-1)
  • (modified) clang/include/clang/AST/ComparisonCategories.h (+5-4)
  • (modified) clang/include/clang/AST/ComputeDependence.h (+86-85)
  • (modified) clang/include/clang/AST/DataCollection.h (+2-1)
  • (modified) clang/include/clang/AST/Decl.h (+35-34)
  • (modified) clang/include/clang/AST/DeclBase.h (+5-4)
  • (modified) clang/include/clang/AST/DeclCXX.h (+33-32)
  • (modified) clang/include/clang/AST/DeclContextInternals.h (+2-1)
  • (modified) clang/include/clang/AST/DeclFriend.h (+2-1)
  • (modified) clang/include/clang/AST/DeclGroup.h (+2-1)
  • (modified) clang/include/clang/AST/DeclID.h (+3-2)
  • (modified) clang/include/clang/AST/DeclObjC.h (+20-19)
  • (modified) clang/include/clang/AST/DeclOpenMP.h (+7-6)
  • (modified) clang/include/clang/AST/DeclTemplate.h (+25-24)
  • (modified) clang/include/clang/AST/DeclarationName.h (+7-6)
  • (modified) clang/include/clang/AST/DependentDiagnostic.h (+2-1)
  • (modified) clang/include/clang/AST/Expr.h (+40-39)
  • (modified) clang/include/clang/AST/ExprCXX.h (+44-43)
  • (modified) clang/include/clang/AST/ExprConcepts.h (+7-6)
  • (modified) clang/include/clang/AST/ExprObjC.h (+6-5)
  • (modified) clang/include/clang/AST/ExprOpenMP.h (+3-2)
  • (modified) clang/include/clang/AST/ExternalASTMerger.h (+2-1)
  • (modified) clang/include/clang/AST/ExternalASTSource.h (+2-1)
  • (modified) clang/include/clang/AST/FormatString.h (+13-12)
  • (modified) clang/include/clang/AST/JSONNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/LambdaCapture.h (+2-1)
  • (modified) clang/include/clang/AST/LocInfoType.h (+2-1)
  • (modified) clang/include/clang/AST/Mangle.h (+5-4)
  • (modified) clang/include/clang/AST/MangleNumberingContext.h (+2-1)
  • (modified) clang/include/clang/AST/NSAPI.h (+2-1)
  • (modified) clang/include/clang/AST/NestedNameSpecifier.h (+4-3)
  • (modified) clang/include/clang/AST/ODRDiagsEmitter.h (+2-1)
  • (modified) clang/include/clang/AST/ODRHash.h (+3-2)
  • (modified) clang/include/clang/AST/OSLog.h (+2-1)
  • (modified) clang/include/clang/AST/OpenACCClause.h (+34-33)
  • (modified) clang/include/clang/AST/OpenMPClause.h (+58-57)
  • (modified) clang/include/clang/AST/ParentMap.h (+2-1)
  • (modified) clang/include/clang/AST/ParentMapContext.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyDeclStackTrace.h (+2-1)
  • (modified) clang/include/clang/AST/PrettyPrinter.h (+2-1)
  • (modified) clang/include/clang/AST/QualTypeNames.h (+3-2)
  • (modified) clang/include/clang/AST/Randstruct.h (+2-1)
  • (modified) clang/include/clang/AST/RawCommentList.h (+3-2)
  • (modified) clang/include/clang/AST/RecordLayout.h (+2-1)
  • (modified) clang/include/clang/AST/Redeclarable.h (+2-1)
  • (modified) clang/include/clang/AST/SelectorLocationsKind.h (+5-4)
  • (modified) clang/include/clang/AST/Stmt.h (+22-21)
  • (modified) clang/include/clang/AST/StmtCXX.h (+5-4)
  • (modified) clang/include/clang/AST/StmtIterator.h (+2-1)
  • (modified) clang/include/clang/AST/StmtObjC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenACC.h (+3-2)
  • (modified) clang/include/clang/AST/StmtOpenMP.h (+80-79)
  • (modified) clang/include/clang/AST/TemplateBase.h (+7-6)
  • (modified) clang/include/clang/AST/TemplateName.h (+6-5)
  • (modified) clang/include/clang/AST/TextNodeDumper.h (+3-2)
  • (modified) clang/include/clang/AST/Type.h (+71-70)
  • (modified) clang/include/clang/AST/TypeLoc.h (+32-31)
  • (modified) clang/include/clang/AST/VTTBuilder.h (+2-1)
  • (modified) clang/include/clang/AST/VTableBuilder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchFinder.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+231-230)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchersInternal.h (+14-13)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h (+5-4)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Parser.h (+4-3)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/Registry.h (+3-2)
  • (modified) clang/include/clang/ASTMatchers/Dynamic/VariantValue.h (+6-5)
  • (modified) clang/include/clang/ASTMatchers/GtestMatchers.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/CalledOnceCheck.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/Consumed.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/Dominators.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/IntervalPartition.h (+6-5)
  • (modified) clang/include/clang/Analysis/Analyses/LiveVariables.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/PostOrderCFGView.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/ReachableCode.h (+4-3)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafety.h (+5-4)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyLogical.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (+9-8)
  • (modified) clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (+2-1)
  • (modified) clang/include/clang/Analysis/Analyses/UninitializedValues.h (+3-2)
  • (modified) clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h (+5-4)
  • (modified) clang/include/clang/Analysis/AnalysisDeclContext.h (+8-7)
  • (modified) clang/include/clang/Analysis/BodyFarm.h (+2-1)
  • (modified) clang/include/clang/Analysis/CFG.h (+7-6)
  • (modified) clang/include/clang/Analysis/CFGStmtMap.h (+2-1)
  • (modified) clang/include/clang/Analysis/CallGraph.h (+3-2)
  • (modified) clang/include/clang/Analysis/CloneDetection.h (+11-10)
  • (modified) clang/include/clang/Analysis/CodeInjector.h (+2-1)
  • (modified) clang/include/clang/Analysis/ConstructionContext.h (+4-3)
  • (modified) clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h (+5-4)
  • (modified) clang/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/ASTOps.h (+8-7)
  • (modified) clang/include/clang/Analysis/FlowSensitive/AdornedCFG.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Arena.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/CNFFormula.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/DebugSupport.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Formula.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Logger.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/RecordOps.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/SimplifyConstraints.h (+2-1)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Solver.h (+4-3)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Transfer.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/Value.h (+3-2)
  • (modified) clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h (+2-1)
  • (modified) clang/include/clang/Analysis/IssueHash.h (+3-2)
  • (modified) clang/include/clang/Analysis/MacroExpansionContext.h (+2-1)
  • (modified) clang/include/clang/Analysis/PathDiagnostic.h (+14-13)
  • (modified) clang/include/clang/Analysis/ProgramPoint.h (+4-3)
  • (modified) clang/include/clang/Analysis/RetainSummaryManager.h (+5-4)
  • (modified) clang/include/clang/Basic/ASTSourceDescriptor.h (+2-1)
  • (modified) clang/include/clang/Basic/AttrSubjectMatchRules.h (+2-1)
  • (modified) clang/include/clang/Basic/AttributeCommonInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/Attributes.h (+2-1)
  • (modified) clang/include/clang/Basic/Builtins.h (+4-3)
  • (modified) clang/include/clang/Basic/CLWarnings.h (+2-1)
  • (modified) clang/include/clang/Basic/CharInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/CodeGenOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/Cuda.h (+11-10)
  • (modified) clang/include/clang/Basic/DarwinSDKInfo.h (+4-3)
  • (modified) clang/include/clang/Basic/Diagnostic.h (+18-17)
  • (modified) clang/include/clang/Basic/DiagnosticError.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticIDs.h (+2-1)
  • (modified) clang/include/clang/Basic/DiagnosticOptions.h (+3-2)
  • (modified) clang/include/clang/Basic/ExpressionTraits.h (+3-2)
  • (modified) clang/include/clang/Basic/FileEntry.h (+2-1)
  • (modified) clang/include/clang/Basic/FileManager.h (+2-1)
  • (modified) clang/include/clang/Basic/FileSystemStatCache.h (+3-2)
  • (modified) clang/include/clang/Basic/IdentifierTable.h (+9-8)
  • (modified) clang/include/clang/Basic/LangOptions.h (+4-3)
  • (modified) clang/include/clang/Basic/LangStandard.h (+4-3)
  • (modified) clang/include/clang/Basic/MakeSupport.h (+2-1)
  • (modified) clang/include/clang/Basic/Module.h (+3-2)
  • (modified) clang/include/clang/Basic/NoSanitizeList.h (+2-1)
  • (modified) clang/include/clang/Basic/ObjCRuntime.h (+3-2)
  • (modified) clang/include/clang/Basic/OpenCLOptions.h (+2-1)
  • (modified) clang/include/clang/Basic/OpenMPKinds.h (+27-26)
  • (modified) clang/include/clang/Basic/OperatorKinds.h (+2-1)
  • (modified) clang/include/clang/Basic/OperatorPrecedence.h (+2-1)
  • (modified) clang/include/clang/Basic/ParsedAttrInfo.h (+3-2)
  • (modified) clang/include/clang/Basic/PrettyStackTrace.h (+2-1)
  • (modified) clang/include/clang/Basic/ProfileList.h (+2-1)
  • (modified) clang/include/clang/Basic/SanitizerSpecialCaseList.h (+2-1)
  • (modified) clang/include/clang/Basic/Sanitizers.h (+10-9)
  • (modified) clang/include/clang/Basic/Sarif.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceLocation.h (+5-4)
  • (modified) clang/include/clang/Basic/SourceManager.h (+6-5)
  • (modified) clang/include/clang/Basic/SourceManagerInternals.h (+2-1)
  • (modified) clang/include/clang/Basic/SourceMgrAdapter.h (+2-1)
  • (modified) clang/include/clang/Basic/Specifiers.h (+4-3)
  • (modified) clang/include/clang/Basic/Stack.h (+4-3)
  • (modified) clang/include/clang/Basic/SyncScope.h (+2-1)
  • (modified) clang/include/clang/Basic/TargetID.h (+7-6)
  • (modified) clang/include/clang/Basic/TargetInfo.h (+2-1)
  • (modified) clang/include/clang/Basic/TokenKinds.h (+7-6)
  • (modified) clang/include/clang/Basic/TypeTraits.h (+8-7)
  • (modified) clang/include/clang/Basic/Version.h (+10-9)
  • (modified) clang/include/clang/Basic/XRayInstr.h (+3-2)
  • (modified) clang/include/clang/Basic/XRayLists.h (+2-1)
  • (modified) clang/include/clang/CodeGen/BackendUtil.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CGFunctionInfo.h (+4-3)
  • (modified) clang/include/clang/CodeGen/CodeGenABITypes.h (+21-20)
  • (modified) clang/include/clang/CodeGen/CodeGenAction.h (+8-7)
  • (modified) clang/include/clang/CodeGen/ConstantInitBuilder.h (+5-4)
  • (modified) clang/include/clang/CodeGen/ConstantInitFuture.h (+2-1)
  • (modified) clang/include/clang/CodeGen/ModuleBuilder.h (+3-2)
  • (modified) clang/include/clang/CodeGen/ObjectFilePCHContainerWriter.h (+2-1)
  • (modified) clang/include/clang/CodeGen/SwiftCallingConv.h (+15-14)
  • (modified) clang/include/clang/CrossTU/CrossTranslationUnit.h (+9-8)
  • (modified) clang/include/clang/Driver/Action.h (+29-28)
  • (modified) clang/include/clang/Driver/Compilation.h (+2-1)
  • (modified) clang/include/clang/Driver/Distro.h (+2-1)
  • (modified) clang/include/clang/Driver/Driver.h (+8-7)
  • (modified) clang/include/clang/Driver/Job.h (+4-3)
  • (modified) clang/include/clang/Driver/Multilib.h (+5-4)
  • (modified) clang/include/clang/Driver/MultilibBuilder.h (+3-2)
  • (modified) clang/include/clang/Driver/OffloadBundler.h (+5-4)
  • (modified) clang/include/clang/Driver/OptionUtils.h (+3-2)
  • (modified) clang/include/clang/Driver/Options.h (+2-1)
  • (modified) clang/include/clang/Driver/Phases.h (+2-1)
  • (modified) clang/include/clang/Driver/SanitizerArgs.h (+2-1)
  • (modified) clang/include/clang/Driver/Tool.h (+2-1)
  • (modified) clang/include/clang/Driver/ToolChain.h (+2-1)
  • (modified) clang/include/clang/Driver/Types.h (+26-25)
  • (modified) clang/include/clang/Driver/XRayArgs.h (+2-1)
  • (modified) clang/include/clang/Edit/Commit.h (+3-2)
  • (modified) clang/include/clang/Edit/EditedSource.h (+2-1)
  • (modified) clang/include/clang/Edit/EditsReceiver.h (+2-1)
  • (modified) clang/include/clang/Edit/Rewriters.h (+4-3)
  • (modified) clang/include/clang/ExtractAPI/API.h (+36-35)
  • (modified) clang/include/clang/ExtractAPI/APIIgnoresList.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/DeclarationFragments.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/ExtractAPIActionBase.h (+2-1)
  • (modified) clang/include/clang/ExtractAPI/FrontendActions.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h (+3-2)
  • (modified) clang/include/clang/ExtractAPI/TypedefUnderlyingTypeResolver.h (+2-1)
  • (modified) clang/include/clang/Format/Format.h (+36-35)
  • (modified) clang/include/clang/Frontend/ASTConsumers.h (+5-4)
  • (modified) clang/include/clang/Frontend/ASTUnit.h (+4-3)
  • (modified) clang/include/clang/Frontend/ChainedDiagnosticConsumer.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInstance.h (+2-1)
  • (modified) clang/include/clang/Frontend/CompilerInvocation.h (+10-9)
  • (modified) clang/include/clang/Frontend/DiagnosticRenderer.h (+3-2)
  • (modified) clang/include/clang/Frontend/FrontendAction.h (+6-5)
  • (modified) clang/include/clang/Frontend/FrontendActions.h (+27-26)
  • (modified) clang/include/clang/Frontend/FrontendOptions.h (+2-1)
  • (modified) clang/include/clang/Frontend/LayoutOverrideSource.h (+2-1)
  • (modified) clang/include/clang/Frontend/LogDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/MultiplexConsumer.h (+3-2)
  • (modified) clang/include/clang/Frontend/PrecompiledPreamble.h (+7-6)
  • (modified) clang/include/clang/Frontend/SARIFDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/SARIFDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/SerializedDiagnosticReader.h (+4-3)
  • (modified) clang/include/clang/Frontend/TextDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticBuffer.h (+2-1)
  • (modified) clang/include/clang/Frontend/TextDiagnosticPrinter.h (+2-1)
  • (modified) clang/include/clang/Frontend/Utils.h (+10-9)
  • (modified) clang/include/clang/Frontend/VerifyDiagnosticConsumer.h (+3-2)
  • (modified) clang/include/clang/FrontendTool/Utils.h (+3-2)
  • (modified) clang/include/clang/Index/CommentToXML.h (+2-1)
  • (modified) clang/include/clang/Index/IndexSymbol.h (+13-12)
  • (modified) clang/include/clang/Index/IndexingAction.h (+8-7)
  • (modified) clang/include/clang/Index/USRGeneration.h (+17-16)
  • (modified) clang/include/clang/IndexSerialization/SerializablePathCollection.h (+4-3)
  • (modified) clang/include/clang/InstallAPI/Context.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/DirectoryScanner.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/DylibVerifier.h (+3-2)
  • (modified) clang/include/clang/InstallAPI/FileList.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Frontend.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/FrontendRecords.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/HeaderFile.h (+6-5)
  • (modified) clang/include/clang/InstallAPI/Library.h (+2-1)
  • (modified) clang/include/clang/InstallAPI/Visitor.h (+2-1)
  • (modified) clang/include/clang/Interpreter/CodeCompletion.h (+2-1)
  • (modified) clang/include/clang/Interpreter/Interpreter.h (+3-2)
  • (modified) clang/include/clang/Lex/CodeCompletionHandler.h (+2-1)
  • (modified) clang/include/clang/Lex/DependencyDirectivesScanner.h (+3-2)
  • (modified) clang/include/clang/Lex/DirectoryLookup.h (+3-2)
  • (modified) clang/include/clang/Lex/ExternalPreprocessorSource.h (+2-1)
  • (modified) clang/include/clang/Lex/HeaderMap.h (+3-2)
  • (modified) clang/include/clang/Lex/HeaderSearch.h (+5-4)
  • (modified) clang/include/clang/Lex/Lexer.h (+2-1)
  • (modified) clang/include/clang/Lex/LiteralSupport.h (+7-6)
  • (modified) clang/include/clang/Lex/MacroArgs.h (+2-1)
  • (modified) clang/include/clang/Lex/MacroInfo.h (+5-4)
  • (modified) clang/include/clang/Lex/ModuleLoader.h (+2-1)
  • (modified) clang/include/clang/Lex/ModuleMap.h (+3-2)
  • (modified) clang/include/clang/Lex/PPCallbacks.h (+3-2)
  • (modified) clang/include/clang/Lex/PPConditionalDirectiveRecord.h (+2-1)
  • (modified) clang/include/clang/Lex/Pragma.h (+5-4)
  • (modified) clang/include/clang/Lex/PreprocessingRecord.h (+5-4)
  • (modified) clang/include/clang/Lex/Preprocessor.h (+4-3)
  • (modified) clang/include/clang/Lex/PreprocessorLexer.h (+2-1)
  • (modified) clang/include/clang/Lex/ScratchBuffer.h (+2-1)
  • (modified) clang/include/clang/Lex/Token.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenConcatenation.h (+2-1)
  • (modified) clang/include/clang/Lex/TokenLexer.h (+2-1)
  • (modified) clang/include/clang/Parse/ParseAST.h (+3-2)
  • (modified) clang/include/clang/Parse/Parser.h (+13-12)
  • (modified) clang/include/clang/Parse/RAIIObjectsForParser.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/HTMLRewrite.h (+10-9)
  • (modified) clang/include/clang/Rewrite/Core/Rewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Core/TokenRewriter.h (+2-1)
  • (modified) clang/include/clang/Rewrite/Frontend/ASTConsumers.h (+4-3)
  • (modified) clang/include/clang/Rewrite/Frontend/FixItRewriter.h (+3-2)
  • (modified) clang/include/clang/Rewrite/Frontend/FrontendActions.h (+8-7)
  • (modified) clang/include/clang/Rewrite/Frontend/Rewriters.h (+4-3)
  • (modified) clang/include/clang/Sema/AnalysisBasedWarnings.h (+3-2)
  • (modified) clang/include/clang/Sema/CodeCompleteConsumer.h (+20-19)
  • (modified) clang/include/clang/Sema/DeclSpec.h (+7-6)
  • (modified) clang/include/clang/Sema/DelayedDiagnostic.h (+2-1)
  • (modified) clang/include/clang/Sema/ExternalSemaSource.h (+2-1)
diff --git a/clang/include/clang/APINotes/APINotesManager.h b/clang/include/clang/APINotes/APINotesManager.h
index 98592438e90eab..05d7930d3a2e7f 100644
--- a/clang/include/clang/APINotes/APINotesManager.h
+++ b/clang/include/clang/APINotes/APINotesManager.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_APINOTESMANAGER_H
 
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
@@ -41,7 +42,7 @@ class APINotesReader;
 /// external API notes files that correspond to a given header. Its primary
 /// operation is \c findAPINotes(), which finds the API notes reader that
 /// provides information about the declarations at that location.
-class APINotesManager {
+class CLANG_ABI APINotesManager {
   using ReaderEntry = llvm::PointerUnion<DirectoryEntryRef, APINotesReader *>;
 
   SourceManager &SM;
diff --git a/clang/include/clang/APINotes/APINotesReader.h b/clang/include/clang/APINotes/APINotesReader.h
index baf63340640242..58ee2857c7930f 100644
--- a/clang/include/clang/APINotes/APINotesReader.h
+++ b/clang/include/clang/APINotes/APINotesReader.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_READER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/VersionTuple.h"
 #include <memory>
@@ -25,7 +26,7 @@ namespace api_notes {
 
 /// A class that reads API notes data from a binary file that was written by
 /// the \c APINotesWriter.
-class APINotesReader {
+class CLANG_ABI APINotesReader {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesWriter.h b/clang/include/clang/APINotes/APINotesWriter.h
index 3cc16c3d959faf..b8b45a89dcfc8b 100644
--- a/clang/include/clang/APINotes/APINotesWriter.h
+++ b/clang/include/clang/APINotes/APINotesWriter.h
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_APINOTES_WRITER_H
 
 #include "clang/APINotes/Types.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/Support/raw_ostream.h"
@@ -29,7 +30,7 @@ namespace api_notes {
 
 /// A class that writes API notes data to a binary representation that can be
 /// read by the \c APINotesReader.
-class APINotesWriter {
+class CLANG_ABI APINotesWriter {
   class Implementation;
   std::unique_ptr<Implementation> Implementation;
 
diff --git a/clang/include/clang/APINotes/APINotesYAMLCompiler.h b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
index 9c24ed85b6a124..3954cf347e8244 100644
--- a/clang/include/clang/APINotes/APINotesYAMLCompiler.h
+++ b/clang/include/clang/APINotes/APINotesYAMLCompiler.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 #define LLVM_CLANG_APINOTES_APINOTESYAMLCOMPILER_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
@@ -22,10 +23,10 @@ namespace api_notes {
 /// Parses the APINotes YAML content and writes the representation back to the
 /// specified stream.  This provides a means of testing the YAML processing of
 /// the APINotes format.
-bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
+CLANG_ABI bool parseAndDumpAPINotes(llvm::StringRef YI, llvm::raw_ostream &OS);
 
 /// Converts API notes from YAML format to binary format.
-bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
+CLANG_ABI bool compileAPINotes(llvm::StringRef YAMLInput, const FileEntry *SourceFile,
                      llvm::raw_ostream &OS,
                      llvm::SourceMgr::DiagHandlerTy DiagHandler = nullptr,
                      void *DiagHandlerCtxt = nullptr);
diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index 89889910d1a073..574406586c4674 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -10,6 +10,7 @@
 #define LLVM_CLANG_APINOTES_TYPES_H
 
 #include "clang/Basic/Specifiers.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include <climits>
@@ -49,7 +50,7 @@ enum class SwiftNewTypeKind {
 /// Describes API notes data for any entity.
 ///
 /// This is used as the base of all API notes.
-class CommonEntityInfo {
+class CLANG_ABI CommonEntityInfo {
 public:
   /// Message to use when this entity is unavailable.
   std::string UnavailableMsg;
@@ -132,7 +133,7 @@ inline bool operator!=(const CommonEntityInfo &LHS,
 }
 
 /// Describes API notes for types.
-class CommonTypeInfo : public CommonEntityInfo {
+class CLANG_ABI CommonTypeInfo : public CommonEntityInfo {
   /// The Swift type to which a given type is bridged.
   ///
   /// Reflects the swift_bridge attribute.
@@ -194,7 +195,7 @@ inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
 
 /// Describes API notes data for an Objective-C class or protocol or a C++
 /// namespace.
-class ContextInfo : public CommonTypeInfo {
+class CLANG_ABI ContextInfo : public CommonTypeInfo {
   /// Whether this class has a default nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasDefaultNullability : 1;
@@ -301,7 +302,7 @@ inline bool operator!=(const ContextInfo &LHS, const ContextInfo &RHS) {
 }
 
 /// API notes for a variable/property.
-class VariableInfo : public CommonEntityInfo {
+class CLANG_ABI VariableInfo : public CommonEntityInfo {
   /// Whether this property has been audited for nullability.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NullabilityAudited : 1;
@@ -358,7 +359,7 @@ inline bool operator!=(const VariableInfo &LHS, const VariableInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C property.
-class ObjCPropertyInfo : public VariableInfo {
+class CLANG_ABI ObjCPropertyInfo : public VariableInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned SwiftImportAsAccessorsSpecified : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -416,7 +417,7 @@ inline bool operator!=(const ObjCPropertyInfo &LHS,
 }
 
 /// Describes a function or method parameter.
-class ParamInfo : public VariableInfo {
+class CLANG_ABI ParamInfo : public VariableInfo {
   /// Whether noescape was specified.
   LLVM_PREFERRED_TYPE(bool)
   unsigned NoEscapeSpecified : 1;
@@ -486,7 +487,7 @@ inline bool operator!=(const ParamInfo &LHS, const ParamInfo &RHS) {
 }
 
 /// API notes for a function or method.
-class FunctionInfo : public CommonEntityInfo {
+class CLANG_ABI FunctionInfo : public CommonEntityInfo {
 private:
   static constexpr const uint64_t NullabilityKindMask = 0x3;
   static constexpr const unsigned NullabilityKindSize = 2;
@@ -606,7 +607,7 @@ inline bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS) {
 }
 
 /// Describes API notes data for an Objective-C method.
-class ObjCMethodInfo : public FunctionInfo {
+class CLANG_ABI ObjCMethodInfo : public FunctionInfo {
 public:
   /// Whether this is a designated initializer of its class.
   LLVM_PREFERRED_TYPE(bool)
@@ -675,7 +676,7 @@ class EnumConstantInfo : public CommonEntityInfo {
 };
 
 /// Describes API notes data for a tag.
-class TagInfo : public CommonTypeInfo {
+class CLANG_ABI TagInfo : public CommonTypeInfo {
   LLVM_PREFERRED_TYPE(bool)
   unsigned HasFlagEnum : 1;
   LLVM_PREFERRED_TYPE(bool)
@@ -765,7 +766,7 @@ inline bool operator!=(const TagInfo &LHS, const TagInfo &RHS) {
 }
 
 /// Describes API notes data for a typedef.
-class TypedefInfo : public CommonTypeInfo {
+class CLANG_ABI TypedefInfo : public CommonTypeInfo {
 public:
   std::optional<SwiftNewTypeKind> SwiftWrapper;
 
diff --git a/clang/include/clang/ARCMigrate/ARCMT.h b/clang/include/clang/ARCMigrate/ARCMT.h
index 2b950e3d2cc2bf..dc078101e371ff 100644
--- a/clang/include/clang/ARCMigrate/ARCMT.h
+++ b/clang/include/clang/ARCMigrate/ARCMT.h
@@ -12,6 +12,7 @@
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Frontend/CompilerInvocation.h"
+#include "clang/Support/Compiler.h"
 
 namespace clang {
   class ASTContext;
@@ -37,7 +38,7 @@ namespace arcmt {
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
                      DiagnosticConsumer *DiagClient,
@@ -48,7 +49,7 @@ checkForManualIssues(CompilerInvocation &CI, const FrontendInputFile &Input,
 /// applies automatic modifications to source files to conform to ARC.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool
+CLANG_ABI bool
 applyTransformations(CompilerInvocation &origCI,
                      const FrontendInputFile &Input,
                      std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -65,7 +66,7 @@ applyTransformations(CompilerInvocation &origCI,
 /// the pre-migration ARC diagnostics.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool migrateWithTemporaryFiles(
+CLANG_ABI bool migrateWithTemporaryFiles(
     CompilerInvocation &origCI, const FrontendInputFile &Input,
     std::shared_ptr<PCHContainerOperations> PCHContainerOps,
     DiagnosticConsumer *DiagClient, StringRef outputDir,
@@ -75,7 +76,7 @@ bool migrateWithTemporaryFiles(
 /// migrateWithTemporaryFiles produced.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
+CLANG_ABI bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
                        StringRef outputDir,
                        DiagnosticConsumer *DiagClient);
 
@@ -83,17 +84,17 @@ bool getFileRemappings(std::vector<std::pair<std::string,std::string> > &remap,
 /// info.
 ///
 /// \returns false if no error is produced, true otherwise.
-bool getFileRemappingsFromFileList(
+CLANG_ABI bool getFileRemappingsFromFileList(
                         std::vector<std::pair<std::string,std::string> > &remap,
                         ArrayRef<StringRef> remapFiles,
                         DiagnosticConsumer *DiagClient);
 
 typedef void (*TransformFn)(MigrationPass &pass);
 
-std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
+CLANG_ABI std::vector<TransformFn> getAllTransformations(LangOptions::GCMode OrigGCMode,
                                                bool NoFinalizeRemoval);
 
-class MigrationProcess {
+class CLANG_ABI MigrationProcess {
   CompilerInvocation OrigCI;
   std::shared_ptr<PCHContainerOperations> PCHContainerOps;
   DiagnosticConsumer *DiagClient;
@@ -107,7 +108,7 @@ class MigrationProcess {
                    DiagnosticConsumer *diagClient,
                    StringRef outputDir = StringRef());
 
-  class RewriteListener {
+  class CLANG_ABI RewriteListener {
   public:
     virtual ~RewriteListener();
 
diff --git a/clang/include/clang/ARCMigrate/ARCMTActions.h b/clang/include/clang/ARCMigrate/ARCMTActions.h
index 714f4b33db446b..50c6142078f5c8 100644
--- a/clang/include/clang/ARCMigrate/ARCMTActions.h
+++ b/clang/include/clang/ARCMigrate/ARCMTActions.h
@@ -11,12 +11,13 @@
 
 #include "clang/ARCMigrate/FileRemapper.h"
 #include "clang/Frontend/FrontendAction.h"
+#include "clang/Support/Compiler.h"
 #include <memory>
 
 namespace clang {
 namespace arcmt {
 
-class CheckAction : public WrapperFrontendAction {
+class CLANG_ABI CheckAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -24,7 +25,7 @@ class CheckAction : public WrapperFrontendAction {
   CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class ModifyAction : public WrapperFrontendAction {
+class CLANG_ABI ModifyAction : public WrapperFrontendAction {
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
 
@@ -32,7 +33,7 @@ class ModifyAction : public WrapperFrontendAction {
   ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
 };
 
-class MigrateSourceAction : public ASTFrontendAction {
+class CLANG_ABI MigrateSourceAction : public ASTFrontendAction {
   FileRemapper Remapper;
 protected:
   bool BeginInvocation(CompilerInstance &CI) override;
@@ -40,7 +41,7 @@ class MigrateSourceAction : public ASTFrontendAction {
                                                  StringRef InFile) override;
 };
 
-class MigrateAction : public WrapperFrontendAction {
+class CLANG_ABI MigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   std::string PlistOut;
   bool EmitPremigrationARCErrors;
@@ -55,7 +56,7 @@ class MigrateAction : public WrapperFrontendAction {
 };
 
 /// Migrates to modern ObjC syntax.
-class ObjCMigrateAction : public WrapperFrontendAction {
+class CLANG_ABI ObjCMigrateAction : public WrapperFrontendAction {
   std::string MigrateDir;
   unsigned    ObjCMigAction;
   FileRemapper Remapper;
diff --git a/clang/include/clang/ARCMigrate/FileRemapper.h b/clang/include/clang/ARCMigrate/FileRemapper.h
index afcee363516a21..3c9f706a75cf38 100644
--- a/clang/include/clang/ARCMigrate/FileRemapper.h
+++ b/clang/include/clang/ARCMigrate/FileRemapper.h
@@ -11,6 +11,7 @@
 
 #include "clang/Basic/FileEntry.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
@@ -29,7 +30,7 @@ namespace clang {
 
 namespace arcmt {
 
-class FileRemapper {
+class CLANG_ABI FileRemapper {
   // FIXME: Reuse the same FileManager for multiple ASTContexts.
   std::unique_ptr<FileManager> FileMgr;
 
diff --git a/clang/include/clang/AST/APNumericStorage.h b/clang/include/clang/AST/APNumericStorage.h
index 95eddbcd86e839..ae634d46dfea2b 100644
--- a/clang/include/clang/AST/APNumericStorage.h
+++ b/clang/include/clang/AST/APNumericStorage.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_CLANG_AST_APNUMERICSTORAGE_H
 #define LLVM_CLANG_AST_APNUMERICSTORAGE_H
 
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 
@@ -23,7 +24,7 @@ class ASTContext;
 /// to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
 /// the APFloat/APInt values will never get freed. APNumericStorage uses
 /// ASTContext's allocator for memory allocation.
-class APNumericStorage {
+class CLANG_ABI APNumericStorage {
   union {
     uint64_t VAL;   ///< Used to store the <= 64 bits integer value.
     uint64_t *pVal; ///< Used to store the >64 bits integer value.
diff --git a/clang/include/clang/AST/APValue.h b/clang/include/clang/AST/APValue.h
index c4206b73b11562..fc6baf92a90202 100644
--- a/clang/include/clang/AST/APValue.h
+++ b/clang/include/clang/AST/APValue.h
@@ -14,6 +14,7 @@
 #define LLVM_CLANG_AST_APVALUE_H
 
 #include "clang/Basic/LLVM.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/APFixedPoint.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
@@ -41,7 +42,7 @@ template <typename T> class BasicReaderBase;
   class QualType;
 
 /// Symbolic representation of typeid(T) for some type T.
-class TypeInfoLValue {
+class CLANG_ABI TypeInfoLValue {
   const Type *T;
 
 public:
@@ -119,7 +120,7 @@ namespace clang {
 /// APValue - This class implements a discriminated union of [uninitialized]
 /// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
 /// [Vector: N * APValue], [Array: N * APValue]
-class APValue {
+class CLANG_ABI APValue {
   typedef llvm::APFixedPoint APFixedPoint;
   typedef llvm::APSInt APSInt;
   typedef llvm::APFloat APFloat;
@@ -143,7 +144,7 @@ class APValue {
     AddrLabelDiff
   };
 
-  class LValueBase {
+  class CLANG_ABI LValueBase {
     typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                                DynamicAllocLValue>
         PtrTy;
@@ -179,11 +180,11 @@ class APValue {
 
     QualType getType() const;
 
-    friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
+    friend CLANG_ABI bool operator==(const LValueBase &LHS, const LValueBase &RHS);
     friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
       return !(LHS == RHS);
     }
-    friend llvm::hash_code hash_value(const LValueBase &Base);
+    friend CLANG_ABI llvm::hash_code hash_value(const LValueBase &Base);
     friend struct llvm::DenseMapInfo<LValueBase>;
 
   private:
@@ -205,7 +206,7 @@ class APValue {
   typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
 
   /// A non-discriminated union of a base, field, or array index.
-  class LValuePathEntry {
+  class CLANG_ABI LValuePathEntry {
     static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
                   "pointer doesn't fit in 64 bits?");
     uint64_t Value;
@@ -237,7 +238,7 @@ class APValue {
       return llvm::hash_value(A.Value);
     }
   };
-  class LValuePathSerializationHelper {
+  class CLANG_ABI LValuePathSerializationHelper {
     const void *Ty;
 
   public:
@@ -274,7 +275,7 @@ class APValue {
     Vec &operator=(const Vec &) = delete;
     ~Vec() { delete[] Elts; }
   };
-  struct Arr {
+  struct CLANG_ABI Arr {
     APValue *Elts;
     unsigned NumElts, ArrSize;
     Arr(unsigned NumElts, unsigned ArrSize);
@@ -282,7 +283,7 @@ class APValue {
     Arr &operator=(const Arr &) = delete;
     ~Arr();
   };
-  struct StructData {
+  struct CLANG_ABI StructData {
     APValue *Elts;
     unsigned NumBases;
     unsigned NumFields;
@@ -291,7 +292,7 @@ class APValue {
     StructData &operator=(const StructData &) = delete;
     ~StructData();
   };
-  struct UnionData {
+  struct CLANG_ABI UnionData {
     const FieldDecl *Field;
     APValue *Value;
     UnionData();
@@ -702,7 +703,7 @@ class APValue {
 } // end namespace clang.
 
 namespace llvm {
-template<> struct DenseMapInfo<clang::APValue::LValueBase> {
+template<> struct CLANG_ABI DenseMapInfo<clang::APValue::LValueBase> {
   static clang::APValue::LValueBase getEmptyKey();
   static clang::APValue::LValueBase getTombstoneKey();
   static unsigned getHashValue(const clang::APValue::LValueBase &Base);
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index 00500e214f4ce6..59b0a8e9d96a9d 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -18,6 +18,7 @@
 #include "clang/AST/NestedNameSpecifier.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Support/Compiler.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
@@ -32,7 +33,7 @@ struct PrintingPolicy;
 
 /// The result of a constraint satisfaction check, containing the necessary
 /// information to diagnose an unsatisfied constraint.
-class ConstraintSatisfaction : public llvm::FoldingSetNode {
+class CLANG_ABI ConstraintSatisfaction : public llvm::FoldingSetNode {
   // The template-like entity that 'owns' the constraint checked here (can be a
   // constrained entity or a concept).
   const NamedDecl *ConstraintOwner = nullptr;
@@ -84,7 +85,7 @@ using UnsatisfiedConstraintRecord =
 /// necessary information to diagnose an unsatisfied constraint.
 ///
 /// This is safe to store in an AST node, as opposed to ConstraintSatisfaction.
-struct ASTConstraintSatisfaction final :
+struct CLANG_ABI ASTConstraintSatisfaction final :
     llvm::TrailingObjects<ASTConstraintSatisfaction,
                           UnsatisfiedConstraintRecord> {
   std::size_t NumRecords;
@@ -121,7 +122,7 @@ struct ASTConstraintSatisfaction final :
 ///
 ///   template <std::derives_from<Expr> T> void dump();
 ///             ~~~~~~~~~~~~~~~~~~~~~~~ (in TemplateTypeParmDecl)
-class ConceptReference {
+class CLANG_ABI ConceptReference {
   // \brief The optional nested name specifier used when naming the concept.
   NestedNameSpecifierLoc NestedNameSpec;
 
diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h
index 447f2592d23595..735c7e549f5cac 100644
--- a/clang/include/clang/AST/ASTConsumer.h
+++ b/clang/include/clang/AST/ASTConsumer.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CLANG_AST_ASTCONSUMER_H
 #define LLVM_CLANG_AST_ASTCONSUMER_H
 
+#include "clang/Support/Compiler.h"
 namespace clang {
   class ASTContext;
   class CXXMethodDecl;
@@ -31,7 +32,7 @@ namespace clang {
 /// ASTCons...
[truncated]

@fsfod
Copy link
Contributor Author

fsfod commented Oct 2, 2024

Processing just header is also much faster than a full build and I think it would only have to run on changed headers and source files for a PR.

@fsfod fsfod force-pushed the exported-api/generated-macros-clang branch from bdad289 to 22b9f80 Compare October 14, 2024 18:47
@vgvassilev
Copy link
Contributor

Processing just header is also much faster than a full build and I think it would only have to run on changed headers and source files for a PR.

Any ideas how to implement that check? If we have a draft implementation we can check with the the ci folks how to deploy it...

@fsfod fsfod marked this pull request as ready for review October 16, 2024 15:07
@llvmbot llvmbot added the ClangIR Anything related to the ClangIR project label Oct 16, 2024
@vgvassilev
Copy link
Contributor

@efriedma-quic, @rnk, @compnerd, @AaronBallman can we make another round of review here?

@efriedma-quic
Copy link
Collaborator

I'd like some answer about how we plan to ensure the macros remain correct. Short-term, "someone periodically runs the tool manually" might be good enough if we don't expect much churn, I guess.

Also, can the tool itself be added to llvm-project?

(The actual changes seem fine at first glance, but I haven't tried to dive deep into the specifics of what exact symbols get exported as a result of the macros.)

@fsfod
Copy link
Contributor Author

fsfod commented Oct 24, 2024

I'd like some answer about how we plan to ensure the macros remain correct. Short-term, "someone periodically runs the tool manually" might be good enough if we don't expect much churn, I guess.

Missing macros on some classes or functions shouldn't break any existing configurations or platforms while default symbol visibility is still left as public.

Also, can the tool itself be added to llvm-project?

This is something i have been wondering about it wouldn't mind it being added, I just wasn't sure if it was too niche or not. I don't know if that was part of @compnerd original goal when he wrote it, I think he still on holiday atm.

@tstellar
Copy link
Collaborator

Is there any reason why the tool should be in the monorepo and not some other repository?

Also, as for keeping the annotations up-to-date. My recommendation is to add a github action job that runs the ids tool and then submits a pull request for any necessary changes. We could run it automatically once a day to start.

@compnerd
Copy link
Member

compnerd commented Nov 4, 2024

pre-commit actions are expensive, but I think we could afford to do something here. It is not hard to set up a DLL build of an ELF DSO build that uses these annotations, and it's cheaper than a fully static build.

Having a fast incremental build for DLL-enabled LLVM/clang/lld/lldb on Windows would be very useful. It should be "cheaper" than a fully static build as you point out and would ensure that this configuration doesn't regress.

I'd like some answer about how we plan to ensure the macros remain correct.

The default behaviour of ids is to assume that anything declared in the header is public and it will ensure that anything added in the headers is annotated properly to say it is exposed, making something private would be an explicit decision that the developer need to take.

Also, can the tool itself be added to llvm-project?

I've no objection to merging it into llvm-project, I had designed it to be generic enough that it could actually be vended as a useful tool from the LLVM distribution (it is in some ways an adjunct to the llvm-ifs tool that @plotfi and I had worked on in the past).

@vgvassilev
Copy link
Contributor

A gentle ping on reviewing.

@AaronBallman
Copy link
Collaborator

The default behaviour of ids is to assume that anything declared in the header is public and it will ensure that anything added in the headers is annotated properly to say it is exposed, making something private would be an explicit decision that the developer need to take.

Is this the correct default though? It seems to me that usual best practices is to limit the visibility unless there's an opt in saying something is public (aka, the class model in C++ rather than the struct model which is rooted in C compatibility). I would have thought we'd do an initial pass to make everything public that needs to be public, and then require explicit opt-in rather than explicit opt-out, mostly because anything we list as being opted in is something someone, somewhere is likely to take as a promise that we'll always support it because it's part of the public interface.

From what I'm seeing on the PR, it sounds like most of the outstanding concerns are around how to keep these annotations up to date. There have been a few requests for something like precommit CI or a github action. I think we should try to come to a decision on what we feel comfortable with there. (I tend to lean on the side of a github action that's run once a day as suggested by @tstellar

@compnerd
Copy link
Member

compnerd commented Nov 25, 2024

The default behaviour of ids is to assume that anything declared in the header is public and it will ensure that anything added in the headers is annotated properly to say it is exposed, making something private would be an explicit decision that the developer need to take.

Is this the correct default though? It seems to me that usual best practices is to limit the visibility unless there's an opt in saying something is public (aka, the class model in C++ rather than the struct model which is rooted in C compatibility). I would have thought we'd do an initial pass to make everything public that needs to be public, and then require explicit opt-in rather than explicit opt-out, mostly because anything we list as being opted in is something someone, somewhere is likely to take as a promise that we'll always support it because it's part of the public interface.

I can absolutely see the value in the opposite - minimise the ABI surface. For many projects, there is a split of internal and external headers. The idea is that this tool is only run on the external headers, so those are meant to be ABI.

While the idea of making everything private and requiring opt-in to make it public is enticing, I don't see how to verify that the ABI surface is correct/complete. If we were to do that, then the default behaviour would require iteration until the minimal bounds is determined which would be frustrating for the developer as you might require O(function) iterations. On the other hand, it does help with ABI stability because additions to the ABI surface are okay, removal is not permitted for stability (Hyrum's Law).

From what I'm seeing on the PR, it sounds like most of the outstanding concerns are around how to keep these annotations up to date. There have been a few requests for something like precommit CI or a github action. I think we should try to come to a decision on what we feel comfortable with there. (I tend to lean on the side of a github action that's run once a day as suggested by @tstellar

I agree that a GHA workflow would work for this. However, if/when we are able to get a Windows DLL build stood up, that would also likely be less interesting as that would immediately catch any regressions. Furthermore, I expect that once this work is fully complete, we should be able to switch to -fvisbility=hidden -fvisbility-inlines-hidden which would also provide a pretty good overlap on Linux and macOS builds. The remaining uncaught differences would be platform specific due to ABI specific constraints (e.g. RTTI representation and vtable layouts).

Note that this doesn't mean that I'm against the GHA - quite the opposite. I think that is a good solution and will help bridge us to the point where we can rely on regular iteration to identify these issues more quickly.

@fsfod
Copy link
Contributor Author

fsfod commented Nov 25, 2024

I can absolutely see the value in the opposite - minimise the ABI surface. For many projects, there is a split of internal and external headers. The idea is that this tool is only run on the external headers, so those are meant to be ABI.

There were multiple internals headers I had to annotate because tests were using there API.

@compnerd
Copy link
Member

I can absolutely see the value in the opposite - minimise the ABI surface. For many projects, there is a split of internal and external headers. The idea is that this tool is only run on the external headers, so those are meant to be ABI.

There were multiple internals headers I had to annotate because tests were using there API.

Right, if there are internal headers, the developer can make the call on those, but you should use a different annotation for those as they are not meant to be public ABI. If they are included under debug or some other condition that is not present on production builds, that should be fine, but otherwise, we are extending the public ABI surface of the library.

@AaronBallman
Copy link
Collaborator

The default behaviour of ids is to assume that anything declared in the header is public and it will ensure that anything added in the headers is annotated properly to say it is exposed, making something private would be an explicit decision that the developer need to take.

Is this the correct default though? It seems to me that usual best practices is to limit the visibility unless there's an opt in saying something is public (aka, the class model in C++ rather than the struct model which is rooted in C compatibility). I would have thought we'd do an initial pass to make everything public that needs to be public, and then require explicit opt-in rather than explicit opt-out, mostly because anything we list as being opted in is something someone, somewhere is likely to take as a promise that we'll always support it because it's part of the public interface.

I can absolutely see the value in the opposite - minimise the ABI surface. For many projects, there is a split of internal and external headers. The idea is that this tool is only run on the external headers, so those are meant to be ABI.

While the idea of making everything private and requiring opt-in to make it public is enticing, I don't see how to verify that the ABI surface is correct/complete. If we were to do that, then the default behaviour would require iteration until the minimal bounds is determined which would be frustrating for the developer as you might require O(function) iterations.

Well, we're currently approaching this from the angle of "expose everything and then the user can do whatever they want", but perhaps the discussion we should be having is "what use cases do we explicitly want to support?" and then we write plugins to demonstrate that we do support those use cases, exposing what's necessary as part of that process. This does mean that use cases we hadn't anticipated may be frustrating for users, but we can more easily expand the surface area of what we expose than we can claw it back once we've exposed it publicly.

But that does mean a lot more up front work on our part.

(Note, I don't insist on this, just having the discussion to see where the ideas lead.)

On the other hand, it does help with ABI stability because additions to the ABI surface are okay, removal is not permitted for stability (Hyrum's Law).

Exactly; and I worry about the long-term maintenance impacts of exposing everything.

From what I'm seeing on the PR, it sounds like most of the outstanding concerns are around how to keep these annotations up to date. There have been a few requests for something like precommit CI or a github action. I think we should try to come to a decision on what we feel comfortable with there. (I tend to lean on the side of a github action that's run once a day as suggested by @tstellar

I agree that a GHA workflow would work for this. However, if/when we are able to get a Windows DLL build stood up, that would also likely be less interesting as that would immediately catch any regressions. Furthermore, I expect that once this work is fully complete, we should be able to switch to -fvisbility=hidden -fvisbility-inlines-hidden which would also provide a pretty good overlap on Linux and macOS builds. The remaining uncaught differences would be platform specific due to ABI specific constraints (e.g. RTTI representation and vtable layouts).

Note that this doesn't mean that I'm against the GHA - quite the opposite. I think that is a good solution and will help bridge us to the point where we can rely on regular iteration to identify these issues more quickly.

+1

@compnerd
Copy link
Member

Well, we're currently approaching this from the angle of "expose everything and then the user can do whatever they want", but perhaps the discussion we should be having is "what use cases do we explicitly want to support?" and then we write plugins to demonstrate that we do support those use cases, exposing what's necessary as part of that process. This does mean that use cases we hadn't anticipated may be frustrating for users, but we can more easily expand the surface area of what we expose than we can claw it back once we've exposed it publicly.

Ah, so ... this is interesting. There are two separate "competing" goals here. The GSoC project was about enabling clang plugins. My goal has always been different (which I've clearly articulated on discourse).

My motivation is supporting a DLL build of LLVM, clang, LLDB. The idea is to reduce the size of the toolchain distribution by using dynamic linking of LLVM and sharing the code rather than statically linking all libraries. This also then opens up a second opportunity for only doing PGO/LTO/BOLT on a single DLL that can be shared across all the tools. The hope is to actually allow page sharing and reduce memory pressure, reduce load times on Windows (because the libraries are paged in and mapped), and reduce the toolchain size.

An ideal scenario in my mind is that we are able to create the following DLLs:

  1. LLVMSupport.dll
  2. LLVM.dll
  3. clang.dll
  4. LLDB.dll (which potentially already exists as liblldb.dll)

clang and the binary tools would depend on LLVM.dll. The clang tools could depend on LLVM and clang DLLs.

This would of course allow us to minimise the exported interface to what clang and the binary tools need.

@rnk
Copy link
Collaborator

rnk commented Nov 27, 2024

I think it makes sense to focus on Saleem's use case, which, perhaps to translate it into Posix-ecosystem terms, is to create a single Clang DSO (similar to llvm-dylib or whatever we call it) that all the affiliated monorepo Clang tools use (clang-tidy, clang-rename, clang-format, clang-scan-deps, LLDB, whatever you like). That requires annotating private APIs that are not for out of tree users as being exported, which matches the status quo of linking the Clang tools statically. We don't want there to be too much divergence between the static and dynamic builds of these Clang tools, so that's going to require spraying these annotations fairly widely without implying that they are publicly facing stable APIs.

I believe this is something that Linux distributions have wanted for a long time, and something they struggle with currently. Maybe Tom @tstellar could give us some additional perspective on their goals and requirements.

@tstellar
Copy link
Collaborator

Well, we're currently approaching this from the angle of "expose everything and then the user can do whatever they want", but perhaps the discussion we should be having is "what use cases do we explicitly want to support?" and then we write plugins to demonstrate that we do support those use cases, exposing what's necessary as part of that process. This does mean that use cases we hadn't anticipated may be frustrating for users, but we can more easily expand the surface area of what we expose than we can claw it back once we've exposed it publicly.

I think long-term we should be having discussion about just how much of the API we want to explicitly support. This would help make porting apps to a new version easier and it would make it easier to backport fixes to stable releases.

For now, though, I think it makes sense to just annotate all the existing public APIs as a starting point and then we can have follow on discussions later about any APIs to make private.

But this before we do that, we need to have some kind of mechanism in place so we can actually enumerate the AP However, we already expose everything in the API, and just adding the annotations doesn't change that (although I think it may slightly reduce the number of symbols we export

@compnerd
Copy link
Member

compnerd commented Dec 4, 2024

But this before we do that, we need to have some kind of mechanism in place so we can actually enumerate the AP However, we already expose everything in the API, and just adding the annotations doesn't change that (although I think it may slightly reduce the number of symbols we export

I think that this is quite accurate. The overall exported symbol count should be reduced with the desired changes as we would default to hidden visibility and then restore the symbols that are needed.

@AaronBallman
Copy link
Collaborator

Okay, I'm convinced that we should start by marking all APIs as public first and then figure out what to make private later. It's logically backwards (easier to expose things than it is to claw things back), but it's also solving a real need and is more actionable than trying to determine use cases up front.

So once the merge conflicts are fixed, this LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 backend:AMDGPU backend:ARM backend:Hexagon backend:loongarch backend:PowerPC backend:RISC-V backend:SystemZ backend:WebAssembly backend:X86 clang:analysis clang:codegen IR generation bugs: mangling, exceptions, etc. clang:dataflow Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:modules C++20 modules and Clang Header Modules clang:openmp OpenMP related changes to Clang clang:static analyzer clang Clang issues not falling into any other category clang-format ClangIR Anything related to the ClangIR project HLSL HLSL Language Support xray
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

10 participants