diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-10 17:03:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-10 17:03:06 +0000 |
commit | 1ab55e9bb87d98bff1d42c7a0ee502c64755d9f5 (patch) | |
tree | 0684c1767cb16364433fb05a4e5f4711d29c1436 /lib/Sema/SemaChecking.cpp | |
parent | 075f8f1b6bed4d1b224c74f87508534cc6392ce6 (diff) |
Eliminate the branching in QualType::getTypePtr() by providing a
common base for ExtQuals and Type that stores the underlying type
pointer. This results in a 2% performance win for -emit-llvm on a
typical C file, with 1% memory growth in the AST.
Note that there is an API change in this optimization:
QualType::getTypePtr() can no longer be invoked on a NULL
QualType. If the QualType might be NULL, use
QualType::getTypePtrOrNull(). I've audited all uses of getTypePtr() in
the code base and changed the appropriate uses over to
getTypePtrOrNull().
A future optimization opportunity would be to distinguish between
cast/dyn_cast and cast_or_null/dyn_cast_or_null; for the former, we
could use getTypePtr() rather than getTypePtrOrNull(), to take another
branch out of the cast/dyn_cast implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121489 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
0 files changed, 0 insertions, 0 deletions