summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtSerialization.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-06-24 17:00:08 +0000
committerTed Kremenek <kremenek@apple.com>2008-06-24 17:00:08 +0000
commit17ae57faa8da08e6245ca12c84ac9ca3b97fe853 (patch)
tree5a9a1db1d81bc5520146531b416d939cf3f894b2 /clang/lib/AST/StmtSerialization.cpp
parentd5cd61dca6908385e96e5b0c79adbdffbc7fe94b (diff)
downloadbcm5719-llvm-17ae57faa8da08e6245ca12c84ac9ca3b97fe853.tar.gz
bcm5719-llvm-17ae57faa8da08e6245ca12c84ac9ca3b97fe853.zip
Update serialization for ObjCMessageExpr to handle additional bit-swizziling of receiver information.
llvm-svn: 52679
Diffstat (limited to 'clang/lib/AST/StmtSerialization.cpp')
-rw-r--r--clang/lib/AST/StmtSerialization.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/clang/lib/AST/StmtSerialization.cpp b/clang/lib/AST/StmtSerialization.cpp
index cc794f0c8d7..aad7e816003 100644
--- a/clang/lib/AST/StmtSerialization.cpp
+++ b/clang/lib/AST/StmtSerialization.cpp
@@ -1017,7 +1017,7 @@ ObjCPropertyRefExpr* ObjCPropertyRefExpr::CreateImpl(Deserializer& D,
}
void ObjCMessageExpr::EmitImpl(Serializer& S) const {
- S.EmitBool(getReceiver() ? true : false);
+ S.EmitInt(getFlag());
S.Emit(getType());
S.Emit(SelName);
S.Emit(LBracloc);
@@ -1027,14 +1027,18 @@ void ObjCMessageExpr::EmitImpl(Serializer& S) const {
if (getReceiver())
S.BatchEmitOwnedPtrs(NumArgs+1, SubExprs);
- else {
- S.EmitPtr(getClassName());
+ else {
+ ClassInfo Info = getClassInfo();
+
+ if (Info.first) S.EmitPtr(Info.first);
+ else S.EmitPtr(Info.second);
+
S.BatchEmitOwnedPtrs(NumArgs, &SubExprs[ARGS_START]);
}
}
ObjCMessageExpr* ObjCMessageExpr::CreateImpl(Deserializer& D, ASTContext& C) {
- bool isReceiver = D.ReadBool();
+ unsigned flags = D.ReadInt();
QualType t = QualType::ReadVal(D);
Selector S = Selector::ReadVal(D);
SourceLocation L = SourceLocation::ReadVal(D);
@@ -1042,7 +1046,7 @@ ObjCMessageExpr* ObjCMessageExpr::CreateImpl(Deserializer& D, ASTContext& C) {
// Construct an array for the subexpressions.
unsigned NumArgs = D.ReadInt();
- Expr** SubExprs = new Expr*[NumArgs+1];
+ Stmt** SubExprs = new Stmt*[NumArgs+1];
// Construct the ObjCMessageExpr object using the special ctor.
ObjCMessageExpr* ME = new ObjCMessageExpr(S, t, L, R, SubExprs, NumArgs);
@@ -1053,12 +1057,12 @@ ObjCMessageExpr* ObjCMessageExpr::CreateImpl(Deserializer& D, ASTContext& C) {
// Now read in the arguments.
- if (isReceiver)
+ if (flags & Flags == IsInstMeth)
D.BatchReadOwnedPtrs(NumArgs+1, SubExprs, C);
else {
- // Read the pointer for ClassName. The Deserializer will handle the
+ // Read the pointer for Cls/ClassName. The Deserializer will handle the
// bit-mangling automatically.
- SubExprs[RECEIVER] = (Expr*) ((uintptr_t) 0x1);
+ SubExprs[RECEIVER] = (Stmt*) ((uintptr_t) flags);
D.ReadUIntPtr((uintptr_t&) SubExprs[RECEIVER]);
// Read the arguments.
OpenPOWER on IntegriCloud