diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-19 01:39:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-19 01:39:10 +0000 |
commit | 301bc21fd0d767a30192156aa8ae05da56d33fe1 (patch) | |
tree | 5a145a5b6137600c472fd0fdf1b93e449b279667 /clang/lib/Parse/ParseDecl.cpp | |
parent | f981ec4582a4c4e8411cda3bd311c461afcd96f6 (diff) | |
download | bcm5719-llvm-301bc21fd0d767a30192156aa8ae05da56d33fe1.tar.gz bcm5719-llvm-301bc21fd0d767a30192156aa8ae05da56d33fe1.zip |
Make Sema::getPrintingPolicy less ridiculously expensive. This used to perform
an identifier table lookup, *and* copy the LangOptions (including various
std::vector<std::string>s). Twice. We call this function once each time we start
parsing a declaration specifier sequence, and once for each call to Sema::Diag.
This reduces the compile time for a sample .c file from the linux kernel by 20%.
llvm-svn: 270009
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 91445281673..8a3110c5153 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2661,7 +2661,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, bool AttrsLastTime = false; ParsedAttributesWithRange attrs(AttrFactory); // We use Sema's policy to get bool macros right. - const PrintingPolicy &Policy = Actions.getPrintingPolicy(); + PrintingPolicy Policy = Actions.getPrintingPolicy(); while (1) { bool isInvalid = false; bool isStorageClass = false; |