summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-26 06:37:51 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-26 06:37:51 +0000
commit01b2cb4772b02bfe0ccce50896651f0bb24f5327 (patch)
tree32744aa73c3ca314fef3e5111949d696c7788129 /clang/lib/Serialization/ASTReader.cpp
parenta5789bb4e1fd6e9023c1bb1181afb5ed8e873900 (diff)
downloadbcm5719-llvm-01b2cb4772b02bfe0ccce50896651f0bb24f5327.tar.gz
bcm5719-llvm-01b2cb4772b02bfe0ccce50896651f0bb24f5327.zip
[modules] Improve abbreviations for C++:
* Add abbreviation for CXXMethodDecl and for FunctionProtoType. These come up a *lot* in C++ modules. * Allow typedef declarations to use the abbreviation if they're class members, or if they're used. In passing, add more record name records for Clang AST node kinds. The downside is that we had already used up our allotment of 12 abbreviations, so this pushes us to an extra bit on each record to support the extra abbrev kinds, which increases file size by ~1%. This patch *barely* pays for that through the other improvements, but we've got room for another 18 abbrevs, so we should be able to make it much more profitable with future changes. llvm-svn: 214024
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 6ed41c39702..679b500ee61 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -5262,10 +5262,6 @@ QualType ASTReader::readTypeRecord(unsigned Index) {
/*produces*/ Record[5]);
unsigned Idx = 6;
- unsigned NumParams = Record[Idx++];
- SmallVector<QualType, 16> ParamTypes;
- for (unsigned I = 0; I != NumParams; ++I)
- ParamTypes.push_back(readType(*Loc.F, Record, Idx));
EPI.Variadic = Record[Idx++];
EPI.HasTrailingReturn = Record[Idx++];
@@ -5273,6 +5269,12 @@ QualType ASTReader::readTypeRecord(unsigned Index) {
EPI.RefQualifier = static_cast<RefQualifierKind>(Record[Idx++]);
SmallVector<QualType, 8> ExceptionStorage;
readExceptionSpec(*Loc.F, ExceptionStorage, EPI, Record, Idx);
+
+ unsigned NumParams = Record[Idx++];
+ SmallVector<QualType, 16> ParamTypes;
+ for (unsigned I = 0; I != NumParams; ++I)
+ ParamTypes.push_back(readType(*Loc.F, Record, Idx));
+
return Context.getFunctionType(ResultType, ParamTypes, EPI);
}
OpenPOWER on IntegriCloud