llvm-project/clang
Jaroslav Sevcik 4481eefbe8 [ASTImporter] Properly delete decls from SavedImportPaths
Summary:
We see a significant regression (~40% slower on large codebases) in expression evaluation after https://reviews.llvm.org/rL364771. A sampling profile shows the extra time is spent in SavedImportPathsTy::operator[] when called from ASTImporter::Import. I believe this is because ASTImporter::Import adds an element to the SavedImportPaths map for each decl unconditionally (see 7b81c3f879/clang/lib/AST/ASTImporter.cpp (L8256)).

To fix this, we call SavedImportPathsTy::erase on the declaration rather than clearing its value vector. That way we do not accidentally introduce new empty elements.  (With this patch the performance is restored, and we do not see SavedImportPathsTy::operator[] in the profile anymore.)

Reviewers: martong, teemperor, a.sidorin, shafik

Reviewed By: martong

Subscribers: rnkovacs, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73166
2020-01-22 15:20:06 +01:00
..
INPUTS
bindings [Wdocumentation] Implement \anchor 2019-12-21 14:52:21 +01:00
cmake [CMake] Use LinuxRemoteTI instead of LinuxLocalTI in CrossWinToARMLinux cmake cache 2020-01-18 01:29:09 +03:00
docs Revert "PR17164: Change clang's default behavior from -flax-vector-conversions=all to -flax-vector-conversions=integer." 2020-01-20 16:34:09 -08:00
examples Update clang-interpreter example to incorporate changes in ce2207abaf. 2020-01-21 22:00:50 -08:00
include [Concepts] Placeholder constraints and abbreviated templates 2020-01-22 12:09:13 +02:00
lib [ASTImporter] Properly delete decls from SavedImportPaths 2020-01-22 15:20:06 +01:00
runtime
test Revert "[Concepts] Fix bug when referencing function parameters in instantiated function template requires clause" 2020-01-22 12:16:35 +02:00
tools [Concepts] Requires Expressions 2020-01-19 00:23:26 +02:00
unittests [clang][index] Index the injected class name types. 2020-01-22 10:07:54 +01:00
utils [TableGen] Use a table to lookup MVE intrinsic names 2020-01-21 11:05:45 -08:00
www CWG2352: Allow qualification conversions during reference binding. 2020-01-09 18:24:06 -08:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt [Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation 2020-01-13 10:40:18 -05:00
CODE_OWNERS.TXT
INSTALL.txt
LICENSE.TXT
ModuleInfo.txt
NOTES.txt
README.txt [NFC] test commit reverted 2019-12-21 22:12:07 +04:00

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:             http://clang.llvm.org/
Building and using Clang:         http://clang.llvm.org/get_started.html
Clang Static Analyzer:            http://clang-analyzer.llvm.org/
Information on the LLVM project:  http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/