diff options
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 4eef6cfbff4..57dc611c7e0 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -3217,6 +3217,14 @@ ASTReader::ReadASTBlock(ModuleFile &F, unsigned ClientLoadCapabilities) { OptimizeOffPragmaLocation = ReadSourceLocation(F, Record[0]); break; + case MSSTRUCT_PRAGMA_OPTIONS: + if (Record.size() != 1) { + Error("invalid pragma ms_struct record"); + return Failure; + } + PragmaMSStructState = Record[0]; + break; + case UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES: for (unsigned I = 0, N = Record.size(); I != N; ++I) UnusedLocalTypedefNameCandidates.push_back( @@ -6998,10 +7006,12 @@ void ASTReader::UpdateSema() { SemaDeclRefs.clear(); } - // Update the state of 'pragma clang optimize'. Use the same API as if we had - // encountered the pragma in the source. + // Update the state of pragmas. Use the same API as if we had encountered the + // pragma in the source. if(OptimizeOffPragmaLocation.isValid()) SemaObj->ActOnPragmaOptimize(/* IsOn = */ false, OptimizeOffPragmaLocation); + if (PragmaMSStructState != -1) + SemaObj->ActOnPragmaMSStruct((PragmaMSStructKind)PragmaMSStructState); } IdentifierInfo *ASTReader::get(StringRef Name) { @@ -8696,6 +8706,7 @@ ASTReader::ASTReader( Diags(PP.getDiagnostics()), SemaObj(nullptr), PP(PP), Context(Context), Consumer(nullptr), ModuleMgr(PP.getFileManager(), PCHContainerRdr), ReadTimer(std::move(ReadTimer)), + PragmaMSStructState(-1), isysroot(isysroot), DisableValidation(DisableValidation), AllowASTWithCompilerErrors(AllowASTWithCompilerErrors), AllowConfigurationMismatch(AllowConfigurationMismatch), |