08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
projectDirPath = "";
class Selector {
enum IdentifierInfoFlag {
+ // MultiKeywordSelector = 0.
ZeroArg = 0x1,
OneArg = 0x2,
ArgFlags = ZeroArg|OneArg
Selector(IdentifierInfo *II, unsigned nArgs) {
InfoPtr = reinterpret_cast<uintptr_t>(II);
- if (nArgs == 0)
- InfoPtr |= ZeroArg;
- else if (nArgs == 1)
- InfoPtr |= OneArg;
- else
- assert(0 && "nArgs not equal to 0/1");
+ assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
+ assert(nArgs < 2 && "nArgs not equal to 0/1");
+ InfoPtr |= nArgs+1;
}
Selector(MultiKeywordSelector *SI) {
InfoPtr = reinterpret_cast<uintptr_t>(SI);
+ assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo");
}
friend class Parser; // only the Parser can create these.
IdentifierInfo *getAsIdentifierInfo() const {
- if (InfoPtr & ArgFlags)
+ if (getIdentifierInfoFlag())
return reinterpret_cast<IdentifierInfo *>(InfoPtr & ~ArgFlags);
return 0;
}