Commit Graph

8553 Commits

Author SHA1 Message Date
Douglas Gregor 34ec2ef159 Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation
declaration and an explicit instantiation definition, and know not to
instantiate explicit instantiation declarations. Unfortunately, there
is some remaining confusion w.r.t. instantiation of out-of-line member
function definitions that causes trouble here.
 

llvm-svn: 81053
2009-09-04 22:48:11 +00:00
Douglas Gregor d94105a1c2 Don't generate any code for an explicit call to a trivial destructor.
Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!

llvm-svn: 81025
2009-09-04 19:04:08 +00:00
Daniel Dunbar 037f389f4d Merge libgcc spec changes for darwin::Link::ConstructJob.
llvm-svn: 81022
2009-09-04 18:35:47 +00:00
Daniel Dunbar 2b5f6817e0 Tweak darwin::Link::AddLinkArgs.
llvm-svn: 81021
2009-09-04 18:35:41 +00:00
Daniel Dunbar 91dbfd6666 Implement darwin::Link::AddDarwinArch for ARM.
llvm-svn: 81020
2009-09-04 18:35:31 +00:00
Daniel Dunbar 84e727fb72 Darwin: Pass -iphoneos-version-min to ld when building for ARM.
llvm-svn: 81019
2009-09-04 18:35:21 +00:00
Daniel Dunbar 5ed07fe794 Add -ccc-install-dir option for faking installation path.
llvm-svn: 81017
2009-09-04 18:35:03 +00:00
Daniel Dunbar f0a5b9b126 Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.
llvm-svn: 81016
2009-09-04 18:34:51 +00:00
Douglas Gregor bddb73fa1d If a destructor is referenced or a pseudo-destructor expression is
formed without a trailing '(', diagnose the error (these expressions
must be immediately called), emit a fix-it hint, and fix the code.

llvm-svn: 81015
2009-09-04 18:29:40 +00:00
Mike Stump 5a522353c3 Add overidding for methods for vtable building for the secondary
vtables.  Add thunk generation.  WIP.

llvm-svn: 81014
2009-09-04 18:27:16 +00:00
Daniel Dunbar 5095b293b7 Remove unused argument.
llvm-svn: 81010
2009-09-04 17:39:02 +00:00
Douglas Gregor ad8a336b40 Implement AST, semantics, and CodeGen for C++ pseudo-destructor
expressions, e.g.,

  p->~T()

when p is a pointer to a scalar type. 

We don't currently diagnose errors when pseudo-destructor expressions
are used in any way other than by forming a call.

llvm-svn: 81009
2009-09-04 17:36:40 +00:00
Steve Naroff ef9618b75f Implement accessors clang_getCursorKind(), clang_getCursorDecl().
Implement clang_getCursor() - wired up to Argiris's work.
Implement callbacks for CXCursor_ObjCProtocolRef.

llvm-svn: 81004
2009-09-04 15:44:05 +00:00
Douglas Gregor 2d2282e8f9 When searching for a default constructor or copy constructor, skip constructor templates
llvm-svn: 81002
2009-09-04 14:46:39 +00:00
Douglas Gregor 43e75176ec Parse extern templates, pass that information all the way to Sema,
then drop it on the floor.

llvm-svn: 80989
2009-09-04 06:33:52 +00:00
Douglas Gregor 119b0c7185 Introduce an egregious hack to fix PR4828.
The problem this change addresses is that we treat __is_pod and
__is_empty as keywords in C++, because they are built-in type traits
in GCC >= 4.3. However, GNU libstdc++ 4.2 (and possibly earlier
versions) define implementation-detail struct templates named __is_pod
and __is_empty. 

This commit solves the problem by recognizing

  struct __is_pod

and

  struct __is_empty

as special token sequences. When one of these token sequences is
encountered, the keyword (__is_pod or __is_empty) is implicitly
downgraded to an identifier so that parsing can continue. This is an
egregious hack, but it has the virtue of "just working" whether
someone is using libstdc++ 4.2 or not, without the need for special
flags.

llvm-svn: 80988
2009-09-04 05:53:02 +00:00
Zhongxing Xu bfb000f337 move the check into MarkNoReturnFunction.
llvm-svn: 80980
2009-09-04 02:17:35 +00:00
Zhongxing Xu 1748d8a43d Extract mark-no-return-function code into a function.
llvm-svn: 80979
2009-09-04 02:13:36 +00:00
John McCall 06f6fe8df7 Correctly handle elaborated template ids. Still not handled properly for friends.
llvm-svn: 80977
2009-09-04 01:14:41 +00:00
Fariborz Jahanian 37d065680b Patch to instantiate destructors used to destruct
base and data members when they are needed.

llvm-svn: 80967
2009-09-03 23:18:17 +00:00
Anders Carlsson 0e91275ab4 If the alignment of the chosen field in a union is greater than the alignment of the union, we need to use a packed LLVM struct. Fixes <rdar://problem/7184250>.
llvm-svn: 80964
2009-09-03 22:56:02 +00:00
Douglas Gregor f816bd70ce Implement tree transformations for DeclarationNames. Among other
things, this means that we can properly cope with member access
expressions such as 

  t->operator T()

where T is a template parameter (or other dependent type).

llvm-svn: 80957
2009-09-03 22:13:48 +00:00
Douglas Gregor 2b6ca46c6b Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.

llvm-svn: 80953
2009-09-03 21:38:09 +00:00
Fariborz Jahanian 59a1cd4a06 Mark constructors used in initialization of base(s) and fields
as referecned with location where they are used. Still
need to look at destructor aspects of them.

llvm-svn: 80950
2009-09-03 21:32:41 +00:00
Fariborz Jahanian 3501bcec7d Issue diagnostics in variety of situations involving
reference/const data members when user has declared
the constructor. This necessitated some non-minor
refactoring.

llvm-svn: 80934
2009-09-03 19:36:46 +00:00
Daniel Dunbar fe07aecd37 Don't use '%ll', this doesn't workin on Win32.
llvm-svn: 80933
2009-09-03 19:23:49 +00:00
Steve Naroff c0683b909a Add ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().
llvm-svn: 80932
2009-09-03 18:19:54 +00:00
Douglas Gregor c26e0f626b Improved handling for dependent, qualified member access expressions, e.g.,
t->Base::f

where t has a dependent type. We save the nested-name-specifier in the
CXXUnresolvedMemberExpr then, during instantiation, substitute into
the nested-name-specifier with the (transformed) object type of t, so
that we get name lookup into the type of the object expression.

Note that we do not yet retain information about name lookup into the
lexical scope of the member access expression, so several regression
tests are still disabled.

llvm-svn: 80925
2009-09-03 16:14:30 +00:00
Douglas Gregor b3286fe685 Save/load POSIXThreads flag for PCH
llvm-svn: 80916
2009-09-03 14:36:33 +00:00
Daniel Dunbar 3a0637b06b Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

llvm-svn: 80896
2009-09-03 05:59:50 +00:00
Daniel Dunbar 2d9c740cc5 Revert "Remove redundant local variable (use newly created instance data).", the
previous commit this depends on is breaking x86_64-apple-darwin10 and Linux tests.

llvm-svn: 80895
2009-09-03 05:59:35 +00:00
Daniel Dunbar a77eaeb1e6 Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

llvm-svn: 80883
2009-09-03 04:54:28 +00:00
Ted Kremenek 17a0296a09 Fix 80 column violations.
llvm-svn: 80873
2009-09-03 03:02:58 +00:00
David Chisnall 2c5bef2a74 Fixed bug introduced in r79900 where FreeBSD was turned into NetBSD, transposing the ABIs and breaking both platforms.
llvm-svn: 80870
2009-09-03 01:48:05 +00:00
Ted Kremenek b117fd9168 Fix regression introduced in r80786 and reported in PR 4867. We should use
'dyn_cast' instead of 'cast' as the denominator value could be UnknownVal (and
is not guaranteed to be a DefinedVal).

llvm-svn: 80869
2009-09-03 01:48:03 +00:00
Zhongxing Xu 677e6a2faf remove a debug output I introduced in the last commit.
llvm-svn: 80865
2009-09-03 01:31:59 +00:00
Mike Stump 850cc1c5a4 Update.
llvm-svn: 80864
2009-09-03 01:30:36 +00:00
Anders Carlsson 496335ea1a Add CastExpr::getCastKindName and use it in the StmtDumper.
llvm-svn: 80862
2009-09-03 00:59:21 +00:00
Steve Naroff 517ea46e2e Remove redundant local variable (use newly created instance data).
llvm-svn: 80861
2009-09-03 00:43:52 +00:00
Fariborz Jahanian f15d4b6050 This patch does the following.
1) Issue digsnostics in non-fragile ABI, when an expression
   evaluates to an interface type (except when it is used to
   access a non-fragile ivar).
2) Issue unsupported error in fragile ABI when an expression
   evaluates to an interface type (except when it is used to
   access a fragile ivar).

llvm-svn: 80860
2009-09-03 00:43:07 +00:00
Steve Naroff ef3cf2a576 Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().

llvm-svn: 80859
2009-09-03 00:32:06 +00:00
Douglas Gregor 64792e021d Add a wicked little test-case that illustrates what we have to deal
with to properly support member access expressions in templates. This
test is XFAIL'd, because we get it completely wrong, but I've made the
minimal changes to the representation to at least avoid a crash.

llvm-svn: 80856
2009-09-02 23:58:38 +00:00
Douglas Gregor e5feb51624 Don't try to CodeGen using directives, from Anders Johnsen
llvm-svn: 80853
2009-09-02 23:49:23 +00:00
Fariborz Jahanian cc043a7154 Minor refactoring of my last patch.
llvm-svn: 80847
2009-09-02 23:11:48 +00:00
Fariborz Jahanian 3117e2b9d4 Referenced instatiated default constructors
must be defined. Fixed pr4853.

llvm-svn: 80846
2009-09-02 23:02:57 +00:00
Douglas Gregor b7bfe79412 Rewrite of our handling of name lookup in C++ member access expressions, e.g.,
x->Base::f

We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.

We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.

I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.

llvm-svn: 80843
2009-09-02 22:59:36 +00:00
Anders Carlsson 35dca26835 Fix an assertion when initializing a union using a member initializer. (We weren't casting from the union type to the initializer type correctly).
llvm-svn: 80837
2009-09-02 21:14:47 +00:00
John McCall f8bd861ce9 Borrow a friend class's previous declaration's access specifier regardless of
whether the current context is dependent.

Thanks to Anders for pointing this out.

llvm-svn: 80828
2009-09-02 19:32:14 +00:00
Anders Carlsson 2e56cc6e6c Fix a codegen crash when a class template has a constructor that does member initialization of an anonymous union.
llvm-svn: 80826
2009-09-02 19:17:55 +00:00
Anders Carlsson 09a3774cd3 Packed unions should be packed. Fixes an assert Daniel reported.
llvm-svn: 80808
2009-09-02 17:51:33 +00:00
Fariborz Jahanian fc60ca8801 Allow null initialization of scalara data members
in constructors's initializer list. pr4854

llvm-svn: 80802
2009-09-02 17:10:17 +00:00
Zhongxing Xu 6e4232c79c Refactor the check for bad divide into a checker.
Also fix a checker context bug: the Dst set is not always empty initially. 
Because in GRExprEngine::CheckerVisit(), *CurrSet is used repeatedly. 
So we removed the Dst.empty() condition in ~CheckerContext() when deciding
whether to do autotransision.

llvm-svn: 80786
2009-09-02 13:26:26 +00:00
Douglas Gregor c707da6866 Document how we intepret C++ DR 382
llvm-svn: 80785
2009-09-02 13:12:51 +00:00
Douglas Gregor 12bbfe1d31 When parsing typename specifiers (with either the identifier or
simple-template-id form), check whether the scope specifier is
computable as a declaration context rather than checking whether it is
dependent, so that we properly cope with members of the current
instantiation. 

Improve testing for typename specifiers that terminate in a
simpe-template-id.

llvm-svn: 80783
2009-09-02 13:05:45 +00:00
Zhongxing Xu 79affb7b94 Refactor bad callee check into a Checker.
Now bad callee is checked as a PreVisit to the CallExpr.

llvm-svn: 80771
2009-09-02 08:10:35 +00:00
Zhongxing Xu 656b10a1fa Still use BadArg bugtype in the checker. This saves us implement registerInitialVisitors
in the BugReport. 

When all internal bug checking logic are moved to checkers, BuiltinBug will
not reference GRExprEngine, and FlushReports() will be not necessary, since
all bugs are emitted into the equivalent classes immediately.

For now just add a ctor with no arguments.

llvm-svn: 80770
2009-09-02 07:09:39 +00:00
Ted Kremenek cf768cd202 Replace uses of ImmutableSet in SymbolReaper with DenseSet. This was
motivated from Shark profiles that shows that 'markLive' was very
heavy when using --analyzer-store=region.  On my benchmark file, this
reduces the analysis time for --analyzer-store=region from 19.5s to
13.5s and for --analyzer-store=basic from 5.3s to 3.5s.  For the
benchmark file, this is a reduction of about 30% analysis time for
both analysis modes (a huge win).

llvm-svn: 80765
2009-09-02 06:03:18 +00:00
Ted Kremenek ad5a600a24 Implement: <rdar://problem/6337100> CWE-338: Use of cryptographically weak prng
Patch by Geoff Keating!

llvm-svn: 80752
2009-09-02 02:47:41 +00:00
John McCall e94dd7ccf5 When adding a friend class declaration to the lookup tables, use the access specifier
of any previous declaration in case we replace it in a class's declaration table.
Fixes bug 4858.  This sort of thing makes me reconsider putting friend declarations in
declaration lists.

llvm-svn: 80750
2009-09-02 02:15:17 +00:00
John McCall e8dbaef730 Fix a little crasher in friend decls. Thanks again to Eli for finding this.
llvm-svn: 80748
2009-09-02 01:07:03 +00:00
Mike Stump 3f707e9f14 Add mangling for covariant thunks.
llvm-svn: 80747
2009-09-02 00:56:18 +00:00
John McCall 2dc078f24e Ensure that the tag decls of friend decls aren't added to the friending class's
decl list, and remove some workarounds that were due to this.  Thanks to Eli for
pointing this out and providing the test case.

llvm-svn: 80745
2009-09-02 00:55:30 +00:00
Mike Stump a119813218 Shorten name.
llvm-svn: 80744
2009-09-02 00:28:47 +00:00
Mike Stump 9cc7d30435 Add mangling for thunks.
llvm-svn: 80743
2009-09-02 00:25:38 +00:00
Fariborz Jahanian 086ac11606 It is illegal to derefrercne to an interface in
objc's non-fragile ABI.

llvm-svn: 80739
2009-09-02 00:00:05 +00:00
Mike Stump 2348e62498 More overriding base work and some cleanups. WIP.
llvm-svn: 80737
2009-09-01 23:22:44 +00:00
Fariborz Jahanian 5083e2623b After a conversation with Doug. I added a fix me to
where we build the constructor's initializer list.

llvm-svn: 80735
2009-09-01 23:08:16 +00:00
Mike Stump 40dc64bcfc Split out overriding. WIP.
llvm-svn: 80732
2009-09-01 22:20:28 +00:00
Anders Carlsson c82555fb85 Handle member expressions that return references correctly.
llvm-svn: 80723
2009-09-01 21:18:52 +00:00
Anders Carlsson 783ab50b33 Assert that we don't have any virtual bases. We can emit dtors for polymorphics classes just fune.
llvm-svn: 80722
2009-09-01 21:12:16 +00:00
Douglas Gregor a3a3f6fecd In CXXBaseOrMemberInitializer, don't confuse CtorTocall with
AnonUnionMember. Fixes PR4826.

llvm-svn: 80721
2009-09-01 21:04:42 +00:00
Anders Carlsson f1ae6d45dd Use the correct cast kinds for bit casts and function to pointer decay. Fixes PR4827.
llvm-svn: 80720
2009-09-01 20:52:42 +00:00
Anders Carlsson 6904f644e7 Add a CK_FunctionToPointerDecay cast kind.
llvm-svn: 80719
2009-09-01 20:37:18 +00:00
Anders Carlsson 6b8b4b459d We can generate constructors/destructors with base classes and non-trivial fields just fine now.
llvm-svn: 80701
2009-09-01 18:33:46 +00:00
Douglas Gregor 2ffd96549d Implement proper substitution for OverloadedFunctionDecls, but substituting each of the functions in the overload set
llvm-svn: 80692
2009-09-01 17:53:10 +00:00
Douglas Gregor d51896311d Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons
llvm-svn: 80690
2009-09-01 17:22:34 +00:00
Fariborz Jahanian 1a50477385 Fixed a property getter ir-gen crash.
llvm-svn: 80681
2009-09-01 17:02:21 +00:00
Douglas Gregor 32e2c8472e Fix a crasher involving template instantiation of non-dependent
expressions making use of an overloaded operator. Thanks for the test
case, Anders!

llvm-svn: 80679
2009-09-01 16:58:52 +00:00
Daniel Dunbar 6cdf83c192 Add driver support for -emit-ast and AST compilation steps.
- <rdar://problem/7185031> Add 'clang' option '-emit-ast'

llvm-svn: 80678
2009-09-01 16:57:46 +00:00
Anders Carlsson bcec05c9fd Don't assume that a base is always a RecordType, it can also be a TemplateSpecializationType. Also, make sure to get the instantiated union member.
llvm-svn: 80662
2009-09-01 06:22:14 +00:00
Anders Carlsson 62215c4fb5 Add pretty stack traces when instantiating functions and static data members.
llvm-svn: 80661
2009-09-01 05:12:24 +00:00
Anders Carlsson 17dc7e2007 Handle member initializers that point to fields in anonymous structs.
llvm-svn: 80659
2009-09-01 04:31:02 +00:00
Anders Carlsson 5da848427a Don't assert when instantiating member references to fields in anonymous structs.
llvm-svn: 80657
2009-09-01 04:26:58 +00:00
Eli Friedman 1c277d0fe8 PR4836, part 2: CodeGen for __builtin_isnan.
llvm-svn: 80655
2009-09-01 04:19:44 +00:00
Douglas Gregor 84f14dd674 Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

  x->f<int>()

llvm-svn: 80646
2009-09-01 00:37:14 +00:00
Ted Kremenek 3aff920676 Sentence-case bug category.
llvm-svn: 80644
2009-09-01 00:17:12 +00:00
Douglas Gregor f4b34ba326 Remember to write the qualifier of a MemberExpr to the PCH file when we get to C++ PCH
llvm-svn: 80643
2009-08-31 23:44:04 +00:00
Douglas Gregor f405d7e6f1 Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocate
space within the MemberExpr for the nested-name-specifier and its
source range. We'll do the same thing with explicitly-specified
template arguments, assuming I don't flip-flop again.

llvm-svn: 80642
2009-08-31 23:41:50 +00:00
John McCall 759e32bdc6 Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.

llvm-svn: 80636
2009-08-31 22:39:49 +00:00
Devang Patel 124095bb18 Rename DIBlock as DILexicalBlock.
llvm-svn: 80634
2009-08-31 22:00:32 +00:00
Douglas Gregor 96ee789d33 Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
also be adding explicit template arguments as an additional
"adornment". No functionality change.

llvm-svn: 80628
2009-08-31 21:41:48 +00:00
Douglas Gregor fbc1823451 Add parsing for references to member function templates with explicit
template argument lists, e.g., x.f<int>().

Semantic analysis will be a separate commit.

llvm-svn: 80624
2009-08-31 21:16:32 +00:00
Eli Friedman 7e4faaccda PR4836, part 1: add Sema support for __builtin_isnan and friends; they
are apparently used by Solaris libc despite the fact that clang claims 
to be compatible with gcc 4.2, which doesn't support them.

llvm-svn: 80610
2009-08-31 20:06:00 +00:00
Douglas Gregor f14b46f9a8 Implement template instantiation for member operator access.
llvm-svn: 80609
2009-08-31 20:00:26 +00:00
Douglas Gregor 522fbc4969 Support explicit C++ member operator syntax, from James Porter!
llvm-svn: 80608
2009-08-31 19:52:13 +00:00
Fariborz Jahanian 879d726608 Re-implemented generation of objc_memmove_collectable
API for copying GC'able aggregates (Next runtime only).

llvm-svn: 80607
2009-08-31 19:33:16 +00:00
Daniel Dunbar 6733a7ec15 Fix a -Asserts warning.
llvm-svn: 80606
2009-08-31 19:16:38 +00:00
David Chisnall 5778fce141 Updated GNU runtime non-fragile ABI.
Added -fconstant-string-class= option.
Added __has_feature() test for non-fragile ABI.

llvm-svn: 80591
2009-08-31 16:41:57 +00:00
Anders Carlsson b533df02b5 More missing member goodness.
llvm-svn: 80491
2009-08-30 07:09:50 +00:00
Anders Carlsson 0d2a51b61f Improve missing error messages as suggested by Doug.
llvm-svn: 80489
2009-08-30 06:49:43 +00:00
Anders Carlsson 5167a4644d Use DiagnoseMissingMember for UsingDecls.
llvm-svn: 80470
2009-08-30 00:58:45 +00:00
Anders Carlsson 896c230a19 Improve diagnostics for missing members. This renames the err_typecheck_no_member to err_typecheck_no_member_deprecated. The idea is that err_typecheck_no_member_deprecated should be phased out and any call sites that reference it should call DiagnoseMissingMember instead.
llvm-svn: 80469
2009-08-30 00:54:35 +00:00
Eli Friedman 744a249493 Unbreak tests. I'll look into why this is necessary later.
llvm-svn: 80468
2009-08-30 00:53:54 +00:00
Argyrios Kyrtzidis 321995b5e5 Fix the start source location for type-specs like long, short, etc.
llvm-svn: 80448
2009-08-29 22:39:34 +00:00
Eli Friedman 15e05261d4 Make instantiating initializers for classes with a dependent base type
work correctly.

The change in lib/AST/DeclCXX.cpp is mostly a large reindentation; I 
couldn't figure out a good way to avoid it.

llvm-svn: 80446
2009-08-29 22:22:07 +00:00
Eli Friedman 033e8d4ae6 Make IRGen for initializing a member reference work correctly.
llvm-svn: 80439
2009-08-29 20:58:20 +00:00
Anders Carlsson adf36b2379 Add a workaround for decls that come from friend decls pointing to undeclared classes.
llvm-svn: 80438
2009-08-29 20:47:47 +00:00
Anders Carlsson 6df9e076ea In DeclPrinter, assert when asked to print AS_None.
llvm-svn: 80437
2009-08-29 20:36:12 +00:00
Fariborz Jahanian 0a484d007b Patch to ir-gen user-defined conversions used in expressions
[12.3.2-p3]

llvm-svn: 80436
2009-08-29 20:33:32 +00:00
Anders Carlsson 7b194b780d Set the access specifier for using decls.
llvm-svn: 80435
2009-08-29 19:54:19 +00:00
Anders Carlsson 4bb87ce33e Improve instantiation of UnresolvedUsingDecls.
llvm-svn: 80434
2009-08-29 19:37:28 +00:00
Fariborz Jahanian 3df8767869 Patch for code gen. for c-style cast which ends in
using class's conversion functions [12.3.2-p2]

llvm-svn: 80433
2009-08-29 19:15:16 +00:00
Eli Friedman 9ab0319b2b Get rid of mostly-unused, buggy method.
llvm-svn: 80432
2009-08-29 19:09:59 +00:00
John McCall 5966088621 Fix the breakage by handling indirect instantiations. This would be much
improved if there were a consistent name for getInstantiatedFromMemberX()
across all classes.  Cheap refactor if someone wants to do it, but let's get the
buildbots happy first.

llvm-svn: 80425
2009-08-29 08:11:13 +00:00
Anders Carlsson 705539441b Instantiate member and base initializers. Patch by Anders Johnsen! (tweaked slightly by me)
llvm-svn: 80422
2009-08-29 05:16:22 +00:00
Eli Friedman 2624be4fd4 Fix a couple issues with parsing invalid nested-name-specifiers.
llvm-svn: 80421
2009-08-29 04:08:08 +00:00
John McCall 75c03bbb0c For consistency, just make friend declarations AS_public.
llvm-svn: 80420
2009-08-29 03:50:18 +00:00
John McCall 970d530a84 Ensure code generation for friend declarations in class templates.
llvm-svn: 80418
2009-08-29 03:16:09 +00:00
Zhongxing Xu 6fd66d4588 Refactor undefined argument checking into a Checker.
llvm-svn: 80417
2009-08-29 02:11:01 +00:00
Anders Carlsson 1e172e068f Store the SourceLocation of right parentheses in member initializers. Patch by Anders Johnsen!
llvm-svn: 80416
2009-08-29 01:31:33 +00:00
Anders Carlsson 6e1ca8315c Don't assert that friend declarations must have access specifiers for now.
llvm-svn: 80415
2009-08-29 01:13:02 +00:00
Anders Carlsson 938b10079a CreateDeclRefExprs that point to UnresolvedUsingDecls.
llvm-svn: 80413
2009-08-29 01:06:32 +00:00
Anders Carlsson a884e67485 Add another check for UnresolvedUsingDecl.
llvm-svn: 80412
2009-08-29 00:56:38 +00:00
Mike Stump beefdc8948 iGenerate vcalls as we build up the methods. WIP.
llvm-svn: 80405
2009-08-28 23:22:54 +00:00
Douglas Gregor 90820ee62a Make sure we actually found a redeclaration before complaining about attributes added to a redeclaration in C++
llvm-svn: 80403
2009-08-28 22:54:55 +00:00
Anders Carlsson 601d6e4c7b Add printing of access specifiers to DeclPrinter. The formatting is pretty bad but it works :)
llvm-svn: 80402
2009-08-28 22:39:52 +00:00
Douglas Gregor c37709b3c5 Remove #if 0'd code that is clearly not needed
llvm-svn: 80399
2009-08-28 22:06:43 +00:00
Fariborz Jahanian 2fee79a9a1 path to ir-gen 12.3.1 Conversion by constructor
llvm-svn: 80398
2009-08-28 22:04:50 +00:00
Douglas Gregor f3db003358 Don't crash when instantiating templates containing anonymous structs/unions
llvm-svn: 80397
2009-08-28 22:03:51 +00:00
Douglas Gregor 11395b66c6 Test instantiation of static data members that live within nested
member templates.

llvm-svn: 80396
2009-08-28 21:41:19 +00:00
Douglas Gregor d99bb43068 Fix and test template instantiation for nested member templates.
llvm-svn: 80394
2009-08-28 21:09:48 +00:00
Douglas Gregor 39cacdb04b Tighten up the conversion from a single-level template argument list
to a multi-level template argument list by making it explicit. The
forced auditing of callers found a bug in the instantiation of member
classes inside member templates.

I *love* static type systems.

llvm-svn: 80391
2009-08-28 20:50:45 +00:00
Douglas Gregor 6533292684 Remove the conversion from a multi-level template argument list back to a single template argument list. We no longer need this crutch
llvm-svn: 80390
2009-08-28 20:33:09 +00:00
Douglas Gregor 01afeeff1d Implement template instantiation for member class templates.
When performing template instantiation of the definitions of member
templates (or members thereof),  we build a data structure containing
the template arguments from each "level" of template
instantiation. During template instantiation, we substitute all levels
of template arguments simultaneously. 

llvm-svn: 80389
2009-08-28 20:31:08 +00:00
Ted Kremenek 52ac2b5735 retain/release checker: [CIContext createCGImage...] and friends returned CF
objects that are not automatically garbage collected. This fixes
<rdar://problem/7174400>.

llvm-svn: 80387
2009-08-28 19:52:12 +00:00
Anders Carlsson df5a1c8b5d Improve support for using decls in the decl printer.
llvm-svn: 80386
2009-08-28 19:16:39 +00:00
Anders Carlsson 01ff6d7094 Check for UnresolvedUsingDecl when determining if a declaration is a redeclaration or not.
llvm-svn: 80383
2009-08-28 17:57:07 +00:00
Fariborz Jahanian b1771e4e74 patch to prevent crash in hopelessly incorrect
method definition with labels.

llvm-svn: 80381
2009-08-28 17:52:37 +00:00
Douglas Gregor a654dd8ae8 Collect multiple levels of template arguments into a new type,
MultiLevelTemplateArgumentList. This is a baby step toward
instantiating member templates; no intended functionality change yet.

llvm-svn: 80380
2009-08-28 17:37:35 +00:00
Anders Carlsson d20e795a5b Fix this for real.
llvm-svn: 80377
2009-08-28 16:57:08 +00:00
Anders Carlsson f2bc7c386e Allow explicit ctors for casts.
llvm-svn: 80374
2009-08-28 16:22:20 +00:00
Anders Carlsson 759b78951e When doing overload resolution, expressions that are value dependent but not type dependent and of integral type should not be treated as null pointer constants.
llvm-svn: 80369
2009-08-28 15:55:56 +00:00
Anders Carlsson 228eea36a3 Pass InOverloadResolution all the way down to IsPointerConversion.
llvm-svn: 80368
2009-08-28 15:33:32 +00:00
Anders Carlsson 4bd7875b9c Instantiate unresolved using declarations.
llvm-svn: 80366
2009-08-28 15:18:15 +00:00
Fariborz Jahanian 8b899e4247 ir-gen related patch for type conversion
with class type conversion methods. WIP.

llvm-svn: 80365
2009-08-28 15:11:24 +00:00
John McCall aa74a0c3b5 Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not.  Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.

llvm-svn: 80353
2009-08-28 07:59:38 +00:00
Anders Carlsson f038fc2c12 Create UnresolvedUsingDecls.
llvm-svn: 80346
2009-08-28 05:49:21 +00:00
Anders Carlsson 696a3f199b Factor declaration building out to Sema::BuildUsingDeclaration.
llvm-svn: 80337
2009-08-28 05:40:36 +00:00
Anders Carlsson 8305c1fa97 Check in UnresolvedUsingDecl.
llvm-svn: 80336
2009-08-28 05:30:28 +00:00
Ted Kremenek 198a8c5f95 Use SymbolicRegion instead of CodeTextRegion for symbolic function
pointers.  Most logic cares first about whether or not a region is
symbolic, and second if represents code.  This should fix a series of
silent corner case bugs (as well as simplify a bunch of code).

llvm-svn: 80335
2009-08-28 04:49:15 +00:00
Anders Carlsson 5a9c5acf0f More work on using declarations.
llvm-svn: 80333
2009-08-28 03:35:18 +00:00
Anders Carlsson 59140b3b86 Many improvements to using declarations.
llvm-svn: 80332
2009-08-28 03:16:11 +00:00
Ted Kremenek aeca0954c2 Use C++ style comments.
llvm-svn: 80320
2009-08-28 00:24:55 +00:00
Ted Kremenek d032fcce5c Implement: <rdar://problem/6337132> CWE-273: Failure to Check Whether Privileges
Were Dropped Successfully

Patch by Geoff Keating!

llvm-svn: 80313
2009-08-28 00:08:09 +00:00
Douglas Gregor 6a1f965853 When looking for overloaded member operators, make sure to instantiate
class template specializations (when possible) and look into base
classes. Thanks to Eli for the test case!

FIXME -=1.

llvm-svn: 80302
2009-08-27 23:35:55 +00:00
Ted Kremenek ce499c2078 CFG construction: Abort CFG construction when processing a CompoundStmt if any
of its subexpressions resulted in a "bad CFG".

llvm-svn: 80298
2009-08-27 23:16:26 +00:00
Ted Kremenek 1d5f2f3546 Rename 'bindExpr' to 'BindExpr'.
llvm-svn: 80294
2009-08-27 22:17:37 +00:00
Ted Kremenek 0ac724be55 Move the AnalysisContext* from GRState to Environment.
llvm-svn: 80293
2009-08-27 22:15:20 +00:00
Eli Friedman 80110179f4 Define _GNU_SOURCE in C++ mode so that clang works with GNU libstdc++.
llvm-svn: 80289
2009-08-27 22:01:41 +00:00
Eli Friedman ff083ef429 Clean up CodeGenFunction::EmitCastLValue to use the cast kind. Error
out for user-defined conversions instead of crashing.

llvm-svn: 80282
2009-08-27 21:19:33 +00:00
Eli Friedman bda4ef15ce Fix for PR4794 (instantiating friend class decl); this version shouldn't
cause any regressions.

llvm-svn: 80277
2009-08-27 19:11:42 +00:00
Eli Friedman 1e97108bdd Back out bad piece of r80272. Will look at fixing this a different way.
llvm-svn: 80273
2009-08-27 18:44:04 +00:00
Eli Friedman 7a61407d0b PR4794: Make instantiating friend class decls not crash.
llvm-svn: 80272
2009-08-27 18:38:56 +00:00
Anders Carlsson 20d1332d76 Add an InOverloadResolution flag to TryCopyInitialization.
llvm-svn: 80261
2009-08-27 17:37:39 +00:00
Anders Carlsson 271e3a4d47 Remove more default arguments.
llvm-svn: 80260
2009-08-27 17:30:43 +00:00
Anders Carlsson ef4c72135f Remove default arguments from TryImplicitConversion and fix a bug found in the process.
llvm-svn: 80258
2009-08-27 17:24:15 +00:00
Anders Carlsson 03068aa077 Remove default argument from TryCopyInitialization.
llvm-svn: 80256
2009-08-27 17:18:13 +00:00
Anders Carlsson 5ec4abf268 Revert the flags change for now, I have a better idea for this.
llvm-svn: 80255
2009-08-27 17:14:02 +00:00
Douglas Gregor e704c9df31 Implement instantiation of the declarations of member function
templates within class templates, producing a member function template
of a class template specialization. If you can parse that, I'm
sorry. Example:

  template<typename T>
  struct X {
    template<typename U> void f(T, U);
  };

When we instantiate X<int>, we now instantiate the declaration
X<int>::f, which looks like this:

  template<typename U> void X<int>::f(int, U);

The path this takes through
TemplateDeclInstantiator::VisitCXXMethodDecl is convoluted and
ugly, but I don't know how to improve it yet. I'm resting my hopes on
the multi-level substitution required to instantiate definitions of
nested templates, which may simplify this code as well.

More testing to come...

llvm-svn: 80252
2009-08-27 16:57:43 +00:00
Anders Carlsson 2f7e956f16 Add a OverloadResolutionFlags and start converting some of the overload methods over to using it instead of bools arguments.
llvm-svn: 80248
2009-08-27 16:01:18 +00:00
Zhongxing Xu 3ca89b9f20 Remove a unused member variable. Instead query the option from AnalysisManager.
llvm-svn: 80226
2009-08-27 06:55:26 +00:00
Douglas Gregor e985a3b724 When checking whether one declaration context encloses another, make sure to look at the primary contexts. Thanks to Eli for the test case
llvm-svn: 80212
2009-08-27 06:03:53 +00:00
Anders Carlsson 35d6e3e710 Don't check member and base initializers if the constructor is dependent.
llvm-svn: 80211
2009-08-27 05:57:30 +00:00
Anders Carlsson e0eebb3ee4 Use early returns to avoid indentation.
llvm-svn: 80209
2009-08-27 05:45:01 +00:00
Eli Friedman 561154dd6b Stub out an error so we don't crash.
llvm-svn: 80207
2009-08-27 05:09:36 +00:00
Anders Carlsson 574315a0fa Add a BuildCXXTemporaryObjectExpr and use it so default arguments will be instantiated correctly for temporary object expressions.
llvm-svn: 80206
2009-08-27 05:08:22 +00:00
Anders Carlsson 55243168df In ActOnCXXTypeConstructExpr, check that the type is complete and non-abstract before creating any expressions. This assures that any templates are instantiated if necessary.
llvm-svn: 80200
2009-08-27 03:53:50 +00:00
Ted Kremenek 907a711f60 Simplify 'Environment' to contain only one map from 'const Stmt*' to SVals, greatly simplifying the logic of the analyzer in many places. We now only distinguish between block-level expressions and subexpressions in Environment::RemoveDeadBindings and GRState pretty-printing.
llvm-svn: 80194
2009-08-27 01:39:13 +00:00
Anders Carlsson eabf770457 New RequireNonAbstractType function.
llvm-svn: 80183
2009-08-27 00:13:57 +00:00
Anders Carlsson d624e16833 Bye-bye old RequireCompleteType.
llvm-svn: 80182
2009-08-26 23:45:07 +00:00
Mike Stump a0d0e6fcb1 Fixup codegen for static dispatch to a virtual function that was
almost correct.  :-)

llvm-svn: 80181
2009-08-26 23:38:08 +00:00
Fariborz Jahanian c71f094c08 ir-gen for type convesion of class objects. WIP.
llvm-svn: 80178
2009-08-26 23:31:30 +00:00
Douglas Gregor ce2a5e18f2 Make sure to bump the reference count of the last element in the ParenListExpr representing the direct initializer of a declaration
llvm-svn: 80177
2009-08-26 23:26:04 +00:00
Anders Carlsson 3c912f66c8 Remove another unused argument.
llvm-svn: 80175
2009-08-26 23:00:36 +00:00
Anders Carlsson 029fc690d3 Remove the PrintType argument from RequireCompleteType.
llvm-svn: 80174
2009-08-26 22:59:12 +00:00
Douglas Gregor c190523d7a When a member reference expression includes a qualifier on the member
name, e.g.,
  
  x->Base::f()

retain the qualifier (and its source range information) in a new
subclass of MemberExpr called CXXQualifiedMemberExpr. Provide
construction, transformation, profiling, printing, etc., for this new
expression type.

When a virtual function is called via a qualified name, don't emit a
virtual call. Instead, call that function directly. Mike, could you
add a CodeGen test for this, too?

llvm-svn: 80167
2009-08-26 22:36:53 +00:00
Anders Carlsson f68079e77b Add a RequireCompleteType variant that takes a PartialDiagnostic. The old RequireCompleteType now creates a PartialDiagnostic and calls the new function.
llvm-svn: 80165
2009-08-26 22:33:56 +00:00
Mike Stump 3722f5896c Regularize the case and sort.
llvm-svn: 80163
2009-08-26 22:31:08 +00:00
Douglas Gregor 402250f2f9 Implement support for C++ direct initializers that involve dependent
types or type-dependent expressions.

llvm-svn: 80143
2009-08-26 21:14:46 +00:00
Mike Stump 849416a388 More work for conversion functions.
llvm-svn: 80142
2009-08-26 21:11:25 +00:00
Mike Stump a5588bf3ac Implement virtual dispatch. :-) This is self-consistent with clang,
but not yet necessarily perfectly consistent with gcc.  Also addressed
Doug and John's comments.

llvm-svn: 80137
2009-08-26 20:46:33 +00:00
Fariborz Jahanian d79d5053bd AST for conversion by conversion functions. WIP.
llvm-svn: 80135
2009-08-26 20:34:58 +00:00
Eli Friedman 95f896380f Make address-space qualification work correctly for compound literals.
Issue reported on cfe-dev.

Also fixed the code to use isConstant to determine whether to generate a 
constant global, to be consistent with CodeGenModule.  This probably 
needs to be refactored to deal with C++, though.

llvm-svn: 80131
2009-08-26 20:01:39 +00:00
Anders Carlsson c24fc2949e More support for pseudo dtors.
llvm-svn: 80129
2009-08-26 19:22:42 +00:00
Fariborz Jahanian 1cec0c4c94 update to CXXFunctionalCastExpr to support ir-gen for
type convesions of class objects [class.conv]. WIP.

llvm-svn: 80127
2009-08-26 18:55:36 +00:00
Douglas Gregor 13789b3af2 Make sure to compare primary declaration contexts when determining whether a declaration is in scope
llvm-svn: 80126
2009-08-26 18:54:58 +00:00
Douglas Gregor 5e0962f944 When we know that we are parsing a class-name, implicitly construct a
TypenameType if getTypeName is looking at a member of an unknown
specialization. This allows us to properly parse class templates that
derived from type that could only otherwise be described by a typename type, 
e.g.,

  template<class T> struct X {};
  template<typename T> struct Y : public X<T>::X { }; 

Fixes PR4381.

llvm-svn: 80123
2009-08-26 18:27:52 +00:00
Anders Carlsson f571c11d54 Add Sema::BuildMemberReferenceExpr and have Sema::ActOnMemberReferenceExpr call it.
llvm-svn: 80122
2009-08-26 18:25:21 +00:00
Anders Carlsson e7b9d71aab Address some of Doug's comments.
llvm-svn: 80114
2009-08-26 17:36:19 +00:00
Douglas Gregor e9899d9769 Fix for overloaded binary operators whose operands need implicit
conversions, from Sylvere Teissier!

llvm-svn: 80112
2009-08-26 17:08:25 +00:00
Douglas Gregor 7e112b0d79 Source location information for ? and : in a ConditionalOperator, from Enea Zaffanella
llvm-svn: 80097
2009-08-26 14:37:04 +00:00
Douglas Gregor 66a985d16e Fix bug in __extension__ handling for declarations, from Abramo
Bagnara with a fix from Enea Zaffanella!

llvm-svn: 80094
2009-08-26 14:27:30 +00:00
Anders Carlsson 458055a890 Revert r80064 since it broke the build.
llvm-svn: 80066
2009-08-26 03:30:14 +00:00
Mike Stump fbddfdacdc Implement virtual dispatch. :-) This is self-consistent with clang, but not yet
necessarily perfectly consistent with gcc.

llvm-svn: 80064
2009-08-26 01:54:35 +00:00
Fariborz Jahanian 2c73b1d2a2 Simplified default construction of array data members
in the constructor prologue.

llvm-svn: 80060
2009-08-26 00:23:27 +00:00
Douglas Gregor 053f691d5e Improve diagnostics and recovery when the nested-name-specifier of a
qualified name does not actually refer into a class/class
template/class template partial specialization. 

Improve printing of nested-name-specifiers to eliminate redudant
qualifiers. Also, make it possible to output a nested-name-specifier
through a DiagnosticBuilder, although there are relatively few places
that will use this leeway.

llvm-svn: 80056
2009-08-26 00:04:55 +00:00
Anders Carlsson 7e3f0e4e0d Parsing of pseudo-destructors.
llvm-svn: 80055
2009-08-25 23:46:41 +00:00
Ted Kremenek c4c48be88e Fix regression in BasicStoreManager caused by implicitly casting loaded values and trying to load/store from arrays. RegionStoreManager already properly handles these cases well; we just need to gracefully not handle this case in BasicStoreManager. This fixes PR 4781.
llvm-svn: 80051
2009-08-25 23:29:04 +00:00
Ted Kremenek d1d6066be8 Handle pointer arithmetic in RegionStoreManager involving Objective-C pointers
when using the non-fragile Objective-C ABI.  This fixes <rdar://problem/7168531>.

llvm-svn: 80047
2009-08-25 22:55:09 +00:00
Douglas Gregor e861bac059 Improve support for out-of-line definitions of nested templates and
their members, including member class template, member function
templates, and member classes and functions of member templates.

To actually parse the nested-name-specifiers that qualify the name of
an out-of-line definition of a member template, e.g.,

  template<typename X> template<typename Y>
  X Outer<X>::Inner1<Y>::foo(Y) {
    return X();
  }

we need to look for the template names (e.g., "Inner1") as a member of
the current instantiation (Outer<X>), even before we have entered the
scope of the current instantiation. Since we can't do this in general
(i.e., we should not be looking into all dependent
nested-name-specifiers as if they were the current instantiation), we
rely on the parser to tell us when it is parsing a declaration
specifier sequence, and, therefore, when we should consider the
current scope specifier to be a current instantiation.

Printing of complicated, dependent nested-name-specifiers may be
somewhat broken by this commit; I'll add tests for this issue and fix
the problem (if it still exists) in a subsequent commit.

llvm-svn: 80044
2009-08-25 22:51:20 +00:00
John McCall 76d824f3f9 Clarify the difference between substitution and instantiation by renaming
functions that don't instantiate definitions.

llvm-svn: 80037
2009-08-25 22:02:44 +00:00
Ted Kremenek 3ed9543ace Fix crash reported in <rdar://problem/7124210> by "back-porting" some of the
implicit cast logic in RegionStoreManager to BasicStoreManager. This involved
moving CastRetriedVal from RegionStoreManager to StoreManager.

llvm-svn: 80026
2009-08-25 20:51:30 +00:00
Ted Kremenek 3a459dc8c9 Move logic of GRExprEngine::EvalBinOp to SValuator::EvalBinOp.
llvm-svn: 80018
2009-08-25 18:44:25 +00:00
John McCall 1dfa9a9872 Modify an assert to capture the restriction on friend declarations more
accurately.  Prevents the assert from triggering incorrectly when friending 
functions first declared in extern "C" contexts.  Fixes bug 4757.

llvm-svn: 80016
2009-08-25 17:53:59 +00:00
Douglas Gregor 1d5e9f9368 Implement out-of-line definitions of nested class templates. Most of
the logic is there for out-of-line definitions with multiple levels of
nested templates, but this is still a work-in-progress: we're having
trouble determining when we should look into a dependent
nested-name-specifier. 

llvm-svn: 80003
2009-08-25 17:23:04 +00:00
Fariborz Jahanian 797cf62703 Skip over bases/fields with dependent types.
Fixes pr4771.

llvm-svn: 79999
2009-08-25 16:37:49 +00:00
Dan Gohman a98e0e73de Update clang for raw_fd_ostream no longer requiring F_Force.
llvm-svn: 79991
2009-08-25 15:36:09 +00:00
Anders Carlsson be96bc94e8 Handle the implicit 'this' parameter for format attributes.
llvm-svn: 79987
2009-08-25 14:12:34 +00:00
Anders Carlsson 114056f22c If a parameter has a default argument expression, make sure to instantiate the parameter type before checking that the expression is a valid initializer.
llvm-svn: 79986
2009-08-25 13:46:13 +00:00
Anders Carlsson 6c0a6e490c Emit conversion functions correctly.
llvm-svn: 79985
2009-08-25 13:14:46 +00:00
Anders Carlsson 10ebe78730 Improved support for default arguments in constructors for class templates.
llvm-svn: 79984
2009-08-25 13:07:08 +00:00
Zhongxing Xu 342950efc5 Remove CodeDecl and CFG from GRExprEngine and GRStateManager.
Now AnalysisManager is the only place we can get CodeDecl.
This leads to an API change: GRState::bindExpr() now takes the CFG argument.

llvm-svn: 79980
2009-08-25 06:51:30 +00:00
Anders Carlsson c1eb79b7c9 InitializeVarWithConstructor now returns true on failure.
llvm-svn: 79976
2009-08-25 05:18:00 +00:00
Anders Carlsson 6eb55575da BuildCXXConstructExpr now returns an OwningExprResult.
llvm-svn: 79975
2009-08-25 05:12:04 +00:00
Anders Carlsson 355933d096 Factor building of CXXDefaultArgExpr expressions out into a separate function.
llvm-svn: 79974
2009-08-25 03:49:14 +00:00
Zhongxing Xu 94ec649b33 Remove Decl and CFG from ExplodedGraph. This leads to a series small changes.
llvm-svn: 79973
2009-08-25 03:33:41 +00:00
Anders Carlsson 4562f1f066 Basic support for default argument expressions for function templates.
llvm-svn: 79972
2009-08-25 03:18:48 +00:00
Anders Carlsson c80a127c4d Factor setting default arguments out into SetParamDefaultArgument.
llvm-svn: 79970
2009-08-25 02:29:20 +00:00
Anders Carlsson 12e022ddbf Fix ivar layout map generation (hopefully).
llvm-svn: 79968
2009-08-25 02:07:02 +00:00
Anders Carlsson 5a532380a1 Use hasDefaultArg instead of getDefaultArg.
llvm-svn: 79967
2009-08-25 01:23:32 +00:00
Anders Carlsson f1c2695d48 Check that the default argument is well-formed before checking the initializer types.
llvm-svn: 79964
2009-08-25 01:02:06 +00:00
Douglas Gregor 9d01b5b40c Eliminate a GCC warning
llvm-svn: 79962
2009-08-25 00:17:23 +00:00
Fariborz Jahanian a6a3494c1d Remove #ifdef'out code.
llvm-svn: 79956
2009-08-24 23:16:37 +00:00
Douglas Gregor a3dff8e37a Keep track of the template parameter depth properly when we have
member templates declared inside other templates. This allows us to
match out-of-line definitions of member function templates within
class templates to the declarations within the class template. We
still can't handle out-of-line definitions for member class templates,
however.

llvm-svn: 79955
2009-08-24 23:03:25 +00:00
Ted Kremenek d6cfbafd3b ConstraintManager::AssumeDual now accepts a 'DefinedSVal' instead of 'SVal' for
the condition. This eliminates a source of bugs where the client doesn't
correctly reason about undefined or unknown values. This fixes PR 4759.

llvm-svn: 79952
2009-08-24 22:47:34 +00:00
Daniel Dunbar a6b4a3d646 PR4766: Don't pass -static to 'as' on x86_64 on Darwin.
Also, do pass -static even with -dynamic on i386.

llvm-svn: 79948
2009-08-24 22:26:16 +00:00
Fariborz Jahanian 7c07d5fed8 Remove ivarlayout bitmap optimization, instead if all zeros,
put out the bitmap when all objects are scanned.

llvm-svn: 79947
2009-08-24 21:55:06 +00:00
Douglas Gregor 4c95288f64 Don't try to evaluate an expression that is type- or value-dependent while building the CFG
llvm-svn: 79941
2009-08-24 21:39:56 +00:00
Douglas Gregor f2270430a1 Skip transparent contexts when performing C++ name lookup
llvm-svn: 79931
2009-08-24 18:55:03 +00:00
Anders Carlsson c327709db8 Handle array to pointer decay in EmitCastExpr and get rid of VisitImplicitCastExpr.
llvm-svn: 79930
2009-08-24 18:37:17 +00:00
Anders Carlsson 3df53bcf10 Handle CK_NullToMemberPointer in ScalarExprEmitter::EmitCast
llvm-svn: 79929
2009-08-24 18:26:39 +00:00
Anders Carlsson 15583e4493 Pass the cast kind to ScalarExprEmitter::EmitCastExpr.
llvm-svn: 79928
2009-08-24 18:12:39 +00:00
Anders Carlsson 83133d9a74 Use the right cast kind when comparing null to member pointers.
llvm-svn: 79927
2009-08-24 18:03:14 +00:00
Douglas Gregor b00b10eb2e Implement support for equality comparisons (!=, ==) of member
pointers, by extending the "composite pointer type" logic to include
member pointer types.

Introduce test cases for member pointer comparisons, including those
that involve the builtin operator candidates implemented earlier. 

llvm-svn: 79925
2009-08-24 17:42:35 +00:00
Chris Lattner e6434cb421 normalize the CharacterLiteral::getLocation method name, patch
by Enea Zaffanella!

llvm-svn: 79924
2009-08-24 17:39:36 +00:00
Fariborz Jahanian 20464fba70 Fixes pr4763.
llvm-svn: 79923
2009-08-24 17:19:23 +00:00
Anders Carlsson 867b48f713 More member pointer work.
llvm-svn: 79922
2009-08-24 17:16:23 +00:00
Anders Carlsson 4557b2c0c2 Remove dead code
llvm-svn: 79921
2009-08-24 16:52:33 +00:00
Douglas Gregor 8a2e601917 Try to complete a type before looking for conversion functions within
that type. Note that we do not produce a diagnostic if the type is
incomplete; rather, we just don't look for conversion functions. Fixes PR4660.

llvm-svn: 79919
2009-08-24 15:23:48 +00:00
Douglas Gregor 84605aeac9 Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.

llvm-svn: 79917
2009-08-24 13:43:27 +00:00
Torok Edwin db7149246f Fix build of clang with gcc-4.4: #include <cstdio> was missing.
llvm-svn: 79916
2009-08-24 13:25:12 +00:00
Douglas Gregor 8b9575f27e Top-level semicolons are allowed in C++0x. Fixes PR4755.
llvm-svn: 79912
2009-08-24 12:17:54 +00:00
Douglas Gregor c8c277a1b3 Make sure to adjust function template declarations to their templated
declarations (e.g., FunctionTemplateDecl -> CXXConstructorDecl) before
performing semantic analysis on the declarations. Fixes PR4761.

llvm-svn: 79911
2009-08-24 11:57:43 +00:00
Daniel Dunbar 576d90d39b Remove TargetInfo::getTargetPrefix().
llvm-svn: 79907
2009-08-24 09:54:37 +00:00
Daniel Dunbar 8100d01ecf Switch to StringRef based BitstreamWriter APIs, where appropriate.
- There is lots of non-endian safe code in here... :/

llvm-svn: 79905
2009-08-24 09:31:37 +00:00
Daniel Dunbar 516bb9dd76 Remove arch normalization from Driver, this should be unnecessary now that
things have moved to llvm::Triple.

llvm-svn: 79902
2009-08-24 09:16:49 +00:00
Daniel Dunbar 40165180f7 Switch TargetInfo to store an llvm::Triple.
- Primarily to discourage clients form making decisions based on the string.

llvm-svn: 79901
2009-08-24 09:10:05 +00:00
Daniel Dunbar e3532f82a7 Switch ABI selection to use llvm::Triple instead of string munging.
llvm-svn: 79900
2009-08-24 08:52:16 +00:00
Chris Lattner dca19591f2 fix a GCC type punning warning.
llvm-svn: 79895
2009-08-24 05:19:01 +00:00
Chris Lattner 72bb4f602c prune #includes.
llvm-svn: 79889
2009-08-24 04:11:30 +00:00
Chris Lattner 3441b4f77e API changes to match llvm ToT.
llvm-svn: 79868
2009-08-23 22:45:33 +00:00
Daniel Dunbar ccc60da5c7 Reenable clang using clang-cc for C++ and all archs by default.
llvm-svn: 79861
2009-08-23 19:41:53 +00:00
Daniel Dunbar b5bcd6b94a Temporarily switch clang back to not using clang-cc by default for C++, and only
using clang-cc on i386 and x86_64.

llvm-svn: 79859
2009-08-23 18:42:54 +00:00
Benjamin Kramer 89b422c118 Replace cerr with errs().
llvm-svn: 79854
2009-08-23 12:08:50 +00:00
Daniel Dunbar 730a54bf28 cerr -> errs.
llvm-svn: 79844
2009-08-23 08:52:09 +00:00
Chris Lattner 817b3012bc use errs() instead of cerr.
llvm-svn: 79829
2009-08-23 05:57:09 +00:00
Douglas Gregor 33870d908f CMake: Improve installation of Clang
- Install clang-cc into libexec
  - Install headers into lib/clang/<version>/include
  - Don't install other clang-based tools (clang-wpa, clang-index, etc.)

llvm-svn: 79827
2009-08-23 05:28:29 +00:00
Douglas Gregor 76d8c5725f Don't install Clang libraries.
llvm-svn: 79824
2009-08-23 05:02:18 +00:00
Chris Lattner 84cffc22d4 adjust for raw_fd_ostream api change.
llvm-svn: 79809
2009-08-23 02:59:41 +00:00
Anders Carlsson 622ddae92b Whoops, comment this out for now. I'll fix it shortly.
llvm-svn: 79806
2009-08-23 01:28:08 +00:00
Anders Carlsson d606de72ab More work towards zero-initializing structs that contain member pointers in constant expressions.
llvm-svn: 79805
2009-08-23 01:25:01 +00:00
Anders Carlsson beac2bef4d Remove the PaddingFields member from CGRecordLayout, it wasn't used anyway.
llvm-svn: 79799
2009-08-23 01:01:04 +00:00
Eli Friedman 16c209610c Catch a few more cases of illegal comparisons.
llvm-svn: 79793
2009-08-23 00:27:47 +00:00
Chris Lattner d99bd52c73 Eli points out that we really must diagnose "void* > 0" as an extension.
Explicitly add it as an EXTENSION instead of an EXTWARN so that it only
comes out with -pedantic.  Thanks Eli!

llvm-svn: 79791
2009-08-23 00:03:44 +00:00
Anders Carlsson faeccc622f Handle CK_NullToMemberPointer casts in the constant expr emitter.
llvm-svn: 79790
2009-08-23 00:02:11 +00:00
Anders Carlsson 3b0c5dcdd2 Change the constant expression emitter to look at the cast kind for to-union casts.
llvm-svn: 79789
2009-08-22 23:54:44 +00:00
Anders Carlsson d7923c6ed7 Add CK_NullToMemberPointer and CK_BaseToDerivedMemberPointer cast kinds. Make -ast-dump print out the cast kinds of cast expressions.
llvm-svn: 79787
2009-08-22 23:33:40 +00:00
Anders Carlsson 9cedbefb24 Add a -fno-elide-constructors option to clang-cc.
llvm-svn: 79782
2009-08-22 22:30:33 +00:00
Fariborz Jahanian a83c016d22 Type of a ?: expression whose either expression is a built-in 'id'
type is 'id' type.

llvm-svn: 79781
2009-08-22 22:27:17 +00:00
Fariborz Jahanian cbf10f5de5 Don't issue warning on multiple selector found when
selector name is for a @selector expression.

llvm-svn: 79776
2009-08-22 21:13:55 +00:00
Chris Lattner f8344dbfdd tweak some pointer sema checking stuff (which was added to implement PR4175) to
avoid emitting a warning on "someptr > 0".  This is obviously questionable (they 
could use != instead) but is reasonable, and the warning "ordered comparison 
between pointer and integer" didn't make a ton of sense because 0 is a valid 
null pointer constant.

Just silence the warning in this case, it is unlikely to indicate a bug.

llvm-svn: 79743
2009-08-22 18:58:31 +00:00
Edward O'Callaghan 856e4ff78d Second half of, clang, AuroraUX toolchain support.
llvm-svn: 79713
2009-08-22 01:06:46 +00:00
Douglas Gregor c45a40afd1 Implement delayed parsing for member function templates. Fixes PR4608.
llvm-svn: 79709
2009-08-22 00:34:47 +00:00
Ted Kremenek cdf5f4aa7b Remove 'AnalysisContext::setDecl()', as we the Decl associated with an
AnalysisContext should never change. Along the way, propagate some constness
around.

llvm-svn: 79701
2009-08-21 23:58:43 +00:00
Ted Kremenek 00aeae98b5 Constify LocationContext* (parent) and Stmt* fields in LocationContext.
llvm-svn: 79700
2009-08-21 23:39:58 +00:00
Ted Kremenek 608677a2e1 Remove 'SelfRegion' field from both BasicStoreManager and RegionStoreManager.
SelfRegion represented the object bound to 'self' (when analyzing Objective-C
methods) upon entry to a method. Having this region stored on the side ignores
the current stack frame that we might be analyzing (among other things), and is
a problem for interprocedural analysis.

For RegionStoreManager, the value for SelfRegion is just lazily created.

For BasicStoreManager, the value for SelfRegion is bound eagerly to 'self', but
no explicit tracking of SelfRegion on the side is made.

As part of this change, remove the restriction in BasicStoreManager that we only
track ivars for 'self'. This shouldn't actually change anything in terms of
precision, and simplifies the logic.

llvm-svn: 79694
2009-08-21 23:25:54 +00:00
Douglas Gregor 05155d8d7b Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.

llvm-svn: 79693
2009-08-21 23:19:43 +00:00
Mike Stump 0b8c5ae7af Calculate the address point for a vtable better, and start fleshing out the vcall
calculations better.

llvm-svn: 79687
2009-08-21 23:09:30 +00:00
Douglas Gregor e839486de9 Refactor instantiation of destructors to use the common CXXMethodDecl
code, fixing a problem where instantiations of out-of-line destructor
definitions would had the wrong lexical context.

Introduce tests for out-of-line definitions of the constructors,
destructors, and conversion functions of a class template partial
specialization.

llvm-svn: 79682
2009-08-21 22:43:28 +00:00
Fariborz Jahanian 8adc973483 Patch to ir-gen copy assigning array members when synthesizing
a copy assignment operator function.

llvm-svn: 79681
2009-08-21 22:34:55 +00:00
Ted Kremenek 14536f6ee0 Add LocationContext* field to VarRegion. This is needed for interprocedural analysis.
llvm-svn: 79680
2009-08-21 22:28:32 +00:00
Douglas Gregor e5bbb7d4ef Fix parsing for out-of-line definitions of constructors and
destructors of class templates.

llvm-svn: 79678
2009-08-21 22:16:40 +00:00
Douglas Gregor 5ed5ae476e Introduce support for constructor templates, which can now be declared
and will participate in overload resolution. Unify the instantiation
of CXXMethodDecls and CXXConstructorDecls, which had already gotten
out-of-sync.

llvm-svn: 79658
2009-08-21 18:42:58 +00:00
Fariborz Jahanian 5626384384 Patch to provide ir-gen support in copying array members
when synthesizing a copy constructor. Arrays's base element
may have a trivial or non-trivial copy constructor.

llvm-svn: 79653
2009-08-21 18:30:26 +00:00
Fariborz Jahanian 7481bd88bb Array member construction in prologue of user-declared
constructors.

llvm-svn: 79640
2009-08-21 17:09:38 +00:00
Fariborz Jahanian 6c9e5a2b9e Introduce getConstantArrayElementCount API and use it in
construction/destruction of array members.

llvm-svn: 79637
2009-08-21 16:31:06 +00:00
Zhongxing Xu 54f87880e7 Eagerly bind 'self' to SelfRegion. Thus we do not need to get code decl from
GRStateManager to create the SelfRegion.

llvm-svn: 79628
2009-08-21 13:25:15 +00:00
Sanjiv Gupta 91f8cd9a91 Reversing part of 79544.
Need to find a new way to do target specific semanitc checking.

llvm-svn: 79596
2009-08-21 04:58:03 +00:00
Zhongxing Xu 71900fbac7 Get the code decl from the initial location context.
llvm-svn: 79591
2009-08-21 03:05:36 +00:00
Zhongxing Xu 871918c76f Get the code decl from the initial location context.
llvm-svn: 79590
2009-08-21 02:58:11 +00:00
Daniel Dunbar 6d886b056a gcc told me to add these.
llvm-svn: 79589
2009-08-21 02:43:05 +00:00
Zhongxing Xu 6be1a4e832 Tie the local check NSErrorCheck to a Decl to pave the way
to untie the ExplodedGraph from a specific Decl.

llvm-svn: 79588
2009-08-21 02:18:44 +00:00
Mike Stump a002945a20 We now support overriding base functions in vtables. WIP.
llvm-svn: 79587
2009-08-21 01:45:00 +00:00
Argyrios Kyrtzidis 6032ef1aa3 Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.
llvm-svn: 79584
2009-08-21 00:31:54 +00:00
Douglas Gregor a8eed7dabb Make the new Objective-C "id" and "Class" redefinition types special
types that are preloaded by the PCH file. Fixes PCH breakage
introduced in r79248.

llvm-svn: 79583
2009-08-21 00:27:50 +00:00
Douglas Gregor 97628d6a4c Implement support for calling member function templates, which involves:
- Allowing one to name a member function template within a class
  template and on the right-hand side of a member access expression.
  - Template argument deduction for calls to member function templates.
  - Registering specializations of member function templates (and
  finding them later).

llvm-svn: 79581
2009-08-21 00:16:32 +00:00
Fariborz Jahanian 1a606ab12a Patch to ir-gen destruction of array member elements in revers order
of their construction.

llvm-svn: 79571
2009-08-20 23:02:58 +00:00
Douglas Gregor 3447e76762 Initial support for parsing and representation of member function templates.
llvm-svn: 79570
2009-08-20 22:52:58 +00:00
Fariborz Jahanian 9c83720d17 ir-gen patch to destruct array members. WIP.
llvm-svn: 79565
2009-08-20 20:54:15 +00:00
Douglas Gregor 468535e552 Fix a typo in a variable name
llvm-svn: 79558
2009-08-20 18:46:05 +00:00
Sanjiv Gupta b841d1baa1 Issue an error if the user specifies parameters in a function marked as ISR.
llvm-svn: 79544
2009-08-20 17:48:52 +00:00
Fariborz Jahanian 9a84665921 Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.

llvm-svn: 79537
2009-08-20 17:02:02 +00:00
Mike Stump cae6178b3b Refine vbase offsets for the inductive case. Things are now starting
to come together nicely.  Still a WIP.

llvm-svn: 79521
2009-08-20 07:22:17 +00:00
John McCall 950aac085d Add syntax examples for the friend declaration types.
Remove an assert trivialized by dominating code.

llvm-svn: 79520
2009-08-20 07:19:42 +00:00
Douglas Gregor ebe1010b0f Refactor the instantiation of statements into a generic tree
transformation.

llvm-svn: 79519
2009-08-20 07:17:43 +00:00
Ted Kremenek 815fbb6026 retain/release checker: Treat NSObject method '-awakeAfterUsingCoder:'
just as if it behaved like an init function.  This fixes <rdar://problem/7129086>.

llvm-svn: 79515
2009-08-20 05:13:36 +00:00
Eli Friedman 629ffb9ad3 Fix bit-field promotion to be a bit closer to the behavior of gcc.
Patch by Enea Zaffanella, with some simplifications/corrections to
isPromotableBitField by me.

llvm-svn: 79510
2009-08-20 04:21:42 +00:00
Zhongxing Xu 1a3ec57520 If the 'while' has an empty body, set the body to the continue target block.
Although this does not make the CFG more correct, it makes the CFG more 
beautiful without multiple roots.

llvm-svn: 79509
2009-08-20 03:21:49 +00:00
Zhongxing Xu a778b02e89 If the body of for loop is empty, set its body to the continue target.
Otherwise we get a wrong CFG.

llvm-svn: 79507
2009-08-20 02:56:48 +00:00
Mike Stump 2220447adc Ensure we don't output repeated vbase offsets. I have a testcase for
this, but need to fixup the actual offset value before I can check it
in.  WIP.

llvm-svn: 79506
2009-08-20 02:11:48 +00:00
John McCall 87a44eb98a Basic nested-template implementation.
llvm-svn: 79504
2009-08-20 01:44:21 +00:00
Zhongxing Xu 068928b2a6 Rename: ProgramPoint::getContext() => ProgramPoint::getLocationContext().
llvm-svn: 79502
2009-08-20 01:23:34 +00:00
Fariborz Jahanian dd46eb770f Test case for my last patch plus a minor clean up.
llvm-svn: 79500
2009-08-20 01:01:06 +00:00
Ted Kremenek d982f001c9 retain/release checker: Special case handling of CFAttributedStringSetAttribute,
fixing <rdar://problem/7152619>. Along the way, merge test cases in
'test/Analysis/rdar-6539791.c' into 'test/Analysis/retain-release.m'.

llvm-svn: 79499
2009-08-20 00:57:22 +00:00
Fariborz Jahanian eeb0e57247 ir-gen for multi-dimensional array construction. WIP.
llvm-svn: 79497
2009-08-20 00:15:15 +00:00
Ted Kremenek eebcf574dd Enhance diagnostics concerning attribute 'ns_returns_retained' and 'cf_returns_retained' to present the range of the attribute and have the diagnostic location be the declaration that the attribute was falsely attached to. This solves the problem where these diagnostics were being suppressed when these attributes were wrapped in a macro that was defined in a system header.
llvm-svn: 79496
2009-08-19 23:56:48 +00:00
Argyrios Kyrtzidis 20cf19141f Keep track of the right paren ')' source location in a function declarator.
llvm-svn: 79489
2009-08-19 23:14:54 +00:00
Fariborz Jahanian a8fe2c26a8 Removed unneeded code for break/continue statements in
manufactured for-loop per Anders feedback (thanks).

- Fariborz

llvm-svn: 79466
2009-08-19 21:10:38 +00:00
Fariborz Jahanian 431c883287 ir-gen for constructing arrays as non-static data members. WIP.
llvm-svn: 79464
2009-08-19 20:55:16 +00:00
Eli Friedman a9c3d71b59 Add TCE target to clang; patch by Mikael Lepistö.
llvm-svn: 79462
2009-08-19 20:47:07 +00:00
Daniel Dunbar 62c850fb8f Remove now unnecessary helper methods.
llvm-svn: 79460
2009-08-19 20:32:38 +00:00
Daniel Dunbar 58bc48c14e Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.

llvm-svn: 79455
2009-08-19 20:04:03 +00:00
Daniel Dunbar dec484abfb Convert parts of Rewriter to StringRef based API.
- Please accept my sincere apologies for the gratuitous elimination of code
   duplication, manual string length counting, unnecessary strlen calls, etc.

llvm-svn: 79448
2009-08-19 19:10:30 +00:00
Daniel Dunbar 69c300d5e3 Use raw_svector_ostream for string concatenation.
llvm-svn: 79444
2009-08-19 18:30:37 +00:00
Mike Stump 3bc0a3bf7d One second thought, I think I want to limit this class to just vtable
building activities.

llvm-svn: 79438
2009-08-19 18:10:47 +00:00
Mike Stump b386941208 Cleanup: fold IndirectPrimary into builder.
llvm-svn: 79423
2009-08-19 14:40:47 +00:00
Mike Stump 3b09f004db We don't want to confuse this layout with the BLayout from the builder.
llvm-svn: 79422
2009-08-19 14:06:50 +00:00
Zhongxing Xu 080fa0522b Get the Decl from the current ExplodedNode. Eventually the diagnostic client
and other core analysis logic will be untied to a particular Decl.

llvm-svn: 79420
2009-08-19 12:50:00 +00:00
Benjamin Kramer a48651de2d Update CMakeLists.
llvm-svn: 79416
2009-08-19 12:02:15 +00:00
Eli Friedman 5ae98ee006 Make integer promotions work correctly on PIC16 and other platforms
where sizeof(short) == sizeof(int).  Move UsualArithmeticConversionsType 
out of Sema, since it was only there as a historical artifact.  Patch by 
Enea Zaffanella.

llvm-svn: 79412
2009-08-19 07:44:53 +00:00
Mike Stump 984c99d190 Restore vbase offsets for classes without a primary.
llvm-svn: 79402
2009-08-19 02:53:08 +00:00
Mike Stump 583ef62149 Refine vcalls a little.
llvm-svn: 79400
2009-08-19 02:06:38 +00:00
Argyrios Kyrtzidis cc06621280 Fix a comment and improve an assert message.
llvm-svn: 79399
2009-08-19 01:46:06 +00:00
Argyrios Kyrtzidis 560ac97bf3 Store/load type source info from/to PCH files.
llvm-svn: 79396
2009-08-19 01:28:35 +00:00
Argyrios Kyrtzidis c7148c974d Use Sema's LocInfoType to pass and preserve type source info through the Parser.
llvm-svn: 79395
2009-08-19 01:28:28 +00:00
Argyrios Kyrtzidis e918926d31 Introduce LocInfoType which is a Sema-specific implementation detail.
This is a Type subclass that can hold a DeclaratorInfo* when we have type source info coming
out of a declarator that we want to preserve. This is used only at the "border" of Parser/Sema for
passing/getting QualTypes, it does not participate in the type system semantics in any way.

llvm-svn: 79394
2009-08-19 01:28:17 +00:00
Argyrios Kyrtzidis fc8b022810 Create and instantiate a DeclaratorInfo using a newly introduced Sema::GetDeclaratorInfoForDeclarator().
llvm-svn: 79393
2009-08-19 01:28:06 +00:00
Argyrios Kyrtzidis 60ed560428 Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.
DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

llvm-svn: 79392
2009-08-19 01:27:57 +00:00
Argyrios Kyrtzidis 3f79ad7405 Introduce DeclaratorInfo and TypeLoc, intended to be used for storing and reading source information for types.
DeclaratorInfo will contain a flat memory block for source information about a type that came out of a declarator.
TypeLoc and its subclasses will be used by clients as wrappers to "traverse" the memory block and read the information.

Both DeclaratorInfo and TypeLoc are not utilized in this commit.

llvm-svn: 79391
2009-08-19 01:27:32 +00:00
Mike Stump 6fe6ca11da Cleanup.
llvm-svn: 79374
2009-08-18 22:04:08 +00:00