Commit Graph

32 Commits

Author SHA1 Message Date
Fariborz Jahanian bf9294fb65 Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).

llvm-svn: 111823
2010-08-23 18:51:39 +00:00
John McCall 4887165193 DeclPtrTy -> Decl *
llvm-svn: 111733
2010-08-21 09:40:31 +00:00
Argyrios Kyrtzidis d32ee89ea2 Fix an issue with writing to PCH another included PCH, introduced by the "using an AST on-disk hash table for name lookup" commit.
When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts
may be incomplete, since we now lazily deserialize the visible decls of a particular name.
Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables
of DeclContexts before writing them out.

llvm-svn: 111698
2010-08-20 23:35:55 +00:00
Fariborz Jahanian a50b3a20f1 objective-c ivar refactoring patch. Iterations
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars. 

llvm-svn: 111679
2010-08-20 21:21:08 +00:00
Argyrios Kyrtzidis ba88bfab37 Use the AST on-disk hash table for name lookup inside a DeclContext.
*Huge* improvement over the amount of deserializing that we do for C++ lookup.
e.g, if he have the Carbon header precompiled and include it on a file containing this:

int x;

these are the before/after stats:

BEFORE:

*** AST File Statistics:
  578 stat cache hits
  4 stat cache misses
  548/30654 source location entries read (1.787695%)
  15907/16501 types read (96.400223%)
  53525/59955 declarations read (89.275291%)
  33993/43525 identifiers read (78.099945%)
  41516/51891 statements read (80.006165%)
  77/5317 macros read (1.448185%)
  0/6335 lexical declcontexts read (0.000000%)
  1/5424 visible declcontexts read (0.018437%)

AFTER using the on-disk table:

*** AST File Statistics:
  578 stat cache hits
  4 stat cache misses
  548/30654 source location entries read (1.787695%)
  10/16501 types read (0.060602%)
  9/59955 declarations read (0.015011%)
  161/43525 identifiers read (0.369902%)
  20/51891 statements read (0.038542%)
  6/5317 macros read (0.112846%)
  0/6335 lexical declcontexts read (0.000000%)
  2/5424 visible declcontexts read (0.036873%)

There's only one issue affecting mostly the precompiled preambles which I will address soon.

llvm-svn: 111636
2010-08-20 16:04:35 +00:00
Argyrios Kyrtzidis 07347321c6 Introduce the mechanism for building an AST on-disk hash table for name lookup inside a DeclContext but don't use it yet.
llvm-svn: 111635
2010-08-20 16:04:27 +00:00
Argyrios Kyrtzidis 082e4613eb Refactoring; move the functionality of ASTWriter::GetOrCreateTypeID to the more generic
MakeTypeID template function which accepts a type and a function object that returns a TypeIdx.

MakeTypeID is in PCHCommon.h so that it can be used by ASTReader too.

llvm-svn: 111634
2010-08-20 16:04:20 +00:00
Argyrios Kyrtzidis 9ab44ea6bd Introduce ASTWriter::GetOrCreateTypeID and move most of the functionality of AddTypeRef there.
No functionality change.

llvm-svn: 111633
2010-08-20 16:04:14 +00:00
Argyrios Kyrtzidis e394f2ca8b A bit of refactoring; Introduce ASTWriter::GetOrCreateTypeIdx and move the emission of types there.
No functionality change.

llvm-svn: 111632
2010-08-20 16:04:09 +00:00
Argyrios Kyrtzidis a7fbbb0546 Rename TypeIDs -> TypeIdxs. No functionality change.
llvm-svn: 111631
2010-08-20 16:04:04 +00:00
Argyrios Kyrtzidis bb5c7eae4c serialization::TypeID is used with or without qualifiers, both as index and as index + qualifiers.
Disambiguate and provide some type safety by using a new class TypeIdx for the "TypeID as index" semantics.

llvm-svn: 111630
2010-08-20 16:03:59 +00:00
Argyrios Kyrtzidis 4bd97102e9 Share the common code of ComputeHash(Selector Sel) instead of keeping 2 copies in PCHReader and PCHWriter.
No functionality change.

llvm-svn: 111629
2010-08-20 16:03:52 +00:00
John McCall b3774b5c1e Regularize the API for accessing explicit template arguments.
llvm-svn: 111584
2010-08-19 23:49:38 +00:00
Douglas Gregor b473b07cff Make sure to deallocate the identifier lookup tables and selector tables
when destroying an ASTReader. Plugs a leak that shows up in libclang.

llvm-svn: 111488
2010-08-19 00:28:17 +00:00
Sebastian Redl 539c506152 Rename pch namespace to serialization.
llvm-svn: 111478
2010-08-18 23:57:32 +00:00
Sebastian Redl f164204baa Rename stuff in PCHBitCodes.h
llvm-svn: 111475
2010-08-18 23:57:22 +00:00
Sebastian Redl f5b1346738 Rename the ASTReader header files.
llvm-svn: 111474
2010-08-18 23:57:17 +00:00
Sebastian Redl 3b3c874f68 Rename the ASTReader implementation files.
llvm-svn: 111473
2010-08-18 23:57:11 +00:00
Sebastian Redl d44cd6adba More PCH -> AST renaming.
llvm-svn: 111472
2010-08-18 23:57:06 +00:00
Sebastian Redl 3e31c72497 Rename various classes from PCH to AST.
llvm-svn: 111471
2010-08-18 23:56:56 +00:00
Sebastian Redl 70c751de76 Rename PCHStmtReader -> ASTStmtReader.
llvm-svn: 111470
2010-08-18 23:56:52 +00:00
Sebastian Redl b3298c3bb6 Rename PCHDeclReader -> ASTDeclReader.
llvm-svn: 111469
2010-08-18 23:56:48 +00:00
Sebastian Redl 2c499f6561 Rename PCHReader to ASTReader.
llvm-svn: 111467
2010-08-18 23:56:43 +00:00
Sebastian Redl 1914c6fef8 Rename PCHWriter.h to ASTWriter.h
llvm-svn: 111466
2010-08-18 23:56:37 +00:00
Sebastian Redl d6522cfc6d Rename the ASTWriter implementation files
llvm-svn: 111465
2010-08-18 23:56:31 +00:00
Sebastian Redl 42a0f6a7f2 Do the PCH->AST rename for ASTWriter's implementation parts.
llvm-svn: 111464
2010-08-18 23:56:27 +00:00
Sebastian Redl 55c0ad5772 Rename PCHWriter to ASTWriter
llvm-svn: 111463
2010-08-18 23:56:21 +00:00
Alexis Hunt dcfba7b35b Generate Attr subclasses with TableGen.
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

 - The constructor arguments are a SourceLocation and a Context&,
   followed by the attributes arguments in the order that they were
   defined in Attr.td

 - Every argument in Attr.td has an appropriate accessor named getFoo,
   and there are sometimes a few extra ones (such as to get the length
   of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

llvm-svn: 111455
2010-08-18 23:23:40 +00:00
Sebastian Redl 7940e6fb1d Fix CMake build
llvm-svn: 111284
2010-08-17 21:00:23 +00:00
Sebastian Redl 135bcc791b Reintroduce the serialization library, with fixed dependencies.
llvm-svn: 111279
2010-08-17 20:43:28 +00:00
Douglas Gregor 256a7282e4 Revert Sebastian's build-breaking patch.
llvm-svn: 111265
2010-08-17 18:31:01 +00:00
Sebastian Redl 52ce9bb2fb Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.
llvm-svn: 111258
2010-08-17 17:55:49 +00:00