diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-07 01:22:02 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-07 01:22:02 +0000 |
commit | 150ec292a6e7995a711cedbe7a10a25d664a6c6b (patch) | |
tree | f082f23b10ab8e368cd68959f58b1136bbf2a1e8 /lib/Basic/IdentifierTable.cpp | |
parent | 1fbfd5b9b8b82aea084773b76dd1ec6796a7000c (diff) |
Selector: (changes made after discussing this more with Steve Naroff)
- Make Selector::getAsIdentifierInfo() private. Using IdentifierInfo* in
Selector is an implementation detail that clients shouldn't think about.
- Modify diagnostic emission in Sema::ProcessPropertyDecl to not use
Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is
null) and instead use Selector::getAsString().
- Tidy up Selector::getAsString() implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | lib/Basic/IdentifierTable.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 4e2e7005e3..f4acbec019 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -352,8 +352,9 @@ std::string Selector::getAsString() const { 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 += ":"; |