assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
}
Selector(uintptr_t V) : InfoPtr(V) {}
-public:
- friend class SelectorTable; // only the SelectorTable can create these
- friend class DeclarationName; // and the AST's DeclarationName.
-
- /// The default ctor should only be used when creating data structures that
- /// will contain selectors.
- Selector() : InfoPtr(0) {}
IdentifierInfo *getAsIdentifierInfo() const {
if (getIdentifierInfoFlag())
unsigned getIdentifierInfoFlag() const {
return InfoPtr & ArgFlags;
}
+public:
+ friend class SelectorTable; // only the SelectorTable can create these
+ friend class DeclarationName; // and the AST's DeclarationName.
+
+ /// The default ctor should only be used when creating data structures that
+ /// will contain selectors.
+ Selector() : InfoPtr(0) {}
+
/// operator==/!= - Indicate whether the specified selectors are identical.
bool operator==(Selector RHS) const {
return InfoPtr == RHS.InfoPtr;
if (InfoPtr & ArgFlags) {
IdentifierInfo *II = getAsIdentifierInfo();
+ // If the number of arguments is 0 then II is guaranteed to not be null.
if (getNumArgs() == 0)
- return II ? II->getName() : "";
+ return II->getName();
std::string Res = II ? II->getName() : "";
Res += ":";
Diag(property->getLocation(),
diag::err_accessor_property_type_mismatch)
<< property->getDeclName()
- << GetterMethod->getSelector().getAsIdentifierInfo();
+ << GetterMethod->getSelector().getAsString();
Diag(GetterMethod->getLocation(), diag::note_declared_at);
}
Diag(property->getLocation(),
diag::err_accessor_property_type_mismatch)
<< property->getDeclName()
- << SetterMethod->getSelector().getAsIdentifierInfo();
+ << SetterMethod->getSelector().getAsString();
Diag(SetterMethod->getLocation(), diag::note_declared_at);
}
}