Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
- Implement PCH support for ImplicitParamDecl
- Fix the handling of the body of an ObjCMethodDecl
- Several cast -> cast_or_null fixes
- Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
selectors.
- Make Selector::getAsString() work with NULL selectors.
- Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
in the PCH reader and writer; these were never getting called.
At this point, all of the pch-test tests pass for C and Objective-C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70163 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index 8b74b20..69ee090 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -315,9 +315,9 @@
}
IdentifierInfo *Selector::getIdentifierInfoForSlot(unsigned argIndex) const {
- if (IdentifierInfo *II = getAsIdentifierInfo()) {
+ if (getIdentifierInfoFlag()) {
assert(argIndex == 0 && "illegal keyword index");
- return II;
+ return getAsIdentifierInfo();
}
// We point to a MultiKeywordSelector (pointer doesn't contain any flags).
MultiKeywordSelector *SI = reinterpret_cast<MultiKeywordSelector *>(InfoPtr);
@@ -346,6 +346,9 @@
}
std::string Selector::getAsString() const {
+ if (InfoPtr == 0)
+ return "<null selector>";
+
if (InfoPtr & ArgFlags) {
IdentifierInfo *II = getAsIdentifierInfo();