summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-04-25 12:07:12 +0000
committerSteve Naroff <snaroff@apple.com>2009-04-25 12:07:12 +0000
commit4f2a71bcdbf61ea809a98fd13e2dfeb4146db2bc (patch)
treefee1f01f0c261fd6044bf3c1efe9325702c39014 /clang/lib/Frontend/PCHReader.cpp
parentc8afb09a3bec5070ce4ebf0e217d833c3b48443b (diff)
downloadbcm5719-llvm-4f2a71bcdbf61ea809a98fd13e2dfeb4146db2bc.tar.gz
bcm5719-llvm-4f2a71bcdbf61ea809a98fd13e2dfeb4146db2bc.zip
Fix a major bug in PCHReader::ReadSelectorBlock().
Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris. llvm-svn: 70039
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 4c3e248c64a..78be893bc70 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -1750,14 +1750,15 @@ bool PCHReader::ReadSelectorBlock() {
for (unsigned SelIdx = 0; SelIdx < NumSels; SelIdx++) {
unsigned NumArgs = Record[Idx++];
KeyIdents.clear();
- if (NumArgs <= 1) {
+ if (NumArgs == 0) {
+ // If the number of arguments is 0, the we must have an Identifier.
IdentifierInfo *II = DecodeIdentifierInfo(Record[Idx++]);
assert(II && "DecodeIdentifierInfo returned 0");
KeyIdents.push_back(II);
} else {
+ // For keyword selectors, the Identifier is optional (::: is legal!).
for (unsigned ArgIdx = 0; ArgIdx < NumArgs; ++ArgIdx) {
IdentifierInfo *II = DecodeIdentifierInfo(Record[Idx++]);
- assert(II && "DecodeIdentifierInfo returned 0");
KeyIdents.push_back(II);
}
}
OpenPOWER on IntegriCloud