diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-27 07:35:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-27 07:35:58 +0000 |
commit | 258172e78d2db3d1c021e4165ae3231893958b30 (patch) | |
tree | dfb88a98d58ff9f2b6e67c8fc90a0ce58e44b54f /clang/lib/Frontend/PCHWriter.cpp | |
parent | 72405d6ec24cdf56d147f88afd33703df4cbf0ea (diff) | |
download | bcm5719-llvm-258172e78d2db3d1c021e4165ae3231893958b30.tar.gz bcm5719-llvm-258172e78d2db3d1c021e4165ae3231893958b30.zip |
add an abbreviation for common PARM_VAR_DECL. All but 9 of the
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.
Before:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.23595e+07b/2.79494e+06B/698736W
% of file: 38.7233
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 139387
% Abbrev Recs: 0
After:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.02405e+07b/2.53006e+06B/632516W
% of file: 35.301
Num SubBlocks: 0
Num Abbrevs: 1
Num Records: 139387
% Abbrev Recs: 19.2902
llvm-svn: 70199
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index d181013a37e..bb72f78546d 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -18,7 +18,6 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclContextInternals.h" #include "clang/AST/Expr.h" -#include "clang/AST/StmtVisitor.h" #include "clang/AST/Type.h" #include "clang/Lex/MacroInfo.h" #include "clang/Lex/Preprocessor.h" @@ -484,8 +483,8 @@ void PCHWriter::WriteLanguageOptions(const LangOptions &LangOpts) { Record.push_back(LangOpts.Freestanding); // Freestanding implementation Record.push_back(LangOpts.NoBuiltin); // Do not use builtin functions (-fno-builtin) - Record.push_back(LangOpts.ThreadsafeStatics); // Whether static initializers are protected - // by locks. + // Whether static initializers are protected by locks. + Record.push_back(LangOpts.ThreadsafeStatics); Record.push_back(LangOpts.Blocks); // block extension to C Record.push_back(LangOpts.EmitAllDecls); // Emit all declarations, even if // they are unused. @@ -1737,6 +1736,7 @@ pch::DeclID PCHWriter::getDeclID(const Decl *D) { } void PCHWriter::AddDeclarationName(DeclarationName Name, RecordData &Record) { + // FIXME: Emit a stable enum for NameKind. 0 = Identifier etc. Record.push_back(Name.getNameKind()); switch (Name.getNameKind()) { case DeclarationName::Identifier: |