diff options
| author | Mingming Liu <mingmingl@google.com> | 2025-09-10 15:25:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 15:25:31 -0700 |
| commit | 1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch) | |
| tree | 57f4b1f313c8cf74eed8819870f39c36ea263c68 /clang/lib/Serialization/ASTWriter.cpp | |
| parent | 898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff) | |
| parent | b8cefcb601ddaa18482555c4ff363c01a270c2fe (diff) | |
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 87e462f179ce..2f847ec89ebd 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -57,6 +57,7 @@ #include "clang/Basic/TargetInfo.h" #include "clang/Basic/TargetOptions.h" #include "clang/Basic/Version.h" +#include "clang/Frontend/CompilerInstance.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/MacroInfo.h" @@ -1710,9 +1711,13 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, StringRef isysroot) { const HeaderSearchOptions &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts(); + SmallString<256> HSOpts_ModuleCachePath; + CompilerInstance::normalizeModuleCachePath( + PP.getFileManager(), HSOpts.ModuleCachePath, HSOpts_ModuleCachePath); + AddString(HSOpts.Sysroot, Record); AddString(HSOpts.ResourceDir, Record); - AddString(HSOpts.ModuleCachePath, Record); + AddString(HSOpts_ModuleCachePath, Record); AddString(HSOpts.ModuleUserBuildPath, Record); Record.push_back(HSOpts.DisableModuleHash); Record.push_back(HSOpts.ImplicitModuleMaps); @@ -8547,6 +8552,7 @@ void OMPClauseWriter::VisitOMPSeverityClause(OMPSeverityClause *C) { } void OMPClauseWriter::VisitOMPMessageClause(OMPMessageClause *C) { + VisitOMPClauseWithPreInit(C); Record.AddStmt(C->getMessageString()); Record.AddSourceLocation(C->getLParenLoc()); } @@ -8750,8 +8756,11 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeSourceLocation(PC->getLParenLoc()); writeOpenACCVarList(PC); - for (VarDecl *VD : PC->getInitRecipes()) - AddDeclRef(VD); + for (const OpenACCPrivateRecipe &R : PC->getInitRecipes()) { + static_assert(sizeof(R) == 2 * sizeof(int *)); + AddDeclRef(R.AllocaDecl); + AddStmt(const_cast<Expr *>(R.InitExpr)); + } return; } case OpenACCClauseKind::Host: { @@ -8772,7 +8781,9 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeOpenACCVarList(FPC); for (const OpenACCFirstPrivateRecipe &R : FPC->getInitRecipes()) { - AddDeclRef(R.RecipeDecl); + static_assert(sizeof(R) == 3 * sizeof(int *)); + AddDeclRef(R.AllocaDecl); + AddStmt(const_cast<Expr *>(R.InitExpr)); AddDeclRef(R.InitFromTemporary); } return; @@ -8894,8 +8905,9 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) { writeOpenACCVarList(RC); for (const OpenACCReductionRecipe &R : RC->getRecipes()) { - static_assert(sizeof(OpenACCReductionRecipe) == sizeof(int *)); - AddDeclRef(R.RecipeDecl); + static_assert(sizeof(OpenACCReductionRecipe) == 2 * sizeof(int *)); + AddDeclRef(R.AllocaDecl); + AddStmt(const_cast<Expr *>(R.InitExpr)); } return; } |
