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

402 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor f90b27ad07 Implement pack expansions whose pattern is a base-specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 22:36:02 +00:00
Argyrios Kyrtzidis 20df8e7bfe In the latest episode of "Deserializing bugs caused by accessors" the series reached a thrilling climax when
FunctionDecl::setPure crashed a poor user's code.

Remove the use of this accessor when deserializing, along with several other in the neighborhood. Fixes rdar://8759653.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122756 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:57:40 +00:00
Douglas Gregor be230c36e3 Implement support for pack expansions whose pattern is a non-type
template argument (described by an expression, of course). For
example:

  template<int...> struct int_tuple { };

  template<int ...Values>
  struct square {
    typedef int_tuple<(Values*Values)...> type;
  };

It also lays the foundation for pack expansions in an initializer-list.
  



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122751 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:17:50 +00:00
Chris Lattner 3f59c975aa The -fshort-wchar option causes wchar_t to become unsigned, in addition to being
16-bits in size.  Implement this by splitting WChar into two enums, like we have
for char.  This fixes a miscompmilation of XULRunner, PR8856.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-25 23:25:43 +00:00
Douglas Gregor 10738d36b1 Add an AST representation for non-type template parameter
packs, e.g.,

  template<typename T, unsigned ...Dims> struct multi_array;

along with semantic analysis support for finding unexpanded non-type
template parameter packs in types, expressions, and so on.

Template instantiation involving non-type template parameter packs
probably doesn't work yet. That'll come soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 23:51:58 +00:00
Ted Kremenek c32647d111 Add -fobjc-default-synthesized-properties flag
to allow us to explicitly control whether or
not Objective-C properties are default synthesized.
Currently this feature only works when using
the -fobjc-non-fragile-abi2 flag (so there is
no functionality change), but we can now turn
off this feature without turning off all the features
coupled with -fobjc-non-fragile-abi2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 21:35:43 +00:00
Michael J. Spencer fbfd180495 Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:45:57 +00:00
Douglas Gregor 7536dd5e6c Introduce a new type, PackExpansionType, to capture types that are
pack expansions, e.g. given

  template<typename... Types> struct tuple;

  template<typename... Types>
  struct tuple_of_refs {
    typedef tuple<Types&...> types;
  };

the type of the "types" typedef is a PackExpansionType whose pattern
is Types&. 

This commit introduces support for creating pack expansions for
template type arguments, as above, but not for any other kind of pack
expansion, nor for any form of instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 02:24:11 +00:00
Michael J. Spencer 256053b31e Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 21:22:22 +00:00
Michael J. Spencer 4eeebc464e MemoryBuffer API update.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 03:28:14 +00:00
Argyrios Kyrtzidis 0827408865 Fix diagnostic pragmas.
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 18:44:22 +00:00
John McCall e23cf437fe Restore r121752 without modification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 08:05:40 +00:00
John McCall 5bfe232d1f Pull out r121752 in case it's causing the selfhost breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 07:30:51 +00:00
John McCall 0e88aa7100 Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around.  The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 06:51:39 +00:00
Douglas Gregor d0937224f3 Variadic templates: extend Type, NestedNameSpecifier, TemplateName,
and TemplateArgument with an operation that determines whether there
are any unexpanded parameter packs within that construct. Use this
information to diagnose the appearance of the names of parameter packs
that have not been expanded (C++ [temp.variadic]p5). Since this
property is checked often (every declaration, ever expression
statement, etc.), we extend Type and Expr with a bit storing the
result of this computation, rather than walking the AST each time to
determine whether any unexpanded parameter packs occur.

This commit is deficient in several ways, which will be remedied with
future commits:
  - Expr has a bit to store the presence of an unexpanded parameter
  pack, but it is never set.
  - The error messages don't point out where the unexpanded parameter
  packs were named in the type/expression, but they should. 
  - We don't check for unexpanded parameter packs in all of the places
  where we should.
  - Testing is sparse, pending the resolution of the above three
  issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 22:49:22 +00:00
Argyrios Kyrtzidis f40f0d5a38 Keep the source location of the selector in ObjCMessageExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 20:08:27 +00:00
Douglas Gregor 1ab55e9bb8 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
2010-12-10 17:03:06 +00:00
Abramo Bagnara 075f8f1b6b Added ParenType type node.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 16:29:40 +00:00
John McCall 49f4e1cbd8 It's kindof silly that ExtQuals has an ASTContext&, and we can use that
space better.  Remove this reference.  To make that work, change some APIs
(most importantly, getDesugaredType()) to take an ASTContext& if they
need to return a QualType.  Simultaneously, diminish the need to return a
QualType by introducing some useful APIs on SplitQualType, which is
just a std::pair<const Type *, Qualifiers>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 11:01:00 +00:00
Michael J. Spencer 3a321e23f6 Use error_code instead of std::string* for MemoryBuffer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:36:38 +00:00
Douglas Gregor 8f1509446f When an "inline" declaration was followed by a definition not marked
"inline", we weren't giving the definition weak linkage because the
"inline" bit wasn't propagated. This was a longstanding FIXME that,
somehow, hadn't triggered a bug in the wild. Fix this problem by
tracking whether any declaration was marked "inline", and clean up the
semantics of GNU's "extern inline" semantics calculation based on this
change.

Fixes <rdar://problem/8740363>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 16:59:22 +00:00
Francois Pichet f187237d91 Remove the TypesCompatibleExprClass AST node. Merge its functionality into BinaryTypeTraitExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 22:35:30 +00:00
Francois Pichet 6ad6f2848d Type traits intrinsic implementation: __is_base_of(T, U)
New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:08:36 +00:00
Douglas Gregor 381d34e0b2 Re-implement caching for the linkage calculation of declarations.
My previous attempt at solving the compile-time problem with many
redeclarations of the same entity cached both linkage and visibility,
while this patch only tackles linkage. There are several reasons for
this difference:

  - Linkage is a language concept, and is evaluated many times during
    semantic analysis and codegen, while visibility is only a
    code-generation concept that is evaluated only once per (unique)
    declaration. Hence, we *must* optimize linkage calculations but
    don't need to optimize visibility computation.
  - Once we know the linkage of a declaration, subsequent
    redeclarations can't change that linkage. Hence, cache
    invalidation is far simpler than for visibility, where a later
    redeclaration can completely change the visibility.
  - We have 3 spare bits in Decl to store the linkage cache, so the
    cache doesn't increase the size of declarations. With the
    visibility+linkage cache, NamedDecl got larger.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:36:25 +00:00
Douglas Gregor b5f35bae05 Revert r120808, my previous implementation of caching for the linkage
and visibility of declarations, because it was extremely messy and it
increased the size of NamedDecl.

An improved implementation is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 17:49:01 +00:00
John McCall 4765fa05b5 Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 08:20:24 +00:00
Francois Pichet 00eb3f9c5b More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:
struct X {
  X() : au_i1(123) {}
  union {
    int au_i1;
    float au_f1;
  };
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 09:14:42 +00:00
Abramo Bagnara a88cefd266 Added struct/class syntactic info for c++0x scoped enum.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:54:17 +00:00
Douglas Gregor 2357207a57 Implement caching for the linkage and visibility calculations of
declarations.

The motivation for this patch is that linkage/visibility computations
are linear in the number of redeclarations of an entity, and we've run
into a case where a single translation unit has > 6500 redeclarations
of the same (unused!) external variable. Since each redeclaration
involves a linkage check, the resulting quadratic behavior makes Clang
slow to a crawl. With this change, a simple test with 512
redeclarations of a variable syntax-checks ~20x faster than
before.

That said, I hate this change, and will probably end up reverting it
in a few hours. Reasons to hate it:
  - It makes NamedDecl larger, since we don't have enough free bits in
  Decl to squeeze in the extra information about caching.
  - There are way too many places where we need to invalidate this
  cache, because the visibility of a declaration can change due to
  redeclarations (!). Despite self-hosting and passing the testsuite,
  I have no confidence that I've found all of places where this cache
  needs to be invalidated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:11:42 +00:00
John McCall 12f78a6741 Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:19:52 +00:00
Peter Collingbourne 08a53269b1 Serialization: support for CUDA language extensions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:14:57 +00:00
Douglas Gregor 89d9980bbc When using a precompiled preamble with detailed preprocessing records,
trap the serialized preprocessing records (macro definitions, macro
instantiations, macro definitions) from the generation of the
precompiled preamble, then replay those when walking the list of
preprocessed entities. This eliminates a bug where clang_getCursor()
wasn't able to find preprocessed-entity cursors in the preamble.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 06:16:57 +00:00
Douglas Gregor 414cb64f09 When loading a precompiled preamble, use the file ID of the
precompiled preamble as the "main" source file's file ID within the
source manager. This makes compiling with a precompiled preamble
produce the same source locations as when compiling without the
precompiled preamble; prior to this change, we ended up with different
file IDs for source locations within the precompiled preamble
vs. those after the precompiled preamble, even for entities (e.g.,
preprocessing entities) in the same file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 05:23:00 +00:00
Michael J. Spencer 03013fa9a0 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:12:39 +00:00
Benjamin Kramer 54353f4893 Hide a bunch of symbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25 18:29:30 +00:00
Chris Lattner 898a061f69 change the 'is directory' indicator to be a null-or-not
pointer that is passed down through the APIs, and make
FileSystemStatCache::get be the one that filters out
directory lookups that hit files.  This also paves the
way to have stat queries be able to return opened files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 21:17:56 +00:00
Chris Lattner d6f6111980 simplify the cache miss handling code, eliminating CacheMissing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 20:05:15 +00:00
Chris Lattner 74e976ba4b PCH files only cache successful stats. Remove the code that reads/writes
the result code of the stat to/from the PCH file since it is always 0.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 19:28:12 +00:00
Chris Lattner 10e286aa8d rework the stat cache, pulling it out of FileManager.h into
its own header and giving it some more structure.  No 
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 19:19:34 +00:00
Chris Lattner 75dfb65c38 tidy up. Split FileManager::getBufferForFile into
two copies, since they are fundamentally different
operations and the StringRef one should go away
(it shouldn't be part of FileManager at least).

Remove some dead arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 09:19:42 +00:00
Chris Lattner 39b49bcaad now the FileManager has a FileSystemOpts ivar, stop threading
FileSystemOpts through a ton of apis, simplifying a lot of code.
This also fixes a latent bug in ASTUnit where it would invoke
methods on FileManager without creating one in some code paths
in cindextext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 08:35:12 +00:00
Chris Lattner 6538227d51 remove old compatibility APIs, use StringRef versions instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 09:55:08 +00:00
Francois Pichet 87c2e121cf Major anonymous union/struct redesign.
A new AST node is introduced:
   def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 06:08:52 +00:00
Argyrios Kyrtzidis 44aa1f3978 Revert r119838 "Don't warn for empty 'if' body if there is a macro that expands to nothing"
and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro.

Thanks to Abramo Bagnara for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20 02:04:01 +00:00
Argyrios Kyrtzidis a25b6a4b43 Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:
if (condition)
    CALL(0); // empty macro but don't warn for empty body.

Fixes rdar://8436021.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 20:54:25 +00:00
Argyrios Kyrtzidis 33e4e70c8c Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
   SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 20:06:41 +00:00
John McCall f89e55ab1b Calculate the value kind of an expression when it's created and
store it on the expression node.  Also store an "object kind",
which distinguishes ordinary "addressed" l-values (like
variable references and pointer dereferences) and bitfield,
@property, and vector-component l-values.

Currently we're not using these for much, but I aim to switch
pretty much everything calculating l-valueness over to them.
For now they shouldn't necessarily be trusted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 06:31:45 +00:00
Douglas Gregor a4ffd85a66 For an Objective-C @synthesize statement, e.g.,
@synthesize foo = _foo;

keep track of the location of the ivar ("_foo"). Teach libclang to
visit the ivar as a member reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 01:03:52 +00:00
John McCall 7cd7d1ad33 Add a new expression kind, OpaqueValueExpr, which is useful for
certain internal type-checking procedures as well as for representing
certain implicitly-generated operations.  Uses to follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 23:31:06 +00:00
Bob Wilson e86d78cf47 Add a variant of GCC-style vector types for ARM NEON.
NEON vector types need to be mangled in a special way to comply with ARM's ABI,
similar to some of the AltiVec-specific vector types.  This patch is mostly
just renaming a bunch of "AltiVecSpecific" things, since they will no longer
be specific to AltiVec.  Besides that, it just adds the new "NeonVector" enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 21:56:12 +00:00
Argyrios Kyrtzidis 826faa22ba Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to avoid leaking memory.
Fixes rdar://8649963.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118674 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 05:40:41 +00:00
Douglas Gregor 910f8008fe Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07 23:05:16 +00:00
Argyrios Kyrtzidis 60f7684881 Don't write an empty DIAG_USER_MAPPINGS record.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 22:20:49 +00:00
Argyrios Kyrtzidis f41d3be399 Read/write from/to PCH the diagnostic mappings that the user set so that e.g. #pragma clang diagnostic can be used in a PCH.
Fixes rdar://8435969.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 22:10:18 +00:00
Argyrios Kyrtzidis 389db16c63 Implement -working-directory.
When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
 the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
 file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 22:45:23 +00:00
Douglas Gregor 4ab829c2a2 Plug a leak in the preprocessing record's handling of inclusion
directives. We had a std::string in an object that was allocated via a
BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 15:03:47 +00:00
Douglas Gregor acec34bda4 Flush statements after writing each DECL_CXX_BASE_SPECIFIERS node
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 04:28:16 +00:00
Douglas Gregor 295a2a617a Make the deserialization of macro definitions lazy, so that we can
load identifiers without loading their corresponding macro
definitions. This is likely to improve PCH performance slightly, and
reduces deserialization stack depth considerably when using
preprocessor metaprogramming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 00:23:06 +00:00
Douglas Gregor 7c789c1a3f Make the deserialization of C++ base class specifiers lazy, improving
the performance of C++ PCH and reducing stack depth in the reader.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 22:39:52 +00:00
Argyrios Kyrtzidis e09a275444 Switch case IDs conflict between chained PCHs; since there is no need to be global, make them local to a decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117540 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 09:29:32 +00:00
Argyrios Kyrtzidis 3c7d7afd25 Remove an assertion that hit on legitimate cases. A redeclaration may have location before the
first one if the redeclaration comes from a friend decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 07:38:53 +00:00
Argyrios Kyrtzidis 100050bf64 Use the ASTMutationListener to track when a named decl gets added to a DeclContext,
meaning we need to rewrite its name lookup table in a chained PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 07:38:51 +00:00
Argyrios Kyrtzidis 0f04f69acd Properly add chained template specializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 07:38:47 +00:00
Argyrios Kyrtzidis d3d0755a42 Fix the re-serializing decls in a chained PCH mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 07:38:45 +00:00
Argyrios Kyrtzidis bef1a7b9c1 Use the ASTMutationListener to track added template specializations in a chained PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 07:38:42 +00:00
Douglas Gregor c8e5cf8f72 Make AST deserialization for class template specializations lazier, by
not loading the specializations of a class template until some AST
consumer needs them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 22:21:36 +00:00
Douglas Gregor 69aecc6252 Lazily load the next friend in the chain of FriendDecls, to eliminate
some excessive recursion and deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 20:23:41 +00:00
Douglas Gregor 06c919300c Lazily load the "next" namespace in the chain of NamespaceDecls, to
eliminate some excessive recursion and deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117476 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 19:49:05 +00:00
John McCall 3fa5cae9b3 No really, we don't have a retain/release system for statements/expressions
anymore.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 07:05:15 +00:00
Douglas Gregor 32adc8bd6f When de-serializing a type that is supposed to be canonical, call
getCanonicalType() to make sure that the type we got back is actually
canonical. This is the case for most types, which always build a
canonical type when given canonical components. However, some types that
involve expressions in their canonicalization (e.g., array types with
dependent sizes) don't always build canonical types from canonical
components, because there is no such thing as a "canonical"
expression. Therefore, we do this extra mapping to ensure that the
canonical types we store are actually canonical.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 00:51:02 +00:00
Chandler Carruth 428edafa9e Improve the tracking of source locations for parentheses in constructor calls.
This adds them where missing, and traces them through PCH. We fix at least one
bug in the extents found by the Index library, and make a lot of refactoring
tools which care about the exact formulation of a constructor call easier to
write. Also some minor cleanups to more consistently follow the friend pattern
instead of the setter pattern when rebuilding a serialized AST.

Patch originally by Samuel Benzaquen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 08:47:36 +00:00
Argyrios Kyrtzidis b6cc0e1a78 Keep track in chained PCH of implicit members that were added after the definition was completed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:54 +00:00
Argyrios Kyrtzidis 565bf30bf5 Start fleshing out ASTMutationListener; notify when a tag definition is completed.
In that case a chained PCH will record the updates to the DefinitionData pointer of forward references.
If a forward reference mutated into a definition re-write it into the chained PCH, this is too big of a change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117239 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:50 +00:00
Argyrios Kyrtzidis ba901b507f Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls that will be replaced in the chained PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:46 +00:00
Argyrios Kyrtzidis aacdd02e58 Some method renaming, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:43 +00:00
Argyrios Kyrtzidis 89eaf3af92 Refactoring.
- Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used.
- Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:40 +00:00
Argyrios Kyrtzidis 7b90340c9c Put the mechanism in place to track modifications in an AST entity that were committed after
its initial creation/deserialization and store the changes in a chained PCH.

The idea is that the AST entities call methods on the ASTMutationListener to give notifications
of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes
of the updated entity. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:36 +00:00
Argyrios Kyrtzidis 134db1fff5 Simplify and "robust-ify" the way that CXXRecord references point to the definition data when loaded from PCH.
Temporary disable 'test/PCH/chain-cxx.cpp' until a better way to fix it is in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:31 +00:00
Argyrios Kyrtzidis c01dc6fb5b Minor refactoring; Pull reading/writing DefinitionData out into a function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24 17:26:27 +00:00
John McCall 1fb0caaa7b Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage.  This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 21:05:15 +00:00
Michael J. Spencer dae4ac4fe5 Reorganize predefined macros for all Windows targets.
This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.

-fmsc-version=<version> (defaults to VS2003 (1300))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 05:21:48 +00:00
Michael J. Spencer 20249a1af2 Fix Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 03:16:25 +00:00
Argyrios Kyrtzidis 441fff128f Modify the assumptions of an assert; the updated latest redeclaration can have the same location
if it's a template specialization pointing at the template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 23:48:40 +00:00
Douglas Gregor ecdcb883cb Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 22:00:55 +00:00
Argyrios Kyrtzidis 0ad6dc3cee Fix chained PCH issue; make sure all visible decls that will be put into a UPDATE_VISIBLE block were recorded beforehand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 16:22:56 +00:00
Argyrios Kyrtzidis 3e8a614b15 Minor optimization; Try to iterator over redeclarations only when necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 16:22:49 +00:00
Argyrios Kyrtzidis 9703b0dd35 Fix issue with chained PCH where forward references did not pick up later definition in the chained PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 00:11:15 +00:00
Andrew Trick 220a9c82dc Putting back safe fixes 116836,116837,116838
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 21:54:32 +00:00
Andrew Trick 7cffb55ef5 Reverting 116836,116837,116838 until we resolve the getLangStandardForKind failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 21:14:46 +00:00
Argyrios Kyrtzidis 0d7d39939a Fix up the comments for creating ParmVarDeclAbbrev to reflect reality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 18:06:49 +00:00
Argyrios Kyrtzidis 4eb9fc0449 Read/write declaration attributes from/to PCH properly. Embed them in the declaration block instead of trying to create another block.
The new block was messing with the assumption that after decls block comes the stmts block.
Fixes http://llvm.org/PR8406

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116737 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 19:20:11 +00:00
John McCall 6102ca1d49 White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't.  Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 06:59:13 +00:00
Fariborz Jahanian c44d91c446 Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
AST node. (finishing off radar 8525788).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 18:40:05 +00:00
Argyrios Kyrtzidis 4045107b73 Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 18:21:24 +00:00
Douglas Gregor 95f4292cc5 When performing typo correction, look through the set of known
identifiers to determine good typo-correction candidates. Once we've
identified those candidates, we perform name lookup on each of them
and the consider the results. 

This optimization makes typo correction > 2x faster on a benchmark
example using a single typo (NSstring) in a tiny file that includes
Cocoa.h from a precompiled header, since we are deserializing far less
information now during typo correction.

There is a semantic change here, which is interesting. The presence of
a similarly-named entity that is not visible can now affect typo
correction. This is both good (you won't get weird corrections if the
thing you wanted isn't in scope) and bad (you won't get good
corrections if there is a similarly-named-but-completely-unrelated
thing). Time will tell whether it was a good choice or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 22:11:03 +00:00
John McCall b870b88df7 At Fariborz's request, a somewhat cleaner bit-combining hack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116524 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 21:48:26 +00:00
Argyrios Kyrtzidis 36d2fd44bf Store in PCH the key function of C++ class to avoid deserializing the complete declaration context in order to compute it.
Progress for rdar://7260160.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 20:14:38 +00:00
Argyrios Kyrtzidis eb5e9986e5 Allow deserialization of just the fields of a record, when we want to iterate over them,
instead of deserializing the complete declaration context of the record.

Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration
that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods.
Fix this by allow deserialization of just the fields when we want to iterate over them.
Progress for rdar://7260160.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 20:14:34 +00:00
Argyrios Kyrtzidis 336d43a368 Give a default implementation for ASTDeserializationListener's methods, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 20:14:28 +00:00
Fariborz Jahanian 8ac2d44982 Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 16:04:05 +00:00
Douglas Gregor 1274ccd90a Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 23:50:27 +00:00
Argyrios Kyrtzidis 9a2b9d794b Implement -fshort-enums (rdar://8490496).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 00:25:19 +00:00
Douglas Gregor 0a0c3e72ce Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:41:58 +00:00
Douglas Gregor 9747583420 Fix a marvelous chained AST writing bug, where we end up with the
following amusing sequence:
  - AST writing schedules writing a type X* that it had never seen
  before
  - AST writing starts writing another declaration, ends up
  deserializing X* from a prior AST file. Now we have two type IDs for
  the same type!
  - AST writer tries to write X*. It only has the lower-numbered ID
  from the the prior AST file, so references to the higher-numbered ID
  that was scheduled for writing go off into lalaland.

To fix this, keep the higher-numbered ID so we end up writing the type
twice. Since this issue occurs so rarely, and type records are
generally rather small, I deemed this better than the alternative: to
keep a separate mapping from the higher-numbered IDs to the
lower-numbered IDs, which we would end up having to check whenever we
want to deserialize any type.

Fixes <rdar://problem/8511624>, I think.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 18:37:06 +00:00
Sebastian Redl 1d9f1fe717 Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 16:15:19 +00:00
Sebastian Redl c3632730cc Thread PerFileData through the ASTReader again, this time with the LLVM changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 15:59:54 +00:00
Douglas Gregor 55f48de5f6 When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 18:21:45 +00:00
Douglas Gregor 77424bc379 Implement chained PCH support for the macro definitions stored within
the "detailed" preprocessing record.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 19:29:26 +00:00
Douglas Gregor b1a7d9a21b Revert r115336 ("Thread PerFileData through everything."), because
we're missing the corresponding changes in the LLVM repository.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 20:33:34 +00:00
Sebastian Redl dc928191a3 Thread PerFileData through everything. This allows us to remap stuff later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 19:59:15 +00:00
Sebastian Redl a866e65287 Record module loaders and module source order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 19:59:12 +00:00
Douglas Gregor dab60ad68a Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 18:44:50 +00:00
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
Douglas Gregor ee9b0ba290 When an identifier that has a macro definition in the original PCH
file is somehow changed in a chained PCH file, make sure that we write
out the macro definition. Fixes part of <rdar://problem/8499034>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 01:03:07 +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
Argyrios Kyrtzidis 1a18600b85 Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 14:54:07 +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 196f557741 My previous fix was incorrect for non-chained PCH reuse. Fix again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 23:20:01 +00:00
Douglas Gregor 3e9438b525 Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:37:28 +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
Argyrios Kyrtzidis 355a9fe26a Implement -Wunused-label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 21:21:25 +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
Michael J. Spencer 560a921b85 Revert "CMake: Update to use standard CMake dependency tracking facilities instead"
This reverts commit r113631

Conflicts:

	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:54:41 +00:00
Sebastian Redl 0dfd848fa4 Eagerly evaluate type traits in Sema instead of lazily in AST. They actually need Sema access to be correct, fixes coming up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:56:31 +00:00
Argyrios Kyrtzidis 4076dacf14 When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:15:54 +00:00
Argyrios Kyrtzidis f1b8911d35 Remove the trivial setters from CXXDeleteExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:15:40 +00:00
Argyrios Kyrtzidis 99a8ca0bdb Fix C++ PCH issue.
The canonical FunctionTemplateDecl contains the specializations but we cannot use getCanonicalDecl on Template because it may still be initializing.
Write and read it from PCH.
Fixes http://llvm.org/PR8134

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 11:45:48 +00:00
Argyrios Kyrtzidis 8fed4b4bc9 Avoid setters in ASTDeclReader::VisitClassTemplatePartialSpecializationDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 11:45:41 +00:00
Argyrios Kyrtzidis 586c7156d5 Avoid setters in ASTDeclReader::VisitClassTemplateSpecializationDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 11:45:32 +00:00
Argyrios Kyrtzidis 8b996b8cb4 Avoid setters in ASTDeclReader::VisitCXXRecordDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 11:45:25 +00:00
Sebastian Redl 5221d8f2da Address Doug's comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 22:34:40 +00:00
Michael J. Spencer 5a7f34958c CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:13:16 +00:00
Sebastian Redl 6b219d0824 Serialization support for CXXNoexceptExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:55:54 +00:00
Douglas Gregor 3d37c0ada0 Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 16:14:44 +00:00
Douglas Gregor ec9bf47565 Clean up CMake dependencies
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 15:44:58 +00:00
Argyrios Kyrtzidis a626a3d0fb Fix C++ PCH issue.
Another beating by boost in this test case: http://llvm.org/PR8117
A function specialization wasn't properly initialized if it wasn't canonical.

I wish there was a nice little test case but this was boost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 11:28:23 +00:00
Ted Kremenek 559fb55460 When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where
covered by individual case statements.  Flow-based analyses may wish to consult this information,
and recording this in the AST allows us to obviate reconstructing this information later when
we build the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 00:05:53 +00:00
Argyrios Kyrtzidis 65b63ec141 Re-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:32:35 +00:00
Argyrios Kyrtzidis 6b54151963 Fix C++ PCH issues.
PCH got a severe beating by the boost-using test case reported here: http://llvm.org/PR8099
Fix issues like:

-When PCH reading, make sure Decl's getASTContext() doesn't get called since a Decl in the parent hierarchy may be initializing.
-In ASTDeclReader::VisitFunctionDecl VisitRedeclarable should be called before using FunctionDecl's isCanonicalDecl()
-In ASTDeclReader::VisitRedeclarableTemplateDecl CommonOrPrev must be initialized before anything else.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 19:31:22 +00:00
Francois Pichet 01b7c3028d Microsoft's __uuidof operator implementation part 1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 12:20:18 +00:00
Douglas Gregor ab6677ec40 Provide proper type-source location information for
CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and
CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the
process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 00:15:04 +00:00
Douglas Gregor 1bb2a93ab7 Improve source-location information for CXXNewExpr, by hanging on to
the TypeSourceInfo for the allocated type. Fixes PR7501.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 21:49:58 +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
Douglas Gregor e2ca6d4a2f Eliminate CXXBindReferenceExpr, which was used in a ton of
well-intentioned but completely unused code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:50:02 +00:00
Benjamin Kramer 1d6107c301 Avoid implicit string construction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 15:06:24 +00:00
Douglas Gregor 7e24256c95 Implement libclang support for using declarations. Clang actually uses
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.

Several related changes here:
  - Cursor visitation of the three AST nodes for using declarations
  - Proper source-range computation for these AST nodes
  - Using declarations have no USRs, since they don't actually declare
    any entities.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:52:22 +00:00
Douglas Gregor 0a35bceb77 Implement libclang support for using directives (cursor + visitation +
suppressing USRs). Also, fix up the source location information for
using directives so that the declaration location refers to the
namespace name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 03:07:18 +00:00
Ted Kremenek 53b9441b5a Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols
(and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in
an @interface declaration.  'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced
in both the @interface and class extensions.  The latter is needed for semantic analysis/codegen, while the former is
needed to maintain the lexical information of the original source.

Fixes <rdar://problem/8380046>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 01:21:15 +00:00
Douglas Gregor 8ea5b9d832 Improve location information in the representation of namespace
aliases. Previously, the location of the alias was at the "namespace"
keyword. Now, it's on the identifier being declared (as is the custom
for Clang), and we keep a separate source location for the "namespace"
keyword.

Also, added a getSourceRange() member function to NamespaceAliasDecl
to correctly compute the source range.

Finally, removed a bunch of setters from NamespaceAliasDecl and gave
ASTReaderDecl friendship so that it could set the corresponding fields
directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 00:08:19 +00:00
Fariborz Jahanian f9b949fecf AST work to support [C++] [IRgen] for ?: with missing LHS
This is also pr7726 and wip. No change in functionality
at this time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:02:20 +00:00
Argyrios Kyrtzidis 9996a7f06a Fix the memory leak of FloatingLiteral/IntegerLiteral.
For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers.
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Fixes rdar://7637185

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 09:06:06 +00:00
John McCall d931b08698 De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 03:08:43 +00:00
John McCall 5baba9d983 More incremental progress towards not including Expr.h in Sema.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 10:28:54 +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 4153a060f4 AST writer support for having specializations of templates from earlier in the chain. This ought to finish C++ chained PCH support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 22:50:24 +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 1d1e42b17d Write visible update blocks. No regressions in normal PCH functionality, but no tests for the chain yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:50:09 +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
Fariborz Jahanian 000835d0b0 Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:51:39 +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
Fariborz Jahanian 2c18bb7c9f objective-c ivar refactoring patch. Iterations
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111679 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 21:21:08 +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 eb3f04e60f 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:04:20 +00:00
Argyrios Kyrtzidis 7fb35182f4 Introduce ASTWriter::GetOrCreateTypeID and move most of the functionality of AddTypeRef there.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:04:14 +00:00
Argyrios Kyrtzidis 26fca90786 A bit of refactoring; Introduce ASTWriter::GetOrCreateTypeIdx and move the emission of types there.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:04:09 +00:00
Argyrios Kyrtzidis 01b81c4d07 Rename TypeIDs -> TypeIdxs. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:04:04 +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
John McCall 096832c5ed Regularize the API for accessing explicit template arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:49:38 +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
Sebastian Redl 3c7f413460 More PCH -> AST renaming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:57:06 +00:00
Sebastian Redl 571db7f0cb Rename various classes from PCH to AST.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:56 +00:00
Sebastian Redl 60adf4acf4 Rename PCHStmtReader -> ASTStmtReader.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:52 +00:00
Sebastian Redl d527cc06d7 Rename PCHDeclReader -> ASTDeclReader.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:48 +00:00
Sebastian Redl c43b54cbc1 Rename PCHReader to ASTReader.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:43 +00:00
Sebastian Redl 7faa2ec03a Rename PCHWriter.h to ASTWriter.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:37 +00:00
Sebastian Redl 4ee2ad0434 Rename the ASTWriter implementation files
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:31 +00:00
Sebastian Redl 3397c55703 Do the PCH->AST rename for ASTWriter's implementation parts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:27 +00:00
Sebastian Redl a4232eb646 Rename PCHWriter to ASTWriter
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:56:21 +00:00
Sean Hunt cf807c4dfd 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:23:40 +00:00
Sebastian Redl 11e6f61091 Fix CMake build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 21:00:23 +00:00
Sebastian Redl 857281328f Reintroduce the serialization library, with fixed dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 20:43:28 +00:00
Douglas Gregor 4557e473c9 Revert Sebastian's build-breaking patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 18:31:01 +00:00
Sebastian Redl 93c972945b 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 17:55:49 +00:00