[PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization code must be set

otherwise it will crash with asserts on or it will be written as null pointer.

llvm-svn: 144626
This commit is contained in:
Argyrios Kyrtzidis 2011-11-15 06:20:27 +00:00
parent 233f12d9e2
commit 5938650b13
2 changed files with 12 additions and 0 deletions

View File

@ -753,6 +753,8 @@ void ASTStmtWriter::VisitPseudoObjectExpr(PseudoObjectExpr *E) {
if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(*i))
Writer.AddStmt(OVE->getSourceExpr());
}
Code = serialization::EXPR_PSEUDO_OBJECT;
}
void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
@ -768,6 +770,8 @@ void ASTStmtWriter::VisitAtomicExpr(AtomicExpr *E) {
}
Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
Writer.AddSourceLocation(E->getRParenLoc(), Record);
Code = serialization::EXPR_ATOMIC;
}
//===----------------------------------------------------------------------===//

View File

@ -16,3 +16,11 @@ typedef typeof(id<foo>) objc_id_protocol_ty;
typedef typeof(itf*) objc_interface_ty;
typedef typeof(itf<foo>*) objc_qual_interface_ty;
@interface PP
@property (assign) id prop;
@end
static inline id getPseudoObject(PP *p) {
return p.prop;
}