diff options
Diffstat (limited to 'lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r-- | lib/Serialization/ASTReaderStmt.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index 7a4c8b0282..b913ad8b6a 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/lib/Serialization/ASTReaderStmt.cpp @@ -1703,6 +1703,9 @@ OMPClause *OMPClauseReader::readClause() { case OMPC_shared: C = OMPSharedClause::CreateEmpty(Context, Record[Idx++]); break; + case OMPC_reduction: + C = OMPReductionClause::CreateEmpty(Context, Record[Idx++]); + break; case OMPC_linear: C = OMPLinearClause::CreateEmpty(Context, Record[Idx++]); break; @@ -1794,6 +1797,24 @@ void OMPClauseReader::VisitOMPSharedClause(OMPSharedClause *C) { C->setVarRefs(Vars); } +void OMPClauseReader::VisitOMPReductionClause(OMPReductionClause *C) { + C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setColonLoc(Reader->ReadSourceLocation(Record, Idx)); + NestedNameSpecifierLoc NNSL = + Reader->Reader.ReadNestedNameSpecifierLoc(Reader->F, Record, Idx); + DeclarationNameInfo DNI; + Reader->ReadDeclarationNameInfo(DNI, Record, Idx); + C->setQualifierLoc(NNSL); + C->setNameInfo(DNI); + + unsigned NumVars = C->varlist_size(); + SmallVector<Expr *, 16> Vars; + Vars.reserve(NumVars); + for (unsigned i = 0; i != NumVars; ++i) + Vars.push_back(Reader->Reader.ReadSubExpr()); + C->setVarRefs(Vars); +} + void OMPClauseReader::VisitOMPLinearClause(OMPLinearClause *C) { C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); C->setColonLoc(Reader->ReadSourceLocation(Record, Idx)); |