diff options
author | Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> | 2024-05-30 19:59:59 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 19:59:59 +0400 |
commit | ed35a92c404650b15a79ff38bcaff41de176cb78 (patch) | |
tree | fcf0585c3659ce41e6c6efb78f2c52e7f5dfe320 /clang/lib/Sema/Sema.cpp | |
parent | b62ba7f5b1caf99a3cbbe06d0e1c788c2dc85416 (diff) | |
download | llvm-ed35a92c404650b15a79ff38bcaff41de176cb78.zip llvm-ed35a92c404650b15a79ff38bcaff41de176cb78.tar.gz llvm-ed35a92c404650b15a79ff38bcaff41de176cb78.tar.bz2 |
[clang] Introduce target-specific `Sema` components (#93179)
This patch introduces `SemaAMDGPU`, `SemaARM`, `SemaBPF`, `SemaHexagon`,
`SemaLoongArch`, `SemaMIPS`, `SemaNVPTX`, `SemaPPC`, `SemaSystemZ`,
`SemaWasm`. This continues previous efforts to split Sema up. Additional
context can be found in #84184 and #92682.
I decided to bundle target-specific components together because of their
low impact on `Sema`. That said, their impact on `SemaChecking.cpp` is
far from low, and I consider it a success.
Somewhat accidentally, I also moved Wasm- and AMDGPU-specific function
from `SemaDeclAttr.cpp`, because they were exposed in `Sema`. That went
well, and I consider it a success, too. I'd like to move the rest of
static target-specific functions out of `SemaDeclAttr.cpp` like we're
doing with built-ins in `SemaChecking.cpp` .
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 39a9a43..582adcf 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -41,17 +41,27 @@ #include "clang/Sema/RISCVIntrinsicManager.h" #include "clang/Sema/Scope.h" #include "clang/Sema/ScopeInfo.h" +#include "clang/Sema/SemaAMDGPU.h" +#include "clang/Sema/SemaARM.h" +#include "clang/Sema/SemaBPF.h" #include "clang/Sema/SemaCUDA.h" #include "clang/Sema/SemaCodeCompletion.h" #include "clang/Sema/SemaConsumer.h" #include "clang/Sema/SemaHLSL.h" +#include "clang/Sema/SemaHexagon.h" #include "clang/Sema/SemaInternal.h" +#include "clang/Sema/SemaLoongArch.h" +#include "clang/Sema/SemaMIPS.h" +#include "clang/Sema/SemaNVPTX.h" #include "clang/Sema/SemaObjC.h" #include "clang/Sema/SemaOpenACC.h" #include "clang/Sema/SemaOpenMP.h" +#include "clang/Sema/SemaPPC.h" #include "clang/Sema/SemaPseudoObject.h" #include "clang/Sema/SemaRISCV.h" #include "clang/Sema/SemaSYCL.h" +#include "clang/Sema/SemaSystemZ.h" +#include "clang/Sema/SemaWasm.h" #include "clang/Sema/SemaX86.h" #include "clang/Sema/TemplateDeduction.h" #include "clang/Sema/TemplateInstCallback.h" @@ -206,16 +216,26 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, LateTemplateParser(nullptr), LateTemplateParserCleanup(nullptr), OpaqueParser(nullptr), CurContext(nullptr), ExternalSource(nullptr), CurScope(nullptr), Ident_super(nullptr), + AMDGPUPtr(std::make_unique<SemaAMDGPU>(*this)), + ARMPtr(std::make_unique<SemaARM>(*this)), + BPFPtr(std::make_unique<SemaBPF>(*this)), CodeCompletionPtr( std::make_unique<SemaCodeCompletion>(*this, CodeCompleter)), CUDAPtr(std::make_unique<SemaCUDA>(*this)), HLSLPtr(std::make_unique<SemaHLSL>(*this)), + HexagonPtr(std::make_unique<SemaHexagon>(*this)), + LoongArchPtr(std::make_unique<SemaLoongArch>(*this)), + MIPSPtr(std::make_unique<SemaMIPS>(*this)), + NVPTXPtr(std::make_unique<SemaNVPTX>(*this)), ObjCPtr(std::make_unique<SemaObjC>(*this)), OpenACCPtr(std::make_unique<SemaOpenACC>(*this)), OpenMPPtr(std::make_unique<SemaOpenMP>(*this)), + PPCPtr(std::make_unique<SemaPPC>(*this)), PseudoObjectPtr(std::make_unique<SemaPseudoObject>(*this)), RISCVPtr(std::make_unique<SemaRISCV>(*this)), SYCLPtr(std::make_unique<SemaSYCL>(*this)), + SystemZPtr(std::make_unique<SemaSystemZ>(*this)), + WasmPtr(std::make_unique<SemaWasm>(*this)), X86Ptr(std::make_unique<SemaX86>(*this)), MSPointerToMemberRepresentationMethod( LangOpts.getMSPointerToMemberRepresentationMethod()), |