aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-26 22:20:50 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-26 22:20:50 +0000
commit405bad07391494d2eb025f8222c256c66b56e5f8 (patch)
tree1724d3fc1263541f68da74087c3267f76d4c873d /lib/Basic/IdentifierTable.cpp
parentf91f5c8a66ffd812f61819836529f8ad437f7e2b (diff)
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
Diffstat (limited to 'lib/Basic/IdentifierTable.cpp')
-rw-r--r--lib/Basic/IdentifierTable.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index 8b74b20032..69ee090b6e 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -315,9 +315,9 @@ unsigned Selector::getNumArgs() const {
}
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 MultiKeywordSelector::getName() const {
}
std::string Selector::getAsString() const {
+ if (InfoPtr == 0)
+ return "<null selector>";
+
if (InfoPtr & ArgFlags) {
IdentifierInfo *II = getAsIdentifierInfo();