Граф коммитов

182 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 3747ee72e1 If we get a TU_CONTEXT update from a chained PCH file before we
actually have an ASTContext, delay the processing of that
update. Patch by Sebastian Redl! Fixes <rdar://problem/8499034>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 01:18:02 +00:00
Argyrios Kyrtzidis 297c706f21 Support implicit includes when generating a PCH and allow the user to pass a -include on the command line following the PCH include.
Fixes rdar://7382084.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115159 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:53:50 +00:00
Sebastian Redl edadecc012 Fix a bug in loading macro records. Fixes yet another crash in libclang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114940 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 02:55:49 +00:00
Sebastian Redl 4a9eb26500 Fix a use of an invalidated reference due to a hash map reallocating.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114937 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 02:24:44 +00:00
Sebastian Redl b57a624f22 When chaining PCHs, only write PPRecords that don't come from PCH, and give them the correct IDs. Fixes a crash in XCode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:18:47 +00:00
Douglas Gregor 76dc8890b6 When setting the globally-visible declarations for a particular
identifier, we may have a Sema object but no translation unit scope
(because parsing is finished). In this case, we still need to update
the IdResolver, which might still be used when writing a PCH
containing another PCH (without chaining). This bug manifested as a
failure with precompiled preambles.

Also, add a little environment-variable-sensitive logging for
libclang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 23:29:12 +00:00
Sebastian Redl 8db9faed41 Change source manager serialization to be less tied to the PCH model.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 20:19:08 +00:00
Sebastian Redl 4ee5a6f9bd Only preload SLocEntries after the entire PCH chain was loaded.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:42:30 +00:00
Sebastian Redl 301c9b0b67 Reshuffle PerFileData's members to make more sense.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:42:27 +00:00
Sebastian Redl f73c93fea0 Macro definitions in AST files have their own IDs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 19:54:06 +00:00
Benjamin Kramer 4ea884b429 Replace loops with SmallVector::append.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 23:43:28 +00:00
Argyrios Kyrtzidis f84cde1cbc Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's IsWritten and source order is not set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 19:04:27 +00:00
Chandler Carruth 62c78d54be Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 08:44:16 +00:00
John McCall 2a7fb27913 Move more stuff out of Sema.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 05:32:35 +00:00
Sebastian Redl 6e50e00c2f AST reader support for having specializations of templates from earlier in the chain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 22:50:19 +00:00
John McCall 5f1e0942a3 More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque.  That may
not be reasonably attainable, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 08:50:51 +00:00
John McCall 7a1fad3825 Remove a header dependency from Sema.h at the cost of some type safety.
If someone wants to fix this some other way....



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 07:32:53 +00:00
Sebastian Redl 5967d6228f Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:50:16 +00:00
Sebastian Redl e1dde811b3 Read the UPDATE_VISIBLE record, and add its visible decls to the lookup tables. Also, free the lookup tables when destructing the ASTReader.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:50:04 +00:00
Sebastian Redl 0ea8f7f5a4 Correctly initialize the visible decls pointer if there are no visible decls for a record.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:50:00 +00:00
Sebastian Redl 8b12273c86 Baby step towards supporting namespaces in chained PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:49:55 +00:00
John McCall d226f65006 DeclPtrTy -> Decl *
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 09:40:31 +00:00
Argyrios Kyrtzidis a60786b46e 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111698 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 23:35:55 +00:00
Argyrios Kyrtzidis 074dcc8ef8 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:04:35 +00:00
Argyrios Kyrtzidis 5d26768e26 Introduce the mechanism for building an AST on-disk hash table for name lookup inside a DeclContext but don't use it yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:04:27 +00:00
Argyrios Kyrtzidis c8e5d51f51 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:03:59 +00:00
Argyrios Kyrtzidis 0eca89e989 Share the common code of ComputeHash(Selector Sel) instead of keeping 2 copies in PCHReader and PCHWriter.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:03:52 +00:00
Douglas Gregor 501c103656 Make sure to deallocate the identifier lookup tables and selector tables
when destroying an ASTReader. Plugs a leak that shows up in libclang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 00:28:17 +00:00
Sebastian Redl 8538e8d43a Rename pch namespace to serialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:57:32 +00:00
Sebastian Redl f29f0a28c4 Rename stuff in PCHBitCodes.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:57:22 +00:00
Sebastian Redl 6ab7cd853e Rename the ASTReader header files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:57:17 +00:00
Sebastian Redl 904c9c8389 Rename the ASTReader implementation files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:57:11 +00:00