| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 70169
|
|
|
|
| |
llvm-svn: 70167
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
eventually get an option to turn this off, but it is nice for looking at
statistics. For example, the types block now prints:
Block ID #11 (TYPES_BLOCK_ID):
Num Instances: 1
Total Size: 895100b/111888B/27971.9W
% of file: 1.55801
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 14899
% Abbrev Recs: 0
Code Histogram:
5478 TYPE_FUNCTION_PROTO
2683 TYPE_TYPEDEF
2460 TYPE_POINTER
2047 TYPE_ENUM
1553 TYPE_RECORD
283 TYPE_CONSTANT_ARRAY
274 TYPE_OBJC_INTERFACE
76 TYPE_INCOMPLETE_ARRAY
10 TYPE_VECTOR
9 TYPE_OBJC_QUALIFIED_ID
5 TYPE_FUNCTION_NO_PROTO
5 TYPE_EXT_QUAL
3 TYPE_TYPEOF_EXPR
llvm-svn: 70166
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
- Implement PCH support for ImplicitParamDecl
- Fix the handling of the body of an ObjCMethodDecl
- Several cast -> cast_or_null fixes
- Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
selectors.
- Make Selector::getAsString() work with NULL selectors.
- Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
in the PCH reader and writer; these were never getting called.
At this point, all of the pch-test tests pass for C and Objective-C.
llvm-svn: 70163
|
|
|
|
| |
llvm-svn: 70143
|
|
|
|
|
|
| |
This fixes all the -emit-pch problems discovered by utils/pch-test.pl.
llvm-svn: 70125
|
|
|
|
|
|
|
|
|
|
|
| |
necessary and iterate until all types and declarations have been
written. This reduces the Cocoa.h PCH file size by about 4% (since we
don't write types we don't need), and fixes problems where writing a
declaration generates a new type.
This doesn't seem to have any impact on performance either way.
llvm-svn: 70109
|
|
|
|
| |
llvm-svn: 70105
|
|
|
|
|
|
| |
the missing bits of ObjCMessageExpr.
llvm-svn: 70100
|
|
|
|
|
|
|
|
|
|
|
|
| |
most of which are ignored. Instead, move the __COUNTER__ value out to
a PCH-level record (since it is handled eagerly) and move the header
file information into the SourceManager block (which is also,
currently, loaded eagerly).
This results in another 17% performance improvement in the
Cocoa-prefixed "Hello, World" with PCH.
llvm-svn: 70097
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"interesting" identifiers (e.g., those where the IdentifierInfo has
some useful information) from "uninteresting" identifiers (where the
IdentifierInfo is just a name). This makes the hash table smaller (so
searching in it should be faster) and, when loading "uninteresting"
identifiers, we skip the lookup in the hash table.
PCH file size is slightly smaller than before (since we don't emit the
contents of the uninteresting IdentifierInfo structures). The
Cocoa.h-prefixed "Hello, World" doesn't show any speedup, although
we're getting to the point where system noise is a bit issue.
llvm-svn: 70075
|
|
|
|
|
|
|
| |
identifiers. They don't yet work, but will inhibit future
optimizations.
llvm-svn: 70071
|
|
|
|
|
|
| |
file so that the key layout matches that of the PTH key layout
llvm-svn: 70066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that the PCH reader does not have to decode the VBR encoding at PCH
load time.
Also, reduce the size of the identifier offsets from 64 bits down to
32 bits. The identifier table itself isn't going to grow to more than
4GB :)
Overall, this results in a 13% speedup in the Cocoa-prefixed "Hello,
World" benchmark.
llvm-svn: 70063
|
|
|
|
|
|
|
|
|
|
| |
blobs, so that we don't need to do any work to get these arrays into
memory at PCH load time.
This gives another 19% performance improvement to the Cocoa-prefixed
"Hello, World!".
llvm-svn: 70059
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This results in a 10% speedup on the Cocoa-prefixed "Hello, World!",
all of which is (not surprisingly) user time. There was a tiny
reduction in the size of the PCH file for Cocoa.h, because certain
selectors aren't being written twice.
I'm using two new tricks here that I'd like to replicate elsewhere:
(1) The selectors not used in the global method pool are packed into
the blob after the global method pool's on-disk hash table and
stored as keys, so that all selectors are in the same blob.
(2) We record the offsets of each selector key when we write it into
the global method pool (or after it, in the same blob). The offset
table is written as a blob, so that we don't need to pack/unpack a
SmallVector with its contents.
llvm-svn: 70055
|
|
|
|
| |
llvm-svn: 70044
|
|
|
|
|
|
| |
Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris.
llvm-svn: 70039
|
|
|
|
|
|
|
|
| |
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.
llvm-svn: 70005
|
|
|
|
|
|
|
| |
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.
llvm-svn: 70001
|
|
|
|
|
|
|
|
|
|
|
|
| |
(1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since
the reader assumes that bucket data is aligned on 4-byte
boundaries.
(2) Don't emit the number of factory methods twice. This was
throwing off the data counts and therefore causing lookups to
fail. I've added asserts so that this class of error cannot happen
again.
llvm-svn: 69991
|
|
|
|
|
|
|
|
| |
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.
llvm-svn: 69989
|
|
|
|
| |
llvm-svn: 69987
|
|
|
|
|
|
|
|
|
|
|
| |
good for uniformity is good for PCH (or is it the other way around?).
As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.
llvm-svn: 69941
|
|
|
|
|
|
|
|
|
|
|
|
| |
their own namespace (IDNS_Protocol) and use the normal name-lookup
routines to find them. Aside from the simplification this provides
(one less DenseMap!), it means that protocols will be lazily
deserialized from PCH files.
Make the code size of the selector table block match the code size of
the type and decl blocks.
llvm-svn: 69939
|
|
|
|
| |
llvm-svn: 69933
|
|
|
|
|
|
|
|
| |
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.
llvm-svn: 69932
|
|
|
|
|
|
|
| |
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.
llvm-svn: 69905
|
|
|
|
|
| |
Note: This support is non-lazy. Once we get "Cocoa.h" humming, we can optimize this.
llvm-svn: 69884
|
|
|
|
| |
llvm-svn: 69860
|
|
|
|
| |
llvm-svn: 69858
|
|
|
|
|
|
|
| |
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.
llvm-svn: 69857
|
|
|
|
| |
llvm-svn: 69856
|
|
|
|
| |
llvm-svn: 69855
|
|
|
|
| |
llvm-svn: 69843
|
|
|
|
| |
llvm-svn: 69835
|
|
|
|
| |
llvm-svn: 69833
|
|
|
|
|
|
| |
to happen (ever), but at least we'll do the right thing when it does.
llvm-svn: 69829
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file needs to store. CodeGen needs to see these definitions (via
HandleTopLevelDecl), otherwise it won't be able to generate code for
them.
This patch notifies the consumer (e.g., CodeGen) about function
definitions and variable definitions when the corresponding
declarations are deserialized. Hence, we don't eagerly deserialize the
declarations for every variable or function that has a definition in
the PCH file. This gives another 5% speedup for the Carbon-prefixed
"Hello, World!", and brings our PCH statistics down to something far
more reasonable:
*** PCH Statistics:
13/20693 types read (0.062823%)
17/59230 declarations read (0.028702%)
54/44914 identifiers read (0.120230%)
0/32954 statements read (0.000000%)
5/6187 macros read (0.080815%)
llvm-svn: 69820
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.
This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":
*** PCH Statistics:
286/20693 types read (1.382110%)
1630/59230 declarations read (2.751984%)
764/44914 identifiers read (1.701029%)
1/32954 statements read (0.003035%)
5/6187 macros read (0.080815%)
down from
*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)
llvm-svn: 69815
|
|
|
|
| |
llvm-svn: 69783
|
|
|
|
| |
llvm-svn: 69781
|
|
|
|
|
|
| |
way to serialize selectors yet.
llvm-svn: 69780
|
|
|
|
|
|
|
| |
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.
llvm-svn: 69779
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This optimization improves performance on the Carbon-prefixed "Hello,
World!" example by 57%. For reference, we're now about 2.25x faster
than GCC PCH. We're also pulling in far less of the PCH file:
*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)
llvm-svn: 69755
|
|
|
|
|
|
|
| |
unit into the PCH file, since we won't be performing name lookup into
it anyway. Reduces the size of the Carbon.h PCH file by ~200k.
llvm-svn: 69739
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
identifiers from a precompiled header.
This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not.
This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers.
90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".
llvm-svn: 69737
|
|
|
|
|
|
|
|
| |
reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).
Once selector support is in place, we should be able to take this for a spin (and add test cases).
llvm-svn: 69674
|
|
|
|
|
|
|
|
|
|
|
| |
that also includes the contents of the IdentifierInfo itself (the
various fields and flags, along with the chain of identifiers visible
at the top level that have that name).
We don't make any use of the hash table yet, except that our
identifier ID -> string mapping points into the hash table now.
llvm-svn: 69625
|
|
|
|
|
|
|
|
| |
ObjCIvarDecl.
Next step: Add selector support to PCHWriter::AddDeclarationName().
llvm-svn: 69619
|