History log of /external/clang/lib/AST/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
PValue.cpp
STContext.cpp
STDiagnostic.cpp
STDumper.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
eclTemplate.cpp
xpr.cpp
xprConstant.cpp
nheritViz.cpp
taniumMangle.cpp
icrosoftCXXABI.cpp
icrosoftMangle.cpp
ecordLayoutBuilder.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
ypePrinter.cpp
TableBuilder.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
PValue.cpp
STContext.cpp
STDiagnostic.cpp
STDumper.cpp
STImporter.cpp
STTypeTraits.cpp
XXABI.h
XXInheritance.cpp
omment.cpp
ommentCommandTraits.cpp
ommentParser.cpp
ommentSema.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclFriend.cpp
eclObjC.cpp
eclOpenMP.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
xternalASTSource.cpp
taniumCXXABI.cpp
taniumMangle.cpp
angleNumberingContext.cpp
icrosoftMangle.cpp
SAPI.cpp
estedNameSpecifier.cpp
arentMap.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
tmt.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtProfile.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
ypeLoc.cpp
ypePrinter.cpp
TableBuilder.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
PValue.cpp
STContext.cpp
STDiagnostic.cpp
STDumper.cpp
STImporter.cpp
STTypeTraits.cpp
ndroid.mk
ttrImpl.cpp
MakeLists.txt
XXInheritance.cpp
omment.cpp
ommentCommandTraits.cpp
ommentLexer.cpp
ommentSema.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclFriend.cpp
eclObjC.cpp
eclOpenMP.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
nheritViz.cpp
taniumCXXABI.cpp
taniumMangle.cpp
angle.cpp
angleNumberingContext.cpp
icrosoftCXXABI.cpp
icrosoftMangle.cpp
awCommentList.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
ypePrinter.cpp
TTBuilder.cpp
TableBuilder.cpp
229d345dd5a73ef6ba75d1d730ecf96e8dc9ecec 08-Feb-2014 Stephen Hines <srhines@google.com> Update clang for merge to LLVM 3.4.

Update TableGen rules:
- AttrExprArgs
+ AttrIdentifierArg
+ AttrParsedAttrImpl
+ AttrTypeArg

Update config.h files.

Adjust Android.mk for added/removed files:

+ TransProtectedScope.cpp

- DumpXML.cpp

+ Consumed.cpp

+ CodeGenABITypes.cpp

+ SanitizerArgs.cpp

+ AllocationDiagnostics.cpp
- CommonBugCategories.cpp
+ IdenticalExprChecker.cpp

+ CommonBugCategories.cpp
- SymbolManager.cpp
- TextPathDiagnostics.cpp
+ SymbolManager.cpp

Change-Id: I73bea10e7e73e611f678bc5bf9935e26da63be17
ndroid.mk
1fab7c3e3bd97a909a80b1bfea1909c6e7347fc0 12-Feb-2014 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/release_34' into merge-20140211

Conflicts:
lib/Basic/Targets.cpp
lib/Sema/SemaDeclAttr.cpp

Change-Id: I17ca7161f32007272ee82036d237d051847dd02e
b3617be53923ac3e5885ff5001aa748bd0223102 14-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r197298:
------------------------------------------------------------------------
r197298 | rsmith | 2013-12-13 17:04:22 -0800 (Fri, 13 Dec 2013) | 3 lines

PR18232: implement instantiation for class-scope explicit specializations of
class templates (a Microsoft extension).

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197320 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
01f3d00bc5074a2f105eda35ef7aee8088e938d6 10-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196771:
------------------------------------------------------------------------
r196771 | majnemer | 2013-12-09 02:44:32 -0800 (Mon, 09 Dec 2013) | 17 lines

[-cxx-abi microsoft] Mangle large integral constants correctly

Testing has revealed that large integral constants (i.e. > INT64_MAX)
are always mangled as-if they are negative, even in places where it
would not make sense for them to be negative (like non-type template
parameters of type unsigned long long).

To address this, we change the way we model number mangling: always
mangle as-if our number is an int64_t. This should result in correct
results when we have large unsigned numbers.

N.B. Bizarrely, things that are 32-bit displacements like vbptr offsets
are mangled as-if they are unsigned 32-bit numbers. This is a pretty
egregious waste of space, it would be a 4x savings if we could mangle it
like a signed 32-bit number. Instead, we explicitly cast these
displacements to uint32_t and let the mangler proceed.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196878 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
525f2f5437929a324a37697f2934fda78931c66a 09-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196712:
------------------------------------------------------------------------
r196712 | rafael | 2013-12-07 17:13:22 -0800 (Sat, 07 Dec 2013) | 12 lines

Fix pr18174.

Clang outputs LLVM one top level decl at a time. This combined with the
visibility computation code looking for the newest NamespaceDecl would cause
it to produce different results for nested namespaces.

The two options for producing consistent results are
* Delay codegen of anything inside a namespace until the end of the file.
* Don't look for the newest NamespaceDecl.

This patch implements the second option.
This matches the gcc behavior too.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196745 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
edb95d3f9eb354b30baddd58fee5d2e7b3da2c92 02-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196048:
------------------------------------------------------------------------
r196048 | d0k | 2013-12-01 07:09:32 -0800 (Sun, 01 Dec 2013) | 3 lines

CommentLexer: When proceeding with a typo corrected name don't clobber the token.

This would crash if the token is used in another diagnostic. PR18051.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196075 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
b8110d4e00a973c3238e23110e3d405da55fa7d3 27-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195768:
------------------------------------------------------------------------
r195768 | rafael | 2013-11-26 08:09:08 -0800 (Tue, 26 Nov 2013) | 3 lines

Don't call getMostRecentDecl when we know we have it.

On a Release build this takes the testcase in pr18055 from 0m3.892s to 0m1.452s.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195816 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8a5c9d7a4607a22170b6ddf3874321416c65fea5 26-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195669:
------------------------------------------------------------------------
r195669 | majnemer | 2013-11-25 09:50:19 -0800 (Mon, 25 Nov 2013) | 13 lines

[-cxx-abi microsoft] Create backrefs for <unnamed-type-`id'>

It wasn't possible for an anonymous type to show up inside of function arguments.
However, decltype (which MSVC added support for in 2010) makes this
possible. Further, backrefs to these anonymous types can now be formed.

This fixes PR18022.

N.B. We do not, and very likely _will not_, support MSVC's bug where
subsequent typedefs of anonymous types leak into the linkage name; this
is a gross violation of the ABI. A warning should be introduced to
inform our users of this particular shortcoming.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195729 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
7bd67854cfa59699e0efe72244af1578f2a1c09e 26-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195620:
------------------------------------------------------------------------
r195620 | rsmith | 2013-11-24 23:07:05 -0800 (Sun, 24 Nov 2013) | 3 lines

Take cv-qualifiers on fields of class type into account when determining
whether a defaulted special member function should be deleted.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195719 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7b0fe5d62cc31a61188a20b243794b800baa3e7e 20-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195168:
------------------------------------------------------------------------
r195168 | rnk | 2013-11-19 15:23:00 -0800 (Tue, 19 Nov 2013) | 17 lines

Add a mangler entry point for TBAA rather than using RTTI directly

Summary:
RTTI is not yet implemented for the Microsoft C++ ABI and isn't expected
soon. We could easily add the mangling, but the error is what prevents
us from silently miscompiling code that expects RTTI.

Instead, add a new mangleTypeName entry point that simply forwards to
mangleName or mangleType to produce a string that isn't part of the ABI.
Itanium can continue to use RTTI names to avoid unecessary test
breakage.

This also seems like the right design. The fact that TBAA names happen
to be RTTI names is now an implementation detail of the mangler, rather
than part of TBAA.

Differential Revision: http://llvm-reviews.chandlerc.com/D2153
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195227 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
icrosoftMangle.cpp
8d1f5a5c54514cb66390acaa133730f43e69d97e 20-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195158:
------------------------------------------------------------------------
r195158 | whunt | 2013-11-19 14:11:09 -0800 (Tue, 19 Nov 2013) | 9 lines

Microsoft Record Layout: zero sized base after base with vbtbl fix

Microsoft adds an extra byte of padding before laying out zero sized
non-virtual bases if the non-virtual base before it contains a vbptr.
This patch adds the same behavior to clang.

Differential Revision: http://llvm-reviews.chandlerc.com/D2106


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195167 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
99cbf42292c59c6833d6ec4e69235ac5309e20d0 17-Nov-2013 Hao Liu <Hao.Liu@arm.com> Fix the problem that the arm_neon.h can't be used in a cpp file. Also fix a minor bug with poly64 name mangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194952 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
93b717ac956f5c82f7895ed8874cbd514c6d0a4e 15-Nov-2013 Hans Wennborg <hans@hanshq.net> [-cxx-abi microsoft] Emit thunks for pointers to virtual member functions

Instead of storing the vtable offset directly in the function pointer and
doing a branch to check for virtualness at each call site, the MS ABI
generates a thunk for calling the function at a specific vtable offset,
and puts that in the function pointer.

This patch adds support for emitting such thunks. However, it doesn't support
pointers to virtual member functions that are variadic, have an incomplete
aggregate return type or parameter, or are overriding a function in a virtual
base class.

Differential Revision: http://llvm-reviews.chandlerc.com/D2104

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194827 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
e21432efa94079aa1a62f7d5ff3b47a92d3c8296 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Modern gcc is happy to constant evaluate __builtin_strlen in various cases
where we didn't. Extend our constant evaluation for __builtin_strlen to handle
any constant array of chars, not just string literals, to match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194762 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
418220b209ed67a5cc6802d367a9a994d7225e04 14-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> DR408: If a static data member of incomplete array type is declared in a class
template, that member has a dependent type (even if we can see the definition
of the member of the primary template), because the array size could change in
a member specialization.

Patch by Karthik Bhat!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194740 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
758c4d86bb9b2298374fce5b3ca4a35f953f2d2e 14-Nov-2013 Joey Gouly <joey.gouly@arm.com> [OpenCL] Make sure we put string literals in the constant address space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194717 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
142ab06ffb2ec286917554aa5d945323a1ebf359 14-Nov-2013 Serge Pavlov <sepavloff@gmail.com> Added warning on structures/unions that are empty or contain only
bit fields of zero size. Warnings are generated in C++ mode and if
only such type is defined inside extern "C" block.
The patch fixed PR5065.

Differential Revision: http://llvm-reviews.chandlerc.com/D2151


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194653 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
1d40d62f137d3831729131e56562fc490b7f9591 13-Nov-2013 Warren Hunt <whunt@google.com> No functional change. Renaming a variable in RecordLayoutBuilder and
improving comments to make documentation more accurate.

Differential Revision:http://llvm-reviews.chandlerc.com/D2172



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194609 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
e39ff50fd72e9ffaa28f141a5c9bb22f1b8f2844 12-Nov-2013 Robert Lytton <robert@xmos.com> XCore target requires preferred alignment.

The xcore llvm backend does not handle 8 byte alignment viz:
"%BadAlignment = alloca i64, align 8"
So getPreferredTypeAlign() must never overalign.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194462 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e0ac9bfbf588e269fefc8758e715ee5804affb18 12-Nov-2013 Reid Kleckner <reid@kleckner.net> -fms-compatibility: Use C++98 null pointer constant rules

Patch by Will Wilson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194441 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
471b52aaab1d175ddad7c24d825dbf0582a1767e 10-Nov-2013 Benjamin Kramer <benny.kra@googlemail.com> Avoid double StringMap lookups. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194355 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
144879a48fb91cd3685fa1fadd9cb5851895759a 10-Nov-2013 Benjamin Kramer <benny.kra@googlemail.com> CommentSema: Factor code better. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194354 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
152eee9f81f1b4f00e1bce655903fc78cafb1342 08-Nov-2013 Reid Kleckner <reid@kleckner.net> Make -fdump-vtable-layouts print to stdout, not stderr

This makes it consistent with -fdump-record-layouts, which was moved to
outs() in r186219. My reasoning for going with stdout is that when one
of these options is present, the layouts are really a program output,
and shouldn't be interleaved with diagnostics, which are on stderr.

Reviewers: timurrrr

Differential Revision: http://llvm-reviews.chandlerc.com/D2127

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194279 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
6acb04f755cfc73d05772457d70aeb5adfaf6d8f 08-Nov-2013 Timur Iskhodzhanov <timurrrr@google.com> Thread the info about vbptr sharing through ASTRecordLayout

Reviewed at http://llvm-reviews.chandlerc.com/D2120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194256 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
TableBuilder.cpp
9aebdc94d819e8a537030efc70567d585382ecf9 07-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17615: A delegating constructor initializer is a full-expression. Don't
forget to clean up temporaries at the end of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194213 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
40aa366f994f7b2c103e94f903a34226b4b8f06b 07-Nov-2013 Timur Iskhodzhanov <timurrrr@google.com> Minor refinement of VTableBuilder.h: fix wrong indentation, rename a struct field with a more appropriate name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194202 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
bafa74f360cb3ec82fa8c688845330f491d167fd 07-Nov-2013 David Majnemer <david.majnemer@gmail.com> [-fms-extensions] Add support for __FUNCDNAME__

Summary:
Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled
function name via __FUNCDNAME__. This implementation is very naive and
unoptimized, it is expected that __FUNCDNAME__ would be used rarely in
practice.

Reviewers: rnk, rsmith, thakis

CC: cfe-commits, silvas

Differential Revision: http://llvm-reviews.chandlerc.com/D2109

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194181 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
xpr.cpp
tmtPrinter.cpp
0de7ba67f896a01ac1d99821a5f2b31c5fb7ccb4 06-Nov-2013 Aaron Ballman <aaron@aaronballman.com> Silencing some MSVC warnings about not all control paths returning a value when they actually do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194156 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
58b6db76adab8dee2e64fbc300360f9b46c561ba 06-Nov-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194132 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
icrosoftMangle.cpp
TableBuilder.cpp
9a9ca98d6463530384aa12685034899c4cc8733d 06-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> More constant evaluation cleanup, and fix an issue where we'd override an
earlier 'non-constant' diagnostic with a later one if the earlier one was from
a side-effect we thought we could evaluate past.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194117 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
92563d0c04d9f06e528439bb93073e41ecbdc07b 06-Nov-2013 Warren Hunt <whunt@google.com> Microsoft adds weird padding before virtual bases if the last field was a bitfield

This patch adds the same behavior to clang.

Differential Revision: http://llvm-reviews.chandlerc.com/D2103



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194115 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
00841f5d6273d9088cfe308bacf6f5a80470c829 06-Nov-2013 Peter Collingbourne <peter@pcc.me.uk> Introduce DynTypedNode::print, dump and getSourceRange.

These functions can generally be applied to multiple kinds of AST node,
so it makes sense to add them to DynTypedNode.

Differential Revision: http://llvm-reviews.chandlerc.com/D2096

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194113 91177308-0d34-0410-b5e6-96231b3b80d8
STTypeTraits.cpp
0004329758b99d2b92096b353e35c427ebbee622 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Simplify: we don't care why constant evaluation might have failed when we're
checking an expression for constant overflow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194099 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f490f0eaba5fed6236d8f8a965a2fd98fa41e891 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor constant expression handling and make a couple of tweaks to make it a
bit more robust against future changes. This includes a slight diagnostic
improvement: if we know we're only trying to form a constant expression, take
the first diagnostic which shows the expression is not a constant expression,
rather than preferring the first one which makes the expression unfoldable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194098 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5f0db587078b5af32fc9ac41fe4276b80918fd8d 05-Nov-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix vbtable indices when a class shares the vbptr with a non-virtual base

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194082 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
3cebc73895daccea85984d8881b5b45c8f8df9c6 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

This allows a C++ standard library implementation to provide both a sized and
an unsized deallocation function, where the unsized one does not just call the
sized one, for instance by putting both in the same object file within an
archive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194055 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
743cbb91499e138a63a398c6515667905f1b3be8 04-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement final resolution of DR1402: implicitly-declared move operators that
would be deleted are still declared, but are ignored by overload resolution.

Also, don't delete such members if a subobject has no corresponding move
operation and a non-trivial copy. This causes us to implicitly declare move
operations in more cases, but risks move-assigning virtual bases multiple
times in some circumstances (a warning for that is to follow).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193969 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
62e9370d9da9ee4f675da52d559a79c93c30642e 04-Nov-2013 David Majnemer <david.majnemer@gmail.com> Sema: Do not allow overloading between methods based on restrict

If the sole distinction between two declarations is that one has a
__restrict qualifier then we should not consider it to be an overload.

Instead, we will consider it as an incompatible redeclaration which is
similar to how MSVC, ICC and GCC would handle it.

This fixes PR17786.

N.B. We must not mangle in __restrict into method qualifiers becase we
don't allow overloading between such declarations anymore. To do
otherwise would be a violation of the Itanium ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193964 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
77534c7051b30f0443b3f79e3dfe6b1d8e66b957 03-Nov-2013 Bob Wilson <bob.wilson@apple.com> OS X 10.9+ and iOS 7+ support load/store of big atomic objects.

rdar://13973577

Patch by Fariborz Jahanian.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193935 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
caf759752b086ef30b6c564654b382d17fb0c16f 02-Nov-2013 Warren Hunt <whunt@google.com> Improves compatibility with cl.exe when laying out array fields

Differential Revision: http://llvm-reviews.chandlerc.com/D2090

Clang was "improperly" over-aligning arrays with sizes are not a multiple of
their alignment.
This behavior was removed in microsoft 32 bit mode.

In addition, after examination of ASTContext::getTypeInfoImpl, a redundant code block in
MicrosoftRecordLayoutBuilder::getAdjustedFieldInfo was deleted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193898 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
2d023ecb2b9204a3dbc3b88ad9564b0a5bc211f6 02-Nov-2013 Warren Hunt <whunt@google.com> Wraps lazily generated builtins in an extern "C" context

Differential Revision: http://llvm-reviews.chandlerc.com/D2082

Adds a lang_c LinkageSpecDecl to lazily generated builtins. This enforces correct
behavior for builtins in a variety of cases without special treatment elsewhere within
the compiler (special treatment is removed by the patch). It also allows for C++
overloads of builtin functions, which Microsoft uses in their headers e.g.
_InterlockedExchangeAdd is an extern C builtin for the long type but an inline wrapper
for int type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193896 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c70cc5d90403f99ccce5cab3a6c022ad9cdcb66c 30-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Make thunk this/return adjustment ABI-specific. Also, fix the return adjustment when using -cxx-abi microsoft

Reviewed at http://llvm-reviews.chandlerc.com/D2026

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193679 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
TableBuilder.cpp
d647efb48af96dfc56d31736beb1052536ee81ff 29-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix an assertion when handling a custom case of virtual inheritance; also reduce code duplication

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193610 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
4e7f00c74487bca84993a1f35d0a26a84ed2b1a0 25-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC: under -Wunused-property-ivar warn if property's
backing warning is not used in one of its accessor methods.
// rdar://14989999


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193439 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
eclObjC.cpp
68eccccbbfc9d87b754df539f5b1343f4c499b63 25-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Remove dead variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193395 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1bf080e8f1283aa3c85418a3da3a49457896f0cc 24-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Remove dead recursive function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193313 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
7967c95891c5f65f6312fbbcb999ac257d776914 24-Oct-2013 Warren Hunt <whunt@google.com> Implements 64 bit microsoft record layout and adds lit tests to cover
it. Also removes all of the microsoft C++ ABI related code from the
itanium layout builder.

Differential Revision: http://llvm-reviews.chandlerc.com/D2003



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193290 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
885d8bf8d06ddaf79ffe45a96aaa42621db44241 23-Oct-2013 David Majnemer <david.majnemer@gmail.com> AST: Mangle fields in anonymous structs/unions

The Itanium mangler couldn't cope with mangling an IndirectFieldDecl.
Instead, mangle the field the IndirectFieldDecl refers to.

Further, give IndirectFieldDecl no linkage just like FieldDecl.

N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for
data members of anonymous structs/unions. However, this seems
impossible so turn it into an assertion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193269 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
taniumMangle.cpp
bef582b0159e8f0deb606c7700e3590a6f5a4ab2 23-Oct-2013 Faisal Vali <faisalv@yahoo.com> Refactor out the circular reference to LambdaExpr in CXXRecordDecl.

A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test. The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html. Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box).

Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

No change in functionality.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193246 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
80f2b2e693422f84ec3735f16a08614a527b0bc5 23-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert r193223 and r193216.

They were causing CodeGenCXX/mangle-exprs.cpp to fail.

Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl."

Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193226 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a4c91afe103063e983aa9bab535e442da8629636 23-Oct-2013 Faisal Vali <faisalv@yahoo.com> Remove the circular reference to LambdaExpr in CXXRecordDecl.

Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

No change in functionality.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193223 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
426589aa7a5cbb50e0f69988288414bac7657542 23-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Teach AST dumper to dump the containing module and hidden flag for declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193210 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
b1c0e204046b72828e513bad369ab03252b2c42e 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Treat aliases as definitions.

This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193200 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e39c0f32fd9e6c6de68b50a1b20bca58759ba8d5 22-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193164 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
87bcee88d9b49de8214aa23d07c96f7bec3198e0 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Simplify some implementations of get*Decl.

* NamedDecl and CXXMethodDecl were missing getMostRecentDecl.
* The const version can just forward to the non const.
* getMostRecentDecl can use cast instead of cast_or_null.

This then removes some casts from the callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193039 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9297535638b59e652bc521bf8e6c87856d639279 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Reduce indentation with an early exit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193028 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
7693b32af6863c63fcaf4de087760740ee675f71 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Add isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.

Redeclarable already had a isFirstDecl, but it was missing from DeclBase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193027 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
65d1096dcfaf5f1f58ed8859e30db735a057e962 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Simplify FunctionDecl::getBody.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193025 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8219c03a963714c23985e06f0f170c54956678f5 18-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix 80-column violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192937 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
7121bdb91b86f6053765bda18dd0a8a118929ace 18-Oct-2013 David Majnemer <david.majnemer@gmail.com> [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for 'final'

Summary: Some MS headers use these features.

Reviewers: rnk, rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1948

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192936 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
bc6509175e1ce5cc1b48d1b97ac8d23d8b74167c 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename some functions for consistency.

Every other function in Redeclarable.h was using Decl instead of Declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192900 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
icrosoftMangle.cpp
ecordLayoutBuilder.cpp
82552742a1002cf1408d6f371efc9cc6a9f2d7cc 16-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> [-cxx-abi microsoft] Fix this argument/parameter offsets for virtual destructors in the presence of virtual bases

Reviewed at http://llvm-reviews.chandlerc.com/D1939

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192822 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
d6be277ba4bf271c6de8ffcc8c46f060c8cbd4d5 16-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> On 32 bit windows, mangle stdcall and fastcall decls in clang.

This removes the dependency on the llvm mangler doing it for us. In isolation,
the benefit is that the testing of what mangling is applied is all in one place:
(C, C++) X (Itanium, Microsoft) are all handled by clang.

This also gives me hope that in the future the llvm mangler (and llvm-ar) will
not depend on TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192762 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
angle.cpp
icrosoftMangle.cpp
c5042885480aa8b06e7b792247257846dfdddd80 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Teach the AST dumper to dump the canonical declaration for a mergeable declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192739 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
f186c9203278c0804b051e2b10ee2631a4d17274 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add constant evaluation support for __builtin_isinf, __builtin_isfinite,
__builtin_isnan, and __builtin_isnormal. Patch by Karthik Bhat! Tests by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192729 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8690cee218a59d3f6eaca17b9c25d03a52ebacaa 15-Oct-2013 Reid Kleckner <reid@kleckner.net> ms-compat: Fix taking the address of a member of a dependent base

If unqualified id lookup fails while parsing a class template with a
dependent base, clang with -fms-compatibility will pretend the user
prefixed the name with 'this->' in order to delay the lookup. However,
if there was a unary ampersand, Sema::ActOnDependentIdExpression() will
create a DependentDeclRefExpr, which is not what we wanted at all. Fix
this by building the CXXDependentScopeMemberExpr directly instead.

In order to be fully MSVC compatible, we would have to defer all
attempts at name lookup to instantiation time. However, until we have
real problems with system headers that can't be parsed, we'll put off
implementing that.

Fixes PR16014.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1892

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192727 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
b7f23f18acaf84d14d6ca2c02c12c22e68d72837 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Correctly skip type sugar when determining the width of an enum type. Derived
from a patch by Justin Bogner.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192671 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a7dec298303edbf3eb2c7993801c602a1d88e9db 14-Oct-2013 Reid Kleckner <reid@kleckner.net> PR17576: Fix assertion on polymorphic classes with small alignment

We have to reserve at least the width of a pointer for the vfptr. For
classes with small alignment, we weren't reserving enough space, and
were overlapping the first field with the vfptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192626 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d42217f7570e68d08bde1ff89960e1773b41749a 14-Oct-2013 Warren Hunt <whunt@google.com> Correctly check for distructors when realizing vtordisps

This patch fixes the distructor test when checking for vtordisp requirements in
microsoft record layout. A test case is also included.

Addresses:
http://llvm.org/bugs/show_bug.cgi?id=16406#c7



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192616 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
7dcff5b56bc470c456f70ecb124c3a9013c50953 14-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Reduce double set lookups by using the result of insert.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192598 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
812a32f41efc1cea52ee93220ba1519758807ad6 11-Oct-2013 Reid Kleckner <reid@kleckner.net> Only use the MS record layout when using the MS C++ ABI

We're not ready to use it everywhere we use a win32 triple yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192502 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
70e37c458e9189cf2d8078b02deb8f8a189f826b 11-Oct-2013 Reid Kleckner <reid@kleckner.net> Fix unused variable warning in MS record layout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192495 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b2969b1e50580344891a98f5b241f8351fe371cf 11-Oct-2013 Warren Hunt <whunt@google.com> Adds Microsoft compatiable C++ record layout code to clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192494 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
af3b980ef367e031051afd67ca3475bb7aa32db8 10-Oct-2013 Ted Kremenek <kremenek@apple.com> Fix getIntegerTypeOrder() to properly handle enums by first unwrapping their underlying integer type. This is a precondition for calling getIntegerRank().

Fixes an assertion failure in a test case involving vectors.

Fixes <rdar://problem/15091442>

Please somebody check this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192334 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8f2cb42e1aa5dbdd6fa651a5da7ab8a3a0d4dece 09-Oct-2013 Sean Callanan <scallanan@apple.com> This patch addresses a problem encountered by the
ASTImporter when importing the following types:

typedef struct {
} A;

typedef struct {
A a;
} B;

Suppose we have imported B, but we did not at that
time need to complete it. Then later we want to
import A. The struct is anonymous, so the first
thing we want to do is make sure no other anonymous
struct already matches it. So we set up an
StructuralEquivalenceContext and compare B with A.

This happens at ASTImporter.cpp:2179.

Now, in this scenario, B is not complete. So we go
and import its fields, including a, which causes A
to be imported. The ASTImporter doesn’t yet have A
in its list of already-imported things, so we
import A.

After the StructuralEquivalenceContext is finished
determining that A and B are different, the
ASTImporter concludes that A must be imported
because no equivalent exists, so it imports a second
copy of A. Now we have two different structs
representing A. This is really bad news.

The patch allows the StructuralEquivalenceContext to
use the original version of B when making its
comparison, obviating the need for an import and
cutting this loop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192324 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
9fe529f15723018a2fecdcc35611210f92ed2b82 09-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator. Introduce a new print policy for
suppression of strong lifetime qualifiers when
inferring property. // rdar://15082812


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192305 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
f07465828da2a07297646a2277ba8fe3abd2d4c3 09-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Code cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumVTableBuilder and clang-format code around

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192288 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
2cb17a06befb61b1434aaa991652fea4338c95d7 09-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Reland 192220 "Abstract out parts of thunk emission code, add support for simple thunks when using -cxx-abi microsoft" with relaxed assertions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192285 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
TableBuilder.cpp
0ac66c03c01ae95bc34cca71067ba8dd65e06a1d 08-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Revert 192220 as it fails on an assertion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192225 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
TableBuilder.cpp
c3dcfa20f8ec56fad90ffe42d0f4bc0168a2e138 08-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Abstract out parts of thunk emission code, add support for simple thunks when using -cxx-abi microsoft

Reviewed at http://llvm-reviews.chandlerc.com/D1787

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192220 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
TableBuilder.cpp
5ce45c77fc986d13f8cf566b2c195c7cda8afde3 08-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix an edge case in the template differ with default arguments.

In the test case one type is coming from a typedef with no default arg, the
other has the default arg. Taking the default arg from the typedef crashes, so
always use the real template paramter declaration. PR17510.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192202 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
ffc63a8f8ca7c2ccc525c876aa9ba9031176f782 08-Oct-2013 Faisal Vali <faisalv@yahoo.com> Fix linkage calculation of auto member functions returning lambdas

As described by Richard in https://groups.google.com/a/isocpp.org/d/msg/std-discussion/S1kmj0wF5-g/fb6agEYoL2IJ

we should allow:

template<typename S>
struct A {

template<typename T> static auto default_lambda() {
return [](const T&) { return 42; };
}

template<class U = decltype(default_lambda<S>())>
U func(U u = default_lambda<S>()) { return u; }

};

int run2 = A<double>{}.func()(3.14);

int run3 = A<char>{}.func()('a');

This patch allows the code using the same trickery that was used to allow the code in non-member functions at namespace scope.


Please see http://llvm-reviews.chandlerc.com/D1844 for richard's approval.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192166 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d1a32c328bce903fb1b17fc8147b646be818298e 08-Oct-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Fix the calling convention for operator new in records

Summary:
Operator new, new[], delete, and delete[] are all implicitly static when
declared inside a record. CXXMethodDecl already knows this, but we need
to account for that before we pick the calling convention for the
function type.

Fixes PR17371.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1761

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192150 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
icrosoftMangle.cpp
9a7e09fffbad657f775417252bc966098dfb1501 07-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove -ast-dump-xml.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192131 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
umpXML.cpp
4ed0122c1b795379cc4e11dfd62312358dcbf506 07-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> When merging class definitions across modules in C++, merge together fields.
This change doesn't go all the way to making fields redeclarable; instead, it
makes them 'mergeable', which means we can find the canonical declaration, but
not much else (and for a declaration that's not from a module, the canonical
declaration is always that declaration).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192092 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cbf8dde9e39ab8e95477e3bdf4ee0d269fac0637 06-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix PR17382 - properly group virtual method overloads in the vftable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192067 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
8a5fb999c6a9d3011f2c95543bad55021f8a01ca 04-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Simplify MicrosoftCXXNameMangler::mangleFunctionType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191950 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
11f22a35b7f08a8d017f6ab26e440edffc930f96 03-Oct-2013 Timur Iskhodzhanov <timurrrr@google.com> Extract ABI-specific parts of MangleContext into separate classes

Reviewed at http://llvm-reviews.chandlerc.com/D1807

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
icrosoftMangle.cpp
d195bc38fd424b0c928e3c354038a8ca6e2ccac3 01-Oct-2013 Alexey Bataev <a.bataev@hotmail.com> [OpenMP] Added parsing and semantic analysis for firstprivate clause


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191730 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
de8eaa2bf22ab0a59118289ee8b97f6ac6a97196 01-Oct-2013 Faisal Vali <faisalv@yahoo.com> Fix computation of linkage within nested lambdas.

When nested C++11 lambdas are used in NSDMI's - this patch prevents infinite recursion by computing the linkage of any nested lambda by determining the linkage of the outermost enclosing lambda (which might inherit its linkage from its parent).

See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval.

[On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions]


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191727 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9b93f206d89dbf86805b610b417bb874f7f446e8 01-Oct-2013 Eli Friedman <eli.friedman@gmail.com> Tweak changes in r186464 to avoid a crash.

Currently, IR generation can't handle file-scope compound literals with
non-constant initializers in C++.

Fixes PR17415 (the first crash in the bug).

(We should probably change (T){1,2,3} to use the same codepath as T{1,2,3} in
C++ eventually, given that the semantics of the latter are actually defined by
the standard.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191719 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c6867ddf541925c4dede00295fa2d06e8a39e89c 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Revert the linkage fix.
I got a bunch of buildbot failures that i don't understand - sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191647 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
99229cd81825a9c1df20ed8971d10608e5793521 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Fix computation of linkage within nested lambdas.
When nested lambdas are used in NSDMI's - this prevents infinite recursion.

See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval regarding the code, and then request for some tests.

[On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions]


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191645 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
56fe35b4e2a437bc7fee4ec321c742c8fd8c5cf6 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Fix windows newlines :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191641 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d6992ab33b7113e1bd7af51c0c52d17c23706c01 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Implement conversion to function pointer for generic lambdas without captures.

The general strategy is to create template versions of the conversion function and static invoker and then during template argument deduction of the conversion function, create the corresponding call-operator and static invoker specializations, and when the conversion function is marked referenced generate the body of the conversion function using the corresponding static-invoker specialization. Similarly, Codegen does something similar - when asked to emit the IR for a specialized static invoker of a generic lambda, it forwards emission to the corresponding call operator.

This patch has been reviewed in person both by Doug and Richard. Richard gave me the LGTM.

A few minor changes:
- per Richard's request i added a simple check to gracefully inform that captures (init, explicit or default) have not been added to generic lambdas just yet (instead of the assertion violation).
- I removed a few lines of code that added the call operators instantiated parameters to the currentinstantiationscope. Not only did it not handle parameter packs, but it is more relevant in the patch for nested lambdas which will follow this one, and fix that problem more comprehensively.
- Doug had commented that the original implementation strategy of using the TypeSourceInfo of the call operator to create the static-invoker was flawed and allowed const as a member qualifier to creep into the type of the static-invoker. I currently kludge around it - but after my initial discussion with Doug, with a follow up session with Richard, I have added a FIXME so that a more elegant solution that involves the use of TrivialTypeSourceInfo call followed by the correct wiring of the template parameters to the functionprototypeloc is forthcoming.

Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191634 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4cb295d3b32cb04215f87948fbf944ee4c31de1b 29-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;
instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out
the backward-compatibility issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191629 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
42572f532b99230bf7aa3e3593a0fbb1174bce7c 28-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Refactor comment merging.

- We scan for whitespace between comments anyways, remember any newlines seen
along the way.
- Use this newline number to decide whether two comments are adjacent.
- Since the newline check is now free remove the caching and unused code.
- Remove unnecessary boolean state from the comment list.
- No behavioral change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191614 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
04fa7a33279808dc3e5117c41b5f84c40eeb7362 28-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Per latest drafting, switch to implementing init-captures as if by declaring
and capturing a variable declaration, and complete the implementation of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191605 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
d0629eb137d06bf6d46a430abdb7fa044909298b 27-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Variable templates: handle instantiation of static data member templates
appropriately, especially when they appear within class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191548 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
a53d7a0259ff88f78ba8ecac7d0cb3ea96302b1d 27-Sep-2013 Timur Iskhodzhanov <timurrrr@google.com> Abstract out the emission of vtables, add basic support for vtable emission when using -cxx-abi microsoft

Reviewed at http://llvm-reviews.chandlerc.com/D1532

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191523 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
icrosoftMangle.cpp
TableBuilder.cpp
c420e3cbafbc0468645ca9aab1b71c76c30d280f 27-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: Handle multidimensional arrays inside of __uuidof()

We previously handled one-dimensional arrays but didn't consider the
general case. The fix is simple: keep going through subsequent
dimensions until we get to the base element.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191493 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
fe16aa31fdfaad4c38aed443d853af293714f1c4 27-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: Handle qualified array types in typeid() expressions

The intent of getTypeOperand() was to yield an unqualified type.
However QualType::getUnqualifiedType() does not strip away qualifiers on
arrays.

N.B. This worked fine when typeid() was applied to an expression
because we would inject as implicit cast to the unqualified array type
in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191487 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
fad9e13f3cb85198f0ee5af620ba81cd78574faa 26-Sep-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- generic lambdas within template functions and nested
within other generic lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware
(Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit)

As an example of what compiles through this commit:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

This patch has been reviewed by Doug and Richard. Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics).



Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately
generate a template-parameter-type when 'auto' is parsed in a generic
lambda parameter context. (i.e we do NOT use AutoType deduced to
a template parameter type - Richard seemed ok with this approach).
We encode that this template type was generated from an auto by simply
adding $auto to the name which can be used for better diagnostics if needed.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- various tests were added - but much more will be needed.

There is obviously more work to be done, and both Richard (weakly) and Doug (strongly)
have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData
in a future patch which is forthcoming.

A greatful thanks to all reviewers including Eli Friedman, James Dennett,
and especially the two gracious wizards (Richard Smith and Doug Gregor)
who spent hours providing feedback (in person in Chicago and on the mailing lists).
And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified!

Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191453 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
eclCXX.cpp
xprCXX.cpp
d0dbb7e6d4f05f5d0a5978822476897fe3427787 26-Sep-2013 Alexey Bataev <a.bataev@hotmail.com> [OPENMP] Improved variable lookup procedure for threadprivate variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191416 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
e3e686f5d16ac2a8a0da658935cd79ef3ada546d 26-Sep-2013 Reid Kleckner <reid@kleckner.net> Remove unused param from MicrosoftMangle::mangleCallingConvention()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191405 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
543c4ae954f2bce5ac58ed22080f23cbd94794d2 24-Sep-2013 Alexey Bataev <a.bataev@hotmail.com> [OPENMP] Bug fixes and improvements.
1. Fixed constructor of shared clause.
2. Some macros for clauses processing are replaced by private template methods.
3. Additional checks in sema analysis of OpenMP clauses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191265 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtProfile.cpp
bf44918562811a1a895aa09f34549f5119d10f8b 22-Sep-2013 Nick Lewycky <nicholas@mxc.ca> Fix comment to match name of variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191171 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
414a1bdbdaf250e0488589f12865c8961831b65d 18-Sep-2013 Hal Finkel <hfinkel@anl.gov> Add the intrinsic __builtin_convertvector

LLVM supports applying conversion instructions to vectors of the same number of
elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to
cause such instructions to be generated when using builtin vector types.

C-style casting on vectors is already defined in terms of bitcasts, and so
cannot be used for these conversions as well (without leading to a very
confusing set of semantics). As a result, this adds a __builtin_convertvector
intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is
intended to aid the creation of vector intrinsic headers that create generic IR
instead of target-dependent intrinsics (in other words, this is a generic
_mm_cvtepi32_ps). As noted in the documentation, the action of
__builtin_convertvector is defined in terms of the action of a C-style cast on
each vector element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190915 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
1a973447d0524b6dbb67605c33481687b24cd862 18-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Fix ObjC @encode for C++ classes w/virtual bases.

PR17142.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190912 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
71687a01e3f634f9be26a29006380f1cf10a31ca 18-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> -ast-dump support for variable templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190911 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
aa82461f696ced36b0cd817dfa492b6c93d15447 18-Sep-2013 David Majnemer <david.majnemer@gmail.com> Revert "Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately""

This reverts commit r190895 which reverted r190892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190904 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
icrosoftMangle.cpp
1f7fd68131872707a297335e6bc71beef47f9d73 18-Sep-2013 David Majnemer <david.majnemer@gmail.com> Revert "[-cxx-abi microsoft] Mangle local TagDecls appropriately"

This reverts commit r190892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190895 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
icrosoftMangle.cpp
075404782734005e4742621ba4fa29e334cd4987 18-Sep-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle local TagDecls appropriately

Summary:
When selecting a mangling for an anonymous tag type:
- We should first try it's typedef'd name.
- If that doesn't work, we should mangle in the name of the declarator
that specified it as a declaration specifier.
- If that doesn't work, fall back to a static mangling of
<unnamed-type>.

This should make our anonymous type mangling compatible.

This partially fixes PR16994; we would need to have an implementation of
scope numbering to get it right (a separate issue).

Reviewers: rnk, rsmith, rjmccall, cdavis5x

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1540

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190892 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
icrosoftMangle.cpp
69b6515cfa336a2bfc26f5dfd9023ebf143836f3 17-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Fix const-eval of vector init-lists of a vector.

Like any other type, an init list for a vector can have the same type as
the vector itself; handle that case.

<rdar://problem/14990460>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190844 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e9f6f33f0cf98a3e39025a57a0079cd316ed98f8 17-Sep-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Correctly identify Win32 entry points

Summary:
This fixes several issues with the original implementation:
- Win32 entry points cannot be in namespaces
- A Win32 entry point cannot be a function template, diagnose if we it.
- Win32 entry points cannot be overloaded.
- Win32 entry points implicitly return, similar to main.

Reviewers: rnk, rsmith, whunt, timurrrr

Reviewed By: rnk

CC: cfe-commits, nrieck

Differential Revision: http://llvm-reviews.chandlerc.com/D1683

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190818 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
icrosoftMangle.cpp
2574084c30e7171eb1b26d67688aa1d4290824ba 16-Sep-2013 NAKAMURA Takumi <geek4civic@gmail.com> Prune "return" after llvm_unreachable(). It was redundant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190774 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1fca547913774c6c547a15414d1a7051c1f446b5 13-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Part three of PR15721: if we have an invalid CXXDefaultInitExpr, don't crash if
we try to constant-evaluate it. Patch by Karthik Bhat, test by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190722 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cb3b4001d4b9492df3e88227282cec2764e7e76f 13-Sep-2013 NAKAMURA Takumi <geek4civic@gmail.com> ASTContext.cpp: Fix a warning in r190684. [-Wcovered-switch-default]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190705 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cef8e69fcebe5df23e05db39c923bf16abff0418 13-Sep-2013 David Tweed <david.tweed@arm.com> A buildbot compiling with strict error on unused variables pointed out a
historical remnant in r190684; remove it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190687 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
1eef85246b411b55c493098266746d0d83c241ea 13-Sep-2013 David Tweed <david.tweed@arm.com> Certain multi-platform languages, such as OpenCL, have the concept of
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.

Patch by Michele Scandale!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190684 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
978c5e0c239189117481b00fbba30101195f7e2c 13-Sep-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle user defined entry points properly

Summary:
Functions named "main", "wmain", "WinMain", "wWinMain", and "DllMain"
are never mangled regardless of linkage, even when compiling for kernel
mode.
Depends on D1655

Reviewers: timurrrr, pcc, rnk, whunt

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1670

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190675 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
cab7dad9eb1d986874a8224b6167f413aec55b14 13-Sep-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle declarations inside extern "C"

Summary:
This is a first step to getting extern "C" working properly inside
clang. There are a number of quirks but mangling declarations inside
such a function are a good first step.

Reviewers: timurrrr, pcc, cdavis5x

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1655

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190671 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
e825cf3ff84c3d47c73ddd39fb66617567093981 12-Sep-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the end-location of a CXXTemporaryObjectExpr when it is created with a initializer_list.

rdar://14887351

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190561 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d068607c136298bec0891d750389a55bac9f5c98 11-Sep-2013 Aaron Ballman <aaron@aaronballman.com> Tablegen now generates a StringSwitch for attributes containing enumeration arguments to map strings to the proper enumeration value. This makes error checking more consistent and reduces the amount of hand-written code required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190545 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
58e4cd09cc71893798282833806f4205b37dc828 11-Sep-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Canonicalize array parameters better

Summary:
More accurately characterize the nature of array parameters. Doing this
removes false back-reference opportunities. Remove some hacks now that
we characterize these better.

Reviewers: rnk, timurrrr, whunt, cdavis5x

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1626

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190488 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
a3d727ba775eaecd4fd69e1c90b81732394716a6 11-Sep-2013 Eli Friedman <eli.friedman@gmail.com> volatile types are not trivially copyable.

PR17123.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190484 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bafe46fe35ff58cc10487ba8bdcbcccd6d3319e7 11-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Add unused markings to suppress warnings.

trunk clang is a bit more aggressive about emitting unused-declaration
warnings, so adjust some AST code to match. Specifically, use
LLVM_ATTRIBUTE_UNUSED for declarations which are never supposed to be
referenced, and turn references to declarations which are supposed to be
referenced into odr-uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190443 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
tmt.cpp
812d6bcbd13190e6e5c2c915bf1499038d56b44b 10-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190439 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c5c6fa78fd0e6a15c5611e8a059359054cfbf9d5 10-Sep-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Mangle dynamic initializer stubs the same way MSVC does

Summary: Dynamic initializers are mangled as ??__E <name> YAXXZ.

Reviewers: timurrrr

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1477

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190434 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
icrosoftMangle.cpp
942f9fe11d3a9583eef6bc4ca2549b1f0d1694da 10-Sep-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Implement guard variables for static initialization

Static locals requiring initialization are not thread safe on Windows.
Unfortunately, it's possible to create static locals that are actually
externally visible with inline functions and templates. As a result, we
have to implement an initialization guard scheme that is compatible with
TUs built by MSVC, which makes thread safety prohibitively difficult.

MSVC's scheme is that every function that requires a guard gets an i32
bitfield. Each static local is assigned a bit that indicates if it has
been initialized, up to 32 bits, at which point a new bitfield is
created. MSVC rejects inline functions with more than 32 static locals,
and the externally visible mangling (?_B) only allows for one guard
variable per function.

On Eli's recommendation, I used MangleNumberingContext to track which
bit each static corresponds to.

Implements PR16888.

Reviewers: rjmccall, eli.friedman

Differential Revision: http://llvm-reviews.chandlerc.com/D1416

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190427 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXABI.h
taniumCXXABI.cpp
taniumMangle.cpp
angleNumberingContext.cpp
icrosoftCXXABI.cpp
icrosoftMangle.cpp
b7165589b2eafc4b48d09a5914e21604ae580256 09-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++ modules: fix a bug where loading a declaration with some name would prevent
name lookup from lazily deserializing the other declarations with the same
name, by tracking a bit to indicate whether a name in a DeclContext might have
additional external results. This also allows lazier reconciling of the lookup
table if a module import adds decls to a pre-existing DC.

However, this exposes a pre-existing bug, which causes a regression in
test/Modules/decldef.mm: if we have a reference to a declaration, and a
later-imported module adds a redeclaration, nothing causes us to load that
redeclaration when we use or emit the reference (which can manifest as a
reference to an undefined inline function, a use of an incomplete type, and so
on). decldef.mm has been extended with an additional testcase which fails with
or without this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190293 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6333bad83e2372ad2191d00f2538ae73927500f6 07-Sep-2013 David Majnemer <david.majnemer@gmail.com> Correct typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190257 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
09e0626d394bb32a89df2eab061614d64d29271b 07-Sep-2013 David Majnemer <david.majnemer@gmail.com> 'return' before 'else' is bad style


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190241 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
29b37a06fc58bb2993d1c35cf7411b6b94b1116a 07-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: __uuidof should leak through templated types

Summary:
__uuidof on templated types should exmaine if any of its template
parameters have a uuid declspec. If exactly one does, then take it.
Otherwise, issue an appropriate error.

Reviewers: rsmith, thakis, rnk

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1419

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190240 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1245a54ca6e9c5b14196461dc3f84b24ea6594b1 07-Sep-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fix missing source location in CXXTemporaryObjectExpr nodes.
For clarity, renamed (get/set)ParenRange as (get/set)ParenOrBraceRange
in CXXConstructExpr nodes.
Added testcase.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190239 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0c018357b8bbb1f96bbf622a5807421e626b4228 06-Sep-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test threadprivate_messages.cpp)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190183 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
e3efec20260ea7a0071e2ae6eedf3c2865e476d3 05-Sep-2013 James Dennett <jdennett@google.com> Mark lambda closure classes as being implicitly-generated.

Summary: Closure classes for C++ lambdas are always compiler-generated. This one-line change calls setImplicit(true) on them at creation time, such that a default RecursiveASTVisitor (or any for which shouldVisitImplicitCode returns false) will skip them.

Reviewers: rsmith, dblaikie

Reviewed By: dblaikie

CC: klimek, revane, cfe-commits, jordan_rose

Differential Revision: http://llvm-reviews.chandlerc.com/D1593

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190073 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7b7bef1ec355fb46643349d77c266b913f36b656 05-Sep-2013 Stepan Dyatkovskiy <stpworld@narod.ru> Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth.

As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here.
2. Fix handleModeAttr according to new methods in TargetInfo.
This approach is implemented in the patch attached to this post.

Fixes:
1st Commit (Current): Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190044 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
86164e8f51fa89a3ec904607c3848dc4a21b12cf 05-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Note when a decl is used in AST files.

When an AST file is built based on another AST file, it can use a decl from
the fist file, and therefore mark the "isUsed" bit. We need to note this in
the AST file so that the bit is set correctly when the second AST file is
loaded.

This patch introduces the distinction between setIsUsed() and markUsed() so
that we don't call into the ASTMutationListener callback when it wouldn't
be appropriate.

Fixes PR16635.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190016 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
e7eb0c4f6e728bb62c7d7304949b8a697153ba90 05-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17103: Scoped enumerations with signed integer types have signed integer
representation. Don't emit comparisons on them as 'icmp ult'!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190010 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0aae289e10b3efd484ecc023eb0fad873346754c 04-Sep-2013 Pavel Labath <labath@google.com> ASTDumper: fix dump of CXXCatchStmt

Summary: I added the display of the VarDecl contained in the statement.

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1596

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189941 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
b2b169aef03109a3a08bd93cba72894a83288dc4 03-Sep-2013 Pavel Labath <labath@google.com> Remove useless reinterpret_casts from Stmt.cpp

Summary:
I have no idea why these were there in the first place, but now they are
certainly not necessary.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1581

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189813 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
4367829b41e89d2f3dfae94a97af40ffa01c56c9 03-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "OpenMP: Data-sharing attributes analysis and clause 'shared'"

This reverts commit r189795.

threadprivate_messages.cpp is faling on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189811 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
8f1a2db8649eb151ee620273dcf34b700176430f 03-Sep-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP: Data-sharing attributes analysis and clause 'shared'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189795 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
4d4032206c9f966d991c73000e8816b910fb2fd7 02-Sep-2013 Chandler Carruth <chandlerc@gmail.com> Mark that qualifiers can prefix the auto type. This seems to just have
been an oversight, as it definitely works. Every test which changed had
the const written on the LHS of the auto already.

Notably, this also makes things like cpp11-migrate's formation of 'const
auto &' variables much more familiar.

Yes, many people feel that 'const' and other qualifiers belong on the
RHS of the type. I'm not going to argue about that because Clang already
*overwhelming* places the qualifiers on the LHS when it can and on the
RHS when it must. We shouldn't diverge for auto. We should add a tool to
clang-tidy that fixes this in either direction, and then wire up
clang-tidy to tools like cpp11-migrate to fix their placement after
transforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189769 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
bb6b5e40b6ea0e512eebd4bdc9d635076ed279f7 30-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Mention in AST dump whether a class declaration is a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189647 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
c2d775714f79af977672e4f1dbc16ee9e02d1dea 30-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't eagerly load all conversion operators when loading a class declaration
from a PCH/module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189646 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e8519c31a6ef853b627d557702ac1890f18ce2c9 30-Aug-2013 Charles Davis <cdavis5x@gmail.com> Add ms_abi and sysv_abi attribute handling.

Based on a patch by Benno Rice!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189644 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
icrosoftMangle.cpp
ype.cpp
ypePrinter.cpp
cd03f862d82cac28c9517e2036716f8d49112c8b 30-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Be lazier when loading KeyFunctions from PCH/modules. We don't need to load
these in eagerly if we're not actually processing a translation unit. The added
laziness here also avoids us loading in parts of a CXXRecordDecl earlier than an
upcoming class template specialization merging patch would like.

Ideally, we should mark the vtable as used when we see a definition for the key
function, rather than having a separate pass over dynamic classes at the end of
the TU. The existing approach is pretty bad for PCH/modules, since it forcibly
loads the declarations of all key functions in all imported modules, whether or
not those key functions are defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189627 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4e1a82c14cba135ebd86bcc914fcbbc524d70a61 30-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Adjust clang for change to APFloat::toString.

I changed the diagnostic printing code because it's probably better
to cut off a digit from DBL_MAX than to print something like
1.300000001 when the user wrote 1.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189625 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
97ed61f5b6fc096725b65c2b1c1bf58eb16c9611 28-Aug-2013 David Majnemer <david.majnemer@gmail.com> AST: Don't treat a TemplateExpansion as a Template

Summary:
Instead of calling getAsTemplate(), call
getAsTemplateOrTemplatePattern() because it handles the
TemplateExpansion case too.

This fixes PR16997.

Reviewers: doug.gregor, rsmith

Reviewed By: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1512

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189422 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
ef072033876e295ec5d3402f8730a3ae358ad815 28-Aug-2013 Reid Kleckner <reid@kleckner.net> Delete CC_Default and use the target default CC everywhere

Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1231

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
umpXML.cpp
xprCXX.cpp
icrosoftMangle.cpp
ype.cpp
ypePrinter.cpp
309f6456626fdc85181fd42d9ed8d9c0c5a6746a 27-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Remove ArgIndex, we handle all template argument kinds!

TemplateExpansion cannot happen here because MSVC doesn't mangle
anything but the fully substituted template arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189325 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
ad822223ee107f5e887e04e5c8c073ab0f116dd3 27-Aug-2013 Nick Lewycky <nicholas@mxc.ca> Show which decls are marked invalid in -ast-dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189306 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
ec1f905faa3d55dd8760061275ff37d7c0820c06 27-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Itanium mangler: remove "proposal" comments for manglings that are in the
latest draft of the ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189303 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
15b2674896371ac2a0fe707b538a1a29dec9d8e4 26-Aug-2013 Wei Pan <wei.pan@intel.com> Handle predefined expression for a captured statement

- __func__ or __FUNCTION__ returns captured statement's parent
function name, not the one compiler generated.

Differential Revision: http://llvm-reviews.chandlerc.com/D1491

Reviewed by bkramer



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189219 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4b104067143cd97e954d279ddc42ed03bbe86a08 26-Aug-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix virtual destructor mangling when using "-cxx-abi microsoft" on x64

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189214 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
ec0258a0a89ae39bfb6c5962ee1b8310481bc00f 26-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Unnamed types are mangled less wrong


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189208 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
8d2a5ea694ed0002b45deb2bd35db451b16a07d6 24-Aug-2013 Larisse Voufo <lvoufo@google.com> A clean-up pass, exploring the unification of traversals of class, variable and function templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189152 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
2b429358a9849e2e48520a03065fa385a02dc115 23-Aug-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: fix a bug where a line with whitespace between two paragraphs
would cause us to concatenate these paragraphs into a single one.

The no-op whitespace churn in test/Index test happened because these tests
don't use the correct approach for testing and are more strict than required
for they are testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189126 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
31c71ca0eb83967085f21713b1dedff8c7f7a90f 23-Aug-2013 Dmitri Gribenko <gribozavr@gmail.com> Fix indentation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189119 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
3520868fcffb6e3405014cd47973bfa757487a40 23-Aug-2013 Dmitri Gribenko <gribozavr@gmail.com> Use CharInfo.h routines in TextComment::isWhitespaceNoCache


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189115 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
344472ebeded2fca2ed5013b9e87f81d09bfa908 23-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189112 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
ommentSema.cpp
estedNameSpecifier.cpp
37fd27dbb941d27f4bd7412e534e7e5089d6781b 23-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove SequenceNumber from class/variable template partial specializations.
This was only used to ensure that the traversal order was the same as the
insertion order, but that guarantee was already being provided by the use
of a FoldingSetVector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189075 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
152b4e4652baedfceba1cd8115515629225e713f 22-Aug-2013 Manuel Klimek <klimek@google.com> Revert "Implement a rudimentary form of generic lambdas."

This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclCXX.cpp
xprCXX.cpp
ype.cpp
32b5a1e82f535d43e94332183cd330f4a39b2dbd 22-Aug-2013 Craig Topper <craig.topper@gmail.com> Constify more uses of ASTContext&. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188991 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprConstant.cpp
ype.cpp
8b4b98b7cb18cc4a99cca0aefa515cc8756dc06d 22-Aug-2013 Craig Topper <craig.topper@gmail.com> Constify some more ASTContext& uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188989 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
0b861560d9b4b0eb2b36d0f32cc7819efe9ee5f2 22-Aug-2013 Craig Topper <craig.topper@gmail.com> Constify the ASTContext& passed to Stmt creation functions. Also constify the context in couple other functions that are called from creation functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188986 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
9db7a7eb4e23758e041752c9c0c0ec1663d5a0af 22-Aug-2013 Craig Topper <craig.topper@gmail.com> Constify the ASTContext& passed to Expr creation functions. Also constify the context in couple other functions that are called from creation functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188985 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
ecb5819a9e64fb654d46a3b270a286cc570c58ff 22-Aug-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- nested lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware


As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Augment AutoType's constructor (similar to how variadic
template-type-parameters ala TemplateTypeParmDecl are implemented) to
accept an IsParameterPack to encode a generic lambda parameter pack.

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that Sema::ActOnLambdaAutoParameter may use it to create the
appropriate list of corresponding TemplateTypeParmDecl for each
auto parameter identified within the generic lambda (also stored
within the current LambdaScopeInfo). Additionally,
a TemplateParameterList data-member was added to hold the invented
TemplateParameterList AST node which will be much more useful
once we teach TreeTransform how to transform generic lambdas.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- Teach Sema::ActOnStartOfLambdaDefinition to set the
return type of a lambda without a trailing return type
to 'auto' in C++1y mode, and teach the return type
deduction machinery in SemaStmt.cpp to process either
C++11 and C++14 lambda's correctly depending on the flag.

- various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,
James Dennett and the ever illuminating Richard Smith. And
yet I am certain that I have allowed unidentified bugs to creep in;
bugs, that I will do my best to slay, once identified!

Thanks!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188977 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclCXX.cpp
xprCXX.cpp
ype.cpp
c0afea9495ba535ac5de07c32b68a5559622737e 22-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Reduce sizeof(TemplateArgument) from 32 to 24.

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188959 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
28bdbf0861fefb33474fddbda1d3c66ee29be2af 21-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Use the right type for PredefinedExpr when it's in a lambda.

1. We now print the return type of lambdas and return type deduced functions
as "auto". Trailing return types with decltype print the underlying type.
2. Use the lambda or block scope for the PredefinedExpr type instead of the
parent function. This fixes PR16946, a strange mismatch between type of the
expression and the actual result.
3. Verify the type in CodeGen.
4. The type for blocks is still wrong. They are numbered and the name is not
known until CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188900 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8f189a9911a992a5c4118c3789485a85bd96e045 21-Aug-2013 Timur Iskhodzhanov <timurrrr@google.com> Abstract out virtual calls and virtual function prologue code generation; implement them for -cxx-abi microsoft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188870 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
9b9a5bf53edc724574593bbedcb55eca0d9995c6 21-Aug-2013 Craig Topper <craig.topper@gmail.com> Revert accidental commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188862 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
b7a95d2941869f2dfd0d2f0e805f794b46dd4b55 21-Aug-2013 Craig Topper <craig.topper@gmail.com> Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188860 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
ed218d05aa3d429208b0eb2204707c75b87d2fee 20-Aug-2013 Craig Topper <craig.topper@gmail.com> Revert r188756 because some other changes snuck in with it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188757 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
dab7845798d673cabeef792451354aeb394cdd54 20-Aug-2013 Craig Topper <craig.topper@gmail.com> Add AVX-512 feature flag and knl cpu to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188756 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
13b572c9e84729b4bd5f00d0f1452a4b93211cde 20-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Fix name lookup with dependent using decls.

We previously mishandled UnresolvedUsingValueDecls in
NamedDecl::declarationReplaces, which caused us to forget decls
when there are multiple dependent using decls for the same name.

Fixes PR16936.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188737 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
536bcedb8e6fea6458789f99f0ef554ce65514cc 19-Aug-2013 Craig Topper <craig.topper@gmail.com> Make the version of Stmt::operator new that takes ASTContext* call the ASTContext& version in Stmt inline instead of having two out of line functions that both call to the global versions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188648 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
bdf253de659442bc3fd4fc28d6145ad46113a0a7 18-Aug-2013 Craig Topper <craig.topper@gmail.com> Revert r188644 to unbreak buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188645 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
c2a99813e408651eee2a1d6a5dbf4edc10ce6827 18-Aug-2013 Craig Topper <craig.topper@gmail.com> Remove Stmt::operator new that takes a ASTContext*. All callers use the ASTContext& version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188644 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
5b3ebb4356ac62abd8767c4c3388b773d9d61802 18-Aug-2013 Craig Topper <craig.topper@gmail.com> Remove throw() from Stmt::operator new so the compiler will omit the null check on the result since ASTContext allocator won't return null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188641 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
05ed1a0587edcf3b8ee84a67d8c8ca76753d1fc1 18-Aug-2013 Craig Topper <craig.topper@gmail.com> Make expression allocation methods use a 'const' reference to the ASTContext since the underlying operator new only needs a const reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188636 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
360d23ef628bf891514e77c519d1d77305ca1743 16-Aug-2013 David Majnemer <david.majnemer@gmail.com> Parse: Do not 'HandleTopLevelDecl' on templated functions.

Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1412

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188536 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
cdd4b78583120222b82148626119b3e80ae1d291 16-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Properly track l-paren of a CXXFucntionalCastExpr.

In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.

Fixes PR16903.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188495 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
146522ec40ebc21a8c826e8bac98befaf91504cb 15-Aug-2013 Jack Carter <jack.carter@imgtec.com> [Mips][msa] Add support for half

Add support for half (a.k.a. __fp16) in builtin descriptions.
The second argument to BUILTIN() now accepts 'h' to represent half.

Patch by Daniel Sanders


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1c7a4094aff42e3bcfe948527e71f8fedbbf3222 15-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle member pointers better

Summary:
There were several things going wrong:
- We mangled in useless qualifiers like "volatile void" return types.
- We didn't propagate 64-bit pointer markers sufficiently.
- We mangled qualifiers belonging to the pointee incorrectly.

This fixes PR16844 and PR16848.

Reviewers: rnk, whunt

Reviewed By: rnk

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1353

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188450 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
26314e1a3e37efff2d19212d262731bc3a3044c4 13-Aug-2013 David Majnemer <david.majnemer@gmail.com> Fix typo in comment.

Thanks Kim Gräsman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188257 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c80eb46a0f37bee9597f1b466013a0f6271f9318 13-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle __uuidof correctly into template parameters

Summary:
It seems that __uuidof introduces a global extern "C" declaration of
type __s_GUID. However, our implementation of __uuidof does not provide
such a declaration and thus must open-code the mangling for __uuidof in
template parameters.

This allows us to codegen scoped COM pointers and other such things.

This fixes PR16836.
Depends on D1356.

Reviewers: rnk, cdavis5x, rsmith

Reviewed By: rnk

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1357

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188252 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
icrosoftMangle.cpp
439d665f4d1066ee5ebd8dd0938d85be83d490c4 13-Aug-2013 Larisse Voufo <lvoufo@google.com> variable templates updated for PCH serialization... Still working on test cases...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188249 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
f2081f685a021d1a50ded55cb23c7f039a037e7c 13-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle TemplateArgument::Declaration for references

Summary:
Properly mangle declarations showing up in template arguments that are
reference parameters. Fun-fact: undname cannot handle these!

Reviewers: rnk, cdavis5x

Reviewed By: rnk

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1356

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188245 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
42acc0c357557574514814863cab950f23cbff5e 12-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Fix pretty-printing for unnamed unions.

This is just a couple of minor fixes to account for the existence
of ElaboratedType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188209 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ypePrinter.cpp
c1cef0892e049fcd31084f02d1efdd9985d4dfa4 10-Aug-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Added source locs for angled parentheses in class/var template partial specs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188134 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ee138f6478e62f77e90418fd133ba8d637a9248a 10-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Correctly profile CXXPseudoDestructorExprs.

CXXPseudoDestructorExprs may not contain a type. PR16852.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188123 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
a902511dd22624b15cc61e36d167d1cf3549bc74 08-Aug-2013 Stephen Hines <srhines@google.com> Update Clang for merge to r187914.

Fixups related to OptParser.td moving into LLVM (from Clang).

Add libLLVMOption dependency.

Android.mk changes:
- Arg.cpp
- ArgList.cpp
- Option.cpp
- OptTable.cpp
- OptParserEmitter.cpp
- LambdaMangleContext.cpp
+ ASTTypeTraits.cpp
+ MangleNumberingContext.cpp
+ MicrosoftVBTables.cpp

Change-Id: I0aef80d90be9297cd1d5b5a08134cb6de2af4d2e
ndroid.mk
f68af647dda5cca00b49be27d24f62b0a7fff986 10-Aug-2013 James Dennett <jdennett@google.com> Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.

Summary:
Source-centric tools need access to the location of a C++11
lambda expression's capture-default ('&' or '=') when it's present.
It's possible for them to find it by re-lexing and re-implementing
rules that Clang's parser has already applied, but the cost of storing
the SourceLocation and making it available to them is 32 bits per
LambdaExpr (a small delta, proportionally), and the simplification in
client code is significant.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits, klimek, revane

Differential Revision: http://llvm-reviews.chandlerc.com/D1192

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188121 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
17ffbd03695a590d1c513010b7d4e96b9d5fe7d9 09-Aug-2013 David Majnemer <david.majnemer@gmail.com> Revert "[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section"

This commit reverts r188053.

It is breaking the build bots.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188055 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
ea3db97495b4a657bff505cd06b71e53ced46805 09-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section

We mangled them like:
L___uuid_12345678-1234-1234-1234-123456789abc

We should've mangled them like:
__GUID_12345678_1234_1234_1234_123456789abc

Furthermore, they are external symbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188053 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
4e9686b1f9947f1747b4f4316deb2087a7f56282 09-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement [class.friend]p11's special name lookup rules for friend declarations
of local classes. We were previously handling this by performing qualified
lookup within a function declaration(!!); replace it with the proper scope
lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188050 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1c56c9d9c2eed9ade88afe93541cc6fd25932355 08-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix alignof computation of large arrays on x86_64.

We were exposing the extra alignment given to large arrays. The new behavior
matches gcc, which is a good thing since this is a gcc extension.

Thanks to Joerg Sonnenberger for noticing it.

While at it, centralize the method description in the .h file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187999 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4ac73c7514f9e836b4d9781738f333c5cb91cb63 08-Aug-2013 Stephen Hines <srhines@google.com> Merge commit '51e75aecf4fb303b91c9e54fd88e3509e5acc7a6' into merge-20130807

Conflicts:
lib/Basic/Targets.cpp
lib/Sema/SemaDeclAttr.cpp

Change-Id: If457223ecbee9e43c73d15333bf10d36590d05c4
b82f77fbe320a497f0b60d241c59b651b3ce15ca 07-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Correctly allign arrays on 32 bit systems.

Before this patch we would align

long long int big[1024];

to 4 bytes on 32 bit systems. The problem is that we were only looking
at the element type when getLargeArrayMinWidth returned non zero.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187897 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
15c8e56e44a5fb6d298ae5bad791f9ea5bb883f6 07-Aug-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to fix doxygen trailing comments for ObjectiveC methods.
// rdar://14258334


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187893 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8c238be45e2ae6fa00fb5a2bc27a46d3c16d47ee 07-Aug-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to fix doxygen trailing comments for ObjectiveC properties.
// rdar://14258334


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187835 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3835a4ef050da466038844274d79f1fc9d77c0f1 06-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16755: When initializing or modifying a bitfield member in a constant
expression, truncate the stored value to the size of the bitfield.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187782 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ef4579cda09b73e3d4d98af48201da25adc29326 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclTemplate.cpp
taniumMangle.cpp
c0e64f3d293bc1c448a84d285f115bc946b91b07 06-Aug-2013 David Majnemer <david.majnemer@gmail.com> [ms-cxxabi] Properly mangle member pointers

There were three things missing from the original implementation:

- We would omit the 'E' qualifier for members int 64-bit mode.
- We would not exmaine the qualifiers in 'IsMember' mode.
- We didn't generate the correct backref to the base class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187753 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
02c44f0962c8739c447bc35688d47294f72494aa 06-Aug-2013 David Majnemer <david.majnemer@gmail.com> [ms-cxxabi] Handle template-template arguments

Template-template arguments appear to be a rather simple encoding of the
template's templated tag type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187751 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
7802fc9e6cb488fc1321ce3f7431b7aeeefdd18f 05-Aug-2013 David Majnemer <david.majnemer@gmail.com> [ms-cxxabi] Mangle nullptr template arguments

MSVC mangles nullptr template arguments identically to zero literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187741 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
13163700843a0ad1df903bdadcce59ae86827d72 01-Aug-2013 David Majnemer <david.majnemer@gmail.com> AST: Treat inline function declarations in -fms-compatibility as if it were in C++ when in C mode

This essentially fixes PR16766.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187586 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3b142da09284334a5fec95ed467ff6313a504b0d 01-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> Make helper function static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187574 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
800de7ee43ab2dce2a281d4fa3c965b5424a4237 01-Aug-2013 Daniel Jasper <djasper@google.com> Silence unused variable warning in non-assert builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187572 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
b793f0d3448a15277cd6b6cc4ba558ded39a8084 01-Aug-2013 Tim Northover <tnorthover@apple.com> AArch64: initial NEON support

Patch by Ana Pazos

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187568 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
3f32210598ff678fbaa462422770bdbace895ac8 01-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert when instantiating a default argument of a template defined in a
module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187556 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
635de28950ef84ae26308ff734e778bad1ddde92 30-Jul-2013 Timur Iskhodzhanov <timurrrr@google.com> Add MicrosoftVFTableContext to AST

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187409 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
TableBuilder.cpp
dc663264c56e587ce9210a7c3b049645e92526b9 26-Jul-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Remove comma from the blacklist of characters that prevent a comment to be attached to a decl.

It's common to use an availability function macro at the start of a decl.
rdar://13965065

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187230 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ceaa1ecfa3a8c2cd851bda94b135318e83ba560a 25-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> Documentation parsing: if typedef name is being declared
via a macro, try using declaration's starting location.
This is improvement over not having a valid location and
dropping comment altogether. // rdar://14348912


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187085 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
03ce5f8c68f55405db6001e82bdb18581d0dadce 24-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: track object lifetime during constexpr evaluation, and don't allow
objects to be used once their lifetimes end. This completes the C++1y
constexpr extensions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187025 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a4130baad9d10b7feabb7e003da53424e986d269 22-Jul-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Emit linkonce complete dtors in TUs that need them

Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong. This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor. They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases. This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors. In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch. Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly. This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1066

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186828 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
8d030c7a6f36438f6c7dd977f8be0de0cc781ad5 22-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
* renamed isTypeName as HasTypenameKeyword
In UsingDecl:
* renamed get/setUsingLocation to get/setUsingLoc
* renamed is/setTypeName as has/setTypename



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186816 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
ddcff1b310b80b63f1a9ba88f2befeab40c3648f 22-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Tighten up the set of operator new/operator delete calls we're permitted to
optimize, to follow the permissions granted in N3664. Under those rules, only
calls generated by new-expressions and delete-expressions are permitted to be
optimized, and direct calls to ::operator new and ::operator delete must be
treated as normal calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186799 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
81e4549fede62835235a53c024909c3fab6b73ac 21-Jul-2013 Lubos Lunak <l.lunak@suse.cz> report unused-value warning also for warn_unused types



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186793 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
03bf10dc4f245a17ee4f702461cba5120cc4d09b 20-Jul-2013 Richard Trieu <rtrieu@google.com> If a default argument is a dependent type, get the real type from the desugared
template. Passing around dependent types can lead to integral arguments that
cannot be evaluated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186757 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
654005265b1faab223f055bff3dd254476df7ff5 20-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix bug in computing POD-for-layout.

A class with a field of non-POD-for-layout type is not POD-for-layout.
This computation should not depend on whether the field is of POD type
in the language sense.

Fixes PR16537.

Patch by Josh Magee.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186741 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a5e660188a3c654cf0c88ed1093b28207e870b2b 20-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make IgnoreParens() look through ChooseExprs.

This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes <rdar://problem/14438917>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
4bdb602d1a70ea432aad909825eb4748a2aca768 19-Jul-2013 Jean-Daniel Dupas <devlists@shadowlab.org> Fix another place where clang check objc selector name instead of checking the selector family

Summary: In ARC mode, clang emits a warning if the result of an 'init' method is unused but miss cases where the method does not follows the Cocoa naming convention but is properly declared as an init family method.

CC: cfe-commits, eli.friedman

Differential Revision: http://llvm-reviews.chandlerc.com/D1163

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186718 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5b92696c8f1f8ef943ad87397b95c031b5787305 19-Jul-2013 Reid Kleckner <reid@kleckner.net> Create calling convention AttributedType sugar nodes

Canonical types are unchanged. The type printer had to be changed to
avoid printing any non-default implicit calling convention as well as
the calling convention attribute.

Reviewers: rjmccall

Differential Revision: http://llvm-reviews.chandlerc.com/D1132

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186714 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
4fa7eab771ab8212e1058bd1a91061ff120c8fbb 19-Jul-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP: basic support for #pragma omp parallel


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186647 91177308-0d34-0410-b5e6-96231b3b80d8
eclOpenMP.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
d4de59d3e54421ef88316d650e35802ba9c572cf 17-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed source range of C++03 access declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186522 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
21cde050b64eefbb5094af67985752eee42d00e2 17-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++. This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186464 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bdfacea02fa37b64e4eb815448bc5c4d42a67a8e 16-Jul-2013 Samuel Benzaquen <sbenza@google.com> Add more types to ASTNodeKind. Refactor common instantiation code.

Summary:
Add support for CXXCtorInitializer and TemplateArgument types to ASTNodeKind.
This change is to support more matchers from clang/ASTMatchers/ASTMatchers.h in the dynamic layer (clang/ASTMatchers/Dynamic).

Reviewers: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1143

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186422 91177308-0d34-0410-b5e6-96231b3b80d8
STTypeTraits.cpp
e8caa30d6124b915fb6bfb3fb2d0eb4857381d08 16-Jul-2013 Serge Pavlov <sepavloff@gmail.com> Limit number of bits in size representation so that bit size fit 64 bits.
This fixes PR8256 and some others.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186385 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
5029bd518b4d5363ceb049c9162c30e5b38ba199 16-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix alignment of class derived from empty class.

The record layout code didn't properly take into account that
an empty class at offset 0 can have an alignment greater than 1.

Patch by Andrea Di Biagio.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186370 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ad4aaf11897cc5e9d443b0a80114daacf385f6df 15-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjC migrator: finding conforming protocol
candidates for each class. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186349 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3aa29df37b140f9c6786b6863a0cac195071b598 15-Jul-2013 Craig Topper <craig.topper@gmail.com> Add 'static' and 'const' qualifiers to some arrays of strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b960232518a1cd79c5f64ab5ef54c88e34660191 15-Jul-2013 Craig Topper <craig.topper@gmail.com> Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186300 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
dc80978ed59863c4d4eb251c109d312de0532611 13-Jul-2013 David Blaikie <dblaikie@gmail.com> Simplify getTypeInfoImpl handling of 'non-canonical unless dependent' types.

These types are not dependent in this context, so just look through
the sugar.

Review by Richard Smith & Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186260 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7bae1597f4a7088f5048695c14a8f1013a86108 13-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++ modules: Don't call DeclContext::lookup when half-way through deserializing
decls. That can reenter deserialization and explode horribly by trying to merge
a declaration that we've not got very far through deserializing yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186236 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3be37d1d2d5733523e516e5a6b22c576e740230e 13-Jul-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Don't consider function templates for name backrefs

They don't seem to be used for back references, presumably because a
function template is unlikely to reoccur, while a class template name
may reoccur as a type.

This fixes a mangling issue for llvm::hash_combine() in Hashing.h.

Reviewers: timurrrr

Differential Revision: http://llvm-reviews.chandlerc.com/D1078

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186233 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c250192494e0fa63be50269d2c1eb7786f8ab7a0 13-Jul-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Changes so that a few tests do not fail when running under guarded malloc.

Guarded malloc emits some messages at the beginning in stderr when enabled.
These messages caused a few tests to fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186219 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c131046bb8724afcbc8649c123683d12cfb5015f 12-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> fixes a typo caught by Jordan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186171 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
361a329ee562fb3ed7a20ffddb9e98e71fa16a56 12-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Produce gcc compatible encoding of
ivar type in meta-data while preventing recursive
encoding in a corner case. // rdar://14408244


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186169 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fcb5a251e9c0c8c2d54323677d4f2ba5219301d0 12-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix crash on zero-argument assignment operator.

Make sure we don't crash when checking whether an assignment operator
without any arguments is a special member. <rdar://problem/14397774>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186137 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5154dce6388e3aaa445467030df7a45ed1211abe 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add a __builtin_addressof that performs the same functionality as the built-in
& operator (ignoring any overloaded operator& for the type). The purpose of
this builtin is for use in std::addressof, to allow it to be made constexpr;
the existing implementation technique (reinterpret_cast to some reference type,
take address, reinterpert_cast back) does not permit this because
reinterpret_cast between reference types is not permitted in a constant
expression in C++11 onwards.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186053 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
07b1bbe648a21b8cdbc073fb6a409422c49921bb 10-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjC migrator: Improve on hueristics.
migrate to 'copy attribute if Object
class implements NSCopying otherwise
assume implied 'strong'. Remove
lifetime qualifier on property as it has
moved to property's attribute. Added TODO
comment for future work by poking into
setter implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186037 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e79c9876aac0d933c9f97e8a36c97698b368daba 10-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Finish off mangling locals in block literals.

Specifically, handle the case where the block is in a default argument
in a class method. The mangling here follows what we do for lambdas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185991 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
e5798893b1fb2468a11e8374d340e6fa2f82a9a5 10-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Get rid of dead/useless code for block mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185989 91177308-0d34-0410-b5e6-96231b3b80d8
angle.cpp
icrosoftMangle.cpp
5e867c8a07d82da0d3b0a43402ee4f1c6ba416e9 10-Jul-2013 Eli Friedman <eli.friedman@gmail.com> More local mangling fixes.

Compute mangling numbers for externally visible local variables and tags.
Change the mangler to consistently use discriminators where necessary.
Tweak the scheme we use to number decls which are not externally visible
to avoid unnecessary discriminators in common cases now that we request
them more consistently.

Fixes <rdar://problem/14204721>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185986 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
angleNumberingContext.cpp
163fbf810eaffc2c7b0170d91b6196b032911957 08-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid specifying the vector size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185784 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
eb9c55fdfa25d97f61c04f4f06fd499d988045c0 06-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> [comment parsing]: Removes an unsafe API whose
use can cause crash. No test is available. It is uncovered
by code browsing. // rdar://14348205


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185732 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
1847c718fe61f8e99d77c60ab77c9bf2ad4d77aa 05-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Don't use mangleCXXRTTIName in TBAA for C code.

This changes the TBAA code so it doesn't use mangleCXXRTTIName in C,
because it doesn't really make sense there. Also, as sort of a
defense-in-depth change, fix the mangler so it handles C RecordDecls
correctly.

No tests because I don't know the TBAA code well enough to write a test,
and I don't know how else to trigger mangling a local struct in C.

Fixes a crash with r185450 reported by Joerg Sonnenberger.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185721 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
1ec4a86a867fc04f35d13bc9e33b04cf2171fe41 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::createTemporaryFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185717 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
6b9240e058bf3451685df73fc8ce181b3046e92b 05-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl& for function arguments instead of SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
TableBuilder.cpp
889221076f50fe7df37e2e61c967e941b8df383a 05-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix regression from r185450.

As it turns out, the NoFunction bit for local class mangling needed to be
propagated into more places. r185450 turned what used to be an incorrect
mangling into an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185713 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
09d19efaa147762f84aed55efa7930bb3616a4e5 04-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185610 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
XXInheritance.cpp
5d90d1805c99e0f14c623adf2cbedc725184bc4b 02-Jul-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Mangle variadic template parameter packs

Unlike Itanium, there is no code to indicate the beginning of a
parameter pack. I tested this with MSVC 2013, which is the only version
that implements variadic templates so far.

This is needed to compile APInt.cpp for the MS C++ ABI.

Reviewers: timurrrr

Differential Revision: http://llvm-reviews.chandlerc.com/D1077

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185454 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
8443188a8f9cbd27612b7058cdcfc53356f024a3 02-Jul-2013 Eli Friedman <eli.friedman@gmail.com> More fixes for block mangling.

Make sure we properly treat names defined inside a block as local
names. There are basically three fixes here. One, correctly
treat blocks as a context where we need to use local-name mangling using
the new isLocalContainerContext helper. Two, make
CXXNameMangler::manglePrefix handle local names in a consistent way.
Three, extend CXXNameMangler::mangleLocalName so it can mangle a block
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185450 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
432d488305492bd998dbcd200ed500389c7602f5 02-Jul-2013 Timur Iskhodzhanov <timurrrr@google.com> Simplify getting CXXRecordDecl from a base iterator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185438 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
1cf7c3f8948b26395bc3293a657afb9f98878db7 02-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Don't skip lambdas when mangling local vars.

This commit rearranges the logic in CXXNameMangler::mangleLocalName and
GetLocalClassDecl so that it doesn't accidentally skip over lambdas. It
also reduces code duplication a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185402 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
47be5bb24df2c91012ecd432546184cceee2c64c 01-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Simplify code in mangler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185384 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
a7872d48b904c6b696ac843a82a9dd624e35b032 01-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix CMakeLists.txt.

Sorry about that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185374 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
07369dde9d72213bf8a48288cd8b29999af9a40c 01-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix mangling for block literals.

Blocks, like lambdas, can be written in contexts which are required to be
treated as the same under ODR. Unlike lambdas, it isn't possible to actually
take the address of a block, so the mangling of the block itself doesn't
matter. However, objects like static variables inside a block do need to
be mangled in a consistent way.

There are basically three components here. One, block literals need a
consistent numbering. Two, objects/types inside a block literal need
to be mangled using it. Three, objects/types inside a block literal need
to have their linkage computed correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185372 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
taniumMangle.cpp
ambdaMangleContext.cpp
angleNumberingContext.cpp
15a0de95f5b364cfb96bacc644f491215bd92098 28-Jun-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix a trivial typo, add a FIXME to have more test coverage for VTableBuilder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185159 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
6982bf4d77bc57a85ee173b631729fce673f16ef 28-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Lazily deserialize function template specializations. This fixes a cycle in
module deserialization / merging, and more laziness here is general goodness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185132 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
49bab4c0046e8300c79e79b7ca9a479696c7e87a 27-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove bogus VarDecl::extendsLifetimeOfTemporary function and inline it into
its only caller with a FIXME explaining why it's bogus.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185109 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bf516f7a5d3385ab9989220eface8d5709038924 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185103 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
0a598fd7e428b5eb28b67770a66f3976ac365e42 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185101 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmt.cpp
ype.cpp
TableBuilder.cpp
6887ff2c70f4afba4e521f8779d041e6d02df464 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Simplify StmtIterator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185098 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
2a42bc82c513756d200e49c9ea5a68e5d7bca43e 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185042 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
33b90b34990a7738adebae30ef7ebf9d578ce9ae 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Handle all TemplateArguments in trivial TypeLocs.

Armed with a much better understanding of what
TemplateSpecializationTypeLoc::initializeArgLocs actually does, I now
understand that it's fine to just use an empty TemplateArgumentLocInfo
for Integral, Declaration, and NullPtr TemplateArguments.

Fixes PR14281. (The testcases are actually derived from libcxx_test in
deduction-crash.cpp because the original testcase was impossible to reduce.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185038 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
cd06f26835033e879a9278941f4f6e6a4086976d 26-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Rewrite record layout for ms_struct structs.

The old implementation of ms_struct in RecordLayoutBuilder was a
complete mess: it depended on complicated conditionals which didn't
really reflect the underlying logic, and placed a burden on users of
the resulting RecordLayout. This commit rips out almost all of the
old code, and replaces it with simple checks in
RecordLayoutBuilder::LayoutBitField.

This commit also fixes <rdar://problem/14252115>, a bug where class
inheritance would cause us to lay out bitfields incorrectly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185018 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
ecordLayoutBuilder.cpp
4fc5089e306fe606f2e3e4fa58063ebab35deb62 26-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Lazily deserialize the "first' friend declaration when deserializing a class
declaration. This PCH a little lazier, and breaks a deserialization cycle that
causes crashes with modules enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184904 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclFriend.cpp
147fab970c9877273e6185f0e276f376887c967f 26-Jun-2013 Matt Beaumont-Gay <matthewbg@google.com> Don't try to get the layout of an invalid decl in getDeclAlign.

When the decl that we're getting alignment for is a FieldDecl, and the field's
parent record is invalid, skip the actual field alignment calculation (and
return 1-byte alignment in the general case).

Also, assert in in getASTRecordLayout that the decl is valid. This was
inspired by PR16292; see also r184581 and r184751.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184883 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
bace10ccf5fe3468c6232681875039961f02322d 24-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Change mangling of objects inside block literals.

This changes the mangling of local static variables/etc. inside blocks
to do something simple and sane. This avoids depending on the way we mangle
blocks, which isn't really appropriate here.

John, please take a look at this to make sure the mangling I chose is sane.

Fixes <rdar://problem/14074423>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184780 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
f21818dbeeb024ecf4c221ef08735f7c99a7acea 24-Jun-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Use sugared types in the mangler instead of canonical types

At this point, it's clear that the MSVC mangler uses the type-as-written
instead of the canonical type, so this should bring us closer to MSVC.
The main thrust of this change is to fix the way we mangle decayed array
parameters of function pointer parameters. With a DecayedType sugar
node, this code can now be much simpler.

Fixes PR16096.

This also fixes a separate issue that Richard spotted in review.
Because separate declarations of the same entity can be spelled and
mangled differently, MSVC always mangles the earliest declaration in an
attempt to avoid link errors. Clang now does the same.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D844

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184777 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
12df246d6dea2ee1f92c186f922f1afcf499647a 24-Jun-2013 Reid Kleckner <reid@kleckner.net> [AST] Introduce a new DecayedType sugar node

The goal of this sugar node is to be able to look at an arbitrary
FunctionType and tell if any of the parameters were decayed from an
array or function type. Ultimately this is necessary to implement
Microsoft's C++ name mangling scheme, which mangles decayed arrays
differently from normal pointers.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1014

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184763 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
taniumMangle.cpp
ypePrinter.cpp
653c657864a436cfa25ecbf2e03fa0ef1eea36f3 24-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert a use of PathV1.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184743 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
096a394f3d5b4938640e1ac92d9b439a2bad0a23 24-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Avoid adding entries to the DeclContext lookup table multiple times when lazily
constructing a lookup table.

Previously, buildLookup would add lookup table entries for each item lexically
within the DC, and adding the first entry with a given name would trigger the
external source to add all its entries with that name. Then buildLookup would
carry on and re-add those entries all over again.

Instead, follow a simple rule: a declaration from an external source is only
ever made visible by the external source. One exception to this: since we don't
usually build a lookup table for the TU in C, and we never serialize one, we
don't expect the external source to provide lookups in the TU in C, so we build
those ones ourselves.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184696 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c5b0054693b3b3cafe6a13549358c22e07fcd4ff 24-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: allow "\param ..." to describe variadic arguments

Original patch by Fariborz Jahanian; extended by me.

Fixes rdar://14124644


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184688 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentSema.cpp
ddb10f767604d8efa5e491076d6fdd23a19db86c 24-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> When setting the external visible declarations for a decl context, check
whether they replace any existing lookups in the context, rather than
accumulating a bunch of lookup results referring to the same entity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184679 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ab297ccbcc51d5197d4ddb4e99b7bc8868d38314 24-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184678 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
a558d2e29817e36798875c96efb62251e53ff024 24-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Move comment on Sema::isFunctionPointerVarDecl() to the header file


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184677 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
97e5bc2643dd1478ca10d1b9a6581f332801c958 23-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: followup to r184610: allow multiple \returns

Remove unneeded member in CommentSema, add a test for the XML schema (the
schema already allowed multiple paragraphs in <ResultDiscussion>, but there
were no tests for that), fix HTML generation (it is not allowed to have <p>
inside <dl>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184652 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
6e322c08b187ba93019732d2295c84c339813e0d 22-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add dumping support for DeclContext's StoredDeclsMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184648 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
35178dc09d97bb2e0612813def09833866e3ad82 22-Jun-2013 David Blaikie <dblaikie@gmail.com> DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184644 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
d52b20c706326cc2c5c3707a902e7ca4474719b6 22-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> [document parsing]: Allow multiple adjacent \return and the like
commands. Render them properly in XML output.
// rdar://14207725


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184610 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
3f7c1b1aab8c9deb0ecf527c2a4089bfd68bada1 21-Jun-2013 Nico Weber <nicolasweber@gmx.de> Add an assert() suggested by Richard.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184516 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9b9bdba90cb7a61ed0e5bbadf9155b9d6848ce98 21-Jun-2013 Nico Weber <nicolasweber@gmx.de> Fix a crash with __flaot128 noticed by Eli.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184498 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cac18add73d095eaab600aefe27ea7174aec4922 20-Jun-2013 Nico Weber <nicolasweber@gmx.de> Lazily provide a __float128 dummy type in -std=gnu++11 mode.

This is needed to parse libstdc++ 4.7's type_traits, see PR13530.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184476 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cf52ca6bb6dd76a1bd967bc422287fafafa1e45a 20-Jun-2013 Manuel Klimek <klimek@google.com> Adds the equalsBoundNode matcher.

Most of the tests contributed by Edwin Vane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184427 91177308-0d34-0410-b5e6-96231b3b80d8
STTypeTraits.cpp
c2fa6b6f9a89f55397355937544fbbe8258ead5d 20-Jun-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Improved source code fidelity for gcc mode attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184417 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
850cf510b8e310a99344c29731f0b68e096a8658 20-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix one place I missed that was memcpy'ing TypeLocs in a way that messes
up alignment.

Fixes utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp from the
libc++ testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184397 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
37a84f653c196aa0b73fad96707175a62dcb6a12 20-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16377: Allow evaluation of statement expressions in constant evaluation,
why not. Apparently GCC supports this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184396 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d5fbb2910fe934a61176b94503b0cf495f129253 19-Jun-2013 Samuel Benzaquen <sbenza@google.com> Enhancements for the DynTypedNode

Added ASTNodeKind as a standalone way to represent node kinds and their hierarchy.
This change is to support ongoing work on D815.

Reviewers: klimek

CC: cfe-commits

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184331 91177308-0d34-0410-b5e6-96231b3b80d8
STTypeTraits.cpp
MakeLists.txt
2d588b4bc7127adf1a1c621002dfe452a99fef6f 19-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> documentation parsing: patch to make @class work for
class templates; and similarly, @function works for
function templates. // rdar://14124702


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184329 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
e310d4473ffe22ee8e9161afa56fd8293cf2e013 19-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't depend on PathV1.h including set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184310 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
9063302a82423cb83f002257a416741850739a70 19-Jun-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Emit and install appropriately mangled vbtables

In Itanium, dynamic classes have one vtable with several different
address points for dynamic base classes that can't share vtables.

In the MS C++ ABI, each vbtable that can't be shared gets its own
symbol, similar to how ctor vtables work in Itanium. However, instead
of mangling the subobject offset into the symbol, the unique portions of
the inheritance path are mangled into the symbol to make it unique.

This patch implements the MSVC 2012 scheme for forming unique vbtable
symbol names. MSVC 2010 use the same mangling with a different subset
of the path. Implementing that mangling and possibly others is TODO.

Each vbtable is an array of i32 offsets from the vbptr that points to it
to another virtual base subobject. The first entry of a vbtable always
points to the base of the current subobject, implying that it is the
same no matter which parent class contains it.

Reviewers: rjmccall

Differential Revision: http://llvm-reviews.chandlerc.com/D636

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184309 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
icrosoftMangle.cpp
b0f9314bbe29d09c3ea3f76a257125d1568665c7 19-Jun-2013 NAKAMURA Takumi <geek4civic@gmail.com> Revert r184249, "doc. parsing: Allow parameter name "..." for variadic functions/methods."

It crashes in the case;

/// Without any "param"s in the description.
int printf(const char *format, ...);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184283 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
0601700e8d8e8d0f42bea1c0137c04e8c8ae5ac3 19-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Introduce a new mangling for protocol-qualified ObjC types in C++. This allows
to provide proper overloading, and also prevents mangling conflicts with
template arguments of protocol-qualified type.

This is a non-backward-compatible mangling change, but per discussion with
John, the benefits outweigh this cost.

Fixes <rdar://problem/14074822>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184250 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
7e5e2d0c53b1b7253621d955089c0d14fe2a8078 19-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> doc. parsing: Allow parameter name "..." for variadic functions/methods.
// rdar://14124644


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184249 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
3ed4d1cbaad763c103771bdefb8b986a08f165fc 18-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14503: Don't assert if a constexpr constructor temploid instantiates to a
constructor that does not initialize all members, and that constructor is used
to initialize a global.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184211 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6e40c9544a0215c3e632e1fb79d5161adc464101 18-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix source range of CXXNewExpr with parentheses around the type. PR15569.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184139 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
26e51781f9d55cdae764facf8fe773aa2adb4569 17-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix Expr::Classify to correctly classify ExtVectorElementExprs. PR16204.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184123 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
9610d77508bdca13e0475783ff404428611c9683 17-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Cleanup linkage computation for static locals.

With this patch we assign VisibleNoLinkage to static locals in inline functions.
This lets us simplify CodeGen a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184114 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cff15128c6c089bd6fae841b80680e6f5afbf0bf 17-Jun-2013 Reid Kleckner <reid@kleckner.net> [AST] Don't include RecursiveASTVisitor.h in ASTContext.h

The untemplated implementation of getParents() doesn't need to be in a
header file.

RecursiveASTVisitor.h is full of repeated macro expansion. Moving this
include to ASTContext.cpp speeds up compilation of
LambdaMangleContext.cpp, a small C++ file with few includes, from 3.7s
to 2.8s for me locally. I haven't measured a full build, but it can't
hurt.

I had to fix a few static analyzer files that were depending on
transitive includes of C++ AST headers.

Reviewers: rsmith, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D982

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184075 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d6b698739ab157348acafcec5b06a05d3d35377d 15-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16263: Implement current direction of core issue 1376. Binding a reference to
the result of a cast-to-reference-type lifetime-extends the object to which the
reference inside the cast binds.

This requires us to look for subobject adjustments on both the inside and the
outside of the MaterializeTemporaryExpr when looking for a temporary to
lifetime-extend (which we also need for core issue 616, and possibly 1213).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184024 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3282b84296dba58e811741b63e4429980a98df8b 14-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Emit initializers for static-storage-duration temporaries as constants where
possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183967 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2f9c0355d33fe1c64ddc4a9f9710135220e47ca9 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> InheritViz.cpp uses sys::Path, include PathV1.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183922 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
8b81df326bd32ecb00e0f0c81e771de0c4f92937 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use version of DisplayGraph that takes a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183916 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
5350ded82a4e93a79c99a322e11360e096e2f852 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> More for PR12457: fix handling of __builtin_isinf_sign and test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183890 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
acaf72adaed7b320fdec8c09f70ec9ac46df3563 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Towards PR12457: constant expression evaluation support for __builtin_parity{,l,ll}, __builtin_ffs{,l,ll}, and __builtin_fpclassify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183889 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4dbf408ee91a35f7c703ab279e7eaa1803215936 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix part of PR12457. Patch by Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183886 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f050d2445ed75569ccfe0740caa900403d2ce3b3 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement core issue 903: only integer literals with value 0 and prvalues of
type std::nullptr_t are null pointer constants from C++11 onwards.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183883 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7c3e615f01e8f9f587315800fdaf2305ed824568 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR12086, PR15117

Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).

This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183872 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
2049840b0ffe8ee4bf39051cfa8ca08440c8f667 12-Jun-2013 Stephen Hines <srhines@google.com> Merge commit '1342a4ef62dd7b839c6f09348b246a4f00282f29' into merge_20130612
0567a79130a251bf464ce21ecf3f8b9fb5207900 10-Jun-2013 Reid Kleckner <reid@kleckner.net> Use FPT::getArgTypes() instead of manually building ArrayRefs

Made significantly easier with git-clang-format.

Differential Revision: http://llvm-reviews.chandlerc.com/D947

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183694 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ambdaMangleContext.cpp
c910d4cfa5042f2c9da1eb4e0b6ed59240c0eeee 08-Jun-2013 Reid Kleckner <reid@kleckner.net> Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"

This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183616 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
63c9a92a805394c1ca9e4a5fd8afb3acbb918d03 08-Jun-2013 Reid Kleckner <reid@kleckner.net> [Sema] Make FunctionType's TSI use unadjusted argument types

This helps preserve the type-as-written in the AST, which we need for
MSVC mangling. In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
- QualType ArgTy = Param->getType();
+ QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

Differential Revision: http://llvm-reviews.chandlerc.com/D883

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183614 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
44ee0a710c59d8e6793189f903bae21c16814324 07-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Re-commit r183466 with a fix to make the TypeLoc casting machinery work
correctly in the presence of qualified types.

(I had to change the unittest because it was trying to cast a
QualifiedTypeLoc to TemplateSpecializationTypeLoc.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183563 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
20387efff0870da2c8b30bb62ae661239a903021 07-Jun-2013 Manuel Klimek <klimek@google.com> Reverts r183466: "Perform dynamic alignment computations..."

This introduces bugs in TemplateSpecializationTypeLoc's angle bracket
locations.

Regression test follows in a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183513 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
86875b11db3536858116effd80cbb06b6810303d 07-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Perform dynamic alignment computations so that the data in TypeLocs is
correctly aligned. Not performing such computations led to misaligned loads,
which crash on some platforms and are generally bad on other platforms.

The implementation of TypeLocBuilder::pushImpl is rather messy; code using
TypeLocBuilder accidentally assumes that partial TypeLocs are
laid out like a complete TypeLoc. As a followup, I intend to work on
fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should
substantially simplify the implemementation.

Fixes PR16144.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183466 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
49a246f4fad959888bb0164c624c3c2b03078e91 06-Jun-2013 Jordan Rose <jordan_rose@apple.com> [analyzer; new edges] Simplify edges in a C++11 for-range loop.

Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.

In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.

One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.

<rdar://problem/14038483>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183449 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
f69dd33cfc0b1f2a6c88d10951dbd29c4dc806c2 06-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> When a static storage duration temporary appears in a constant expression, it
must be initialized by a constant expression (not just a core constant
expression), because we're going to emit it as a global. Core issue for this is
pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183388 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fb6f75feaa0fa6621282df1075677a26fdfde1b7 06-Jun-2013 Jordan Rose <jordan_rose@apple.com> [analyzer] Look through ExprWithCleanups to see if an expr's consumed.

We based decisions during analysis and during path generation on whether
or not an expression is consumed, so if a top-level expression has
cleanups it's important for us to look through that.

<rdar://problem/14076125>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183368 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
2aae5ba15d07e9aa37ff9b03ad0024c0707068f5 05-Jun-2013 Timur Iskhodzhanov <timurrrr@google.com> Recommit r183298+r183300 'Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers()'

In r183298, I've used llvm::SmallPtrSet<..., 8> instead of llvm::SmallVector<..., 8> for NewVirtualFunctionsTy by mistake.
This only manifested when a class had more than 8 virtual functions, which wasn't covered by unit-tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183310 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
d38a21f5888dd3940739e27f2d309a112d6f3790 05-Jun-2013 Timur Iskhodzhanov <timurrrr@google.com> Revert r183298 and r183300 as the former broke the virtual function lookup in libcxx __locale

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183305 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
391faea6c1b99499acae9e4c500c458d10c8be4a 05-Jun-2013 David Blaikie <dblaikie@gmail.com> Fix fallout from r183298, unused function (CollectPrimaryBases) causing the -Werror build to fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183300 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
c65ee8f4fe7d9e48b75a367b8b63d62db0855821 05-Jun-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix the DUMP_OVERRIDERS macro in the VTableBuilder.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183299 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
f19759ea386d0576a7a0e250cedccc33ed560bf5 05-Jun-2013 Timur Iskhodzhanov <timurrrr@google.com> Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers(); also add some tests for the VTable indices output to make sure we don't regress

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183298 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
211c8ddb5b500ed84833751363d0cfe1115f4dd3 05-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Model temporary lifetime-extension explicitly in the AST. Use this model to
handle temporaries which have been lifetime-extended to static storage duration
within constant expressions. This correctly handles nested lifetime extension
(through reference members of aggregates in aggregate initializers) but
non-constant-expression emission hasn't yet been updated to do the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183283 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDumper.cpp
xprConstant.cpp
48eff6c3512fd6c768072b05ab4c287c7719072b 04-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C encoding. Fixes up encodeing for
arrays of empty structs. // rdar://14053082
(also pr13062).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183234 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ec0d96f8fa33a56cf4b9ea7d63bff8c0abcdd13c 04-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix linkage computation for local types in template functions.

Template functions (and member functions of class templates) present the same
problem as inline functions. They need to be uniqued, so we need to assign
VisibleNoLinkage linkage to types defined in them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183222 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8fcb0452235eeecfae8cabd7381e146327a8472e 03-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Pacify compilers that think you can drop off a fully covered switch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183155 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
f0f353b36f173ea282209070fcdbbedab84c19db 03-Jun-2013 Manuel Klimek <klimek@google.com> Fix memory leak for APValues that do memory allocation.

This patch ensures that APValues are deallocated with the ASTContext by
registering a deallocation function for APValues to the ASTContext.

Original version of the patch by James Dennett.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183101 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
ecl.cpp
d1b55dcf6bd61d4350b01e15590bde9bb5a334bb 03-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Do not walk through member-accesses on bitfields when looking for the object
which is lifetime-extended by a reference binding. An additional temporary is
created for such a bitfield access (although we have no explicit AST
representation for it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183095 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8a66bf78becf05a24e8251379f3843d1fceb627f 03-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor constant expression evaluation to associate the complete object of a
materialized temporary with the corresponding MaterializeTemporaryExpr. This is
groundwork for providing C++11's guaranteed static initialization for global
references bound to lifetime-extended temporaries (if the initialization is a
constant expression).

In passing, fix a couple of bugs where some evaluation failures didn't trigger
diagnostics, and a rejects-valid where potential constant expression testing
would assume that it knew the dynamic type of *this and would reject programs
which relied on it being some derived type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183093 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4e43dec4df9d7dd8e07b47bb15967f1b733a9bc6 03-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix handling of pointers-to-members and comma expressions when
lifetime-extending temporaries in reference bindings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183089 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e98089083f2504a4b1f55a9f00a2a2df63cb72e0 30-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix PR16060.

The testcase in PR16060 points out that while template arguments can
show that a type is not externally visible, the standards still says
they have external linkage.

In terms of our implementation, it means that we should merge just the
isExternallyVisible bit, not the formal linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182962 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
df08c4b371522025d1d3aec4992fb0f27d7c4571 30-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix potential infinite loop when iterating over redeclarations of an ObjMethodDecl, resulting from invalid code.

Check for invalid decls in ObjCMethodDecl::getNextRedeclaration(); otherwise if we start from an invalid redeclaration
of an @implementation we would move to the @interface and not reach the original declaration again.

Fixes rdar://14024851

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182951 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
42b7861f957591ab40128419dcef0fae081364d6 29-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove unused field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182874 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5a8b0491df5491566ddbf63a99e714a2bd4bb046 29-May-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] There are no key functions in the Microsoft C++ ABI

MSVC's class data is always comdat, so clang's should always be
linkonce_odr in LLVM IR.

Reviewers: pcc

Differential Revision: http://llvm-reviews.chandlerc.com/D838

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182865 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
74caf012521be0651fb4f65db37796b900fcdac6 29-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't compute the visibility unless we really have to.

This brings the number of linkage computations in "clang -cc1" in SemaExpr.ii
from 58426 to 43134. With -emit-llvm the number goes from 161045 to 145461.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182823 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
dc0705645276258afddb06cdf0fd7c8840251ee0 28-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Check the linkage cache at every recursive step.

Before this patch the linkage cache was only used by the entry level function
(getLinkage). The function that does the actual computation (getLVForDecl),
never looked at it.

This means that we would not reuse an entry in the cache when getLVForDecl did
a recursive call. This patch fixes that by adding another computation enum
value for when we don't care about the linkage at all and having getLVForDecl
check the cache in that case.

When running "clang -cc1" over SemaExpr.ii this brings the number of linkage
computations from 93749 to 58426. When running "clang -cc1 -emit-llvm -O3" it
goes from 198708 to 161444.

For SemaExpr.ii at least linkage computation is a small enough percentage of
the work that the time difference was in the noise.

When asserts are enabled this patch also causes clang to check the linkage
cache even on recursive calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182799 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
538bbe597b935a74d95c668ad209536753f13481 28-May-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to issue error when target of MacOS and iOS
does not support large load/store of atomic objects.
// rdar://13973577


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182781 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5bbb0581cb62e019c2b92bdd5362ba93e84e826f 28-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix a crash when we were trying to compute the linkage too early.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e8328540cffa6b5b5f7d07e2e7d2f3503500a383 28-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Propagate VisibleNoLinkage down to class members.

Fixes PR16114.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182750 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
24639c421a36acaa5d0924664c52b9bf2b1c8b91 28-May-2013 Rafael Espindola <rafael.espindola@gmail.com> use getLVForDecl for consistency.

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182749 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bdf2bba1cb8c6347f43a3caa36e801b1d86450d0 27-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix the linkage of local types in inline VisibleNoLinkage functions.

We were handling only local types in inline External functions before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182737 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
88ce12aaf6f0a5a55a458ad152218b4072456ee6 27-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Move 3 helper function to Linkage.h

This removes a duplicate from Decl.cpp and a followup patch will use
isExternallyVisible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182735 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a99ecbcc4c431d52df0b01539035ab5281d54656 25-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix linkage computation for derived types in inline functions.

John noticed that the fix for pr15930 (r181981) didn't handle indirect
uses of local types. For example, a pointer to local struct, or a
function that returns it.

One way to implement this would be to recursively look for local
types. This would look a lot like the linkage computation itself for
types.

To avoid code duplication and utilize the existing linkage cache, this
patch just makes the computation of "type with no linkage but
externally visible because it is from an inline function" part of the
linkage computation itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182711 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9779fdd271bb6a938bdee93f901e4ef7b1a88610 24-May-2013 Michael J. Spencer <bigcheesegs@gmail.com> Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182675 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d3bb9ffb9aa3c78ac9b525f5c8071c5a7c5309d4 24-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix printing CXXTemporaryObjectExpr with default args.

Patch by Will Wilson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182651 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
e565bfa2d67a3b5e02412b4fde5b28873ff7b8d8 23-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix bitcode desynchronization when loading a PCH containing a class template
specialization with modules enabled. Just don't merge them at all for now;
we'll revisit this when support for template merging is added.

In passing, make Decl::dump() a little safer to use with PCH/modules, by making
it not deserialize any additional declarations. From a debugger you can call
decls_begin() or similar first if you want to dump all child decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182544 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
5705f211472f19fc38e58d81365f9261024b3ba3 23-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14772: Support constant expression evaluation for _Atomic types.
* Treat _Atomic(T) as a literal type if T is a literal type.
* Evaluate expressions of this type properly.
* Fix a lurking bug where we built completely bogus ASTs for converting to
_Atomic types in C++ in some cases, caught by the tests for this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182541 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
aa9df09729fb8aee3e645549e95fcb413306a7aa 23-May-2013 Aaron Ballman <aaron@aaronballman.com> Adding in parsing and the start of semantic support for __sptr and __uptr pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes.

For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx

Patch reviewed by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182535 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
5fc764aaff9c0f714931c4d7ba0c5d8ce6790387 22-May-2013 Reid Kleckner <reid@kleckner.net> Remove unused #include <map>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182500 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
f0219cdcc6af557676f23c2c8d1f922caaf6f49a 22-May-2013 Reid Kleckner <reid@kleckner.net> Use StringMap in MicrosoftMangle to resolve FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182488 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
bdaeaed3e3293f1915cdf336f406d4d391331039 22-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16090: C++1y: treat undeduced 'auto' as a literal type, so that constexpr
function templates can use it as a return type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182433 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0a74a4ccc4ecfe1a2792ab72c83815323d8fc914 21-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> In -ast-dump, only dump comments when dumping the actual Decl to which they
attach, rather than merging all comments on the declaration chain. This gives a
more faithful dump, and has the side benefit of unbreaking uses of dump() from
within AST deserialization (where the redeclaration chain may not be sane).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182350 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDumper.cpp
dbed7cceb8b453cc0ef78cc83f5466d5268037ba 21-May-2013 Fariborz Jahanian <fjahanian@apple.com> doc. parsing. HeaderDoc documentaton allows use of
@class command on an @interface declaration. Turn off
the warning for this case. // rdar://13927330


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182334 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
8dbda516d343706bae904f800c6d64e145d58a8c 20-May-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi]: When an class conforms to multiple
protocols that declare the same property of incompatible
types, issue a warning when class implementation synthesizes
the property. // rdar://13075400


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182316 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
fa047c580506041d1120023b10c6a3528c8016c6 18-May-2013 Serge Pavlov <sepavloff@gmail.com> Removed invalid character.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182189 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
b9fdfb50983012b3460e3c27737ec8cdfdb8627d 18-May-2013 Jordan Rose <jordan_rose@apple.com> [analyzer] "Fix" ParentMap to handle non-syntactic OpaqueValueExprs.

Constructs like PseudoObjectExpr, where an expression can appear more than
once in the AST, use OpaqueValueExprs to guard against inadvertent
re-processing of the shared expression during AST traversal. The most
common form of this is to share expressions between the syntactic
"as-written" form of, say, an Objective-C property access 'obj.prop', and
the underlying "semantic" form '[obj prop]'.

However, some constructs can produce OpaqueValueExprs that don't appear in
the syntactic form at all; in these cases the ParentMap wasn't ever traversing
the children of these expressions. This patch fixes that by checking to see
if an OpaqueValueExpr's child has ever been traversed before. There's also a
bit of reset logic when visiting a PseudoObjectExpr to handle the case of
updating the ParentMap, which some external clients depend on.

This still isn't exactly the right fix because we probably want the parent
of the OpaqueValueExpr itself to be its location in the syntactic form if
it's syntactic and the PseudoObjectExpr or BinaryConditionalOperator itself
if it's semantic. Whe I originally wrote the code to do this, I didn't realize
that OpaqueValueExprs themselves are shared in the AST, not just their source
expressions. This patch doesn't change the existing behavior so as not to
break anything inadvertently relying on it; we'll come back to this later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182187 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
bb518991ce4298d8662235fc8cb13813f011c18d 18-May-2013 Jordan Rose <jordan_rose@apple.com> Revert "[analyzer; alternate edges] improve support for edges with PseudoObjectExprs."

Ted and I spent a long time discussing this today and found out that neither
the existing code nor the new code was doing what either of us thought it
was, which is never good. The good news is we found a much simpler way to
fix the motivating test case (an ObjCSubscriptExpr).

This reverts r182083, but pieces of it will come back in subsequent commits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182185 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
ac8b151c4f0478c76a61f2044445b9367fa1a299 18-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Handle local enum types too.

Thanks to John McCall for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182182 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e9aae62e8bca3abfc1dc36f67845444291171e13 17-May-2013 Ted Kremenek <kremenek@apple.com> [analyzer; alternate edges] improve support for edges with PseudoObjectExprs.

This optimizes some spurious edges resulting from PseudoObjectExprs.
This required far more changes than I anticipated. The current
ParentMap does not record any hierarchy information between
a PseudoObjectExpr and its *semantic* expressions that may be
wrapped in OpaqueValueExprs, which are the expressions actually
laid out in the CFG. This means the arrow pruning logic could
not map from an expression to its containing PseudoObjectExprs.

To solve this, this patch adds a variant of ParentMap that
returns the "semantic" parentage of expressions (essentially
as they are viewed by the CFG). This alternate ParentMap is then
used by the arrow reducing logic to identify edges into pseudo
object expressions, and then eliminate them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182083 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
7a9f7c7c68673c46d6e2b83fec6f4cbfbd25f475 17-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> A little ArrayRef'ization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182074 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
c077dbee4c5f63677390e0bd0730271d2bfa18d8 17-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> AST dumping: if a declaration has an uncomputed or uninstantiated exception specification, include that in the dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182070 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
0d8e9646bc000bab521ce52ed294209a92298cef 16-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> First pass of semantic analysis for init-captures: check the initializer, build
a FieldDecl from it, and propagate both into the closure type and the
LambdaExpr.

You can't do much useful with them yet -- you can't use them within the body
of the lambda, because we don't have a representation for "the this of the
lambda, not the this of the enclosing context". We also don't have support or a
representation for a nested capture of an init-capture yet, which was intended
to work despite not being allowed by the current standard wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181985 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
c45c8dd54bc54f9be46546fdf002dc9fe07d1715 16-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Tidy up now that PointerUnion has an operator== that works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181983 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1229e20dfa837998541aa3c6fafcc188981acd2f 16-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix pr15930.

In the case of inline functions, we have to special case local types
when they are used as template arguments to make sure the template
instantiations are still uniqued in case the function itself is inlined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181981 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7247c88d1e41514a41085f83ebf03dd5220e054a 15-May-2013 David Blaikie <dblaikie@gmail.com> Use only explicit bool conversion operator

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

DiagnosticBuilder kept its implicit conversion operator owing to the
prevalent use of it in return statements.

One bug was found in ExprConstant.cpp involving a comparison of two
PointerUnions (PointerUnion did not previously have an operator==, so
instead both operands were converted to bool & then compared). A test
is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix
(adding operator== to PointerUnion in LLVM).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181869 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
ecl.cpp
xpr.cpp
xprConstant.cpp
1069b731a0dc872069c2d6572eefe424b0cceff3 15-May-2013 Richard Trieu <rtrieu@google.com> Add static_cast to assertion to silence sign/unsigned comparison warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181849 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
910f17e331221cd0833d0b5b49013cbbc7ef122a 14-May-2013 Richard Trieu <rtrieu@google.com> When computing the size of large arrays, use char units instead of bits.
This prevents an overflow and assertion when the number of bits cannot be
stored in 64-bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181839 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7e94c907cf6924929e81083e93628d0f520c734 14-May-2013 David Blaikie <dblaikie@gmail.com> Fix clang -Werror build due to -Wreorder violation introduced in r181825

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181834 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
17828ca5857d5d9cadfffd339f888de58182c8f1 14-May-2013 David Blaikie <dblaikie@gmail.com> Provide operator<< for stream output of DeclarationNames

ASTDumper was already trying to do this & instead got an implicit bool
conversion by surprise (thus printing out 0 or 1 instead of the name of
the declaration). To avoid that issue & simplify call sites, simply make
it the normal/expected operator<<(raw_ostream&, ...) overload & simplify
all the existing call sites. (bonus: this function doesn't need to be a
member or friend, it's just using public API in DeclarationName)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181832 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
STDumper.cpp
eclarationName.cpp
d6a08d16a0c8d98e2491f3ee012dbb46b64038f2 14-May-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Mangle in an implicit 'E' for certain types on win64

Most of the complexity of this patch is figuring out which types get the
qualifier and which don't. If we implement __ptr32/64, then we should
check the qualifier instead of assuming all pointers are 64-bit.

This fixes PR13792.

Patch by Warren Hunt!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181825 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
ecordLayoutBuilder.cpp
f039e3eb0ffa87aae0e38cec48f367ee179b4de6 14-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Suppress bogus "use of undefined constexpr function" error if the function body
was erroneous and got discarded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181758 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1071b9f2d38f8177e54f20412a36450462c19186 13-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Suppress GCC warning for no return after covered switch, and remove some
debugging code from an unreachable codepath.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181731 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fbff0c4510c7f0e0f30a005960e434b973f5bd21 13-May-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C error recovery. This patch makes a quick
recovery form duplicate method definition error thus
preventing doc parsing to loop trying to find comment
for the invalid redefinition in a previous declaration.
// rdar://13836387


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181710 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
77b502580d2d3a04ee0a83e9e22eb6b8d8be3ea6 13-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix a gcc warning.

In r181677 I removed this llvm_unreachable and it introduced a gcc
warning. Add it back.

Thanks to Patrik Hägglund for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181704 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6af701f29be43e49a25ab098c79940ae4cbb69c7 13-May-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate with qualified names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181683 91177308-0d34-0410-b5e6-96231b3b80d8
eclOpenMP.cpp
eclPrinter.cpp
181e3ecc0907ae0103586a9f4db52241995a8267 13-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Cleanup handling of UniqueExternalLinkage.

This patch renames getLinkage to getLinkageInternal. Only code that
needs to handle UniqueExternalLinkage specially should call this.

Linkage, as defined in the c++ standard, is provided by
getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.

Most places in the compiler actually want isExternallyVisible, which
handles UniqueExternalLinkage as internal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181677 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ecordLayoutBuilder.cpp
ype.cpp
d248e586d60a3fe971369089e763d5e8f669b7a9 13-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix stack overflow in linkage computation when a function with a deduced return
type returns a lambda defined within itself. The computation of linkage for the
function looked at the linkage of the lambda, and vice versa.

This is solved by not checking whether an 'auto' in a function return type
deduces to a type with unique external linkage. We don't need this check,
because the type deduced for 'auto' doesn't affect whether two
otherwise-identical declarations would name different functions, so we don't
need to give an ostensibly external-linkage function internal linkage for this
reason. (We also don't need unique-external linkage in C++11 onwards at all,
but that's not implemented yet.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181675 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
284b3cbfd1cd5b6585437fbb8b95fe136f273efb 12-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support for 'switch' statements in constexpr functions. This is somewhat
inefficient; we perform a linear scan of switch labels to find the one matching
the condition, and then walk the body looking for that label. Both parts should
be straightforward to optimize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181671 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9dadfab2faebe40e7dbbfd0801c15174b69bd726 11-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y deduced return types: when we deduce a return type for a function which
we loaded from PCH, if we're building another PCH, create an update record to
patch the return type of the earlier declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181659 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2ad77cdd028b3c96f21d7bc6daee8fde6cf0cd86 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Allocate memory for the new number of subexpressions. Fixup for r181572


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181611 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
15f92bad58c8650b1306729744b1a1230197497a 10-May-2013 Hans Wennborg <hans@hanshq.net> Add support for __wchar_t in -fms-extensions mode.

MSVC provides __wchar_t. This is the same as the built-in wchar_t type
from C++, but it is also available with -fno-wchar and in C.

The commit changes ASTContext to have two different types for this:

- WCharTy is the built-in type used for wchar_t in C++ and __wchar_t.

- WideCharTy is the type of a wide character literal. In C++ this is
the same as WCharTy, and in C it is an integer type compatible with
the type in <stddef.h>.

This fixes PR15815.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181587 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
27365ee830cec7cf52c088b400867ff67b0b3b23 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize ShuffleVectorExpr::setExprs

But ShuffleVectorExpr should be tail-allocating the storage for expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181572 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f1e08ac58e72257f0e50e9bda1f1f232ed823ce2 10-May-2013 David Blaikie <dblaikie@gmail.com> Debug Info: include address-of ('&') operator and qualified names in template argument lists

This fixes several (7 out of 16) cases of PR14492 in the GDB 7.5 test
suite. It seems GDB was bailing out whenever it had even the slightest
problem with the template argument list (& I assume it didn't like
seeing template value parameters that were just simple names - perhaps
assuming that lone names must be types, not values)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181556 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
524387ae3dfc0c4cf2b095f83f9e47aa549b7e55 09-May-2013 Ben Langmuir <ben.langmuir@intel.com> CodeGen for CapturedStmts

EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function. This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function. It is based
on GenerateBlockFunction, but is much simpler. The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

Differential Revision: http://llvm-reviews.chandlerc.com/D640


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181536 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
icrosoftMangle.cpp
f4030ae4638d1831a2a031f1e33b86de8c5fef28 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: make single character command impostures
warn in pedantic mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181523 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
ommentLexer.cpp
5cd4c41422b8d65a08e0ec007743d7a0ae72ec27 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: So, in this patch, single character
'commands' will not go through typo fixit logic,
preserving the old behavior (no typo, no diagnostics).
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181521 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
ommentLexer.cpp
9d6b1cb173998c82783c1751b8ce88d3d7243dc3 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181517 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
6391ea2897b595178a8a97e5080f59a6f55ce442 09-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y constant initializer rules: in a constant initializer for an
object x, x's subobjects can be constructed by constexpr constructor even if
they are of non-literal type, and can be read and written even though they're
not members of a constexpr object or temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181506 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d7ceab3f311418fd77c2899e8fba254402fd0b5a 09-May-2013 Nico Weber <nicolasweber@gmx.de> Objective-C: Correctly encode 'retain' and 'copy' for readonly properties.

clang would omit 'C' for 'copy' properties and '&' for 'retain' properties if
the property was also 'readonly'. Fix this, which makes clang match gcc4.2's
behavior.

Fixes PR15928.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181491 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ad91e5431f2f2d0a32ccdff8c55e7fa921af42bd 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: Also do typo correction for
dynamically registered commands.
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181477 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
abbfa671539c74b5bec66a64964de984c908cdfa 08-May-2013 Fariborz Jahanian <fjahanian@apple.com> Turn off a warning caused by my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181464 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
0089bc4ddee6bb309ad25f4c7ad4b7ffe5df4512 08-May-2013 Fariborz Jahanian <fjahanian@apple.com> documentation parsing. Patch to do typo correction for
documentation commands. Patch was reviewed, along with
great suggestions for improvement, by Doug.
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181458 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
ommentLexer.cpp
2fca8027fdfa09e99d1066f4694ca437b43ab6d4 08-May-2013 Timur Iskhodzhanov <timurrrr@google.com> Fix one FIXME in VTableBuilder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181396 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
e7565635002ce0daaaf4b714cdb472507af462ee 08-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181388 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a49a7fe2a7c1881402be25ca9124d3883637198f 08-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y constant expression evaluation: compound assignment support for floating-point and pointer types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181376 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
28b34d86baca3282704de364b98a123baf426799 07-May-2013 Richard Trieu <rtrieu@google.com> Fix crash on invalid in template type diffing.

This is a fix for PR15895, where Clang will crash when trying to print a
template diff and the template uses an address of operator. This resulted
from expecting a DeclRefExpr when the Expr could have also been
UnaryOperator->DeclRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181365 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
d20afcbe94f0daed15d040d98d2aa8ef8ed368e4 07-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y constant expression evaluation: support for compound assignments on integers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181287 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a8942d7686dde6d221a176c502ce857bdc409dab 07-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: an assignment operator is implicitly 'constexpr' if it would only call 'constexpr' assignment operators for a literal class type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181284 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b491e684395ee19123abdd73b75776fea966d8cf 03-May-2013 Stephen Hines <srhines@google.com> Update Clang for merge to r180944.

Change-Id: Ic42c9b2576c8da6a73092734c392ef5b3cf949c1
ndroid.mk
993f43f24d7a45a5cd4678a3316b0852261fc5d4 06-May-2013 John McCall <rjmccall@apple.com> Grab-bag of bit-field fixes:

- References to ObjC bit-field ivars are bit-field lvalues;
fixes rdar://13794269, which got me started down this.
- Introduce Expr::refersToBitField, switch a couple users to
it where semantically important, and comment the difference
between this and the existing API.
- Discourage Expr::getBitField by making it a bit longer and
less general-sounding.
- Lock down on const_casts of bit-field gl-values until we
hear back from the committee as to whether they're allowed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181252 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
b8409215523e5478b8b0aa9cdcd10038cf7651fe 06-May-2013 Ulrich Weigand <ulrich.weigand@de.ibm.com> Add SystemZ support

This patch then adds all the usual platform-specific pieces for SystemZ:
driver support, basic target info, register names and constraints,
ABI info and vararg support. It also adds new tests to verify pre-defined
macros and inline asm, and updates a test for the minimum alignment change.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall. Thanks to all reviewers!

Patch by Richard Sandiford.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181211 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6b20351a1d6178addfaa86716aaba36f2e9ea188 06-May-2013 Ulrich Weigand <ulrich.weigand@de.ibm.com> Allow targets to define minimum alignment for global variables

This patch adds a new common code feature that allows platform code to
request minimum alignment of global symbols. The background for this is
that on SystemZ, the most efficient way to load addresses of global symbol
is the LOAD ADDRESS RELATIVE LONG (LARL) instruction. This instruction
provides PC-relative addressing, but only to *even* addresses. For this
reason, existing compilers will guarantee that global symbols are always
aligned to at least 2. [ Since symbols would otherwise already use a
default alignment based on their type, this will usually only affect global
objects of character type or character arrays. ] GCC also allows creating
symbols without that extra alignment by using explicit "aligned" attributes
(which then need to be used on both definition and each use of the symbol).

To enable support for this with Clang, this patch adds a
TargetInfo::MinGlobalAlign variable that provides a global minimum for the
alignment of every global object (unless overridden via explicit alignment
attribute), and adds code to respect this setting. Within this patch, no
platform actually sets the value to anything but the default 1, resulting
in no change in behaviour on any existing target.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall. Thanks to all reviewers!

Patch by Richard Sandiford.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181210 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
dbce2c6771d3d1e8ca42989122a5edf8fb5a93d7 06-May-2013 Hans Wennborg <hans@hanshq.net> Add llvm_unreachable at end of fully covered switch

To pacify GCC warning about control reaching end of non-void function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181197 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
10f6f065456a2cfb6c2ab5dfedefb930e5e52e9d 06-May-2013 John McCall <rjmccall@apple.com> Require the containing type to be complete when we see
__alignof__ of a field.

This problem can only happen in C++11.

Also do some petty optimizations.

rdar://13784901

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181185 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
692eafd2052fb6ca581530d6f3569eea9520a508 06-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support range-based for loops in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181184 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ce61715606b5f55ccc023720cdf9c1a796b0d526 06-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support 'for', 'while', and 'do ... while' in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181181 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5528ac9f40ec6cb54e7096908bf2beeed511bce4 06-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support for increment and decrement in constant expression evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181173 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b476a14e9b35ef2448b42b033e1f0cceaa3f2778 05-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Factor out duplication between lvalue-to-rvalue conversions and variable
assignments in constant expressions. No significant functionality changes
(slight improvement to potential constant expression checking).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181170 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d8ffd0b7b61566f15a67192883a607f7703bcece 05-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Make all 'is in extern "C"' tests use the lexical context.

I was not able to find a case (other than the fix in r181163) where this
makes a difference, but it is a more obviously correct API to have.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181165 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
5543169296beeb183b9c9392debc774fcf493eeb 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentParser.cpp
ecl.cpp
eclObjC.cpp
xprCXX.cpp
f9734241b141ad9c19969bab9b56dd4246e35e7d 04-May-2013 Aaron Ballman <aaron@aaronballman.com> Reverting r181004 since it has broken test/Sema/wchar.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181122 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
dc17384581e37436582a007be4d9185bcf7003ec 04-May-2013 Enea Zaffanella <zaffanella@cs.unipr.it> In VarDecl nodes, store the thread storage class specifier as written.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181113 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
60e141e1f87211ca831de6821003d80fe20a06f3 04-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement most of N3638 (return type deduction for normal functions).
Missing (somewhat ironically) is support for the new deduction rules
in lambda functions, plus PCH support for return type patching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181108 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9fd6b8f5a73788f288edd01fa99d434d1e6588ad 04-May-2013 Wei Pan <wei.pan@intel.com> Implement template support for CapturedStmt

- Sema tests added and CodeGen tests are pending

Differential Revision: http://llvm-reviews.chandlerc.com/D728



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181101 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
cd904e8864637e427f5ea3bf35a26e79b3dbbadf 04-May-2013 Sean Callanan <scallanan@apple.com> Added a function to check whether a Decl is in
the list of Decls for a given DeclContext. This
is useful for LLDB's implementation of
FindExternalLexicalDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181093 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
efa78d163214fd9e909ab2bf6911edfbc7a2b9df 04-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: Make warning about unknown command
tags off by default for now. Move diagnostic code
to DiagnosticCommentKinds.td. // rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181081 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
ad6fd9f93ce0d328397e8d57ef7117ced24fc8e2 04-May-2013 Fariborz Jahanian <fjahanian@apple.com> [Doc parsing] Provide diagnostics for unknown documentation
commands. // rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181071 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
awCommentList.cpp
2f729009067e6aff6198719ec9f8220d88cfea09 04-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename ObjCImplementationDecl::getSuperLoc() -> getSuperClassLoc() for consistency with ObjCInterfaceDecl::getSuperClassLoc()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181064 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
83eba02c2ea333015335e2f74c4d11c5315b655d 03-May-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-20130502
dc5be4f54d6415cb88b2f8a7c5bc9011e332b9b8 03-May-2013 Ben Langmuir <ben.langmuir@intel.com> Serialization for captured statements

Add serialization for captured statements and captured decls. Also add
a const_capture_iterator to CapturedStmt.

Test contributed by Wei Pan

Differential Revision: http://llvm-reviews.chandlerc.com/D727


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181048 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmt.cpp
8c045ace381972f41d385b0a661ccf172834f459 03-May-2013 Ben Langmuir <ben.langmuir@intel.com> Move CapturedStmt parameters to CapturedDecl

Move the creation of CapturedStmt parameters out of CodeGen and into
Sema, making it easier to customize the outlined function. The
ImplicitParamDecls are stored in the CapturedDecl using an
ASTContext-allocated array.

Differential Revision: http://llvm-reviews.chandlerc.com/D722


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181043 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
634c5634817b9ad384a706fe87ab302985566bba 03-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Keep track of an @implementation's super class name location, if one was provided.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181039 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
000817b3b2ab95c5b9cbb76950cd01b79fe93f55 03-May-2013 John McCall <rjmccall@apple.com> Micro-optimization: check the overloaded operator kind before
checking for a lambda.

Thanks to Jordan for the pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181031 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6f464bb8d316b95bf60efcdb2d21803659d3aa1b 03-May-2013 Hans Wennborg <hans@hanshq.net> Support __wchar_t in -fms-extensions and -fms-compatibility modes.

MSVC provides __wchar_t, either as an alias for the built-in wchar_t
type, or as a separate type depending on language (C vs C++) and flags
(-fno-wchar).

In -fms-extensions, Clang will simply accept __wchar_t as an alias for
whatever type is used for wide character literals. In -fms-compatibility, we
try to mimic MSVC's behavior by always making __wchar_t a builtin type.

This fixes PR15815.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f5ebf9bf1df10ac15ba32a4b24dfe171b7848c58 03-May-2013 John McCall <rjmccall@apple.com> Correctly emit certain implicit references to 'self' even within
a lambda.

Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation
functions. Fix that by generally improving getNonClosureContext
to look through lambdas and captured statements but only report
code contexts, which is generally what's wanted. Audit uses of
CurFuncDecl and getNonClosureAncestor for correctness.

Bug #2 is that lambdas weren't specially mapping 'self' when inside
an ObjC method. Fix that by removing the requirement for that
and using the normal EmitDeclRefLValue path in LoadObjCSelf.

rdar://13800041

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181000 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
aeeacf725c9e0ddd64ea9764bd008e5b6873ce51 03-May-2013 John McCall <rjmccall@apple.com> Move parsing of identifiers in MS-style inline assembly into
the actual parser and support arbitrary id-expressions.

We're actually basically set up to do arbitrary expressions here
if we wanted to.

Assembly operands permit things like A::x to be written regardless
of language mode, which forces us to embellish the evaluation
context logic somewhat. The logic here under template instantiation
is incorrect; we need to preserve the fact that an expression was
unevaluated. Of course, template instantiation in general is fishy
here because we have no way of delaying semantic analysis in the
MC parser. It's all just fishy.

I've also fixed the serialization of MS asm statements.

This commit depends on an LLVM commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180976 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
4857fdcdcb61f314a53ea45be3cbfaf60bb9255b 02-May-2013 Fariborz Jahanian <fjahanian@apple.com> [document parsing]: support c++11 type aliases
with no comment of their own to inherit the
comment of their aliased type. // rdar://13752382


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180924 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a3ae52b63aff9d4478084e40b1f683f45eb06ab7 01-May-2013 Fariborz Jahanian <fjahanian@apple.com> [documenting declaration]: Remove arc liftime qualifiers
when doccumenting declrations in comments.
// rdar://13757500


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180880 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
28fff5394fc9521ec0ee1d4f7ef4cca5e4f78071 01-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix spurious trailing comma when printing some of the __c11_atomic_* builtins. Patch by Joe Sprowes!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180867 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
a07a6c3e756d0a6a5baa2cad9d165f79f0fb1b42 01-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15884: In the 'taking the address of a temporary' extension, materialize the
temporary to an lvalue before taking its address. This removes a weird special
case from the AST representation, and allows the constant expression evaluator
to deal with it without (broken) hacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180866 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
db1519a95687622d08340f9b7522ef84a53b331a 01-May-2013 Fariborz Jahanian <fjahanian@apple.com> [ObjC declaration documentation] declaration of
types involving Objective-C pointers must have
their arc qualifiers elided as they don't
add any additional info. // rdar://13757500.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180860 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
dc7a4f5d7a7e3b60d4dc4a80338d7a2728540998 30-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180789 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
91efca0fa2ef5e63b48692e3439f5c6e6bde350c 27-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> documenttion parsing. Provide a c-index test
and limit comment extraction to public c++
bases. // rdar://13647476


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180646 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fff418b1abea921685a1175a8ee0b597594bddc1 27-Apr-2013 Sean Callanan <scallanan@apple.com> In the ASTImporter, when checking whether two
structs are compatible, check whether the fields
of the structs have the same name. This prevents
erroneous coalescing of (in particular) anonymous
structs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180644 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
888d34566a4de6097896863a2f6660ed1537ddb9 27-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Move helper classes into anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180642 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
622bb4acc00fd63bac545ca23f7c42fd909dc0e7 26-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> document parsing. When a sub-class (c++ Objective-C) missing
a comment, grab the first comment found in its class
heirarchy. Also, when a category is mossing a comment,
grab comment of its primary class. // rdar://13647476


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180629 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
002f9281e010202b87cc120195b67df06ef3e17f 26-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: -fparse-all-comments: recognize empty line comments

In -fparse-all-comments mode empty '//' comments were recognized as
RCK_Invalid, and were not merged with next and previous lines.

Patch by Amin Shali.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180625 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
a2c3646c35dd09d21b74826240aa916545b1873f 26-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y decltype(auto).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
ypePrinter.cpp
bebf5b1bcfbf591dd3cd80c4aebd6486bb34f41c 26-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support simple variable assignments in constexpr functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180603 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e5e575ded9cd4b80229fb299a2d97e9d44728eda 26-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add r180263 back, but fix hasBraces() to be correct during parsing.

Original commit message:

Fix a case in linkage computation that should check for single line extern "C".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180591 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
d247842acdbded335f03f91ba0153bc36e65eb39 26-Apr-2013 Bill Wendling <isanbard@gmail.com> Revert r180263. It's causing failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180583 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f3f0f357f8d6b4511b6d605cc8a39ae3787fef6d 25-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: This is a small modification to my
patch -n r180198.
When reporting on missing property accessor implementation in
categories, do not report when they are declared in primary class,
class's protocol, or one of it super classes or in of the other
categories. // rdar://13713098


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180580 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f49d9c9b858973eb10717f4b3936a4a4384bd355 25-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix a case in linkage computation that should check for single line extern "C".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180263 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
65dfa2b31794ff4013cb3f9a8178305b56a3d549 25-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't mark 'extern "C" void f(void)' as having extern storage class.

Instead, we check for one line extern "C" context in linkage computation and
when deciding if a variable is a definition.

This hopefully completes the transition to having "as written" semantics for
hasExternalStorage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180258 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b70d1c32ca62d072b3f4a5d4628fdcf692cbf2f0 25-Apr-2013 Peter Collingbourne <peter@pcc.me.uk> [ms-cxxabi] Fix a number of bugs in the mangler.

This includes the following fixes:
- Implement 4 subtly different variants of qualifier mangling and use them
in what I believe are the right places.
- Fix handling of array types. Previously we were always decaying them,
which is wrong if the type appears as a template argument, pointee,
referent etc.
Fixes PR13182.

Differential Revision: http://llvm-reviews.chandlerc.com/D709

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180250 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c775b1a0702621e297d00452a897381c8bf10f3f 24-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: When reporting on missing property accessor implementation in
categories, do not report when they are declared in primary class,
class's protocol, or one of it super classes. This is because,
its class is going to implement them. // rdar://13713098


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180198 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a10b97898ee6339c3110e6ca33f178ff52f05238 22-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y constexpr extensions, round 1: Allow most forms of declaration and
statement in constexpr functions. Everything which doesn't require variable
mutation is also allowed as an extension in C++11. 'void' becomes a literal
type to support constexpr functions which return 'void'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180022 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
99ad35921aa6c1b200b6432c066961f930fce1e1 22-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix array constant expression evaluation bug: we can have different values for
different array elements, even if they're all constructed using the same
default constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180017 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c3bf52ced9652f555aa0767bb822ec4c64546212 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Allow aggregates to have default initializers.

Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in
CXXCtorInitializers and in InitListExprs to represent a default initializer.

There's an additional complication here: because the default initializer can
refer to the initialized object via its 'this' pointer, we need to make sure
that 'this' points to the right thing within the evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
b80a16eadd0dacabfc1c32412e243ccb99dd664d 19-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement CodeGen for C++11 thread_local, following the Itanium ABI specification as discussed on cxx-abi-dev.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179858 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
3a5891277e6c545e72551935526fce7337446e88 18-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: simplify code. As a side effect, this also silences GCC's
-Wunitnitialized warning.

Patch by Rui Ueyama.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179794 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
099ecfb0ed137665a3394187030d8fd7183fd9d4 17-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> [document parsing]: When tag declaration (but not definition!)
is part of the decl-specifier-seq of some other declaration,
it doesn't get comment. // rdar://12390371


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179722 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
673c5d5e22b0af17bb9e903862f39e8a23d9e47f 17-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Correct the range returned by ParmVarDecl::getSourceRange(), for parameters in ObjC methods with postfix types.

For a parameter in a method like this:

-(int)methodWithFn:(void (*)(int *p))fn;

we would return the source range of the type and not include the parameter name.

Fixes rdar://13668626.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179660 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e7a77727804c12750cb39e8732e26f2a26e4ce0f 17-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use the extra info in global method pool to speed up looking for ObjC overridden methods.

When we are in a implementation, we check the global method pool whether there were category
methods with the same selector. If there were none (common case) we don't need to do lookups for
overridden methods again.

Note that for an interface method (if we don't encounter its implementation), it is considered that
it overrides methods that were declared before it, not for category methods introduced after it.

This is tradeoff in favor of performance, since it is expensive to do lookups in case there was a
category, and moving the global method pool to ASTContext (so we can check it) would increase complexity.

rdar://13508196

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179654 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
685d10462b875f8c056d27488c0a1b4e13ef680f 17-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> In ASTContext::getOverriddenMethods, call overridden_methods_begin/overridden_methods_end directly.

This avoids unnecessary Decl::getASTContext() invocations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179653 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6afcf8875d4e447645cd7bf3733dd8e2eb8455dc 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Sema for Captured Statements

Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic
analysis. Currently captures all variables by reference.

TODO: templates

Author: Ben Langmuir <ben.langmuir@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D433


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179618 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
tmt.cpp
tmtPrinter.cpp
051303ce09291dfbed537fa33b0d8a4d92c82b75 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Implement CapturedStmt AST

CapturedStmt can be used to implement generic function outlining as described in
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

CapturedStmt is not exposed to the C api.

Serialization and template support are pending.

Author: Wei Pan <wei.pan@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179615 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
76da55d3a49e1805f51b1ced7c5da5bcd7f759d8 16-Apr-2013 John McCall <rjmccall@apple.com> Basic support for Microsoft property declarations and
references thereto.

Patch by Tong Shen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
77670f17ae3a5c3188149c19a7e386c01d0aa7c0 15-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert "Speed-up ObjCMethodDecl::getOverriddenMethods()."

This reverts commit r179436.

Due to caching, it was possible that we could miss overridden methods that
were introduced by categories later on.

Along with reverting the commit I also included a test case that would have caught this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179547 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
90cc390c4955029dd56d125af5512e68efa0c2b2 15-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove hasExternalLinkageUncached.

It was being used correctly, but it is a very dangerous API to have around.
Instead, move the logic from the filtering to when we are deciding if we should
link two decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179523 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
72fdc8947e54be1a8dd36b03e24f112aba1241e1 15-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix the storage class of method instantiations.

We keep the "as written" storage class, but that is a fuzzy concept for
instantiations. With this patch instantiations of methods of class templates
now get a storage class that is based on the semantics of isStatic(). With this
can simplify isStatic() itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179521 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
38afbc7361d861968232defaeaf8e302af75b5ee 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
eclPrinter.cpp
xprConstant.cpp
175c8e2e57befe2db15dd339ab5eb27d0c2b6013 13-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Speed-up ObjCMethodDecl::getOverriddenMethods().

Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its
results instead of re-calculating the categories multiple times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179436 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
a3609b0c7685346308ed2c8022f94949bbfe7cdf 11-Apr-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Implement member pointer emission and dereferencing

Summary:
Handles all inheritance models for both data and function member
pointers.

Also implements isZeroInitializable() and refactors some of the null
member pointer code.

MSVC supports converting member pointers through virtual bases, which
clang does not (yet?) support. Implementing that extension is covered
by http://llvm.org/15713

Reviewers: rjmccall

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179305 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
1fd1e288d0f45b86d191d8f53f569e5143f3a18a 11-Apr-2013 Jordan Rose <jordan_rose@apple.com> Force a load when creating a reference to a temporary copied from a bitfield.

For this source:
const int &ref = someStruct.bitfield;

We used to generate this AST:

DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'const int' lvalue <NoOp>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Notice the lvalue inside the MaterializeTemporaryExpr, which is very
confusing (and caused an assertion to fire in the analyzer - PR15694).

We now generate this:

DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'int' <LValueToRValue>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Which makes a lot more sense. This allows us to remove code in both
CodeGen and AST that hacked around this special case.

The commit also makes Clang accept this (legal) C++11 code:

int &&ref = std::move(someStruct).bitfield

PR15694 / <rdar://problem/13600396>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179250 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6fd7d3067dd06584ef3940e88e31fea1a0e83588 10-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Add an option to parse all comments as documentation comments

Patch by Amin Shali.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179180 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
awCommentList.cpp
0baaabb7174c8e512ea52bc36687dc31ff68b09f 10-Apr-2013 John McCall <rjmccall@apple.com> Don't crash when mangling types defined in ObjC class extensions.

The original test case here was mangling a type name for TBAA,
but we can provoke this in C++11 easily enough.

rdar://13434937

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179153 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
cb5949d1cd6ed8f5e830dd1849a2b786e32e1818 09-Apr-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Add "$$C" when mangling template arg QualTypes

Credit goes to Timur Iskhodzhanov for finding the problem and solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179093 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
109f5fc8dff6f3bd707e0e4140dc99ef7d4f3e88 08-Apr-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/12806802> Propagate access specifiers for conversion functions to the conversion function set eagerly.

This slightly propagates an existing hack that delays when we provide
access specifiers for the visible conversion functions of a class by
copying the available access specifier early. The only client this
affects is LLDB, which tends to discover and add conversion functions
after the class is technically "complete". As such, the only
observable difference is in LLDB, so the testing will go there.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179029 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a83297bd83ba7184935dddde04787f88dd52e182 04-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Make helpers static & 80 cols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178767 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
c855ce7ab97aa25c609a5f83e19b27289fede21a 04-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add hasExternalLinkageUncached back with the test that Richard provided, but
keep the call at the current location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178741 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6a7664c4a8b378da5a7f58d940d39b76fb0d6673 04-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Avoid computing the linkage instead of avoiding caching it.

This mostly reverts 178733, but keeps the tests.

I don't claim to understand how hidden sub modules work or when we need to see
them (is that documented?), but this has the same semantics and avoids adding
hasExternalLinkageUncached which has the same foot gun potential as the old
hasExternalLinkage.

Last but not least, not computing linkage when it is not needed is more
efficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178739 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d613ac9c57936d219d9eecba1d061a45ff7a3ae8 04-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix 41 of the 61 tests which fail with modules enabled: we were computing and
caching the linkage for a declaration before we set up its redeclaration chain,
when determining whether a declaration could be a redeclaration of something
from an unimported submodule. We actually want to look at the declaration as if
it were not a redeclaration here, so compute the linkage but don't cache it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178733 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d2615cc53b916e8aae45783ca7113b93de515ce3 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 178663 back.

http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green
before it processed the reverted 178663, so it could not have been the culprit.

Revert "Revert 178663."

This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert 178663.

Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb

Revert "Don't compute a patched/semantic storage class."

This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
8f187f62cb0487d31bc4afdfcd47e11fe9a51d05 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't compute a patched/semantic storage class.

For variables and functions clang used to store two storage classes. The one
"as written" in the code and a patched one, which, for example, propagates
static to the following decls.

This apparently is from the days clang lacked linkage computation. It is now
redundant and this patch removes it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
d3ec874e840c7cfcb4447102bb0deb38bac94649 03-Apr-2013 Richard Trieu <rtrieu@google.com> Refactor the Get* functions to be more consistant among themselves.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178613 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
709caea14f3a31265d6a791d8e3897ca7b65c1cb 03-Apr-2013 Richard Trieu <rtrieu@google.com> Do not assume the template argument is an integer only because the
expressions are integer. It can also be ValueDecl expressions

Use the type information from the TemplateParameterList instead

Patch by Olivier Goffart!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178611 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
fa3d2758653113cd2b5fff06f8ff22eeb669c044 03-Apr-2013 Richard Trieu <rtrieu@google.com> Fix a crasher in Template Diffing.

When support was added for declaration arguments, the case of variadic
declaration arguments was not supported. This patch fixes that problem by
not crashing when certain ValueDecl's are null.

Patch by Olivier Goffart!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178610 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
625785d370f6c0d8262090b8a2abe3799f72d58d 03-Apr-2013 Richard Trieu <rtrieu@google.com> Fix a crasher in Template Diffing.

Value depenedent expressions for default arguments cannot be evaluated.
Instead, use the desugared template type to get an argument expression that
can be used. This is needed for both integer and declaration arguements.

Also, move this common code into a separate function.

Patch by Olivier Goffart!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178609 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
cb428a1ac09dddf5ed3bf2a740f9ea31e9e11037 02-Apr-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Rename enum and remove dead case per Jordan's suggestion

The IHM_ prefix was a fairly gross abbreviation to try to hit three
characters for uniqueness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178551 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
4ba49295274236084323fb68214bfb6aa7adc9eb 02-Apr-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Remove unused variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178550 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
4410489163931892b568f0a43bd49c430a3aa3f5 02-Apr-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Move MS inheritance model calculation into MemberPointerType

Summary:
This makes it possible to share code between lib/AST/MicrosoftCXXABI.cpp
and lib/CodeGen/MicrosoftCXXABI.cpp. No functionality change.

Also adds comments about the layout of the member pointer structs as I
currently understand them.

Reviewers: rjmccall

CC: timurrrr, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D590

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178548 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
f396ad9b1fa0c74c9db16a8158c3882c9db774e2 01-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't eagerly deserialize every templated function (and every static data
member inside a class template) when loading a PCH file or module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178496 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
04593d0f9d84f6adf942bd66f1587e05c6a47c42 29-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> When looking for overridden ObjC methods, don't ignore 'hidden' ones.

When using modules we should not ignore overridden methods from
categories that are hidden because the module is not visible.
This will give more consistent results (when imports change) and it's more
correct since the methods are indeed overridden even if they are not "visible"
for lookup purposes.

rdar://13350796

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178374 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
84e9ab44af3a16f66d62590505db2036ef0aa03b 28-Mar-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Correctly compute the size of member pointers

Summary:
This also relaxes the requirement on Windows that the member pointer
class type be a complete type (http://llvm.org/PR12070). We still ask
for a complete type to instantiate any templates (MSVC does this), but
if that fails we continue as normal, relying on any inheritance
attributes on the declaration.

Reviewers: rjmccall

CC: triton, timurrrr, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D568

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178283 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
9ef9875bbe19dc9f73c6c95b803d9a4945168690 27-Mar-2013 Joao Matos <ripzonetriton@gmail.com> Implement compiler intrinsics needed for compatibility with MSVC 2012 <type_traits>.

Patch by me and Ryan Molden.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178111 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
852e3d7143cda1cdf6771c17559d38822cc296b3 26-Mar-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Give the MS inheritance attributes a base class

Required making a handful of changes to the table generator. Also adds
an unspecified inheritance attribute. This opens the path for us to
apply these attributes to C++ records implicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178054 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
1232e279b4a0d98885b9672d3bb5905488360e49 26-Mar-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Mangle vector types

Summary:
The only vector types a user can pass from MSVC code to clang code are
the ones from *mmintrin.h, so we only have to match the MSVC mangling
for these types. MSVC mangles the __m128 family of types as tag types,
which we match. For other vector types, we emit a unique tag type
mangling that won't match anything produced by MSVC.

Reviewers: rjmccall

CC: chandlerc, timurrrr, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D576

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178036 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
060fe33d41ea975db519c96def5c2d2b1da7a78f 23-Mar-2013 Richard Trieu <rtrieu@google.com> Strip off local qualifiers when converting from RecordType to
TemplateSpecializationType during template type diffing. This allows the
correct printing of diffing qualifiers on templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177809 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
c640058aa7f224a71ce3b1d2601d84e1b57f82d3 22-Mar-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate directive parsing and semantic analysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclBase.cpp
eclOpenMP.cpp
eclPrinter.cpp
5bdaef55d486f20346fe16f3d41324694d3ff0d5 21-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Tighten the rules when warning
is issused for on overriding 'readwrite'
property which is not auto-synthesized.
Buttom line is that if hueristics determine
that there will be a user implemented setter,
no warning will be issued. // rdar://13388503


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177662 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b9da713efb4277753211590953f433723908aade 21-Mar-2013 John McCall <rjmccall@apple.com> Further weaken block conversion rules to permit blocks with
enum return type to be converted to blocks with any integer type
of the same size.

rdar://13463504

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177613 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ff430f6af32468d3b09b66266aef03818230c35f 20-Mar-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Mangle function pointer template arguments correctly

Reviewers: rjmccall

CC: timurrrr, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D554

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177589 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
f16216c7bb6ec4fd4a1ee4ed801fe7c01267be71 20-Mar-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Fix assertion on unhandled function template arg types

This code was changed in r158376 to get template argument source info
for better diagnostics, but the current code asserts for any kind of
unsupported template argument before it can issue a diagnostic. This change
goes back to the Itanium implementation of isTemplate() and puts the argument
index into the diagnostic instead of a source location.

Review URL: http://llvm-reviews.chandlerc.com/D553

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177471 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
15d68882f5fa4afae8333e75b2bfd5e2834c8aaf 19-Mar-2013 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2013_03_18

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: I05e70941163ec5a461eba43ef78f6738cd5a1e69
2aa5cf412c9a56aba1e3a7b04ca18499a2b83b20 19-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> documentation comment parsing. Added couple of
top-level HeaderDoc tags @functiongroup and
@methodgroup to doc. tags recognized.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177358 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
70e82dc7a254054f0de491493489da162e63c364 16-Mar-2013 Richard Trieu <rtrieu@google.com> Improve template diffing handling of default integer values.

When the template argument is both default and value dependent, the expression
retrieved for the default argument cannot be evaluated, thus never matching
any argument value. To get the proper value, get the template argument
from the desugared template specialization. Also, output the original
expression to provide more information about the argument mismatch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177209 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
454d5b3ab316331b621b37d7c8b86db9f7d33fcc 15-Mar-2013 David Blaikie <dblaikie@gmail.com> Remove unnecessary default in covered switch over enum

This cleans up the Clang -Werror build that was broken by r177180.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177184 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
e738fc5145984235a8f084077791271c4d266236 15-Mar-2013 Daniel Dunbar <daniel@zuster.org> [AST] Add a fast path to ConstantArrayType::getNumAddressingBits().

- This fast path is almost 100% effective on real code, and lets us avoid
multiple allocations of 128-bit APSInt objects in the common case.

- As with any overflow-check-skipping-code, I'd appreciate someone double
checking my logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177183 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
8e694d21342d020551be688f63d7f77b83b27dd7 15-Mar-2013 Richard Trieu <rtrieu@google.com> Refactor template diffing to store an enum that records which type of
difference is stored inside a DiffNode. This should not change any
diagnostic messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177180 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
c90cc9374f18396251760b9fe6468fd1232e9f0e 15-Mar-2013 Bob Wilson <bob.wilson@apple.com> Revert "Remove a pointless assertion."

This reverts commit r177158.

I'm blindly reverting this because it appears to be breaking numerous
buildbots. I'll reapply if it doesn't turn out to be the culprit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177165 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7e0786f08e5e14776c8a46a0534c254b3fdc14fe 15-Mar-2013 Nico Weber <nicolasweber@gmx.de> Remove a pointless assertion.

FindNodeOrInsertPos() is called 10 lines earlier already, and the function
early-returns there if the result is != 0. InsertPos isn't recomputed after
that check, so this assert is always trivially true. (And it has nothing to
do with if T is canonical or not.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177158 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7f99d5c54135ae812a7cb7c86f135086d3d65031 14-Mar-2013 Douglas Gregor <dgregor@apple.com> [PR15513/<rdar://problem/13409707>] Template arguments in diagnostics aren't always known at compile time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177110 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
2d1b09641ecf2e754bf3fd244dc45dbf3e460c1b 14-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Avoid computing the linkage too early. Don't invalidate it.

Before this patch we would compute the linkage lazily and cache it. When the
AST was modified in ways that could change the value, we would invalidate the
cache.

That was fairly brittle, since any code could ask for the a linkage before
the correct value was available.

We should change the API to one where the linkage is computed explicitly and
trying to get it when it is not available asserts.

This patch is a first step in that direction. We still compute the linkage
lazily, but instead of invalidating a cache, we assert that the AST
modifications didn't change the result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176999 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
2d9e8838712f3fcacedaf898fd85654cd2bb3600 12-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Whitespace cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176896 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6d1cb5c62671b0ab4d9c023addf80562d7a45fd1 12-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Fixes a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176878 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
77e430df036060ba360a3e378deb4bbb3f691580 12-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Correctly compute linkage of decls forward declared extern C.

This fixes a crash in

namespace {
struct X {};
}
extern "C" X test2_b;
X test2_b

before we would assign different linkages to each of the test2_b decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176869 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6c18af24456000e4b7289bc024519efdb796229a 12-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove a bogus assert so we don't crash in

namespace {
struct X {};
}
extern "C" {
X b = X();
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176866 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
83972f128e9218c051692bf96361327a701aeb79 09-Mar-2013 John McCall <rjmccall@apple.com> Add TagDecl::hasNameForLinkage(), which is true if the tag
is non-anonymous or is defined in a typedef of itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176742 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
b421b56d5a83c5bcae576b714ebd9df7b745368d 09-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Documentation parsing. Some refactoring and code
improvements per Dmtiri's comments. // rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176739 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
bea522ff43a3f11c7a2bc7949119dbb9fce19e39 08-Mar-2013 Jordan Rose <jordan_rose@apple.com> ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xprCXX.cpp
ambdaMangleContext.cpp
ype.cpp
28c1cd2138f700742235e1e720c1f7e6dc75a11a 08-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> HeaderDoc: Support more of HeaderDoc documentation
commands; top level tags such as @interface and
their 2nd level tags such as @coclass, etc.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176667 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
9eda3abe7e183b05834947391c0cdc291f4ee0d8 07-Mar-2013 John McCall <rjmccall@apple.com> Promote atomic type sizes up to a power of two, capped by
MaxAtomicPromoteWidth. Fix a ton of terrible bugs with
_Atomic types and (non-intrinsic-mediated) loads and stores
thereto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176658 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
377830097aec41c0cd80ef5972b4e850b44afefd 07-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a hasExternalStorageAsWritten helper. No functionality change.

It is possible that some of the current uses of
"getStorageClassAsWritten() == SC_Extern" should use this but I don't know
enough about SC_PrivateExtern to change and test them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176606 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4919de6a53a007487c6d6b173921b5e7152a2004 06-Mar-2013 Adrian Prantl <aprantl@apple.com> Ensure that DIType is regenerated after we visit an implementation
that adds ivars to an interface.

Fixes rdar://13175234

This is an update to r176116 that performs a smart caching of interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176584 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
88f070f99f7f352e294eed212fdf7a23c0815fe2 06-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> say objective-C in the warning and streamline
several diagnostics into one. // rdar://13094352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176560 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
bd3aca04d304b9f31240b94af0aad818f6f932ab 06-Mar-2013 Stephen Hines <srhines@google.com> Update build rules for Clang merge to version 176138.

Change-Id: Ib028329a591e6175998d969f11b5404bf3f19e81
ndroid.mk
450b86c0c9ff8307f5145ced621914600196c500 06-Mar-2013 Stephen Hines <srhines@google.com> Merge commit 'b58f810669d9c17bcc025b7560de01d162856f34' into merge_20130226

Conflicts:
include/clang/Basic/LangOptions.def
lib/Sema/SemaDeclAttr.cpp

Change-Id: Ia10b4d3b2c949a72d328cb58b113f90237d4a5d5
eb8f69f094e95d0132e4a6817a2111ad188ab087 06-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> fix a missing check in my last patch.
// rdar://13094352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176529 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
99a7057098c56211e641705e1ff38d4b7c8b309d 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> doc. parsing. Improve on diagnostics on my last patch.
// rdar://13094352.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176525 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
ca76bf8a935ef1da970fbc95869e899120883ba1 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Fix this checkin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176510 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
bca9788dbaf5fcf241efdc82ddcda712cb22214e 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> doc parsing. Add @method and @callback for
checkings and few other refactoring/cleanup.
// rdar://13094352.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176509 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
ommentSema.cpp
4b02dff7aebb98d2d60b2ff4d3fc86109213128c 05-Mar-2013 David Blaikie <dblaikie@gmail.com> Add quotation marks to template names in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176474 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
2a268f2629b49958427e8eb02f2c3d565be71acc 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> doc parsing. We want to issue a strong warning when
an @function comment is not followed by a function decl.
// rdar://13094352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176468 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
ommentSema.cpp
808383d2d6d58a7c7db85f8c7618fb74d821309f 05-Mar-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: refactor handling of command markers in AST

* Use the term 'command marker', because the semantics of 'backslash' and 'at'
commands are the same. (Talking about 'at commands' makes them look like a
special entity.)

* Sink the flag down into bitfields, reducing the size of AST nodes.

* Change the flag into an enum for clarity. Boolean function parameters are
not very clear.

* Add unittests for new tok::at_command tokens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176461 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
c9320095d0126a104552ae718af461ad53316a34 04-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> [comment parsing] source fidelity for tparam command too.
// rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176448 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
66f6c24146efccc9ad7e37dbd2bd0ea1844e6422 04-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing. Missed a case of referring
to original command in diagnostic. // rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176444 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
8536fa14ee1048e5e2d62cb3dc11fc640c7dc00d 02-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Some refactoring in my patch on document
command source fidelity. // rdar://13066276



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176401 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
c98e9130bcddd0258c110d30749edd2284087e3d 01-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing. Keep the original command format
in AST for source fidelity and use it in diagnostics
to refer to the original format. // rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176387 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
1d4fff5551c2347010b955b4337a2aa7d65a050e 27-Feb-2013 Timur Iskhodzhanov <timurrrr@google.com> Better support for constructors with -cxx-abi microsoft, partly fixes PR12784

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176186 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
a2bb8923334ecd35b8f914dff7d105330abbad22 27-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't cache the visibility of types.

Since r175326 an implicitly hidden template argument can cause a template
installation to become hidden, even if the template itself has an explicit
default visibility. This requires that we keep track of "late" additions
of the visibility attribute.

This is hopefully the last followup change. It just removes the caching of
visibilities from types so that we can see new attributes even after a type has
been used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176164 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f127eb8aeb3ce861f3dbc1adbb3362bfd98461e1 27-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename methods to comply with the LLVM Coding Standards.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176159 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
18895dc4fd29f0071eeb591be820338f16407906 27-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Change Type::getLinkageAndVisibility to return a LinkageInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176157 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
2beda12c3fbaa9125831b7f818680978c596b205 27-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Move LinkageInfo out of NamedDecl so that it can be used in Type.h.

Everything that cares about visibility also cares about linkage, so I just
moved it to Visibility.h instead of creating a new .h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176155 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
da8910519b8dc79826781e74aaafddbd5c4ba19c 27-Feb-2013 Richard Trieu <rtrieu@google.com> Update template diffing to handle template arguments that are declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176153 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
10b4df7ff21076c21ca764f8ca38ccaff7888f25 27-Feb-2013 Adrian Prantl <aprantl@apple.com> Temporarily revert r176116 for compile-time performance regression.

This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176151 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
664e860beb2550bef24fb8946192f61648a71d7f 27-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing: Properties are considered like methods, and people
think of them as having return values that may be computed. Don't
warn when using @return in their comment. // rdar://13189938


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176147 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
58c79037256c77ffdbaa0da12205777e239fe096 26-Feb-2013 Adrian Prantl <aprantl@apple.com> Ensure that DIType is regenerated after we visited an implementation that adds ivars to an interface. Fixes rdar://13175234

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176116 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d3b2f0ac1cedad284d860acd652f28a05bcbcbed 26-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the most recent decl in getExplicitVisibility.

Now that implicitly hidden template arguments can make an instantiation hidden,
it is important to look at more than just the canonical decl of the argument
in order to see if an attribute is available in a more recent decl.

This has the disadvantage of exposing when getExplicitVisibility is called,
but lets us handle cases like

template <typename T>
struct __attribute__((visibility("default"))) barT {
static void zed() {}
};
class foo;
class __attribute__((visibility("default"))) foo;
template struct barT<foo>;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176112 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6980f17c78442a7db80d98902932ef047930284a 25-Feb-2013 Michael Han <fragmentshaders@gmail.com> Fix empty declaration printing.

Don't print the semicolon when visiting an empty declaration because the semicolon
will be printed as a terminator later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176035 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
b063ef0222a99ee168631afa7b5a882d494b8fde 23-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Add streamed versions of getQualifiedNameAsString.

Move the cold virtual method getNameForDiagnostic out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175966 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
xpr.cpp
02fb50d54042982bccc04c276ad2342827c8fcd3 23-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove the hack that avoided mangling static functions in extern C contexts.

Weather we should give C language linkage to functions and variables with
internal linkage probably depends on how much code assumes it. The standard
says they should have no language linkage, but gcc and msvc assign them
C language linkage.

This commit removes the hack that was preventing the mangling on static
functions declare in extern C contexts. It is an experiment to see if we
can implement the rules in the standard.

If it turns out that many users depend on these functions and variables
having C language linkage, we should change isExternC instead and try
to convince the CWG to change the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175937 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
7728cddd7866fadd07f1191eee40985e3cdbc6bf 23-Feb-2013 Peter Collingbourne <peter@pcc.me.uk> Revert r175912, "Add support for coldcc to clang" at John's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175936 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
ype.cpp
ypePrinter.cpp
f799ae1afb897151a84a7170951e367d8307ae04 22-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C arg: provide fixit support when
c++'s named cast need be replaced for bridge casting.
// rdar://12788838


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175923 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4c67aa96401b67b5200e701cff87485067ab0792 22-Feb-2013 Peter Collingbourne <peter@pcc.me.uk> Add support for coldcc to clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175912 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
ype.cpp
ypePrinter.cpp
684aa73192d92850a926870be62a1787eb5b7ed9 22-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclPrinter.cpp
5dd8f280980451d475a37db087adab991c1b5655 22-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Use raw_ostream::indent, update comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175897 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
7e9f060b46b39289d978dd5f449e236df98867f9 22-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Push the raw_ostream through the template diffing code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175896 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
1249b0fc1fc877c7fe8ecf325308504bff7819e6 22-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Streamify FormatASTNodeDiagnosticArgument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175895 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
5eada844fa70b6e2bc941dd7306f7a4fb1e8529d 22-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Streamify getNameForDiagnostic and remove the string versions of PrintTemplateArgumentList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175894 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
ecl.cpp
eclTemplate.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
emplateBase.cpp
ypePrinter.cpp
6ebf09130479bc7605aa09a3e6c4dc2ba3513495 22-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add CommentOptions to allow specifying custom comment block commands

Add an ability to specify custom documentation block comment commands via a new
class CommentOptions. The intention is that this class will hold future
customizations for comment parsing, including defining documentation comments
with specific numbers of parameters, etc.

CommentOptions instance is a member of LangOptions.

CommentOptions is controlled by a new command-line parameter
-fcomment-block-commands=Foo,Bar,Baz.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175892 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ommentCommandTraits.cpp
9d4df46b6c78825303ffbdd01bbe8d4b4513ed89 22-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> StmtPrinter: Directly print types to the stream instead of taking a detour through getAsString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175891 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ypePrinter.cpp
425663a16cc0d1bbd6764300f8a59251057dffe8 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Teach -ast-print how to print trailing-return-types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175864 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
d9bd83e0af720733e7564b125c1c9d495318b9e2 22-Feb-2013 NAKAMURA Takumi <geek4civic@gmail.com> Decl.cpp/mergeTemplateLV(): Tweak a description. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175859 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3892d022f36ee5bf3be4a55ea01c08d323ef6235 22-Feb-2013 John McCall <rjmccall@apple.com> Ignore visibility from enclosing template arguments
for explicit member specializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175827 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
4216ee1ed997b826470864182df34df1a350fcb7 21-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> AST dumping: dump template instantiations only once

Fixes infinite loop in PR15220.

Patch by Philip Craig.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175805 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
66874fb18afbffb8b2ca05576851a64534be3352 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Use None rather than Optional<T>() where possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175705 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclTemplate.cpp
SAPI.cpp
emplateBase.cpp
65124fe81f61eed98b845c87e3a78a780f3deb11 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Rename TypeLoc's isType to isKind

Matches changes made to SVal's similar functions based on Jordan Rose's review
feedback to r175594.

Also change isKind to take a reference rather than a non-null pointer, while I'm
at it. (& make TypeLoc::isKind private)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175704 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
e40b56226c1509d092d43a1c0b93cfb697f86158 21-Feb-2013 Richard Trieu <rtrieu@google.com> Remove commented out code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175699 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
dc84cd5efdd3430efb22546b4ac656aa0540b210 20-Feb-2013 David Blaikie <dblaikie@gmail.com> Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175679 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclTemplate.cpp
SAPI.cpp
emplateBase.cpp
d4c3d66be70ae2d0bd828329022dc428cc277a1c 20-Feb-2013 John McCall <rjmccall@apple.com> Add a new 'type_visibility' attribute to allow users to
control the visibility of a type for the purposes of RTTI
and template argument restrictions independently of how
visibility propagates to its non-type member declarations.

Also fix r175326 to not ignore template argument visibility
on a template explicit instantiation when a member has
an explicit attribute but the instantiation does not.

The type_visibility work is rdar://11880378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175587 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a880b19aa6ef1dc95936f5de052be7a7d6ee6814 19-Feb-2013 John McCall <rjmccall@apple.com> Add support for -fvisibility-ms-compat.

We treat this as an alternative to -fvisibility=<?>
which changes the default value visibility to "hidden"
and the default type visibility to "default".

Expose a -cc1 option for changing the default type
visibility, repurposing -fvisibility as the default
value visibility option (also setting type visibility
from it in the absence of a specific option).

rdar://13079314

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175480 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
39e6ab4be93d9c5e729a578ddd9d415cd2d49872 18-Feb-2013 David Blaikie <dblaikie@gmail.com> Replace TypeLoc llvm::cast support to be well-defined.

The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175462 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
omment.cpp
icrosoftMangle.cpp
emplateBase.cpp
ypeLoc.cpp
5a758de93fa2a28a84eb0d918a31d9522472990c 16-Feb-2013 John McCall <rjmccall@apple.com> Rework the visibility computation algorithm in preparation
for distinguishing type vs. value visibility.

The changes to the visibility of explicit specializations
are intentional. The change to the "ugly" test case is
a consequence of a sensible implementation, and I am happy
to argue that this is better behavior. Other changes may
or may not be intended; it is quite difficult to divine
intent from some of the code I altered.

I've left behind a comment which I hope explains the
philosophy behind visibility computation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175326 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
17c1a2e748d49d293c9926eeeb85aa4890182106 15-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: Fixes a compiler crash when encoding
an ivar of type pointer to a typedef'ed object.
// rdar://13190095


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175298 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a574c8909748fc0d2fd723a48334d6d2c72c8227 15-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Make helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175265 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cfaed8d399a34e79fbab9f70eb4ea1bbeb81a02b 14-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: synthesize properties in order of their
declarations to synthesize their ivars in similar
determinstic order so they are laid out in
a determinstic order. // rdar://13192366


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175214 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
83dece57e3e3fd84dfd4299a89751e266e87c79d 14-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Mangle extern "C" functions whose names are not simple identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175166 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
e252a89fc1560ca4cda9a95e4ae05e2dc03ee78c 14-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove const_casts by making spec_begin()/spec_end() const


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175159 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
eclTemplate.cpp
747836e5c79b5e12fe9cfb9b724dc4edeb115419 14-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Partially revert r175117 so that we don't break assumptions about how
static functions in extern "C" contexts are mangled. Should fix the
bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175132 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
d2fdd4256a2efc41365ccdd27a210d1d99a1fe3a 14-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> merge hasCLanguageLinkage and isExternC. Keep the shorter name.

I added hasCLanguageLinkage while fixing some language linkage bugs some
time ago so that I wouldn't have to check all users of isExternC. It turned
out to be a much longer detour than expected, but this patch finally
merges the two again. The isExternC function now implements just the
standard notion of having C language linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175119 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
taniumMangle.cpp
950fee2555f7a6bd193e588d6b6a941fd182391a 14-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fix
some cases where functions with no language linkage were being treated as having
C language linkage. In particular, don't warn in

extern "C" {
static NonPod foo();
}

Since getLanguageLinkage checks the language linkage, the linkage computation
cannot use the language linkage. Break the loop by checking just the context
in the linkage computation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175117 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
taniumMangle.cpp
2c5d8459f12549dc48654a4da33c085835831d1d 13-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: Make order of ivars which are synthesized
in the course of property synthesis deterministic (ordered
by their type size), instead of having hashtable order
(as it is currently). // rdar://13192366


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175100 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
59660c21178b6af518bd4b564e032d5c9cc218cb 13-Feb-2013 Timur Iskhodzhanov <timurrrr@google.com> Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175045 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
TableBuilder.cpp
ad0e27b18b0cefab049121d4bfd7b12216e7de6e 12-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix a bug reduced from a crash when trying to use modules with libc++. We check
the linkage of functions and variables while merging declarations from modules,
and we don't necessarily have enough of the rest of the AST loaded at that
point to allow us to compute linkage, so serialize it instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174943 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8896339a3c654dc44877d52a926eb89ab3ef30b5 11-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't bother reconciling external visible decls against our current set of
declarations if we didn't have a lookup map when the external decls were added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174906 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0ff4f8bf47c924b4b01d989a53432a95471a068d 10-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Use static functions instead of an unnamed namespace


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174835 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
bf8814478fddfa611911bdbd6a53a6614938cc63 09-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: use CharInfo.h

This also gives us 0.2% speedup on '-fsyntax-only -Wdocumentation' time for
a testcase that consists of all Clang headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174810 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
ommentParser.cpp
6bd992946bda92193fadce7e4890d4465d2702f4 09-Feb-2013 Douglas Gregor <dgregor@apple.com> Ensure that type definitions present in just-loaded modules are
visible.

The basic problem here is that a given translation unit can use
forward declarations to form pointers to a given type, say,

class X;
X *x;

and then import a module that includes a definition of X:

import XDef;

We will then fail when attempting to access a member of X, e.g.,

x->method()

because the AST reader did not know to look for a default of a class
named X within the new module.

This implementation is a bit of a C-centric hack, because the only
definitions that can have this property are enums, structs, unions,
Objective-C classes, and Objective-C protocols, and all of those are
either visible at the top-level or can't be defined later. Hence, we
can use the out-of-date-ness of the name and the identifier-update
mechanism to force the update.

In C++, we will not be so lucky, and will need a more advanced
solution, because the definitions could be in namespaces defined in
two different modules, e.g.,

// module 1
namespace N { struct X; }

// module 2
namespace N { struct X { /* ... */ }; }

One possible implementation here is for C++ to extend the information
associated with each identifier table to include the declaration IDs
of any definitions associated with that name, regardless of
context. We would have to eagerly load those definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174794 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
3f6f51e28231f65de9c2dd150a2d757b2162cfa3 08-Feb-2013 Jordan Rose <jordan_rose@apple.com> Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.

Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
emplateBase.cpp
6d4f73498cf014b002e72368f1c80b6b0a0785f0 08-Feb-2013 Jordan Rose <jordan_rose@apple.com> StmtPrinter: Write large char values using \u or \U.

This may not always be valid, but we were previously just
emitting them raw.

While here, s/isprint/isPrintable/ (using the new CharInfo).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174766 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
f21107b95a65db82f3295fd166074b5a59dfb1a7 08-Feb-2013 Tanya Lattner <tonic@nondot.org> Use the target address space value when mangling names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174688 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
2bb07c1dfeda50d7edcee512932b86a1a65c6e69 08-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix stack overflow and improve performance when a module contains many
overloads of a name by claiming that there are no lookup results for that name
in modules while loading the names from the module. Lookups in deserialization
really don't want to find names which they themselves are in the process of
introducing. This also has the pleasant side-effect of automatically caching
PCH lookups which found no names.

The runtime here is still quadratic in the number of overloads, but the
constant is lower.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174685 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
21f18c4fda167dc5f72feddbd6a7ac1b63200a0d 07-Feb-2013 Guy Benyei <guy.benyei@intel.com> Add OpenCL samplers as Clang builtin types and check sampler related restrictions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174601 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
icrosoftMangle.cpp
SAPI.cpp
ype.cpp
ypeLoc.cpp
bbcd0f3ba215d5a8857b224e32b0330586a00dc6 07-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix handling of module imports adding names to a DeclContext after qualified
name lookup has been performed in that context (this probably only happens in
C++).

1) Whenever we add names to a context, set a flag on it, and if we perform
lookup and discover that the context has had a lookup table built but has the
flag set, update all entries in the lookup table with additional names from
the external source.

2) When marking a DeclContext as having external visible decls, mark the
context in which lookup is performed, not the one we are adding. These won't
be the same if we're adding another copy of a pre-existing namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174577 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3646c68676c3c46a026b23d52188ef6e0d856178 07-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Simplify FindExternalVisibleDeclsByName by making it return a bool indicating
if it found any decls, rather than returning a list of found decls. This
removes a returning-ArrayRef-to-deleted-storage bug from
MultiplexExternalSemaSource (in code not exercised by any of the clang
binaries), reduces the work required in the found-no-decls case with PCH, and
importantly removes the need for DeclContext::lookup to be reentrant.

No functionality change intended!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174576 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xternalASTSource.cpp
4a19052fe91c988885c722252ef03ce5f762a73c 07-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> AST dumping: indicate the previous declaration for a redeclaration, and
indicate the semantic DC if it's not the lexical DC. In passing, correct
the ascii-art child marker for a child of a FriendDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174570 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
93aa2db250a0e67192ab2a5417e4dfd5530d6f56 04-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> DeclPrinter: fix CXXConstructExpr printing with implicit default argument

This is an improvement of r173630, that handles the following case:

struct VirualDestrClass
{
VirualDestrClass(int arg);
virtual ~VirualDestrClass();
};

struct ConstrWithCleanupsClass
{
ConstrWithCleanupsClass(const VirualDestrClass& cplx = VirualDestrClass(42));
};

ConstrWithCleanupsClass cwcNoArg;

That was printed as:

ConstrWithCleanupsClass cwcNoArg();


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174296 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
922cec29a9366f70d593d6225aea01dcd3daf8cf 03-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> CodeGen: Remove unnecessary const_casts. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174292 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
f8c12146fa2153a6d97b7c92d27d2ece0cd26e79 03-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove unneeded const_casts


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174287 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b35cc2d46c4188a0b2d094b3104ce69092c34802 03-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Constify ASTContext::getObjContainingInterface


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174282 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
821b93eec8b58a3e320ef34e7c98906ab61cf8c3 02-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Correctly classify T{} as an array temporary if T is an array of class type with nontrivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174261 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
af01bed59b2fe18fa483f5dbb86584b31eda6f98 01-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: improve the fidelity of XML output for many block commands

This change introduces a 'kind' attribute for the <Para> tag, that captures the
kind of the parent block command.

For example:

\todo Meow.

used to be just <Para>Meow.</Para>, but now it is
<Para kind="todo">Meow.</Para>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174216 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ae54121c15cdd38f415f6fdda48215ab5e4dcee1 01-Feb-2013 Alexander Kornienko <alexfh@google.com> Use const visitors in ASTDumper.
http://llvm-reviews.chandlerc.com/D355
Patch by Philip Craig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174171 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
xpr.cpp
f843a580c4a54ca147f22422ee8ccfd2347784fc 01-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> [Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174109 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
c264e16a42b3f6c36521857a29ea0949d9781c22 31-Jan-2013 Tim Northover <Tim.Northover@arm.com> Add support for AArch64 target.

In cooperation with the LLVM patch, this should implement all scalar front-end
parts of the C and C++ ABIs for AArch64.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174055 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8c84028ed9aa0dfd54ab729dee78f29c961d7f37 31-Jan-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Added outer template parameter lists to friend type AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174050 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.cpp
eclPrinter.cpp
f499b34d4911dda3b20ede1377ea29b83d3f149e 31-Jan-2013 Richard Trieu <rtrieu@google.com> When comparing two template template arguments in the template differ, consider
them the same if they are actually the same; having the same name isn't enough.

Similar to r174013, template template arguments were also mistakenly considered
the same when they had the same name but were in different namespaces.
In addition, when printing template template arguments, use the qualified name
if the regular name is the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174029 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
95f97bf07a1811d020cbdcaa51d6e25752a4bd37 31-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix -Wcovered-switch-default and -Wunused-private-field warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174025 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
e8d411997899a87e1a9f63ad3f52b38e7931687c 31-Jan-2013 Richard Trieu <rtrieu@google.com> Add indents to AST dumping and removed parenthesis from AST nodes.
Indents were given the color blue when outputting with color.
AST dumping now looks like this:

Node
|-Node
| `-Node
`-Node
`-Node

Compared to the previous:

(Node
(Node
(Node))
(Node
(Node)))



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174022 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
1166723df8af0f062c3f6d473d8ae7bb2b64e572 31-Jan-2013 Douglas Gregor <dgregor@apple.com> When comparing two templates in the template differ, consider them the
same if they are actually the same; having the same name isn't
enough. Fixes <rdar://problem/12931988>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174013 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
5bd1e5ba000023910ad986a16dd16d7ca914750a 30-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: resolve more named character references

This reimplements r173850 with a better approach:
(1) use a TableGen-generated matcher instead of doing a linear search;
(2) avoid allocations for new strings by converting code points to string
iterals with TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173931 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ommentLexer.cpp
b1c760ea2a7831100da5a9ed64291b34df0ddbe0 30-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Revert unintended change


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173927 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
cb5620c9b213f4bd323912159fdddda35e258a14 30-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support

This is required to use them in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173924 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ommentLexer.cpp
7586a6e6b7d79d4be031d2d0d6a35d5996cd0db9 30-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
an attribute for consistency with our other noreturn mechanisms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173898 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4b1a0e4ab6648894c63bffe8564a669c1df3d683 30-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Removed couple of html named character references in
my last patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173856 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
658a115c8e0d5bddf607a13d2ce13cd306ef2389 30-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> [Doc parsing] Patch to parse Doxygen-supported HTML character
references to their UTIF-8 encoding. Reviewed offline by Doug.
// rdar://12392215


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173850 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
a52d278f0fbac83fa26a03948759cce467d8e55b 29-Jan-2013 Joey Gouly <joey.gouly@arm.com> Fix a crash in OpenCL code by using the proper (RHS) bit-width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173802 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f727e1c6cc382c1b5fe23b38ba04df2d4a2f358a 29-Jan-2013 Douglas Gregor <dgregor@apple.com> Don't crash while printing APValues that are lvalues casted to a
decidedly non-reference, non-pointer type. Fixes <rdar://problem/13090123>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173747 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
a438b2d277fae00a4fa467ffcf382246e0a201e9 29-Jan-2013 John McCall <rjmccall@apple.com> Abstract the behavior of when to use base-class tail padding.

For fun, I added a comedy "actually obey the C++11 POD rules" option
which nobody is allowed to use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173744 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5250e2b24f7288fb31dc6357831fcbc4ced26693 27-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Decl printer: fix CXXConstructExpr with implicit default argument

Patch by Will Wilson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173630 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
d1e5c0df2acb01192eedda14534fe990e1e26c46 27-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: attach any tag type's documentation to its typedef if latter
does not have one of its own. // rdar://13067629

Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173626 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
06b5ea65365c5898be8355868a49c6f396cc8b02 27-Jan-2013 NAKAMURA Takumi <geek4civic@gmail.com> Revert r173586 (and r173587) , "Attach any tag type's documentation to its typedef if"

It caused unexpected warnings with @tparam.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173614 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e3fac338e0e9d7cdbac8a19f741f6bb8a74e631d 26-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Fix comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173587 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
87611cdd0c1a8e5648d63e141f471644c6f7dc64 26-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Attach any tag type's documentation to its typedef if
latter does not have one of its own. // rdar://13067629


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173586 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9677eb864f7354f140cd1bf59557843851e65de4 26-Jan-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Added ASTContext methods getIntPtrType and getUIntPtrType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173581 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d615f88e3c24f91a65c25a4f7e66e0f97b18cc15 26-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Constify some getters of DesignatedInitExpr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173574 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7ba443aa8cfb222737d3a964a19ad4fb1328c4b5 26-Jan-2013 Richard Trieu <rtrieu@google.com> Highlight various parts of the AST dump with color. Colors are controlled by
-f(no-)color-diagnostics. In addition, dumpColor() function calls are added
to force color printing. No structural changes to -ast-dump.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173548 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
10442564e1ba3c4dfb184cc4e36beffbee4811c3 26-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: actually check for a block command after "\param x"

This fixes PR15068.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173539 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
3ac83d69c61238cd0d38e90fcdd03390530ab2fb 26-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> patch for PR9027 and // rdar://11861085
Title: [PR9027] volatile struct bug: member is not loaded at -O;
This is caused by last flag passed to @llvm.memcpy being false,
not honoring that aggregate has at least one 'volatile' data member
(even though aggregate itself has not been qualified as 'volatile'.
As a result, optimization optimizes away the memcpy altogether.
Patch review by John MaCall (I still need to fix up a test though).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173535 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
23799e3ec4b341753e4fb63a7e995cf4ac3b6066 26-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> simplify code by removing excessive bracing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173521 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
41170b55ba635afb806394d44f2b7f1f6095df37 25-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Attach enum's documentation to its typedef if
latter does not have one of its own. // rdar://13067629


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173516 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d5617eeafc93209a26b9f88276c88cf997c3a0a7 25-Jan-2013 John McCall <rjmccall@apple.com> The standard ARM C++ ABI dictates that inline functions are
never key functions. We did not implement that rule for the
iOS ABI, which was driven by what was implemented in gcc-4.2.
However, implement it now for other ARM-based platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173515 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
b8b2c9da87e7d70a1679db026f40548b3192b705 25-Jan-2013 John McCall <rjmccall@apple.com> First pass at abstracting out a class for the target C++ ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173514 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
TableBuilder.cpp
d4497dde6fc8f5ce79e0ec37682b8dc920bbbef0 25-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Clean up: since we have FunctionDecl::IsInline, make it store the right value
for template instantiations, and use it to simplify the implementation of
FunctionDecl::isInlined().

This incidentally changes the result of isInlined on a declared-but-not-defined
non-inline member function from true to false. This is sort of a bug fix, but
currently isInlined is only called on function definitions, so it has no visible
effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173397 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8f6284750822e2062da583415164467f57cdf214 24-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> removed duplicated comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173378 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ad48a500596d7d678b99c7f94326cfa856c3b49f 24-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to check for integer overflow. It has been
commented on and approved by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173377 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8441fffda14c5d9ac704f24173fcb117d4999a8e 23-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Add constness for NestedNameSpecifier::Create parameter


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173274 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
b76d9718caea48b9333979b3da6f3a80110840cb 23-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Constify some getters in RedeclarableTemplateDecl


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173272 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
19dbb20ac4371fae3190379a7e7bd467af3c00aa 23-Jan-2013 Joey Gouly <joey.gouly@arm.com> Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3a344f9fc7a62ad0a8d26b2a1ccf5e4989720d0c 22-Jan-2013 Nico Weber <nicolasweber@gmx.de> Fix a bug in VarDecl::getSourceRange() for static member arrays with an element
type with an implicit initializer expression.

Patch from Will Wilson <will@indefiant.com>!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173170 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9ec55f24b8f848bb37a9971100cf2fca379d5572 22-Jan-2013 Tim Northover <Tim.Northover@arm.com> Switch to APFloat constructor taking fltSemantics.

This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173139 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
cd376b63c42214c7851ca917e7da9d30f9e84fa4 09-Jan-2013 Stephen Hines <srhines@google.com> Update Clang for merge to r171906.

clang-tblgen-rules.mk - New AttrDump.inc target
lib/AST/Android.mk
lib/Analysis/Android.mk
lib/Basic/Android.mk
lib/Lex/Android.mk
lib/Parse/Android.mk
lib/Sema/Android.mk
lib/StaticAnalyzer/Checkers/Android.mk

Change-Id: If31b4c9123f730ab851f11b00b0688166b14b4b2
ndroid.mk
15bb58edc9d053aa49c28167deb41ff0409ddabc 21-Jan-2013 Stephen Hines <srhines@google.com> Merge commit 'd130fd2e141f1fef412c2d58e7385370801bd718' into merge-llvm

Conflicts:
lib/Basic/Targets.cpp

Change-Id: I90a669a33ffe4de8b32c8459016fd0b2a55da0ad
649c7316aa29181df7270732722fe5d07ab3c7ad 21-Jan-2013 Timur Iskhodzhanov <timurrrr@google.com> First step towards vftable generation with -cxx-abi microsoft PR13231

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173035 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
e6b9d802fb7b16d93474c4f1c179ab36202e8a8b 20-Jan-2013 Guy Benyei <guy.benyei@intel.com> Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
taniumMangle.cpp
icrosoftMangle.cpp
SAPI.cpp
ype.cpp
ypeLoc.cpp
c934dfe950a14fe447aa14a7dae25d00ee87c8bb 19-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Use llvm::hexDigitValue in comment lexer


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172924 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
ba57183965f117279342903edec19766e478c9a8 18-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Some builtins do not evaluate their arguments. Teach EvaluatedExprVisitor not
to visit them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172769 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
02dd79830979e6d83d4420377e8f4c9e4a77439b 18-Jan-2013 Douglas Gregor <dgregor@apple.com> In Objective-C ARC, completely ignore ownership qualifiers on the
return type of a function by canonicalizing them away. They are
useless anyway, and conflict with our rules for template argument
deduction and __strong. Fixes <rdar://problem/12367446>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
87b73ba920f523ef13f2420cbdb958a281aa6f33 17-Jan-2013 Matt Beaumont-Gay <matthewbg@google.com> Suppress all -Wunused-value warnings from macro body expansions.

This is inspired by a number of false positives in real code, including
PR14968. I've added test cases reduced from these false positives to
test/Sema/unused-expr.c, as well as corresponding test cases that pass the
offending expressions as arguments to a no-op macro to ensure that we do warn
there.

This also removes my previous tweak from r166522/r166534, so that we warn on
unused cast expressions in macro arguments.

There were several test cases that were using -Wunused-value to test general
diagnostic emission features; I changed those to use other warnings or warn on
a macro argument expression. I stared at the test case for PR14399 for a while
with Richard Smith and we believe the new test case exercises the same
codepaths as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172696 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cd8ab51a44e80625d84126780b0d85a7732e25af 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 semantics for [[noreturn]] attribute. This required splitting
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172691 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0f9b9f37941ea709104f02d7dbe4ea18ab457605 17-Jan-2013 Douglas Gregor <dgregor@apple.com> Treat hidden Objective-C protocol definitions as if they were
undefined, and don't find methods or protocols within those protocol
definitions. This completes <rdar://problem/10634711>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172686 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a44b97004298a4eb7c270009ea4cb12aad49c543 17-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a dictionary literal
if we can see the elements of the arrays.

for example:

NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]];

-->

NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" };

rdar://12428166

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172679 91177308-0d34-0410-b5e6-96231b3b80d8
SAPI.cpp
d329724745b49f894b768d47275b7c2713106e89 17-Jan-2013 Douglas Gregor <dgregor@apple.com> Rework the traversal of Objective-C categories and extensions to
consider (sub)module visibility.

The bulk of this change replaces myriad hand-rolled loops over the
linked list of Objective-C categories/extensions attached to an
interface declaration with loops using one of the four new category
iterator kinds:

visible_categories_iterator: Iterates over all visible categories
and extensions, hiding any that have their "hidden" bit set. This is
by far the most commonly used iterator.

known_categories_iterator: Iterates over all categories and
extensions, ignoring the "hidden" bit. This tends to be used for
redeclaration-like traversals.

visible_extensions_iterator: Iterates over all visible extensions,
hiding any that have their "hidden" bit set.

known_extensions_iterator: Iterates over all extensions, whether
they are visible to normal name lookup or not.

The effect of this change is that any uses of the visible_ iterators
will respect module-import visibility. See the new tests for examples.

Note that the old accessors for categories and extensions are gone;
there are *Raw() forms for some of them, for those (few) areas of the
compiler that have to manipulate the linked list of categories
directly. This is generally discouraged.

Part two of <rdar://problem/10634711>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172665 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclObjC.cpp
umpXML.cpp
3f7b3a754e9698d613672dd1f7af3ccd1b42470a 15-Jan-2013 David Greene <greened@obbligato.org> Fix Cast

Avoid a cast-away-const error by properly using const_cast<>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172558 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
51ccafd66682ecbccc0a63364291dc7a8f6ec0f0 15-Jan-2013 Alexander Kornienko <alexfh@google.com> Resolved merge error with r172323 (llvm::X -> X)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172528 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
acd356e18ecb8213d65f1454bb3c1bb4f6892bab 14-Jan-2013 Alexander Kornienko <alexfh@google.com> Dump comments in -ast-dump.
http://llvm-reviews.chandlerc.com/D269

"Added dumping of declaration comments in ASTDumper. This required moving the
comment dumping code from CommentDumper so that the indentation is correct."

Patch by Philip Craig!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172409 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
MakeLists.txt
omment.cpp
ommentDumper.cpp
0446f51e1c0e16bc9e3f1311967e31ac6dc40bab 14-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove an unneeded const_cast


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172370 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
STDumper.cpp
STImporter.cpp
ommentDumper.cpp
ommentSema.cpp
ecl.cpp
eclBase.cpp
eclTemplate.cpp
umpXML.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
taniumMangle.cpp
6dcea67483a72e47db0a382e8d073340927ac27f 12-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172317 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
508276c8895d0a52198a0fa5dd01471236a94d50 12-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> bar

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172316 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
838dc597e25614c653a062a124b06a04d6b7f5eb 12-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Disable caching of visibility.

The testcase in pr14929 shows that this is extremely hard to do. If we choose
to apply the attribute, that causes the visibility of some decls to change and
that can happen really late (during codegen).

Current gcc warns and ignores the attribute in this testcase with a warning.
This suggest that the correct solution is to find a point in the compilation
where we can compute the visibility and
* assert it was never computed before
* reject any attempts to compute it again in the future (with warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172305 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
ype.cpp
ca2ab45341c448284cf93770018c717810575f86 12-Jan-2013 Douglas Gregor <dgregor@apple.com> Provide Decl::getOwningModule(), which determines the (sub)module in
which a particular declaration resides. Use this information to
customize the "definition of 'blah' must be imported from another
module" diagnostic with the module the user actually has to
import. Additionally, recover by importing that module, so we don't
complain about other names in that module.

Still TODO: coming up with decent Fix-Its for these cases, and expand
this recovery approach for other name lookup failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172290 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c328d9c22a4397dd7313d06be5b82d700297b246 12-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing: when property accessors don't have comment
of their own (or are syntheszed), use prperty's comment.
for them. // rdar://12791315


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172278 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
2246823e207a4846c842a27cf99d99920cd2b178 12-Jan-2013 Sean Callanan <scallanan@apple.com> Fixed a bug that caused the AST importer to erroneously
import incomplete definitions for RecordDecls and then
mark the resulting definition as complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172273 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
a18e70b25c85d7e653e642b5e6e58d6063af3d83 10-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Issue warning when case value is too large to fit
in case condition type. // rdar://11577384.
Test is conditionalized on x86_64-apple triple as
I am not sure if the INT_MAX/LONG_MAX values in the test
will pass this test for other hosts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172016 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
719e53f64637c5ac41aac0c711e1977487ffc0d7 09-Jan-2013 David Blaikie <dblaikie@gmail.com> Suppress GCC -Wreturn warning.

Modified from a patch by David Greene.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171982 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
abe75ef905626d00358427a7a3c59480c1f03361 09-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Handle static functions being redeclared in function scope.

Fixes pr14861.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171978 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ef3c69406f73b892a3d5023ea42b3d7ed9c99d33 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Clear the LV cache when setting the instantiated from link.
Fixes pr14835.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171857 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa46d513f47280a9786e8e9aa77f7089b3f8fee6 08-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Move ref qualifiers from Type bitfields into FunctionProtoType, stealing two
bits from the number of parameters. This brings the bitfields down from 33 bits
to 32 bits, reducing the size of Types by 4 bytes on 32-bit systems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171827 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
cc5a28a1a10e966ae176957d9fd21b03951f600e 07-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Minor refactoring of my last patch
related to // rdar://12958878


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171792 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
32b94bedc6a789e4091626e7433e73555cf9df00 07-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: when searching for declarations in protocol
list of classes, etc., make sure to look into protocol
definitions. // rdar://12958878


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171777 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c3cd2b0d538e4db78f1bcbedd0085e2005ce5c51 07-Jan-2013 Alexander Kornienko <alexfh@google.com> Implement Attr dumping for -ast-dump.
http://llvm-reviews.chandlerc.com/D234

Patch by Philip Craig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171760 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
MakeLists.txt
7a83421776416d6a9044fb03b5b02208b47646c1 07-Jan-2013 David Tweed <david.tweed@arm.com> Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to be
with respect to the lower "left-hand-side bitwidth" bits, even when negative);
see OpenCL spec 6.3j. This patch both implements this behaviour in the code
generator and "constant folding" bits of Sema, and also prevents tests
to detect undefinedness in terms of the weaker C99 or C++ specifications
from being applied.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171755 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6acc4bc44db341d499a925cfe68bea89390039a4 05-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Assert that redeclarations have the same linkage.

It is somewhat hard to test linkage, so I decided to try to add an assert. This
already found some interesting cases where there were different.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171585 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7ac928b4dc15b5eeb13ea62e96330a145cc71068 04-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Style fix: We don't use lowercase-and-underscored template parameter names.
Thanks for dgregor for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2b721f52655bc75f8b9d5dcc761298829d5a7c8e 04-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix typo. Thanks to dgregor for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171521 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f7992132207d7ddc8810a135cec97ebe5805e500 04-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Fix up various builtin declaration of objc_msgSend families
to match those foung in objc.h an avoid spurious warnings.
// rdar://12489098


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171492 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4e24f0f711e2c9fde79f19fa1c80deaab3f3b356 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby 'C++0x' comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171372 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
62a833eaebb1867d9950767288debdfa34dd8561 02-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert an if that never happens to an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171354 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa7dbafc3539868ce271cb336444ec544260905a 30-Dec-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment lexing: replace manual comparison with StringRef::find_first_of

This gives an about 1.8% improvement on Clang bootstrap with -Wdocumentation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171262 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
9f0c692c4db9012248c65fab6cb703f2ce444dfe 30-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Don't get confused if a extern "C" builtin function is redeclared without
the extern "C".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171260 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
07cf58c96dc599d1c25dae4efd9445b6f5d3596c 29-Dec-2012 Nico Weber <nicolasweber@gmx.de> ArrayRefize CXXTryStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171239 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d36aa359e2f45cd22c7366a015ad94de08044dbb 29-Dec-2012 Nico Weber <nicolasweber@gmx.de> ArrayRefize a CompoundStmt constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171238 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
78eeba8c7d53b6b2983c76b77b23b45b89ed939d 28-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Reject overloading of two static extern C functions.

This patch moves hasCLanguageLinkage to be VarDecl and FunctionDecl methods
so that they can be used from SemaOverload.cpp and then fixes the logic
in Sema::IsOverload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171193 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ceb59d91b3a7def4297ec8468621805777741963 28-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Replace magic numbers in CheckICE with an enum.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171192 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9b403c555a294530305f40dfee859b73070de542 28-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14729: Fix typo in CheckICE for BinaryConditionalOperators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171191 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
65d78312ce026092cb6e7b1d4d06f05e18d02aa0 25-Dec-2012 Erik Verbruggen <erikjv@me.com> Fix for PR12222.

Changed getLocStart() and getLocEnd() to be required for Stmts, and make
getSourceRange() optional. The default implementation for getSourceRange()
is build the range by calling getLocStart() and getLocEnd().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171067 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
38980086c0f791e8c23cc882574f18e5b4a87db6 25-Dec-2012 Guy Benyei <guy.benyei@intel.com> Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171056 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
ype.cpp
ypePrinter.cpp
140aadf5b927ae294388c680a7db44e5de39578a 25-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Add 171048 back but invalidate the cache of all redeclarations when setting
the body of a functions. The problem was that hasBody looks at the entire chain
and causes problems to -fvisibility-inlines-hidden if the cache was not
invalidated.

Original message:

Cache visibility of decls.

This unifies the linkage and visibility caching. I first implemented this when
working on pr13844, but the previous fixes removed the performance advantage of
this one.
This is still a step in the right direction for making linkage and visibility
cheap to use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171053 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
eaf5ec43ec52f650a00254d1c20d51fb7671aead 25-Dec-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r171048, "Cache visibility of decls."

It broke stage2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171050 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
dfb316613a40d0efc033c7bd0a49da59c915fc63 25-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Cache visibility of decls.

This unifies the linkage and visibility caching. I first implemented this when
working on pr13844, but the previous fixes removed the performance advantage of
this one.

This is still a step in the right direction for making linkage and visibility
cheap to use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171048 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
335153679daf37c13a8c89266056b4be061e34e3 22-Dec-2012 Douglas Gregor <dgregor@apple.com> Use a safe default width for template-diff'ing integral arguments, in
case we can't find an exact width to use. Fixes crash in
<rdar://problem/12456626>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170951 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
d4ae6535a667d515afc0af3e67ca287548aba985 21-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> Fixes couple of friend declaration -ast-print bug
found by running -ast-print on all-std-headers.cpp
which caused it to go into infinite loop. Now
-ast-print prints all declarations found in
all-std-headers.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170928 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ad017fa7a4df7389d245d02a49b3c79ed70bedb9 20-Dec-2012 Bill Wendling <isanbard@gmail.com> Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c939453846395abc860cdb0239784daf4df4fb54 20-Dec-2012 Alexander Kornienko <alexfh@google.com> Minor coding style issue: NULL -> 0

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170688 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
ad7bb3601d57e7d41c199a4367490b705f669e67 20-Dec-2012 Alexander Kornienko <alexfh@google.com> ASTDumper coding style fixes.
http://llvm-reviews.chandlerc.com/D226

Patch by Philip Craig!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170684 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
a89479081e0ee1589736d987771de609c5505832 20-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix another uninitialized bool member bug found by -fsanitize=bool. This one
appears to currently be benign (we happen to test the flags in the right
order, so we never depend on the uninitialized value).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170640 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
3624e9e55d98507863d0731a0942cd874f2a1574 20-Dec-2012 John McCall <rjmccall@apple.com> Robustify the @encode code and add support for _Atomic.

Fixes PR14628.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170639 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5b9268f26ac53a74d2c504279fe577d988d5615d 20-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170636 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
d538ed9b2a617239d5bd56357663de62f6f9224c 20-Dec-2012 Alexander Kornienko <alexfh@google.com> Implement AST dumper for Decls.
http://llvm-reviews.chandlerc.com/D52

Patch by Philip Craig!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170634 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
eclPrinter.cpp
tmtPrinter.cpp
emplateName.cpp
40902d817e5a73850045d8a0c9795bc5047ee000 20-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> Audit DeclPrinter with -ast-dump on Cocoa.h and
fix any bad objectiveC syntax coming out of
DeclPrinter. This is on going. Also, introduce a new
PrintPolicy and use it as needed when declaration tag
is to be produced via DeclPrinter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170606 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ca57ccdf480fc002202c74011bdf14687f164a5a 19-Dec-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix PR14591: Windows newlines in doxygen comments cause failed assertion in
TextDiagnostic

Patch by Janusz Chorko.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170566 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
eb34db715f1130ad7793fc0cc50c8191c2157c53 19-Dec-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add a missing 'else'. Found by inspection.

No testcase because we were just building an extra AST node and eventually
throwing it away, so it did not affect correctness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170563 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
094dbf917127a1228147587076d59ca45b7c258d 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170500 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c83c2300e1946fea78ecd3c2e93d9c2dd2638a2b 19-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170489 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
3bc93e3124ad5e7191c4a12dc981c8ee53578193 19-Dec-2012 David Blaikie <dblaikie@gmail.com> Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
xprCXX.cpp
1850ac6ae954524c821723a0f87df62d004a7293 19-Dec-2012 Eli Friedman <eli.friedman@gmail.com> Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170474 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
88b9521364735a6c9a7ccd23c5bd19d81a80cdd3 19-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170467 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
b13621d08e20ac7aa550e05896de8a57ee99c1e8 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Re-commit r170428 changes with Linux style file endings.

Add OpenCL images as clang builtin types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170432 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
icrosoftMangle.cpp
SAPI.cpp
ype.cpp
ypeLoc.cpp
7f92f2d8d9b7a07900c030183bc13a9ff60057cc 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170431 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
icrosoftMangle.cpp
SAPI.cpp
ype.cpp
ypeLoc.cpp
736104a7619c53ef92553780273d7357a3cdde81 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Add OpenCL images as clang builtin types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170428 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
icrosoftMangle.cpp
SAPI.cpp
ype.cpp
ypeLoc.cpp
a7a2f2a96dc9d2e66a5e6ee7ca50cb04931f4c98 18-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge storage classes even when contexts don't match.

This fixes the storage class of extern decls that are merged with file level
statics. The patch also fixes the linkage computation so that they are
considered internal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170406 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
372df4548267ce5d6ecf1da68902f0d793271a4f 17-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix isThisDeclarationADefinition for extern following tentative.

An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170377 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4ae711b5ef292378d5b88cede3d4b708174053e2 14-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't hit an assertion failure when calculating the __PRETTY_FUNCTION__
of a member function with parenthesized declarator.

Like this test case:

class Foo {
const char *(baz)() {
return __PRETTY_FUNCTION__;
}
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170233 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
40b66a000dca59be61117558bb54f3880a77cd14 13-Dec-2012 Alexander Kornienko <alexfh@google.com> Rename StmtDumper to ASTDumper.
Patch contributed by Philip Craig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170127 91177308-0d34-0410-b5e6-96231b3b80d8
STDumper.cpp
MakeLists.txt
tmtDumper.cpp
1b257afbae854c6817f26b7d61c4fed8ff7aebad 11-Dec-2012 Douglas Gregor <dgregor@apple.com> Use @import rather than @__experimental_modules_import, since the
latter is rather a mess to type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169919 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
34db84fdb092f89ea3678a0792074a5b9253829a 11-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C blocks: Check for record type when deciding if
byref variable requires extended layout info. to prevent
a crash involving arrays declared __block. // rdar://12787751


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169908 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
21c8b19a28f0140261a53f0cc006c8d55a433665 11-Dec-2012 Alexander Kornienko <alexfh@google.com> StmtDumper coding style changes

Summary:
A few small coding style changes for StmtDumper, including:
- rename Dump* methods to dump*
- uninline some methods
- comment fixes
- whitespace fixes

Please review and commit if okay.

Reviewers: alexfh

Reviewed By: alexfh

CC: cfe-commits, alexfh, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D190

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169866 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
d5bc359971fe9e3d78a44e9b25a909f01f3018ec 11-Dec-2012 Alexander Kornienko <alexfh@google.com> Rename StmtDumper::DumpSubTree() to dumpStmt()

Summary:
Also rename DumpDeclarator() to dumpDecl(). Once Decl dumping is added, these will be the two main methods of the class, so this is just for consistency in naming.

There was a DumpStmt() method already, but there was no point in having it, so I have merged it into VisitStmt(). Similarly, DumpExpr() is merged into VisitExpr().

Reviewers: alexfh

Reviewed By: alexfh

CC: cfe-commits, alexfh

Differential Revision: http://llvm-reviews.chandlerc.com/D156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169865 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
bc2a35d5ff492107dab5bdb7682f0da2f4a88861 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Finish implementing 'selected constructor' rules for triviality in C++11. In
the cases where we can't determine whether special members would be trivial
while building the class, we eagerly declare those special members. The impact
of this is bounded, since it does not trigger implicit declarations of special
members in classes which merely *use* those classes.

In order to determine whether we need to apply this rule, we also need to
eagerly declare move operations and destructors in cases where they might be
deleted. If a move operation were supposed to be deleted, it would instead
be suppressed, and we could need overload resolution to determine if we fall
back to a trivial copy operation. If a destructor were implicitly deleted,
it would cause the move constructor of any derived classes to be suppressed.

As discussed on cxx-abi-dev, C++11's selected constructor rules are also
retroactively applied as a defect resolution in C++03 mode, in order to
identify that class B has a non-trivial copy constructor (since it calls
A's constructor template, not A's copy constructor):

struct A { template<typename T> A(T &); };
struct B { mutable A a; };


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169673 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
55798658f879915992ed0ebe30b0b63fd570ff1b 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove some remnants of the assumption that there is at most one of each
flavour of special member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169670 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ac71351acdefc9de0c770c1d717e621ac9e684bf 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.

This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.

This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169667 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
d5bc867f6597ee8d4eb31ea217934e436fc7c7e3 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++03 [dcl.init]p5's checking for value-initialization of references
properly, rather than faking it up by pretending that a reference member makes
the default constructor non-trivial. That leads to rejects-valids when putting
such types inside unions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169662 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
0ee69cc6d4fc547671303afbd715cb990e5c3af6 08-Dec-2012 Eli Bendersky <eliben@google.com> Currently when AST record layouts are dumped with -fdump-record-layouts, the
following:

sizeof=132, dsize=132, align=4
nvsize=132, nvalign=4

Is not indented, so when classes are nested there is no way to know to
which class it belongs.

Fix this problem by indenting the size summary properly for each class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169654 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d5e839429771ad4d1a8b3db598cbbc6d93621f75 06-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't use dyn_cast on a Type* which might not be canonical. Fixes an extremely obscure record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169467 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5e0ea1994be5b5b55fb8740548d7c7c151733b96 06-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> More C++ testing of declarations embedded in
<declaration> tag of Comment XML and fixing
DeclPrint of templates along the way - wip.
//rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169453 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ddb2968ba69e14bafec765401d70f2477bc977f6 05-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> In DeclPrint add printing of '= default'
in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169440 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
65bcdabba34fddc303ab97f60dfea6079989306a 05-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> In DeclPrint add printing of 'explicit'
constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169435 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
02a2e5a1dd0ad1b93f66040fc7aae6d69a918daf 05-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> Testing C++ declarations embedded in
<declaration> tag of Comment XML.
Added DeclPrint support for constructors
and fix tests accordingly.
This is wip. // rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169412 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8920eb7a957f3b0bc4a8213ecdaec9a7fcd139ea 05-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> Testing C++ declarations embedded in
<declaration> tag of Comment XML and
added support for friend declaration printing.
This is wip. // rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169346 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
3e2fe86dd0dd65bff254e3bbdc0ea8df9282dc35 04-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> Testing C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing block literal printout as result of the testing.
// rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169307 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ff685c562c8fd5dfc6effec17377fde9dad6f271 04-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c blocks: Consider padding due to alignment
after the fixed size block header when generating
captured block variable info. // rdar://12773256


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169285 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STConsumer.cpp
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ttrImpl.cpp
XXInheritance.cpp
ommentParser.cpp
ommentSema.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclGroup.cpp
eclTemplate.cpp
xprClassification.cpp
taniumCXXABI.cpp
angle.cpp
awCommentList.cpp
ecordLayoutBuilder.cpp
tmtDumper.cpp
emplateName.cpp
ypeLoc.cpp
ypePrinter.cpp
482b4fd1aabb880887f3982ae13fbbaadb0c7d8e 04-Dec-2012 Fariborz Jahanian <fjahanian@apple.com> Testing objective-C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing declaration of ivars private to @implementation
as result of the testing. // rdar://12378714


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169193 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
a93d0f280693b8418bc88cf7a8c93325f7fcf4c6 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Include pruning and general cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169095 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmt.cpp
emplateBase.cpp
TableBuilder.cpp
9852f58f50b4fc20914fbce5b4454135a42343f4 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Don't include Type.h in DeclarationName.h.

Recursively prune some includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169094 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
2fa67efeaf66a9332c30a026dc1c21bef6c33a6c 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code.

Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169092 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ommentSema.cpp
ecl.cpp
eclBase.cpp
eclObjC.cpp
eclPrinter.cpp
umpXML.cpp
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
icrosoftMangle.cpp
tmt.cpp
tmtPrinter.cpp
ype.cpp
7d04d3a6855bc74d5c1a2213717eb5402b772ae6 30-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Refactor to reduce duplication in handling of special member functions. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168977 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
b2829203384ab529c0ba13696acca68f7c79d000 29-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Now that the underlying problem has been fixed, add r168411 back.
Original commit message:

Remove redundant code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168900 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8b8a09e496fbed361d4c8e9e8cc259454a094258 29-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge function types in C.

Among other differences, GCC accepts

typedef int IA[];
typedef int A10[10];
static A10 *f(void);
static IA *f(void);
void g(void) {
(void)sizeof(*f());
}

but clang used to reject it with:

invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
* Use the type from the function type in initializations, even if an parameter
is available.
* Fix the merging of the noreturn attribute in function types.
* Make CodeGen handle the fact that an parameter type can be different from
the corresponding type in the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168895 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
53c61c5c0c912b5032882471f5215d66a11bb0ce 29-Nov-2012 Timur Iskhodzhanov <timurrrr@google.com> [-cxx-abi microsoft] Also spill the argument-back-references context when mangling templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168862 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
b15c8984ea300624fbbde385d3907667ce1043fa 29-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C blocks: Make sure that identical logic is used
in deciding a copy/dispose field is needed in a byref structure
and when generating the copy/dispose helpers. In certain
cases, these fields were being added but no copy/dispose was
being generated. This was uncovered in ARC, but not in MRR.
// rdar://12759433


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168825 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
acf796b4797c5b3e9e237148fa622afdc04b3eff 28-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Store on the CXXRecordDecl whether the class has, or would have, a copy
constructor/assignment operator with a const-qualified parameter type. The
prior method for determining this incorrectly used overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168775 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
2a82ca255b0f99f6201a75ed52b91fc024f6e9cf 28-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTUnresolvedSet, an UnresolvedSet-like class, whose contents are
allocated using the allocator associated with an ASTContext.

Use this inside CXXRecordDecl::DefinitionData instead of an UnresolvedSet to
avoid a potential memory leak.

rdar://12761275

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168771 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9d29543284e75648ac89c6e9586fc7cf786cf66f 28-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,
expose only the iterators instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168770 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6902e4146d426998ff6a94b16776c1b3f805a048 27-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Fix the definition of the vfork() builtin on Haiku. PR14378.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168674 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8272be5ed3bf7c7ac5d32fa9fd83f9229bf455d0 27-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert r168411 for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168667 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
79b7cc59658ca477cd943561d2d30cdfe9e09a5a 26-Nov-2012 Timur Iskhodzhanov <timurrrr@google.com> Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168583 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
8dbf697cf5e10824659bc5061ebf470fa43716fa 25-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Add r168519 back, but with a fix to also merge the used flag in variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168564 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6df81a94fca403c7aa66918404caab19cffbca35 25-Nov-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r168519, "Merge used flags so that we don't have to iterate on isUsed. With this change"

It brought bunch of (possibly false) warnings.

llvm/unittests/VMCore/PassManagerTest.cpp:60:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char ModuleNDNM::ID=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:86:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char ModuleNDM2::ID=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:106:21: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char ModuleDNM::ID=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:217:16: warning: variable 'initcount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int LPass::initcount=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:218:16: warning: variable 'fincount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int LPass::fincount=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:259:16: warning: variable 'inited' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int BPass::inited=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:260:16: warning: variable 'fin' is not needed and will not be emitted [-Wunneeded-internal-declaration]
int BPass::fin=0;
^
llvm/unittests/VMCore/PassManagerTest.cpp:283:24: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
char OnTheFlyTest::ID=0;
^
8 warnings generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168549 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
919b7e69781daf68766bb9af11ca1b9f246ce935 23-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge used flags so that we don't have to iterate on isUsed. With this change
"clang -cc1 -fsyntax-only" on the preprocessed output of

#define M extern int a;
#define M2 M M
#define M4 M2 M2
#define M8 M4 M4
#define M16 M8 M8
#define M32 M16 M16
#define M64 M32 M32
#define M128 M64 M64
#define M256 M128 M128
#define M512 M256 M256
#define M1024 M512 M512
#define M2048 M1024 M1024
#define M4096 M2048 M2048
#define M8192 M4096 M4096
#define M16384 M8192 M8192
M16384

goes from 2.994s to 1.416s. GCC is at 0.022s, so we still have a long way to go.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168519 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
385e1d9fd05cdebf00924489788409f6853579bf 23-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove redundant check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168515 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f62c690c55fb920f3ba0a4f6e6e259e2ae7ce297 22-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix CXXRecordDecl::forallBases to not look through bases which are dependent
and defined within the current instantiation, but which are not part of the
current instantiation. Previously, it would look at bases which could be
specialized separately from the current template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168477 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
16c8cf1c3c5e4265b90103a7b5e924e567ab5cd1 21-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove redundant code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168411 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5175861336cf35cce8b2889282d9b55394a4380c 21-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove redundant code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168410 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
36cbbe916f66f08d36492e75809fbf54416a5e8d 18-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Documentation parsing: propely handle a lone '\endverbatim' and emit a warning.

We actually used to assert on this.

Thanks to NAKAMURA Takumi for noticing this!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168277 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
95f6190acb664b345b1395abaea84ee451740c5b 16-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> StmtDumper: remove incomplete support for limiting the maximum dump depth.
There are better ways of limiting the amount of information if there is a need
for that.

Patch by Philip Craig.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168206 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0bbf1c668e8cb1a3e5b1385c2fd5cd6c73f481c0 16-Nov-2012 Matt Beaumont-Gay <matthewbg@google.com> Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater.

GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary
lifetime bugs.

No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168124 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
426391cd51af86f9d59eceb0fb1c42153eccbb9a 16-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> A step towards sorting out handling of triviality of special members in C++11.

Separate out the notions of 'has a trivial special member' and 'has a
non-trivial special member', and use them appropriately. These are not
opposites of one another (there might be no special member, or in C++11 there
might be a trivial one and a non-trivial one). The CXXRecordDecl predicates
continue to produce incorrect results, but do so in fewer cases now, and
they document the cases where they might be wrong.

No functionality changes are intended here (they will come when the predicates
start producing the right answers...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168119 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ype.cpp
3d145f660a23d5bdabdd1ead83c51f3df1489b09 15-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> block extended signatur option. Change previous option
to a cc1 -fencode-extended-block-signature and pass it
to cc1 and recognize this option to produce extended block
type signature. // rdar://12109031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168063 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5b64e77c2d51ca3e9313ed4107d3c4d927895cd6 15-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Fix a trivial bool-related bug I spotted while skimming David Fang's
current list of powerpc-darwin8 failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168016 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
924d5c9853fbdfabc54a473e680f3b6bb8a1b940 15-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Make template diffing handle integral expressions of various widths correctly.
PR14342.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168005 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
06cffc0511ba76d979fad9ef6944e685936b62f0 15-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C blocks: under cc1 flag -encode-extended-block-signature,
generate expanded signature encoding to include types as we
already do this for protocol method lists.
// rdar://12109031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167997 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1cef45955d87dde48c78b6878dc0ee67a3404b6c 14-Nov-2012 Douglas Gregor <dgregor@apple.com> Teach the AST importer to merge enumerator constants. Fixes
<rdar://problem/12676166>, and tested on the LLDB side of the world.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167990 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
3ca23d7dc6cb61e6f363a58d9256d548199d120c 14-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C blocks: Provide layout map for byref
variables captured in a block. // rdar://12184410



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167931 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
93af2b839224badbb0555f8920c44fc9a1c793fe 14-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14279: Work around this major miscompilation by treating move operations as
non-trivial if they would not call a move operation, even if they would in fact
call a trivial copy operation. A proper fix is to follow, but this small
directed fix is intended for porting to the 3.2 release branch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167920 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
08db94f58e50263eb98ba1a05e967520e8e7f895 14-Nov-2012 David Blaikie <dblaikie@gmail.com> Remove debugging assert.

Found by Richard Smith in post-commit review of r167906.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167911 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
66cff7257698d5528632917d38f9a3037bb1506d 14-Nov-2012 David Blaikie <dblaikie@gmail.com> Provide the correct mangling and linkage for certain unnamed nested classes.

This corrects the mangling and linkage of classes (& their member functions) in
cases like this:

struct foo {
struct {
void func() { ... }
} x;
};

we were accidentally giving this nested unnamed struct 'no' linkage where it
should've had the linkage of the outer class. The mangling was incorrecty too,
mangling as TU-wide unnamed type mangling of $_X rather than class-scoped
mangling of UtX_.

This also fixes -Wunused-member-function which would incorrectly diagnose
'func' as unused due to it having no linkage & thus appearing to be TU-local
when in fact it might be correctly used in another TU.

Similar mangling should be applied to function local classes in similar cases
but I've deferred that for a subsequent patch.

Review/discussion by Richard Smith, John McCall, & especially Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167906 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
taniumMangle.cpp
8c88953ff0cebd861643ab92309aba71d23c306b 14-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove another questionable use of hasTrivial*. The relevant thing for this
test was whether the /selected/ operator= was trivial, not whether the class
had any trivial (or any non-trivial) operator=s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167897 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0a26d7680d064653cb42e89e70c62402283003fd 13-Nov-2012 Nico Weber <nicolasweber@gmx.de> [ms] Make mangleIntegerLiteral less aware of exact type of the literal.

Integer literal mangling does not actually depend on exact type of the literal.
This will simplify calling mangleIntegerLiteral when literal type is not known,
for example, when sizes or offsets are mangled as integer literals.

Also, call mangleNumber instead of directly printing mangled values of 0/1, to
avoid this knowledge from being in multiple places.

Patch from Evgeny Eltsin!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167878 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
5f9a7e31d038843f1d3a5e2544fc365ffd563951 12-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove abuse of hasTrivial*, and fix miscompile wherein global arrays with
internal linkage, no uses, trivial construction, and nontrivial destruction
were not emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167756 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
731de313f759bdb412d38df3d2a0f149437ef401 12-Nov-2012 David Blaikie <dblaikie@gmail.com> 80 cols & unnecessary braces from r167736.

Post-commit review feedback by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167739 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
383ec17ecaac9ac4fce2747640623274a139badf 12-Nov-2012 David Blaikie <dblaikie@gmail.com> Correct printing of nested anonymous type member accesses.

Patch by Florent Bruneau!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167736 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c6b82c353bef4cbc0d1dde8580abf8d0a266e64b 12-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove calls to getMostRecentDecl. The case they were added for in r117526 are
now covered by attribute merging.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167714 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
538fb98685522bb7234c693f12e82b8893e290ff 12-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> In Sema::MergeVarDecl we handle merging of storage classes and visibility
attributes. In cases where the merged declaration is fully equivalent to the
two original ones, some of the code was getLVForDecl was duplicated.

Cases that are still handled in getLVForDecl are things like

__private_extern__ int N;
int N;

For which we cannot produce a single merged decl with all the information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167703 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
229d47aef27e6f65fe4dc3beb22f622dd81104ad 10-Nov-2012 Douglas Gregor <dgregor@apple.com> Rework my implementation of circular-reference finding to not use
CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the
failure introduced in r167651.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167668 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
d777e2845110469182809e4efc577899395805f7 10-Nov-2012 Douglas Gregor <dgregor@apple.com> Diagnostic circular inheritance involving dependent base classes. We
would have diagnosed this at instantiation time anyway, if only we
didn't hang on all of these test cases. Fixes <rdar://problem/12629723>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167651 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
ecd27bf256c92f56c7c7ede6f40ec5d31a40b35e 09-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBuffer
for completeness and use it in CompilerInstance::InitializeSourceManager if
the input is a memory buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167628 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c8e78b2c8e4d56ef05880437326806dd0a2aa45a 09-Nov-2012 Nico Weber <nicolasweber@gmx.de> [ms] Implement int64_t version of mangleNumber() in terms of the APSInt version.

No intended functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167602 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
e95b46bf50059806d58f494f6ad3a827dce02e24 09-Nov-2012 Nico Weber <nicolasweber@gmx.de> [Windows] Fix mangling of number literal '0'

Do this by making the mangleNumber(APSInt) overload look like
the int64_t version. (The latter should probably just delegate
to the former).

Test from Evgeny Eltsin!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167599 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c2fc67e0cf7dd061fda1aa90d81668f3e070d4cb 08-Nov-2012 David Blaikie <dblaikie@gmail.com> Fix a source range regression in C++ new expressions with call initializers.

Introduced in r167507, discovered in review by Abramo Bagnara.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167597 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
23700f083fb72f5c6792e253f203a43aba3cef86 08-Nov-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Allow to pass from syntactic form of InitListExpr to semantic form (just as viceversa). No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167591 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
13fd684ee2c7578177b7c741e8eeec91ae628fcf 08-Nov-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed range of implicit MemberExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167581 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cb7b45e6d80c14d7d12db1eff17dc14b4ae8a35e 07-Nov-2012 Manuel Klimek <klimek@google.com> Create helper functions in StmtDumper for outputting the indentation, newlines, and brackets.

This is preparation for adding Decl dumping.

Patch by Philip Craig.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167509 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
530564196fe7e2e30fbc2b0edae45975447583e0 07-Nov-2012 David Blaikie <dblaikie@gmail.com> PR13552: Fix the end location of a CXXNewExpr.

Spent longer than reasonable looking for a nice way to test this & decided to
give up for now. Open to suggestions/requests. Richard Smith suggested adding
something to ASTMatchers but it wasn't readily apparent how to test this with
that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167507 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1e905da74dbfd353d77dfc548fc9d6ff420d515a 03-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove a const_cast by propagating constness to the member function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167357 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
54c45453359b47646a1c8d072b02f628b7e16eaa 01-Nov-2012 Richard Trieu <rtrieu@google.com> Fix the template type diffing to handle integral template arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167252 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
ef4b666e841e3917385892713612888ec6c3a056 01-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix an incorrect assert, the LHS can be an LValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167232 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e4a990f34904eb572c8d6aa1deef19465214359c 01-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167201 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e63aedd0cb064fc106636ad856cc0e645e6374ce 31-Oct-2012 Anna Zaks <ganna@apple.com> Address Jordan's review: comments, spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167091 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0a7dd835184343ec9149277b668ecdc5d49fe8b0 27-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Move two helper functions to AST so that sema can use them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166853 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8c7a185dd84a7d44b1c83f66fd60629372efd498 27-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Fix indentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166830 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f596760aab256d81a6823e731c988b35ef8197ad 27-Oct-2012 Douglas Gregor <dgregor@apple.com> When an externally-supplied record layout has a size that clearly
doesn't include padding up to the alignment of the record, take this
as a cue that the alignment of the record should (conservatively) be
set to 1. This is similar to other the other cues we use to determine
that the record has a lower alignment, e.g., that the
externally-supplied layout places fields at lower offsets than we
would. Fixes <rdar://problem/12582052>; test case in LLDB.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166824 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
11ce5fe7d8dda29f3d093e5759a7476b140e3241 26-Oct-2012 Douglas Gregor <dgregor@apple.com> Match up anonymous structs/unions in the ASTImporter. Previously, we'd
only actually get the answer right if there was only a single
anonymous struct/union at that level. This is part of
<rdar://problem/11904570>; the test will go into LLDB itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166781 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
47395d9360782a854594804aafe13ee877c4c0c4 26-Oct-2012 Douglas Gregor <dgregor@apple.com> Eliminate some longstanding FIXMEs regarding variadic templates in the
ASTImporter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166777 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
347f64feb4f144c97757b4d8469030e793dbb36e 26-Oct-2012 Douglas Gregor <dgregor@apple.com> In the ASTImporter, don't try to emit a diagnostic if we're not
allowed to complain about a failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166776 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
3304c436130edcc0e4c500a48f951249e242d9d0 25-Oct-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentDumper: reorder members and add a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166705 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
a45451d0959501c7d82582c61571a29cfdacdb0b 24-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Don't print scope qualifiers for references to a type defined locally in a function. Patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166617 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
6d919fb67bf6aa3db09608fb2948b558977c6929 24-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Address feedback from Eli Friedman on r166522.

In particular, we do want to warn on some unused cast subexpressions within
macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166534 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c7db84d0146a6f22b19949fb0128e2148aa92467 24-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Don't emit -Wunused-value warnings from macro expansions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166522 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
a7a38cb64e0781b8489332cedcfae9c8f95ba22e 23-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Fix pretty-printing pseudo-destructor calls. Patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166500 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
84c3b9745f813a784b5d8ce77f2785750523d9eb 23-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Fix -Wunused-value to not warn on expressions that have unresolved lookups due
to dependent arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166468 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
03e6fda61f48a6f11fb3c9459d5ac3d5b1db2809 22-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14141 (part of DR1351): An implicitly-deduced "any" exception specification
produces an exception of 'noexcept(false)' and is thus compatible with an
explicit exception specification of 'noexcept(false)'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166404 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
e1aebe1e3aabe955e3805e994647e5e31dcc4d8c 19-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Pretty-print a ParenListExpr in a variable initializer correctly. Patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166311 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8cfabf2cb278efc1f694f1d9aab76888a60ee3ac 19-Oct-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove const_casts by propagating constness down to called functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166287 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentDumper.cpp
820e9a7e29a01bd4a91537a6c6d4524834da622b 19-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1511: A const volatile global does not implicitly get internal linkage like a
const non-volatile global does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166269 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
25c9bc117d8825dce7911f6fddf3725d1914a7c6 18-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Use the type as written when pretty-printing C-style casts. Patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166237 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
262e60c1ccb5197e8e2ea49ada1196ed65183734 18-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> [doc parsing] use getParamName to access parameter
for current(rewritten) comment and getParamNameAsWritten
to access param name coming with \param marker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166231 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentDumper.cpp
ommentSema.cpp
eafa9d4d0d8b97f006dbd19c1e51d14663c8c5c3 18-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Remove check which incorrectly suppressed printing an identifier in type printing. Patch by Benoit Perrot.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166227 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
d03ef04ed32e9c9d7c714e8f1b31693c5b907dd2 18-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Fix AST pretty-printing for C++ new expressions with placement arguments with default values.

Based on patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166226 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
b36ea375e20f71df19c101fa2399b7ea3a607e04 18-Oct-2012 Anna Zaks <ganna@apple.com> Factor CollectClassPropertyImplementations out of Sema into AST

This would make it possible for the analyzer to use the function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166210 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b1502bcd67fb593a95cbf73ec3814f4015666da0 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1442: In a range-based for statement, namespace 'std' is not an associated
namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166194 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
278eafa2cd8296f8128d13c6466a0ace3d03a872 18-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed some corner cases due to implicit int TypeLoc and simplified the logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166174 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
49c67c4099fc238b49a849553f2275eb43ea6675 18-Oct-2012 Nick Lewycky <nicholas@mxc.ca> Put used="1" on all used declarations in the XML dumper. This allows us to
start seeing the bit so that we can find bugs and write tests for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166171 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
9be36ab27b874b404099650e0c29bc92f3c7662d 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1535: only potentially-evaluated typeid expressions are disallowed in constant
expressions, not *any* typeid on a polymorphic class type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166156 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1bfb00dabf83d8c8b95b7276b4c0ae3fd64832c8 17-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> [Doc parsing]: This patch adds <Declaration> tag to
XML comment for declarations which pretty-prints
declaration. I had to XFAIL one test annotate-comments.cpp.
This test is currently unmaintainable as written.
Dmitri G., can you see what we can do about this test.
We should change this test such that adding a new tag does not wreck
havoc to the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166130 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
eclPrinter.cpp
915c07db05375d563187f8b75fa4f766a5220b75 17-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Fix pretty-printing for variables declared in a condition. Patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166073 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
263366f9241366f29ba65b703120f302490c39ff 17-Oct-2012 Derek Schuff <dschuff@google.com> Add pnaclcall convention to Native Client targets.

Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
ype.cpp
ypePrinter.cpp
e54cba1ec0b0e498ee67d200289035797932e714 16-Oct-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Move some logic around to simplify the interface between the
front-end and the AsmParser. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166063 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d954ab47c681b8afc94bc3accbee708a05e6768e 16-Oct-2012 David Blaikie <dblaikie@gmail.com> Note deleted functions when dumping vtables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166056 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
b2e80013dbf316f83716a9d9cdc9a6ed5a5a8e2a 15-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed ClassTemplateSpecializationDecl source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165975 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ac8ea058febf6041871386d135ac2b955ab5d83a 15-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed FunctionTypeLoc range for trailing return type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165974 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
88d285cc0fc4ecdbc88d1779dcd2da968aa8b191 15-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> Fixes location of overriding declaration with no comment
of their own.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165972 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
6553c686cb419b22b4c79d05a422fb1e96f6e122 15-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration.
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165953 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentDumper.cpp
5f608aedb6c5d32d2f7c51f9354a75b21f1eeaee 13-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Make -mms-bitfields behave consistently.

Patch by Jeremiah Zanin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165849 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ecordLayoutBuilder.cpp
a143a9dcebea2ade67a2e9de1a939fbb70964015 13-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Fix -ast-print for uses of operator->.

Patch by Grzegorz Jablonski.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165832 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
71793ef10d3a0ab009a9c070ab413a6afc9f3f8c 12-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> Add dump support for comments coming from
overridden symbols. OK'ed off-line by Doug.
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165807 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
749ace614b6ea1ae11d194a60b18e1e43e1db243 12-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://12378793


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
omment.cpp
ommentSema.cpp
41c1f21c00d12f58a73199026b8041db9818988a 11-Oct-2012 Ted Kremenek <kremenek@apple.com> Teach GetBaseType() about BlockPointerTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165742 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
0142f0cf0859c1622f66edaaaafddcdfb8918376 11-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Handle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Grosser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165720 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
50d2b268d7a49719fe9dae89195ff809c4572dbf 11-Oct-2012 Jordan Rose <jordan_rose@apple.com> ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.

Currently, Objective-C does not support class properties, even though it
allows calling class methods with dot syntax.

No intended functionality change; purely optimization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165716 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c5f804636e367ef744fd24cf88f7c956a5af0434 11-Oct-2012 Nico Weber <nicolasweber@gmx.de> Add codegen support for __uuidof().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165710 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
bf967be66ea8c51b66c61659c23240f762a56dbe 10-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> [Doc parsing] This patch searches overridden objc/c++
methods looking for documentation on a particular base
class inherited by any method that overrides the base class.
In case of redeclaration, as when objc method is defined
in the implementation, it also looks up for documentation
in class/class extension being redeclared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165643 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
omment.cpp
ommentDumper.cpp
ommentSema.cpp
eclObjC.cpp
04bec39d61f2b392d798882c9141fecf3ca653c5 10-Oct-2012 Jordan Rose <jordan_rose@apple.com> Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.

Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl
(the latter by name) over to findPropertyDecl. This actually makes
-Wreceiver-is-weak a bit stronger than it was before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165628 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1e4691b9d8e1bdcc8ef62b323969d702c51b3c08 10-Oct-2012 Jordan Rose <jordan_rose@apple.com> Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.

This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165626 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
umpXML.cpp
eae5a820bced67465c8517793a1602dfaeed8a06 10-Oct-2012 Logan Chien <tzuhsiang.chien@gmail.com> Fix PR 11709: Change the definition of va_list to meet AAPCS requirement

AAPCS ABI Section 7.1.4 [1] specifies that va_list
should be defined as struct __va_list { void *__ap;};
And in C++, it is defined in namespace std.

[1] http://infocenter.arm.com/help/topic
/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

Patch by Weiming Zhao.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165609 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bc0a2bb8dc122f8daae890ec82cecfe2054859eb 09-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165538 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
740ae67dbf8dac44dbc8d6593a60f4f37a0a2aa5 09-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the functionality that looks for ObjC overridden methods from
ASTContext to the ObjCMethodDecl, and have the more generic
ASTContext::getOverriddenMethods() use the ObjCMethodDecl::getOverriddenMethods()
function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165518 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
5456b0fe40714a78cd0ba7c1a5b7dc34eda385af 09-Oct-2012 Douglas Gregor <dgregor@apple.com> When we load a function or method body from an AST file, we check
whether that function/method already has a body (loaded from some
other AST file), as introduced in r165137. Delay this check until
after the redeclaration chains have been wired up.

While I'm here, make the loading of method bodies lazy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165513 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
21c3607282550779c9ae5fe784928597807fd110 09-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the logic that searches for overridden methods from libclang to
ASTContext so that it can be widely available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165473 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
38eb1e161f602ee810dfb8a5a0d8462572f22689 09-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When storing the C++ overridden methods, store them once for the
canonical method; avoid storing them again for an out-of-line definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165472 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d69f31ce4c33577396dbdc8f4f149baf0e68b68c 09-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> In VarDecl::getSourceRange() make sure to check that the source location
of the initializer is valid before using it.

Fixes rdar://12455002&12449015 where local variables of objc objects in ARC mode
were not annotated because of the ImplicitValueInitExpr initializer having invalid
source range, resulting in the SourceRange of the VarDecl having invalid end location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165456 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0bea86307eb8c16339315a1e261fc490eb505c5b 08-Oct-2012 David Blaikie <dblaikie@gmail.com> StringRef-ify Binary/UnaryOperator::getOpcodeStr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165383 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d190057934331390ff67ebf51d66186dd5e392f0 06-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Expose __builtin_bswap16.

GCC has always supported this on PowerPC and 4.8 supports it on all platforms,
so it's a good idea to expose it in clang too. LLVM supports this on all targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165362 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1e5101e1e52729564b6fc8d7bf146cef33bc31ca 06-Oct-2012 Jordan Rose <jordan_rose@apple.com> ParentMap: Restore the ability to update an existing map.

The Clang ASTs are a DAG, not a pure tree. However, ParentMap has to
choose a single parent for each object. In the main (only?) cases in
which the AST forms a DAG, it protects from multiple traversal by using
OpaqueValueExprs. Previously, ParentMap would just unconditionally look
through all OpaqueValueExprs when building its map.

In order to make this behavior better for the analyzer's diagnostics,
ParentMap was changed to not set a statement's parent if there already
was one in the map. However, ParentMap is supposed to allow updating
existing mappings by calling addStmt once again. This change makes the
"transparency" of OpaqueValueExprs explicit, and disables it when it
is not desired, rather than checking the current contents of the map.

This new code seems like a big change, but it should actually have
essentially the same performance as before. Only OpaqueValueExprs and
their users (PseudoObjectExpr and BinaryConditionalOperator) will
have any different behavior.

There should be no user-visible functionality change, though a test
has been added for the current behavior of BinaryConditionalOperator
source locations and accompanying Xcode arrows (which are not so great...).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165355 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
abd5fa28199bab926ae983afa511e5a195ac131a 05-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Added forgotten break.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165298 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
59c0a818a79be850f7ae8fdafd57a1710e5b809a 04-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed FunctionTypeLoc source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165259 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
acf0bb4f49059e444dbedeef8188c9bfb6ead8c4 04-Oct-2012 Nick Lewycky <nicholas@mxc.ca> Add missing comment for mangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165202 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
7b2f93c8b63f59d429731aaf16d14f0cd32f98c8 03-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> CodeGen: Fix a silly typo when emitting subs of block addresses.

Part of PR14005.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165117 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
385b91f2f49169442067ff6406b370618d11a776 03-Oct-2012 Nico Weber <nicolasweber@gmx.de> When mangling an APSInt with the ms abi, make sure to look at all nibbles.

Currently, it's ignored if the number of set bits isn't divisible by 4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165116 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c950bc92e69910b667d7a3dea24e4afc8abdc7e5 03-Oct-2012 Nico Weber <nicolasweber@gmx.de> While I'm here, resync a %select with the enum definition it selects on.

* nullptr used to be mapped to ERROR, now mapped to nullptr
* integral was missing
* expressions now have their own error message, so they won't reach
this. Map them to ERROR.

Note that clang usually crashes before emitting this diagnostic anyway
(see PR13984), so this change alone doesn't have an observable effect.
It makes the code more correct though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165095 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
2225556de7186e9b22cd4da4e7d1f5c26daae8da 03-Oct-2012 Nico Weber <nicolasweber@gmx.de> Move expression mangling in the microsoft mangler to its own function.

This matches what's done in ItaniumMangle and makes it a bit easier
to implement mangling for more expressions. Also use the slightly nicer
"not yet implemented" error message from there.

No functionality change (except for the different error message).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165093 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
88a374ad85eec5a47bd172aa7b765d24fdf01690 03-Oct-2012 Nico Weber <nicolasweber@gmx.de> Replace a default: with an explicit list of cases. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165091 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
d3d981627c375b187f33cc92a034a77ac329ec47 03-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165084 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
041ce8e00afd1185549a25d5c2b97d219ae032d9 03-Oct-2012 Jordan Rose <jordan_rose@apple.com> Teach getCXXRecordDeclForPointerType about references.

Then, rename it getPointeeCXXRecordDecl and give it a nice doc comment,
and actually use it.

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165077 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
be9af1288881110e406b87914162eaa59f1e5918 02-Oct-2012 Lang Hames <lhames@gmail.com> Add FP_CONTRACT support for clang.

Clang will now honor the FP_CONTRACT pragma and emit LLVM
fmuladd intrinsics for expressions of the form A * B + C (when they occur in a
single statement).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
01cad02220180b9646525295f502c00c64a172d0 01-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix treatment of case which came up on std-proposals@: 'void' is permitted in core constant expressions, despite not being a literal type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164968 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bbff82f302a1dd67589f65912351978905f0c5a7 01-Oct-2012 Anna Zaks <ganna@apple.com> Move isObjCSelf into Expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1952354bd376062c3ab3d328c0fc6c36530c9309 29-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Move the 'find macro by spelling' infrastructure to the Preprocessor class and
use it to suggest appropriate macro for __attribute__((deprecated)) in
-Wdocumentation-deprecated-sync.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164892 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ommentSema.cpp
awCommentList.cpp
3c88301b551add30e9a4b59af325534643dc4b21 28-Sep-2012 Richard Trieu <rtrieu@google.com> Update template type diffing to handle qualifiers. Differing qualifiers will
now be printed with highlighting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164843 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
70d38f3179251bb3e7253a52bf54f8fa2314590a 28-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by Tijl Coosemans!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164841 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
65eaecf09ea407626fa5b88178b579f2ce5f4177 28-Sep-2012 Richard Trieu <rtrieu@google.com> Clean up part of template type diffing. Moved repeated code to separate
functions. Reworked one of the conditionals. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164839 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
919a2d7a63eec8f6e1e95e85306e0dc21ef91883 28-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Fix a regression from r164656.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164804 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
ad0ce53c8219456938405b84c5d13341a47e3d94 27-Sep-2012 Anna Zaks <ganna@apple.com> Make getDefaultSynthIvarName() a member of ObjCPropertyDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164789 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
023bd7d6ff3bf9ad6c9fa2e404924195e4f31584 27-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> Pass PrintingPolicy by reference, copying it isn't cheap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164781 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
d7a6b1640e565487d163023a6a2e83f55476ae96 26-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Fix the AST representation for non-type template arguments to encode
enough information so we can mangle them correctly in cases involving
dependent parameter types. (This specifically impacts cases involving
null pointers and cases involving parameters of reference type.)
Fix the mangler to use this information instead of trying to scavenge
it out of the parameter declaration.

<rdar://problem/12296776>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164656 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ecl.cpp
umpXML.cpp
taniumMangle.cpp
tmtProfile.cpp
emplateBase.cpp
ypeLoc.cpp
073819806ba2441e2a3e550107f1e756a6ee3ad0 26-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationType
for a type alias template can appear as sugar at any level of desugaring, just
like a TypedefType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164655 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d498f384d154e154e939a9c764054cd4a8d76819 25-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve upon r164450 and localize the logic of updating the type of
a function decl inside the ASTNodeImporter::VisitFunctionDecl function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164625 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
9653ab52b90e5f4ebf1f5ae842e8e5cbbcf5c1be 25-Sep-2012 John McCall <rjmccall@apple.com> Implement Mike Herrick's proposed noexcept mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164593 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
ea30e2f8667668173cf7433c3c80cf603bd922a4 25-Sep-2012 John McCall <rjmccall@apple.com> Add the Microsoft __is_interface_class type trait.
Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164591 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
6319917b5021e9602389b49ca4f245d235e9b90a 25-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Handle C++ functional casts in a similar way to C-style casts in
unused expression warnings. <rdar://problem/12359208>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164569 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0bd9838751384181ff387f2fb346896792b89617 22-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment sema: warn when comment has \deprecated but declaration does not have a
deprecation attribute ('deprecated', 'availability' or 'unavailable').

This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it
can be turned off easily while leaving other -Wdocumentation warnings on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164467 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
f0fdefc13a58db2a8b32bb47ac23bc16efad6fda 22-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When importing a FunctionProtoType::ExtProtoInfo, its ExceptionSpecDecl can point to the
FunctionDecl that we are importing the FunctionProtoType for, in which case we'll have
infinite recursion when importing.

Initially create a FunctionProtoType with null ExceptionSpecDecl/ExceptionSpecTemplate and
update the type in ASTNodeImporter::VisitFunctionDecl after the FunctionDecl has been created.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164450 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
6ddca84d10cab043cf34e3f77ad2379cebd96af6 22-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix build errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164417 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ac70c1abbf97127ae33421332bd926232079b49e 22-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [AST importer] Do a correct import of a FunctionProtoType::ExtProtoInfo, don't pass
nodes from the imported ASTContext.

rdar://12348924

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164416 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
a0a3c90abde4b52b96ce70bd062d81041092900c 20-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> StmtPrinter: Print floating point literals with the right suffix to disambiguate them from integers.

Based on a patch by Olaf Krzikalla, UDL fixes by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164303 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
8da8a660128180a31479216111ff9b19b11c95b4 19-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Add the TypeSourceInfo for the lambda call operator to the lambda's
definition info; it needs to be there because the mangler needs to
access it before we're finished defining the lambda class.
PR12808.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164186 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
taniumMangle.cpp
ec504e0d677594fe975e29b25d6d47be54038baf 15-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: don't treat typedef to a typedef to a function as a
'function-like' type that can be annotated with \param.

Thanks to Eli Friedman for noticing!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163985 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
f56faa01936b9cf909623d7f06e3c2569ca4a78e 15-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163983 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
66dfef17b8da7c89e20f32d4f0f4a04691b79768 14-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> In StringLiteral::setString make sure that we copy the number of
bytes of the buffer and not the size of the string, otherwise we
may overwrite the buffer if there is a mismatch between the size
of the string and the CharByteWidth, and assertions are disabled.

The bug where this could occur was fixed in r163931.
Related to rdar://12069503

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163939 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8c05da3fd8db98af482826ba059ab1ad6d58010f 14-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: don't parse comment marker followed by a digit as a command
since no Doxygen command starts with a digit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163909 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
210d8aa7162e928d81d3f284b5ca7bc6bb3a9ba7 14-Sep-2012 Stephen Hines <srhines@google.com> Forgot about CommentHTMLTags.td, which I had a stale copy of.

Change-Id: I94ab4bb47d1dc494bea3ce12534cd18004715f2b
ndroid.mk
abcf0dccc9cd4c802f4e7797bf452c6808d2226f 13-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: handle \deprecated command. It is a block command, but it
should be fine to use it without further explanations in the attached
paragraph, so the warning about empty paragraph was turned off for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163836 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
cca178014377d5ee756afba47edb93d76a100b06 12-Sep-2012 Ted Kremenek <kremenek@apple.com> Convert a few more getAs cases to castAs where we immediately call a member function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163684 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
9a4db032ecd991626d236a502e770126db32bd31 12-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13811: Add a FunctionParmPackExpr node to handle references to function
parameter packs where the reference is not being expanded but the pack has
been. Previously, Clang would segfault in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163672 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
b0b8a96df25660cbdbf35d23c3ff5887c33f82f9 11-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: handle non-builtin commands correctly. After semantic
analysis registers a command, it becomes a "known" command for the lexer, since
it has an ID. Having this freedom of choice to register a command is a good
thing since BriefParser does not need this.

But the parser should still invoke the correct semantic analysis method
(actOnUnknownCommand) in this case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163646 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
ommentParser.cpp
ommentSema.cpp
a13cdf4780a885c0d3726fe8d3562b9bc770b7ec 11-Sep-2012 Douglas Gregor <dgregor@apple.com> Switch a SmallPtrSet/SmallVector pair over to SetVector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163600 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
e5cc4c967178669dd19832bc0fb03b293d5d969f 11-Sep-2012 Stephen Hines <srhines@google.com> Merge up through LLVM r163557.

New CommentCommandInfo and CommentHTMLTagsProperties targets for TableGen.

Updated Android.mk source files for AST, StaticAnalyzer/Checkers,
StaticAnalyzer/Core, driver, and TableGen.

Split Rewrite/Android.mk into Core and Frontend sub-libraries.

Change-Id: Ia114939e242a79570c41a519f4f3cc712a0ed9a8
ndroid.mk
116bb09882bc1c9281cd84dd07496201feb18d18 11-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Fix buffer overflow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163578 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
9f0b1324a5352713337c75ef4a5acffd96609c6c 11-Sep-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-2012_09_10
22cd9ac42a730a7776e323bc1210df2d457d8377 11-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] When loading fields from external storage make sure to also
load in the IndirectField declarations as well.

Field designators in initializer lists depend on traversing the fields
decl chain to find the indirect fields.

Fixes rdar://12239321

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163552 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1ad23d62007162df82b58bca31b4aa277a5f6586 10-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove redundant semicolons which are null statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163546 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
eclBase.cpp
eclPrinter.cpp
e4330a302ac20b41b9800267ebd4b5b01f8553f8 10-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.

Now we have a list of all commands. This is a good thing in itself, but it
also enables us to easily implement typo correction for command names.

With this change we have objects that contain information about each command,
so it makes sense to resolve command name just once during lexing (currently we
store command names as strings and do a linear search every time some property
value is needed). Thus comment token and AST nodes were changed to contain a
command ID -- index into a tables of builtin and registered commands. Unknown
commands are registered during parsing and thus are also uniformly assigned an
ID. Using an ID instead of a StringRef is also a nice memory optimization
since ID is a small integer that fits into a common bitfield in Comment class.

This change implies that to get any information about a command (even a command
name) we need a CommandTraits object to resolve the command ID to CommandInfo*.
Currently a fresh temporary CommandTraits object is created whenever it is
needed since it does not have any state. But with this change it has state --
new commands can be registered, so a CommandTraits object was added to
ASTContext.

Also, in libclang CXComment has to be expanded to include a CXTranslationUnit
so that all functions working on comment AST nodes can get a CommandTraits
object. This breaks binary compatibility of CXComment APIs.

Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't
need TU parameter anymore, so it was removed. This is a source-incompatible
change for this C API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163540 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
omment.cpp
ommentBriefParser.cpp
ommentCommandTraits.cpp
ommentDumper.cpp
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
awCommentList.cpp
4a66557c297e1e5a71a3da4ceca1969800e7de70 09-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> RawCommentList: don't copy the whole new RawComment to LastComment each time.
We just need a single SourceLocation for previous comment end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163482 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
762f159c3295552f1f3e5e1af8b66385bfaed786 09-Sep-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Added missing const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163477 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e75bb61f1b876afaa6b2f4a2b860c2889ea1d050 09-Sep-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed support for disabled wchar_t and added an appropriate test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163476 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6964b3f80ce1ba489e7e25e7cd58062699af9b0c 07-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR9023: A template template parameter whose template parameter list contains an
unexpanded parameter pack is a pack expansion. Thus, as with a non-type template
parameter which is a pack expansion, it needs to be expanded early into a fixed
list of template parameters.

Since the expanded list of template parameters is not itself a parameter pack,
it is permitted to appear before the end of the template parameter list, so also
remove that restriction (for both template template parameter pack expansions and
non-type template parameter pack expansions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163369 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
31ba6135375433b617a8587ea6cc836a014ebd86 06-Sep-2012 Roman Divacky <rdivacky@freebsd.org> Dont cast away const needlessly. Found by gcc48 -Wcast-qual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163325 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
tmtDumper.cpp
255793d35bd5aa13ab2fd0b22f66b8e34698d8e0 05-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c++11: c++11 does not change pod-ness when
type is an unqualified objc pointer in arc. Treat it just
as being treated in c++98. This fixes a bogus vararg warning
with -std=c++11. //rdar://12229679


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163236 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
568ba871bbac959029671b81f8e531edb7e0d7d6 04-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Revert r163083 per chandlerc's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163149 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
679fc9314c2bde5eb6bea33c790d1a035461e618 04-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Revert r163078 per chandlerc's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163145 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
12603e259170cd02084f51b17b43e9c9c4fce354 04-Sep-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Fix an illegal index and an 80-column violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163143 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a04ca5c4e091f567230fc95c6b2715576ad0893b 03-Sep-2012 Timur Iskhodzhanov <timurrrr@google.com> Fix PR13444 - wrong mangling of "const char * const *" and friends with "-cxx-abi microsoft"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163110 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
5be92de217a1940d0e109abd0f401df4480c1a4b 02-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Implemented parsing and AST support for the MS __leave exception statement. Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163083 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
f712c48ce80763f3c0bbc2e1b0afe6ed3b5b88cb 02-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Added a diagnostic for mismatched MS inheritance attributes. Also fixed the incomplete type member pointer size calculation under the MS ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163078 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCXXABI.cpp
17d35c36fbae764fcd68fa8b31624078a033aabc 01-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Normalize line endings of r163013 (part 2).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163032 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
icrosoftMangle.cpp
7aaa167abba495ecb0e99eb4f2fa155cf28c798d 01-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove windows line endings.

While there fix a dead assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163031 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6666ed4ed2e2bc13da5ac5d0a4947019137d45be 31-Aug-2012 Joao Matos <ripzonetriton@gmail.com> Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
icrosoftMangle.cpp
ecordLayoutBuilder.cpp
ype.cpp
af503a6f218cbef8704609812668360b0cbd0b60 31-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove the useless CommentOptions class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162986 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
awCommentList.cpp
c24a76e376a767edc14e60bed716396a84cb127a 31-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment HTML tag name machers: move from StringSwitch to an efficient
TableGen-generated string matcher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162969 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ommentLexer.cpp
ommentSema.cpp
a6c66cedc022c9e5d45a937d6b8cff491a6bf81b 31-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Change the representation of builtin functions in the AST
(__builtin_* etc.) so that it isn't possible to take their address.
Specifically, introduce a new type to represent a reference to a builtin
function, and a new cast kind to convert it to a function pointer in the
operand of a call. Fixes PR13195.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162962 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
SAPI.cpp
ype.cpp
ypeLoc.cpp
482466b76174738def05d4ae3c3240bc83b57426 31-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Switch a couple getAs uses to castAs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
961713055e636170da59d7006a878cb4ba518a5d 30-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: clang must implicitly convert
__objc_yes/__objc_no to (BOOL)1/(BOOL)0 when
BOOL is declared; otherwise it resorts to
default of 'signed char'. This is important to
selecting the correct Numeric API numberWithBool:
Can't have a clang test for this. Will checkin and
executable llvm test. // rdar://12156616


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162922 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c586d5dd7a997321ea96d1d28213315f86778fc8 30-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Fix a crash in type merging with enum types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162886 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
48def65d1cfbd020c5d4a7e542a00d63808c6060 29-Aug-2012 Hans Wennborg <hans@hanshq.net> Move TLS check from LValueExprEvaluator::VisitVarDecl to
CheckLValueConstantExpression.

Richard pointed out that using the address of a TLS variable is ok in a
core C++11 constant expression, as long as it isn't part of the eventual
result of constant expression evaluation. Having the check in
CheckLValueConstantExpression accomplishes this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162850 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
29f431b3e310ae6bd367dccf5a2794ad1cac9592 29-Aug-2012 Hans Wennborg <hans@hanshq.net> Fix r162835 as per Richard's comments.

VisitVarDecl should return Error(E), and we should test that the address
of a TLS var can't be used as a constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162837 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ae7a66f44edebe14d0499d790e91e3ef57e1f70e 29-Aug-2012 Hans Wennborg <hans@hanshq.net> The address of a TLS var is not compile-time constant (PR13720)

This makes Clang produce an error for code such as:

__thread int x;
int *p = &x;

The lvalue of a thread-local variable cannot be evaluated at compile
time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162835 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
00d16371f581af9ac8ac5d9ab2386cb2cfed61c1 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Have generateAsmString() return the AsmString computed by Sema.
We still need to translate the string, but this at least gets us one step
closer to using the more general EmitAsmStmt() codegen function. No functional
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162785 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
89fb6d7eba51c7864ec544e07accd23b24057122 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add constraints to MSAsmStmt. We don't currently compute
the constraints, so in the interim we speculatively assume a 'r' constraint.
This is expected to work for most cases on x86.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162784 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
92527012d4b8bc0c3d49acc471ebe5590fe97fba 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use dyn_cast<> here to simplify logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162773 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
aba59aafd47ded6d483894cd6ab7bff494eb7587 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Make the AsmStmt class non-virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162768 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
4c3b8a3ed28c52dc56d3a1b9670d71e5f7070c62 28-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix a -Wdocumentation warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162730 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c88c6a490ee946d80e306efaf83ae41b8f002741 28-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Merging consecutive comments: be more conservative.
Should fix part 2 of PR13374.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162723 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
c4fb221120f2c8b158082d0b2b9daa29d2f65d5b 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Hoist more common code into the AsmStmt base class. Add stubs
with FIXMEs for unimplemented features. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162716 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
33f0558f75f70061707d1388e305b8f92f4e55de 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add virtual function, getClobber, that returns a StringRef.
More work towards unifying asm stmt codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162712 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
5c7f59445ae68109c7ffee731aca2ce32db587c7 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Rename getClobber to getClobberStringLiteral. No functional
change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162710 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtProfile.cpp
da083b2ce8db27ce6e508cb77cb12c0fc8b7cad9 27-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Rename GenerateAsmString to generateAsmString to conform with
coding standards. Also, add stub for MSAsmStmt class as part of unifying
codegen logic for AsmStmts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162696 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
066ef86b435a5c567778c25fc201a2831049ad4b 27-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Hoist common logic into the AsmStmt base class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162692 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
728581e7702cafe32cc9e1b5b61a15f5042ce189 27-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a new base class, AsmStmt, for the GCCAsmStmt and MSAsmStmt
classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162691 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
efe97d67399a3fd616dd249743d1f848d6ad6636 27-Aug-2012 John McCall <rjmccall@apple.com> Use cast<> instead of static_cast. Patch by Timur Iskhodzhanov!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162683 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
2612e9f1d0a356a303097bea9faf53fdb213c50c 25-Aug-2012 John McCall <rjmccall@apple.com> Fix the mangling of function pointers in the MS ABI.
Patch by Timur Iskhodzhanov!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162638 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
df5faf5e7ae6823d0af0b801c4ac26d47f2cee97 25-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162632 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
9edd2c8a2ff6c6326ff2d5b081929e4baaa798ed 24-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: for unresolved parameters, do not suggest parameter fixit
with parameter that is documented.

Fixes PR13670, <rdar://problem/12155840>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162570 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
be3ace834ee7438915e73d2115365d57d03ceb99 24-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Refactor code. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162568 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
3b6bef9a213249c6ab6d67c07b1ac6380961be3e 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Push ArrayRef through the Expr hierarchy.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162552 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
8eba6f194484c38ed724375aeab27de556113a84 23-Aug-2012 Stephen Hines <srhines@google.com> Add new files for merge to upstream r162325.

Change-Id: I44af8265445bd67d7985164e2e3117b8c3d8d3c1
ndroid.mk
80ea4bc944eb01c220eeaa004b21ad709ba928e1 24-Aug-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: If47d0d39459760017258502b4d9e859ac36a273b
633abb0ea01d37ab9c8e4ce1ee9e48894a12dfca 24-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST. Next we need
generate the Input/Output expressions using Sema::ActOnIdExpression().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162509 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
70ff1091315c60fed68d7197c637ec8c588e67a1 24-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment semantic analysis: treat function typedefs as functions so that one can
use \param and \returns in documentation.

Fixes PR13533.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162507 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
7dd88609b6774152993bee8bed189aafc4c6f61a 24-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to decls: since it was decided that Decl::isImplicit should
not be set for implicit instantiations, remove the FIXME. This should be the
last bit for PR13634. The actual fix happened in r162238.

Motivation: it might be misleading to mark implicit instantiations as
Decl::isImplicit = true. Because then, in order to be consistent, we should
mark all instantiated members as implicit. But the user did actually type the
declaration for the member, but the compiler played with it a little bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
890f0f1612b0028b8b16730ae7ed07e295600c76 23-Aug-2012 Ted Kremenek <kremenek@apple.com> Change a bunch of cases where we do "getAs<...>->doSomething()" to
"castAs<...>->doSomething()". The analyzer was flagging these
as potential null dereferences, which is technically true. The
invariants appear to be that these casts should never fail, so
let's use castAs<> instead and avoid a runtime check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162468 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
xprConstant.cpp
925d58c20aba52ef3901db7402a2067266ed12ea 23-Aug-2012 Douglas Gregor <dgregor@apple.com> array_pod_sort on the addresses of declaration pointers leads to
inconsistent ordering of results; instead, use use SmallPtrSet to
eliminate duplicates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162429 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
834a5bd311b4a32f89937ca5b6dd2b4111891859 23-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: parse "<blah" as an HTML tag only if "blah" is a known tag
name. This should reduce the amount of warning false positives about bad HTML
in comments when the comment author intended to put a reference to a template.
This change will also enable us parse the comment as intended in these cases.

Fixes part 1 of PR13374.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162407 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
4b41c65feb93eeb6f6d27b49a2045ea1b72de9d1 22-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> ASTContext::getCommentForDecl: add comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162374 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2125c9010e259548a8c476fa998a561889555c95 22-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: when documentation is requested for an
implicit instantiation, look for documentation attached to the template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162371 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
54c2f88540994726032bfbf1d087bb67767432af 22-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix typo in debug method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162352 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
0ac4ec7f1c79a13f813fa644997a4b89ac0ba3aa 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentBriefParser: allow paragraphs to be separated by line of whitespace.
Skip paragraphs that contain only whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162315 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
a796b6c4b99116ca31e6e61d8765b321678d580e 21-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Switch some realignment calculations over to llvm::RoundUpToAlignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162297 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2e0b8d9c0b16c4f3e3bed992205ce43a0908915d 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> DeclPrinter, terse mode: don't print function bodies


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162294 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
d1fc82efd53ffda30f4f16041399d78f3bf0705f 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutput
to reflect the intention, not the implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162293 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
88d2f678e70ab9360f09f3534d9223e6ec20f129 21-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix alignment of array of VarDecl* following array of unsigned in LambdaExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162255 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
929bbfb0b69165b55da3c56abf22aa10e20dadc6 21-Aug-2012 John McCall <rjmccall@apple.com> When performing a trivial copy of a C++ type, we must be careful not
to overwrite objects that might have been allocated into the type's
tail padding. This patch is missing some potential optimizations where
the destination is provably a complete object, but it's necessary for
correctness.

Patch by Jonathan Sauer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162254 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
49795ae2c7cbb0845ed07b6626ac24275234e3d1 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> DeclPrinter: add terse output mode and lots of tests

Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output
from DeclPrinter. The motivation is to use DeclPrinter to print declarations
in user-friendly format, without overwhelming user with inner detail of the
declaration being printed.

Also add many tests for DeclPrinter. There are quite a few things that we
print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests
check our output against incorrect output, so that we can fix/refactor/rewrite
the DeclPrinter later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162245 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
dce750b15eb5eb797ac9bbea118333d7d1896831 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: ignore implicit decls. Decl::isImplicit()
does not return true for all implicit decls currently.

This should fix PR13634 for now, but Decl::isImplicit() should be fixed, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162238 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f0a26499c0ef62c7940b596be092315922a46ab7 20-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Fix InitListExpr::isStringLiteralInit so it handles various edge cases correctly. PR13643.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162226 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
df4ee102aa909e2f40c294701bfeffac63e8d29b 20-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove old cruft now that MS-style asms their own code path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162210 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
54c86f746f9e4431fa3855fe7a92c6827a357e85 18-Aug-2012 John McCall <rjmccall@apple.com> When mangling a negative number, remember that negating it does not
always yield a positive number. Just print the negated result as an
unsigned number.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162163 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
1a30edb995924b007044ca7abd97d7fbea22007f 17-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix misaligned allocation of TemplateParameterList objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162056 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
81c53b461951ef5de8ea3d55d06aed8af8d81ac4 16-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentCommandTraits: rename BeginName -> StartName for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162044 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
1599eac40a3b28de0824013dc2fb90551dfa01b0 16-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: parse the comment in context of the
declaration it was attached to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162033 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d1420c6fa788669e49f21e184927c7833881e399 16-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Store SourceManager pointer on PrintingPolicy in the case where we're dumping,
and remove ASTContext reference (which was frequently bound to a dereferenced
null pointer) from the recursive lump of printPretty functions. In so doing,
fix (at least) one case where we intended to use the 'dump' mode, but that
failed because a null ASTContext reference had been passed in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162011 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STDiagnostic.cpp
eclPrinter.cpp
tmtPrinter.cpp
0dae729a69c4fccc38c97d5dd44f7b20bb20de1c 16-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't constant-fold when pretty-printing alignment attribute. This fixes a
potential crasher -- Context is sometimes a null reference (!!) here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162007 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
2f47cab092cd2dcbfe7e003fa865499caf198dc2 16-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix misaligned allocation of QualifiedTempateName and DependentTemplateName.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162005 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
058ab170a5b8597f32c3f343a1e9de2cd7b05848 16-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add inputs and outputs to AST. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162000 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
4e79fdfe22db1c982e8fdf8397fee426a8c57821 15-Aug-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Correctly devirtualize virtual method calls in constructors.

This is the other half of C++11 [class.cdtor]p4 (the destructor side
was added in r161915). This also fixes an issue with post-call checks
where the 'this' value was already being cleaned out of the state, thus
being omitted from a reconstructed CXXConstructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161981 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7bd092b054444e9800e8de1d8d71c408dbdc8ead 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add the left brace source location and improve the pretty
printer. Patch by Enea Zaffanella <zaffanella@cs.unipr.it>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161958 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
47467041f629aa287a988be3073e230de3e56a3c 15-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Use the right alignment when allocating NestedNameSpecifier objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161920 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
97f6026f460c3aaa250fc9dcd7c2b8b6c1f3ba69 15-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix overallocation and underalignment of ASTTemplateArgumentListInfo objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161918 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
92570bd1597f355d5673a94960323f81d99c4921 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove the last bits of LineEnds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161904 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
c41ace950dcf2254c9aa48e73647b89c35109f80 14-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to redeclarations: fix wrong assumptions

The reason for the recent fallout for "attaching comments to any redeclaration"
change are two false assumptions:
(1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y'
where we want the comment to be attached to both X and Y);
(2) the whole redeclaration chain has only a single comment (obviously false, the
user can put a separate comment for each redeclaration).

To fix (1) I revert the part of the recent change where a 'Decl*' member was
introduced to RawComment. Now ASTContext has a separate DenseMap for mapping
'Decl*' to 'FullComment*'.

To fix (2) I just removed the test with this assumption. We might not parse
every comment in redecl chain if we already parsed at least one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
awCommentList.cpp
42c72c258e08ca79c9267346b4badcddd8fcd001 14-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Do NOT use inline functions with LLVM_ATTRIBUTE_USED.

The function will be emitted into every single TU including the header!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161872 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
umpXML.cpp
7657fd7d34426e7df6e84aa6e3d73be532a75f78 13-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13570: When an unresolved overloaded call appeared in a dependent context, we
forgot to set it as being instantiation-dependent as well as being type- and
value-dependent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161791 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0d729105ecb50a7e3cbe6e57c29149edfa5cf05a 13-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Factor out computation of whether a typeid's expression is potentially
evaluated into a CXXTypeid member function. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161779 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
cd81df2dcff4e13eea6edfbfd52a4458d978d174 13-Aug-2012 Douglas Gregor <dgregor@apple.com> When looking for the comment associated with a declaration, adjust the
'templated' declaration for a function or class template to refer to
the function or class template itself, to which the documentation will
be attached. Fixes PR13593.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f50555eedef33fd5a67d369aa0ae8a6f1d201543 11-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: find comment attached to any redeclaration

Not only look for the comment near the declaration itself, but also walk the
redeclaration chain: the previous declaration might have had a documentation
comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161722 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
awCommentList.cpp
33c72e1c0bbb477cf36dd7becd933b860c42ed8c 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Avoid extra allocations by making this an array of StringRefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161703 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
e790bc32ca3eb7cc396b45071d7987776e965ed7 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Fix a memory leak introduced in r161686.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161698 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
4399ea9d473365224d9e4db0cd94aab849eb59b7 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add clobbers to AST representation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161686 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
4ef832ffc1147ce2f9777f9fad650cb3139a1d00 10-Aug-2012 David Blaikie <dblaikie@gmail.com> Provide isConst/Volatile on CXXMethodDecl.

This also provides isConst/Volatile/Restrict on FunctionTypes to coalesce
the implementation with other callers (& update those other callers).

Patch contributed by Sam Panzer (panzer@google.com).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161647 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
umpXML.cpp
xpr.cpp
xprCXX.cpp
cace2103efe3449c406bcdfd4874dfb1e94c811a 09-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use StringRef here, per Jordan's suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161619 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
62290ae569016345b79d4e11dd93abc300e5a681 09-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment to HTML and XML conversion: ignore commands that contain a declaration
as their argument. For example, \fn, \function, \typedef, \method, \class etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161601 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.cpp
7b7af0201b0f0bac47663b4daf530afd8df85595 09-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Add new file CommentCommandTraits.cpp to CMakeLists.txt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161551 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
aa58081902ad31927df02e8537d972eabe29d6df 09-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: extract TableGen'able pieces into new CommandTraits class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161548 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ommentBriefParser.cpp
ommentCommandTraits.cpp
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
awCommentList.cpp
62f22b87801882646418bae85111e565f7a53ddb 08-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161518 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
2aa800a955132d83a666bcd52d3d59d09cffc079 08-Aug-2012 Jordan Rose <jordan_rose@apple.com> Constify CXXRecordDecl::isVirtuallyDerivedFrom.

No functionality change. A couple ugly const_casts because the ancestor
search code is used for other purposes as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161509 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
3a32c9c565f970fd319b97a6056a4725cfa4f0f5 08-Aug-2012 Chad Rosier <mcrosier@apple.com> Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161503 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
50800fc551ac6b8a95cca662223e7f061bbd169a 08-Aug-2012 David Blaikie <dblaikie@gmail.com> Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161501 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
15631b4d354d7fe99ad018de82a9d636d4bd8e92 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Fix a -ast-dump crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161472 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
0e2a86802be7f888c29adf09fe23ad35bc6fb35d 08-Aug-2012 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161455 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
cff339a60a571a606a7510548f661dc6a719368d 07-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: DeclInfo: add a special kind for enums.
Comment XML: add a root node kind for enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161442 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
dd7b803e6ce5b8e61cf3b14af2c57199e5e991d9 07-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: treat enumerators as "variables" in DeclInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161435 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
60b70388e43d146d968a1cc0705b30cb2d7263fe 07-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update documentation of HasSideEffects to match its callers' expectations, and
update implementation to match. An elidable, non-trivial constructor call is a
side-effect under this definition, but wasn't under the old one, because we are
not required to evaluate it even though it may have an effect.

Also rationalize checking for volatile reads: just look for lvalue-to-rvalue
conversions on volatile glvalues, and ignore whether a DeclRefExpr etc is for
a volatile variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161393 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8ae4ec28451a16a57718286da3e476fc2f495c3f 07-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Teach Expr::HasSideEffects about all the Expr types, and fix a bug where it
was mistakenly classifying dynamic_casts which might throw as having no side
effects.

Switch it from a visitor to a switch, so it is kept up-to-date as future Expr
nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not
really related to constant expression evaluation.

Since we use HasSideEffect to determine whether to emit an unused global with
internal linkage, this has the effect of suppressing emission of globals in
some cases.

I've left many of the Objective-C cases conservatively assuming that the
expression has side-effects. I'll leave it to someone with better knowledge
of Objective-C than mine to improve them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161388 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
79efe24e125553b7fd4a35ffb3b7a45c4f1e661a 07-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Stmt destructors are never called, so allocate the AsmToks using
the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161373 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
8a90393e7ca61d9753cb9a2f2bc64b2669393ffb 07-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: fix crash on \tparam followed immediately by another block
command, for example: \tparam\brief.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161361 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
04bf29eb1b197e0a103139ab5d63b0b97432f004 06-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: DeclInfo: collapse a bunch of boolean flags into an enum.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161352 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentSema.cpp
2b1b025fa6e848ec36c0554924d7d63342aa80e4 06-Aug-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Improve arrow locations for PseudoObjectExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161350 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
8f726de55412870ef70e788b852c6cc50873e15b 06-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Pass Tokens to Sema and store them in the AST. No functional
change intended. No test case as there's no real way to test at this time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161342 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
7d9b51107999c1c1fada7319c4687fe570eb2c0b 06-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parser and sema: remove useless return values


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161331 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
ommentSema.cpp
9443c57150e870e308406e1e4e6d9d64712b417e 06-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: warn on duplicate \brief and \return commands.

Doxygen manual claims that multiple \brief or \returns commands will be merged
together, but actual behavior is different (second \brief command becomes a
part of a discussion, second \returns becomes a "Returns: blah" paragraph on
its own). Anyway, it seems to be a bad idea to use multiple \brief or \returns
commands in a single command.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161325 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
88815f3f81361692dd281000e3e46bf163b2f28b 06-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: \return in void function: specialize diagnostic text for
ObjC methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161324 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentSema.cpp
b34eb0c6f0ea24047ad2439825b4f6348e380315 04-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C string literal has no side-effect,
resulting in issuance of unused static variable
warning now. // rdar://10777111


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161291 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
51e87c5fa1d506058ed594b4290b06775ec74a8e 04-Aug-2012 Jordan Rose <jordan_rose@apple.com> Enhance getImplicitObjectArgument to look through ->*.

This only applies in the case where ->* is not overloaded, since it
specifically looks for BinaryOperator and not CXXOperatorCallExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161275 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
89ab7d0012ffe02a335b765eeb9b48977a5ecd79 03-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: warn if \returns is used in a non-function comment or if
the function returns void.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161261 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentSema.cpp
c23aca44753ff65303fb19d4d6d2114018629f07 03-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Flesh out test for defaulted key functions a bit more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161243 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
f3fce80bb2eafaa556779c84f38104003bddb0ea 03-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix failed to generate vtables in certain cases.

By C++ standard, the vtable should be generated if the first non-inline
virtual function is defined in the TU. Current version of clang doesn't
generate vtable if the first virtual function is defaulted, because the
key function is regarded as the defaulted function.

Patch by Li Kan!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161236 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ee959355b93c0648fea88dc986d196e3705407dc 03-Aug-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-160673-20120724.

Change-Id: I00d23ac9b893c62dca281ec771eeb5f911854bae
ndroid.mk
08fc8eb5a1cc9c01af67e016ab21c9b905711eb1 03-Aug-2012 Shih-wei Liao <sliao@google.com> Merge with Clang upstream r160673 (Jul 24th 2012)

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: I37f02f20642a037b9da8d35fefa01986cd250b14
5b32a08abe5530e9294b7b373cc70199b9e2fca4 03-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: convert a huge if -- else if statement on Decl's type into a
switch. Thanks Sean Silva for suggestion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161225 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
af19a6aaa2959ef5e76f19d51e87ef523bdeedde 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comments AST: refactor DeclInfo to use an enum for decl kind instead of
separate flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161217 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentSema.cpp
967e5d7ebb775a93f9c200d19d557d18bf945f10 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comments: handle template paramter documentation in alias-declaration
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161215 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
c27bc80a98b9558513b50956c930eedc9e461ae0 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: handle using-declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161211 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1abee64ad71519ea9d91f1fe76441b9cdb75b6c0 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> ASTContext.h: replace include by a forward declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161186 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
651f8ce530ebe6f7f4b67988c3c532a94f097efc 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Initialize flag in DeclInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161141 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
1ca7ecc8854ffea215c033a0d8482551bf1b73f0 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: add DeclInfo to store information about the declaration. Sema was
already extracting most of this, but discarding at the end of semantic analysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161140 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentSema.cpp
96b098674908eaa59a9128f3305cda6fbbdad563 01-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add support for \tparam command on all levels.

The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161087 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ommentBriefParser.cpp
ommentDumper.cpp
ommentParser.cpp
ommentSema.cpp
98499013bd70ec584f4c01c45106ec3e8203f16c 31-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Consider the visibility of template template arguments. GCC doesn't, but it also
fails to consider the linkage, which we were already considering.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161070 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ca93ee707d9570b74d24c7d55defe18dac38bcc0 30-Jul-2012 Anna Zaks <ganna@apple.com> Mark ObjCInterfaceDecl::lookupPrivateMethod as const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160989 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e5deb79d0e7f1c81fdc9ae89ed5a4edc9a589581 30-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parser: don't crash on a completely empty \param followed by a block
command


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160975 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
c109361fc44e82250bae143c9f0f20e11b3c3488 30-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment dumper: silence a warning by not casting away const


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160972 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
2cd7f41f4eb2b02568664132253f8e1d9cf381dd 30-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix ambiguity detection in GetBestOverloadCandidateSimple.

When performing the simplistic overload resolution for single-argument methods,
don't check the best overload for ambiguity with itself when the best overload
doesn't happen to be the first one.

Fixes PR13480.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160961 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
72b57cc4463315ed1446aeca476e08f68e4679da 28-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment dumper: print \param parameter index if parameter name is resolved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160908 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
0ba5880d6b3278a51ad69307f2c65fa3a118cb85 28-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentSema.cpp: remove extra semicolon


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160901 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
bbb7af301e0886f109b6391d7ba913b676ef44f5 27-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment Sema: don't try to typo-correct a \param when function has zero
arguments. Just an optimization, no functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160896 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
477a9f58c1b197f315befd03b42a8a0b3a2f0ff9 27-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement resolving of HTML character references (named: &amp;, decimal: &#42;,
hex: &#x1a;) during comment parsing.

Now internal representation of plain text in comment AST does not contain
character references, but the characters themselves.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ommentLexer.cpp
awCommentList.cpp
e61354b274ec5aa6acf3d15271896ce7596bb123 27-Jul-2012 Anna Zaks <ganna@apple.com> Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.

Also, fix a subtle bug, which occurred due to lookupPrivateMethod
defined in DeclObjC.h not looking up the method inside parent's
categories.

Note, the code assumes that Class's parent object has the same methods
as what's in the Root class of a the hierarchy, which is a heuristic
that might not hold for hierarchies which do not descend from NSObject.
Would be great to fix this in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160885 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
11abf2ad01f64ede7c0555167f41a1c5852f80c6 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Update tblgen'd dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
866abce3b93ab01bac00e0383a753819893b868a 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Reformat, alphabetize lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160850 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
b9d0b76e42fd2d4cdfd135220302458d03ad09fe 27-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Final piece of core issue 1330: delay computing the exception specification of
a defaulted special member function until the exception specification is needed
(using the same criteria used for the delayed instantiation of exception
specifications for function temploids).

EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like
EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to
resolve the exception specification.

This is enabled for all C++ modes: it's a little faster in the case where the
exception specification isn't used, allows our C++11-in-C++98 extensions to
work, and is still correct for C++98, since in that mode the computation of the
exception specification can't fail.

The diagnostics here aren't great (in particular, we should include implicit
evaluation of exception specifications for defaulted special members in the
template instantiation backtraces), but they're not much worse than before.

Our approach to the problem of cycles between in-class initializers and the
exception specification for a defaulted default constructor is modified a
little by this change -- we now reject any odr-use of a defaulted default
constructor if that constructor uses an in-class initializer and the use is in
an in-class initialzer which is declared lexically earlier. This is a closer
approximation to the current draft solution in core issue 1351, but isn't an
exact match (but the current draft wording isn't reasonable, so that's to be
expected).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160847 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
e34a052d642ba7830174b1a51787251d7f704f80 26-Jul-2012 Alexander Kornienko <alexfh@google.com> Added -ast-dump-filter option to clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160784 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
umpXML.cpp
bae11d8f82378f3b5ffcc994d8b107c9fbec6c4e 26-Jul-2012 Timur Iskhodzhanov <timurrrr@google.com> Remove an outdated comment; add one test to compare function pointer and block mangling

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160783 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
dc6dabcabd36d61d1ad7f5069080b2aade79b1f0 26-Jul-2012 Timur Iskhodzhanov <timurrrr@google.com> Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160780 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
d93c5ff2b1a83f73c64ee6b8e4eff521865e92d2 25-Jul-2012 Timur Iskhodzhanov <timurrrr@google.com> Add a FIXME to revisit the performance of BackRefMap later

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160709 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
612409ece080e814f79e06772c690d603f45fbd6 25-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160705 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
6582277bfc8bb587602e2c0689b6b2ff4b9bef53 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: add warning for multiple \param commands with duplicate
parameter names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160696 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
00c59f7ed2814f67d6d7e844479ea99eca9e55ef 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentSema: simplify functions, per Jordan's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160689 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
0c43a927d97c39c7d6de6a055af1d8f101d5a058 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: allow newlines between \param, direction specification (e.g.,
[in]), parameter name and description paragraph.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160682 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
db13f04dd0579874932bdb958647d0903f632dd4 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: couple TextTokenRetokenizer and comment parser together to
remove one of the two variable-length lookahead buffers. Now retokenizer will
ask for more tokens when it needs them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160680 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
c4b0f9b851ca59e61b802d58792ea3600fd9a9d4 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Move TextTokenRetokenizer from CommentLexer.h to CommentParser.cpp since it is
an implementation detail of the parser.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160679 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
fd939162ff99a0084ed22a08dd37c149a0883a2b 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: retokenized text tokens are now pushed back in correct (not
reverse) order


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160675 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
f5e0b225b4d8027edab993ad4ac87510fcd6f991 24-Jul-2012 Timur Iskhodzhanov <timurrrr@google.com> Fix PR13207 (Mangling of templates with back references when using -cxx-abi microsoft)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160667 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
8487c524fdfcea3da858fd0af850b4784c8096d0 23-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment Sema: refactor handling of 'ParmVarDecl's and save them in Sema members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160634 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
2d66a5016d4aacce362f89290261c8a1a6eef0d3 23-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: add InlineContentComment::RenderKind to specify a default
rendering mode for clients that don't want to interpret Doxygen commands.

Also add a libclang API to query this information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160633 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
ommentSema.cpp
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
TableBuilder.cpp
3fe52ff7df93f7a928a15cc2cbf5134fdc0cec15 23-Jul-2012 Douglas Gregor <dgregor@apple.com> When we have an Objective-C object with non-trivial lifetime in a
structor class under ARC, that struct/class does not have a trivial
move constructor or move assignment operator. Fixes the rest of
<rdar://problem/11738725>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160615 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9f08f49929324ec6863e81b22a43fb2e8575b433 20-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.

The assertion was wrong in case we have a verbatim block without a closing
command.

Also add tests for closing command name in a verbatim block, since now it can
be empty in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160568 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
4423f81705bd834054f9940d4eb9195addaea065 20-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentBriefParser: coding style fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160551 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
72021ff4038cbc48b09a3acb743e319809f086db 20-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentBriefParser: use \returns if we can't find the \brief or just a plain
paragraph.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160550 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
381767fcfe2fdf53727099d95b23b0c9e6a9aa6c 20-Jul-2012 Nico Weber <nicolasweber@gmx.de> Let Expr::HasSideEffects() return false for NULL, bool literals, this, and nullptr.

Fixes PR13413, -Wunused-private-field now warns on unused fields initialized to NULL.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160541 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ffb0c3adc27d257c8453886957b8d220d1ad14d8 20-Jul-2012 Eric Christopher <echristo@apple.com> Remove HasSynthBitfield and all callers/writers/etc. Also remove
previous ResetObjCLayout calls since this is now handled in Sema.

Part of rdar://11842763

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160527 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
umpXML.cpp
ad29b2bbb72b57fa823a1217d70e4173fa33fc08 19-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentDumper: print word-like arguments for block commands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160519 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
c48dd8e7b4f6f273a0dd482f800323e4ed02f7fc 19-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentSema: add more inline commands to tables


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160481 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
858e69fe1305bdffb76a200c0f498685f11e65ae 19-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace
TextComment node was considered whitespace even if it contained other child
nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160474 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
cdd1b371eab6bfca6a002fe7e16e3c77cb2f24b7 19-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment::dump(): show name of inline command


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160467 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
64da4e55c111f4733135e1780216609569767351 19-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: don't parse whitespace before \endverbatim as a separate line of whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160464 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
94572c32af458c97f6f5a9fafea44e84baa656bf 18-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> This fits into 80 columns without wrapping.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160453 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
0f7f10bd0ea08abf56c69fea9316275a1ee0e40c 18-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160452 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
fb3643a7509dcde7fb0fb7290e4b3b42b317700c 18-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> On Darwin, the linker removes functions in CommentDumper.o (Comment::dump())
despite __attribute__(__used__). As explained by Argyrios,
> .a archive files do some stripping of their own and they remove .o files that
> contain functions that are not referenced by any other .o file.

The fix is to use these functions from another .o file.

Thanks, Argyrios!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160437 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentDumper.cpp
3d3d22c74b6fd8cfa65d27b982f027636a8d4025 18-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentSema: \short is the same as \brief.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160414 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
a444f1856459130bd3a1bb8995331c9e367db04f 18-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement an optimization for finding the comment that occurs just after a
given declaration.

It is based on the observation that during parsing the comment that should be
attached to the decl is usually among the last two documentation comments
parsed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160400 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
76e7edddfa0692097a94c32fff0bc5f5f4512cff 17-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentBriefParser: use StringSwitch::Cases to group synonyms. Thanks Jordan!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160396 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
93ed7cf05f900b9150dcf59c0e0f37f3bd325f62 17-Jul-2012 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter how to handle anonymous structs/unions
better. Fixes <rdar://problem/11466212>; the test (and back-ported
version of this code) were committed to LLDB in r160186.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160395 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
26dc97cbeba8ced19972a259720a71aefa01ef43 17-Jul-2012 Eli Friedman <eli.friedman@gmail.com> Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160394 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
251c449b280eb845017a6c022ed7189d17c63d49 17-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160393 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
659a7124c7069b3e01dd171f7290562f58f9e97a 17-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160383 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
d8672ef2d343a0dbfe838724fb2d9fb4efea6041 16-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from
being a property of a canonical type to being a property of the fully-sugared
type. This should only make a difference in the case where an alias template
ignores one of its parameters, and that parameter is an unexpanded parameter
pack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160244 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
912394028ddd1934d40ad3d44c6655472cae9ef7 16-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Revert change accidentally committed in r160240.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160241 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f5baeb4af53b79a0d92a4ab7b7eba19bd721f344 16-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13368: Halve the instantiation depth of this test again. Apparently, FreeBSD
has a much lower default stack limit than the systems I have access to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160240 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
81695fa3a4772a62131eca45f8582cff72b1b9db 15-Jul-2012 Eric Christopher <echristo@apple.com> Replace IsSameValue with the llvm::APSInt/llvm::APInt versions
that we just copied from here and replace all uses.

Part of rdar://11875995

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160224 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f9e9af7df0cea6e997ac04131c7af6ca4384b0cc 14-Jul-2012 Chad Rosier <mcrosier@apple.com> Add a per target max vector alignment field (e.g., 32-byte alignment for x86 due to
AVX). Currently, if no aligned attribute is specified the alignment of a vector is
inferred from its size. Thus, very large vectors will be over-aligned with no
benefit. Target owners should set this target max.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160209 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0bab9da90f1e087dabe3aaf4e32ab99297d11017 14-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Move option test earlier in the function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160202 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f195f2cacf149286232d66578fad3370efa5f567 13-Jul-2012 Nuno Lopes <nunoplopes@sapo.pt> add support for conditional expressions in Expr::HasSideEffects()
This fixes a bug in __builtin_object_size() codegen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160191 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0eaf69d9a10149f0f344238183915912c2dca392 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in line with Statement AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160182 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
ommentSema.cpp
b04b73122064641d3acd637c26ea76bd3573041b 13-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Use -fvisibility-inlines-hidden in inline functions too. This matches gcc
behavior since gcc pr30066. Thanks to Benjamin Kramer for pointing it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160174 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
838925dc841f0968ac5daf941aed5d2331775a59 13-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Provide a special-case diagnostic when two class member functions instantiate
to the same signature. Fix a bug in the type printer which would cause this
diagnostic to print wonderful types like 'const const int *'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160161 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
d3d02dd0ae17eabc8e0b8972ac6a3863534b39d2 13-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a bug in my previous commit. The problem is not that we were not using the
canonical decl for the template, but that we were not merging attributes for
templates at all!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160157 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
abd56c816e9164b17bb3e7154a511b0c9896ffdb 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations during parsing: handle more Objective-C declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160156 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3f38bf2d441fac379c427f86153fbb0cb41256c6 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160153 91177308-0d34-0410-b5e6-96231b3b80d8
ommentDumper.cpp
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
3d986980bd02594b1a5aa7b9f9f68d201621ced7 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Make concepts of optional and forbidden end tags separate. Thanks Jordan for pointing this!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160149 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
23458208b25acd7d2dfa003b029299e30124fe5f 12-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Use the canonical template decl when trying to find if it has a visibility
attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160139 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8f88a1dcc57cfe8580eb1558a783ad8499bfe8e0 12-Jul-2012 Timur Iskhodzhanov <timurrrr@google.com> [Windows] Use thiscall as the default calling convention for class methods. PR12785

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160121 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
icrosoftMangle.cpp
dc5796cb3e77feb58928f84632d3f0088351d847 12-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> AST/CommentSema.cpp: Fix signess in abs() to appease msvc. It would not make sense to pass (unsigned)-(unsigned) to abs().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160097 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
e3f470a718ec00eb8b546e405fa59bc2df2d7c46 12-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Stop instantiating a class if we hit a static_assert failure. Also, if the
static_assert fails when parsing the template, don't diagnose it again on every
instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160088 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
18b7f95bdbfbd90c1f8e027225fb2cb8fca7134a 12-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160087 91177308-0d34-0410-b5e6-96231b3b80d8
ommentSema.cpp
a5ef44ff5d93a3be6ca67782828157a71894cf0c 11-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Enable comment parsing and semantic analysis to emit diagnostics. A few
diagnostics implemented -- see testcases.

I created a new TableGen file for comment diagnostics,
DiagnosticCommentKinds.td, because comment diagnostics don't logically
fit into AST diagnostics file. But I don't feel strongly about it.

This also implements support for self-closing HTML tags in comment
lexer and parser (for example, <br />).

In order to issue precise diagnostics CommentSema needs to know the
declaration the comment is attached to. There is no easy way to find a decl by
comment, so we match comments and decls in lockstep: after parsing one
declgroup we check if we have any new, not yet attached comments. If we do --
then we do the usual comment-finding process.

It is interesting that this automatically handles trailing comments.
We pick up not only comments that precede the declaration, but also
comments that *follow* the declaration -- thanks to the lookahead in
the lexer: after parsing the declgroup we've consumed the semicolon
and looked ahead through comments.

Added -Wdocumentation-html flag for semantic HTML errors to allow the user to
disable only HTML warnings (but not HTML parse errors, which we emit as
warnings in -Wdocumentation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160078 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
omment.cpp
ommentDumper.cpp
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
awCommentList.cpp
a4334dffde250c22c339a974a7131914fe723180 11-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash when constant-evaluating a CXXConstructExpr representing
value-initialization for an array of class type with a trivial default
constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160024 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5409d28b6167032696f4915bb765a6f7db579f3f 10-Jul-2012 Richard Trieu <rtrieu@google.com> Properly update the FormattedArgs vector when the template type diffing falls
back to regular type printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159976 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
a99ec107ba6b5abaf27c6cc9318e65689163f2a1 09-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment lexing: fix lexing to actually work in non-error cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159963 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
34f60a4a7fb87e9f4dfd08f8751ce76db9981215 09-Jul-2012 Abramo Bagnara <abramo.bagnara@gmail.com> The delete argument should not be converted to void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159961 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4990890fc9428f98bef90ba349203a648c592778 09-Jul-2012 Alexander Kornienko <alexfh@google.com> Inline storage of attributes in AttributedStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159925 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
de31aa7f0ef71f5c162372e319cbc03c0924f074 08-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13290: Constant-evaluation support for CXXConstructExprs which construct a
multidimensional array of class type. Also, preserve zero-initialization when
evaluating an initializer list for an array, in case the initializers refer to
later elements (which have preceding zero-initialization).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159904 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9c00676f2393335dc60c61faf944d4f8f622fac6 07-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Restrict the set of declaration kinds for which we allow trailing comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4d48b5c1d58c381e6e0c719701ef433b530e0e1a 06-Jul-2012 Matt Beaumont-Gay <matthewbg@google.com> Sprinkle llvm_unreachable around to placate GCC's -Wreturn-type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159860 91177308-0d34-0410-b5e6-96231b3b80d8
omment.cpp
ommentParser.cpp
811c820257746b1799b790b6adc7804f44154011 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Don't store pointers into a std::vector (RawCommentList::Comments). Although
currently we take address of std::vector's contents only after we finished
adding all comments (so no reallocation can happen), this will change in
future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159845 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
awCommentList.cpp
814e219fc6d5faeb48e4fd5375843346f2d4a7a7 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Stop using new[] on llvm::BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159833 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
9bf997e63d4e4004588b374e702a5e64da5ebb49 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Use C++ cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159830 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bfdb5061b47fc2708ca74d7b1042a666ad188d96 06-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> ASTContext.cpp: Appease msvc to cast NULL to typed pointer, or msvc mistakes NULL as int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159818 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea7eb071166c69e11bfda4f1d89d5c2b6bbcdca3 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentParser.cpp: remove unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159797 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.cpp
8d3ba23f2d9e6c87794d059412a0808c9cbacb25 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement AST classes for comments, a real parser for Doxygen comments and a
very simple semantic analysis that just builds the AST; minor changes for lexer
to pick up source locations I didn't think about before.

Comments AST is modelled along the ideas of HTML AST: block and inline content.

* Block content is a paragraph or a command that has a paragraph as an argument
or verbatim command.
* Inline content is placed within some block. Inline content includes plain
text, inline commands and HTML as tag soup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
omment.cpp
ommentDumper.cpp
ommentLexer.cpp
ommentParser.cpp
ommentSema.cpp
471c8b49982d1132f30b0b0da27fef94fd6e4f67 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159723 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.cpp
xprCXX.cpp
tmtPrinter.cpp
ypePrinter.cpp
d4f5198ae07d9a4958d8191bac694ded12173ad9 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used instead.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159719 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXInheritance.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
TTBuilder.cpp
TableBuilder.cpp
478851c3ed6bd784e7377dffd8e57b200c1b9ba9 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Drop the ASTContext.h include from Stmt.h and fix up transitive users.

This required moving the ctors for IntegerLiteral and FloatingLiteral out of
line which shouldn't change anything as they are usually called through Create
methods that are already out of line.

ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector
and make it independent from ASTContext.h

Pass the StorageAllocator directly to AccessedEntity so it doesn't need to
have a definition of ASTContext around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159718 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ambdaMangleContext.cpp
tmtDumper.cpp
ypeLoc.cpp
3a2d0fb726aca3096b5c1ea9be734417060f34d7 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Split out the "empty" case for compound statement into a separate ctor.

Move the ASTContext-dependent version out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159717 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
ee3096a2d3092892d4c6f607a6323d9409714ed5 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> CXXRecordDecl: Split getBases/getVBases into a slow and a fast path.

This avoids costly computation of getASTContext() and drops the header
dependency from DeclCXX.h to ASTContext.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159716 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c50a0e3900f1b44503be48457508af372f4dd05a 04-Jul-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Renamed RawComment kinds to avoid name clash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159706 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
57aceb227d192ce41f5412a53d451354e90dd792 03-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentBriefParser: remove dead store. Found by Clang Analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159673 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
a5335769ab676c455543d8e705e72ece6bf15cfb 02-Jul-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Reintroduced FieldDecl public methods setBitWidth and removeBitWidth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159579 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d99ef536b241071b6f4c01db6525dc03242ac30b 02-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.

Since extracting comments isn't free, a new code completion option is
introduced.

A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159539 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
fb40e3f10ccef93c4f8fb6bd4fe5a108fa6cd369 01-Jul-2012 Meador Inge <meadori@codesourcery.com> PR13189: va_list broken with precompiled headers

For some targets a structure named __va_list_tag is built to help define
the __builtin_va_list type. However, __va_list_tag was not being treated as a
predefined type thus causing problems when serializing the AST. This commit
fixes that oversight by adding the necessary support to treat __va_list_tag
as a predefined type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159508 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f70a88612a4bc2de2872a518267b9b4891ab6431 30-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add support for the C11 _Alignof keyword.

This behaves like the existing GNU __alignof and C++11 alignof keywords;
most of the patch is simply adding the third token spelling to various places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159494 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
075a54354dc6e3644b12206e5127855091783fd6 30-Jun-2012 Fariborz Jahanian <fjahanian@apple.com> blocks: fixes a crash when encoding block type
with argument type of size 0. // rdar://11777609
PR13229.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159477 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7e68ba5660a9b2b854df4ae7a556e6b91d738c6c 30-Jun-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c IRGen: fixes a crash when method type is being mangled
when an argument type size is 0. // rdar://11777609, PR13229


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159472 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
55e1808c6064ace116e458ab82abf33d3f83659a 29-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Factor out a check for block commands (that implicitly start a new paragraph) into a separate function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159444 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
16d0078d2a4b1024cbeca8e1ebe7c0ed45554f11 29-Jun-2012 Axel Naumann <Axel.Naumann@cern.ch> From Philippe Canal:
Update the two function overloads
void TemplateSpecializationType::PrintTemplateArgumentList(raw_ostream &OS,....
to behave like
std::string TemplateSpecializationType::PrintTemplateArgumentList(const TemplateArgument *Args,...
hence making sure that clang consistently adds a space between two '>' at the end of nested template arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159412 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
8376f5934a18b950ac7323d8a38ed231623010fa 28-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove redundant check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159355 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c3fee3539fd00a6ce21dc1f574baf76686640072 28-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: don't attach comments to implicit declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159354 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
632fbaa22fbed7c090eb83775731bfff786c2198 28-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix another issue with devirtualizing calls to final methods by passing them
the correct this pointer. There is some potential for sharing a bit more
code with canDevirtualizeMemberFunctionCalls, but that can be done in an
independent patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159326 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d558b5238df74ef3cb76d7125375a5c28fe0eaa9 28-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Cleanup \brief comment. Since it is a single paragraph, no need to save newlines there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159325 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
f199b9cd4af562029a3c7b82c4672819b2c39e70 28-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Teach \brief parser about commands that start a new paragraph implicitly


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159309 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
8bdb58a7835a9a90dd9b9791fccf269cbc1dcef3 28-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching documentation comments to declarations: don't attach a comment to a declaration if there is a preprocessor directive between them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159305 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5676d32a23faf0506f5c295980c2876c862488d5 28-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix an infinite loop in comment lexer: we were not advancing in the input character stream when we saw a '<' that is not a start of an HTML tag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159303 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
8d852e35adb46e0799538dfc9c80d44f27cd3597 27-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Implement John McCall's review of r159212 other than the this pointer not
being updated. Will fix that in a second.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159280 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0713d993cd0b4eb6a1b642c7d51d0f1845c1e986 27-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a crash I introduced in r159212.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159279 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
962668d2c192dd02f75b8ec3628a89964bfb738b 27-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove unsigned and a pointer from a comment token (so that each token can have only one semantic string value attached to it), at a cost of adding an additional token.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159270 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
f5e0aeac8a510ba1fd4c83391978cffd31e5ac69 27-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment lexer: counting backwards from token end is thought to be confusing. We already have a pointer to the beginning of the token, so use it to extract the text instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159269 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.cpp
1e15e3b78c396c829789e616b313e656814f5947 27-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Initialize RawComment::BriefTextValid in other constructor, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159253 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
c0b8324d6f68dfc2221257cdb83e39b974431c0b 27-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Simplify logic in BriefParser::Parse(), per Jordan's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159247 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.cpp
4285f84a5c3725210b4f12551af6c5d467d0763d 27-Jun-2012 Timur Iskhodzhanov <timurrrr@google.com> [Windows] Improve mangling of templates when back references are present

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159234 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
4622fe85ab214d54297f978ee2cc31c021051e69 26-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove typedef which is unused after r159189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159224 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2d44d77fed3200e2eff289f55493317e90d3398c 26-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement a lexer for structured comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159223 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
ommentBriefParser.cpp
ommentLexer.cpp
awCommentList.cpp
37d2a00f4ca5689dac7fec2931fcef37556f5092 26-Jun-2012 David Blaikie <dblaikie@gmail.com> Remove spurious semicolons committed in r159216.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159218 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
246b6aa6763de8c617d564ef33123a8f3293a80e 26-Jun-2012 Richard Trieu <rtrieu@google.com> Add template type diffing to Clang. This feature will provide a better
comparison between two templated types when they both appear in a diagnostic.
Type elision will remove indentical template arguments, which can be disabled
with -fno-elide-type. Cyan highlighting is applied to the differing types.

For more formatting, -fdiagnostic-show-template-tree will output the template
type as an indented text tree, with differences appearing inline. Template
tree works with or without type elision.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159216 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
0b4fe503ef00d9f8ea330850d3e3b303e9c7c876 26-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> During codegen of a virtual call we would extract any casts in the expression
to see if we had an underlying final class or method, but we would then
use the cast type to do the call, resulting in a direct call to the wrong
method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159212 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
4904bf4e84cfb48080270ebaa9005327f18ab0e5 26-Jun-2012 Fariborz Jahanian <fjahanian@apple.com> block literal irgen: several improvements on naming block
literal helper functions. All helper functions (global
and locals) use block_invoke as their prefix. Local literal
helper names are prefixed by their enclosing mangled function
names. Blocks in non-local initializers (e.g. a global variable
or a C++11 field) are prefixed by their mangled variable name.
The descriminator number added to end of the name starts off
with blank (for first block) and _<N> (for the N+2-th block).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159206 91177308-0d34-0410-b5e6-96231b3b80d8
angle.cpp
e92b1f4917bfb669a09d220dc979fc3676df4da8 26-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix lifetime issue for backing APValue of OpaqueValueExpr in recursive
constexpr function evaluation, and corresponding ASan / valgrind issue in
tests, by storing the corresponding value with the relevant stack frame. This
also prevents re-evaluation of the source of the underlying OpaqueValueExpr,
which makes a major performance difference for certain contrived code (see
testcase update).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159189 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f6172aee547241427e6dabdd0bd6fcaf1c046689 25-Jun-2012 Eli Friedman <eli.friedman@gmail.com> Use std::map instead of llvm::DenseMap because we rely on the stability of references to values in these maps. PR13197.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159161 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6b02009359a462ffe633696a4441313b462e6566 25-Jun-2012 Nico Weber <nicolasweber@gmx.de> Make explicit specializations at class scope work
for non-type template parameters in microsoft mode.
PR12709.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159147 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
28ad063b279378b19cb0704f977429df366a151e 23-Jun-2012 Nico Weber <nicolasweber@gmx.de> Support L__FUNCTION__ in microsoft mode, PR11789

Heavily based on a patch from
Aaron Wishnick <aaron.s.wishnick@gmail.com>.

I'll clean up the duplicated function in CodeGen as
a follow-up, later today or tomorrow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159060 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
3f835687b8f7ad3060fe4c462727b212ed714b30 23-Jun-2012 Timur Iskhodzhanov <timurrrr@google.com> [Windows] Fix mangling of repeated types in the presence of bool and function pointers PR13176,PR13177

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159059 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
3facb626608c99f497cb5b8bfc60d3ed3ba304b6 23-Jun-2012 Charles Davis <cdavis@mines.edu> MicrosoftMangle: Fix mangling of integral constant non-type template arguments in a class specialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159056 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
e601b237e495bb15a5e5df2e20c61fa01a6c4df0 22-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Handle include directive with comments. It turns out that in this case comments are not coming in source order. Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158940 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
9530a8bf275f91f95147e1fb205dc85bea1ae45c 21-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> VC9 does not like heterogenous compare function objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158936 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
awCommentList.cpp
06e767d6703fdae9cda21c6c96c79a0135e2567a 21-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> MS: Mangle rvalue references and nullptr_t, and produce back-references when
appropriate. Patch by João Matos!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158895 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
b0d8671f95fe08a220118bca29063ba4d11a9dac 21-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bd1be2c90c6bbc83fe420da51733469a4904831b 21-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> RawCommentList::addComment: fix the assertion so it actually checks that new comment is after the last one (change Comments[0] to Comments.back()), and handle the case of two consecutive comments, e.g. /** *//* */. There is already a testcase for that (but it didn't trigger the assert because the assert itself was wrong).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158882 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
0b92fcb1353d2d8b31b6c485e6caa14568aca43b 20-Jun-2012 John McCall <rjmccall@apple.com> Introduce ObjCRuntime::hasWeakClassImport() and use it in the appropriate
places. I've turned this off for the GNU runtimes --- I don't know if
they support weak class import, but it's easy enough for them to opt in.

Also tweak a comment per review by Jordan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158860 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
59c30cd804c162dcc1c156bd3bab5c8f1dfd4749 20-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove unused ASTContext& arg in RawCommentList::addComment, as pointed out by Chandler in commit message for r158807.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158845 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.cpp
f95d4125c01fa7b98722ae8cfbceac4a87d037b4 20-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Fix a big layering violation introduced by r158771.

That commit added a new library just to hold the RawCommentList. I've
started a discussion on the commit thread about whether that is really
meritted -- it certainly doesn't seem necessary at this stage.

However, the immediate problem is that the AST library has a hard
dependency on the Comment library, but the dependencies were set up
completely backward. In addition to the layering violation, this had an
unfortunate effect if scattering the Comments library dependency
throughout the build system, but inconsistently so -- several parts of
the CMake dependencies were missing and only showed up due to transitive
deps or the fact that the target wasn't being built by tho bots.

It turns out that the Comments library can't (currently) be a well
formed layer *below* the AST library either, as it has an API that
accepts an ASTContext. That parameter is currently unused, so maybe that
was a mistake?

Anyways, it really seems like this is logically part of the AST --
that's the whole point of the ASTContext providing access to it as far
as I can tell -- so I've merged it into the AST library to solve the
immediate layering violation problems and remove some of the churn from
our library dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158807 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
awCommentList.cpp
260611a32535c851237926bfcf78869b13c07d5b 20-Jun-2012 John McCall <rjmccall@apple.com> Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend: break this
down into a single target runtime kind and version, and compute
all the relevant information from that. This makes it
relatively painless to add support for new runtimes to the
compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime. This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
aa0cd85838f2a024e589ea4e8c2094130065af21 20-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Structured comment parsing, first step.

* Retain comments in the AST
* Serialize/deserialize comments
* Find comments attached to a certain Decl
* Expose raw comment text and SourceRange via libclang


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5ca8639f97663255880f0da81f1026a06a14d003 20-Jun-2012 Sean Hunt <scshunt@csclub.uwaterloo.ca> Do not crash when we dynamic cast a final type to void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158763 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
3532936f4f50c15fcec4d00f4cbb81a7a9dd9b7e 19-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r158700 and dependent patches r158716, r158717, and r158731.

The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158749 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
bfcb037a3479de4a453a8275c64ae441c22d43f9 19-Jun-2012 Sean Hunt <scshunt@csclub.uwaterloo.ca> Improve the specification of spellings in Attr.td.

Note that this is mostly a structural patch that handles the change from the old
spelling style to the new one. One consequence of this is that all AT_foo_bar
enum values have changed to not be based off of the first spelling, but rather
off of the class name, so they are now AT_FooBar and the like (a straw poll on
IRC showed support for this). Apologies for code churn.

Most attributes have GNU spellings as a temporary solution until everything else
is sorted out (such as a Keyword spelling, which I intend to add if someone else
doesn't beat me to it). This is definitely a WIP.

I've also killed BaseCheckAttr since it was unused, and I had to go through
every attribute anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158700 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
c5613b26a24a33d7450e3d0bf315c6ccc920ce7b 16-Jun-2012 Meador Inge <meadori@codesourcery.com> Explicitly build __builtin_va_list.

The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158592 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a0cff720d40f239fee0e5ecc8378122b456c1991 16-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [AST/libclang] Fix the selector locations that are reported for a
method definition that has its '{' attached to the method name without
a space.

With a method like:

-(id)meth{
.....
}

the logic in ObjCMethodDecl that determined the selector locations got
confused because it was initialized based on an end location for '{' but
that end location changed to '}' after the method was finished.

Fix this by having an immutable end location for the declarator and
for getLocEnd() get the end location from the body itself.

Fixes rdar://11659739.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158583 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
32f498a675df990901e6659d610dc740f9423228 16-Jun-2012 Eli Friedman <eli.friedman@gmail.com> Make the ".*" operator work correctly when the base is a prvalue and the field has a non-trivial copy constructor. PR13097.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158578 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1c3a46aa5a55068c3107e659333ccf10f6dab843 16-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escape Objective-C @keywords in Doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158565 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a125350491ca56a2068e3ddcf96ffce007480b56 16-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: Made a parameter name in a \param command match the code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158564 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0ef03ff14813c5778220632994a1529dc649129d 15-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: eliminated Doxygen warnings by deleting a doc comment
on ASTContext::CreateTypeSourceInfo that duplicated information from the
(more complete) version in ASTContext.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158504 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8ab09da1faaa33b9fa78de59cc4e191bfe9907b5 13-Jun-2012 Richard Trieu <rtrieu@google.com> Moved the StringLiteral printing code from StmtPrinter into the StringLiteral
class and have StmtPrinter and StmtDumper refer to it. This fixes an
assertion failure when dumping wchar string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158417 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
28e862a4fbb9ed4060d1db25d45b1ed7a42f1b75 13-Jun-2012 Kaelyn Uhrain <rikka@google.com> Remove the trailing backslash from the comment to remove the warning about
a multi-line comment, fixing builds with e.g. -Werror=comment enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158406 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
df9ef1bc8c3780307ab2ed81bf5e31c23310b936 13-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13099: Teach -Wformat about raw string literals, UTF-8 strings and Unicode escape sequences.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e0deb035b3e2d07b41ea55db84b110abcb65b753 13-Jun-2012 Charles Davis <cdavis@mines.edu> Grab bag of Microsoft Mangler fixes:

- Support mangling virtual function tables (base tables need work on the
ManglerContext interface).
- Correct mangling of local scopes (i.e. functions and C++ methods).
- Replace every llvm_unreachable() for actually-reachable code with a
diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158376 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
ceeb53af1f0f651de124d8e5a1b13b184a480afc 12-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158343 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8cd64b4c5553fa6284d248336cb7c82dc960a394 11-Jun-2012 Chad Rosier <mcrosier@apple.com> Etch out the code path for MS-style inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158325 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
edb4b626130cc8268b1d7a3f9a9fdc7fb4c3a2bb 11-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> We were computing the visibility and linkage of template parameters, but
only using the linkage.

Use and test both, documenting that considering the visibility and linkage
of template parameters is a difference from gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158309 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d3861ce75a308c65b58c0159e2cee58aea2dff1c 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove CXXRecordDecl flags which are unused after r158289.

We need an efficient mechanism to determine whether a defaulted default
constructor is constexpr, in order to determine whether a class is a literal
type, so keep the incrementally-built form on CXXRecordDecl. Remove the
on-demand computation of same, so that we only have one method for determining
whether a default constructor is constexpr. This doesn't affect correctness,
since default constructor lookup is much simpler than selecting a constructor
for copying or moving.

We don't need a corresponding mechanism for defaulted copy or move constructors,
since they can't affect whether a type is a literal type. Conversely, checking
whether such functions are constexpr can require non-trivial effort, so we defer
such checks until the copy or move constructor is required.

Thus we now only compute whether a copy or move constructor is constexpr on
demand, and only compute whether a default constructor is constexpr in advance.
This is unfortunate, but seems like the best solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158290 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
ca5233044ef679840d1ad1c46a36b16e2ee8a6e1 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13064: Store whether an in-class initializer uses direct or copy
initialization, and use that information to produce the right kind of
initialization during template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclPrinter.cpp
3f5f558a4ca08fe952cbbdf69b87487163c9a719 08-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13051: If a constructor is explicitly defaulted, it isn't marked as being
constexpr until we get to the end of the class definition. When that happens,
be sure to remember that the class actually does have a constexpr constructor.

This is a stopgap solution, which still doesn't cover the case of a class with
multiple copy constructors (only some of which are constexpr). We should be
performing constructor lookup when implicitly defining a constructor in order
to determine whether all constructors it invokes are constexpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158228 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
c0838d2acb498b0491908d3693514dfec5befe6f 08-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13047: Fix various abuses of clang::Type in the MS mangler, to make it work
in the presence of type sugar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158184 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
b4bc99ba5540a618c86c136c9112ead8fb1d9866 07-Jun-2012 Douglas Gregor <dgregor@apple.com> Add ext_vector type code for builtins, from John Garvin!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158156 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b8e54cd26cc71075456a74be054a95fa1f2e28ad 07-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Reuse APInt's getNumWords, which gets rounding right (my ad-hoc solution missed it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158151 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
855243789cb44799c03f4c7216d3d6308805f549 07-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Plug a long standing memory leak in TemplateArgument.

The integral APSInt value is now stored in a decomposed form and the backing
store for large values is allocated via the ASTContext. This way its not
leaked as TemplateArguments are never destructed when they are allocated in
the ASTContext. Since the integral data is immutable it is now shared between
instances, making copying TemplateArguments a trivial operation.

Currently getting the integral data out of a TemplateArgument requires creating
a new APSInt object. This is cheap when the value is small but can be expensive
if it's not. If this turns out to be an issue a more efficient accessor could
be added.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158150 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
umpXML.cpp
taniumMangle.cpp
icrosoftMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
emplateBase.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
xprConstant.cpp
taniumMangle.cpp
ecordLayoutBuilder.cpp
TableBuilder.cpp
113c4448003ff6fd76eaabde08d3ebfffd8a327a 06-Jun-2012 Douglas Gregor <dgregor@apple.com> A non-explicit constructor template with a second parameter that is a
parameter pack is a converting constructor. Fixes PR13003.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158040 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
bd1d18ecc420838b7ba620c0a2c5d2a86cac371d 05-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13022: cope with parenthesized function types in MS name mangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157959 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
36d02af300a207242f0486b4255420d8be796b21 05-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add a warning for when an array-to-pointer decay is performed on an array
temporary or an array subobject of a class temporary, and the resulting value
is used to initialize a pointer which outlives the temporary. Such a pointer
is always left dangling after the initialization completes and the array's
lifetime ends.

In order to detect this situation, this change also adds an
LValueClassification of LV_ArrayTemporary for temporaries of array type which
aren't subobjects of class temporaries. These occur in C++11 T{...} and GNU C++
(T){...} expressions, when T is an array type. Previously we treated the former
as a generic prvalue and the latter as a class temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157955 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
cacf718381dda1b23efedf3deb02170186095cc0 04-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [objcmt] Don't migrate to subscripting syntax if the required methods have not
been declared on NSArray/NSDictionary.

rdar://11581975

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157951 91177308-0d34-0410-b5e6-96231b3b80d8
SAPI.cpp
48d798ce32447607144db70a484cdb99c1180663 02-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix typos found by http://github.com/lyda/misspell-check

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157886 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
c4d7675ddd598e3d89237cd04eeba3be322e560c 29-May-2012 Charles Davis <cdavis@mines.edu> Use fewer temporaries mangling APSInt objects. The performance difference
is negligible, but it makes the code clearer. Based on a suggestion by
Jordy Rose.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157601 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c1fd52b4b08384697428206a758125cb4a62d83f 28-May-2012 Charles Davis <cdavis@mines.edu> Fix mangling of integral template arguments between 1 and 10. Add a test case
for this. Reported by Timur Iskhodzhanov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157583 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
104e51f30fdf42b1f594a1be20de1c8673088c50 28-May-2012 Charles Davis <cdavis@mines.edu> Fix Lang's fix. This should fix the tests for +Asserts builds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157561 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
e0cf31dc263979027f345c00318a704c5f5b1e76 28-May-2012 Benjamin Kramer <benny.kra@googlemail.com> PR12962: Fix a rare use after free when collecting virtual overrides.

The DenseMap reallocates after 64 insertions so this only happened in
large test cases under very specific circumstances.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157549 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
f17523b6d3d9ef1dbcb64b63d9bada7bdae194a7 27-May-2012 Lang Hames <lhames@gmail.com> Fix call to APSInt constructor - it doesn't take an initial value, just a
bitwidth and signedness. Also rename the variable to reflect its purpose.

No test case - discovered during random code exploration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157547 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
9fd2359ee3b140557b808e4b79bc73a3b9d62304 27-May-2012 Charles Davis <cdavis@mines.edu> Mangle template instantiations properly (as of VC 7.x) when compiling for
the Microsoft Visual C++ ABI. Currently limited to type and integral
non-type arguments. Based on a patch by Timur Iskhodzhanov!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157524 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
41be8cd0593f2e08e41eed218e1b91f419e829a1 25-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Don't ignore linkage when ignoring visibility in the instantiation of a
method template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157486 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9db614f339f7596e2c0e0e04d6c714cd264ce883 25-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Don't ignore linkage when ignoring visibility in the instantiation of a
function template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157480 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
20831e21ae00ee10e9d9d906f565a66f9fe1d2d1 25-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Consider the linkage for member class templates even when we have to ignore
the visibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157475 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ad359beadbe2b91acf6888546e39083ae74321d9 25-May-2012 Rafael Espindola <rafael.espindola@gmail.com> When ignoring visibility in an instantiation, still consider the linkage.
Similar fixes for function and member template to follow as I write the
testcases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157470 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
59073bb1b430286d3c392134312c0b6c4f69a2b5 25-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Whitespace fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4059da87fa2fe9f415c9656dc63e75d5d4a489ef 24-May-2012 Eli Friedman <eli.friedman@gmail.com> A minor tweak to the new volatile lvalue warning: don't warn on "(void)x", where "x" refers to a local variable. This should silence a useless warning in compiler-rt and other places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157414 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a6115068cde719142eb394db88612c185cabd05b 24-May-2012 Eli Friedman <eli.friedman@gmail.com> Add a warning to diagnose statements in C++ like "*(volatile int*)x;". Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157362 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c6794850a570a91c5f224b6f0293db9f560f4213 23-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> If the first argument of __builtin_object_size can be folded to a constant
pointer, but such folding encounters side-effects, ignore the side-effects
rather than performing them at runtime: CodeGen generates wrong code for
__builtin_object_size in that case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157310 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cae1c623b638f91e848ed81a2510b86b403992e4 21-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Function template version of the previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157207 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0b0ad0abd8518742c57d0c6fc01c79982ba2bfdf 21-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Produce a hidden symbol for zed in

struct HIDDEN foo {
};
template <class P>
struct bar {
};
template <>
struct HIDDEN bar<foo> {
DEFAULT static void zed();
};
void bar<foo>::zed() {
}

Before we would produce a hidden symbol in

struct HIDDEN foo {
};
template <class P>
struct bar {
};
template <>
struct bar<foo> {
DEFAULT static void zed();
};
void bar<foo>::zed() {
}

But adding HIDDEN to the specialization would cause us to produce a default
symbol.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157206 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4dc34ebf2a0716bf77ba110dab6777a3fc4397dd 20-May-2012 Peter Collingbourne <peter@pcc.me.uk> CUDA: add CodeGen support for global variable address spaces.
Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0. This relies on address
space 0 being a unified address space.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157167 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2bd4b60a955d2911af938401708d016eb3acc723 19-May-2012 Dmitri Gribenko <gribozavr@gmail.com> Use RecordDecl::field_iterator because D1, D2 are RecordDecls. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157119 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c470442fe144b93c2877134559d0067b3215289d 19-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify some users of DeclarationName::getNameKind. Fold getFETokenInfoAsVoid into its only caller.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157116 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ad9689f3531c49e4bff467d9469993606800068c 17-May-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added two missing const qualifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156988 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
797105a45a838a7c1cefd05dec3fd0cbaeb0a215 16-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix the visibility of instantiations of static data members.
Fixes pr12835.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156897 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7fe103cdcc00a675aac04a11975dc078aba47db5 16-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [objcmt] Rewrite messages to NSString's stringWithUTF8String:/stringWithCString:
to use the @() boxing syntax.

It will also rewrite uses of stringWithCString:encoding: where the encoding that is
used is NSASCIIStringEncoding or NSUTF8StringEncoding.

rdar://11438360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156868 91177308-0d34-0410-b5e6-96231b3b80d8
SAPI.cpp
31c195ac0f3869e742d42f9d02b6cd33442fb630 15-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix our handling of visibility in explicit template instantiations.

* Don't copy the visibility attribute during instantiations. We have to be able
to distinguish

struct HIDDEN foo {};
template<class T>
DEFAULT void bar() {}
template DEFAULT void bar<foo>();

from

struct HIDDEN foo {};
template<class T>
DEFAULT void bar() {}
template void bar<foo>();

* If an instantiation has an attribute, it takes precedence over an attribute
in the template.

* With instantiation attributes handled with the above logic, we can now
select the minimum visibility when looking at template arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156821 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4b50263096457552ee86eb790c9638c6bb7357fa 15-May-2012 John McCall <rjmccall@apple.com> Change the mangling of a ref-qualifier on a function type so that
it is placed in a position which is never ambiguous with a
reference-to-function type. This follows some recent discussion
and ensuing proposal on cxx-abi-dev. It is not necessary to
change the mangling of CV-qualifiers because you cannot
apply CV-qualification in the normal sense to a function type.
It is not necessary to change the mangling of ref-qualifiers on
method declarations because they appear in an unambiguous
location.

In addition, mangle CV-qualifiers and ref-qualifiers on function
types when they occur in positions other than member pointers
(that is, when they appear as template arguments).

This is a minor ABI break with previous releases of clang. It
is not considered critical because (1) ref-qualifiers are
relatively rare, since AFAIK we're the only implementing compiler,
and (2) they're particularly likely to come up in contexts that
do not rely on the ODR for correctness. We apologize for any
inconvenience; this is the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156794 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
df8755884e039d3f313ee0fea42b955257b5e240 11-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> The Lexer constructor expects a source location at the start of the
file buffer, not at the start of lexing.

Fixes assertion hit in format diagnostics. rdar://11418366

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156647 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2df1a5819fd98708ff3b4772f3477f6c1a8da59a 11-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [objc] When boxing a BOOL/NSInteger/NSUInteger type, use the corresponding
numberWithBool:/numberWithInteger:/numberWithUnsignedInteger: NSNumber selectors.

rdar://11428703

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156583 91177308-0d34-0410-b5e6-96231b3b80d8
SAPI.cpp
ype.cpp
36faaddccf519231a3facd26495e895ba5a28776 10-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When AST-dumping the ObjCBoxedExpr node, also print out what selector it chose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156564 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
d079abfb5eefaf7da232e39a6564f561402cf4fe 07-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> A union can have a constexpr defaulted default constructor, if it has an
in-class initializer for one of its fields. Value-initialization of such
a type should use the in-class initializer!

The former was just a bug, the latter is a (reported) standard defect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156274 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
f108c63ccc576fe6a3ca08399dbcec574b089ea8 06-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> A conversion operator in a base class shouldn't hide another conversion operator
in the same class, even if they convert to the same type. Fixes PR12712.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156247 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7ad5c996e9519ed4e9afd1f0166be1cd2be8415a 05-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use raw_ostream in TypePrinter and eliminate uses of temporary std::strings.

Part of rdar://10796159

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156228 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclPrinter.cpp
xpr.cpp
ypePrinter.cpp
27a00970bf4ababdc115e54383e6252cc3276dfa 05-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make BuiltinType::getName return a StringRef and introduce BuiltinType::getNameAsCString
to get a const char* if necessary.

This avoids unnecessary conversions when we want to use the result of getName as
a StringRef.

Part of rdar://10796159

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156227 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
51603be62ba78adeb64246b222583dcde4b20b2a 04-May-2012 Douglas Gregor <dgregor@apple.com> Synchronize the representations of DeclarationName and Selector so
that bridging between the two is free. Saves ~4k of code size,
although I don't see any measurable performance difference
(unfortunately).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156187 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
392da48160bd92ceb486792780467cbfdb2d0e8c 04-May-2012 James Molloy <james.molloy@arm.com> Fix handling of wint_t - we can't assume wint_t is purely an integer promotion of wchar_t - they may differ in signedness.

Teach ASTContext about WIntType, and have it taken from TargetInfo like WCharType. Should fix test/Sema/format-strings.c for ARM, with the exception of one subtest which will fail if wint_t and wchar_t are the same size and wint_t is signed, wchar_t is unsigned.

There'll be a followup commit to fix that.

Reviewed by Chandler and Hans at http://llvm.org/reviews/r/8



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156165 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d964d6380945e0505b623050fe6a3f428008fc2a 04-May-2012 Chandler Carruth <chandlerc@gmail.com> Fix non-deterministic iteration order when walking the specializations
of templates by using the newly introduce FoldingSetVector. This
preserves insertion order for all iteration of specializations.

I've also included a somewhat terrifying testcase that rapidly builds up
a large number of functions. This is enough that any system with ASLR
will have non-deterministic debug information generated for the test
case without the fix here as the debug information is generated in part
by walking these specializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156133 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
82047c16486a28537746cfcc0d63745292b9fc54 04-May-2012 Douglas Gregor <dgregor@apple.com> Inline DenseMapInfo<clang::DeclarationName>::getHashValue() for a 0.4% speedup on <rdar://problem/11004361>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156129 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
514d3b6b93c83c0841d2f9dd7af8ecc2877fe921 04-May-2012 Douglas Gregor <dgregor@apple.com> Split DeclarationName::getFETokenInfoAsVoid() into hot/cold paths and
(trivially) make DeclContext::lookup()'s const version inlinable. Good
for 0.3% on <rdar://problem/11004361>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156126 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclarationName.cpp
0cf3c0eecbff007cea2750c113894b47d9e09f33 03-May-2012 David Blaikie <dblaikie@gmail.com> Correctly constify clang::CXXMemberCallExpr::getRecordDecl()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156074 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
3539b0c5a38ab61fac136724512309333d91ee48 02-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Utilize getLocStart()/getLocEnd() on my recent change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155952 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
441c6239c6df8c759bacf6510efbfd434b647066 01-May-2012 John McCall <rjmccall@apple.com> Add support for laying out vtordisps according to our current
working knowledge of the Microsoft ABI. Based on a patch by
Dmitry Sokolov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155905 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
3a8ac07956ac63bd202cdd3b9e4a2c6cefa888da 01-May-2012 John McCall <rjmccall@apple.com> When mangling a synthetic function declaration, we might not have
type-source information for its parameters. Don't crash when
mangling them in the MS C++ ABI. Patch by Timur Iskhodzhanov!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155879 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
c30636a160c640f32f847637004a2632b88cad6c 01-May-2012 Douglas Gregor <dgregor@apple.com> Print inline for inline namespaces, from Faisal Vali

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155875 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8d59deec807ed53efcd07855199cdc9c979f447f 01-May-2012 John McCall <rjmccall@apple.com> My first effort to do this more subtly failed, so elaborately
test for an invalid declaration at every single place in the
constant evaluator that's about to request a struct layout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155868 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4548ca2912e5f2b78a20e50c58d8a1a9c5e9e67c 01-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Store the source range of a CXXOperatorCallExpr in the Expr object instead of
calculating it recursively.

boost::assign::tuple_list_of uses the trick of chaining call operator expressions in order to declare a "list of tuples", e.g:
std::vector<tuple> v = boost::assign::tuple_list_of(1, "foo")(2, "bar")(3, "qqq");

Due to CXXOperatorCallExpr calculating its source range recursively we would get
significant slowdowns with a large number of chained call operator expressions and the
potential for stack overflow.

rdar://11350116

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155848 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
xprConstant.cpp
taniumMangle.cpp
ecordLayoutBuilder.cpp
TableBuilder.cpp
8907832ddee33d8a0b0d8432d4c7470360353d67 28-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> isCXX98PODType: Avoid dispatch on the language standard when recursing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155758 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
152f6b7be508fbc61543f3736ebd390d7ac84bd1 28-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Rename isPODType (using the C++98 rules) into isCXX98PODType and make isPODType decide which one to use based on LangOptions.

- -Wc++98-compat depends on the c++98 definition
- Now __is_pod returns the right thing in c++11 and c++98 mode
- All changes to the type traits test are validated against g++ 4.7

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155756 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
58db7a575efc9a2f35266fe240feac3cf317753d 28-Apr-2012 Douglas Gregor <dgregor@apple.com> When @encode'ing a C++ class that has empty base classes, we can end
up with gaps when the class inherits from the same empty base class
more than once. Fixes <rdar://problem/11324167>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155738 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1de9d7de172379d6af75fd11dda2a713e4f36f62 26-Apr-2012 John McCall <rjmccall@apple.com> Fix a crash-on-invalid where the constant evaluator would try to
evaluate certain expressions involving invalidly-defined classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155645 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fa784da5b9039ead42323bfe9ae6d33ab3c5c6b3 24-Apr-2012 Shih-wei Liao <sliao@google.com> Merge with CLANG upstream r155088.

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Id80f069ae25e623967b705e9fa11cfd94dd2461c
923b0c93375db7e75a02bceb487f6f3d3da2766f 23-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix visibility when we have two types with explicit visibility in a template
argument list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155368 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
38c47674399daac540083a71703d61f66158cbf0 23-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Inline helper function into only caller.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155352 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f6a8b9cba4893b552704f64dd279b4cdc8c13f6f 22-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> An attribute in a explicit template installation should take precedence over
the tempale arguments in deciding the visibility.

This agrees with gcc 4.7.

Found by trying to build chrome with component=shared_library with 155314
reverted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155316 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
60115a0453ecfbfe215fdb10aceab983e5f802ef 22-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix handling of template parameters. Found by inspection. GCC 4.7 agrees
with this testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155301 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1266b613e48bb9fc8155b3ac486a6ac06a75291f 22-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> All the members of LVFlags always have the same value, replace the class with
a boolean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155299 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
79e244f49a60a90167d23daf387dc600d603641d 21-Apr-2012 Nuno Lopes <nunoplopes@sapo.pt> move some stuff to .rodata

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155282 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c7e606086a8d44c4e84ac3d47289288534c79bc6 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> In mergeVisibility, if we already have an explicit visibility, keep it.
This fixes the included testcase and lets us simplify the code a bit. It
does require using mergeWithMin when merging class information to its
members. Expand the comments to explain why that works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155103 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d70d20a361b877d7156291acd1a83b5b1ac2655a 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Now that we check visibility attributes in an appropriate order,
there is no need for mergeVisibily to ever increase the visibility. Not
doing so lets us replace an incorrect use of mergeVisibilityWithMin. The
testcase

struct HIDDEN RECT {
int top;
};
DEFAULT RECT foo = {0};

shows that we should give preference to one of the attributes instead of
keeping the minimum. We still get this testcase wrong because mergeVisibily
handles two explicit visibilities incorrectly, but this is a step in the
right direction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155101 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4fc149057248a565ec9e539be66eeec42216282c 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Check ConsiderGlobalVisibility before using -fvisibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155100 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
415745474c3057cb135a8a0fb2655901b90f3170 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> The explicit bit in LV already tracks exactly the same information as
DHasExplicitVisibility. Simplify the code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155099 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ff2579816bd9318fbda49d8bf9af301ff00371a7 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Move the point in the code where we handle -fvisibility=hidden. With
the current implementation this should be a nop as explicit visibility
takes precedence in mergeVisibility.

The location chosen is such that attributes checked above it can force
a symbol to be default. For example, an attribute is the variable or function.
Attributes checked after this point, can only make the visibility more
restrictive. An attribute in a type for example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155098 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5727cf50bfb8dda767585acb75f26ccfc7f61a4f 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Make setVisibility private and change users to mergeVisibility. This is
currently a nop as those users are the first merge or are a merge
of a hidden explicit visibility, which always wins in the current
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155095 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eb382ec1507cf2c8c12d7443d0b67c076223aec6 19-Apr-2012 Patrick Beard <pcbeard@mac.com> Implements boxed expressions for Objective-C. <rdar://problem/10194391>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155082 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
13bffc532bafd45d4a77867993c1afb83c7661be 19-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR 12586: Fix assert while running libc++ testsuite: deal with exception
specifications on member function templates of class templates and other such
nested beasties. Store the function template from which we are to instantiate
an exception specification rather than trying to deduce it. Plus some
additional test cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155076 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
074c1919167a272860a65f861c81d7d3ff37cd72 18-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Calling setVisibility directly only makes (some) sense when the visibility is
explicit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154969 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
54881cb78e2c9054188c002c012b72175429e79b 17-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Simplify calls to mergeVisibility* by passing in the LinkageInfo. No
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154940 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e6975e9b0985ad7f7ff9187e38d95bfe9ac4181b 17-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.

We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154886 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
ype.cpp
93a49944e0e68e32bc22d45d44ee136b34beffb3 16-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154861 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2850376184b7e7aa81b5034ba44b001f8c55e07a 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154849 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e9836a27cf93a58305ff3cf6d75ddc399c7d8ebf 16-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert r154749 for now at John McCall's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154846 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0f90590c96375052c67116f620fafa2b1eadb41e 16-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Use ordering and the explicit visibility bit instead of modifying
ConsiderGlobalVisibility. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154843 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
62d9f110b83dfa5dcd4a945e3b5f2e9c73d3aa4a 16-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Add another constructor to LVFlags and use it to simplify the code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154814 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cefc3afac14d29de5aba7810cc8fe6c858949e9d 16-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154799 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
tmtProfile.cpp
a31698842e9893559d58a7bf1a987f2ae90bea0b 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Make constant evaluation for pointer comparisons work correctly for some uncommon cases. <rdar://problem/10962435>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154794 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e275a1845b9e32bd3034f2593dee1780855c8fd6 16-Apr-2012 Francois Pichet <pichet2000@gmail.com> The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
error: non-type template argument of type 'const _GUID *' is not a constant expression

For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154790 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b346d2f419ec7d7ce6b20780d518490338efa7de 16-Apr-2012 Nick Lewycky <nicholas@mxc.ca> Implement the all_lookups_iterator for PCH as a follow-up to r153970. This
includes a patch from Matthias Kleine with a regression testcase!

Adds a new iterator 'data_iterator' to OnDiskHashTable which doesn't try to
reconstruct the external_key from the internal_key, which is useful for traits
that don't store enough information to do that mapping in their key. Also
deletes the 'item_iterator' from OnDiskHashTable as dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154784 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.cpp
fe587201feaebc69e6d18858bea85c77926b6ecf 15-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like i8 ptrtoint ([n x i8]* @str to i8).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154756 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
767f7c7558779e7feb4fe10960726dbf01e69a9f 14-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Consider visibility attributes last, so that they take precedence.
I am working on a cleaner fix, but this gets the case in PR12552 passing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154749 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8fb9fb66d415ee40447277f649ecdb12b4964385 14-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace manual delete[] with OwningArrayPtr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154748 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
a2189d7548f44cce1a7831903d2fc861d75e49bb 14-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Don't leak vtable thunks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154747 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
534986f2b21e6050bf00163cd6423fd92155a6ed 14-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
51b92401c9f95023a2ef27064fd5a60fd99175f5 13-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
GNU __atomic builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154659 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2c39d71bb7cefdfe6116fa52454f3b3dc5abd517 13-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ff34d401ff385ef7173ca612432b4ea717fff690 12-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for 18 of the GNU-compatible __atomic builtins.

This is not quite sufficient for libstdc++'s <atomic>: we still need
__atomic_test_and_set and __atomic_clear, and may need a more complete
__atomic_is_lock_free implementation.

We are also missing an implementation of __atomic_always_lock_free,
__atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed
for libstdc++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154579 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
fafbf06732746f3ceca21d452d77b144ba8652ae 11-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Provide, and document, a set of __c11_atomic_* intrinsics to implement C11's
<stdatomic.h> header.

In passing, fix LanguageExtensions to note that C11 and C++11 are no longer
"upcoming standards" but are now actually standardized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154513 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
e1b2abc2ed3f2c98985b06b4ad01c977bd584020 11-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix saving
of an uninitialized Stmt* in serialization of __atomic_init and add a test of
atomics serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154448 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
abf65ce5ddfb8db0d34280d30a91253930732f4f 10-Apr-2012 Douglas Gregor <dgregor@apple.com> Improve the printing of __PRETTY_FUNCTION__ more provide more
information and more closely match GCC's, from Nikola Smiljanic!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154430 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
49149fe0d2be06ce1ceed1e9d2548a0b75a59c47 08-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't forget to evaluate the subexpression in a null pointer cast. If we're
converting from std::nullptr_t, the subexpression might have side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154278 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d2008e2c80d6c9282044ec873a937a17a0f33579 07-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement support for null non-type template arguments for non-type
template parameters of pointer, pointer-to-member, or nullptr_t
type in C++11. Fixes PR9700 / <rdar://problem/11193097>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154219 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
umpXML.cpp
xprConstant.cpp
taniumMangle.cpp
emplateBase.cpp
ypePrinter.cpp
b2f6820773aabff3c5c9e0dbb1cbbbda0d80c41f 06-Apr-2012 Patrick Beard <pcbeard@mac.com> Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154187 91177308-0d34-0410-b5e6-96231b3b80d8
SAPI.cpp
bf393be8a0b8b573ceb23ed19ac953832a2a69e4 06-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: Don't warn when a category does not implement a method
declared in its adopted protocol when another category declares it
because that category will implement it. // rdar://11186449


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154132 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
69f50e7f29766ce76e79c69c38302ba654202377 05-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix assertions and wrong output from StmtPrinter's string literal printing.
String literals (including unicode ones) can contain non-Unicode codepoints
if they were written using \x or similar. Write those out using \x, but be
careful that the following character can't be misinterpreted as part of the
\x escape sequence. Convert UTF-16 surrogate pairs back to codepoints before
rendering them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154069 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
f54486acc1cadf2791c3916ece66fded1e57ba0b 04-Apr-2012 Douglas Gregor <dgregor@apple.com> Move the computation of the lambda mangling information (mangling
number + context) to the point where we initially start defining the
lambda, so that the linkage won't change when that information is made
available. Fixes the assertion in <rdar://problem/11182962>.

Plus, actually mangle the context of lambdas properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154029 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
taniumMangle.cpp
5a5a971908a1fd064454db44c42333a3aecf3d5b 04-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to
be used with clang in c++98 mode.

Several other changes are still required for libstdc++4.7 to work with clang in
c++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153999 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0f6931a2c2cf7f19bab07ab752dfd632d8494205 02-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12438: Profile a reference to a type template parameter by depth and index,
not by canonical decl. This only matters for sizeof...(Pack) expressions; in
all other cases, we'd profile it as a type instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153884 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
b085d898bdfe35097eba45f4072b0f6865f561dc 30-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add info to ObjCPropertyRefExpr to indicate whether the dot syntax property
reference is going to message the setter, the getter, or both.

Having this info on the ObjCPropertyRefExpr node makes it easier for AST
clients (like libclang) to reason about the meaning of the property reference.

[AST/Sema]
-Use 2 bits (with a PointerIntPair) in ObjCPropertyRefExpr to record the above info
-Have ObjCPropertyOpBuilder set the info appropriately.

[libclang]
-When there is an implicit property reference (property syntax using methods)
have clang_getCursorReferenced return a cursor for the method. If the property
reference is going to result in messaging both the getter and the setter choose
to return a cursor for the setter because it is less obvious from source inspection
that the setter is getting called.

The general idea has the seal of approval by John.

rdar://11151621

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153709 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
1e1e9722cb4ea6027e2c4885c7a8f26d3726ca7d 28-Mar-2012 Douglas Gregor <dgregor@apple.com> When we form a new function/class template specialization, we first
search for the specialization (in a folding set) and, if not found
form a *Decl that is then inserted into that folding set. In rare
cases, the folding set may be reallocated between the search and the
insertion, causing a crash. No test case, because triggering rehashing
consistently in a small test case is not feasible. Fixes
<rdar://problem/11115071>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153575 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
ba1030698dbc276db86b11c5329a1edee8a1805e 28-Mar-2012 Douglas Gregor <dgregor@apple.com> Introduce a new libclang API to determine the parent context of a code
completion item. For example, if the code completion itself represents
a declaration in a namespace (say, std::vector), then this API
retrieves the cursor kind and name of the namespace (std). Implements
<rdar://problem/11121951>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153545 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
560ad31c413724fafd13d6fd723e403f28daa132 22-Mar-2012 Shih-wei Liao <sliao@google.com> Migrate external/clang to CLANG-153220-20120321.

Change-Id: I3b469a42a5048f05f06d14aba34419119047e1a9
ndroid.mk
d316862f4fb281ec08a2e45cd3e5580574adb889 24-Mar-2012 Shih-wei Liao <sliao@google.com> Merge branch 'upstream' into sliao_d
f602806965531ee06fd8664b9d7a8912c4af2870 24-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Teach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix up
some calling code to actually pass in a non-null type, to avoid a crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153358 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
1af83c444e5a2f6f50a6e1c15e6ebc618ae18a5f 23-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153304 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0d4cb85130d91da61c45aecb9fd31c7097a7cfcc 22-Mar-2012 Bob Wilson <bob.wilson@apple.com> Fix a comment: kPropertyType = 'T' not 't'. <rdar://problem/11095729>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153264 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9293fff58aa0198fa7a6bb504169bcac01dbbff7 22-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify DataRecursiveIntBinOpEvaluator::VisitBinOp() a bit and make sure we don't
evaluate RHS if LHS could not be evaluated and keepEvaluatingAfterFailure() is false.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153235 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b778305e95f9977e6710f2b04830ecc36398ab5e 22-Mar-2012 Richard Trieu <rtrieu@google.com> Change the binary operator data recursive evaluator to not stop at the first
non-constant value encountered. This allows the evaluator to deduce that
expressions like (x < 5 || true) is equal to true. Previously, it would visit
x and determined that the entire expression is could not evaluated to a
constant.

This fixes PR12318.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153226 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cde7a1dc68af2eb063a039b5a31c3b7dd92b1aa9 21-Mar-2012 Chad Rosier <mcrosier@apple.com> Report the natural alignment of unsigned long long, not the preferred alignment.
rdar://11054144


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153216 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
260a3e4370a15bc3da9d2d9461b6f179c68dd348 21-Mar-2012 John McCall <rjmccall@apple.com> For the annals of subtle but terrible bugs: fix a longstanding bug
in vtable layout where virtual methods inherited from virtual bases
could be assigned the same vcall adjustment slot if they shared
a name and parameter signature but differed in their
cv-qualification. The code was already trying to handle this
case, but unfortunately used the ordinary type qualifiers
(which are always empty here) instead of the method qualifiers.
This seems like something that the API should discourage, but
I don't know how to carry that principle out in this instance.

Eliminate this function's need for an ASTContext while we're at it.

This bug affects the ABI, and fixing it brings us into accord with
the Itanium ABI (and GCC's implementation of it), but, obviously,
technically breaks full compatibility with previous releases of Clang.
Just letting you know.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153168 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
c5d3e80c64af9604ad798282cc6861f9cd2afc52 16-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix Objective-C compilation-time performance regression introduced in r152608.

Reintroduce lazy name lookup table building, ensuring that the lazy building step
produces the same lookup table that would be built by the eager step.

Avoid building a lookup table for the translation unit outside C++, even in cases
where we can't recover the contents of the table from the declaration chain on
the translation unit, since we're not going to perform qualified lookup into it
anyway. Continue to support lazily building such lookup tables for now, though,
since ASTMerge uses them.

In my tests, this performs very similarly to ToT with r152608 backed out, for C,
Obj-C and C++, and does not suffer from PR10447.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152905 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
cc2f77a7dbc5fb58fe188d55fbfb074e80fe5663 15-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Sema] Introduce a data recursive evaluator specific to binary operators.

This allows us to handle extreme cases of chained binary operators without causing stack
overflow.
The binary operators that are handled with the data recursive evaluator are
comma, logical, or operators that have operands with integral or enumeration type.

Part of rdar://10941790.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152819 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
649dfbc389671d0c852ead5953da630d675a5d43 15-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove hacky temporary fix of r151585.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152818 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cad313bd7b28674e0e409e610c450a2411107443 15-Mar-2012 Sean Callanan <scallanan@apple.com> When laying out an Objective-C object, consult
the external source to complete the Decl if it
hasn't been completed already.

This fixes a crash in LLDB.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152807 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5cfc7d85fe13f144c9a8b264d6de9d38dfebc383 15-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r152761 (reverted in r152772) with a fix for the issue which was
breaking bootstrap. No test yet: it's quite hard to tickle the failure case.
The specific testcase for this wouldn't be useful for testing anything more
general than a reintroduction of this precise bug in any case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152775 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7267839dc2fe8ec16445081c3b740ffda5ead217 15-Mar-2012 Daniel Dunbar <daniel@zuster.org> Revert r152761 "Minor optimization to constant evaluation: don't bother
computing expr source...", it breaks bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152772 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d75fb492f7616046797bfe5353e9478d8e25628e 15-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Minor optimization to constant evaluation: don't bother computing expr source
locations for diagnostics we're not going to emit, and don't track the subobject
designator outside C++11 (since we're not going to use it anyway).

This seems to give about a 0.5% speedup on 403.gcc/combine.c, but the results
were sufficiently noisy that I can't reject the null hypothesis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152761 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f1c66b40213784a1c4612f04c14cafa2b0e89988 15-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Instantiating a class template should not instantiate the definition of any
scoped enumeration members. Later uses of an enumeration temploid as a nested
name specifier should cause its instantiation. Plus some groundwork for
explicit specialization of member enumerations of class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152750 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4b1f684416980ef6f1a7cb9e6af9c4fa4a164617 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow vectors to be constructed from constexpr function arguments in
constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152665 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
65daef179790a02eab1b5a989f53984375a06483 13-Mar-2012 Nick Lewycky <nicholas@mxc.ca> It never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
don't, and clean up the places that do it.

The change to ASTWriter is surprising, but the deleted code is a no-op as of
r152608.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152609 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1b7f9cbed1b96b58a6e5f7808ebc9345a76a0936 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10447: lazily building name lookup tables for DeclContexts was broken.
The deferred lookup table building step couldn't accurately tell which Decls
should be included in the lookup table, and consequently built different tables
in some cases.

Fix this by removing lazy building of DeclContext name lookup tables. In
practice, the laziness was frequently not worthwhile in C++, because we
performed lookup into most DeclContexts. In C, it had a bit more value,
since there is no qualified lookup.

In the place of lazy lookup table building, we simply don't build lookup tables
for function DeclContexts at all. Such name lookup tables are not useful, since
they don't capture the scoping information required to correctly perform name
lookup in a function scope.

The resulting performance delta is within the noise on my testing, but appears
to be a very slight win for C++ and a very slight loss for C. The C performance
can probably be recovered (if it is a measurable problem) by avoiding building
the lookup table for the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152608 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a5f4441de7890953460d95f4e88b9fa432b48dc2 13-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators instead of
ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use
even if the caller did not check that the interface is a definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152597 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
78dae24600a877f52dbb6e58bfd5778754a00974 13-Mar-2012 John McCall <rjmccall@apple.com> Alternate fix to PR12248: put Sema in charge of special-casing
the diagnostic for assigning to a copied block capture. This has
the pleasant side-effect of letting us special-case the diagnostic
for assigning to a copied lambda capture as well, without introducing
a new non-modifiable enumerator for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152593 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
71930e02730f3afecd6e71e4d6831b4a07436a7f 12-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we treat variables captured by reference in lambda as modifiable lvalues. Regression from r152491. Fixes PR12248.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152573 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
d8b5ca14277e142506daed181ecff9151dfae32c 12-Mar-2012 Jordy Rose <jediknil@belkadan.com> ObjCBoolLiterals (__objc_yes/__objc_no) behave like C++ booleans (true/false). They are NOT objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152564 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ecordLayoutBuilder.cpp
tmtDumper.cpp
tmtPrinter.cpp
ype.cpp
TableBuilder.cpp
8e55ed1ad3acf9c7f8424aa7d326b3b2c18e943b 11-Mar-2012 Douglas Gregor <dgregor@apple.com> Add a missing 'template' keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152526 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2f47c366bcc28f54f22df6b4266b5d14de302ced 10-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> The type of a definition should not increase its visibility. Fixes PR12221.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152493 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f4b88a45902af1802a1cb42ba48b1c474474f228 10-Mar-2012 John McCall <rjmccall@apple.com> Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclTemplate.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
89da8cf16b671845660711d3dd4174a809ca6cca 10-Mar-2012 John McCall <rjmccall@apple.com> Fix the dumping of BlockExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152478 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
79a55010ed5afa88939e74186494ecfadefbfa43 10-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix a use of the C99 PRI format macros not to conflict with C++11 UDLs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152475 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
540659e102670e08773986862b191ed2c46a0e86 10-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Make sure the accessors for overridden methods don't return inherited constructors. Fixes PR12219.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152470 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0069b84c2aa7cc39263e85997b7cb1ed0b132ccd 10-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Assign APValues by swapping from a temporary. Removes a bunch of unnecessary
copy-construction, which Daniel Dunbar reports as giving a 0.75% speedup on
403.gcc/combine.c. The performance differences on my constexpr torture tests
are below the noise floor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152455 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
ba50b3e8bc68bace2f6715111bbbb8510965be01 09-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow serializing an invalid ParmVarDecl and don't set access to public for
invalid ParmVarDecls.

Part of rdar://11007039.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152437 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
96a0014f9b963d8a987f1cccd48808a47f9c6331 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size().

I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
tmt.cpp
8fbc6d23d61213750ba1fdcb0b4b9d3d54bbc32f 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Define a few more key getLocStart() implementations.
- This cuts the # of getSourceRange calls by 60% on
OGF/NSBezierPath-OAExtensions.m.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152412 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
90e25a8b2cc5d006e4ced052bcdb40c8af999456 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
- getSourceRange() can be very expensive, we should try to avoid it if at all possible.

In conjunction with the previous commit I measured a ~2% speedup on 403.gcc/combine.c and a 3% speedup on OmniGroupFrameworks/NSBezierPath-OAExtensions.m.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152411 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
396ec676b7a39665fa3a3f86f8e0520f8d7e93a8 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Add {DeclRefExpr,MemberExpr,ImplicitCastExpr}::{getLocStart,getLocEnd} methods.
- There are probably a lot more of these worth adding, but these are a start at hitting some of the exprs for which getSourceRange().getBegin() is a poor substitute for getLocStart().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152410 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ef9f29804fa8932282a17b414ef0dde2ea4eec03 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix statement printing for raw and template user-defined literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152401 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
3a5032b89df601ab2e0c5c7e9667db2301bf10cf 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Literal operator suffixes and regular names live in separate namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152395 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
36f5cfe4df32af6c5fe01228102512996f566f9d 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
bc5419a2edc4030d1a623576fe339fbd3eed17a6 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Memoize ASTContext::getTypeInfo().
- On -emit-llvm-only of 403.gcc/combine.c, for example, we make 160k calls to
getTypeInfo but only ever deal with 680 some distinct types.

I saw these speedups (user time):
403.gcc/combine.c -- 3.1%
OmniGroupFrameworks/NSBezierPath-OAExtensions.m -- 3.6%
JavaScriptCore/Interpreter.cpp -- 1.4%
which seems pretty sweet.

I ran some histograms on those compiles and we end up doing a ton of
getTypeInfo() on 'char' and 'int'. I tried splitting out a fast path for builtin
types, but this wasn't a win. Still kinda seems like we could be doing better
here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152377 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
42f42c8c58fd1b70ed1e84b426312581e656620b 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] NestedNameSpecifier's ctor/dtor are trivial and should be inlined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152365 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
cd485926f1ffda2eaa9adeea34e1e15c35ab5fba 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Type::isVoidType() is trivial and should be inlined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152364 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
3d13c5a1e72ed8f8be9c083791d30643d1b1ec43 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Reduce Decl::getASTContext() calls.
- This function is not at all free; pass it around along some hot paths instead
of recomputing it deep inside various VarDecl methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152363 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
56757e9eaff77fb106662fa88793af866a6267d0 08-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Untangle getUnderlyingDeclImpl, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152339 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7a8c758868f00b7fbe105ad2b469a289cfc92b6d 08-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] APValue: Split the fast path of MakeUninit to be inline.
- This change seems to be a tiny loss on 403.gcc/combine.c (.2%), but I think
it is the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152330 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
6daffa5d6031eee8b25fc2c745dd6b58b039a6eb 08-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Change NamedDecl::getUnderlyingDecl() to inline the fast (and incredibly common) path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152321 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
916883004c36291b70355d5e73abb05e138804fb 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure we don't print 123ULL_foo when printing a user-defined integer literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152303 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
76e035a529775dc8fd31124f819745a33a085796 08-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Change Type::isIntegerType to be inlined(). It is very popular.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152289 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
5bc37f6e0c932e7a8e0af92b6266372dc7b94cd9 08-Mar-2012 Douglas Gregor <dgregor@apple.com> Loosen the precondition of isCXXInstanceMember() to simply return
"false" for declarations that aren't members of classes. Fixes PR12106.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152284 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9fcce65e7e1307b5b8da9be13e4092d6bb94dc1d 07-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> AST representation for user-defined literals, plus just enough of semantic
analysis to make the AST representation testable. They are represented by a
new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic
properties, including full CodeGen support, are achieved for free by this
representation.

UserDefinedLiterals can never be dependent, so no custom instantiation
behavior is required. They are mangled as if they were direct calls to the
underlying literal operator. This matches g++'s apparent behavior (but not its
actual mangling, which is broken for literal-operator-ids).

User-defined *string* literals are now fully-operational, but the semantic
analysis is quite hacky and needs more work. No other forms of user-defined
literal are created yet, but the AST support for them is present.

This patch committed after midnight because we had already hit the quota for
new kinds of literal yesterday.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152211 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
9e9c454b12671a624f666fc6fbf132fdf183effc 07-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we consistently canonicalize types when canonicalizing TemplateTemplateParmDecls. PR12179.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152189 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
485ea8e8ea6fd0ab406f10795e35087ee9a07689 07-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> The constant folder's diagnosic mechanism is irrelevant for C; don't bother
producing a C-only diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152181 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
047da195aee797341c86d38cc7e3a7e619274dab 07-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] VarDecl::hasDefinition() - Early exit if we find a strong definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152166 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
60d302a707fb35b9acf41bf5495296c4af947045 07-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] FunctionDecl::getBuiltinID() - Eliminate spurious calls to getASTContext
-- which is very much not free -- in the common case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152165 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ebcb57a8d298862c65043e88b2429591ab3c58d3 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals. This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch. It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
SAPI.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
f9aa3635fccb3dc0925ef4d27dfa2b692a8e6a90 06-Mar-2012 Daniel Dunbar <daniel@zuster.org> AST: Move several Type::is...Type() functions to be inline.
- These functions are both (a) very commonly called and (b) excellent
candidates for CSE in the callers in which they are commonly used.
- That isHalfType() is hot makes me sad, but it is trivially when inlined (and
a huge waste of time when not!!!).
- The extra IsEnumDeclComplete() function is a hack to break the cycle between
Type.h and Decl.h, I'm not sure of how to do this more cleanly, but am open
to ideas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152126 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
c1b0f7fa9b755ab59129ae85187d0d4f91379995 06-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use TinyPtrVector instead of UsuallyTinyPtrVector.

The latter is just a worse version of the former.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152096 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
361035524dc26094825134f30c07311f38f4f8b1 06-Mar-2012 Stephen Hines <srhines@google.com> Merge with upstream Clang @152062.

Added include/clang/Config/config.h
(note the ANDROID_CONFIG_H header guard because CONFIG_H is already taken)

Added support for AttrTemplateInstantiate TableGen rules.

Added libLLVMVectorize dependency.

Build
-HostInfo.cpp
-CallGraph.cpp
+GlobalCallGraph.cpp
-MultiInitializer.cpp
+PPCallbacks.cpp
+SemaConsumer.cpp
+ChainedDiagnosticConsumer.cpp
+DependencyGraph.cpp
+DiagnosticRenderer.cpp
+LayoutOverrideSource.cpp
+WindowsToolChain.cpp
+SemaLambda.cpp
+BoolAssignmentChecker.cpp
+LambdaMangleContext.cpp
+CStringSyntaxChecker.cpp
+ObjCContainersASTChecker.cpp
+ObjCContainersChecker.cpp
+VirtualCallChecker.cpp
+Dominators.cpp
+SubEngine.cpp
+RewriteModernObjC.cpp

Change-Id: Ifda805ce87ae132f055131f4f83692b5c3d63d17
ndroid.mk
91932089c31e1233f0c478b03412e90a65e07ad2 05-Mar-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-20120305

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Ib76c138030a701355ce39a6eda1a89a79f401667
02892a65b18875a04c7ed5eadb3a13be801ab477 05-Mar-2012 Daniel Dunbar <daniel@zuster.org> AST/stats: Don't effectively use an out-of-line function to return a static
bool. Ugh.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152062 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
tmt.cpp
12fc4b0624706b474fa10308631fa8daf92f340f 05-Mar-2012 Peter Collingbourne <peter@pcc.me.uk> Properly handle non-canonical underlying types in
ASTContext::getUnaryTransformType. This can happen if, for example,
an enumeration's underlying type is a typedef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152031 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b3c312ce4d94a037a83ba6df6650b0317b15edd1 05-Mar-2012 James Molloy <james.molloy@arm.com> Fix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not be seen to be in ::std::.

Migrate two other places where the same logic is used to use the helper function that already exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152022 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
1aa0be86358002fe876e5a4a00c3038c96be28ee 03-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Remove APValue/CCValue distinction. It is no longer useful given the
resolution of core issue 1454.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151991 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
16412ef25a2203b7066d0db2b41f944631e5cf79 03-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Avoid an unnecessary recursive loop between type canonicalization and NNS canonicalization which would (rarely) lead to memory corruption. While I'm here, simplify. Fixes PR12166. Not committing a testcase because it's impossible to reduce it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151967 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5a61e0c4229dc82617a37a68ac2fc08d46e00488 02-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Sema] Fix crash-on-invalid-code issue:

@class I;
@implementation I(cat) // crashes here
@end

rdar://10968158

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151931 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
16581335fc32abcbc6ab14eda7af38cf759664b7 02-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure that we instantiate static reference data members of class templates
early, since their values can be used in constant expressions in C++11. For
odr-use checking, the opposite change is required, since references are
odr-used whether or not they satisfy the requirements for appearing in a
constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151881 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
32ad2ee2618745ce3da51c2ae066ed5f21157c07 01-Mar-2012 Ted Kremenek <kremenek@apple.com> Change @import to @__experimental_modules_import. We are not ready to commit to a particular syntax for modules,
and don't have time to push it forward in the near future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151841 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
b2c60b04a597cc5ba4154837cf8e0a155a376fd7 01-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.

Needs llvm update.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151829 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
dca1761c9b91d0a730ac6368425dc978e8481392 01-Mar-2012 Peter Collingbourne <peter@pcc.me.uk> StmtProfiler: Add a null check for child statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151812 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
77bfb8b43ec3f7dee3a71f6e854b03ad29dab84f 29-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: provide fixit hint when atomic property does not
have matching user defined setter/getter and a warning is issued.
In this case, a fixit note is displayed. // rdar://10267155


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151766 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
fd819783aafa39b3bfdfcc095270352074ef4734 29-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a couple -Wuninitialized warnings from gcc. Reported by David Greene.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151754 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
16f1f717af196b1448258857b2e6dcfe144b39d0 29-Feb-2012 James Molloy <james.molloy@arm.com> Reapply r151638 and r151641.

The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation.

These are now fixed, with regression tests added to catch them both (not Darwin-specific).

Original log:
====================

Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

====================




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
umpXML.cpp
32a9a7543f0296b0ae141899005f788bbe4262ca 29-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
umpXML.cpp
fbcf0405b7da1c8606e4223b4f91835643ecd5b4 28-Feb-2012 James Molloy <james.molloy@arm.com> Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
umpXML.cpp
c1b66e6003262b284937b542aa159a0c79619ff4 28-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When evaluating integer expressions include a check for sub-expressions
depth and error if we exceed a max value, to make sure we avoid a stack overflow.

This is a hacky temporary fix. rdar://10913206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151585 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d411a4b23077b29e19c9371bbb19b054a374d922 27-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert testing code I committed by mistake in r151464.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151548 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d162cf102449d817a35ae6755b102edcf9d4583b 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Reorder members to save padding.

There's more potential here, but these Exprs aren't used that often so I don't feel like doing heroic bit packing right now.

-8 bytes on every class changed (x86_64).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151501 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2fa975c94027c6565cb112ffcf93c05b22922c0e 26-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r151460 as it is not enough to address the issue.

Original log:
When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151464 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
faf4ef62b6a4f5b0638e4fb7f77c33a8935bd003 25-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Richard Smith pointed out that there already is a proposal for init list mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151462 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
8ed20910d8b5c35d28c5cbe7e9170d40837192dd 25-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151460 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b76ffc5667e9bb45c63d61ebbd07e66a0456ca4f 25-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Better mangling for new-expressions. Also, although we can't mangle arbitrary initializer lists yet (we will need this), turn the crash into a controlled error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151455 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
13a140caba448a66ffcc5ff0d32a87d6e4f4ad3f 25-Feb-2012 Ahmed Charles <ace2001ac@gmail.com> ArrayRef'ize various functions in the AST/Parser/Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151447 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
dfefb840e36f069286ef6cf178ef339c90f4603d 25-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes and
data members for deleted or user-provided destructors.

Now it's computed in advance, serialize it, and in passing fix all the other
record DefinitionData flags whose serialization was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151441 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
359c89df5479810c9d4784fc0b6ab592eb136777 24-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> When checking whether a reference to a variable is an ICE, look at the type of
the declaration, not at the type of the DeclRefExpr, since within a lambda the
DeclRefExpr can be more const than the declaration is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151399 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0fd7f4db69ea75bde3d5fd7365165c6f43d78be5 24-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Revert r151357. That unreachable is reachable...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151359 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
770dc0342c21f444b878d74ee5e1f4d25b5913a5 24-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Silence gcc warnings pointing out that CharByteWidth could be used
uninitialized. While there, restyle this function! No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151357 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f6cfe8ba2b4d98c20181568e449edf0b60904b03 24-Feb-2012 Douglas Gregor <dgregor@apple.com> Remove some trivial uses of hasTrivialCopyConstructor() and
hasTrivialMoveConstructor().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151354 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4ca8ac2e61c37ddadf37024af86f3e1019af8532 24-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement a new type trait __is_trivially_constructible(T, Args...)
that provides the behavior of the C++11 library trait
std::is_trivially_constructible<T, Args...>, which can't be
implemented purely as a library.

Since __is_trivially_constructible can have zero or more arguments, I
needed to add Yet Another Type Trait Expression Class, this one
handling arbitrary arguments. The next step will be to migrate
UnaryTypeTrait and BinaryTypeTrait over to this new, more general
TypeTrait class.

Fixes the Clang side of <rdar://problem/10895483> / PR12038.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151352 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
eb2f220b334fc77202864c1a57246361f262b5e1 23-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Actually remove the duplicated elements from the vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151270 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
d0e49e587afd15ccc6c2f910a979f0d3d602d166 23-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Unique CXXBasePath decls with the SmallVector/pod_sort/std::unique idiom instead of employing a wasteful std::set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151255 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
b11e52540166a2958439cfe562c25931e4460759 23-Feb-2012 Douglas Gregor <dgregor@apple.com> Seriously, are injected-class-names that hard?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151241 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
25d0a0f67d9e949ffbfc57bf487012f5cbfd886e 23-Feb-2012 Douglas Gregor <dgregor@apple.com> Provide the __is_trivially_assignable type trait, which provides
compiler support for the std::is_trivially_assignable library type
trait.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151240 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
860097c4ee7a365b6d462436659082c8355e03fd 23-Feb-2012 Rafael Espindola <rafael.espindola@gmail.com> Two fixes to how we compute visibility:

* Handle some situations where we should never make a decl more visible,
even when merging in an explicit visibility.

* Handle attributes in members of classes that are explicitly specialized.

Thanks Nico for the report and testing, Eric for the initial review, and dgregor
for the awesome test27 :-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151236 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
341785ec52f87c0803ba52dc88faac4e136f8593 22-Feb-2012 Bill Wendling <isanbard@gmail.com> More ArrayRef-ification of methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151152 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
eclBase.cpp
ac1303eca6cbe3e623fb5ec6fe7ec184ef4b0dfa 22-Feb-2012 Douglas Gregor <dgregor@apple.com> Generate an AST for the conversion from a lambda closure type to a
block pointer that returns a block literal which captures (by copy)
the lambda closure itself. Some aspects of the block literal are left
unspecified, namely the capture variable (which doesn't actually
exist) and the body (which will be filled in by IRgen because it can't
be written as an AST).

Because we're switching to this model, this patch also eliminates
tracking the copy-initialization expression for the block capture of
the conversion function, since that information is now embedded in the
synthesized block literal. -1 side tables FTW.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151131 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
xprConstant.cpp
tmtDumper.cpp
51e47df5a57430f1b691b04258e663cce68aef9d 21-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a crash in the diangostic code in EvalConstant. PR12043.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151100 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f4b7de1cef3007cc0479775638198287384d9af1 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Improve our handling of lambda expressions that occur within default
arguments. There are two aspects to this:

- Make sure that when marking the declarations referenced in a
default argument, we don't try to mark local variables, both because
it's a waste of time and because the semantics are wrong: we're not
in a place where we could capture these variables again even if it
did make sense.
- When a lambda expression occurs in a default argument of a
function template, make sure that the corresponding closure type is
considered dependent, so that it will get properly instantiated. The
second bit is a bit of a hack; to fix it properly, we may have to
rearchitect our handling of default arguments, parsing them only
after creating the function definition. However, I'd like to
separate that work from the lambdas work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151076 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
5878cbcfaa90b8515550db86033fd5a0efab971d 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement non-internal linkage for lambda closure types that need a
stable mangling, since these lambdas can end up in multiple
translation units. Sema is responsible for deciding when this is the
case, because it's already responsible for choosing the mangling
number.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151029 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprCXX.cpp
taniumMangle.cpp
552e29985a710f4ced62b39d70557501bd31ca9b 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement name mangling for lambda expressions that occur within the
initializers of data members (both static and non-static).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151017 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
ccc1b5eebc6ca8a904c58c0468b9a71483b7c7cf 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement name mangling for lambda expressions that occur within the
default arguments of function parameters. This simple-sounding task is
complicated greatly by two issues:

(1) Default arguments aren't actually a real context, so we need to
maintain extra state within lambda expressions to track when a
lambda was actually in a default argument.
(2) At the time that we parse a default argument, the FunctionDecl
doesn't exist yet, so lambda closure types end up in the enclosing
context. It's not clear that we ever want to change that, so instead
we introduce the notion of the "effective" context of a declaration
for the purposes of name mangling.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151011 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
taniumMangle.cpp
af300298ab86752fa64e339ba34195888a830756 20-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> modern objc translator. Finish off first cut of the
modern meta-data translation by commenting out private ivar
declarations in user source. Also, added several tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150985 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
9e8c92a9c9b949bbb0408fbbd9a58e34894b6efc 20-Feb-2012 Douglas Gregor <dgregor@apple.com> Basic support for name mangling of C++11 lambda expressions. Because
name mangling in the Itanium C++ ABI for lambda expressions is so
dependent on context, we encode the number used to encode each lambda
as part of the lambda closure type, and maintain this value within
Sema.

Note that there are a several pieces still missing:
- We still get the linkage of lambda expressions wrong
- We aren't properly numbering or mangling lambda expressions that
occur in default function arguments or in data member initializers.
- We aren't (de-)serializing the lambda numbering tables




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150982 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
xprCXX.cpp
taniumMangle.cpp
ambdaMangleContext.cpp
19562c97669532084a71895197f4444305dd432a 20-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> ObjCMessageExpr: Don't leave SelLocsKind uninitialized when the send is implicit.

Fixes PR11929. Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150943 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
24fe798fffc1748d8bce1321af42981c3719cb85 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Refuse to compile global std::initializer_lists instead of doing completely the wrong thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150928 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e8e92b9dccc362be33a7f9bb84a114b18db65b10 19-Feb-2012 Ahmed Charles <ace2001ac@gmail.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150919 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
86024013d4c3728122c58fa07a2a67e6c15837ef 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement constant expression support for __real__ and __imag__ on lvalue
complex numbers. Treat complex numbers as arrays of the corresponding component
type, in order to make std::complex behave properly if implemented in terms of
_Complex T.

Apparently libstdc++'s std::complex is implemented this way, and we were
rejecting a member like this:

constexpr double real() { return __real__ val; }

because it was marked constexpr but unable to produce a constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150895 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e215ba1c2a3f29fe2cbc4cfb0e532cd204970c49 18-Feb-2012 Ted Kremenek <kremenek@apple.com> Fix crash in analyzer diagnostic generation involving subexpressions of OpaqueValueExpr not appearing in the ParentMap. Fixes <rdar://problem/10797980>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150894 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
b78ae9716576399145786b93f687943f8b197170 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a problem in the GCC testsuite, exposed by r150557. Compound literals
are represented as prvalues in C++; don't be fooled into thinking they're
global lvalues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150870 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
32cf1f27ae8620e7b79bb4e81a067187c0aab7ae 17-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Basic code generation support for std::initializer_list.

We now generate temporary arrays to back std::initializer_list objects
initialized with braces. The initializer_list is then made to point at
the array. We support both ptr+size and start+end forms, although
the latter is untested.

Array lifetime is correct for temporary std::initializer_lists (e.g.
call arguments) and local variables. It is untested for new expressions
and member initializers.

Things left to do:
Massively increase the amount of testing. I need to write tests for
start+end init lists, temporary objects created as a side effect of
initializing init list objects, new expressions, member initialization,
creation of temporary objects (e.g. std::vector) for initializer lists,
and probably more.
Get lifetime "right" for member initializers and new expressions. Not
that either are very useful.
Implement list-initialization of array new expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150803 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f3908f2ae111b1b12ade2524dda71c669ed6f121 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make sure all remaining parts of the constant evaluator are aware that an array
can be represented by an LValue, and use that to simplify the code a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150789 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a345edb668380691fc92d4e4aa0a5ffec366ca6a 17-Feb-2012 John McCall <rjmccall@apple.com> Block expressions always have a prototyped function type; expose this
in the AST accessor and micro-optimize it very slightly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150787 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
27dd7d962bbf774988bc5e59d04a7743ed503514 17-Feb-2012 Douglas Gregor <dgregor@apple.com> Rework the Sema/AST/IRgen dance for the lambda closure type's
conversion to function pointer. Rather than having IRgen synthesize
the body of this function, we instead introduce a static member
function "__invoke" with the same signature as the lambda's
operator() in the AST. Sema then generates a body for the conversion
to function pointer which simply returns the address of __invoke. This
approach makes it easier to evaluate a call to the conversion function
as a constant, makes the linkage of the __invoke function follow the
normal rules for member functions, and may make life easier down the
road if we ever want to constexpr'ify some of lambdas.

Note that IR generation is responsible for filling in the body of
__invoke (Sema just adds a dummy body), because the body can't
generally be expressed in C++.

Eli, please review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150783 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ce582fe2a7aad8b14b3636ad9cac0a3b8bbb219b 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12012: Fix a regression in r150419 where we would try (and fail) to
zero-initialize class types with virtual bases when constant-evaluating an
initializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150770 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ebc6af1279178e1d5f4dcd9f1bbf0f06d89e3a53 16-Feb-2012 Matt Beaumont-Gay <matthewbg@google.com> Pacify gcc's -Wreturn-type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150731 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2aed8b88613863f3c439cdfb205bdf8b608fb205 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.""

This reintroduces commit r150682 with a fix for the Bullet benchmark crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150685 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
1548d14f4092a817f7d90ad3e7a65266dc85fbc5 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."
It leads to a compiler crash in the Bullet benchmark.

This reverts commit r12014.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150684 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
5f688f4b15d02aa7ad159c46b1f78fe59d412f12 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.

Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities.

This breaks the static analysis of new expressions. I've filed PR12014 to track this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150682 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
74e1ad93fa8d6347549bcb10279fdf1fbc775321 16-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr tidyups:
* Fix bug when determining whether && / || are potential constant expressions
* Try harder when determining whether ?: is a potential constant expression
* Produce a diagnostic on sizeof(VLA) to provide a better source location


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150657 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f6e2e0291b8964ed41b4325e21dd90b86e791f10 16-Feb-2012 Douglas Gregor <dgregor@apple.com> Implicitly define a lambda's conversion functions (to function
pointers and block pointers). We use dummy definitions to keep the
invariant that an implicit, used definition has a body; IR generation
will substitute the actual contents, since they can't be represented
as C++.

For the block pointer case, compute the copy-initialization needed to
capture the lambda object in the block, which IR generation will need
later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150645 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e4e68d45f89ff4899d30cbd196603d09b7fbc150 15-Feb-2012 Douglas Gregor <dgregor@apple.com> When overload resolution picks an implicitly-deleted special member
function, provide a specialized diagnostic that indicates the kind of
special member function (default constructor, copy assignment
operator, etc.) and that it was implicitly deleted. Add a hook where
we can provide more detailed information later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150611 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
83587db1bda97f45d2b5a4189e584e2a18be511a 15-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1454. This allows all intermediate results in constant expressions
to be core constant expressions (including pointers and references to
temporaries), and makes constexpr calculations Turing-complete. A Turing machine
simulator is included as a testcase.

This opens up the possibilty of removing CCValue entirely, and removing some
copies from the constant evaluator in the process, but that cleanup is not part
of this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150557 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
4d4e5c1ae83f4510caa486b3ad19de13048f9f04 15-Feb-2012 John McCall <rjmccall@apple.com> Split reinterpret_casts of member pointers out from CK_BitCast; this
is general goodness because representations of member pointers are
not always equivalent across member pointer types on all ABIs
(even though this isn't really standard-endorsed).

Take advantage of the new information to teach IR-generation how
to do these reinterprets in constant initializers. Make sure this
works when intermingled with hierarchy conversions (although
this is not part of our motivating use case). Doing this in the
constant-evaluator would probably have been better, but that would
require a *lot* of extra structure in the representation of
constant member pointers: you'd really have to track an arbitrary
chain of hierarchy conversions and reinterpretations in order to
get this right. Ultimately, this seems less complex. I also
wasn't quite sure how to extend the constant evaluator to handle
foldings that we don't actually want to treat as extended
constant expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150551 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
26f2cac83eeb4317738d74b9e567d3d58aa04ed9 14-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: evaluation support for nullptr comparisons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150521 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
70488e201ccd94d4bb1ef0868cc13cca2b7d4ff6 14-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Pending clear answer from WG21 on whether core issue 903 is intended to apply to
C++11 or just C++17, restrict the set of null pointer constants in C++11 mode
back to those which were considered null in C++98.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150510 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
9d36f5dc4121f0f931211ea2d0a74d299eb82b23 14-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement AST (de-)serialization for lambda expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150491 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7ca4850a3e3530fa6c93b64b740446e32c97f992 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Deal with a horrible C++11 special case. If a non-literal type has a constexpr
constructor, and that constructor is used to initialize an object of static
storage duration such that all members and bases are initialized by constant
expressions, constant initialization is performed. In this case, the object
can still have a non-trivial destructor, and if it does, we must emit a dynamic
initializer which performs no initialization and instead simply registers that
destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150419 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
dfca6f53ab97d28d43e3fa2564209df08f3d282c 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce support for template instantiation of lambda
expressions. This is mostly a simple refact, splitting the main "start
a lambda expression" function into smaller chunks that are driven
either from the parser (Sema::ActOnLambdaExpr) or during AST
transformation (TreeTransform::TransformLambdaExpr). A few minor
interesting points:

- Added new entry points for TreeTransform, so that we can
explicitly establish the link between the lambda closure type in the
template and the lambda closure type in the instantiation.
- Added a bit into LambdaExpr specifying whether it had an explicit
result type or not. We should have had this anyway.

This code is 'lightly' tested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150417 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
43a1b00153a60e3bab1ff66e4674b1bc13d23817 13-Feb-2012 Matt Beaumont-Gay <matthewbg@google.com> Sink variable into assert

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150407 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7ae282fde0a12635893931ebf31b35b0d5d5cab3 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Split the storage of lambda information between the LambdaExpr and the
CXXRecordDecl in a way that actually makes some sense:
- LambdaExpr contains all of the information for initializing the
lambda object, including the capture initializers and associated
array index variables.
- CXXRecordDecl's LambdaDefinitionData contains the captures, which
are needed to understand the captured variable references in the
body of the lambda.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150401 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
9daa7bfdff7256cef693d7bf10084881bcb9253c 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Keep track of the set of array index variables we use when we
synthesize a by-copy captured array in a lambda. This information will
be needed by IR generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150396 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
908a595945cbcbdb0232cec8ce61b0eeb5c17ff6 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Don't allocate unused storage for captures/capture initializers in lambda expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150394 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
da8962a6198bc4bf09a38209db99551b2b0a41a0 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Move the storage of lambda captures and capture initializers from
LambdaExpr over to the CXXRecordDecl. This allows us to eliminate the
back-link from the closure type to the LambdaExpr, which will simplify
and lazify AST deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150393 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
86c3ae46250cdcc57778c27826060779a92f3815 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update constexpr implementation to match CWG's chosen approach for core issues
1358, 1360, 1452 and 1453.
- Instantiations of constexpr functions are always constexpr. This removes the
need for separate declaration/definition checking, which is now gone.
- This makes it possible for a constexpr function to be virtual, if they are
only dependently virtual. Virtual calls to such functions are not constant
expressions.
- Likewise, it's now possible for a literal type to have virtual base classes.
A constexpr constructor for such a type cannot actually produce a constant
expression, though, so add a special-case diagnostic for a constructor call
to such a type rather than trying to evaluate it.
- Classes with trivial default constructors (for which value initialization can
produce a fully-initialized value) are considered literal types.
- Classes with volatile members are not literal types.
- constexpr constructors can be members of non-literal types. We do not yet use
static initialization for global objects constructed in this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150359 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprConstant.cpp
f8af98286022f72157d84951b48fde5fb369ab29 12-Feb-2012 Douglas Gregor <dgregor@apple.com> Within the body of a lambda expression, decltype((x)) for an
id-expression 'x' will compute the type based on the assumption that
'x' will be captured, even if it isn't captured, per C++11
[expr.prim.lambda]p18. There are two related refactors that go into
implementing this:

1) Split out the check that determines whether we should capture a
particular variable reference, along with the computation of the
type of the field, from the actual act of capturing the
variable.
2) Always compute the result of decltype() within Sema, rather than
AST, because the decltype() computation is now context-sensitive.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150347 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
5b9cc5df25c2198f270dd1d5c438fdce70d4051d 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Represent C++ direct initializers as ParenListExprs before semantic analysis
instead of having a special-purpose function.

- ActOnCXXDirectInitializer, which was mostly duplication of
AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
ago), is dropped completely.
- MultiInitializer, which was an ugly hack I added, is dropped again.
- We now have the infrastructure in place to distinguish between
int x = {1};
int x({1});
int x{1};
-- VarDecl now has getInitStyle(), which indicates which of the above was used.
-- CXXConstructExpr now has a flag to indicate that it represents list-
initialization, although this is not yet used.
- InstantiateInitializer was renamed to SubstInitializer and simplified.
- ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
always produces a ParenListExpr. Placed that so far failed to convert that
back to a ParenExpr containing comma operators have been fixed. I'm pretty
sure I could have made a crashing test case before this.

The end result is a (I hope) considerably cleaner design of initializers.
More importantly, the fact that I can now distinguish between the various
initialization kinds means that I can get the tricky generalized initializer
test cases Johannes Schaub supplied to work. (This is not yet done.)

This commit passed self-host, with the resulting compiler passing the tests. I
hope it doesn't break more complicated code. It's a pretty big change, but one
that I feel is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150318 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
umpXML.cpp
xpr.cpp
xprCXX.cpp
41105ad37a2de9bccfcd8137ccfa869cc8345275 11-Feb-2012 Eli Friedman <eli.friedman@gmail.com> const-qualify CXXRecordDecl::getCaptureFields.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150284 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eefb3d5b49c844347f212073a7e975b8118fe8e9 10-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Track whether a function type has a trailing return type as type sugar. Use this
to pretty-print such function types better, and to fix a case where we were not
instantiating templates in lexical order. In passing, move the Variadic bit from
Type's bitfields to FunctionProtoType to get the Type bitfields down to 32 bits.
Also ensure that we always substitute the return type of a function when
substituting explicitly-specified arguments, since that can cause us to bail
out with a SFINAE error before we hit a hard error in parameter substitution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150241 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
4d8d22bfaed6e5d7da6b5556415b18c43b44e36c 10-Feb-2012 Douglas Gregor <dgregor@apple.com> Extend CXXRecordDecl with a function that determines the mapping from
the variables captured by a lambda to the fields that store the
captured values. To be used in IRgen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150235 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
864b1cf13b288c5099911e1265431ffdcac060a4 10-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update to new resolution for DR1458. When taking the address of an object of
incomplete class type which has an overloaded operator&, it's now just
unspecified whether the overloaded operator or the builtin is used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bb3d14e55d267bf5228699c7bf0c8ccdb71c8f46 09-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> objc: If a method is not implemented in the category implementation but
has been declared in its primary class, superclass,
or in one of their protocols, no need to issue unimplemented method.
// rdar://10823023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150206 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b4e5e286a5cd156247720b1eb204abaa8e09568d 09-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> CWG issue 1405: mutable members are allowed in literal types, but can't undergo
lvalue-to-rvalue conversions in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150145 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprConstant.cpp
4bbb8501d9db2ae72b1e39afaafa5795d67ffe03 09-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Avoid using Decl::setAttrs() and Decl::setLexicalDeclContext() from the ASTReaderDecl
directly; they internally call Decl::getASTContext() which may crash if a declaration context
parent is still deserializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150137 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
2fd5983e0da447291a651a347c206aee37a1de5f 08-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1458: Taking the address of an object of incomplete class type is
not a constant expression, because we can't tell whether the complete class type
will have an overloaded operator&.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150066 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
925d8e7c0f18e03dc4bc634b3c6c1ec09373d993 08-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement the agreed resolution to DR1457: a signed left shift of a 1 bit into
the sign bit doesn't have undefined behavior, but a signed left shift of a 1 bit
out of the sign bit still does. As promised to Howard :)

The suppression of the potential constant expression checking in system headers
is also removed, since the problem it was working around is gone.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150059 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
200fa53fd420aa8369586f569dbece04930ad6a3 08-Feb-2012 John McCall <rjmccall@apple.com> Revise the SplitQualType interface to make it its own thing instead of
a typedef of std::pair. This slightly improves type-safety, but mostly
makes code using it clearer to read as well as making it possible to add
methods to the type.

Add such a method for efficiently single-step desugaring a split type.
Add a method to single-step desugaring a locally-unqualified type.
Implement both the SplitQualType and QualType methods in terms of that.

Also, fix a typo ("ObjCGLifetime").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150028 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
ype.cpp
ypePrinter.cpp
fd5a5f547c5012197475ba628947d9755c96cfdc 08-Feb-2012 Sean Callanan <scallanan@apple.com> If a struct needs to be laid out, and it has not
been completed yet, then complete it if possible.
This fixes some assertion failures encountered by
LLDB.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150020 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d7a3e2c5f61cd4893f95b69a424fe4def3aa0f69 07-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line.

This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.

This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99.
This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789.
This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7.
This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f.
This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclarationName.cpp
xprConstant.cpp
taniumMangle.cpp
estedNameSpecifier.cpp
ype.cpp
a59d20b135bfde058a5a69045bab5ec4e2553f74 07-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Print NamedDecls directly to a raw_ostream where possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149982 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateBase.cpp
emplateName.cpp
f978059b82db8c0d849c5f992036210b5ca53200 07-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Switch the ObjC*Decl raw_stream overloads to take a reference, for consistency with NamedDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149981 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
xpr.cpp
angle.cpp
01d08018b7cf5ce1601707cfd7a84d22015fc04e 07-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce basic ASTs for lambda expressions. This covers:
- Capturing variables by-reference and by-copy within a lambda
- The representation of lambda captures
- The creation of the non-static data members in the lambda class
that store the captured variables
- The initialization of the non-static data members from the
captured variables
- Pretty-printing lambda expressions

There are a number of FIXMEs, both explicit and implied, including:
- Creating a field for a capture of 'this'
- Improved diagnostics for initialization failures when capturing
variables by copy
- Dealing with temporaries created during said initialization
- Template instantiation
- AST (de-)serialization
- Binding and returning the lambda expression; turning it into a
proper temporary
- Lots and lots of semantic constraints
- Parameter pack captures


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149977 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
ypePrinter.cpp
a3b9fa2024accdc38e0c8458b5ffd6b5ec0580d5 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make FunctionDecl::doesDeclarationForceExternallyVisibleDefinition use the same logic as FunctionDecl::isInlineDefinitionExternallyVisible to figure out whether to emit a definition. Based on work by Anton Yartsev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149963 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
66581d41527628d4b37f7b05c288f77be7415d7d 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added source location for the template keyword in DependentTemplateSpecializationTypeLoc nodes (DTSTLoc).

The new info is propagated to TSTLoc on template instantiation, getting rid of 3 FIXMEs in TreeTransform.h and another one Parser.cpp.

Simplified code in TypeSpecLocFiller visitor methods for DTSTLoc and DependentNameTypeLoc by removing what now seems to be dead code (adding corresponding assertions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149923 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
210386eb619ea9feef425636150bdffc0538574d 06-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix the result of VarDecl::checkInitIsICE so it is consistently accurate in C++11 mode. PR11928.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149908 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
38a42916cb07fd368d9e2ae1e7915fa896f9ec06 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Removed redundant location info from ElaboratedTypeLoc / DependentNameLoc / DependentTSTLoc. Uniformed names referencing elaborated keyword. No intended functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149889 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
b918d6b1f794266e126e5445d69233462087d764 06-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> objc: fixes a problem in block type comparison involving
enums with underlying type explicitly specified
(feature which is on by default in objective-c).
// rdar://10798770


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149888 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
55d23c925b058be29b792008ddb7d68f6c4fa9a0 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added location for template keyword in TemplateSpecializationTypeLoc. In the process removed some naming ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149870 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypeLoc.cpp
9d9922af13edf3ddf8804a41a98d997324fdd58e 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed instantiation of DependentScopeDeclRefExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149868 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
41576d47d746dacd3d0753d00daf6e47ad4cab5d 06-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement name mangling for scalar value initialization. Reported on IRC by Xeo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149854 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
6496bd10dc3a6d5e3266348f08b6e35f8184bc99 05-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move operator overload out of line. Calling operator<< on a forward declared type doesn't seem to work on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149819 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f7ccbad5d9949e7ddd1cbef43d482553b811e026 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
umpXML.cpp
xpr.cpp
taniumMangle.cpp
angle.cpp
tmtPrinter.cpp
emplateBase.cpp
6f42b62b6194f53bcbc349f5d17388e1936535d7 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9ec7197796a2730d54ae7f632553b5311b2ba3b5 05-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Fix implementation of DR1311: check for volatile qualifiers in
lvalue-to-rvalue conversions on the source type of the conversion, not the
target type (which has them removed for non-class types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149796 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8fe83e1df954d72c0f4ffc15d20a5222ec151c21 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move a method from IdentifierTable.h out of line and remove the SmallString include.

Fix all the transitive include users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
tmtPrinter.cpp
emplateBase.cpp
00bd44d5677783527d7517c1ffe45e4d75a0f56f 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move various diagnostic operator<< overloads out of line and remove includes of Diagnostic.h.

Fix all the files that depended on transitive includes of Diagnostic.h.
With this patch in place changing a diagnostic no longer requires a full rebuild of the StaticAnalyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149781 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclarationName.cpp
xprConstant.cpp
taniumMangle.cpp
estedNameSpecifier.cpp
ype.cpp
ef9b60ffed980864a8db26ad30344be429e58ff5 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move Storage and StorageAllocator out of the PartialDiagnostic class so we can forward declare them.

Let ASTContext allocate the storage in its BumpPtrAllocator.
This will help us remove ASTContext's depedency on PartialDiagnostic.h soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149780 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5ba73e1af8ef519161bd40063dc325457e21676a 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr:
The recent support for potential constant expressions exposed a bug in the
implementation of libstdc++4.6, where numeric_limits<int>::min() is defined
as (int)1 << 31, which isn't a constant expression. Disable the 'constexpr
function never produces a constant expression' error inside system headers
to compensate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149729 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b70126a328f89937f46db42f9e3cba1592887c91 03-Feb-2012 Douglas Gregor <dgregor@apple.com> When a pack expansion occurs in the template argument list of an alias
template without a corresponding parameter pack, don't immediately
substitute the alias template. This is under discussion in the C++
committee, and may become ill-formed, but for now we match GCC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149697 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
8deabc133c121f6c5561d0b2171a41cb2c29b2ce 03-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move isSentinelNullExpr() from Sema to ASTContext to make it more widely
available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149675 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3a5aca8112e03814f78906dc5d032287adb272b5 02-Feb-2012 Anton Yartsev <anton.yartsev@gmail.com> r149587 reverted

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149594 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
13f9f2fa548305c80241ccc1843369fd5964c888 02-Feb-2012 Anton Yartsev <anton.yartsev@gmail.com> Fix for PR10657 (http://llvm.org/bugs/show_bug.cgi?id=10657)
extern inline case considered

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149587 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f15fda02e9c8c82b4a716618f4010b9af8bff796 02-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr:
* support the gcc __builtin_constant_p() ? ... : ... folding hack in C++11
* check for unspecified values in pointer comparisons and pointer subtractions


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149578 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprConstant.cpp
ac32ff9812e7d6bc31573b5499bfd005fc8b8f39 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Make sure that imported definitions get completed before we add
anything into the corresponding DeclContext. Co-hacked with Sean;
fixes <rdar://problem/10768928>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149535 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c36bedc90c687caa71748480c60707ea4608b092 01-Feb-2012 Anna Zaks <ganna@apple.com> Add a new compiler warning, which flags anti-patterns used as the size
argument in strncat.

The warning is ignored by default since it needs more qualification.

TODO: The warning message and the note are messy when
strncat is a builtin due to the macro expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149524 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
15efc4d597a47e6ba5794d4fd8d561bf6947233c 01-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: check for overflow in pointer subtraction.

This is a mess. According to the C++11 standard, pointer subtraction only has
undefined behavior if the difference of the array indices does not fit into a
ptrdiff_t.

However, common implementations effectively perform a char* subtraction first,
and then divide the result by the element size, which can cause overflows in
some cases. Those cases are not considered to be undefined behavior by this
change; perhaps they should be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149490 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c221411ad52edf93659392058341dfec4cdae4fa 01-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove redundant checks in CXXRecordDecl::isCLike(), as suggested by Sebastian.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149476 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7b48a2986345480241f3b8209f71bb21b0530b4f 01-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: overflow checking for integral and floating-point arithmetic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149473 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b04035a7b1a3c9b93cea72ae56dd2ea6e787bae9 01-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: require 'this' to point to an object in a constexpr method call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149467 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b02e4629f78a0c0c0adf9d66b644e5932a781c7e 01-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: add support for comparisons of pointer-to-members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3df61308ddfbdba0897b762a129b5a38750c87d0 01-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Treat INT_MIN % -1 as undefined behavior in C++11. Technically, it
isn't, but this is just a (reported) defect in the wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149448 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
56e68b712931e66612b01ecf0af27a05e5d12648 31-Jan-2012 Matt Beaumont-Gay <matthewbg@google.com> Pacify gcc's -Wreturn-type.

A separate unreachable message will make it easier to debug if either of the
unreachables is reached.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149402 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
82f28583b8e81ae9b61635a0652f6a45623df16d 31-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: the result of a relational operator between pointers to void is
unspecified unless the pointers are equal; therefore, such a comparison is not
a constant expression unless the pointers are equal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149366 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
789f9b6be5df6e5151ac35e68416cdf550db1196 31-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: catch a collection of integral undefined behaviors:
-INT_MIN and INT_MIN / -1
Shift by a negative or too large quantity
Left shift of negative value
Overflow in left shift



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149344 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
395f1c08ff720be7df6535a86df14b6d36a2d57a 31-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: remove integral conversion overflow checking introduced in r149286.
As Eli points out, this is implementation-defined, and the way we define it
makes this fine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149327 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c9674be201cf17d8e1c1c9f8b2c8c3a4474a43db 31-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Clean up switch in Expr::CanThrow. No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149321 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f72fccf533bca206af8e75d041c29db99e6a7f2c 30-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: disallow signed integer overflow in integral conversions in constant
expressions in C++11.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149286 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0c8731a2724e1aee3b908dcfd589a89d4b7938e9 30-Jan-2012 John McCall <rjmccall@apple.com> Per discussion on cxx-abi-dev, don't drop leading zeroes from the
mangling of floating-point literals. I just went ahead and
reimplemented toString() here; if someone wants to generalize
the library routine to do this, or feels strongly that we should
be post-processing, please feel free.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149256 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
394f7b650a03d5d4d8f740d6765f257b1c4e2ec0 28-Jan-2012 Douglas Gregor <dgregor@apple.com> Allow the external AST source to provide a layout without specifying
the alignment (because it's not encoded in DWARF). In this case, make
an educated guess at the alignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149161 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e4b92761b43ced611c417ae478568610f1ad7b1e 27-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added source location for the template keyword in AST template-id expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
emplateBase.cpp
745f5147e065900267c85a5568785a1991d4838f 27-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149108 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4fe19b5bf0db0cbe6afa280ed9f52ed4cb631e53 26-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change HasMutableFields to HasOnlyCMembers and consider that a tag inside
another tag does not break C-like-ness. rdar://10756831

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149071 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
419636316c04d570c183b4797fc811932c588358 26-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: 'id' and block pointer compare in mergeTypes is
made symmetrical. // rdar://10734265


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149065 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5fe31228c883040cf016cfc71ad4bfeba462602e 26-Jan-2012 NAKAMURA Takumi <geek4civic@gmail.com> AST/ExprConstant.cpp: Silence a warning on ms cl.exe. "bool" does not prefer to be compared to integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149059 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
453dbcbe30093fbf947a0bec2fbd46e9694eafe9 26-Jan-2012 Douglas Gregor <dgregor@apple.com> Extend the ExternalASTSource interface to allow the AST source to
provide the layout of records, rather than letting Clang compute
the layout itself. LLDB provides the motivation for this feature:
because various layout-altering attributes (packed, aligned, etc.)
don't get reliably get placed into DWARF, the record layouts computed
by LLDB from the reconstructed records differ from the actual layouts,
and badness occurs. This interface lets the DWARF data drive layout,
so we don't need the attributes preserved to get the answer write.

The testing methodology for this change is fun. I've introduced a
variant of -fdump-record-layouts called -fdump-record-layouts-simple
that always has the simple C format and provides size/alignment/field
offsets. There is also a -cc1 option -foverride-record-layout=<file>
to take the output of -fdump-record-layouts-simple and parse it to
produce a set of overridden layouts, which is introduced into the AST
via a testing-only ExternalASTSource (called
LayoutOverrideSource). Each test contains a number of records to lay
out, which use various layout-changing attributes, and then dumps the
layouts. We then run the test again, using the preprocessor to
eliminate the layout-changing attributes entirely (which would give us
different layouts for the records), but supplying the
previously-computed record layouts. Finally, we diff the layouts
produced from the two runs to be sure that they are identical.

Note that this code makes the assumption that we don't *have* to
provide the offsets of bases or virtual bases to get the layout right,
because the alignment attributes don't affect it. I believe this
assumption holds, but if it does not, we can extend
LayoutOverrideSource to also provide base offset information.

Fixes the Clang side of <rdar://problem/10169539>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149055 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
f2e4cd760a5836ee8941d1b9be6b2e2c2dde23e6 26-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149045 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
95b68f94d28a4b94f4c3fb029b9f1690e1bb728b 26-Jan-2012 Peter Collingbourne <peter@pcc.me.uk> Simplify {Record,Enum}Type::classof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149038 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e7cff2c00c3d74e38984a4db5c48d7e303d3ab8e 26-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: allow block pointer matching 'id' type when
they show up as argument types of two block pointers.
// rdar://10734265


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d9b02e726262e4009dda830998bb934172ac0020 25-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: add support for anonymous struct and union members in literal types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148987 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c0536c8294fc4453f0f1d1cf24a62bfc725fd492 25-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR11848: decree that an alias template contains an unexpanded parameter pack
iff its substitution contains an unexpanded parameter pack. This has the effect
that we now reject declarations such as this (which we used to crash when
expanding):

template<typename T> using Int = int;
template<typename ...Ts> void f(Int<Ts> ...ints);

The standard is inconsistent on how this case should be treated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148905 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
568991b62a29c1919e67438e0ac8216715b2c760 25-Jan-2012 Douglas Gregor <dgregor@apple.com> Only try to import a definition if there is an definition to import.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148894 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
cd0d56a523f877ffd1fe1575caf758b4357f1661 24-Jan-2012 Douglas Gregor <dgregor@apple.com> When importing a RecordDecl as a DeclContext, make sure that we pull
in the definition as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148831 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5602f7e77e975d780f84079532408c0064566c3b 24-Jan-2012 Douglas Gregor <dgregor@apple.com> Teach the AST importer about redeclaration chains for Objective-C
classes and protocols, implementing lazy-import semantics for both.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148816 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
69b26d653829efe834eb18800f9ff33dff64beb4 24-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> In CXXRecordDecl::isCLike(), also check for PODness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148765 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
277b15684582193d26f6c15b40e90a6e45299857 23-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,
without C++-specific features.

Use it to set the language to C++ when indexing non-C-like structs.
rdar://10732579

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148708 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclBase.cpp
eclarationName.cpp
umpXML.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
estedNameSpecifier.cpp
tmt.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
ypeLoc.cpp
ypePrinter.cpp
18932a0f2a94a7813ec461d1118c39ecf8aa936f 20-Jan-2012 Ted Kremenek <kremenek@apple.com> Add ability to specifiy 'restrict' on parameters of builtins, and correct this oversight for scanf functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148573 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4c3fc9b38d3723f73e4ded594cebf38c76f91d93 18-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Move narrowing conversion detection code from SemaInit to SemaOverload, ready
for it to be used in converted constant expression checking, and fix a couple
of issues:
- Conversion operators implicitly invoked prior to the narrowing conversion
were not being correctly handled when determining whether a constant value
was narrowed.
- For conversions from floating-point to integral types, the diagnostic text
incorrectly always claimed that the source expression was not a constant
expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148381 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
40b993a826728214c869ee4fbc9d296a2e1e1f71 18-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> A call to strlen is not a constant expression, even if we're treating it as a
builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148374 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9392d4e4da695e2e1a5befbb3a074793a7265471 18-Jan-2012 Anna Zaks <ganna@apple.com> Constify FunctionDecl::getmemoryFunctionKind().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148369 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7d580a4e9e47dffc3c17aa2b957ac57ca3c4e451 17-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Enable constant evaluation of implicit calls to constexpr conversion operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148333 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a6ea10e22b600d92e084f6b11b9b9a92d0eb2412 17-Jan-2012 Douglas Gregor <dgregor@apple.com> Delay the creation of the built-in Objective-C class 'Protocol' by
moving it from a "special type" to a predefined declaration, as we do
for id, Class, and SEL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148313 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
7530c034c0c71a64c5a9173206d9742ae847af8b 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
561d3abc881033776ece385a01a510e1cbc1fa92 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unnecessary default cases in switches over enums.

This allows -Wswitch-enum to find switches that need updating when these enums are modified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148281 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
umpXML.cpp
xpr.cpp
ypePrinter.cpp
0a151a137a68bb656acbcce7ff2407613bb80cfc 17-Jan-2012 Anna Zaks <ganna@apple.com> Use Builtin ID as the return value
for FunctionDecl::getMemoryFunctionKind().

This is a follow up on the Chris's review for r148142: We don't want to
pollute FunctionDecl with an extra enum. (To make this work, added
memcmp and family to the library builtins.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148267 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7a7ee3033e44b45630981355460ef89efa0bdcc4 16-Jan-2012 David Chisnall <csdavec@swan.ac.uk> Some improvements to the handling of C11 atomic types:

- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.

Still to do:

- Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg.
- Add a signal fence builtin
- Properly set the fenv state in atomic operations on floating point values
- Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context)
- Fix the many remaining corner cases



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
cc32b44ea4b3c702bf84eae0af27ca160bd90831 15-Jan-2012 Douglas Gregor <dgregor@apple.com> When deserializing the definition of a C++ class/ObjC class/ObjC
protocol, record the definition pointer in the canonical declaration
for that entity, and then propagate that definition pointer from the
canonical declaration to all other deserialized declarations. This
approach works well even when deserializing declarations that didn't
know about the original definition, which can occur with modules.

A nice bonus from this definition-deserialization approach is that we
no longer need update records when a definition is added, because the
redeclaration chains ensure that the if any declaration is loaded, the
definition will also get loaded.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148223 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
fa16125aaf667c2bd80efcea403a7a71aa65da14 15-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> decltype(e) is type-dependent if e is instantiation-dependent. Scary but true.
Don't consider decltype(e) for an instantiation-dependent, but not
type-dependent, e to be non-type-dependent but canonical(!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148210 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
28c1ce789322ab99f9b5887015d63ec5f088957a 15-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: casts to void* are allowed in constant expressions, don't set the
designator invalid. (Since we can't read the value of such a pointer, this only
affects the quality of diagnostics.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148208 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
750dc2b16fffa579f96ad053f061976a15ed4665 15-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Change linkage computation so it doesn't depend on FunctionDecl::isExternC or VarDecl::isExternC, and instead queries what it actually cares about: whether the given declaration is inside an extern "C" context. Fundamentally, figuring out whether a function/variable uses C linkage requires knowing the linkage, and the logic in FunctionDecl::isExternC and VarDecl::isExternC was getting it wrong. Given that, fix FunctionDecl::isExternC and VarDecl::isExternC to use much simpler implementations that depend on the fixed linkage computation.

Fixes a regression to test/SemaCXX/linkage.cpp caused by a new warning exposing the fact that the internal state was wrong.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148207 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ef96ee0be5f100789f451641542a69cd719144d2 14-Jan-2012 Douglas Gregor <dgregor@apple.com> De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).

Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclTemplate.cpp
umpXML.cpp
8a8950b13e4d438f732d24f22f63ebe1a9e0075e 14-Jan-2012 Douglas Gregor <dgregor@apple.com> Add a FIXME for mutation of the common pointer of a RedeclarableTemplateDecl. It is not clear that it's worth delaying the allocation of said pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148182 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
7c99bb5c4901c39460818ff8c00840218c48251f 14-Jan-2012 Douglas Gregor <dgregor@apple.com> Reimplement RedeclarableTemplateDecl in terms of
Redeclarable<RedeclarableTemplateDecl>, eliminating a bunch of
redeclaration-chain logic both in RedeclarableTemplateDecl and
especially in its (de-)serialization.

As part of this, eliminate the RedeclarableTemplate<> class template,
which was an abstraction that didn't actually save anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148181 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
2d6a5670465cb3f1d811695a9f23e372508240d2 14-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted
as constants.

Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other
entrypoints dealing with constant member pointers are no longer necessary and
will be removed in a later change.

Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to
VarDecl::evaluateValue. This performs caching and deals with the nasty cases in
C++11 where a non-const object's initializer can refer indirectly to
previously-initialized fields within the same object.

Building the intermediate APValue object incurs a measurable performance hit on
pathological testcases with huge initializer lists, so we continue to build IR
directly from the Expr nodes for array and record types outside of C++11.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148178 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprConstant.cpp
ecordLayoutBuilder.cpp
093ecc92afb70f6125d249eef31f40c0c57b7d24 14-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Remember if a type has its visibility set explicitly or implicitly.
With that, centralize the way we merge visibility, always preferring explicit over
implicit and then picking the most restrictive one.
Fixes pr10113 and pr11690.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148163 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
f6c17a439f3320ac620639a3ee66dbdabb93810c 14-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Fix a silly mistake in ComplexExprEvaluator::ZeroInitialization. <rdar://problem/10691092>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148157 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d9b859a74ecaede23a78d37f364498102ef418c9 13-Jan-2012 Anna Zaks <ganna@apple.com> Move identification of memory setting and copying functions (memset,
memcmp, strncmp,..) out of Sema and into FunctionDecl so that the logic
could be reused in the analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148142 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
83be12c8638a5136b937e602b3a9e25f4bc8e50d 13-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Recommit r148056 with fixes to deal with weirdness with bitfields in unions.

Original message: Make sure adding a field to a struct never reduces its size. PR11745.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148070 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
cd7a21b85ec94f9bddded4ed990dd2e2019011ab 13-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Revert r148056 while I investigate failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148068 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a1796826729ba8c73c32dd49fa4945ff3cb12039 12-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make sure adding a field to a struct never reduces its size. PR11745.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148056 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0c6b8e3fa718a0a67292340e5cff6fe7cbd15c14 12-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> If an ObjCMessageExpr is implicit, there are no source locations for the
selector identifiers.

It was difficult to form a test case for it unfortunately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148053 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ec789163a42a7be654ac34aadb750b508954d53c 12-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: initialization of a union from an empty initializer-list should
zero-initialize the first union member. Also fix a bug where initializing an
array of types compatible with wchar_t from a wide string literal failed in C,
and fortify the C++ tests in this area. This part can't be tested without a code
change to enable array evaluation in C (where an existing test fails).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148035 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
61e616206413d1779c7545c7a8ad1ce1129ad9c1 12-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow constant-folding of references which were formed in a manner not permitted
in a constant expression, for compatibility with g++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148020 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
746f5bcbfde5b25269169c63c66492311673b67d 12-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.

This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148013 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
de8facc81f505ca7e86022911145271f614b96ea 11-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: fix typo resulting in move constructors sometimes not being
implicitly marked constexpr when they should be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147955 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
31dfd642d5ac33c4ee0cfe1d7a1d4da455dcc7a4 10-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Add field IsIEEE in FloatingLiteral to distinguish between different 128-bit
floating point formats.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147887 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7ead5c7b6fd48cf549e55b4db499c26ecf88ae75 10-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Implement the missing pieces of Evaluate for _Complex types. With that complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147840 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
610a60c0e68e34db5a5247d6102e58f37510fef8 10-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11724: Implement evaluation for constexpr defaulted trivial union copy/move
constructors. These are a special case whose behavior cannot be modeled as a
user-written constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147839 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c6c8e0ec96bb64f1b9f543d7c8317c6090f80a30 09-Jan-2012 Douglas Gregor <dgregor@apple.com> Implement redeclaration merging for namespaces defined in distinct
modules. Teach name lookup into namespaces to search in each of the
merged DeclContexts as well as the (now-primary) DeclContext. This
supports the common case where two different modules put something
into the same namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147778 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9bc6fb6317f9bc6aaaacd266b9ea36996ad338bb 07-Jan-2012 Benjamin Kramer <benny.kra@googlemail.com> Pack UsingDecl more.

88 -> 80 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147736 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f5c9f9fd6f5e2850b9b0f19283430245b696c6e5 07-Jan-2012 Douglas Gregor <dgregor@apple.com> Switch NamespaceDecl from its own hand-rolled redeclaration chain over
to Redeclarable<NamespaceDecl>, so that we benefit from the improveed
redeclaration deserialization and merging logic provided by
Redeclarable<T>. Otherwise, no functionality change.

As a drive-by fix, collapse the "inline" bit into the low bit of the
original namespace/anonymous namespace, saving 8 bytes per
NamespaceDecl on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147729 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
eclCXX.cpp
72899c34e3d1abfffa241ad0ce5c4bf175e5ea51 07-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work: semantic analysis of capturing 'this'. It's a bit complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147723 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d97927d69b277120f8d403580c44acd84907d7b4 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Revert r147664; it's breaking clang regression tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147681 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2d5f0952a93dae4b648f2b33bab621ad6e932d9a 06-Jan-2012 Jakub Staszak <kubastaszak@gmail.com> Silence GCC warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147664 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
46cd2186bddc3e046140cb2d56932ee7faf7e3ae 06-Jan-2012 Douglas Gregor <dgregor@apple.com> Stash Decl's TopLevelDeclInObjCContainer and ModulePrivate bits
into the two unused lower bits of the NextDeclInContext link, dropping
the number of bits in Decl down to 32, and saving 8 bytes per
declaration on x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147660 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b4e85ed51905fc94378d7b4ff62b06e0d08042b7 06-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: implement checking and diagnostics for
pointer-arithmetic-related undefined behavior and unspecified results. We
continue to fold such values, but now notice they aren't constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147659 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
092beef87b367e62f96c0057118ba540777de452 06-Jan-2012 John McCall <rjmccall@apple.com> Fix the mangling of class template arguments in a particular
dependent case. Thanks to Jason Merrill for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147653 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
5930a4c5224eea3b0558655f7f8c9ea027ef573e 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Address Richard's review comments on r147561 (Evaluate support for address-of-label differences).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147631 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5d1f496f86305b4738d465031a517b5be49f9ebd 06-Jan-2012 Douglas Gregor <dgregor@apple.com> Always allocate an extra 8 bytes for a deserialized declaration, since
some code in Clang expects 8-byte alignment of declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147626 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b6b60c1521a2e65f60e93c5fd56c103cf027df63 05-Jan-2012 Douglas Gregor <dgregor@apple.com> When we deserialize a declaration from a module file, allocate extra
storage for the global declaration ID. Declarations that are parsed
(rather than deserialized) are unaffected, so the number of
declarations that pay this cost tends to be relatively small (since
relatively few declarations are ever deserialized).

This replaces a largish DenseMap within the AST reader. It's not
strictly a win in terms of memory use---not every declaration was
added to that DenseMap in the first place---but it's cleaner to have
this information available for every deserialized declaration, so that
future clients can rely on it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147617 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1e68ecc4fcce12f683c4fd38acfd1a004001b04f 05-Jan-2012 Douglas Gregor <dgregor@apple.com> When creating declarations that are deserialized from an module file,
go through a central allocation routine
Decl::AllocateDeserializedDecl(). No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147614 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclFriend.cpp
eclObjC.cpp
eclTemplate.cpp
73076431605556fdbf28d287d084a73a24a8b8d4 05-Jan-2012 John McCall <rjmccall@apple.com> The value of a const weak variable is not an integer constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147575 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
65639284118d54ddf2e51a05d2ffccda567fe246 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add an APValue representation for the difference between two address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer.

With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary.

Fixes PR11705.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147561 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xpr.cpp
xprConstant.cpp
71523d6c41e1599fc42f420d02dd2895fd8f65d4 04-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Get rid of an unnecessary check; the AST for init-lists is the same independent of whether we're in C++11 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147503 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7a537404f039d4b7d063bbdc3c8c924be977dff2 04-Jan-2012 Douglas Gregor <dgregor@apple.com> Test "merging" of typedef types across distinct modules. At present,
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.

As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147498 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3edd5a99332dd8ec94a545476dc3c9ed50dec78f 04-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Support constant evaluation for OpenCL nested vector literals. Patch by Anton Lokhmotov.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147496 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5948ae1021122164b22f74353bb7fe325a64f616 03-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce a non-uglified syntax for module imports in Objective-C:

@import identifier [. identifier]* ;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147452 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclPrinter.cpp
a2d8669b09363d3d3a3c67982e08a38c8ed015d0 02-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add assertion to char32_t that the value is valid, as suggested by Jordy Rose.
Add a test that such characters don't make it through to StringLiteral objects
in error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147438 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
d07cc36c71558b62889691184dd04655a33fd12a 02-Jan-2012 Douglas Gregor <dgregor@apple.com> Diagnose cases where the definition of a particular type is required,
is known (to Clang), but is not visible because the module has not yet
been imported.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147436 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
b5d763d87c8ffb969b4d4a59ed98a2e3516e0850 02-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Small cosmetic cleanups in code I will change anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147424 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
61cc296de6c1f82fa84c0abb3ecd142a584838ef 02-Jan-2012 Douglas Gregor <dgregor@apple.com> Fix canonicalization of protocol-qualified types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147421 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c9d3c7edb513e9b8a6ab65b04133653e71d7a72b 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. They are no longer needed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147419 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
49310ba7dca1df625f89baaa7c70bc4d6a36e80e 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate redundant, empty function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147416 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
bd9482d859a74bf2c45ef8b8aedec61c0e1c8374 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclBase.cpp
eclObjC.cpp
eclPrinter.cpp
umpXML.cpp
27c6da284f90e32cda0ec8f52a2b6ba5a2613252 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Wire up redeclaration chains for Objective-C protocols, so that both
forward declarations and definitions of an Objective-C protocol are
represented within a single chain of ObjCProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147412 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
1d784b277cdfd4eba03680715d2a082b3f28d295 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce the core infrastructure needed to model redeclaration chains
for Objective-C protocols, including:
- Using the first declaration as the canonical declaration
- Using the definition as the primary DeclContext
- Making sure that all declarations have a pointer to the definition
data, and that we know which declaration is the definition
- Serialization support for redeclaration chains and for adding
definitions to already-serialized declarations.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCProtocolDecls.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147410 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
5e2a1ff9f28d2eab256d2553e76a9c9d54693875 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147408 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
umpXML.cpp
3fc73ee0c613715ebce78e30b4d050ea715a007d 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Use declaresSameEntity() when comparing ObjCProtocolDecls, and
getCanonicalDecl() when putting ObjCProtocolDecls into a set. This is
groundwork for making ObjCProtocolDecl redeclarable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147406 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
71cb8a2e10c3f75ca50e2b4f205cbd4cec40ad5e 01-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Consider visibility attributes in namespaces as being explicit. I.e., they
take precedence over command line options. Fixes PR10113.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147405 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6f26b5eeb4cf130b2602bdc93597da4f3419e7e5 01-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Replace a isa+cast with a dyn_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147401 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4debc82d9d967501b8650599cd44003d7026f56c 31-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash when trying to pretty-print unicode or wide string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147385 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
51201882382fb40c9456a06c7f93d6ddd4a57712 30-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r147271, reverted in r147361.

Also temporarily remove the assumption from IR gen that we can emit IR for every
constant we can fold, since it isn't currently true in C++11, to fix PR11676.

Original comment from r147271:

constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147384 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
f8c2a33b6e47c494b83e68f02f4ee67ca8fd8e3b 30-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert r147271. This fixes PR11676.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147362 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
80d4b55db94db2172a04617d1a80feca6bbcea5c 28-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Small refactoring and simplification of constant evaluation and some of its
clients. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147318 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
375bb1413c041055262c8a416f20d10474a5eda9 27-Dec-2011 Douglas Gregor <dgregor@apple.com> Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
eclObjC.cpp
eclPrinter.cpp
umpXML.cpp
fedb6ecbed93c6bf12a02d61b2421d6f0da3b4fc 27-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix the visibility of methods of explicit template instantiation definition
when using -fvisibility-inlines-hidden. This matches gcc's behavior and
documentation.

Fixes PR11642.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147295 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
47d2145675099893d702be4bc06bd9f26d8ddd13 27-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: support for evaluation and codegen of typeid constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147290 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
eba05b2e396e1474f7bd6e8e8e1bd7752effef4d 25-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: perform zero-initialization prior to / instead of performing a
constructor call when appropriate. Thanks to Eli for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147271 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
ffbe9b9c64ab2e94b9d48ec56e511f75826fc80a 23-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.

Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
712ef874534ee1bef41d1aa4664ae36148ec8b12 23-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Use class definition AST in several situations when
building related objc ASTs which require a class definition AST.
These were uncovered when testing objc rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147210 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e6a24e83e71f361c7b7de82cf24ee6f5ddc7f1c2 22-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Add support for bitcasts to vector type in Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147137 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6180245e9f63d2927b185ec251fb75aba30f1cac 22-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147128 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprConstant.cpp
974c5f93d0ce4f0699a6f0a4402f6b367da495e3 22-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11637: implement special-case constant evaluation for char arrays initialized
by string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147120 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
aa5d533427d803e52ee42b250ffd6645ef5ccb0f 21-Dec-2011 Matt Beaumont-Gay <matthewbg@google.com> Cast enumerators from different anonymous enums to unsigned, to appease gcc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147067 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7098cbd601ad915aed22d4b5850da99359f25bf3 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147035 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1d238ea926bbdd04356ce475934fcd4cac654c4b 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
- variables of reference type
- constexpr variables


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6bd9719fd97abac1b8126eae866e96db88be4ac8 21-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147026 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e7aa27a826f0b353713df6bfa0715818db8cde74 20-Dec-2011 Douglas Gregor <dgregor@apple.com> When performing layout for an Objective-C class, make sure to dig out
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146976 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
99ba9e3bd70671f3441fb974895f226a83ce0e66 20-Dec-2011 David Blaikie <dblaikie@gmail.com> Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ecl.cpp
eclCXX.cpp
eclFriend.cpp
eclObjC.cpp
eclTemplate.cpp
xprCXX.cpp
angle.cpp
bc6abe93a5d6b1305411f8b6f54c2caa686ddc69 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Evaluation support for ExprWithCleanups. We won't evaluate any expression which
actually requires non-trivial cleanups, so no cleanups need to be performed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146916 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
af2c7a194592401394233b7cbcdd3cfd0a7a38dd 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Improve r146813 (for PR11595) to give an appropriate diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146915 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
099e7f647ccda915513f2b2ec53352dc756082d3 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

extern const int a;
const int n = a;
const int a = 5;
int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146856 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
xprConstant.cpp
2116b144cf07f2574d20517187eb8863645376eb 18-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146842 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f59ff8c777379bd54137853a58c58b72fb869152 17-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Add a missing check before trying to evaluate a temporary. PR11595.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146813 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fd002a7027e47ddd4bc9f32b158b18ab0ebd29c7 16-Dec-2011 Douglas Gregor <dgregor@apple.com> Make sure we're always setting the previous declaration of an ObjCInterfaceDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146763 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d9ce41e19dfd848a8192c2a7f6f9c5b0f3448076 16-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Add missing flush call. This is an attempt to fix a broken Windows buildbot.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146760 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
08d6e032a2a0a8656d12b3b7b93942987bb12eb7 16-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
8d2dbbf9ddfd9d762a341d83f83d840ff68ce03d 16-Dec-2011 Douglas Gregor <dgregor@apple.com> If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146740 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
298aaf2c97ab7c4d5bd3a8e8d8112e3bc77b29b6 16-Dec-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r146715 (Dec 16th 2011)

Change-Id: I66024a7b6eb0ee37d7b3ff7ce41c0bfb4b514bee
0af550115df1f57f17a4f125ff0e8b34820c65d1 16-Dec-2011 Douglas Gregor <dgregor@apple.com> Fix chaining of ObjCInterfaceDecl redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146722 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclObjC.cpp
7723fec9b45b7258c0eddf4cbfd0d335348f5edc 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
eclPrinter.cpp
umpXML.cpp
ecordLayoutBuilder.cpp
ype.cpp
26fec63b14565e9e2d8c9935b276b99be950444a 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146669 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
53df7a1d34f21d8f2309311d1067d463e9064c60 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce the core infrastructure needed to model a complete
redeclaration chain for Objective-C classes, including:
- Using the first declaration as the canonical declaration.
- Using the definition as the primary DeclContext
- Making sure that all declarations have a pointer to the definition
data, and the definition knows that it is the definition.
- Serialization support for when a definition gets added to a
declaration that comes from an AST file.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCInterfaceDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146667 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
2e5c15be82f362611c5928ce853d0685ff98c766 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Move the definition-specific data of ObjCInterfaceDecl into a
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.

Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146644 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
eclPrinter.cpp
60ef308e51c71b760d7f598c1b763ceb7b768148 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146618 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
af764723bf94f8cc7596e2b2f2a97766d188ed98 14-Dec-2011 Douglas Gregor <dgregor@apple.com> Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
members into ObjCClassDecl, saving ourselves one pointer per forward
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146564 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
fea966a4103ed9c018d1494b95e9d09b161f5a70 13-Dec-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added an assertion about overflow in sizeof evaluation. This does not solve the underlying structural issue that is waiting for a proper solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146482 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c1c5f27c64dfc3332d53ad30e44d626e4f9afac3 13-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add checks and diagnostics for many of the cases which C++11 considers to not
be constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146479 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
364a59ed8f0b3adb6a9eb9f2d687650ec1d0d8e5 12-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in calculation of field offsets of ms_struct
fields by just following what comment says.
// rdar://10513599


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146414 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4cd9b8f7fb2cebf614e6e2bc766fad27ffd2e9de 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Clean up diagnostic wording for disallowed casts in C++11 constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146395 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c216a01c96d83bd9a90e214af64913e93d39aacc 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 constant expression cast restrictions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146371 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d5093420308784e31071c8cd723a58d74159f393 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix some not-yet-used diagnostic code in a template, which gcc spotted and clang
did not!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146366 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
dd1f29b6d686899bfd033f26e16cb1621e5549e8 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Prepare constant expression infrastructure for the generation of richer
diagnostics. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146365 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ee19f43bf8973bfcccb7329e32a4198641767949 10-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add a fast path to the constant evaluator for integer literals. This speeds up
compilation of some translation units of SPEC's 445.gobmk by ~4%, and does not
seem to cause a measurable slowdown in other cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146306 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
006e42f0c8b65b783d565ef10b938a9e82fc02e3 10-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Add ability to supply additional message to availability macros,
// rdar://10095131


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146304 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f48fdb0937e67f691393f9ffdf75653e5128ea13 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146289 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4ec4089b302d4ab2ec3deac089c7834d27aa39ee 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Teach isConstantInitializer that numeric literals are constants, rather than
having it evaluate them. No change in functionality, but a speed up of about 5%
on some translation units in SPEC 445.gobmk.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146248 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
42786839cff1ccbe4d883b81d01846c5d774ffc6 09-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
infinite recursion due to bad OpaqueValueExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146237 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e052d46f4db91f9ba572859ffc984e85cbf5d5ff 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Replace the implementation of __builtin_constant_p (which was based on the GCC
documentation) with one based on what GCC's __builtin_constant_p is actually
intended to do (discovered by asking a friendly GCC developer).

In particular, an expression which folds to a pointer is now only considered to
be a "constant" by this builtin if it refers to the first character in a string
literal.

This fixes a rather subtle wrong-code issue when building with glibc. Given:

const char cs[4] = "abcd";
int f(const char *p) { return strncmp(p, cs, 4); }

... the macro magic for strncmp produces a (potentially crashing) call to
strlen(cs), because it expands to an expression starting with:

__builtin_constant_p(cs) && strlen(cs) < 4 ? /* ... */

Under the secret true meaning of __builtin_constant_p, this is guaranteed to be
safe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146236 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c6994005dc9f677c831b8e90bdab483cc2197c29 09-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146213 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
aa9c3503867bc52e1f61c4da676116db1b1cdf01 07-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146000 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d62ca370b03b8c6ad58002d3399383baf744e32b 06-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Move vector bitcast handling in constant expressions from the expression
evaluator into constant initializer handling / IRGen. The practical consequence
of this is that the bitcast now lives in the constant's definition, rather than
in its uses.

The code in the constant expression evaluator was producing vectors of the wrong
type and size (and possibly of the wrong value for a big-endian int-to-vector
bitcast). We were getting away with this only because we don't yet support
constant-folding of any expressions which inspect vector values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145981 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
0dd7a25e8d679de1dc0ce788222d6dee0e879885 05-Dec-2011 Lang Hames <lhames@gmail.com> Make isWeakDecl available as a method on ValueDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145845 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
14795c86f1c37874afa332a7b9bc18e6a02bf420 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Fix mangling substitutions for address-space-qualified class
types. Patch from Dmitri Rubinstein!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145776 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
5e9392ba18f5925e26cc5714d1412eda0d219826 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Implement support for the __is_final type trait, to determine whether
a class is marked 'final', from Alberto Ganesh Barbati! Fixes
PR11462.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145775 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
e664977aca2a05a77abab5a06dc0fb69e870cfb9 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Keep track of all of the import declarations that are parsed or
implicitly generated in a translation unit. Modules will need this
information to identify the actual imports that occurred.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145734 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
93ebfa6139bbca4d446c7343e3afc8e5ec777484 03-Dec-2011 Douglas Gregor <dgregor@apple.com> When we treat an #include or #import as a module import, create an
implicit ImportDecl in the translation unit to record the presence of
the import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145727 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
15de72cf580840c61e5704c2f8a2b56f9d0638e1 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce a module import declaration, so that we properly represent, e.g.,

__import_module__ std.vector;

in the AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145725 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclPrinter.cpp
bff22ac1f8b78e4c19d5c3e00226ecea3b24e60f 02-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix bitfield handling for record layout with #pragma pack. <rdar://problem/10494810> and PR9560.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145673 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
50118da99d3c04eb14747cfdc44a9e1d56432aea 01-Dec-2011 Michael J. Spencer <bigcheesegs@gmail.com> Add Microsoft mangling of constructors and destructors. Patch by Dmitry!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145581 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
f8d34ed0d0933350323d9f7a8521011d73dc98d5 01-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> ParmVarDecls have no linkage. Previously we would report that parameters
in type signatures have external linkage.

Fixes rdar://10058317.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145551 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
75df4eeede7b91c22c1d63fafd4dd4142844e3b9 01-Dec-2011 Ted Kremenek <kremenek@apple.com> Further tweak -Wurneachable-code and templates by allowing the warning to run on
explicit template specializations (which represent actual functions somebody wrote).

Along the way, refactor some other code which similarly cares about whether or
not they are looking at a template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145547 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
901dd668931a70932ad09092959c42693409a3cd 01-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix MSVC class layout for empty classes. Patch by Dmitry Sokolov.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145544 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
381c0662095014532bce6706858fd8c4e34da3f7 30-Nov-2011 Ted Kremenek <kremenek@apple.com> Per an offline conversation with John McCall, have StmtPrinter actually print out the source expression for OpaqueValueExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145524 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
dc8dab6fabf4bfd4f4b94bf572ac3342a5bbfcd7 30-Nov-2011 Bob Wilson <bob.wilson@apple.com> Add bigger method type encodings to protocol objects. <rdar://problem/10492418>

The new metadata are method @encode strings with additional data.

1. Each Objective-C object is marked with its class name and protocol names.
The same is done for property @encode already.

2. Each block object is marked with its function prototype's @encoding. For
example, a method parameter that is a block object that itself returns void
and takes an int would look like:
@?<v@?i>

These new method @encode strings are stored in a single array pointed to by structs protocol_t and objc_protocol_ext.

Patch provided by Greg Parker!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145469 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bceb75528a4a9757f85df002ab45c6002dc10f94 27-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for an
array of objects with non-trivial destructors. PR11365.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145203 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
13dc8f98f6108dca8aaa9721567ed5a2d9911e0f 27-Nov-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reference initialization with initializer lists.

This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145186 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
2a710c84db1ebf0c16cba0ff121ca8e15f045a07 25-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r145117 (Nov 25th 2011)

Change-Id: Id4fde985342e3c81f13887e8728bd94b82523642
1e855657867e95c8302f55de3f63409f9b1927c3 22-Nov-2011 Matt Beaumont-Gay <matthewbg@google.com> Provide better source info for template specializations with non-type arguments.

This fixes a crasher in tools like Include-What-You-Use which examine such
arguments. Patch from Dean Sturtevant at Google!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145077 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
c18c42345636e2866fed75c7e434fb659d747672 21-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the same
semantics and defaults as the corresponding g++ arguments. The historical g++
argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions
no longer document that option.

Add -cc1 argument -fconstexpr-depth N to implement the corresponding
functionality.

The -ftemplate-depth=N part of this fixes PR9890.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145045 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1bea8807bcd2be10bf6309a3a848489434464ced 19-Nov-2011 Douglas Gregor <dgregor@apple.com> Add support for pretty-printing attributes, from Richard Membarth!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145002 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
88c2596edc8eb475e20f6033de1ea01669695a0c 18-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continue
parsing or false to abort parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144943 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
f1b69466146cda83936fae66839c446602e05133 18-Nov-2011 Sean Callanan <scallanan@apple.com> Added a clause to the ASTImporter allowing it to
import TranslationUnitDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144934 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
e24f5fc8c763f1b5536b8d70dd510ca959db3a80 17-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: add support for evaluation of member pointers
and base-to-derived casts, and add proper handling of temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144926 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
2ad226bdc847df6b6b6e4f832856478ab63bb3dc 16-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144799 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b755a9da095d2f2f04444797f1e1a9511693815b 16-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR11385: A pointer constant expression which has been cast via an integer is
not safely derived. Don't allow lvalue-to-rvalue conversions on the result of
dereferencing such a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144783 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
71d9a71d19099a6673750b47b32e9786803fa81d 15-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r144605 (Nov 15th 2011)

Conflicts:
include/clang-c/Index.h
include/clang/AST/APValue.h
include/clang/AST/DeclBase.h
include/clang/AST/DeclObjC.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Serialization/ASTWriter.h
lib/AST/APValue.cpp
lib/AST/ASTImporter.cpp
lib/AST/DeclObjC.cpp
lib/AST/ExprConstant.cpp
lib/Driver/ToolChains.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/Frontend/Warnings.cpp
lib/Lex/HeaderSearch.cpp
lib/Lex/LiteralSupport.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaPseudoObject.cpp
test/Analysis/misc-ps.c
test/Analysis/retain-release-path-notes.m
test/CodeGen/string-literal-unicode-conversion.c
test/CodeGenCXX/blocks.cpp
test/Driver/crash-cleanup.c
test/Misc/serialized-diags.c
test/Misc/warning-flags.c
tools/c-index-test/c-index-test.c
tools/libclang/CXLoadedDiagnostic.cpp
tools/libclang/IndexDecl.cpp
tools/libclang/IndexTypeSourceInfo.cpp
tools/libclang/Indexing.cpp
tools/libclang/IndexingContext.cpp
tools/libclang/IndexingContext.h
tools/libclang/libclang.exports

Change-Id: I6621e7d5d9a9d1e4cdec7b7b62ffa6dffaff375d
40f57ee2dab3ed3475fa584f83f05bd3c9ed4a00 15-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is 'ImplicitInterfaceDecl',
no need to store it in another field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144624 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2bbcd5ce370753c86d312d2c72a97476ac35b073 14-Nov-2011 Ted Kremenek <kremenek@apple.com> ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144572 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ecb912e8a2a683a2e1db1743a862ee21e788eea6 14-Nov-2011 Richard Trieu <rtrieu@google.com> Change the checks in the type aka printing. A confusing case where the string
of the first type is the same as the aka string of the second type, but both
types are different. Update the logic to print an aka for the first type to
show that they are different.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144558 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
e2d4f4ed44a32f179c6d48cd1dba8346ab2129d9 13-Nov-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix the signature of the getcontext builtin. Patch by Dimitry Andric.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144505 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1bf9a9e6a5bdc0de7939908855dcddf46b661800 12-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr
or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to
static member functions and static data members are now emitted as constant
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144468 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
ad834d534e9a5db3d3baa09593775f83ceaff1f2 12-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] When completing an objc forward reference, do not serialize the chain of its categories because
it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its
categories list when deserializing.

Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference
was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization
is bug inducing and kinda gross, we should phase it out.

Fixes infinite loop in rdar://10418538.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144465 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
33968da3f081823af467686b3bdef4554d6e7ca4 10-Nov-2011 Devang Patel <dpatel@apple.com> Revert r144273. It causes clang self-host build failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144296 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e441a0b2879c0cad87a0dc1e06321051296e4b4a 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for constexpr member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144273 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
62d3cba9d0c608e894a8ce65f0012d730f29f267 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144265 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
ecl.cpp
xpr.cpp
xprConstant.cpp
427492c7815b5ec15fb4150805c6c82b25841097 10-Nov-2011 John McCall <rjmccall@apple.com> There's no good reason to track temporaries in ExprWithCleanups,
but it is sometimes useful to track blocks. Do so. Also
optimize the storage of these expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144263 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprCXX.cpp
tmtDumper.cpp
a4557098a243193b0b5df161df05f1778f92a894 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporary fix for a performance problem Eli spotted. The APValue representation
is currently too inefficient to allow us to use it for array initializers, but
fortunately we usually don't yet need to evaluate such initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144260 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
640de1872bb062a67fa9a387905b5333d067ef24 09-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144156 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a4aece435555de4bbb720bb93ec6d0fd639f367a 08-Nov-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev: add checks for removing Decls for more use cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144094 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
1e8c75f44f4db4f79f82c5e233ff65fb74c0ce0e 08-Nov-2011 John McCall <rjmccall@apple.com> Fix the layout of vb-tables and vf-tables in the MS C++ ABI.
Based on work by Dmitry Sokolov!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144072 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a97b443a7fc542513b95e643707c8567e090dfc1 08-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> TypePrinter: print OpenCL address space names. Patch by Richard
Membarth, test case by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144063 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
d9d6203a6c5a7e8dd5b1ac24e93e7131213fc0df 08-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> DeclPrinter: print the declaration's storage class specifier as
written, instead of the resolved storage class, which might not be
legal to specify on the declaration (such as out-of-line definitions
of static class members in C++, and __local variables in OpenCL).
Initial patch by Richard Membarth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144062 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
c59af90ca578abcddc25b5db5a8bc9b5b10ca597 08-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix a cluster of related issues involving value-dependence and constant
expression evaluation:
- When folding a non-value-dependent expression, we may try to use the
initializer of a value-dependent variable. If that happens, give up.
- In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
is of integral or enumeration type (a reference isn't OK!)
- In C++11, DeclRefExprs for objects of const literal type initialized with
value-dependent expressions are themselves value-dependent.
- So are references initialized with value-dependent expressions (though this
case is missing from the C++11 standard, along with many others).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144056 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
348d3bdc406fb652fa54949e2f356bc526cfc9c8 07-Nov-2011 Douglas Gregor <dgregor@apple.com> When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144011 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
964ba8642969079214eae9a457dde9dfc91d5b87 07-Nov-2011 Richard Trieu <rtrieu@google.com> Add support for printing integer literals of type short, unsigned short,
__int128_t and __uint128_t. Short and unsigned short integer literals support
is only to work around a crasher as reported in PR11179 and will be removed
once Clang no longer builds short integer literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143977 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
a938489d14e815f56971b271bd5202e32d4df9d5 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143922 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
6be60b343d0cffcb3ff55061ff31778b39a2f9ab 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix 32-bit build bots and remove some casting-away-const warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143914 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
6295b53422fbbc9dfaa5035abdada4648ab73d40 07-Nov-2011 John McCall <rjmccall@apple.com> Rip out CK_GetObjCProperty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143910 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
dd6797f755dbec6bf2b574690a39608aa56b232d 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: preserve subobject designator when flattening a
core constant value down to an APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143909 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
547c88a3b0294a8fc8f664340a50afea40933c8b 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Allow constexpr variables' initializers to be folded in C++11 mode. This
partially undoes the revert in r143491, but does not introduce any new instances
of the underlying issue (which is not yet fixed) in code which does not use
the 'constexpr' keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143905 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bf58d9992f43eca0a19c2fe6038de09aeb17b1f3 06-Nov-2011 David Blaikie <dblaikie@gmail.com> Correcting grammar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143894 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
32d4d95987812ea68479576f005c273dc913198f 06-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Make format string 64 bit safe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143870 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
7acf4bf00ecc31652177b3ac1d3f523346581d71 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
50bdce234a956a433d85ed5d4db4d9ca636e41a3 05-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Now that we have a portable 64 bit format string use it to make this simple again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143800 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
34143a0bab4ada6c6fac98cd52c2e0ff752aeaef 05-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix incorrect format string in debug output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143768 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3130d7cd5b12cb11655670ff18687e0a1d2b09d7 04-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143696 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
109717ddc55cb123d3c7a83c570f31ffaaca728f 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: refactor to start the groundwork for coping with
initializations which refer indirectly to elements of the object being
initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143680 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3b9bf18c3a00015cd22e6688d9dfe949f9b1c5a9 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: track the manner in which an lvalue was written,
to allow us to implement the C++11 rule that a non-active union member can't be
read, and use it to implement subobject access for string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143677 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
001d50150fafff2a457c92d4fa013b50ad7d2ddb 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: although we don't know whether a literal will
be at the same address as another object, we do know it won't alias a null
pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143674 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ff71fad924119685eab5bc8b397a128b4e596f47 04-Nov-2011 Richard Trieu <rtrieu@google.com> In the AST dump, add a space between the type and value for CharacterLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143667 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
6e501001be0aabfa4f1ba2467b0ee782a4586049 03-Nov-2011 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter to import DefinitionData bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143631 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
738f0039be489168e493debc248d60be07a109c7 03-Nov-2011 Douglas Gregor <dgregor@apple.com> Add a printing policy flag to suppress printing "<anonymous>::" prior
to types. Enable this flag for code completion, where knowing whether
something is in an anonymous or inline namespace is actually not
useful, since you don't have to type it anyway. Fixes
<rdar://problem/10208818>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143599 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
ypePrinter.cpp
a95cba91ab8df9ebc1507e649e808968a9a16821 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c535c17205bc6eade37356979a94e458878558bb 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Use StringLiteral::getBytes(), not StringLiteral::getString(), when profiling the expression, so that it works for non-UTF8 strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143550 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
99326e2449d881f2380de9dfd33b7e1c12465804 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> When constant-folding, don't look at the initializer of a global const variable
if it's marked as weak: that definition may not end up being used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143496 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e3a6425aef500a818c0ffa6147358ef67c30aa5d 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporarily disable lvalue-to-rvalue conversions on const pointers while an
apparent miscompile triggered by this is investigated. This is essentially a
revert of r143298.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143491 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
627440b612ff96dfc25334d1475698184c55e996 01-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] For a class extension, give it a unique USR but for any property or ivar
it contains give it a USR based on its semantic context, which is the interface.

This follows what we already did for objc methods. rdar://10371669

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
23de5c7efdf252c450c9fb9480a944a59cdd9124 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 'constexpr calls must return constant expressions' rule, and
perform the code simplifications this rule allows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f3aa8d6ef9457c7e36a8f265c781c38dadc7c074 01-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
treating wide strings as a series of bytes.

Patch by Seth Cantrell.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143417 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
12e3a16149e76004393ccd1f3be1b5811efda65c 01-Nov-2011 Douglas Gregor <dgregor@apple.com> Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143410 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ab78a9c21088b4af9f53914e2543f3cfb3482cfd 31-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Some minor comment changes in constant-folding comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143391 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c3472513c070dccfa949f1fb159afc0933e01c1c 31-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Don't try to fold comparisons between the address of an object and an arbitrary integer constant. Fixes regression from r143334.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143374 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
af3467c7e842f5311b7c657c0f388e7b937e6de0 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactoring and test for r143360. Support for array rvalue to pointer decay is
needed for C++11, and will follow later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143363 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b4cc5407913174251fa4df7cde3b6c3e4196a7f0 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporary fix for assert while evaluating array-to-pointer decay on array
rvalue. Test and better fix to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143360 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a8398ccc7235564ee9a1124c385a4b82e49302d9 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expression handling: evaluation support for
materialized temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143335 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a58a22ad48cd6410881d9a7cca4691ab0fe63949 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: evaluate equality comparisons between
arbitrary pointers, if those pointers don't point to weak objects or literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143334 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
57f1c1d542284567fb314ca6bf83da326f28b8c3 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: support pointer comparisons where the
result is not unspecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143329 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c33d2b794d920b7518920d0fecb46bb7c0c943f7 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert on constant expression evaluation of floating point increment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143320 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d8063ce6aeb0c91dab18d25dc2c2b39d905e1cba 30-Oct-2011 Jim Goodnow II <jim@thegoodnows.net> Fixed CXX struct and class initialization printing to support 'move'
type constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143309 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
18dbecb27a05ed4e350e82eb5d211682ca1c56bf 30-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash if a GCC binary conditional is used in a constant expression on an
integer-cast pointer value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143299 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bf855d30d4eb438f7a76fa8eaa1928c837e407ab 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
just integers and floating point types. Since we don't support evaluating class
types or performing lvalue-to-rvalue conversions on array elements yet, this
just means pointer types right now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143298 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8ff064e2f8c029c0d2579e279673fd3421c03d56 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr function substitution:
Track the function invocation where an lvalue referring to a constexpr function
parameter originated from, and use it to substitute the correct argument and to
determine whether such an argument's lifetime has ended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143296 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
d778105d47d92af4bf74f3e3019ca74ab0d78986 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a5a478c0bcad37b7a67e9548429f0d7a1691fa3b 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143250 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b060361e2eb672088226895ecf4a5d90d471c61a 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Initial support for C++11 constexpr function invocation substitution. Using
constexpr function arguments outside of their function (passing or returning
them by reference) does not work correctly yet.

Calling constexpr function templates does not work yet, since the bodies are not
instantiated until the end of the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8fc563ea8f19004cf2c568f7e061c80f9f851fcb 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
are present in all the necessary places:

In constant expression evaluation, evaluate lvalues as lvalues and rvalues as
rvalues. Remove special case for caching reference initialization and fix a
cyclic initialization crash in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143204 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f17126e938aab826e38c73b4f4edb3f66b320157 27-Oct-2011 Hans Wennborg <hans@hanshq.net> Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143099 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d978c92e9502b0f8eda2e12e80a74996ccc06890 26-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar://problem/10309088>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143019 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
e859fbf5938fc0f8ca5aa115c35c66732174f513 25-Oct-2011 John McCall <rjmccall@apple.com> Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142931 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeLoc.cpp
50e13c58f2c5dafb9b0fdc93a4610c0e61b2ec8f 25-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r142914 and r142915, due to possibly missing file.

r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142921 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeLoc.cpp
1374a279a4708255530d462d4b03910e6441bf06 25-Oct-2011 John McCall <rjmccall@apple.com> Introduce a placeholder type for "pseudo object"
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.

Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142914 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeLoc.cpp
2922f4125587cd0aaf5d9a8fbe7530fa7bc90dbf 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Relax restriction of assigning to 'self' in ARC when a method is attributed with ns_consumes_self. Fixes <rdar://problem/10274056>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142909 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1db0028f9aadf052735dd3433ee43b091a272d3d 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142901 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtProfile.cpp
290c296a6f31f44a3031aff6b23534552cc7c3fa 25-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Clean up, as suggested by John.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142884 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
53a12a238d92dc2d78aa2d9721a70f24b5c44d83 25-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Revert r142844, it broke selfhost. The problem appears to be a missing
lvalue-to-rvalue conversion on the LHS operand of '->'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142872 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bdd9d74f39c8769a18576749fca63717fa7f4120 25-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add explanatory comments for ICE checking in C99 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142866 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
892cc7f95d7a4a80e40b5443b7f9a1c231997e6f 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: evaluate lvalues as lvalues, and rvalues as
rvalues, as C++11 constant evaluation semantics require. DeclRefs referring to
references can now use the normal initialization-caching codepath, which
incidentally fixes a crash in cyclic initialization of references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142844 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
38b4ed49b817b4f93e1ed3800de3fcd221c2da6b 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: factor out handling of ignored values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142835 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2aa40edd9f544460b49add4693d29bb6d78eb58b 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> In accordance with the C89, C99 and C++98 standards, ICEs can only contain
floating-point literals if they are the immediate operands of casts.
ImplicitCastExpr is not a cast in the language-standards sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142832 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3b60ca196ecf18e938bd1e55eb3af598b6d6be9f 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: factor out VarDecl initializer evaluation and
caching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142812 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
248b14a247ff47dff1752187dfb8a9743920d019 22-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactor vector constant expression evaluation to return bool like all the other
const expression evaluation subclasses, and remove some APValue copying and
malloc traffic in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142733 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
28bc9b09aab06a448784b732ce67e90d1ac7fe07 22-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try to set the "array filler" in a InitListExpr twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142695 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cc82772599d9272eaa526da4e4d575301eaa76df 22-Oct-2011 Eli Friedman <eli.friedman@gmail.com> More ASTRecordLayout changes for MS ABI; based on patch by r4start.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142694 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
d20f023d797483d47976923a29c955f26a6fa3d2 21-Oct-2011 Sean Callanan <scallanan@apple.com> I added a new function to DeclContext called
addDeclInternal(). This function suppresses any
calls to FindExternalVisibleDeclsByName() while
a Decl is added to a DeclContext. This behavior
is required for the ASTImporter, because in the
case of the LLDB client the ASTImporter would be
called recursively to import the visible decls,
which leads to assertions because the recursive
call is seeing partially-formed types.

I also modified the ASTImporter to use
addDeclInternal() in all places where it would
otherwise use addDecl(). This fix should not
affect the rest of Clang, passes Clang's
testsuite, and fixes several serious LLDB bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142634 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
b1ce730962fba225a7d59215e1a0ee71ce633b89 11-Nov-2011 Sean Callanan <scallanan@apple.com> When importing an ObjCInterfaceDecl, ensure that
superclass information is imported before validating
it. This fixes spurious "incompatible superclasses"
errors in LLDB.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144393 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f64699e8db3946e21b5f4a0421cbc58a3e439599 11-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evalation: const_cast support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144382 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cd99b072e8b32075da6233cbf14ea58a5c82de4f 11-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Reduce the constexpr stack pressure somewhat. Hopefully this will be enough to
please the buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144375 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
59efe266b804330f4c1f3a1b0ff783e67dd90378 11-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for constexpr member functions. This
reinstates r144273; a combination of r144333's fix for NoOp rvalue-to-lvalue
casts and some corresponding changes here resolve the regression which that
caused.

This patch also adds support for some additional forms of member function call,
along with additional testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144369 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6142ca7790aa09a6e13592b70f142cc4bbcadcae 10-Nov-2011 Devang Patel <dpatel@apple.com> Revert r144273. It causes clang self-host build failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144296 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6c95787b25c72a1c2421e349ef3459912362714a 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for constexpr member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144273 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
180f47959a066795cc0f409433023af448bb0328 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144265 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
ecl.cpp
xpr.cpp
xprConstant.cpp
80ee6e878a169e6255d4686a91bb696151ff229f 10-Nov-2011 John McCall <rjmccall@apple.com> There's no good reason to track temporaries in ExprWithCleanups,
but it is sometimes useful to track blocks. Do so. Also
optimize the storage of these expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144263 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprCXX.cpp
tmtDumper.cpp
1445bbacf4c8de5f208ff4ccb302424a4d9e233e 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporary fix for a performance problem Eli spotted. The APValue representation
is currently too inefficient to allow us to use it for array initializers, but
fortunately we usually don't yet need to evaluate such initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144260 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3d75ca836205856077c18e30e9447accbd85f751 09-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144156 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d9d137e6bc54bad6a7aa64b667aea22230e8264b 08-Nov-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev: add checks for removing Decls for more use cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144094 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
9da235244c2de2bcca654b518c66133c30ebde53 08-Nov-2011 John McCall <rjmccall@apple.com> Fix the layout of vb-tables and vf-tables in the MS C++ ABI.
Based on work by Dmitry Sokolov!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144072 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
63cf68a4fcb93b502934d0d9c4e2ea407180ceb9 08-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> TypePrinter: print OpenCL address space names. Patch by Richard
Membarth, test case by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144063 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
13330c4e85993b348b94958197f9a5be9b778741 08-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> DeclPrinter: print the declaration's storage class specifier as
written, instead of the resolved storage class, which might not be
legal to specify on the declaration (such as out-of-line definitions
of static class members in C++, and __local variables in OpenCL).
Initial patch by Richard Membarth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144062 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
db1822c6de43ff4aa5fa00234bf8222f6f4816e8 08-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix a cluster of related issues involving value-dependence and constant
expression evaluation:
- When folding a non-value-dependent expression, we may try to use the
initializer of a value-dependent variable. If that happens, give up.
- In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
is of integral or enumeration type (a reference isn't OK!)
- In C++11, DeclRefExprs for objects of const literal type initialized with
value-dependent expressions are themselves value-dependent.
- So are references initialized with value-dependent expressions (though this
case is missing from the C++11 standard, along with many others).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144056 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
45fa560c72441069d9e4eb1e66efd87349caa552 07-Nov-2011 Douglas Gregor <dgregor@apple.com> When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144011 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
11cbe2a7fb565678fca456f6bc2d4648ced3adb3 07-Nov-2011 Richard Trieu <rtrieu@google.com> Add support for printing integer literals of type short, unsigned short,
__int128_t and __uint128_t. Short and unsigned short integer literals support
is only to work around a crasher as reported in PR11179 and will be removed
once Clang no longer builds short integer literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143977 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
cc5d4f637cdf83adc174b96d2bfe27cef1cf0f36 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143922 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
38dce9b19c3cc85698fb44ea182f9e7fa0fa4a69 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix 32-bit build bots and remove some casting-away-const warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143914 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
7864435ef2bce200224120bd1df3aed98ea5b99a 07-Nov-2011 John McCall <rjmccall@apple.com> Rip out CK_GetObjCProperty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143910 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
9a17a680c74ef661bf3d864029adf7e74d9cb5b8 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: preserve subobject designator when flattening a
core constant value down to an APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143909 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
cd689927139d3ab52c0c088521633c661bd2d807 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Allow constexpr variables' initializers to be folded in C++11 mode. This
partially undoes the revert in r143491, but does not introduce any new instances
of the underlying issue (which is not yet fixed) in code which does not use
the 'constexpr' keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143905 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
39e02032b01874a0d02ba85a4cd3922adda81376 06-Nov-2011 David Blaikie <dblaikie@gmail.com> Correcting grammar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143894 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4f80e00dc64ceabd8822db927259b94d486e0f15 06-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Make format string 64 bit safe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143870 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.cpp
4b9c2d235fb9449e249d74f48ecfec601650de93 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
e4ebbf79c7045343b9dbe49c721c6023be06f9ee 05-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Now that we have a portable 64 bit format string use it to make this simple again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143800 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8a5d0aedc16ab1a5beff6bbc1b470f47d2c28b67 05-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix incorrect format string in debug output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143768 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
92d3dda09f72b700e15b7b652a7bb47718989994 04-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143696 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
69c2c50498dadfa6bb99baba52187e3cfa0ac78a 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: refactor to start the groundwork for coping with
initializations which refer indirectly to elements of the object being
initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143680 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0a3bdb646ee0318667f4cebec6792d2548fb9950 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: track the manner in which an lvalue was written,
to allow us to implement the C++11 rule that a non-active union member can't be
read, and use it to implement subobject access for string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143677 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
74f4634781cee06e28eb741bda5d0f936fdd1948 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: although we don't know whether a literal will
be at the same address as another object, we do know it won't alias a null
pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143674 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
49cf8847ef4d9caebdd162d2a5d7d055333d8b5c 04-Nov-2011 Richard Trieu <rtrieu@google.com> In the AST dump, add a space between the type and value for CharacterLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143667 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
27c72d8ca8bbb2861959c71f737e2560a7bf9991 03-Nov-2011 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter to import DefinitionData bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143631 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
25270b6e6a8416b7532cfe552b41794418ea19b1 03-Nov-2011 Douglas Gregor <dgregor@apple.com> Add a printing policy flag to suppress printing "<anonymous>::" prior
to types. Enable this flag for code completion, where knowing whether
something is in an anonymous or inline namespace is actually not
useful, since you don't have to type it anyway. Fixes
<rdar://problem/10208818>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143599 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
ypePrinter.cpp
21a25167b8279df3d8f889d041a4fd98733d3c27 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
38738fcace68630bbbfe174c6a3698a4c94b3dc9 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Use StringLiteral::getBytes(), not StringLiteral::getString(), when profiling the expression, so that it works for non-UTF8 strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143550 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
65ac598c7ba7e36f2ad611f2bb39cc957053be5d 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> When constant-folding, don't look at the initializer of a global const variable
if it's marked as weak: that definition may not end up being used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143496 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
344d78d6a669fb324f89937fc0739f97670f4700 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporarily disable lvalue-to-rvalue conversions on const pointers while an
apparent miscompile triggered by this is investigated. This is essentially a
revert of r143298.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143491 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
87ec9c257c99b4136af6c7f5be5a2d486906ba84 01-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] For a class extension, give it a unique USR but for any property or ivar
it contains give it a USR based on its semantic context, which is the interface.

This follows what we already did for objc methods. rdar://10371669

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
177dce777596e68d111d6d3e6046f3ddfc96bd07 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 'constexpr calls must return constant expressions' rule, and
perform the code simplifications this rule allows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
64f45a24b19eb89ff88f7c3ff0df9be8e861ac97 01-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
treating wide strings as a series of bytes.

Patch by Seth Cantrell.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143417 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
76852c218a207ef43583515cb835b6e855353a0f 01-Nov-2011 Douglas Gregor <dgregor@apple.com> Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143410 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c45061bd0c0fdad4df8eea7e9e5af186d11427e5 31-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Some minor comment changes in constant-folding comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143391 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ffbda40a1fb7169591dc01771f3511178a2f727c 31-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Don't try to fold comparisons between the address of an object and an arbitrary integer constant. Fixes regression from r143334.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143374 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6a7c94af983717e2c2d6aebe42cb4737c1c7b9e6 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactoring and test for r143360. Support for array rvalue to pointer decay is
needed for C++11, and will follow later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143363 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
aa97b53175ef138144f69dbc7fda6870c5740226 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Temporary fix for assert while evaluating array-to-pointer decay on array
rvalue. Test and better fix to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143360 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bd552efbeff3a64a1c400d2bba18f13f84abd8ab 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expression handling: evaluation support for
materialized temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143335 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9e36b533af1b2fa9f32c4372c4081abdd86f47e0 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: evaluate equality comparisons between
arbitrary pointers, if those pointers don't point to weak objects or literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143334 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
625b80755b603d28f36fb4212c81484d87ad08d3 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 generalized constant expressions: support pointer comparisons where the
result is not unspecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143329 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7993e8a2a26bf408c2a6d45f24fffa12db336b2b 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert on constant expression evaluation of floating point increment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143320 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5eca37c7fe233dce58ea41fc364680724885144d 30-Oct-2011 Jim Goodnow II <jim@thegoodnows.net> Fixed CXX struct and class initialization printing to support 'move'
type constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143309 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
342f1f8b0a402c5a7f8c5055db7f60a7808f1687 30-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash if a GCC binary conditional is used in a constant expression on an
integer-cast pointer value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143299 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b78c0b66481a59dbef7ac2a454e4f89448909749 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
just integers and floating point types. Since we don't support evaluating class
types or performing lvalue-to-rvalue conversions on array elements yet, this
just means pointer types right now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143298 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
47a1eed1cdd36edbefc318f29be6c0f3212b0c41 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr function substitution:
Track the function invocation where an lvalue referring to a constexpr function
parameter originated from, and use it to substitute the correct argument and to
determine whether such an argument's lifetime has ended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143296 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
51f4708c00110940ca3f337961915f2ca1668375 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ee591a90c2e26c1ba33a4befb364a1c35fb2c311 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143250 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d0dcceae2a8ca0e37b5dd471a704de8583d49c95 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Initial support for C++11 constexpr function invocation substitution. Using
constexpr function arguments outside of their function (passing or returning
them by reference) does not work correctly yet.

Calling constexpr function templates does not work yet, since the bodies are not
instantiated until the end of the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c49bd11f96c2378969822f1f1b814ffa8f2bfee4 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
are present in all the necessary places:

In constant expression evaluation, evaluate lvalues as lvalues and rvalues as
rvalues. Remove special case for caching reference initialization and fix a
cyclic initialization crash in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143204 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
29e97cb35fab314388f62b68fefa78947e93c1dc 27-Oct-2011 Hans Wennborg <hans@hanshq.net> Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143099 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
68a2dc446fe6d32d5da3557902100ed06b21b12b 26-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar://problem/10309088>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143019 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
3c3b7f90a863af43fa63043d396553ecf205351c 25-Oct-2011 John McCall <rjmccall@apple.com> Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142931 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeLoc.cpp
327a50f46449c946c42d50d97689bcb30e2af7d9 25-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r142914 and r142915, due to possibly missing file.

r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142921 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeLoc.cpp
a1b852f8e1bee5ed3604ee483803cef39ce57a20 25-Oct-2011 John McCall <rjmccall@apple.com> Introduce a placeholder type for "pseudo object"
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.

Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142914 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeLoc.cpp
3045ce71304ec8ddef34ced5ee9fa9303f12432e 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Relax restriction of assigning to 'self' in ARC when a method is attributed with ns_consumes_self. Fixes <rdar://problem/10274056>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142909 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ba0513de93d2fab6db5ab30b6927209fcc883078 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142901 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtProfile.cpp
98326ede499696f85d9f7bc1fbc7a628fc22f1ec 25-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Clean up, as suggested by John.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142884 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
436c8898cd1c93c5bacd3fcc4ac586bc5cd77062 25-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Revert r142844, it broke selfhost. The problem appears to be a missing
lvalue-to-rvalue conversion on the LHS operand of '->'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142872 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
05830143fa8c70b8bc46c96b93018455d8a2ca92 25-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add explanatory comments for ICE checking in C99 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142866 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
41bf4f38348561a0f12c10d34f1673cd19a6eb04 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: evaluate lvalues as lvalues, and rvalues as
rvalues, as C++11 constant evaluation semantics require. DeclRefs referring to
references can now use the normal initialization-caching codepath, which
incidentally fixes a crash in cyclic initialization of references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142844 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8327fad71da34492d82c532f42a58cb4baff81a3 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: factor out handling of ignored values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142835 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
32cb47174304bc7ec11478b9497c4e10f48273d9 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> In accordance with the C89, C99 and C++98 standards, ICEs can only contain
floating-point literals if they are the immediate operands of casts.
ImplicitCastExpr is not a cast in the language-standards sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142832 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
03f96110bc2c2c773e06a42982b17a03dd2e5379 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: factor out VarDecl initializer evaluation and
caching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142812 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
07fc657e3077531805b0e2dbf8f8964d48daa38b 22-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactor vector constant expression evaluation to return bool like all the other
const expression evaluation subclasses, and remove some APValue copying and
malloc traffic in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142733 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fe6bd6dc51777802a0118521b9039981a0e6a806 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to upstream Oct 20th 2011 (r142531)

Change-Id: I32cdb5da2c07c84e01f42b4e87161196f468806a
ndroid.mk
00a92abaf907802bfa4d6f38bdd242c6bfc34c09 21-Oct-2011 Logan Chien <loganchien@google.com> Merge with clang upstream Oct 20th 2011 (r142531)

Change-Id: I42181113f38ce445f2a48694d6f654438562b71e
21f77cd0c3da8a1dbaf6245cae43baf4c0b80ea4 22-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try to set the "array filler" in a InitListExpr twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142695 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
227e483cb1f77ea6dcd38c2ca9fb490894a5f887 22-Oct-2011 Eli Friedman <eli.friedman@gmail.com> More ASTRecordLayout changes for MS ABI; based on patch by r4start.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142694 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
9faf810f08132aabb34a478297dfeea89c3bbe17 21-Oct-2011 Sean Callanan <scallanan@apple.com> I added a new function to DeclContext called
addDeclInternal(). This function suppresses any
calls to FindExternalVisibleDeclsByName() while
a Decl is added to a DeclContext. This behavior
is required for the ASTImporter, because in the
case of the LLDB client the ASTImporter would be
called recursively to import the visible decls,
which leads to assertions because the recursive
call is seeing partially-formed types.

I also modified the ASTImporter to use
addDeclInternal() in all places where it would
otherwise use addDecl(). This fix should not
affect the rest of Clang, passes Clang's
testsuite, and fixes several serious LLDB bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142634 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
7c81c2a5915878e4aa6908a097290fd47fb3a154 19-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't forget to complete the objc interface before asking for information,
otherwise lldb will suffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142471 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e0a22d06888c13989b3f72db319f1d498bf69153 18-Oct-2011 John McCall <rjmccall@apple.com> Macro metaprogramming for builtin types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142420 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprClassification.cpp
taniumMangle.cpp
icrosoftMangle.cpp
dd67723af339f94870149ee1934dd652f83ca738 18-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Simplify RecordDeclCXX::setBases slightly. No functional change.

Add test that a variadic base list which expands to 0 bases doesn't make the
class a non-aggregate. This test passed before the change, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142411 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
66f284632dc2e286e3abbd72bc1a44472f9117cc 18-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Revert accidental commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142326 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
97c0aefe8c0523417ffe8a500a220286e11e7a46 18-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Rewrite parts of MS ABI C++ layout. Based on work by r4start; I ended up doing this while I was trying to review his patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142325 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
454b57ac42c9ce0bed9b7a99c2ed5a18fbcd286b 17-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Initial implementation of __atomic_is_lock_free. The input is the size of an atomic type rather than an atomic type itself just to save some implementation pain; I can change that if it seems worthwhile.

I think this is the last hook needed for <atomic> besides defines for ATOMIC_CHAR_LOCK_FREE and friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142281 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b4a686df4de21ec4eeca69211b21f7fe716abeae 17-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTConsumer::HandleTopLevelDeclInObjCContainer which accepts
top-level declarations that occurred inside an ObjC container.

This is useful to keep track of such decls otherwise when e.g. a function
is declared inside an objc interface, it is not passed to HandleTopLevelDecl
and it is not inside the DeclContext of the interface that is returned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142232 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
6d4740e740f9c109c76c111cc90a63f6a24f6357 17-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Have ObjCMethodDecl::getCanonicalDecl take into account redeclared methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142231 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b05d7b20171bbd2feb14b059f39332cbe1bf1014 17-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Keep track when a ObjC interface/protocol was initially created as a forward reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142230 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
0ddaeb9b031070ec64afe92d9892875ac44df427 17-Oct-2011 John McCall <rjmccall@apple.com> Add a new placeholder type to represent "unbridged"
casts in ARC.

No semantic analysis yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142208 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypeLoc.cpp
1e12c59e8f9bb76c23628c4e0d0a1dfced0b1fa0 16-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Split apart the state accumulated during constant expression evaluation and the
end result. Use this split to propagate state information and diagnostics
through more of constant expression evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142159 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b75a3451bcae1301875282e73a13934c90b6574c 15-Oct-2011 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter to perform DeclContext lookups in a way that
avoids loading data from an external source, since those lookups were
causing some "interesting" recursion in LLDB.

This code is not efficient. I plan to remedy this inefficiency in a
follow-up commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142023 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
aa4a99b4a62615db243f7a5c433169f2fc704420 15-Oct-2011 Anton Korobeynikov <asl@math.spbu.ru> Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142016 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypeLoc.cpp
dfa64ba45922e1c28e36341bdf34785fea74659b 15-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Add template instantiation support for AtomicExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142012 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7c9412cdad37146e6d1eee15eaa0d7a1d93e6ee1 14-Oct-2011 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter not to import redundant fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142009 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
2be460723940f8184ec36529b6f6ddf59c04e411 14-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142002 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
b8989f27f116ff2400e92a52c067a69846119eb5 14-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.

Passing a pointer was a bad idea as it collides with the overload for void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
ecordLayoutBuilder.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
72b2625aa67c8213acaf4bf6209b67859d60e2cf 14-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Serialize info about redeclared objc methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141964 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3a919e7110407ae7609bb6edc57aac16a5990661 14-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Really protect from infinite loop when there are objc method redeclarations.

Serialization part will come later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141950 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b40034c2e580ab3b08de9dfb738d8e5d8ef79136 14-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Keep track of objc method redeclarations in the same interface.

Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141946 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6700415542121e2cb7d867728046ffa21e402019 12-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141803 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
5fa6a0422f12216d549d0f2991a29d5690634065 12-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: don't consider class types with mutable members to be literal types.

The standard doesn't allow this, but mutable constexpr variables break the
semantics so badly that we can't reasonably accept them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141768 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8a1d6a5eec8287729084e2a79b39fac96a9c75cd 12-Oct-2011 Eli Friedman <eli.friedman@gmail.com> PR11062: Make C99 inlining work properly for names with associated builtin libcalls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141723 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f10d9171ac24380ca94c71847a9270a05b791cef 11-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: refactor value initialization and scalar list initialization into base class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141717 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9e3c20b2b600af7b2b8c65fb12362ba2046caf10 11-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Silence some -Wuninitialized false positives with gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141701 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
276b061970939293f1abaf694bd3ef05b2cbda79 11-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Initial implementation of __atomic_* (everything except __atomic_is_lock_free).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141632 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
db924224b51b153f24fbe492102d4edebcbbb7f4 11-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Extend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast (which is completely trivial). PR8836.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141604 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a6b8b2c09610b8bc4330e948ece8b940c2386406 10-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141561 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
xpr.cpp
xprConstant.cpp
taniumMangle.cpp
ecordLayoutBuilder.cpp
d61db33331c264d6361283602b248a7423040597 10-Oct-2011 Douglas Gregor <dgregor@apple.com> Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141549 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b8da98a2182d2c69c72136b9a9ebabd4694f3d6b 10-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Another case of HadMultipleCandidates being used uninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141532 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ec2ec1f20322076717c3865b196f7a1c95d883a4 07-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In DeclContext::LoadLexicalDeclsFromExternalStorage don't clear out
the fields if they are already loaded, just ignore them when we are building
the chain in BuildDeclChain.

This fixes an lldb issue where fields were removed and not getting re-added
because lldb is based on ASTImporter adding decls to DeclContext and fields
were already added before by the ASTImporter.

We should really simplify the interaction between DeclContext <-> lldb
going forward..

rdar://10246067

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141418 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
5e1cdac63c3d9c9b32fa41fa0b2d242a58a20d49 07-Oct-2011 John McCall <rjmccall@apple.com> Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141355 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclPrinter.cpp
ecordLayoutBuilder.cpp
ype.cpp
TableBuilder.cpp
6595935602f57b4f2115785bb39dabc83e4232dc 07-Oct-2011 John McCall <rjmccall@apple.com> Record layout requires not just a definition, but a complete
definition. Assert this. Change IR generation to not try to
aggressively emit the IR translation of a record during its
own definition. Fixes PR10912.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141350 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b001de7458d17c17e6d8b8034c7cfcefd3b70c00 07-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.

Thanks to Jeffrey Yasskin for the thorough review!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141330 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypePrinter.cpp
d211cb709510fbe7e75167b9feee0050851d001a 06-Oct-2011 Ted Kremenek <kremenek@apple.com> Use a sidetable in ASTContext for ParmVarDecls whose index exceeds the 8 bits reserved for that value in VarDecl. Fixes PR 10538.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141273 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
0d94094cdbfd531ec96b719e0c8339aff7463ff9 05-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix crash when using archaic protocol, rdar://10238337

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141215 91177308-0d34-0410-b5e6-96231b3b80d8
electorLocationsKind.cpp
88934e85f81abdc4fb5202325252be3bcab5ebf0 05-Oct-2011 Daniel Dunbar <daniel@zuster.org> Driver & AST: Implement support for -fpack-struct and -fpack-struct= command
line options.
- <rdar://problem/10120602>, PR9631

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141211 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b390921e55db36ee0ab1ca203c166f0f8c96f631 05-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Use APFloat::toString to print APFloats more precisely in the AST printer. Patch by Olaf Krzikalla.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141208 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
7cc58b4c927fca539d43eaa58e00dca95946eb7c 05-Oct-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added a flag to identify resolved overloaded function references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141171 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xprCXX.cpp
68395a7a9c5ec4400c4d76f16ee20d9b4c9326d8 05-Oct-2011 Eric Christopher <echristo@apple.com> Fix doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141165 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
53c8167d7a007daae87f342c0fedd03f1dcf1b62 05-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> c: assignment/init of a function pointer whose function(s)
return to one which does not return (has noreturn attribute)
should warn as it is an unsafe assignment. // rdar://10095762
c++ already handles this. This is the c version.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141141 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1711fc91efb36d131f7ba771f73f0154dc1abd1f 04-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve location fidelity of objc decls.

-Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl.
-Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the
class name, not the location of '@'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141061 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
09d8212989c64abad4b745f37f56ca77b44de537 03-Oct-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for template implicit instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141018 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
491306a83c4f0f49f95a3bcbca8580cb98a91c7a 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow getting all source locations of selector identifiers in a ObjCMethodDecl.

Instead of always storing all source locations for the selector identifiers
we check whether all the identifiers are in a "standard" position; "standard" position is

-Immediately before the arguments: -(id)first:(int)x second:(int)y;
-With a space between the arguments: -(id)first: (int)x second: (int)y;
-For nullary selectors, immediately before ';': -(void)release;

In such cases we infer the locations instead of storing them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140989 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclObjC.cpp
electorLocationsKind.cpp
b994e6c7d57b00e3e0f69d152065e2cf85d1de33 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move field in ObjCMessageExpr to avoid padding.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140988 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
207180802c836fda8acbedb47a92f9d2bdca59c3 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow getting all source locations of selector identifiers in a ObjCMessageExpr.

Instead of always storing all source locations for the selector identifiers
we check whether all the identifiers are in a "standard" position; "standard" position is

-Immediately before the arguments: [foo first:1 second:2]
-With a space between the arguments: [foo first: 1 second: 2]
-For nullary selectors, immediately before ']': [foo release]

In such cases we infer the locations instead of storing them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140987 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xpr.cpp
electorLocationsKind.cpp
8d9ed7980405e91a12e33338a78fb99620adf553 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> ArrayRef'ize ObjCMessageExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140986 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
04fb8ef41ed2bd9533ba9392b4db1a7379752c16 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add an assertion that we don't overflow the bitfield ObjCMessageExpr::NumArgs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140985 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
11d77169555480ee0a04c6e5bc390d8fde41175d 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pass from the parser the locations of selector identifiers when creating
objc method decls.

They are not stored in the AST yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140984 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
da92a7f91cf88f49e02050919676f7fb8e3bdff8 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't keep NumSelectorArgs in the ObjCMethodDecl, the number can be derived from the selector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140983 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
951376242c076c3f62dd78bf672909fc011991db 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pass all the locations of the selector identifiers for a message expression from the parser.

They are not kept in the AST yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140982 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9f569cca2a4c5fb6026005434e27025b9e71309d 01-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: semantic checking for constexpr functions and constructors. Based in
part on patches by Peter Collingbourne.

We diverge from the C++11 standard in a few areas, mostly related to checking
constexpr function declarations, and not just definitions. See WG21 paper
N3308=11-0078 for details.

Function invocation substitution is not available in this patch; constexpr
functions cannot yet be used from within constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140926 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7426f793844407021ffeb5afcf917fff1a57f196 30-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140829 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
eea0e817c609c662f3fef61bb257fddf1ae8f7b7 29-Sep-2011 Eli Friedman <eli.friedman@gmail.com> PR11040: CheckICE should not allow an lvalue bitcast as part of an integer constant expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140812 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
82d0b0aab9088e977c2a44c4a5a90479c63149fe 29-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for alignment-specifiers in C1X and C++11, remove
support for the C++0x draft [[align]] attribute and add the C1X
standard header file stdalign.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140796 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
78213e4aec6d8d22b5828dd2687fa19116ebaa26 28-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc arc: Diagnose block pointer type mismatch when
some arguments types are ns_consumed and some otherwise
matching types are not. This is objc side of
// rdar://10187884


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140729 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c8680f46970a5a53d07e05edd93657e64764da3c 28-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::getParentFunctionOrMethod which if the decl is defined inside
a function/method/block it returns the corresponding DeclContext, otherwise it returns null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140672 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8987b2385d9ba63ada66e1344ace79b04d5cb5c3 28-Sep-2011 Douglas Gregor <dgregor@apple.com> Only print _Bool as 'bool' when 'bool' is defined as an object-like
macro whose only replacement token is '_Bool'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140656 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
30c42404202d2e2512e51efc6066bd614cfdb5a4 28-Sep-2011 Douglas Gregor <dgregor@apple.com> When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140650 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
eclPrinter.cpp
ype.cpp
ypePrinter.cpp
2fe363622c32c471e8a68c68ba5cc372644f24fb 27-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Some changes to improve compatibility for MSVC-style C++ struct layout. Patch from r4start at gmail.com (with some minor modifications by me).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140623 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
620b9338dce31ace41f2f1fa491def3043412568 27-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Constant evaluation for pointer CXXScalarValueInitExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140613 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
19aa8609a5d04eed9b81aa1c4608e8a4f3df6ccd 26-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix assertion hit when @encoding C++ classes. rdar://10172840 & http://llvm.org/PR10990

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140542 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a48e676a717309afa50ae06a3d4674acec025bf9 26-Sep-2011 Douglas Gregor <dgregor@apple.com> Re-arrange and bitfieldify data members of CXXConstructExpr to save a
little storage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140529 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
24018467ddb13857b764182f7753764d2f32f87d 26-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Move VTable builder to AST

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140510 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
TableBuilder.cpp
5c551f7aef7db952eca6133366e5afa9e37ab0b7 26-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Move VTT builder to AST

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140501 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
TTBuilder.cpp
d6471f7c1921c7802804ce3ff6fe9768310f72b9 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename Diagnostic to DiagnosticsEngine as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
taniumMangle.cpp
icrosoftMangle.cpp
cea8d966f826554f0679595e9371e314e8dbc1cf 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Treat list-initialization of scalars as a first-class citizen in C++11.
Allow empty initializer lists for scalars, which mean value-initialization.
Constant evaluation for single-element and empty initializer lists for scalars.
Codegen for empty initializer lists for scalars.
Test case comes in next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140459 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
taniumMangle.cpp
icrosoftMangle.cpp
emplateBase.cpp
e3f834950801f1334f1b3f3f7e9a34062905fe1d 23-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc-gc: Fix a corner case where clang fails to generate GC
write barrier with captured pointer to object. // rdar://10150823


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140399 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9fe8c74a93ac8e92512615c5f83e7a328b3b0544 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Fix missing includes for llvm_unreachable


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140368 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
taniumMangle.cpp
icrosoftMangle.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateBase.cpp
71a7605977113c795edd44fcbd2302ad49506653 22-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't use TemplateArgumentListInfo inside AST nodes because it may leak.
Use ASTTemplateArgumentListInfo instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140331 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
xpr.cpp
emplateBase.cpp
b0c3e0909bb04af0bfb82ad01ab6909649d68cca 22-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140330 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
3340e27fe15c52fe28fc722a98fd55d796c90442 22-Sep-2011 Douglas Gregor <dgregor@apple.com> Fix the ASTImporter's lookup for anonymous structs/unions that get a
linkage name via typedef. Patch from/fixes PR10958.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140317 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
4278c654b645402554eb52a48e9c7097c9f1233a 21-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying Function/BlockDecl's setParams


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140268 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
8be0c74e4a779b13c2d8fd8482dcd438eeb089d3 20-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Remove redundant break statements, and replace asserts with llvm_unreachable

Per John's review comments for r140068.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140142 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8c25fc584ce27d59df9923f153e8a132dde58d04 19-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: introduce support for function scope __local variables

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140068 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclPrinter.cpp
a64ccefdf0ea4e03ec88805d71b0af74950c7472 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.

It already works (and is useful with) macro locs as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140057 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
6e5218367c513fe02d1c7210023d40739ecb1572 19-Sep-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix a QoI bug with overloaded operators inside macros.

We were failing to set source locations and ranges in isUnusedResultAWarning
for CXXOperatorCallExprs, leading to an "expression result unused" warning
with absolutely no context if the expression was inside a macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140036 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e8683d6d389def2fce229325435ba3c2b3f75492 14-Sep-2011 John McCall <rjmccall@apple.com> In general, don't look through explicit casts when trying
to find the called declaration. Explicit casts can radically
change the semantics of a call, and it's no longer really a
builtin call any more than it would be a builtin call if you stored
the function pointer into a variable and called that.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139659 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
144b38a7995cbe0928e34fbcc865bb2d2be4f7a3 13-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Fix a regression that r139441 introduced (decls were getting passed
to the consumer without being fully deserialized).

The regression was on compiling boost.python and it was too difficult to get a reduced
test case unfortunately.

Also modify the logic of how objc methods are getting passed to the consumer;
codegen depended on receiving objc methods before the implementation decl.
Since the interesting objc methods are ones with a body and such methods only
exist inside an ObjCImplDecl, deserialize and pass to consumer all the methods
of ObCImplDecl when we see one.

Fixes http://llvm.org/PR10922 & rdar://10117105.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139644 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e289d81369914678db386f6aa86faf8f178e245d 13-Sep-2011 Douglas Gregor <dgregor@apple.com> Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
33e56f3273457bfa22c7c50bc46cf5a18216863d 10-Sep-2011 John McCall <rjmccall@apple.com> Rename the ARC cast kinds to start with "ARC".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139466 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
a81b36d7bcab545938640a859cc2f8a472fcb02a 10-Sep-2011 Richard Trieu <rtrieu@google.com> Fix a broken assert in AST/DeclCXX.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139461 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
dc05b11c67331016473fbc7909827b1b89c9616b 10-Sep-2011 John McCall <rjmccall@apple.com> When converting a block pointer to an Objective-C pointer type, extend
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.

There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
94da1587f7d584fc61df793229d197969f204cd9 10-Sep-2011 Douglas Gregor <dgregor@apple.com> Clean up our handling of Objective-C definitions in AST files. Rather
than having CodeGen check whether a declaration comes from an AST file
(which it shouldn't know or care about), make sure that the AST writer and
reader pass along "interesting" declarations that CodeGen needs to
know about.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139441 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a1364be341550d71dff27dd8de0c6872ba6c707e 10-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extend the Stmt AST to make it easier to look through label, default,
and case statements. Use this to make the logic in the CFG builder more
robust at finding the actual statements within a compound statement,
even when there are many layers of labels obscuring it.

Also extend the test cases for a large chunk of PR10063. Still more work
to do here though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139437 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
45df9c68b4d8eb2206b884c38e89f56d41452c83 09-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use ArrayRef in ExternalASTSource::SetExternalVisibleDeclsForName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139357 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1d9b3b25f7ac0d0195bba6b507a684fe5e7943ee 09-Sep-2011 John McCall <rjmccall@apple.com> Give conversions of block pointers to ObjC pointers a different cast kind
than conversions of C pointers to ObjC pointers. In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139352 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
ype.cpp
8d267c57afb3af418ed5281b7a9bb4555d701a82 09-Sep-2011 Douglas Gregor <dgregor@apple.com> Modules: introduce the __module_private__ declaration specifier, which
indicates that a declaration is only visible within the module it is
declared in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139348 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
c0244c5c351db18c6c35c1594872dde072b90df9 08-Sep-2011 Douglas Gregor <dgregor@apple.com> Look through SubstNonTypeTemplateParmExpr nodes in the various
Expr::Ignore* methods that also look through implicit casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139303 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ed9d84a2112e2bd56befb5f4fa8fc5bdf71fafa3 08-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: added support for function scopes in attribute arguments.

This patch was written by DeLesley Hutchins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139302 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5471bc85b69912e3b448de004498a80c0de32296 08-Sep-2011 Douglas Gregor <dgregor@apple.com> Allow C++0x enumerations with a fixed underlying type in
Objective-C. The @encode'ing of such an enumeration type is the same
as its underlying type. <rdar://problem/5276348>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139297 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e97179c675b341927807c718be215c8d1aab8acb 08-Sep-2011 Douglas Gregor <dgregor@apple.com> Implement the Objective-C 'instancetype' type, which is an alias of
'id' that can be used (only!) via a contextual keyword as the result
type of an Objective-C message send. 'instancetype' then gives the
method a related result type, which we have already been inferring for
a variety of methods (new, alloc, init, self, retain). Addresses
<rdar://problem/9267640>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139275 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1ddc9c4674b7c737ec65241a531df8c64e40b0a9 06-Sep-2011 Douglas Gregor <dgregor@apple.com> When extracting the callee declaration from a call expression, be sure
to look through SubstNonTypeTemplateParmExprs. Then, update the IR
generation of CallExprs to actually use CallExpr::getCalleeDecl()
rather than attempting to mimick its behavior (badly).

Fixes <rdar://problem/10063539>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139185 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ae5860e1787230dd8b8948a08632c9be777d8522 06-Sep-2011 Ted Kremenek <kremenek@apple.com> Don't emit -Wpadded warnings without a valid SourceLocation. This can happen when RecordLayoutBuilder is used by Codegen, not Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139162 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
017ab77655b262311a3550342ca19b85380f8f20 05-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement the suggested resolution of WG21 N3307 issue 19: When determining whether a class is an aggregate in C++0x, treat all functions which are neither deleted nor defaulted as user-provided, not just special member functions. The wording of the standard only defines the term "user-provided" for special member functions, but the intent seems to be that any function can be user-provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139111 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cc2fca2ba2716293204901b8d2393428b965f12a 02-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Make StmtDumper::VisitCXXFunctionalCastExpr dump the attached cast kind. Fix the cast kind for a cast from floating-point to enum type. (The difference isn't actually visible, but that's just because IRGen is overly forgiving.) Per report by Enea Zaffanella on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139011 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
xprConstant.cpp
taniumCXXABI.cpp
taniumMangle.cpp
icrosoftCXXABI.cpp
ecordLayoutBuilder.cpp
tmt.cpp
3e3cd93b2fd9644e970c389e715c13883faf68b6 01-Sep-2011 Douglas Gregor <dgregor@apple.com> Teach ASTContext and Preprocessor to hold on to references to the same
LangOptions, rather than making distinct copies of
LangOptions. Granted, LangOptions doesn't actually get modified, but
this will eventually make it easier to construct ASTContext and
Preprocessor before we know all of the LangOptions.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138959 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e6b8d68a927368b06ac06cc9ac9e7f60aa966d5f 01-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support importing of ObjC categories from modules.

The initial incentive was to fix a crash when PCH chaining categories
to an interface, but the fix was done in the "modules way" that I hear
is popular with the kids these days.

Each module stores the local chain of categories and we combine them
when the interface is loaded. We also warn if non-dependent modules
introduce duplicate named categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138926 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b0656ec72e25e5c8e463c2dc39914636f0cb06d1 31-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Improve the diagnostic text for -Wmissing-noreturn to include the name
of the function in question when applicable (that is, not for blocks).
Patch by Joerg Sonnenberger with some stylistic tweaks by me.

When discussing this weth Joerg, streaming the decl directly into the
diagnostic didn't work because we have a pointer-to-const, and the
overload doesn't accept such. In order to make my style tweaks to the
patch, I first changed the overload to accept a pointer-to-const, and
then changed the diagnostic printing layer to also use
a pointer-to-const, cleaning up a gross line of code along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138854 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
85ea7aa961deac1d754f610af8062ae3f8b4e2a5 30-Aug-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Declare and define implicit move constructor and assignment operator.

This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprClassification.cpp
ype.cpp
955fadbdfecfa24a590febe66a86519096787f2d 30-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove a few mutating ObjCCategoryDecl methods.

Remove
-setClassInterface
-setNextClassCategory
-insertNextClassCategory

and combine them in the Create function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138817 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
80cb6e69d9e85231588ae604e4bc2bc9a07389af 29-Aug-2011 Nico Weber <nicolasweber@gmx.de> Warn on missing [super finalize] calls.

This matches gcc's logic. Second half of PR10661.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138730 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
95ed7784a335aca53b0c6e952cf31a4cfb633360 27-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138709 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
eclObjC.cpp
eclPrinter.cpp
umpXML.cpp
9fc18c97991b1267221ee71d13d8fb2f036b387b 26-Aug-2011 Douglas Gregor <dgregor@apple.com> When we're deserializing declarations lexically stored in a RecordDecl
after having already deserialized the fields, clear out the fields
first. This makes sure that we keep all of the declarations in the
lexical context (including those implicitly added by later
type-checking) within the same list. A test case for this behavior is
coming as part of another commit; testing for this problem in
isolation is a nightmare.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138661 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
02368d0d1a778b73fd73600496fcde4557b2973f 26-Aug-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev: unnamed decls cannot be removed from the lookup map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138631 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
203ba053ef3a7ccab513963118b4632b358c7e89 25-Aug-2011 Douglas Gregor <dgregor@apple.com> Remove long-dead FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138498 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c266de97e269c3747ffc2d122fe53185b541cb37 24-Aug-2011 Douglas Gregor <dgregor@apple.com> Don't force the complete deserialization of the visible-declarations
table when serializing an AST file. This was a holdover from the days
before chained PCH, and is a complete waste of time and storage
now. It's a good thing it's useless, because I have no idea how I
would have implemented MaterializeVisibleDecls efficiently in the
presence of modules.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138496 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xternalASTSource.cpp
cc075e4092900ac9eec9dc92e35096eae1ee29c7 24-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objc - fix up the builtin type for objc_assign_ivar.
// rdar://9362887.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138412 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0124839d7fb3d846795190ba2ccf3951f27784fe 22-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Fix a crash-on-valid that has been here for a very long time:

const int &x = x;

This crashed by inifinetly recursing within the lvalue evaluation
routine. I've added a (somewhat) braindead way of preventing this
recursion. If folks have better suggestions for how to avoid it I'm all
ears.

That said, we have some work to do. This doesn't trigger a single
warning for uninitialized, self-initialized or otherwise completely
wrong code. In some senses, the crash was almost better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138239 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cb8061e321bc6f46f154529885028256c7ae1fb2 22-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix a bug in objc @encoding of C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138235 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3060178ad9df29789505c1e6debcfc80a3a13587 18-Aug-2011 Chad Rosier <mcrosier@apple.com> Fix else style. No functionality change intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137896 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclObjC.cpp
07c682a08596027f015d8700bccddc9dba2d8d4c 17-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix incorrect code indentation and silence dead store warning due to idiomatic code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137870 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
75cf3e86d33ce810c12084126385371b335c30ba 17-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Mark objc methods that are implicitly declared for properties (not user-declared) as implicit.
This results in libclang ignoring such methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137852 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
9b10683a3f222d8dc6e139073ca96b97b439747b 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Whitelist operator== and operator!= as valid for unused value warnings,
even when overloaded and user-defined. These operators are both more
valuable to warn on (due to likely typos) and extremely unlikely to be
reasonable for use to trigger side-effects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137823 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bc84532e762a41141bd94037cd5d1133f234088e 17-Aug-2011 Francois Pichet <pichet2000@gmail.com> Add serialization support for ClassScopeFunctionSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137799 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
af1fc7af351758b0ea0d285bdfe5640128109a4e 15-Aug-2011 Richard Smith <richard-llvm@metafoo.co.uk> Track in the AST whether a function is constexpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137653 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
ype.cpp
0d95f0d7b81110f77e99e833f766d19be7b7e072 14-Aug-2011 Francois Pichet <pichet2000@gmail.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137585 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
af0f4d0b2e38c810effc8b024ad2fb6604eec5d3 14-Aug-2011 Francois Pichet <pichet2000@gmail.com> Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.

Example:
template <class T>
class A {
public:
template <class U> void f(U p) { }
template <> void f(int p) { } // <== class scope specialization
};

This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137573 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
3a02b44e3948f7762dbfba94b7961281ca29d022 12-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> metadata generated by the compiler does not include the weak
attribute of a property. patch by Remy Demarest fixes it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137509 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
772eeaefef2c883aabe35caf4543e7e32d290183 12-Aug-2011 Douglas Gregor <dgregor@apple.com> Switch the __int128_t and __uint128_t types over to predefined types
in the AST format, which are built lazily by the ASTContext when
requested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137437 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7a27ea52b7bd635c89bec5a9c521a3bf7d204238 12-Aug-2011 Douglas Gregor <dgregor@apple.com> Switch the Objective-C 'SEL' type over to a predefined type in the
AST file format, lazily generating the actual declaration in
ASTContext as needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137434 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
79d6726921897811232554ed94c5d77b5b7b3fc0 12-Aug-2011 Douglas Gregor <dgregor@apple.com> Switch the Objective-C 'Class' type over to a predefined type in the
AST file format, lazily generating the actual declaration in
ASTContext as needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137431 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4dfd02a17c6d604c72e6936527c5e1c56d3ecb7a 12-Aug-2011 Douglas Gregor <dgregor@apple.com> Move the creation of the predefined typedef for Objective-C's 'id'
type over into the AST context, then make that declaration a
predefined declaration in the AST format. This ensures that different
AST files will at least agree on the (global) declaration ID for 'id',
and eliminates one of the "special" types in the AST file format.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137429 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
01a4cf11777bb34c35f5d251a9e95eb736d0842b 11-Aug-2011 Douglas Gregor <dgregor@apple.com> Encapsulate the Objective-C id/Class/SEL "redefinition" types in
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137349 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0aeb2890389ec1872e49a18fb2022bfb9f96578d 11-Aug-2011 Sean Callanan <scallanan@apple.com> Extended the AST importer to support ParenTypes.
This is necessary to support importing certain
function pointer types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137311 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
6b8bc0707f26aa6acfdd80a59b9a3850cafbe387 10-Aug-2011 Richard Smith <richard-llvm@metafoo.co.uk> Renamings to consistently use 'Constexpr' not 'ConstExpr' when referring to the C++0x 'constexpr' keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137230 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ype.cpp
0815b579b31cb3129f732bb7ea36fd6ba6949e98 09-Aug-2011 Douglas Gregor <dgregor@apple.com> Move the creation of the record type for the state of Objective-C fast
enumerations from the ASTContext into CodeGen, so that we don't need
to serialize it to AST files. This appears to be the last of the
low-hanging fruit for SpecialTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137124 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5c0d3d66bf06213009802876a14e6298efc1e0b0 09-Aug-2011 Douglas Gregor <dgregor@apple.com> Don't serialize the block descriptor or block extended descriptor
types to AST files; they're only used by debug info generation anyway,
and shouldn't ever exist in the AST anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137122 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
45c4ea75b235de94f44bf96843624e6a559e4c00 09-Aug-2011 Douglas Gregor <dgregor@apple.com> Move the construction of the RecordDecl representing the runtime
layout of a constant NSString from the ASTContext over to CodeGen,
since this is solely CodeGen's responsibility. Eliminates one of the
unnecessary "special" types that we serialize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137121 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b8fca90263760e579d2e463f02c846faa54d03a0 06-Aug-2011 Chad Rosier <mcrosier@apple.com> Add support for using anonymous bitfields (e.g., int : 0) to enforce alignment.
This fixes cases where the anonymous bitfield is followed by a bitfield member.
E.g.,
struct t4
{
char foo;
long : 0;
char bar : 1;
};

rdar://9859156



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136991 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d330e23f183cedb9e6c1cbb809407576f7bbab71 05-Aug-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed FieldDecl source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136963 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
dd7fddb5b6883326e52b278a9b7e9cefea29aae0 05-Aug-2011 Chad Rosier <mcrosier@apple.com> More whitespace and naming fixup. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136944 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
682b7f8506b70024d3ae88b53a07332bd2cca55e 04-Aug-2011 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136929 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0e7bf40027f75c0c62fb002af7eab0882de6d332 04-Aug-2011 Chad Rosier <mcrosier@apple.com> Fix style and remove obviously redundant code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136907 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
6e43f3f0e2fa7a4b50d2497de94a40437cd26003 04-Aug-2011 Chad Rosier <mcrosier@apple.com> Additional comments and whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136892 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4d9d157afb35742bc6348defbe45bc6de780ec77 04-Aug-2011 Kaelyn Uhrain <rikka@google.com> Match type names and give more info for out-of-line function definition errors.

Having a function declaration and definition with different types for a
parameter where the types have same (textual) name can occur when an unqualified
type name resolves to types in different namespaces in each location.

The error messages have been extended by adding notes that point to the first
parameter of the function definition that doesn't match the declaration, instead
of a generic "member declaration nearly matches". The generic message is still
used in cases where the mismatch is not in the paramenter list, such as
mismatched cv qualifiers on the member function itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136891 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
61a62216a0bb33fb668ab653d9f9a704e43d2fc6 04-Aug-2011 Chad Rosier <mcrosier@apple.com> Add partial support for using anonymous bitfields (e.g., int : 0) to enforce
alignment. This fixes cases where the anonymous bitfield is followed by a
non-bitfield member. E.g.,

struct t4
{
int foo : 1;
long : 0;
char bar;
};

Part of rdar://9859156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136858 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1b39dc8b1c7509aba7deaca3b7c4f8be931f53e2 30-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Not sure why we bother updating FunctionDecl's EndRangeLoc in FunctionDecl::setParams.
EndRangeLoc should always be set to at least the ending paren or brace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136573 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0bfe83b5a98ce37bf3a10274bca6f93ca4cb9696 30-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Annotation of parameters that got default args from a previous declarations was
broken because the end location of the parameter was the end location of the default arg,
resulting in a source range that could begin in one file and end in another.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136572 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1cf038c516c5e1f56ea9cff61aac7f7841744a91 30-Jul-2011 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter to cope with cases where we have already
imported a forward declaration, but later the full definition of the
same entity becomes available. When this happens, import the definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136537 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5cb3d699f0e37de1767eb23d26d03953a46cf1ff 28-Jul-2011 Richard Trieu <rtrieu@google.com> Add template instantiations to the output of -ast-dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136306 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
91873b72bf01b7170f80154f3118300ff2eacd34 27-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Make CodeGen for array delete involving incomplete class work without crashing. Should fix regression on g++.dg/init/delete1.C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136241 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0c8cd1ac55720276ad41fa7b4f8785bead5afd32 27-Jul-2011 Ted Kremenek <kremenek@apple.com> Change ASTContext::getSideTableAllocatedMemory() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136235 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
ype.cpp
18fd0c6915b45c4daafe18e3cd324c13306f913f 27-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] More automatic transformations and safety improvements; rdar://9615812 :

- Replace calling -zone with 'nil'. -zone is obsolete in ARC.
- Allow removing retain/release on a static global var.
- Fix assertion hit when scanning for name references outside a NSAutoreleasePool scope.
- Automatically add bridged casts for results of objc method calls and when calling CFRetain, for example:

NSString *s;
CFStringRef ref = [s string]; -> CFStringRef ref = (__bridge CFStringRef)([s string]);
ref = s.string; -> ref = (__bridge CFStringRef)(s.string);
ref = [NSString new]; -> ref = (__bridge_retained CFStringRef)([NSString new]);
ref = [s newString]; -> ref = (__bridge_retained CFStringRef)([s newString]);
ref = [[NSString alloc] init]; -> ref = (__bridge_retained CFStringRef)([[NSString alloc] init]);
ref = [[s string] retain]; -> ref = (__bridge_retained CFStringRef)([s string]);
ref = CFRetain(s); -> ref = (__bridge_retained CFTypeRef)(s);
ref = [s retain]; -> ref = (__bridge_retained CFStringRef)(s);

- Emit migrator error when trying to cast to CF type the result of autorelease/release:
for

CFStringRef f3() {
return (CFStringRef)[[[NSString alloc] init] autorelease];
}

emits:

t.m:12:10: error: [rewriter] it is not safe to cast to 'CFStringRef' the result of 'autorelease' message; a __bridge cast may result in a pointer to a destroyed object and a __bridge_retained may leak the object
return (CFStringRef)[[[NSString alloc] init] autorelease];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t.m:12:3: note: [rewriter] remove the cast and change return type of function to 'NSString *' to have the object automatically autoreleased
return (CFStringRef)[[[NSString alloc] init] autorelease];
^

- Before changing attributes to weak/unsafe_unretained, check if the backing ivar
is set to a +1 object, in which case use 'strong' instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136208 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
9f1210c3280104417a4ad30f0a00825ac8fa718a 26-Jul-2011 Chad Rosier <mcrosier@apple.com> After further discussion it has been determined that alignof should report
the preferred alignment. Thus, revert r135934, r135935, and r135940.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136062 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
822f54a7ba3eca643104623e8048be20a3391b19 25-Jul-2011 Chad Rosier <mcrosier@apple.com> Allow target to specify about using minimum alignment vs preferred. Takes care of
FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI.
Also part of rdar://9802874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135940 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
335608a778db3398aca12e3c855ecfa5ff11c5c9 24-Jul-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/AST/CMakeLists.txt: Update LLVM_USED_LIBS, not to miss symbols with building shared lib. Thanks to Ryuta Suzuki.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135864 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
XXInheritance.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
umpXML.cpp
xpr.cpp
xprConstant.cpp
xternalASTSource.cpp
nheritViz.cpp
taniumMangle.cpp
angle.cpp
icrosoftMangle.cpp
estedNameSpecifier.cpp
ecordLayoutBuilder.cpp
tmt.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
8cc4fd795e01d50a7a7c96f4c0356d23b00d9349 23-Jul-2011 Sean Callanan <scallanan@apple.com> This patch (thanks to Doug Gregor) fixes a
problem where Clang was setting the
hasExternalVisibleDecls() bit for all
DeclContexts it imported. This caused Clang
to make unnecessary calls to
findExternalVisibleDecls() when an external
AST source was installed.

In fact, Clang sometimes interpreted a failure
by one of these spurious calls to find a
Decl as meaning the Decl didn't exist, even
though findExternalLexicalDecls() did locate
that decl. This produced amusing errors of
the form:

-
error: no member named 'b' in 'A'; did you
mean 'b'?
-

Now, if hasExternalVisibleDecls() or
hasExternalLexicalDecls() should be set, the
external AST source must do so itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135824 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
da6d976b0f2470bb3f854913bc3af3245845ad60 22-Jul-2011 John McCall <rjmccall@apple.com> Move this ObjCImplementationDecl member function into libAST
where it belongs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135746 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
db8264e4c5ffd7af6fbad4ca4306bd382bb02691 22-Jul-2011 Jordy Rose <jediknil@belkadan.com> Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
This was previously not-const only because it has to lazily construct a chain
of ivars the first time it is called (and after the chain is invalidated).
In practice, all the clients were just const_casting their const Decls;
all those now-unnecessary const_casts have been removed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135741 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
9d102547dc44d064b40473a5a5166a8bb0dec99a 20-Jul-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r135574 (Jul 20th 2011)

Change-Id: Ib6cc2ba08a63e4cf8febc05fb6e3f2ca58f1d71d
673e775beba71a69dbab4fcd733a84f4cfe2ebfc 20-Jul-2011 Sean Callanan <scallanan@apple.com> This fix (thanks to Doug Gregor) corrects a bug
in ImportDefinition when replacing a previously
forward-declared CXXRecordDecl with its full
definition. The forward-declared type's
DefinitionData had not been intialized for the
forward-declared type, so adding fields to the
Decl caused CXXRecordDecl::addedMember() to
crash when accessing the DefinitionData.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135530 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5b106a872d66f57522b1cc6d1b67f93704409114 18-Jul-2011 Jeffrey Yasskin <jyasskin@google.com> Define DiagnosticBuilder<<APValue so it's easy to include APValues in
diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135398 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
f57ef0516c011237a1b6a5b2585b99caf0396bd7 18-Jul-2011 Nick Lewycky <nicholas@mxc.ca> Don't crash when codegen'ing an empty redecl of a function in C99 mode, when
neither was inline. Fixes bug introduced in r135377.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135380 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
dce67a70a86db8758c926a76fdd980f5369d5746 18-Jul-2011 Nick Lewycky <nicholas@mxc.ca> In C99, emit an inline function when encountering an extern redeclaration.
Fixes PR10233!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135377 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
174cba922331b896949d02d8b1a05f1998ed98e1 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135344 at Sat. 16th July 2011.
ba6ffaf21e465c0926d7fc5fa294ea52f8d45faf 15-Jul-2011 Douglas Gregor <dgregor@apple.com> Augment the interface of ExternalASTSource::FindExternalLexicalDecls()
to allow clients to specify that they've already (correctly) loaded
declarations, and that no further action is needed.

Also, make sure that we clear the "has external lexical declarations"
bit before calling FindExternalLexicalDecls(), to avoid infinite
recursion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135306 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
xternalASTSource.cpp
3e1ef7849845a9e7bf79156bbb8a2c26d77a1d2e 15-Jul-2011 Jeffrey Yasskin <jyasskin@google.com> Use the new APFloat::convertToInt(APSInt) function to simplify uses of
convertToInt(integerParts*) and make them more reliable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135279 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
91a5755ad73c5dc1dfb167e448fdd74e75a6df56 15-Jul-2011 John McCall <rjmccall@apple.com> Create a new expression node, SubstNonTypeTemplateParmExpr,
to represent a fully-substituted non-type template parameter.
This should improve source fidelity, as well as being generically
useful for diagnostics and such.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135243 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
b10aa3e3a26f84d1a0dda6e4c057f83a11a3076c 15-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Switch comments and assert text in AST from 'instantiation' to
'expansion'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135224 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
42068e9d420889014ee26894e421fead336b239d 13-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Silliness with commas, as reported at http://blog.regehr.org/archives/558 . As it turns out, this is my fault for not noticing this was an issue when I was looking at this a long time ago. :(



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135026 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9f8ee2ea0a62551ad5488669cf69308e7b48a9dd 13-Jul-2011 Richard Smith <richard-llvm@metafoo.co.uk> Correctly set up the list of virtual base classes for a CXXRecordDecl. Previously we got the source range wrong for everything in the virtual bases list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135011 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
82378391dfc3b2fc22f63dbf1552bd9aed39dc42 13-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> revert fix for // rdar://9740328


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135010 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c286f3835eb6001c61664cef5d610dfaf80a6e9b 13-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc++: Some level of covariance is allowed in ObjC properties.
Make it also available in ObjC++ propeties. // rdar://9740328


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135001 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f96e904783dc28b2b3fa4dcbb6dbdb40ca26aa8d 12-Jul-2011 Douglas Gregor <dgregor@apple.com> In ARC mode, consider Objective-C lifetime types (object pointers and
block pointers) that don't have any qualification to be POD types. We
were previously considering them to be non-POD types, because this was
convenient in C++ for is_pod-like traits. However, we now end up
inferring lifetime in such cases (template arguments infer __strong),
so it is not necessary.

Moreover, we want rvalues of object type (which have their lifetime
stripped) to be PODs to allow, e.g., va_arg(arglist, id) to function
properly. Fixes <rdar://problem/9758798>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134993 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f1588660c109610e6a79c786b83b7c9bbd6ed31e 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Improve name mangling for instantiation-dependent types that are not
dependent. This covers an odd class of types such as

int (&)[sizeof(sizeof(T() + T()))];

which involve template parameters but, because of some trick typically
involving a form of expression that is never type-dependent, resolve
down to a non-dependent type. Such types need to be mangled
essentially as they were written in the source code (involving
template parameters), rather than via their canonical type.

In general, instantiation-dependent types should be mangled as
they were written in the source. However, since we can't do that now
without non-trivial refactoring of the AST (see the new FIXME), I've
gone for this partial solution: only use the as-written-in-the-source
mangling for these strange types that are instantiation-dependent but
not dependent. This provides better compatibility with previous
incarnations of Clang and with GCC. In the future, we'd like to get
this right.

Fixes <rdar://problem/9663282>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134984 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
ype.cpp
91832368ef1c1158c4351bdccaa141dac818f04e 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Implement name mangling for sizeof...(function parameter pack).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134974 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
6af9f3ca25157379efd5c1caad82e9d01c17b9ff 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Fix the desugaring of dependent decltype and typeof(expr) nodes. The
isSugared() and desugar() routines previously provided were never
actually called, since the corresponding types
(DependentTypeOfExprType, DependentDecltypeType) don't have
corresponding type classes. Outside of the current (incomplete) patch
I'm working on, I haven't found a way to trigger this problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134973 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1961791626ab0ebbd8bf901a37476d527def4edb 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Mangle dependent template names of unknown arity

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134967 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
edee94b615059ad178b06a489312eca6e049609a 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Implement the Itanium C++ ABI's mangling rule for
non-instantiation-dependent sizeof and alignof expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134963 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
79e6bd379773447a74cc3e579d9081e4c5cb6d63 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Centralize the getCanonicalType() calls in the Itanium C++ mangling
code so that they only occur in a single place. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134961 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
5e78cd43a033b3dedf741fca4fa1652f9cb3e41c 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Allow us to compute linkage et al for instantiation-dependent types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134932 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0673cb30340aadaede7b795c763b00f6b64e611c 11-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Apply patch from Richard Trieu to fix PR9548:

When two different types has the same text representation in the same
diagnostic message, print an a.k.a. after the type if the a.k.a. gives extra
information about the type.

class versa_string;

typedef versa_string string;

namespace std {template <typename T> class vector;}

using std::vector;

void f(vector<string> v);

namespace std {
class basic_string;
typedef basic_string string;
template <typename T> class vector {};
void g() {
vector<string> v;
f(v);
}
}

Old message:
----------------
test.cc:15:3: error: no matching function for call to 'f'
f(&v);
^
test.cc:7:6: note: candidate function not viable: no known conversion from
'vector<string>' to 'vector<string>' for 1st argument
void f(vector<string> v);
^
1 error generated.

New message:
---------------
test.cc:15:3: error: no matching function for call to 'f'
f(v);
^
test.cc:7:6: note: candidate function not viable: no known conversion from
'vector<string>' (aka 'std::vector<std::basic_string>') to
'vector<string>' (aka 'std::vector<versa_string>') for 1st argument
void f(vector<string> v);
^
1 error generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134904 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
032c86921177031ecbb46c398b3e710758ba915e 08-Jul-2011 Douglas Gregor <dgregor@apple.com> Teach CXXUnresolvedConstructExpr when it should be an
lvalue/xvalue/rvalue, rather than just (incorrectly) assuming it's an
lvalue. Fixes PR10285 / <rdar://problem/9743926>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134700 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
dbd3c85825ad59896292ac7d326fe1985768f1e3 07-Jul-2011 Cameron Zwarich <zwarich@apple.com> r134634 causes a failure on MultiSource/Benchmarks/Olden/bh with TEST=nightly,
so roll it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
2357aeec0da2740838963880edd97e43f14cb6fd 07-Jul-2011 Nick Lewycky <nicholas@mxc.ca> A redeclaration of an inline method in C99 mode should trigger emission of that
function. Fixes PR10233!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
7e5e5f4cc36fe50f46ad76dca7a266434c94f475 07-Jul-2011 John McCall <rjmccall@apple.com> In ARC, reclaim all return values of retainable type, not just those
where we have an immediate need of a retained value.

As an exception, don't do this when the call is made as the immediate
operand of a __bridge retain. This is more in the way of a workaround
than an actual guarantee, so it's acceptable to be brittle here.

rdar://problem/9504800



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134605 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmt.cpp
82905749d5c8d8b4edec11de754a73349cb96603 07-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Zap a couple unnecessary loops.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134578 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
9670e179a67d868e171feac44fb8f9e2f108c5e8 06-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc-arc: enforce performSelector rules in rejecting retaining selectors
passed to it, and unknown selectors causing potential leak.
// rdar://9659270


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134449 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
bc57f3cfada779521b579ba184d70e0a6f98d62f 05-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Don't overread the buffer when an %x escape in inline asm ends prematurely.

Tested by valgrind & Sema/asm.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134404 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
b43c8ec359293df0c1fc250201930f4461c835f8 04-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Switch the Decl and Stmt stats printing to use llvm::errs() instead of
fprintf, and to be more consistent in formatting with the other stats
printing routines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134374 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
tmt.cpp
cd92a65edc7cbbbb7e3aee8d31008594de90fa51 04-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Start switching the AST stats printing to use llvm::errs() instead of
fprintf. There is more cleanup to be done to the AST stats printing...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134373 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
973c4fc0b0a88f9cea273b16f2082788a6e57d74 02-Jul-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Rewritten fix in r134139 to conform evaluation result to original evaluation context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134320 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3c54415a4e1db09b210a466469c72d2582ce1d83 02-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r134305 at Sat. 2nd July 2011.
28445f0b62f6aed851ff87ce64d9b19200d3211f 02-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Fix mistake in ASTContext::getInnerObjCOwnership noticed by Doug
-Remove unnecessary 'return'.
-Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null)
-Add a test of transferring ownership to a reference cast type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134285 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
31862ba5ea70b1f2c81d03f8a0100b61cd6f06f6 02-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [ARC] When casting from a pointer to an objective-c object with known ownership, if the
cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type
to the cast type:

id x;
static_cast<NSString**>(&x); // Casting as (__strong NSString**).

This currently only works for C++ named casts, C casts to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134273 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
35ee32e800145a535f2676898f8f06f7ae6e9b43 01-Jul-2011 John McCall <rjmccall@apple.com> Just mangle substituted template parameter types as unresolved types.
This is kindof questionable but seems to do more-or-less the right thing.
This is not a particularly friendly part of the ABI.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134227 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
561f81243f665cf2001caadc45df505f826b72d6 01-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce the notion of instantiation dependence into Clang's AST. A
type/expression/template argument/etc. is instantiation-dependent if
it somehow involves a template parameter, even if it doesn't meet the
requirements for the more common kinds of dependence (dependent type,
type-dependent expression, value-dependent expression).

When we see an instantiation-dependent type, we know we always need to
perform substitution into that instantiation-dependent type. This
keeps us from short-circuiting evaluation in places where we
shouldn't, and lets us properly implement C++0x [temp.type]p2.

In theory, this would also allow us to properly mangle
instantiation-dependent-but-not-dependent decltype types per the
Itanium C++ ABI, but we aren't quite there because we still mangle
based on the canonical type in cases like, e.g.,

template<unsigned> struct A { };
template<typename T>
void f(A<sizeof(sizeof(decltype(T() + T())))>) { }
template void f<int>(A<sizeof(sizeof(int))>);

and therefore get the wrong answer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134225 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
estedNameSpecifier.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
68a51a7f9c01ccbe7232d41beeb4deb26f40b013 01-Jul-2011 John McCall <rjmccall@apple.com> Change the mangling of enclosing template template parameters
that serve as the base template name of an unresolved-name to
be mangled as a substitution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134213 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
b44e0cf937baf99578b2a5bdf5066c730247d424 30-Jun-2011 John McCall <rjmccall@apple.com> No, actually, we do need to be able to mangle substituted template names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134195 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
935a70c1e76d78985f20d422940280161b941299 30-Jun-2011 Hans Wennborg <hans@hanshq.net> Fix off-by-one error in StringLiteral::getLocationOfByte.

This fixes PR10223.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134183 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bfbdcd861a4364bfc21a9e5047bdbd56812d6693 30-Jun-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed enum constant evaluation assertions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134139 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
146060435c3efce95c95a092c7a1eb651cfb9ae0 30-Jun-2011 John McCall <rjmccall@apple.com> Preserve that a TemplateName was arrived at by substituting
for a template template parameter.

Uses to follow.

I've also made the uniquing of SubstTemplateTemplateParmPacks
use a ContextualFoldingSet as a minor space efficiency.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
emplateName.cpp
ype.cpp
1901dce8b1e78d0bf7072cccab695bd58c7eec21 30-Jun-2011 John McCall <rjmccall@apple.com> Document and check tighter assumptions about the TemplateName of a
TemplateSpecializationType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134120 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bf9eb88792e022e54a658657bf22e1925948e384 28-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Eliminate most uses of ShallowCollectObjCIvars which requires
a vector for collection. Use iterators where needed instead.
// rdar://6817577


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134015 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
d3d49bb27c7ffd9accc0a6c00e887111c0348845 28-Jun-2011 John McCall <rjmccall@apple.com> Be more thorough about mangling unresolved types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134011 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
0c051221bd06fe1b24b9459292584e5264a131c5 28-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Merge some calls to FoldingSetNodeID::AddInteger; assuming my measurements aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133968 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6ce51ee94bd300c5f30930d96436fd53e4ea89a7 28-Jun-2011 John McCall <rjmccall@apple.com> Don't factor in visibility for templates and template arguments
for explicit specializations with their own explicit visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133958 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b8b0313e84700b5c6d597b3be4de41c97b7550f1 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about 'ownership', not 'lifetime'.

rdar://9477613.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133779 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
7b3f853c6f684c1df423e994482681844c396342 23-Jun-2011 John McCall <rjmccall@apple.com> Apparently at some point in the past I forgot how 'continue'
works in a 'while(false)' loop. Simplify this code; it was
complicated only in anticipation of C++0x lambdas, and it can
become complicated again when those happen. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133761 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8cf0f52037e0c4bf656953ae63a07e8156aeb5fb 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Move definition of template <typename T> void Decl::dropAttr
to its header to avoid an explicit instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133753 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
d6bf0effa9cd397b7466628c17b5f4f8dc362780 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Minor tweak to my last patch per Doug's comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133731 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c3ca14d13741889a9b924d0ca32e818f07a9834a 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Remove multiple use of weak_import attribute on
same declaration. Templatize dropAttr for general use.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133724 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3e66003c1f03bf734efbd0f8eea35784a2d78d66 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133721, Fri. 24th Jun.
8785d115ebaf1a850f5e581e4acd2dbfb2b843cb 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Remove weak_import attribute on new declaration.
// rdar://9538608


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133721 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
7062281f240ef9c4fb343614fb2406532307c4a5 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133678 at Thu. 23th Jun 2011.
0d9106fc97cde979a995e26b18bcd2643f8afb55 22-Jun-2011 Manuel Klimek <klimek@google.com> Changes ParenListExpr to always require a type.
Removes dead code found in the process.
Adds a test to verify that ParenListExprs do not have NULL types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133637 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0894976ba1384a34357e333846adedc6a42334fd 22-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a missing space noticed by matthewbg in code review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133577 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
26a6ec7be5ad57aa380f62aa2c39cd073e22d9dc 22-Jun-2011 John McCall <rjmccall@apple.com> Fix the mangling of dependent-scope decl ref expressions so that they
use the unresolved-name production correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133554 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
0b5810882bd34183c2b764676cafa4c2ce324740 21-Jun-2011 Douglas Gregor <dgregor@apple.com> A few tweaks to MaterializeTemporaryExpr suggested by John.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133528 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprClassification.cpp
14d251cd62942bf7d56bb87a267ba2ca2f7fae3e 21-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a crash when a pointer-to-member function is called in the condition
expression of '?:'. Add a test case for this pattern, and also test the
code that led to the crash in a "working" case as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133523 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
03e80030515c800d1ab44125b9052dfffd1bd04c 21-Jun-2011 Douglas Gregor <dgregor@apple.com> Introduce a new AST node describing reference binding to temporaries.

MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given

const int& r = 1.0;

The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value.

IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133521 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
65aa6885818d4b4eea2e5a9d12085b2398148662 21-Jun-2011 Jay Foad <jay.foad@gmail.com> Make more use of llvm::StringRef in various APIs. In particular, don't
use the deprecated forms of llvm::StringMap::GetOrCreateValue().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133515 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bc8d7f9fd4346cfcc285868be32b74e019a40f01 20-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Restructure the API in Type based on a conversation with Richard Smith.
This makes 'isPointerLikeType' a little less confusing, and pulls the
decay check into a separate interface that is much more clear and
concrete. Also, just implement these as logical wrappers around other
predicates. Having a switch based implementation isn't likely to be
necessary. We can try to optimize them later if they show up on
a profile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133405 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2af68e4761ed30181540dafb5572993daffa4910 19-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Add test cases for false positives on -Wnull-arithmetic from Richard
Trieu, and fix them by checking for array and function types as well as
pointer types.

I've added a predicate method on Type to bundle together the logic we're
using here: isPointerLikeType(). I'd welcome better names for this
predicate, this is the best I came up with. It's implemented as a switch
to be a touch lighter weight than all the chained isa<...> casts that
would result otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133383 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
829f20097e030229fd4c234b84948f53312eaf55 18-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix regression with @encode string. rdar://9624314.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133312 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c22d699d3aa1d7fbd32c4e35cf75abdca94bb5ef 18-Jun-2011 Douglas Gregor <dgregor@apple.com> Objective-C++ ARC: do not mangle __unsafe_unretained lifetime
qualifiers, so that an __unsafe_unretained-qualified type T in ARC code
will have the same mangling as T in non-ARC code, improving ABI
interoperability. This works now because we infer or require a
lifetime qualifier everywhere one can appear in an external
interface. Another part of <rdar://problem/9595486>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133306 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
e559ca1672ecef59345a928af0a6809b09282d2c 18-Jun-2011 Douglas Gregor <dgregor@apple.com> Objective-ARC++: infer template type arguments of
ownership-unqualified retainable object type as __strong. This allows
us to write, e.g.,

std::vector<id>

and we'll infer that the vector's element types have __strong
ownership semantics, which is far nicer than requiring:

std::vector<__strong id>

Note that we allow one to override the ownership qualifier of a
substituted template type parameter, e.g., given

template<typename T>
struct X {
typedef __weak T type;
};

X<id> is treated the same as X<__strong id>. At instantiation type,
the __weak in "__weak T" overrides the (inferred or specified)
__strong on the template argument type, so that we can still provide
metaprogramming transformations.

This is part of <rdar://problem/9595486>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133303 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
7acddacc921cd0b3f813443a8641eeddb82dfbd4 17-Jun-2011 John McCall <rjmccall@apple.com> Objective-C fast enumeration loop variables are not retained in ARC, but
they should still be officially __strong for the purposes of errors,
block capture, etc. Make a new bit on variables, isARCPseudoStrong(),
and set this for 'self' and these enumeration-loop variables. Change
the code that was looking for the old patterns to look for this bit,
and change IR generation to find this bit and treat the resulting
variable as __unsafe_unretained for the purposes of init/destroy in
the two places it can come up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133243 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c7c9058f4977ef4584d68718e23f34504b150ef4 16-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Move computation of __private_extern__ visibilty to
getLVForNamespaceScopeDecl(). // rdar://9609649


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133182 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
16c8f9d68ae6d302083763d4733e728634717dec 16-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133163 at Fri. 17th Jun 2011.
b11382497a923b0d7009e85a1d8eb7bf93ec6d0d 16-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Make the Stmt::Profile method const, and the StmtProfile visitor
a ConstStmtVisitor. This also required adding some const iteration
support for designated initializers and making some of the getters on
the designators const.

It also made the formatting of StmtProfile.cpp rather awkward. I'm happy
to adjust any of the formatting if folks have suggestions. I've at least
fitted it all within 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133152 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtProfile.cpp
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
arentMap.cpp
tmtPrinter.cpp
tmtProfile.cpp
ype.cpp
ypePrinter.cpp
204e13395d83524e9a557c3f3fd6df2e2f353b9d 16-Jun-2011 John McCall <rjmccall@apple.com> Introduce a utility routine for checking whether a block's captures
include a specific variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133102 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4ac01401b1ec602a1f58c217544d3dcb5fcbd7f1 15-Jun-2011 Douglas Gregor <dgregor@apple.com> Eliminate a 'default' case in template argument deduction, where we
were just punting on template argument deduction for a number of type
nodes. Most of them, obviously, didn't matter.

As a consequence of this, make extended vector types (via the
ext_vector_type attribute) actually work properly for several
important cases:
- If the attribute appears in a type-id (i.e, not attached to a
typedef), actually build a proper vector type
- Build ExtVectorType whenever the size is constant; previously, we
were building DependentSizedExtVectorType when the size was constant
but the type was dependent, which makes no sense at all.
- Teach template argument deduction to handle
ExtVectorType/DependentSizedExtVectorType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133060 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1abd35950bcb0761887dca0995c68b8a9dc8916f 14-Jun-2011 Douglas Gregor <dgregor@apple.com> When profiling FunctionProtoTypes, don't canonicalize the expression
in a noexcept exception specification because it isn't part of the
canonical type. This ensures that we keep the exact expression written
in the noexcept exception specification, rather than accidentally
"adopting" a previously-written and canonically "equivalent" function
prototype. Fixes PR10087.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132998 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f33b1e8ad7daec1f382a28e9565744cd7f795384 11-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Added 'atomic' for objc properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132879 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
7a614d8380297fcd2bc23986241905d97222948c 11-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++11 in-class initialization of non-static data members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
xpr.cpp
angle.cpp
926df6cfabf3eaa4afc990c097fa4619b76a9b57 11-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement Objective-C Related Result Type semantics.

Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
umpXML.cpp
cb5d2d0647fdab2e36c85b417e03bf18916ce10c 10-Jun-2011 Eli Friedman <eli.friedman@gmail.com> PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.

While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132861 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e5df885367b9e122ac11c89ddfbc62375695cdab 10-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132843 at Fri. 10th Jun 2011.
8805fe800e30d6597d8c900f590b74567873be78 09-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Don't add objc method name mangling to locally declared function.
// rdar://9566314


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132791 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
2f072b442879b8bba8c5dea11d7c61bedb1924ae 09-Jun-2011 Hans Wennborg <hans@hanshq.net> Handle overloaded operators in ?: precedence warning

This is a follow-up to r132565, and should address the rest of PR9969:

Warn about cases such as

int foo(A a, bool b) {
return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}

also when + is an overloaded operator call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132784 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
63f62df485de57c6b0db167d96bb0f92562adb7b 05-Jun-2011 Douglas Gregor <dgregor@apple.com> Add name mangling for expr .* expr. Fixes PR9983 / <rdar://problem/9486332>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132659 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
61eee0ca33b29e102f11bab77c8b74cc00e2392b 04-Jun-2011 Tanya Lattner <tonic@nondot.org> Add support for builtin astype:
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types.
Added test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132612 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
c7f532f9b8e934a0a284d15a739333372e979f61 03-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132540 at Fri. 3rd Jun 2011.
fb3f4aad0436a9c40e9130598162150890c405b5 02-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Implement -fgnu89-inline. Fixes PR10041.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132460 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
43c9791207a2bd7cef8b17e9bfc4dd87db21690f 28-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream r132249 at Sat. 28th. May 2011.
f968d8374791c37bc464efd9168c2d33dd73605f 27-May-2011 Douglas Gregor <dgregor@apple.com> Objective-C doesn't consider the use of incomplete types as method
parameter types to be ill-formed. However, it relies on the
completeness of method parameter types when producing metadata, e.g.,
for a protocol, leading IR generating to crash in such cases.

Since there's no real way to tighten down the semantics of Objective-C
here without breaking existing code, do something safe but lame:
suppress the generation of metadata when this happens.

Fixes <rdar://problem/9123036>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132171 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ffe37fdda5b4b4f162a45155c30d9f60ce110c12 25-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a little bit of cleanup and a lot more of the base work
behind implicit moves. We now correctly identify move constructors and
assignment operators and update bits on the record correctly. Generation
of implicit moves (declarations or definitions) is not yet supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132080 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
69d9775da47a4b9f165dbc33277f02982928a94e 25-May-2011 Douglas Gregor <dgregor@apple.com> Properly align UnaryTransformType when allocating it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132064 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
319b4a609156faabf0bb86e368026afcd30893ee 25-May-2011 Francois Pichet <pichet2000@gmail.com> Fix MSVC warning: <unsafe use of type 'bool' in operation>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132058 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
ca63c200346c0ca9e00194ec6e34a5a7b0ed9321 25-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a new type node, UnaryTransformType, designed to represent a
type that turns one type into another. This is used as the basis to
implement __underlying_type properly - with TypeSourceInfo and proper
behavior in the face of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132017 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypePrinter.cpp
63fe6814f339df30b8463b39995947cbdf920e48 24-May-2011 Douglas Gregor <dgregor@apple.com> Implement the initial part of C++0x [expr.const]p2, which specifies
that the unevaluated subexpressions of &&, ||, and ? : are not
considered when determining whether the expression is a constant
expression. Also, turn the "used in its own initializer" warning into
a runtime-behavior warning, so that it doesn't fire when a variable is
used as part of an unevaluated subexpression of its own initializer.

Fixes PR9999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131968 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
848afb0c1ff4571ca7a21927ecc2699ea2e7429a 24-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131958 at Tue. 24th May 2011.
cd10dec673680fd18a2e5a27646173780c059d32 24-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131933 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9625e44c0252485277a340746ed8ac950686156f 22-May-2011 Douglas Gregor <dgregor@apple.com> It's considered poor form to create references to the overloaded
function type. Educate template argument deduction thusly, fixing
PR9974 / <rdar://problem/9479155>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131811 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b0844c6f07d8c9c6c9c3095201879593611b9e79 21-May-2011 Douglas Gregor <dgregor@apple.com> Classify bound member function types are member function types. Fixes
PR9973 / <rdar://problem/9479191>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131810 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
575a1c9dc8dc5b4977194993e289f9eda7295c39 20-May-2011 Douglas Gregor <dgregor@apple.com> Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.

Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131735 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
6ee6cf6a13e4047a78ce61951870c6605a7260f0 17-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131450 at Tue. 17th May 2011.
2636197098e02fd7c90f9496056b8ab886dcbff0 17-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Reapply the commits that r131401 reverted and add a fix for PR9927.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131446 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cf34e757b968f1fa7965cab1464212ade4d9f991 17-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement the new C++0x rules for non-trivial things in unions so that
my defaulted constructor tests stop yelling at me about them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131432 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4ea030403d509f5b320b8e1d7952447aba5c2f6c 16-May-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 131377, 131369 and 131365.
131365 caused PR9927.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131401 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5587803dfdb862d573289782f0c695872d9297a1 15-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> main() exists in hosted, not freestanding implementations. Fixes the
build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131390 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
23c608d6815f188cb0bd3444c9708383c6461036 15-May-2011 John McCall <rjmccall@apple.com> Add a method for checking whether a function is one of the reserved global
placement allocation or deallocation functions. These functions cannot be
replaced by the user and are exempt from the normal requirements on
allocation functions (e.g. that they must return unaliased memory).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bf832a4ed4ea36e1657bafd1012bd5eea87b46b0 15-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix MSVC build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131377 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0c6f8260f7428b81f14f65a0d75cb44bc1d3cd3f 15-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix generation of obj-c @encoding for members with zero size.
Also follow gcc in that arrays of elements with zero size are encoded as arrays with zero elements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131369 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ffb945ffb5d29b80fd93649c3572b6d87abce3fc 15-May-2011 Anders Carlsson <andersca@mac.com> When emitting the destructor for a class with a vtable, if we can determine
that the destructor body is trivial and that all member variables also have either
trivial destructors or trivial destructor bodies, we don't need to initialize the
vtable pointers since no virtual member functions will be called on the destructor.

Fixes PR9181.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131368 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
02c5116db6a40e806534c416e0abb22b8840831e 14-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Create proper Objective-C @encoding for C++ classes; fixes rdar://9357400.

Go through and expand the members of bases into the encoding string (and encode the VTable as well).
Unlike gcc which expands virtual bases as many times as they appear in the
hierarchy, clang will only expand them once at the end, to reflect the actual layout.

Note that there doesn't seem to be a way to indicate in the encoding that
packing/alignment of members is different that normal, in which case
the encoding will be out-of-sync with the real layout.
If the runtime switches to just consider the size of types without
taking into account alignment, we could easily make padding explicit in the
encoding (e.g. using arrays of chars). The encoding strings would be
longer then though.

Also encode a flexible array member as array of 0 size, like gcc, not as a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131365 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d01d2b2de449d68e6c44d99a12c0c1fc53222113 14-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131335 at Sat. 14th May 2011.
cbea7635a9a33fe768ed9611b57beae23bd7c98e 13-May-2011 Joerg Sonnenberger <joerg@bec.de> Include assembler label for functions in the XML dump


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131310 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
8cad3046be06ea73ff8892d947697a21d7a440d3 13-May-2011 Peter Collingbourne <peter@pcc.me.uk> Refactoring of constant expression evaluator

This introduces a generic base class for the expression evaluator
classes, which handles a few common expression types which were
previously handled separately in each class. Also, the expression
evaluator now uses ConstStmtVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131281 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
2bb110125e0e5adb7c1c65d12adfa34151ca1c47 13-May-2011 Douglas Gregor <dgregor@apple.com> When determining whether we can make a declaration into a global
constant, also consider whether it's a class type that has any mutable
fields. If so, it can't be a global constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131276 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
feb375d31b7e9108b04a9f55b721d5e0c793a558 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement the __is_trivially_copyable type trait

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131270 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ype.cpp
ebc93e176dad36fa8a28dd3a36c5b3dc7630d87d 12-May-2011 Eli Friedman <eli.friedman@gmail.com> PR9899: handle pseudo-destructors correctly in noexcept() expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131220 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cdee3fee8ca4df7fb9179f29cc3ba96ac4fd0f95 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement implicit deletion of default constructors.

Yes, I'm aware that the diagnostics are awful.

Tests to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131203 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6ec50ad4b12cbb6ca12036080808f912d5ee2515 11-May-2011 Fariborz Jahanian <fjahanian@apple.com> Implenment #pack pragma and ms_struct attribute layout.
Concludes // radar://8823265.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131188 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
be57cf41fb55b48e3f889787960b3ac2eb5e4dbd 11-May-2011 Eli Friedman <eli.friedman@gmail.com> PR9882: Fix noexcept to deal with dependent new, delete, calls, and
dynamic_cast correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131177 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ed63e03e35f2c8ad1a06d7bbc2249d132a730175 10-May-2011 Fariborz Jahanian <fjahanian@apple.com> Support pack pragma and ms_struct attributes. // rdar://8823265



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131142 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
30364d0a6450315989f6613910b09f865044a2a0 10-May-2011 Fariborz Jahanian <fjahanian@apple.com> 'long long' requires special treatment in ms_struct
structs (impacts 32-bit only though).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131103 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
37b8c9ee7cf2b4d5ce3ccd3be1fcadd18a783a57 09-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Clean up trivial default constructors now.

hasTrivialDefaultConstructor() really really means it now.

Also implement a fun standards bug regarding aggregates. Doug, if you'd
like, I can un-implement that bug if you think it is truly a defect.

The bug is that non-special-member constructors are never considered
user-provided, so the following is an aggregate:

struct foo {
foo(int);
};

It's kind of bad, but the solution isn't obvious - should

struct foo {
foo (int) = delete;
};

be an aggregate or not?

Lastly, add a missing initialization to FunctionDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131101 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
023df37c27ee8035664fb62f206ca58f4e2a169d 09-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" and
modify the semantics slightly to accomodate default constructors (I
hope).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131087 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
tmtPrinter.cpp
ype.cpp
5cb0ef4aed9a4a1741260e16a99d18682335ab9b 07-May-2011 Douglas Gregor <dgregor@apple.com> Implement a minor optimization by not introducing declarations into
DeclContext's lookup table when they aren't in any identifier namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131037 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
31e7f225fa3c603b84d66bc8ebdf7ed084e36e62 07-May-2011 Fariborz Jahanian <fjahanian@apple.com> In ms_struct structs, Establish a new alignment for a
non-bitfield following a bitfield if size of their types differ.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131032 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
52bbe7a1133c3cb57e9246f1b96c12940ea3821a 06-May-2011 Fariborz Jahanian <fjahanian@apple.com> Establish a new alignment for an ms_struct bitfield following
a non-bitfield if size of their types differ.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131023 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
10620eb5164e31208fcbf0437cd79ae535ed0559 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Modify some deleted function methods to better reflect reality:

- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)

This fixes the bug that we weren't catching

void foo() = delete;
void foo() {}

as being a redefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131013 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclPrinter.cpp
umpXML.cpp
5f802e51406664ca9b6e0d57fc7ce37ea97a1c65 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert r130912 in order to approach defaulted functions from the other
direction and not introduce things in the wrong place three different
times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130968 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
3e4c6c4c79a03f5cb0c4671d7c282d623c6dc35e 05-May-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++0x alias templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130953 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
eclBase.cpp
eclTemplate.cpp
umpXML.cpp
ype.cpp
78a7d7d79964119a3f35b262eb154b5cbf1001ed 05-May-2011 Fariborz Jahanian <fjahanian@apple.com> __alignof attribute on the field must consider
packed attribute on the field. //rdar://9217290


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130948 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b6adf2c889bb17c1be44e6c8e67e3b2762e9cecc 05-May-2011 Douglas Gregor <dgregor@apple.com> Scoped enumerations should not be treated as integer types (in the C
sense). Fixes <rdar://problem/9366066> by eliminating an inconsistency
between C++ overloading (which handled scoped enumerations correctly)
and C binary operator type-checking (which didn't).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130924 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ad7ec12ef2edbadb85a3754f0395ef2f06d4256c 05-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement some framework for defaulted constructors.

There's some unused stuff for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130912 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
9b3acaa32548d0ce78b9c39a3911397f6738a47c 04-May-2011 Fariborz Jahanian <fjahanian@apple.com> More ms_struct bitfield stuff:
Adjacent bit fields are packed into the same 1-, 2-, or
4-byte allocation unit if the integral types are the same
size. // rdar://8823265.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130851 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
69d891d45a29fdd0074ff3eb158694e95fef57e1 04-May-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev:
Like in r126648, provide (empty) default implementation for pure virtual getMemoryBufferSizes(). Not all use cases have meaningful implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130838 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.cpp
4f4e413f282609d4a488b44fc8669c28636a7aba 04-May-2011 John McCall <rjmccall@apple.com> Type prefixes of unresolved-names should only be mangled as unresolved-types
if they match that production, i.e. if they're template type parameters
or decltypes (or, as an obvious case not yet described in the ABI document,
if they're template template parameters applied to template arguments).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130824 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
cc0f9f1a3b5df7fd308ff3d800fbbbbff805157d 04-May-2011 Fariborz Jahanian <fjahanian@apple.com> Only the first zero-length bitfield decides alignment of
the followup data member in an ms_struct struct.
// rdar:// 8823265



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130795 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
855a8e79f42e670b405b31efd3963f4d89732aff 03-May-2011 Fariborz Jahanian <fjahanian@apple.com> Finish off rules for z-length bitfields in ms_struct
structs. // rdar://8823265


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130783 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ecordLayoutBuilder.cpp
340fa242130c2d8d74c83edca0952e771aebe0e6 02-May-2011 Fariborz Jahanian <fjahanian@apple.com> More rule enforcement of zero bitfields for ms_struct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130696 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
ecordLayoutBuilder.cpp
7f00f842aaf628c1b02c471a233184024511fedd 02-May-2011 Chandler Carruth <chandlerc@gmail.com> I updated this constructor's interface, and didn't have to fix any
callers. Shockingly enough, *there are none*!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130677 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7548beb2fcddcecedc2c7702a139a739eba79b93 02-May-2011 Nick Lewycky <nicholas@mxc.ca> Remove dead variable caught by GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130676 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
5ebd9fea8b4b998ec75eb2bf59644e86205bc9aa 02-May-2011 Chandler Carruth <chandlerc@gmail.com> Nuke stale code for separately importing the qualifer -- it's just part
of the QualifierLoc, and that's all we need to import now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130675 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
3aa8140bde5b9bedf13e46ec0a668daa54814196 02-May-2011 Chandler Carruth <chandlerc@gmail.com> Add an optional field attached to a DeclRefExpr which points back to the
Decl actually found via name lookup & overload resolution when that Decl
is different from the ValueDecl which is actually referenced by the
expression.

This can be used by AST consumers to correctly attribute references to
the spelling location of a using declaration, and otherwise gain insight
into the name resolution performed by Clang.

The public interface to DRE is kept as narrow as possible: we provide
a getFoundDecl() which always returns a NamedDecl, either the ValueDecl
referenced or the new, more precise NamedDecl if present. This way AST
clients can code against getFoundDecl without know when exactly the AST
has a split representation.

For an example of the data this provides consider:
% cat x.cc
namespace N1 {
struct S {};
void f(const S&);
}
void test(N1::S s) {
f(s);
using N1::f;
f(s);
}

% ./bin/clang -fsyntax-only -Xclang -ast-dump x.cc
[...]
void test(N1::S s) (CompoundStmt 0x5b02010 <x.cc:5:20, line:9:1>
(CallExpr 0x5b01df0 <line:6:3, col:6> 'void'
(ImplicitCastExpr 0x5b01dd8 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
(DeclRefExpr 0x5b01d80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)'))
(ImplicitCastExpr 0x5b01e20 <col:5> 'const struct N1::S' lvalue <NoOp>
(DeclRefExpr 0x5b01d58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S')))
(DeclStmt 0x5b01ee0 <line:7:3, col:14>
0x5b01e40 "UsingN1::;")
(CallExpr 0x5b01fc8 <line:8:3, col:6> 'void'
(ImplicitCastExpr 0x5b01fb0 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
(DeclRefExpr 0x5b01f80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)' (UsingShadow 0x5b01ea0 'f')))
(ImplicitCastExpr 0x5b01ff8 <col:5> 'const struct N1::S' lvalue <NoOp>
(DeclRefExpr 0x5b01f58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S'))))

Now we can tell that the second call is 'using' (no pun intended) the using
declaration, and *which* using declaration it sees. Without this, we can
mistake calls that go through using declarations for ADL calls, and have no way
to attribute names looked up with using declarations to the appropriate
UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130670 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
tmtDumper.cpp
fb44de956f27875def889482b5393475060392af 02-May-2011 John McCall <rjmccall@apple.com> Store a parameter index and function prototype depth in every
parameter node and use this to correctly mangle parameter
references in function template signatures.

A follow-up patch will improve the storage usage of these
fields; here I've just done the lazy thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130669 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
tmtProfile.cpp
6857c3e12c86fd0271eb46baab5b18756a94f4cb 02-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove the NameQualifier struct, which was just a wrapper around
NestedNameSpecifierLoc. It predates when we had such an object.

Reference the NNSLoc directly in DREs, and embed it directly into the
MemberNameQualifier struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130668 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7e740bd36772aae16b5cc5e605998ccc5eaf26db 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Several cosmetic changes, no functionality changed.

Mostly trailing whitespace so that me editor nuking it doesn't muddy the
waters of subsequent commits that do change functionality.

Also nukes a stray statement that was harmless but redundant that
I introduced in r130666.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130667 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cb66cff8fdf641f57f85dedb515a5f3240e3a9bb 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Move the state bits in DeclRefExpr out of the pointer union and into
a bitfield in the base class. DREs weren't using any bits here past the
normal Expr bits, so we have plenty of room. This makes the common case
of getting a Decl out of a DRE no longer need to do any masking etc.

Also, while here, clean up code to use the accessor methods rather than
directly poking these bits, and provide a nice comment for DREs that
includes the information previously attached to the bits going into the
pointer union.

No functionality changed here, but DREs should be a tad faster now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130666 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a280bc86b1b982c7ab7e0fc96f172967f27d1863 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove a few more bogus returns when the switch covers all the
enumerators.

Also remove a default that led to llvm_unreachable to make another
switch warn if any enumerators fail to be covered.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130646 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
e194710fcd012df67a2694477ef8ce5a19bf376c 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove another default and a *completely* bogus return from a switch
over type traits.

Add the missing trait from this switch that Clang's warning uncovered.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130645 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
98fa94d2564057555c4a12e8737b8371700cf6e4 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove the type traits UTT_IsLvalueExpr and UTT_IsRvalueExpr.

As might be surmised from their names, these aren't type traits, they're
expression traits. Amazingly enough, they're expression traits that we
have, and fully implement. These "type" traits are even parsed from the
same tokens as the expression traits. Luckily, the parser only tried the
expression trait parsing for these tokens, so this was all just a pile
of dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130643 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
f1e4fbf3112f33ec5b7bc5c57ec148445190d0a8 01-May-2011 John McCall <rjmccall@apple.com> Compress some bits. Only matters for MSVC, or if we ever
devirtualize Decl (because bits can't get laid out in base
classes if the base is POD).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130632 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b7efff4bae117604f442bb6859c844f90b15f3ff 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Switch the interface name for both TemplateTypeParmType and
SubstTemplateTypeParmType to be 'getIdentifier' instead of 'getName' as
it returns an identifier. This makes them more consistent with the
NamedDecl interface.

Also, switch back to using this interface to acquire the indentifier in
TypePrinter.cpp. I missed this in r130628.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130629 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
4fb86f8c4585e53c21c847ad3de9e3b2de123cd9 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Re-applies the patch first applied way back in r106099, with
accompanying fixes to make it work today.

The core of this patch is to provide a link from a TemplateTypeParmType
back to the TemplateTypeParmDecl node which declared it. This in turn
provides much more precise information about the type, where it came
from, and how it functions for AST consumers.

To make the patch work almost a year after its first attempt, it needed
serialization support, and it now retains the old getName() interface.
Finally, it requires us to not attempt to instantiate the type in an
unsupported friend decl -- specifically those coming from template
friend decls but which refer to a specific type through a dependent
name.

A cleaner representation of the last item would be to build
FriendTemplateDecl nodes for these, storing their template parameters
etc, and to perform proper instantation of them like any other template
declaration. They can still be flagged as unsupported for the purpose of
access checking, etc.

This passed an asserts-enabled bootstrap for me, and the reduced test
case mentioned in the original review thread no longer causes issues,
likely fixed at somewhere amidst the 24k revisions that have elapsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130628 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
eclTemplate.cpp
ype.cpp
ypePrinter.cpp
dc53159ba08ae9a435b89e53497906e79141c347 30-Apr-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130622 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d3d77cd138f8e830f6547b6f83fcd5721ccf5f5d 30-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR9792: Make sure to use the right definition of wchar_t when the default
wchar_t is an unsigned type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130620 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
769d0cc72b1831785596d0e76f327bdb887823be 30-Apr-2011 Douglas Gregor <dgregor@apple.com> When comparing parameters of reference-to-qualified type during
partial ordering of function templates, use a simple superset
relationship rather than the convertibility-implying
isMoreQualifiedThan/compatibilyIncludes relationship. Fixes partial
ordering between references and address-space-qualified references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130612 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
25df423cfc6689cf21d51a66af84ea1e70d489df 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Make type-traits reflect that Clang's vectors act like scalar types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130606 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
018a088b3b30e500efa9173f7cd4b1b1f6a065a8 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Switch the type-trait like APIs on the AST to only check for incomplete
types after looking through arrays. Arrays with an unknown bound seem to
be specifically allowed in the library type traits in C++0x, and GCC's
builtin __is_trivial returns 'true' for the type 'int[]'. Now Clang
agrees with GCC about __is_trivial here.

Also hardens these methods against dependent types by just returning false.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130605 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ec997dc66627957bcdcd3db7906a68c1e14a279c 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Rename the last '[hH]asStandardLayout' entites to '[iI]sStandardLayout'
based on Doug's preferences when we discussed this in IRC. This brings
the wording more in line with the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130603 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ype.cpp
636a617cc6021a4366380b3ce673f4472f3d99db 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Hoist all of the type-specific trait logic for __is_standard_layout into
a Type method isStandardLayoutType, to keep our user API matching the
type trait builtins as closely as possible. Also, implement it in terms
of other Type APIs rather than in terms of other type traits. This
models the implementation on that of isLiteralType and isTrivialType.
There remain some common problems with these traits still, so this is
a bit of a WIP. However, we can now fix all of these traits at the same
time and in a consistent manner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130602 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
a8225449421e8c1e996a7c48300521028946482a 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Completely re-implement the core logic behind the __is_standard_layout
type trait. The previous implementation suffered from several problems:

1) It implemented all of the logic in RecordType by walking over every
base and field in a CXXRecordDecl and validating the constraints of
the standard. This made for very straightforward code, but is
extremely inefficient. It also is conceptually wrong, the logic tied
to the C++ definition of standard-layout classes should be in
CXXRecordDecl, not RecordType.
2) To address the performance problems with #1, a cache bit was added to
CXXRecordDecl, and at the completion of every C++ class, the
RecordType was queried to determine if it was a standard layout
class, and that state was cached. Two things went very very wrong
with this. First, the caching version of the query *was never
called*. Even within the recursive steps of the walk over all fields
and bases the caching variant was not called, making each query
a full *recursive* walk. Second, despite the cache not being used, it
was computed for every class declared, even when the trait was never
used in the program. This probably significantly regressed compile
time performance for edge-case files.
3) An ASTContext was required merely to query the type trait because
querying it performed the actual computations.
4) The caching bit wasn't managed correctly (uninitialized).

The new implementation follows the system for all the other traits on
C++ classes by encoding all the state needed in the definition data and
building up the trait incrementally as each base and member are added to
the definition of the class.

The idiosyncracies of the specification of standard-layout classes
requires more state than I would like; currently 5 bits. I could
eliminate one of the bits easily at the expense of both clarity and
resilience of the code. I might be able to eliminate one of the other
bits by computing its state in terms of other state bits in the
definition. I've already done that in one place where there was a fairly
simple way to achieve it.

It's possible some of the bits could be moved out of the definition data
and into some other structure which isn't serialized if the serialized
bloat is a problem. That would preclude serialization of a partial class
declaration, but that's likely already precluded.

Comments on any of these issues welcome.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130601 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ype.cpp
6e35b651cddbc69b2e8b95a32cfeb64cd2da13bf 30-Apr-2011 Benjamin Kramer <benny.kra@googlemail.com> Initialize HasStandardLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130600 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
31bebe03336cbaafb76c6f40642fa47f2cc6c479 29-Apr-2011 Charles Davis <cdavis@mines.edu> Remove comments about __int8 and friends from the mangler. Turns out we don't
actually have to implement them, since in modern versions of MSVC they're
aliases to the standard C types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130509 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftMangle.cpp
43fa33b4bedc28d2faa17d678ad1f40eb42817a1 29-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Relax the non-POD memset warning to use the less restrictive C++11
definition of POD. Specifically, this allows certain non-aggregate
types due to their data members being private.

The representation of C++11 POD testing is pretty gross. Any suggestions
for improvements there are welcome. Especially the name
'isCXX11PODType()' seems truly unfortunate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130492 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
5751838965eefa1c08e4fc545498a3ee45cd9611 29-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Don't assume that the AST methods will only be invoked on C++ types.
Teaches isLiteralType and isTrivialType to behave plausibly and most
importantly not crash on normal RecordDecls.

Sadly I have no real way to test this. I stumbled onto it by
mis-implementing a warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130483 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
07a8a21c3376f3a2ee470bfa3549c6f3ac4e236d 29-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> ms_struct patch for initialization and field access irgen.
// rdar://8823265 - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130451 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
75c4064932d481ac710a80aa88b3370ad8a6af1d 28-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Silence more -Wnon-pod-memset given its current implementation. I may be
able to revert these based on a patch I'm working on, but no reason for
people to be spammed with warnings in the interim.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130394 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
ba29bd25515fbd99e98ba0fedb9d93617b27609e 28-Apr-2011 Ted Kremenek <kremenek@apple.com> Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContext's side tables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130383 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5a7e6f781afc53f3c04c146d74aa7eff15f1338e 28-Apr-2011 John McCall <rjmccall@apple.com> Implement the mangling for non-ADL call expressions that we just
worked out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130376 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
28bbe4b8acc338476fe0825769b41fb32b423c72 28-Apr-2011 John Wiegley <johnw@boostpro.com> Parsing/AST support for Structured Exception Handling

Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130366 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
61d0b6baf47cf411f6c0f6ddb4acffcfeec724f1 28-Apr-2011 Douglas Gregor <dgregor@apple.com> More cleanup of template argument deduction and its handling of
non-CVR qualifiers. We can now properly match address-space--qualified
references during template argument deduction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130365 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
21ff2e516b0e0bc8c1dbf965cb3d44bac3c64330 28-Apr-2011 John Wiegley <johnw@boostpro.com> Implementation of Embarcadero array type traits

Patch authored by John Wiegley.

These are array type traits used for parsing code that employs certain
features of the Embarcadero C++ compiler: __array_rank(T) and
__array_extent(T, Dim).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130351 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
20c0da7787c9a7d2529e42a4a91d777778595d74 28-Apr-2011 John Wiegley <johnw@boostpro.com> t/clang/type-traits

Patch authored by John Wiegley.

These type traits are used for parsing code that employs certain features of
the Embarcadero C++ compiler. Several of these constructs are also desired by
libc++, according to its project pages (such as __is_standard_layout).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130342 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
tmtPrinter.cpp
ype.cpp
14d56ef43ff4921c6749f7340212fbb743fdbb9b 27-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Some refactoring of my ms_struct patch.
// rdar://8823265 related.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130311 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
34a99e7ef27d40fd116061249ae2c4eee6486c01 27-Apr-2011 Douglas Gregor <dgregor@apple.com> When printing a base-specifier, print the ellipsis ("...") if it is a
pack expansion. Fixes PR9452.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130310 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8703b1c8f95a43c0208ae8acc6b209d99c11f386 27-Apr-2011 Douglas Gregor <dgregor@apple.com> ASTImporter support for NestedNameSpecifier, from Olaf Krzikalla

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130307 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
62055b0618fafb4747e783ba3fedd7bc7d57d27d 27-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> With ms_struct attribut, Zero-length bitfields following
non-bitfield members are ignore. // rdar://8823265 wip


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130257 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
cd88b4171753dcb2bc0a21d78f1597c796bb8a20 26-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Gcc pads the size of an array using the alignment of its elements.

The size of the array may not be aligned according to alignment of its elements if an alignment attribute is
specified in a typedef. Fixes rdar://8665729 & http://llvm.org/PR5637.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130242 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
864c041e118155c2b1ce0ba36942a3da5a4a055e 26-Apr-2011 John McCall <rjmccall@apple.com> Make yet another placeholder type, this one marking that an expression is a bound
member function, i.e. something of the form 'x.f' where 'f' is a non-static
member function. Diagnose this in the general case. Some of the new diagnostics
are probably worse than the old ones, but we now get this right much more
universally, and there's certainly room for improvement in the diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130239 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypeLoc.cpp
552622067dc45013d240f73952fece703f5e63bd 25-Apr-2011 John Wiegley <johnw@boostpro.com> t/clang/expr-traits

Patch authored by David Abrahams.

These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for
parsing code that employs certain features of the Embarcadero C++ compiler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130122 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
c0a455942453a37dd7db83eb354f40a49872ab06 24-Apr-2011 John McCall <rjmccall@apple.com> GCC seems to create address-of expression manglings when passing *any*
function as a template argument where a pointer to function is wanted.
Just extend the existing hack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130084 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
a0ce15c13a69c430d8980a1fcf03f420855c18ca 24-Apr-2011 John McCall <rjmccall@apple.com> Update the mangler for some of the "new" unresolved-name manglings.
I've sent off an email requesting clarification on a few things that
I wasn't sure how to handle.

This also necessitated making prefixes and unresolved-prefixes get
mangled separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130083 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
1b6005285e234bc30698917b2d3abb2f1f98bc77 24-Apr-2011 John McCall <rjmccall@apple.com> The ABI settled on mangling float literals with lowercase hex dumps.
APInt::toString doesn't do those, but it's easy to postprocess that output,
and that's probably better than adding another knob to that method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130081 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
9b6347cd410be55425f7062d22fd6e4ecb4e1a58 24-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Implement most of the remaining logic in __is_literal type trait. This
should now support all of the C++98 types, and all of the C++0x types
Clang supports.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130079 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ype.cpp
4d6e5a22d9481bb83b82d911727540096d171c0b 24-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Begin tracking trivialness of move constructors and move assignment
operators in C++ record declarations.

This patch starts off by updating a bunch of the standard citations to
refer to the draft 0x standard so that the semantics intended for move
varianst is clear. Where necessary these are duplicated so they'll be
available in doxygen.

It adds bit fields to keep track of the state for the move constructs,
and updates all the code necessary to track this state (I think) as
members are declared for a class. It also wires the state into the
various trait-like accessors in the AST's API, and tests that the type
trait expressions now behave correctly in the presence of move
constructors and move assignment operators.

This isn't complete yet due to these glaring FIXMEs:
1) No synthesis of implicit move constructors or assignment operators.
2) I don't think we correctly enforce the new logic for both copy and
move trivial checks: that the *selected* copy/move
constructor/operator is trivial. Currently this requires *all* of them
to be trivial.
3) Some of the trait logic needs to be folded into the fine-grained
trivial bits to more closely match the wording of the standard. For
example, many of the places we currently set a bit to track POD-ness
could be removed by querying other more fine grained traits on
demand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130076 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c69a505cfa318d571ce8a0cd038c8d958585a735 23-Apr-2011 Jay Foad <jay.foad@gmail.com> Remove unused STL header includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b7e9589bce9852b4db9575f55ac9137572147eb5 23-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Implement basic __is_trivial type-trait support, enough to close PR9472.
This introduces a few APIs on the AST to bundle up the standard-based
logic so that programmatic clients have access to exactly the same
behavior.

There is only one serious FIXME here: checking for non-trivial move
constructors and move assignment operators. Those bits need to be added
to the declaration and accessors provided.

This implementation should be enough for the uses of __is_trivial in
libstdc++ 4.6's C++98 library implementation.

Ideas for more thorough test cases or any edge cases missing would be
appreciated. =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130057 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
tmtPrinter.cpp
ype.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3e8dc2ac8926dfbebd8f2f6b74ceba4befccd4d2 21-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use the ArrayFiller to fill out "holes" in the array initializer due to designated initializers,
avoiding to create separate Exprs for each one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129933 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4423ac0282acb8ba801eb05b38712438dc0c1e3e 21-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For

double data[20000000] = {0};

we would blow out the memory by creating 20M Exprs to fill out the initializer.

To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.

Fixes rdar://9275920.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129896 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
22ce41d9fc8509da65858c75bf5b3c4dae2d8c04 20-Apr-2011 Douglas Gregor <dgregor@apple.com> Give invalid tag types 8-bit size and alignment, rather than 1-bit
alignment, which causes traps further down the line. Fixes
<rdar://problem/9109755>, which contains a test case far too large to
commit :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129861 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b665b86f30be748cad03df85acde05da19ee875c 20-Apr-2011 Douglas Gregor <dgregor@apple.com> Eliminate an uninteresting assertion; invalid code involving
out-of-line destructors can result in the addition of redundant
destructors to a class. It's not harmful to the AST. Fixes
<rdar://problem/9158632>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129860 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
db57a4cdb0a6abf3239f3a794a900ce312c5887b 19-Apr-2011 Daniel Dunbar <daniel@zuster.org> ADT/Triple: Switch to using .isOSDarwin() predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129823 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6b6b42aed07726178f61954ac6e51f47da00275c 19-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> We regard a function as 'unused' from the codegen perspective, so our warnings diverge from
gcc's unused warnings which don't get emitted if the function is referenced even in an unevaluated context
(e.g. in templates, sizeof, etc.). Also, saying that a function is 'unused' because it won't get codegen'ed
is somewhat misleading.

- Don't emit 'unused' warnings for functions that are referenced in any part of the user's code.
- A warning that an internal function/variable won't get emitted is useful though, so introduce
-Wunneeded-internal-declaration which will warn if a function/variable with internal linkage is not
"needed" ('used' from the codegen perspective), e.g:

static void foo() { }

template <int>
void bar() {
foo();
}

test.cpp:1:13: warning: function 'foo' is not needed and will not be emitted
static void foo() { }
^

Addresses rdar://8733476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129794 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1c860d5640e8eebb11a5d515a761242b66761b0b 19-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> Add a new expression classification, CL_AddressableVoid

CL_AddressableVoid is the expression classification used for void
expressions whose address can be taken, i.e. the result of [], *
or void variable references in C, as opposed to things like the
result of a void function call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129783 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
7c2bdcb4d30f2d370b4367664e6a11b075ce2cb3 18-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a bug in calculation of composite type
of conditional expressions of objc pointer types
where one type is the immediate base type of the
other. // rdar://9296866


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129718 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b92ae0e31126e5630d7022f2d6abe7eed2e17746 16-Apr-2011 Tanya Lattner <tonic@nondot.org> Fix bug in vector initializer when initializing a vector with another vector.
Add test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129617 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
162e1c1b487352434552147967c3dd296ebee2f7 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Support for C++11 (non-template) alias declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
XXInheritance.cpp
ecl.cpp
eclBase.cpp
eclPrinter.cpp
umpXML.cpp
taniumMangle.cpp
icrosoftMangle.cpp
tmtDumper.cpp
tmtIterator.cpp
ype.cpp
ypePrinter.cpp
98a57868d696cb5faf6195a609ad084a711c6bbe 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Teach -ast-print how to print template template parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129565 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumCXXABI.cpp
taniumMangle.cpp
icrosoftCXXABI.cpp
icrosoftMangle.cpp
f111d935722ed488144600cea5ed03a6b5069e8f 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement generic selections

As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
xprCXX.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
414d8967e1d760ea1e19a4aca96b13777a8cf8c5 14-Apr-2011 Anton Korobeynikov <asl@math.spbu.ru> Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.

In particular, all library functions should always be AAPCS regardless of floating point ABI used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129534 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
icrosoftMangle.cpp
ype.cpp
ypePrinter.cpp
5bbcdbf36f8cf79d99703ef20848c55960065e43 14-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Chained PCH: Remember when additional specializations are added to a function template from a previous PCH. Fixes the only crasher when using massive chains on Clang's Sema component. We still have some incomplete codegen there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129516 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
3e2193ce5feb2feb092e5ae615e85148e06e9fd2 14-Apr-2011 Anders Carlsson <andersca@mac.com> Add a flag to StringLiteral to keep track of whether the string is a pascal string or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129488 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
627788c29976fbeb4ad47bcfcb3576889070e357 12-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a regression where the initializer implements
the initialized's protocol and yet clang warns.
objective-c issue, // rdar://9267196


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129363 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
755d8497e39071aa24acc173ff07083e3256b8f8 12-Apr-2011 John McCall <rjmccall@apple.com> After some discussion with Doug, we decided that it made a lot more sense
for __unknown_anytype resolution to destructively modify the AST. So that's
what it does now, which significantly simplifies some of the implementation.
Normal member calls work pretty cleanly now, and I added support for
propagating unknown-ness through &.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129331 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
379b5155b4566f63679e1da6b0ceb5fdfa2aec6d 11-Apr-2011 John McCall <rjmccall@apple.com> More __unknown_anytype work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129269 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
575b374fdbfc2c2224fd3047ac11ffc4b8db9ae5 11-Apr-2011 Anders Carlsson <andersca@mac.com> Remove CK_DynamicToNull.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129265 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
0fee330f5754ca4b248e5bb7363e834668aff06d 11-Apr-2011 Anders Carlsson <andersca@mac.com> Add CXXDynamicCastExpr::isAlwaysNull() which will be replacing the cast kind I added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129263 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7d99bc37e77157523e3bfbc6c077842b74e6690f 10-Apr-2011 Anders Carlsson <andersca@mac.com> As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind which
represents a dynamic cast where we know that the result is always null.

For example:

struct A {
virtual ~A();
};
struct B final : A { };
struct C { };

bool f(B* b) {
return dynamic_cast<C*>(b);
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129256 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
2eba7abeab4abddd28644200397f8a1d5badccdd 09-Apr-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r129173 (Apr 8th 2011)

Upstream Revision
git-id: 0ff32595e4b92c5bdee78946b39f9e990b20cc90
svn-id: 129173
a49218e17bcbb1acde0245773173e2c0c42f4f19 09-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR8369: make __attribute((regparm(0))) work correctly. Original patch by
pageexec@freemail.hu, tweaks by me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129206 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
umpXML.cpp
b7bc34a83aff8af09f2a78aa6d1dcafe18ad8619 08-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Warn for any kind of initialization if initializer does not
implement lhs's protocols. // rdar://9091389.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129142 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1de4d4e8cb2e9c88809fea8092bc6e835a5473d2 07-Apr-2011 John McCall <rjmccall@apple.com> Basic, untested implementation for an "unknown any" type requested by LLDB.
The idea is that you can create a VarDecl with an unknown type, or a
FunctionDecl with an unknown return type, and it will still be valid to
access that object as long as you explicitly cast it at every use. I'm
still going back and forth about how I want to test this effectively, but
I wanted to go ahead and provide a skeletal implementation for the LLDB
folks' benefit and because it also improves some diagnostic goodness for
placeholder expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129065 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xpr.cpp
xprConstant.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypeLoc.cpp
759abb4d9ec14ae32104a9677b60f0542b60d1d8 06-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Fix lookup for class messages sent to qualified-class
types such that protocols are seached first. Fixes
// rdar://9224670


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129016 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6931743e29845d66d919a83db5a7b734f57ffdf2 06-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> Do not use IR marker for LLVM intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129001 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
e87e717b0dbe4776f2b4dbb1e6ce2a19f562d2b0 02-Apr-2011 csmon7507 <csmon7507@gmail.com> Merge branch 'upstream' into logan-fastforward-20110320
d7650610b39947ad8ea8273e7e5099894f71bb08 02-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Apply a bug-fix patch from Marcin Kowalczyk to the source locations for
a couple of operator overloads which form interesting expressions in the
AST.

I added test cases for both bugs with the c-index-test's token
annotation feature. Also, thanks to John McCall for confirming that this
is the correct solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128768 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f445debe3a6825e6528655db0906ce4fa41240ea 01-Apr-2011 csmon <csmon@csmon-desktop.(none)> Merge branch 'upstream' into logan-fastforward-20110320
b277159055933e610bbc80262b600d3ad7e0595c 30-Mar-2011 Ted Kremenek <kremenek@apple.com> Begin reworking static analyzer support for C++ method calls. The current logic was divorced
from how we process ordinary function calls, had a tremendous about of redundancy, and relied
strictly on inlining behavior (which was incomplete) to provide semantics instead of falling
back to the conservative analysis we use for C functions. This is a significant step into
making C++ analyzer support more useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128557 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
077f490d0a514dcc448475f33f799934252b85a7 26-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> More coherent diagnostic attempting to assign to a member of a const object returned
from an objective-c message: // rdar://9005189


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128348 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
da57f3eeab7b7f7f6e6788956f0a0d9adf196a7d 26-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128339 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
4421d2b341d041df44013769f23c306308bbab83 26-Mar-2011 Douglas Gregor <dgregor@apple.com> On Mac OS X, the presence of an 'availability' attribute for that
platform implies default visibility. To achieve these, refactor our
lookup of explicit visibility so that we search for both an explicit
VisibilityAttr and an appropriate AvailabilityAttr, favoring the
VisibilityAttr if it is present.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128336 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b53e417ba487f4193ef3b0485b420e0fdae643a2 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Extend the new 'availability' attribute with support for an
'unavailable' argument, which specifies that the declaration to which
the attribute appertains is unavailable on that platform.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128329 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
e50c297f92914ca996deb8b597624193273b62e4 25-Mar-2011 Eli Friedman <eli.friedman@gmail.com> Silly mistake in integer constant folding cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128297 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0254e70b189a2400648d1cc53e279cc3786186e8 25-Mar-2011 Anders Carlsson <andersca@mac.com> Fix some clang warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128272 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2a523eec6a31955be876625819b89e8dc5def707 25-Mar-2011 Eli Friedman <eli.friedman@gmail.com> Switch constant evaluation of float casts over to cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128251 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
46a523285928aa07bf14803178dc04616ac85994 25-Mar-2011 Eli Friedman <eli.friedman@gmail.com> Cleanup integral and vector constant evaluation of casts to use cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128250 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0ff8818a23db02eba7202aa373ddaeb3ddbf5280 23-Mar-2011 Chris Lattner <sabre@nondot.org> remove a dead variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128141 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0a0d2b179085a52c10402feebeb6db8b4d96a140 23-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
xprConstant.cpp
97d2d2e368d3ead34d83c328383711c7dabab60a 22-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127980 (Mar 20th 2011)
78951941f31d3c63c4178a1275e1a2db2e20da11 22-Mar-2011 John McCall <rjmccall@apple.com> Fix a test case and teach ClearLinkageCache() to clear the linkage of
a function template decl's pattern, which was suddenly exposed by my
last patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128073 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
74990f45b0bc57fca81f908efb13d2b6c6350f03 22-Mar-2011 John McCall <rjmccall@apple.com> File-scope static functions need to be mangled with 'L' so that
they don't collide with file-scope extern functions from the same
translation unit. This is basically a matter of applying the same
logic to FunctionDecls as we were previously applying to VarDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128072 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
43d8bcfc3601aec7dd3e7ccc7b6ddd3ff6189c62 22-Mar-2011 Ted Kremenek <kremenek@apple.com> Simplify crash recovery cleanup registration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128057 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8e02635c9c276720a1e6f926b33303a53cebe9c7 18-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127869 (Mar 18th 2011)
4d96d9f0e758fb9244749f99d4b0a3ab1e3e0592 19-Mar-2011 Ted Kremenek <kremenek@apple.com> Recover memory from RecordLayoutBuilders during crashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127931 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
207f4d8543529221932af82836016a2ef066c917 18-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127915 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7f0a915eb546d353071be08c8adec155e5d9a0dc 18-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed inconsistency when adding TemplateParameterListsInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127876 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0daaf32723ac78549c507c2a68a5300502703673 16-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Use ElaboratedType also for C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127755 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
28ac87e1a22ee15f284643d9007640d25b1aab5b 16-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Support for printing/dumping static asserts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127744 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtDumper.cpp
24f4674e697fb53587f0e8485e9c6592f7021ef2 16-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added missing methods to get Designators source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127735 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a4fdbfad150ae37bddaa4094d3925a27a1a1cf3f 14-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Block return type of the initialized must be
be more speciaclized than that of the initializer,
when matching protocol qualifier list.
// rdar:// 9118343.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127585 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8026f6d82f7fa544bc0453714fe94bca62a1196e 13-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127568 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprCXX.cpp
ype.cpp
60618fa7f88d5162bb5b40988b6b38d4d75d6fc6 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate the new exception information to FunctionProtoType.
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127537 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclPrinter.cpp
umpXML.cpp
xpr.cpp
xprCXX.cpp
ype.cpp
ypePrinter.cpp
f4e3cfbe8abd124be6341ef5d714819b4fbd9082 11-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for the OpenCL vec_step operator, by generalising and
extending the existing support for sizeof and alignof. Original
patch by Guy Benyei.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127475 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
4f3bc8f7aa90b72832b03bee9201c98f4bb6b4d1 11-Mar-2011 Ken Dyck <kd@kendyck.com> Overload IntExprEvaluator::Success() with a function that takes a CharUnits
parameter to tidy up the places where the expression is a size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127454 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d5e3ed085032def4ac875d64cb029fc3926652ed 10-Mar-2011 Ken Dyck <kd@kendyck.com> Instead of round up sizes to '8', round them up to the alignment of the char
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127391 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
90ce2dba294b8443169fe1a583914908fae0e767 10-Mar-2011 Ken Dyck <kd@kendyck.com> Round up the non-virtual size to the next char instead of rounding down.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127390 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ba877adeb49ed6dc17f27fa3a3bcd0cca713fd68 09-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed InnerLocStart.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127330 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
d271e4b0c6c42a0e670226e697963df427e35a56 07-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Apply changes to merge with clang upstream (6th Mar 2011)
ndroid.mk
27d70656d3ce7c9e030b6dea468cfc96687010d5 09-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream (Nov 6th 2011)
f52516038ab5d0b1b90a6dd32f46b7d6dabd04c8 08-Mar-2011 Douglas Gregor <dgregor@apple.com> Teach libclang's token-annotation logic about context-sensitive
keywords for Objective-C+ and C++0x.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127253 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
a2026c96d3935e7909e049ad9096762844544ed6 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source range for declarations using postfix types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127251 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
ypeLoc.cpp
acba90f30876b4140b738f0d3dd0e50724053a96 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed NamespaceDecl source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127242 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
f2cf562cec11dec926c0a29a71769a27fed02962 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed bitfields source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127237 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ff676cb48fe8bf7be2feaa251dc7c5fb15af4730 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for all DeclaratorDecl's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127225 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
c2f3e7f42c8bf9e8d4393a6e8c4762dafc4f28dd 07-Mar-2011 John McCall <rjmccall@apple.com> The conditional needs to be pushed before the branch. Make the test less
trivial to check this. Adjust for style.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127151 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
a868c3799b739781db325c1bd2c6afd182bc9bd6 06-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Completed source ranges fixes for all classes inheriting from TypeDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127120 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
344577e6b58f42d18dc8118c8903b49a85dc005e 06-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed TypedefDecl and TemplateTypeParameter source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127119 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclTemplate.cpp
8b5b4099c61a136e9a1714c4d8a593febe942268 06-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo.", this time with the missing header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127118 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
708a86690469474f0a8149abca71aa4c62bf9710 06-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r127112, "Propagate new-style exception spec information to ExtProtoInfo."

It seems missing "clang/Basic/ExceptionSpecificationType.h".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127115 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
06bfa84588658d721094f383d6950e75100c4c4c 05-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate new-style exception spec information to ExtProtoInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127112 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
6784304db526cde59046d613c4175ce2caf93e44 05-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed LabelDecl source range and cleaned creation code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127094 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c494f77363f057dd8619fec4e885c4f80e3d1b66 05-Mar-2011 Douglas Gregor <dgregor@apple.com> When determining template instantiation arguments within a function
template (not a specialization!), use the "injected" function template
arguments, which correspond to the template parameters of the function
template. This is required when substituting into the default template
parameters of template template parameters within a function template.

Fixes PR9016.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127092 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
67da6f6f0c20dbfebb1c383a3efaf85d925ad33e 05-Mar-2011 Douglas Gregor <dgregor@apple.com> When we're deserializing a template parameter declaration, temporarily
use the translation unit as its declaration context, then deserialize
the actual lexical and semantic DeclContexts after the template
parameter is complete. This avoids problems when the DeclContext
itself (e.g., a class template) is dependent on the template parameter
(e.g., for the injected-class-name).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127056 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b1c86492f9a9bef01a4567408c22f961bbd604fe 05-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Currently we can only remap a file by creating a MemoryBuffer and replacing the file contents with it.
Allow remapping a file by specifying another filename whose contents should be loaded if the original
file gets loaded. This allows to override files without having to create & load buffers in advance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127052 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
6cd9d4aa13c2145c8b4398453974515b734bfe42 04-Mar-2011 Douglas Gregor <dgregor@apple.com> Teach Sema::ActOnCXXNestedNameSpecifier and Sema::CheckTemplateIdType
to cope with non-type templates by providing appropriate
errors. Previously, we would either assert, crash, or silently build a
dependent type when we shouldn't. Fixes PR9226.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127037 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
787a40db5d7b92f6f6713dbe48e9b015fde407b0 04-Mar-2011 Douglas Gregor <dgregor@apple.com> *Recursively* set the context of a template parameter, so that we also
capture the template parameters of template template parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127012 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
9a299e0575ce235f491014627c7267e2d2cd73de 04-Mar-2011 Douglas Gregor <dgregor@apple.com> Make sure to put template parameters into their owning template's
DeclContext once we've created it. This mirrors what we do for
function parameters, where the parameters start out with
translation-unit context and then are adopted by the appropriate
DeclContext when it is created. Also give template parameters public
access and make sure that they don't show up for the purposes of name
lookup.

Fixes PR9400, a regression introduced by r126920, which implemented
substitution of default template arguments provided in template
template parameters (C++ core issue 150).

How on earth could the DeclContext of a template parameter affect the
handling of default template arguments?

I'm so glad you asked! The link is
Sema::getTemplateInstantiationArgs(), which determines the outer
template argument lists that correspond to a given declaration. When
we're instantiating a default template argument for a template
template parameter within the body of a template definition (not it's
instantiation, per core issue 150), we weren't getting any outer
template arguments because the context of the template template
parameter was the translation unit. Now that the context of the
template template parameter is its owning template, we get the
template arguments from the injected-class-name of the owning
template, so substitution works as it should.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127004 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
4a85a73466bfb541cd9c7b57a99292a0b6900b9b 04-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for ClassTemplateSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126999 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
c54061a679d8db4169438b2f97f81e3f443c6a25 04-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Move private structs into anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126997 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
77d4ee2bfc90b77ec8b818de985cd4aceeef757b 04-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Improved TemplateTypeParmDecl end location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126996 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ee4bfd412db491c489fc2ee74916edd73f9c618a 04-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed end location of NonTypeTemplateParamDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126994 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
1a0918ade0a3490c7aff243f9cd519156dfcb0bd 04-Mar-2011 John McCall <rjmccall@apple.com> Don't consider visibility from template parameter lists if we're
computing for a nested decl with explicit visibility. This is all part
of the general philosophy of explicit visibility attributes, where
any information that was obviously available at the attribute site
should probably be ignored. Fixes PR9371.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126992 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
14aa2175416f79ef17811282afbf425f87d54ebf 04-Mar-2011 John McCall <rjmccall@apple.com> Make AttributedTypes for GC-qualified types and fix some miscellaneous
bugs with such types. Not sure this is quite how I want the desugaring
and a.k.a. logic to go, but it suffices.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126986 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
ypePrinter.cpp
203548ba4b72e7e59320d352afc1eb0b5ab131de 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for LabelDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126952 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0f0ea2a96534c615ff5fdd81363989b23cf2164a 03-Mar-2011 Douglas Gregor <dgregor@apple.com> Eliminate redundant nested-name-specifiers on
TemplateSpecializationTypes, which also fixes PR9388.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126946 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
55a9637969260ca7eb66011732094b33f049c52a 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Removed left brace location from LinkageSpecDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126945 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5f6bcbebedb85ee745cbd9a3ca51ca8c766a6117 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed end source location for LinkageSpecDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126943 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
21e006e51a7f9889f55f5bc7b3ca8b50d17571ec 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for FileScopeAsmDecl. Others source range fixes will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126939 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
dfbbcf964a5d51bc01340a6f830cf380f9c0a5a1 03-Mar-2011 Douglas Gregor <dgregor@apple.com> Add a missing break, from John Wiegley

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126919 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
9c6082fe89c61af697f017aa80937581cc2128d8 02-Mar-2011 Tilmann Scheller <tilmann.scheller@googlemail.com> Revert "Add CC_Win64ThisCall and set it in the necessary places."

This reverts commit 126863.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126886 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
icrosoftMangle.cpp
ype.cpp
75e85048e73fcde2ce9d8a48dfdb1220e132eb59 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Fix the source range for a member access expression that includes a
nested-name-specifier and improve the detection of implicit 'this'
bases. Fixes <rdar://problem/8750392>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126880 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
d976c8e2752bc36c0697d43f985ec55b9450f8c1 02-Mar-2011 John McCall <rjmccall@apple.com> Work around a misdesigned GCC warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126879 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
88d117c2eedd7c5bec57ac983a98d5e12bdd2cc6 02-Mar-2011 Tilmann Scheller <tilmann.scheller@googlemail.com> Add CC_Win64ThisCall and set it in the necessary places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126863 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
icrosoftMangle.cpp
ype.cpp
b6744efecba58792cce20d2d7b9ee39927c5422e 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into template
template arguments. I believe that this is the last place in the AST
where we were storing a source range for a nested-name-specifier
rather than a proper nested-name-specifier location structure. (Yay!)

There is still a lot of cleanup to do in the TreeTransform, which
doesn't take advantage of nested-name-specifiers with source-location
information everywhere it could.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126844 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
ypeLoc.cpp
d5313b0bbf3948fe7c63bf46a7da330c96d07309 02-Mar-2011 John McCall <rjmccall@apple.com> Provide an attribute, objc_method_family, to allow the inferred family
of an Objective-C method to be overridden on a case-by-case basis. This
is a higher-level tool than ns_returns_retained &c.; it lets users specify
that not only does a method have different retain/release semantics, but
that it semantically acts differently than one might assume from its name.
This in turn is quite useful to static analysis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126839 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
15c83a246651186661f8bb27715663e5098f4bd8 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Apply changes to merge with clang upstream Nov 10th 2010."
e8f3996b0f2b720280093f7f73865696919bf389 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Simplify some complex emission and implement correct semantics for assignment to volatiles in C. This in effect reverts some of mjs's work in and around r72572. Basically, the C++ standard is quite clear, except that it lies about volatile behavior approximating C's, whereas the C standard is almost actively misleading."
7c6e01a5715d9d517a45ca06b339e9c50f4cbfcb 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Have CXXDeleteExpr::getDestroyedType return the actual destroyed type in more situations. In particular, for code like"
e52e3c3380a571d449422ead558337abe0b4b70f 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Kill CK_Unknown and flesh out the documentation for the existing CastKinds."
8f4ef74b45742f2e52886fc11008c9270ee44518 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Update TypePrinter::PrintVector to handle new Neon vector types."
ed901b742df204cf58a8b03a6e0dd1a06d84a303 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "ASTContext::getVectorType should preserve the vector kind for canonical types. This is needed for Neon types when it is most natural to define them in terms of a typedef. For example, Neon poly8_t is a typedef for "signed char", and we want to define polynomial vectors as vectors of that typedef. Without this change, the result will be a generic GCC-style vector. I think this is safe for other vector types as well, but I would appreciate a review of this."
db1c88bbdd8ab80940d40b65ff1b3f9ca2629f5f 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "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."
1baa0f1eb1250a4d6c1b3da7ec99c6e6b91f9fc3 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Add method ParentMap::addStmt()."
ca34b8f06d560b4f604934d57b2ad311c4228e32 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Assorted work leading towards the elimination of CK_Unknown."
fc5395a116a4e92548f99875f5d82786c5ff82ba 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Add a few more complex-related cast kinds that arise due to arbitrary implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea."
38cf267adf22762494a72c82791a491f4ecb6db3 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Introduce five new cast kinds for various conversions into and between complex types."
7f10664133668045bf1bd7143b9cba7ffabc07f7 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Bring UsualArithmeticConversionsType back into Sema and cast the operands appropriately. There are a lot of missing complex-related cast kinds."
1472d24d9345f42fb9b4ddee26126599acde930f 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Introduce a null-to-pointer implicit cast kind."
cfe5a0619ec52cf5d0e4420314f0e3d4cba73679 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types."
5ecb0486de7ec68e806c3904727ef9080dbe2c03 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Make sure to always check the result of SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes."
026ae918949e2b3a1eddb04a534b72ed50621830 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "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."
85f3d76c0ecfdefcf83ea44a57b7a16119c8a045 02-Mar-2011 John McCall <rjmccall@apple.com> Move some of the logic about classifying Objective-C methods into
conventional categories into Basic and AST. Update the self-init checker
to use this logic; CFRefCountChecker is complicated enough that I didn't
want to touch it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126817 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
059101f922de6eb765601459925f4c8914420b23 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source-location information into dependent
template specialization types. This also required some parser tweaks,
since we were losing track of the nested-name-specifier's source
location information in several places in the parser. Other notable
changes this required:

- Sema::ActOnTagTemplateIdType now type-checks and forms the
appropriate type nodes (+ source-location information) for an
elaborated-type-specifier ending in a template-id. Previously, we
used a combination of ActOnTemplateIdType and
ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped
around a DependentTemplateSpecializationType, which duplicated the
keyword ("class", "struct", etc.) and nested-name-specifier
storage.

- Sema::ActOnTemplateIdType now gets a nested-name-specifier, which
it places into the returned type-source location information.

- Sema::ActOnDependentTag now creates types with source-location
information.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126808 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
fb7cb35fa0a8131853b1b049ca7be77980e144f5 01-Mar-2011 Ted Kremenek <kremenek@apple.com> Don't warn about unused values in ternary ?: expressions unless both the LHS and RHS are "unused" (side-effect free).

Patch by Justin Bogner! Fixes PR 8282.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126779 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
94fdffa4a572fc14ac296f5f1aae9db3734c72f1 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source-location information into dependent
template specialization types. There are still a few rough edges to
clean up with some of the parser actions dropping
nested-name-specifiers too early.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126776 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
ef165c94cf743c7e5eb6f65bced28cdb9ba118f5 01-Mar-2011 Dan Gohman <gohman@apple.com> Revert 123553, as sys::fs::unique_file is not finished yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126772 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
9e876876afc13aa671cc11a17c19907c599b9ab9 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Reinstate the introduction of source-location information for
nested-name-speciciers within elaborated type names, e.g.,

enum clang::NestedNameSpecifier::SpecifierKind

Fixes in this iteration include:

(1) Compute the type-source range properly for a dependent template
specialization type that starts with "template template-id ::", as
in a member access expression

dep->template f<T>::f()

This is a latent bug I triggered with this change (because now we're
checking the computed source ranges for dependent template
specialization types). But the real problem was...

(2) Make sure to set the qualifier range on a dependent template
specialization type appropriately. This will go away once we push
nested-name-specifier locations into dependent template
specialization types, but it was the source of the
valgrind errors on the buildbots.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126765 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
cfe9af250f466e7e38becea4428990448ae07737 01-Mar-2011 Roman Divacky <rdivacky@freebsd.org> Implement -mrtd which sets the StdCall calling convention to be the default
one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126756 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2786864406af0f3ec65b300675c6f3c809c22fd7 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Revert r126748, my second attempt at nested-name-specifier source
location information for elaborated types. *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126753 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
be38c5f5d8fa7c43c52fafddee054b8fe8c2b964 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Reinstate r126737, extending the generation of type-source location
information for qualifier type names throughout the parser to address
several problems.

The commit message from r126737:

Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126748 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
44cd9f9d686dfdb9ad16113c41c2dca1da35a646 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Revert r126737, the most recent nested-name-specifier location change, for buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126746 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
239cbb023c8da689e7722f7146914eed9755e368 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126737 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
3b3e1a1e8b44842ac3f07999c0f1eb82f13ffae4 01-Mar-2011 Ken Dyck <kd@kendyck.com> Use CharUnits for TypeAlign variable in LayoutWideBitField(). No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126730 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2494dd024b392b8def58bf067cc94b51c214cf77 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
DependentNameTypeLoc. Teach the recursive AST visitor and libclang how to
walk DependentNameTypeLoc nodes.

Also, teach libclang about TypedefDecl source ranges, so that we get
those. The massive churn in test/Index/recursive-cxx-member-calls.cpp
is a good thing: we're annotating a lot more of this test correctly
now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126729 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
5dc989c4f630acc3c0028b2d1229511063671a29 01-Mar-2011 Ken Dyck <kd@kendyck.com> Change the return type of GetVirtualPointersSize() to CharUnits. No change
in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126727 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5f791bb44417ecc201ed57a85d0fe02001d8a615 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Refactor the construction of nested-name-specifiers with
source-location information into a NestedNameSpecifierLocBuilder
class, which lives within the AST library and centralize all knowledge
of the format of nested-name-specifier location information here.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126716 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
40d96a69c0e1e8c10f92d450c305a7aae696ca9c 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier location information into DeclRefExpr and
MemberExpr, the last of the expressions with qualifiers!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126688 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
4c9be89bb615ec07eb3ed507c8fa9d0baa8a5ad7 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
UnresolvedLookupExpr and UnresolvedMemberExpr.

Also, improve the computation that checks whether the base of a member
expression (either unresolved or dependent-scoped) is implicit. The
previous check didn't cover all of the cases we use in our
representation, which threw off source-location information for these
expressions (which, in turn, caused some breakage in libclang's token
annotation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126681 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7c3179cf463c3b3b8c21dbb955f933ba50b74f28 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
CXXDependentScopeMemberExpr, and clean up instantiation of
nested-name-specifiers with dependent template specialization types in
the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126663 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
a88f09f34e86125ee4e6949a757aaed314012664 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Eliminate the last remains of TemplateSpecializationTypes with
dependent template names. There is still a lot of redundant code in
TreeTransform to cope with TemplateSpecializationTypes, which I'll
remove in stages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126656 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
b166e4acfd17acb2384b46fadb8678f7cce3f672 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Unbreak CMake build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126653 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
c304d9058ad69ff1fcbc6d19ca0be91acfa243a2 28-Feb-2011 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev:
* Add default implementations (no-op) for ExternalASTSource's pure virtual functions. There are valid use cases that can live with these defaults.
* Move ExternalASTSource's out of line implementations into separate source file.
* Whitespace, forward decl, #include cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126648 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xternalASTSource.cpp
f079b735d876f75e67b8dcc6980d0b742903ce0d 28-Feb-2011 Ken Dyck <kd@kendyck.com> Retry r126357. Use CharUnits for the Size and DataSize calculations when
they are known to be exact multiples of the width of the char type. Add a
test case to CodeGen/union.c that would have caught the problem with the
previous attempt. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126628 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c4002c7e725aec26f2c7bd04fce02595f8e2bb45 28-Feb-2011 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126595 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
aa2187de137e5b809dcbbe14f3b61ae907a3d8aa 28-Feb-2011 Douglas Gregor <dgregor@apple.com> When we encounter a dependent template name within a
nested-name-specifier, e.g.,

T::template apply<U>::

represent the dependent template name specialization as a
DependentTemplateSpecializationType, rather than a
TemplateSpecializationType with a dependent TemplateName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126593 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
ype.cpp
9c64df299df8b565955920c038ce9b8a0244448c 14-Feb-2011 Logan <tzuhsiang.chien@gmail.com> Apply changes to merge with clang upstream Nov 10th 2010.
ndroid.mk
053ec969e3023e4b4a666546476ff74e6bfdfd9a 27-Feb-2011 Logan <tzuhsiang.chien@gmail.com> Merge with clang upstream Nov 10th 2010.
4171766318a2564fbc9a739be0a2851f441c0d29 26-Feb-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement delegating constructors partially.

This successfully performs constructor lookup and verifies that a
delegating initializer is the only initializer present.

This does not perform loop detection in the initialization, but it also
doesn't codegen delegating constructors at all, so this won't cause
runtime infinite loops yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126552 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3b332ab132fa85c83833d74d400f6e126f52fbd2 26-Feb-2011 John McCall <rjmccall@apple.com> Don't crash during constant-evaluation of 1/(1/0). PR9262.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126541 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
00cf3cc2718671aa48e8da264a523b0058a8591e 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
DependentScopeDeclRefExpr. Plus, give NestedNameSpecifierLoc == and !=
operators, since we're going to need 'em elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126508 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
774e2b4f8d23d75cbb3dfef077d4631d37f623c0 25-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Clean up some gross code in the printer here. No more string stream
silliness, and actually use the existing facilities of raw_ostream to do
escaping.

This will also hopefully fix an assert when building with signed char
(MSVC I think).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126505 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
f3db29fff6a583ecda823cf909ab7737d8d30129 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source-location information into
pseudo-destructor expressions. Also, clean up some
template-instantiation and type-checking issues with
pseudo-destructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126498 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0cfaf6a270ecd0f5c7e541a8047c87948317548b 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into namespace
aliases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126496 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
db9924191092b4d426cc066637d81698211846aa 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into using directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126489 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
estedNameSpecifier.cpp
c22b5fff39a7520207f165fb16a27a34b944bd9c 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Use NestedNameSpecifierLoc within out-of-line variables, function, and
tag definitions. Also, add support for template instantiation of
NestedNameSpecifierLocs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126470 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
dc355713be51fcb4ee52d9fd6b4548ceff47fadf 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Update UsingDecl, UnresolvedUsingTypenameDecl, and
UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the
extremely-lossy NestedNameSpecifier/SourceRange pair it used to use,
improving source-location information.

Various infrastructure updates to support NestedNameSpecifierLoc:
- AST/PCH (de-)serialization
- Recursive AST visitor
- libclang traversal (including the first tests of this
functionality)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126459 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
estedNameSpecifier.cpp
tmtDumper.cpp
10aad449dfbb5b43611d45b99c88dfc26db7fac9 25-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Fix the rest of PR9316 along with some other bugs spotted by inspection.
I tried to add test cases for these, but I can't because variables
aren't warned on the way functions are and the codegen layer appears to
use different logic for determining that 'a' and 'g' in the test case
should receive C mangling. I've included the test so that if we ever
switch the codegen layer to use these functions, we won't regress due to
latent bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126453 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
094b64336495496ca29bc1e4774f5e2ceed79096 24-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Likely fix for PR9316 and other unknown bugs: don't use the anonynmous
namespace blanket rule for variables and functions declared 'extern
"C"'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126400 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c34348a7ef1a6b3f92a644a227953800cd1f9947 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Retain complete source-location information for C++
nested-name-specifiers throughout the parser, and provide a new class
(NestedNameSpecifierLoc) that contains a nested-name-specifier along
with its type-source information.

Right now, this information is completely useless, because we don't
actually store the source-location information anywhere in the
AST. Call this Step 1/N.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126391 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
6b46cd9c8508e1a67c66cbb83a9077bb787a3ce2 24-Feb-2011 Daniel Dunbar <daniel@zuster.org> Revert "Use CharUnits values for Size and DataSize outside of the bitfield
layout", it broke some GCC tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126386 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
14aba76042e041b2c5e439bf4ae353a0a3c7fd73 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Teach NestedNameSpecifier to keep track of namespace aliases the same
way it keeps track of namespaces. Previously, we would map from the
namespace alias to its underlying namespace when building a
nested-name-specifier, losing source information in the process.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126358 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
estedNameSpecifier.cpp
8102fae66df9834662d1c51ee5b91f908c419bdf 24-Feb-2011 Ken Dyck <kd@kendyck.com> Use CharUnits values for Size and DataSize outside of the bitfield layout
methods, when they are known to be exact multiples of the width of the char
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126357 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
9911344114cc493e089964f7602b619e5a47c7bc 24-Feb-2011 Ken Dyck <kd@kendyck.com> Use Context.getCharWidth() in place of literal '8's in assertions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126356 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a0c21c4ec00ea083bf036edb08bb016085b53409 24-Feb-2011 Ken Dyck <kd@kendyck.com> Make the Size and DataSize members more CharUnits-friendly by wrapping them
with getter and setter methods in both bit units and CharUnits. This will help
simplify some of the unit mismatch in the parts of the code where sizes are
known to be exact multiples of the width of the char type.

Assertions in the getters help guard against accidentally converting to
CharUnits when sizes are not exact multiples of the char width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126354 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8178df3b39ab923ff5d24538812628abee33df79 22-Feb-2011 John McCall <rjmccall@apple.com> Emit the structure layout of the block literal parameter to a block
invocation function into the debug info. Rather than faking up a class,
which is tricky because of the custom layout we do, we just emit a struct
directly from the layout information we've already got.

Also, don't emit an unnecessarily parameter alloca for this "variable".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126255 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
201e519ad9cc2863bc94cf799e407a81ed29181f 22-Feb-2011 John McCall <rjmccall@apple.com> Give ImplicitParamDecl a public constructor so that it can be allocated on
the stack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126254 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
aab9e315184d344bbd733f13b68915d02db7b32b 22-Feb-2011 John McCall <rjmccall@apple.com> Provide a Decl::getNonClosureContext to look through any "closure" (i.e.
block and, eventually, C++ lambda) contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126252 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
dc856aff4428380baa9afb5577ea04f8fb6beb13 22-Feb-2011 Matt Beaumont-Gay <matthewbg@google.com> Use an unused-except-in-Debug variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126240 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
935f0f01c1ed3c2052b797ac035d57a85b78adc4 21-Feb-2011 Chris Lattner <sabre@nondot.org> add one more case of mismatched input/output constraints.
When the mismatch is due to a larger input operand that is
a constant, truncate it down to the size of the output. This
allows us to accept some cases in the linux kernel and elsewhere.
Pedantically speaking, we generate different code than GCC, though
I can't imagine how it would matter:

Clang:
movb $-1, %al
frob %al

GCC:

movl $255, %eax
frob %al



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126148 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
967ecd3bed2b7f6ea04a1592dced6fc5d44d0b5d 21-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Mangling of undeduced 'auto' types, as specified by Itanium C++ ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126140 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
483b9f3bc05c5409e2c6643f1c9d91e21c8ff9d2 21-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Tweaks to C++0x deduced auto type support:
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
* Temporary template parameter list for auto deduction is now allocated on the stack.
* Deduced 'auto' types are now uniqued.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126139 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2882eca5a184c78f793188083f6ce539740a5cf2 21-Feb-2011 John McCall <rjmccall@apple.com> Pseudo-revirtualize CallExpr::getSourceRange by making it follow the
logic from CXXMemberCallExpr and by making it check for
CXXOperatorCallExpr in order to defer. This is not really an awesome solution,
but I don't have a better idea.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126114 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
34b41d939a1328f484511c6002ba2456db879a29 20-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement the C++0x deduced 'auto' feature.

This fixes PR 8738, 9060 and 9132.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126069 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypeLoc.cpp
ypePrinter.cpp
9ed9a250180f19b2c44df83a196fc3a2ac82f817 20-Feb-2011 Ken Dyck <kd@kendyck.com> Expand use of CharUnits in LayoutField(). No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126066 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
bee5a79fc95e3003d755031e3d2bb4410a71e1c1 20-Feb-2011 Ken Dyck <kd@kendyck.com> Add const qualifier to getTypeInfoInChars().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126064 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c1de52de64725945e5ae87e6f99ddedf161856e5 19-Feb-2011 Chris Lattner <sabre@nondot.org> Fix PR9253, allowing attribute(aligned) to reduce the alignment of
a typedef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126059 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3263e09c8e0925edaa541d0d4bb995b4bfb454e7 19-Feb-2011 Ken Dyck <kd@kendyck.com> Expand use of CharUnits for alignments further. No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126034 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
da2142f2e2b3a02ee6eb5de9f9e6ed6f7eb5a0c0 19-Feb-2011 Douglas Gregor <dgregor@apple.com> Revert all of my commits that devirtualized the Decl hierarchy, which
lead to a serious slowdown (4%) on parsing of Cocoa.h. This memory
optimization should be revisited later, when we have time to look at
the generated code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126033 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclTemplate.cpp
15e310a3b970b64a84cb30f0005bc396b4d978cb 19-Feb-2011 John McCall <rjmccall@apple.com> Warn about code that uses variables and functions with internal linkage
without defining them. This should be an error, but I'm paranoid about
"uses" that end up not actually requiring a definition. I'll revisit later.

Also, teach IR generation to not set internal linkage on variable
declarations, just for safety's sake. Doing so produces an invalid module
if the variable is not ultimately defined.

Also, fix several places in the test suite where we were using internal
functions without definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126016 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
781701c3d34740c53ad912ad007383ae2951c637 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Improve bool and char integral template argument printing in
diagnostics, resolving PR9227.

Patch originally by Mihai Rusu and Stephen Hines with some minimal style
tweaks from me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125999 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
82214a80c0163e01e4d8dec1426023c89277dbb4 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Initial steps to improve diagnostics when there is a NULL and
a non-pointer on the two sides of a conditional expression.

Patch by Stephen Hines and Mihai Rusu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125995 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
813d8346529bf094eb2b249648906ba7fd226688 18-Feb-2011 Douglas Gregor <dgregor@apple.com> Selector::getIdentifierInfoForSlot() can return NULL values, a fact
that was ignored in a few places (most notably, code
completion). Introduce Selector::getNameForSlot() for the common case
where we only care about the name. Audit all uses of
getIdentifierInfoForSlot(), switching many over to getNameForSlot(),
fixing a few crashers.

Fixed <rdar://problem/8939352>, a code-completion crasher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125977 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
tmtPrinter.cpp
4ae493cccbfbf122ec6ebac0e330232c22fa8489 18-Feb-2011 Chris Lattner <sabre@nondot.org> implement basic support for __label__. I wouldn't be shocked if there are
bugs from other clients that don't expect to see a LabelDecl in a DeclStmt,
but if so they should be easy to fix.

This implements most of PR3429 and rdar://8287027



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125817 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
57ad37823e198f977cac605dbfbaefb4daf325e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125771 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
f91d08712514fca6b1e66abf51a13f2d7041bb05 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Remove the last virtual member function from the Decl hierarchy,
reducing the size of all declarations by one pointer. For a 64-bit
Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of
ASTContext's memory usage for this header).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125756 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
2ae442a8a0974aee1da389a69857a4b6f2823c1a 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize TagDecl::completeDefinition().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125755 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
afdfdc05fe8b2442713f0150a5985a9c6d852cee 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125754 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
ebe5a9bcc51bff434f38d94748b08e9160609ed9 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize NamedDecl::getNameForDiagnostic().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125751 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
9e6f2a8d70c3027e99c354edd9d31a37c102f30a 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize RedeclarableTemplateDecl::newCommon().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125750 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
56ca35d396d8692c384c785f9aeebcf22563fe1e 17-Feb-2011 John McCall <rjmccall@apple.com> Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125744 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
4c3e0ee8e6208eb42c4adb78a7d35b641fd85ae9 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize Decl::getNextRedeclaration().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125740 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8755836379a3f8e9848b5e770aa60d00e1fbb990 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Simple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight machinery and indirection that we don't need

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125737 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
770877fa855d1de462392e503ef08252614b0994 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize Decl::getSourceRange()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125736 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0eccdcac47f0ee1d2081244ca714088779b09b98 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize Decl::getCanonicalDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125735 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
tmt.cpp
tmtProfile.cpp
1aa3d81c6e63959ef149489eca42b1520c521af4 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Devirtualize Decl::getBody() and Decl::hasBody().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125731 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f4a03cc2b022fab0ffac6c65449555c52036dece 17-Feb-2011 Douglas Gregor <dgregor@apple.com> De-virtualize Decl::isOutOfLine().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125730 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
c6daf0b29d6c48a99cb1ad707973a7e6dfcafd58 17-Feb-2011 Douglas Gregor <dgregor@apple.com> When printing a qualified type, look through a substituted template
parameter type to see what's behind it, so that we don't end up
printing silly things like "float const *" when "const float *" would
make more sense. Also, replace the pile of "isa" tests with a simple
switch enumerating all of the cases, making a few more obvious cases
use prefix qualifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125729 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
834945c19cfb87fc21dfb6980a0980618655d79d 17-Feb-2011 Ken Dyck <kd@kendyck.com> Convert MaxFieldAlignment to CharUnits from bits. No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125704 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e996ffd240f20a1048179d7727a6ee3227261921 16-Feb-2011 John McCall <rjmccall@apple.com> Save a copy expression for non-trivial copy constructions of catch variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125661 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6feb4bb3defce7e5efc05a69c6bd7dfc9c59fa45 16-Feb-2011 Ken Dyck <kd@kendyck.com> Convert the UnpackedAlignment field to CharUnits from bits. No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125643 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ea7f6c2c53127b875ed432fd1793d48270d8ba6b 16-Feb-2011 Ken Dyck <kd@kendyck.com> Convert Alignment member to CharUnits from bits. No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125641 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a1fdb0bc09aa0d17841cdbdd8c52cd1368251cbf 16-Feb-2011 Ken Dyck <kd@kendyck.com> Convert NonVirtualSize to CharUnits from bits. No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125639 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
df205382dae666b011d857402114e4f4acd56c81 16-Feb-2011 Ken Dyck <kd@kendyck.com> Convert NonVirtualAlignment to CharUnits. No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125638 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4e274e955451632e6ba287bb03fb7a7840c3505e 15-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Add a hack to avoid adding '\01' to asm names when possible. It would be
better for clang to always compute the right name, but for now this hack
fixes PR9177 and lets us build firefox with LTO :-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125607 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
dac54c124e302d6f028ea5723c425b7f66fc7c71 15-Feb-2011 Ken Dyck <kd@kendyck.com> Convert RecordLayout::Alignment to CharUnits from bit units. No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125549 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
7502c1d3ce8bb97bcc4f7bebef507040bd93b26f 13-Feb-2011 John McCall <rjmccall@apple.com> Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
arentMap.cpp
tmtDumper.cpp
tmtProfile.cpp
0d70d71ccbc4f7f59cadb759f61b7172a149676c 13-Feb-2011 John McCall <rjmccall@apple.com> Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic. Fixes PR 9197.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125447 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f4e532b5a1683a9f6c842f361c7415bf3474315f 12-Feb-2011 Ted Kremenek <kremenek@apple.com> Don't emit a dead store for '++' operations unless it occurs with a return statement. We've never seen any other cases that were real bugs.

Fixes <rdar://problem/6962292>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125419 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
0a86d44703fc5cd3cd38ea1708176f5b44321ed8 12-Feb-2011 Jeffrey Yasskin <jyasskin@google.com> Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.

I also sorted the tools/driver dependencies since their order no
longer matters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125417 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
d263fd1451299b1e5f5f1acb2bb13b0a4119aee8 11-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a block sema bug where result type of initializer
is unqualified but its initialized is qualified.
This is for c only and fixes the imm. problem.
c++ is more involved and is wip.
// rdar://8979379


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125386 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f0be979bddb8baa28e77693a3dc931e487b2a9f2 11-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> For consistency, use llvm::raw_ostream in the rest of the mangle api.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125360 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
angle.cpp
icrosoftMangle.cpp
ec2990351335f163601b98e39b52425e2e9f931e 11-Feb-2011 Ken Dyck <kd@kendyck.com> Convert RecordLayout::DataSize to CharUnits from bits, eliminating two
unnecessary calls to RoundUpToAlignment. No changes to functionality
intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125356 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
dd76a9ab9ea675671200f94b18ce95766841952b 11-Feb-2011 Ken Dyck <kd@kendyck.com> Add a helper function, ASTContext::toBits(), that converts sizes in
CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125332 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
0e376a0ca8372c9e809d08a9db2fae98394878b8 11-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Use raw_ostream instead of raw_svector_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125330 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
angle.cpp
icrosoftMangle.cpp
c4850c2aa4c281a352e228aafc51fb1e30dcad02 11-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Use raw_svector_ostream in more places in the mangler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125321 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
angle.cpp
icrosoftMangle.cpp
886e1606c28e970bb288abf4dbc40feb16822a79 10-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> CMake: LLVM_NO_RTTI must be obsolete now!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125275 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
af8ca37a7fa45bff84831706c6d85f9e5b4e1d15 10-Feb-2011 John McCall <rjmccall@apple.com> Move the check that gives functions with unique-external types unique-external
linkage into Decl.cpp. Disable this logic for extern "C" functions, because
the operative rule there is weaker. Fixes rdar://problem/8898466



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125268 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
e08ce650a2b02410eddd1f60a4aa6b3d4be71e73 09-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125217 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
14b6ba77710d6431794d65c7d58c6f29c3dc956e 09-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> AST, Sema, Serialization: keep track of cudaConfigureCall

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125216 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
086eb9f93eadbc63a12770e3457dfe2c6d8f7c30 09-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Non-void functions need to return some value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125185 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f8c7fdbfc6854a11f0823dd11514af5a8d759aff 09-Feb-2011 John McCall <rjmccall@apple.com> Give these little helper functions definitions so that newer gccs stop
complaining.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125184 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
63c00d7f35fa060c0a446c9df3a4402d9c7757fe 09-Feb-2011 John McCall <rjmccall@apple.com> Remove vtables from the Stmt hierarchy; this was pretty easy as
there were only three virtual methods of any significance.

The primary way to grab child iterators now is with
Stmt::child_range children();
Stmt::const_child_range children() const;
where a child_range is just a std::pair of iterators suitable for
being llvm::tie'd to some locals. I've left the old child_begin()
and child_end() accessors in place, but it's probably a substantial
penalty to grab the iterators individually now, since the
switch-based dispatch is kindof inherently slower than vtable
dispatch. Grabbing them together is probably a slight win over the
status quo, although of course we could've achieved that with vtables, too.

I also reclassified SwitchCase (correctly) as an abstract Stmt
class, which (as the first such class that wasn't an Expr subclass)
required some fiddling in a few places.

There are somewhat gross metaprogramming hooks in place to ensure
that new statements/expressions continue to implement
getSourceRange() and children(). I had to work around a recent clang
bug; dgregor actually fixed it already, but I didn't want to
introduce a selfhosting dependency on ToT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125183 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmt.cpp
tmtPrinter.cpp
5f022d82696c84e4d127c558871d68ac6273274e 09-Feb-2011 Ken Dyck <kd@kendyck.com> Convert RecordLayout::Size to CharUnits from bits. No changes to
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125156 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
76a40219ee5624d78aba167dce02bdbaa930955f 09-Feb-2011 John McCall <rjmccall@apple.com> NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.

Also, reorganize and make very explicit the logic for determining
the value kind and type of a referenced declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125150 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
cc324ad80ab940efca006b0064f7ca70a6181816 08-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> AST: support for pre-arg expressions on CallExpr subclasses

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125115 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d64e237f2099b23237d0ed4dd077a286c263e007 08-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> StmtPrinter: factor out arg printing code to PrintCallArgs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125114 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
f76b092e1a6f0df4a5c64aae3c71d6e81e4b717c 08-Feb-2011 John McCall <rjmccall@apple.com> Clear the linkage cache recursively. Fixes PR8926.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125104 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
68cf1a5a01ba43ed56a8624632fd65e0804430ac 08-Feb-2011 Ken Dyck <kd@kendyck.com> Convert RecordLayout::NonVirtualAlign to CharUnits. No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125069 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
6b5a61b6dc400027fd793dcadceeb9da944a37ea 07-Feb-2011 John McCall <rjmccall@apple.com> A few more tweaks to the blocks AST representation:
- BlockDeclRefExprs always store VarDecls
- BDREs no longer store copy expressions
- BlockDecls now store a list of captured variables, information about
how they're captured, and a copy expression if necessary

With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.

Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125005 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
xpr.cpp
tmtDumper.cpp
tmtProfile.cpp
f677ea3cc9598d9952ad7ffab5fb322ba4c5be31 05-Feb-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Basic implementation of inherited constructors. Only generates declarations, and probably only works for very basic use cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124970 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
def0354384d9c4431f7b58b664b59896d4623028 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Implement proper (de-)serialization for explicit template argument
lists with zero template arguments. Fixes some seriously scary
crashers in C++ PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124862 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
adf082e829eb71871b6043009888df3b79055dba 02-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> For gcc compatibility, size of a class which is zero
but has non-empty data fields, such as array of zero length,
remains zero.
// rdar://8945175


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124741 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
469a1eb996e1cb0be54f9b210f836afbddcbb2cc 02-Feb-2011 John McCall <rjmccall@apple.com> An insomniac stab at making block declarations list the variables they close
on, as well as more reliably limiting invalid references to locals from
nested scopes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124721 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprConstant.cpp
6f75550e40a9177db9979fc130ce3ece026b137d 01-Feb-2011 Douglas Gregor <dgregor@apple.com> Basic support for -mms-bitfields, from Carl Norum!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124661 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5c3633fa57f27b0909ab5767715c4e66b8920165 01-Feb-2011 Ken Dyck <kd@kendyck.com> Convert RecordLayout::NonVirtualSize from bit units to CharUnits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124646 91177308-0d34-0410-b5e6-96231b3b80d8
taniumCXXABI.cpp
icrosoftCXXABI.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
d89d30fdd9e3061fb100fb8f976aab5c6cf2c901 28-Jan-2011 John McCall <rjmccall@apple.com> Fix some corner cases in the __is_base_of logic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124505 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
b608b987718c6d841115464f79ab2d1820a63e17 28-Jan-2011 Douglas Gregor <dgregor@apple.com> Give OpaqueValueExpr a source location, because its source location
might be queried in places where we absolutely require a valid
location (e.g., for template instantiation). Fixes some major
brokenness in the use of __is_convertible_to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124465 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9f3611365d0f2297a910cf246e056708726ed10a 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the Microsoft __is_convertible_to type trait, modeling the
semantics after the C++0x is_convertible type trait. This
implementation is not 100% complete, because it allows access errors
to be hard errors (rather than just evaluating false).

Original patch by Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124425 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
63e7d25d2e6036616b42f744fd4a39cd5f911960 27-Jan-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed parameter names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124408 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6ec278d1a354517e20f13a877481453ee7940c78 27-Jan-2011 John McCall <rjmccall@apple.com> Do a proper recursive lookup when deciding whether a class's usual
deallocation function has a two-argument form. Store the result of this
check in new[] and delete[] nodes.

Fixes rdar://problem/8913519



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124373 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f2eca2cf302c50b79891f24b3861d64ea9263831 27-Jan-2011 John McCall <rjmccall@apple.com> Import three interesting bits that apply only to C++ methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124349 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b47f74818094fabd8f150fb4d6d0fa8a6c52cde1 26-Jan-2011 John McCall <rjmccall@apple.com> When mangling a qualified array type, push the qualifiers down to the
element type. Fixes rdar://problem/8913416.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124315 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
0a9a6d68979619a621fedc5089674487f720f765 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this: add name mangling for ref-qualifiers,
using rules that I just made up this morning. This encoding has now
been proposed to the Itanium C++ ABI group for inclusion, but of
course it's still possible that the mangling will change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124296 91177308-0d34-0410-b5e6-96231b3b80d8
taniumMangle.cpp
c938c1668b4fd12af154e965dd935a89e4801a70 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this:

- Add ref-qualifiers to the type system; they are part of the
canonical type. Print & profile ref-qualifiers
- Translate the ref-qualifier from the Declarator chunk for
functions to the function type.
- Diagnose mis-uses of ref-qualifiers w.r.t. static member
functions, free functions, constructors, destructors, etc.
- Add serialization and deserialization of ref-qualifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124281 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
7c7f820d70c925b29290a8563b59615816a827fc 26-Jan-2011 Ken Dyck <kd@kendyck.com> Use RecordLayout::getBaseClassOffset() where CharUnits are needed instead of
converting getBaseClassOffsetInBits() to CharUnits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124274 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c21c7e9c2cded68f91be15be6847c9649242dc17 25-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach TemplateSpecializationTypeLoc::initializeArgLocs() to actually
generate meaningful [*] template argument location information.

[*] Well, as meaningful as possible, given that this entire code path
is a hack for when we've lost type-source information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124211 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypeLoc.cpp
ee8a6cafe8b69c316dd4fa5f6ea4838ffe15621c 25-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In a ObjCMessageExpr with the super class as receiver, 'super' is actually a ObjCInterfaceType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124158 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d0fb3adeed631385a53d15ced60d67c5f64eb133 24-Jan-2011 Douglas Gregor <dgregor@apple.com> Improve the printing of C++ construction expressions, from Yuri Gribov!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124123 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
cb88a1f968c3d4eb451dafb421a8d9578edcbf1a 24-Jan-2011 Anders Carlsson <andersca@mac.com> Use attributes for all the override control specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124122 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
274f83c2ece9041a1994fc3eacfe812ca86095e8 24-Jan-2011 Axel Naumann <Axel.Naumann@cern.ch> Check whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before accessing it, both for consistency (see StmtPrinter::VisitDeclRefExpr()) and for other use cases of dependent types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124119 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ff3a5174d1f6e7dc98de348aecfdfe1d2fb7cd53 24-Jan-2011 Ken Dyck <kd@kendyck.com> Remove private toCharUnits() helper method, replacing with calls to
ASTContext::toCharUnitsFromBits().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124092 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b76cc4d4445fd9e5b29722407ce870e3f5a64cca 22-Jan-2011 Anders Carlsson <andersca@mac.com> Add final/explicit getters and setters to CXXRecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124037 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cc15f010672a13b38104a32e3cefc7adc07ffbf7 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123992 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
69d831645f429d3b806d2ae220aee45ca44f8c6c 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Add some tests for reference-collapsing and referencing binding
involving rvalue references, to start scoping out what is and what
isn't implemented. In the process, tweak some standards citations,
type desugaring, and teach the tentative parser about && in
ptr-operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123913 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
ba4f5d5754c8291690d01ca9581926673d69b24c 20-Jan-2011 John McCall <rjmccall@apple.com> Fix the computation of alignment for fields of packed+aligned structs.
Part of the fix for PR8413.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123904 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
xprConstant.cpp
d967e31ee796efff24b84b704a063634f6b55627 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Refactor the dependence computation for DeclRefExpr so that we can
reuse it for BlockDeclRefExpr. Do so, fixing the dependence calculate
for BlockDeclRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123851 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a779d9ca2fdf1247f65de0e6acf2870d8be53ccd 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement basic support for the use of variadic templates and blocks
together. In particular:
- Handle the use of captured parameter pack names within blocks
(BlockDeclRefExpr understands parameter packs now)
- Handle the declaration and expansion of parameter packs within a block's
parameter list, e.g., ^(Args ...args) { ... })
- Handle instantiation of blocks where the return type was not
explicitly specified. (unrelated, but necessary for my tests).

Together, these fixes should make blocks and variadic templates work
reasonably well together. Note that BlockDeclRefExpr is still broken
w.r.t. its computation of type and value dependence, which will still
cause problems for blocks in templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123849 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6952f1e4256c5b43aee5e98cea4e9b663bd1d413 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for non-type template parameter packs whose type is
a pack expansion, e.g., the parameter pack Values in:

template<typename ...Types>
struct Outer {
template<Types ...Values>
struct Inner;
};

This new implementation approach introduces the notion of an
"expanded" non-type template parameter pack, for which we have already
expanded the types of the parameter pack (to, say, "int*, float*",
for Outer<int*, float*>) but have not yet expanded the values. Aside
from creating these expanded non-type template parameter packs, this
patch updates template argument checking and non-type template
parameter pack instantiation to make use of the appropriate types in
the parameter pack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123845 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
3b6575108a5b6d8b92ac3a9a7794bf6c3a210907 19-Jan-2011 John McCall <rjmccall@apple.com> Change the canonical representation of array types to store qualifiers on the
outermost array types and not on the element type. Move the CanonicalType
member from Type to ExtQualsTypeCommonBase; the canonical type on an ExtQuals
node includes the qualifiers on the ExtQuals. Assorted optimizations enabled
by this change.

getQualifiers(), hasQualifiers(), etc. should all now implicitly look through
array types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123817 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f4c7371fb1d3cebcfb40abad4537bb82515704ea 19-Jan-2011 John McCall <rjmccall@apple.com> Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
umpXML.cpp
xpr.cpp
xprCXX.cpp
taniumMangle.cpp
icrosoftMangle.cpp
estedNameSpecifier.cpp
tmtIterator.cpp
150e0efec6302fa5a8c3b5c3c4ecf5778d3a29f5 19-Jan-2011 Logan <tzuhsiang.chien@gmail.com> Add build rules for clang executable.
ndroid.mk
ce8890371fcdb983ae487c87fa40606a34896ff7 18-Jan-2011 John McCall <rjmccall@apple.com> Fix some unnecessarily complicated code for canonicalizing variably-modified
parameter types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123753 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
62c28c831bbf207cc36e683e7c321fc33bf8928c 18-Jan-2011 John McCall <rjmccall@apple.com> Generalize some operations on qualifiers. QualType::getQualifiers() and
::getCVRQualifiers() now look through array types, like all the other
standard queries. Also, make a 'split' variant of getUnqualifiedType().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123751 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
d8868a634d4fd362243dc646e58c3cf956c81dcd 18-Jan-2011 Douglas Gregor <dgregor@apple.com> Introduce the notion of a "minimal" import of ASTs, to better support LLDB.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123723 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
fb1e3bc29b667f4275e1d5a43d64ec173f4f9a7d 18-Jan-2011 Ken Dyck <ken.dyck@onsemi.com> Replace calls to CharUnits::fromQuantity() with ones
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123715 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ecordLayoutBuilder.cpp
7c4a4a07b28cc529f63f2c20ddffbc02190e4f27 15-Jan-2011 Michael J. Spencer <bigcheesegs@gmail.com> AST/InheritViz: Remove all internal uses of PathV1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123553 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
eb6f5dc86531f794ba7746a2da4d28e37cf5da7e 15-Jan-2011 Ken Dyck <ken.dyck@onsemi.com> Add toCharUnitsInBits() to simplify the many calls to CharUnits::fromQuantity() of the form CharUnits::fromQuantity(bitSize, Context.getCharWidth()).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123542 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1aee05d08b2184acadeb36de300e216390780d6c 15-Jan-2011 Douglas Gregor <dgregor@apple.com> Introduce a new kind of TemplateName that captures a substituted
template template parameter pack that cannot be fully expanded because
its enclosing pack expansion could not be expanded. This form of
TemplateName plays the same role as SubstTemplateTypeParmPackType and
SubstNonTypeTemplateParmPackExpr do for template type parameter packs
and non-type template parameter packs, respectively.

We should now handle these multi-level pack expansion substitutions
anywhere. The largest remaining gap in our variadic-templates support
is that we cannot cope with non-type template parameter packs whose
type is a pack expansion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123521 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
taniumMangle.cpp
emplateName.cpp
c7793c73ba8a343de3f2552d984851985a46f159 15-Jan-2011 Douglas Gregor <dgregor@apple.com> Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,
that captures the substitution of a non-type template argument pack
for a non-type template parameter pack within a pack expansion that
cannot be fully expanded. This follows the approach taken by
SubstTemplateTypeParmPackType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123506 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
taniumMangle.cpp
tmtPrinter.cpp
tmtProfile.cpp
2be29f423acad3bbe39099a78db2805acb5bdf17 15-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach template template argument pack expansions to keep track of the
number of expansions, when we know it, and propagate that information
through Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123493 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclTemplate.cpp
emplateBase.cpp
67fd1251aad51bb80d050b7fa5e506fef0ec8e02 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach PackExpansionExpr to keep track of the number of pack expansions
it will expand to, if known. Propagate this information throughout Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123470 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
emplateBase.cpp
cded4f649cd4b7ba7d461c25c6482ef52b8d3a2a 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out
parameter pack. This allows us to properly handle substitution into
pack expansions that involve multiple parameter packs at different
template parameter levels, even when this substitution happens one
level at a time (as with partial specializations of member class
templates and the signatures of member function templates).

Note that the diagnostic we provide when there is an arity mismatch
between an outer parameter pack and an inner parameter pack in this
case isn't as clear as the normal diagnostic for an arity
mismatch. However, this doesn't matter because these cases are very,
very rare and (even then) only typically occur in a SFINAE context.

The other kinds of pack expansions (expression, template, etc.) still
need to support optional tracking of the number of expansions, and we
need the moral equivalent of SubstTemplateTypeParmPackType for
substituted argument packs of template template and non-type template
parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123448 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
emplateBase.cpp
0bc15d92bf98cd01e7904d7fca9895dacc237618 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Fix a few warnings stemming from my inability to properly fill out
switch() statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123429 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c3069d618f4661d923cb1b5c4525b082fce73b04 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Start implementing support for substitution into pack expansions that
involve template parameter packs at multiple template levels that
occur within the signatures members of class templates (and partial
specializations thereof). This is a work-in-progress that is deficient
in several ways, notably:
- It only works for template type parameter packs, but we need to
also support non-type template parameter packs and template template
parameter packs.
- It doesn't keep track of the lengths of the substituted argument
packs in the expansion, so it can't properly diagnose length
mismatches.

However, this is a concrete step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123425 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
taniumMangle.cpp
icrosoftMangle.cpp
ype.cpp
ypePrinter.cpp
4e26caa0365347eb63d483df29cdf86ca084510c 14-Jan-2011 Ken Dyck <ken.dyck@onsemi.com> Replace a literal '8' with getCharWidth().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123421 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
14110477887e3dc168ffc6c191e72d705051f99e 13-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Move name mangling support from CodeGen to AST. In the
process, perform a number of refactorings:

- Move MiscNameMangler member functions to MangleContext
- Remove GlobalDecl dependency from MangleContext
- Make MangleContext abstract and move Itanium/Microsoft functionality
to their own classes/files
- Implement ASTContext::createMangleContext and have CodeGen use it

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123386 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
taniumMangle.cpp
angle.cpp
icrosoftMangle.cpp
1d5d0b9df6d2a3df338bc3e63000536406e7666c 12-Jan-2011 Douglas Gregor <dgregor@apple.com> Add the location of the right parenthesis of a C++ named cast
(static_cast, dynamic_cast, reinterpret_cast, or const_cast) to
improve source-location information. Fixes PR8960.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123336 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4ba2a17694148e16eaa8d3917f657ffcd3667be4 12-Jan-2011 Jay Foad <jay.foad@gmail.com> PR3558: mark "logically const" accessor methods in ASTContext as const,
and mark the fields they use as mutable. This allows us to remove a few
const_casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
estedNameSpecifier.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
ae278a3a57595349a411f6474938d4dd1b263a0e 12-Jan-2011 John McCall <rjmccall@apple.com> Slight bugfix to the attribute-distribution logic for GC attributes.
Slight optimization of getObjCGCAttrKind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123295 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
203e6a322ae29d577acafcb1572a57ec16e1e730 12-Jan-2011 Douglas Gregor <dgregor@apple.com> Add TemplateArgument::CreatePackCopy() to create a new parameter pack
in ASTContext-allocated memory, copying the provided template
arguments. Use this new routine where we can. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123289 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
emplateBase.cpp
7d5c0c1273bdc1cb3dff1cb5a62d07b1439e82c7 11-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the last bullet of [temp.deduct.type]p5 and part of the last
sentence of [temp.deduct.call]p1, both of which concern the
non-deducibility of parameter packs not at the end of a
parameter-type-list. The latter isn't fully implemented yet; see the
new FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123210 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
8dbfbf4c95251c69a455d4d016d6c7890c932007 10-Jan-2011 Bob Wilson <bob.wilson@apple.com> Fix a comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123184 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b5bc7d04447026252b5181537ab4edcfdbeb3587 09-Jan-2011 Francois Pichet <pichet2000@gmail.com> Don't crash if SpecString is an empty string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123134 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
f51d0b6c2f5abd09d3a7ba907a3d9b7a43752f3d 09-Jan-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Rename CXXCtorInitializer::BaseOrMember to Initializee, since it will also be
used to store the CXXConstructorDecl in a delegating constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123095 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cbb67480094b3bcb5b715acd827cbad55e2a204c 08-Jan-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
more accurate, and makes it make sense for it to hold a delegating constructor
call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123084 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
umpXML.cpp
170464b7c0a2c0c86f2821f14a46f0d540cb5e94 07-Jan-2011 Francois Pichet <pichet2000@gmail.com> Prefix all attribute enumerators with attr_ for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122992 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
3cd47e7883dbfce73189b583850cea81e1d1d261 07-Jan-2011 Francois Pichet <pichet2000@gmail.com> Do not use cdecl, fastcall, stdcall etc.. as identifier name. They are reserved keywords at least on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122991 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
f5c65ffbd7374b6c8d9f1e361041578640cab320 06-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement template argument deduction from a call to a function
template whose last parameter is a parameter pack. This allows us to
form a call to, e.g.,

template<typename ...Args1, typename ...Args2>
void f(std::pair<Args1, Args2> ...pairs);

given zero or more instances of "pair".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122973 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
9d156a7b1b2771e191f2f5a45a7b7a694129463b 06-Jan-2011 John McCall <rjmccall@apple.com> Introduce an AttributedType, but don't actually use it anywhere yet.
The initial TreeTransform is a cop-out, but it's more-or-less equivalent
to what we were doing before, or rather what we're doing now and might
eventually stop doing in favor of using this type.
I am simultaneously intrigued by the possibilities of rebuilding a
dependent Attri



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122942 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ypeLoc.cpp
ypePrinter.cpp
b0ddf3aeb2f119cac42468b029584e8839b354cc 06-Jan-2011 Douglas Gregor <dgregor@apple.com> When default-initializing a TemplateArgumentLocInfo, make sure that we
initialize *all* of the bits to zero. Also, when the pattern of a
template argument pack expansion, make sure to set the ellipsis
location along all paths.

This should clear up the valgrind failure that popped up in Clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122931 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
1fe85ea697fb5c85acded3ac0ddbc19f89c2e181 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Add Decl::isParameterPack(), which covers both function and template
parameter packs, along with ParmVarDecl::isParameterPack(), which
looks for function parameter packs. Use these routines to fix some
obvious FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122904 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
xpr.cpp
a7fc901a2e39bfe55bfcff5934b2d9fdf9656491 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Replace the representation of template template argument pack
expansions with something that is easier to use correctly: a new
template argment kind, rather than a bit on an existing kind. Update
all of the switch statements that deal with template arguments, fixing
a few latent bugs in the process. I"m happy with this representation,
now.

And, oh look! Template instantiation and deduction work for template
template argument pack expansions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122896 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
umpXML.cpp
tmtProfile.cpp
emplateBase.cpp
ba68eca7582a62e3e2ff4b0eba1b2b73a6b80895 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Add semantic analysis for the creation of and an AST representation
for template template argument pack expansions. This allows fun such
as:

template<template<class> class ...> struct apply_impl { /*...*/ };
template<template<class> class ...Metafunctions> struct apply {
typedef typename apply_impl<Metafunctions...>::type type;
};

However, neither template argument deduction nor template
instantiation is implemented for template template argument packs, so
this functionality isn't useful yet.

I'll probably replace the encoding of template template
argument pack expansions in TemplateArgument so that it's harder to
accidentally forget about the expansion. However, this is a step in
the right general direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122890 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
emplateBase.cpp
61c4d28e36cd3f1be392cb77f07436d1fa6b0f9f 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for template template parameter packs, e.g.,

template<template<class> class ...Metafunctions>
struct apply_to_each;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122874 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclBase.cpp
eclPrinter.cpp
eclTemplate.cpp
tmtProfile.cpp
711c52bb20d0c69063b52a99826fb7d2835501f1 05-Jan-2011 John McCall <rjmccall@apple.com> Refactor the application of type attributes so that attributes from
the declaration-specifiers and on the declarator itself are moved
to the appropriate declarator chunk. This permits a greatly
simplified model for how to apply these attributes, as well as
allowing a much more efficient query for the GC attribute.
Now all qualifier queries follow the same basic strategy of
"local qualifiers, local qualifiers on the canonical type,
then look through arrays". This can be easily optimized by
changing the canonical qualified-array-type representation.

Do not process type attributes as decl attributes on declarations
with declarators.

When computing the type of a block, synthesize a prototype
function declarator chunk if the decl-spec type was not a
function. This simplifies the logic for building block signatures.

Change the logic which inserts an objc_read_weak on a block
literal to only fire if the block has a __weak __block variable,
rather than if the return type of the block is __weak qualified,
which is not actually a sensible thing to ask.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122871 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
ee8aff06f6a96214731de17b2cb6df407c6c1820 04-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the sizeof...(pack) expression to compute the length of a
parameter pack.

Note that we're missing proper libclang support for the new
SizeOfPackExpr expression node.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122813 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
b95cc97b2023d00cd3fbae8455bc9d728eab5e5d 04-Jan-2011 Douglas Gregor <dgregor@apple.com> When creating the injected-class-name for a class template involving a
non-type template parameter pack, make sure to create a pack expansion
for the corresponding template argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122799 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
3fb9e4b89f72823f162096086f0f964e6dcf66d6 04-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement pack expansion of base initializers, so that we can
initialize those lovely mixins that come from pack expansions of base
specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122793 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f90b27ad077c3339b62befc892382845339f9490 03-Jan-2011 Douglas Gregor <dgregor@apple.com> 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
STImporter.cpp
eclCXX.cpp
aa165f8458b51c546bebff947343e1a36f3594cb 03-Jan-2011 Douglas Gregor <dgregor@apple.com> Refactor the tree transform's many loops over sets of expressions
(transforming each in turn) into calls into one central routine
(TransformExprs) that transforms a list of expressions. This
refactoring is preparatory work for pack expansions whose in an
expression-list.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122761 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
be230c36e32142cbdcdbe9c97511d097beeecbab 03-Jan-2011 Douglas Gregor <dgregor@apple.com> 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
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
emplateBase.cpp
5389f48b24937ad7b4093307128b3cbf25235654 30-Dec-2010 David Chisnall <csdavec@swan.ac.uk> Expose Objective-C type encodings of declarations to libclang users. This also adds a method in ASTContext which encodes FunctionDecls using the same encoding format that is used for Objective-C methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122639 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
272324bc881450a71873d2f4e72f17837d8998df 30-Dec-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR8796.

The problem was that we were asserting the we never added an empty class
to the same offset twice. This is not true for unions, where two members, empty
or not, can have the some offset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122633 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c7ff82c2040f45eaad2eddea0e4461dddc972cd1 26-Dec-2010 David Chisnall <csdavec@swan.ac.uk> Fix for PR8695.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122564 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3f59c975aa5d047f7edd1b900b5e885c38af0ef7 26-Dec-2010 Chris Lattner <sabre@nondot.org> 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
STContext.cpp
STImporter.cpp
ype.cpp
ypeLoc.cpp
7f040a9d817cd1c72b565e92abff473510bf9e1d 24-Dec-2010 John McCall <rjmccall@apple.com> Refactor how we collect attributes during parsing, and add slots for attributes
on array and function declarators. This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122535 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
56bc9832bc8f80604bfddc2c93f81537df6930a1 24-Dec-2010 Douglas Gregor <dgregor@apple.com> When instantiating a non-type template parameter pack, be sure to
extract the appropriate argument from the argument pack (based on the
current substitution index, of course). Simple instantiation of pack
expansions involving non-type template parameter packs now works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122532 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtProfile.cpp
10738d36b150aa65206890c1c845cdba076e4200 24-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
STContext.cpp
STImporter.cpp
eclBase.cpp
eclTemplate.cpp
xpr.cpp
b7d09d627c8576b9bc85f44f05befdd44fedc7ed 23-Dec-2010 Douglas Gregor <dgregor@apple.com> When forming the injected-class-name of a variadic template, the
template argument corresponding to a template parameter pack is an
argument pack of a pack expansion of that template parameter
pack. Implements C++0x [temp.dep.type]p2 (at least, as much of it as
we can).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122498 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
c6ed729f669044f5072a49d79041f455d971ece3 23-Dec-2010 Jeffrey Yasskin <jyasskin@google.com> Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations. Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122459 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
e02e26293cf8e3bad1059b39cea75c6582896da6 22-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement template argument deduction for pack expansions whose
pattern is a template argument, which involves repeatedly deducing
template arguments using the pattern of the pack expansion, then
bundling the resulting deductions into an argument pack.

We can now handle a variety of simple list-handling metaprograms using
variadic templates. See, e.g., the new "count" metaprogram.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122439 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
99130e5a02e93282cb393d2cba0d3dffc10abc01 22-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Complain on missing property getter method only
if property-dot expression is decidedly
an rvalue. // rdar://8155806.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122430 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
a0e27f00158c9306d53b0003b94182e415380ea9 22-Dec-2010 Francois Pichet <pichet2000@gmail.com> Redesign the way anonymous fields are handled in designated-initializers.
Previously designated anonymous fields were found via name lookup. This redesign uses the fact that an IndirectFieldDecl declaration will always follow an anonymous implicit field to remove the special case of name lookup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122387 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
03491de7b48e05f07731770c3fb51f02bc058079 21-Dec-2010 Douglas Gregor <dgregor@apple.com> Add a hack to work around the lack of proper type-source info in a pack expansion TypeLoc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122367 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
2fcbceff97e065cff499e6cc563ca25c762bf547 21-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement BlockDecl::getSourceRange(). The bogus source-range
information caused token-annotation to fail in funny ways. Fixes
<rdar://problem/8595386>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122338 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
00ccbefcffeb88ea3e2e6323e594fa968753ad14 21-Dec-2010 John McCall <rjmccall@apple.com> Fix the noreturn conversion to only strip off a single level of indirection.
Apply the noreturn attribute while creating a builtin function's type.
Remove the getNoReturnType() API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122295 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
dace95b13e2ceb0c3ec8de6babd926dc5114e1e5 20-Dec-2010 Douglas Gregor <dgregor@apple.com> Clean up the printing of template argument packs; previously, we were
getting extra "<>" delimiters around template argument packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122280 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
8491ffe86c50241b47c6d7ef8cd9ee00f5e675da 20-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for template instantiation of pack expansions
whose patterns are template arguments. We can now instantiate, e.g.,

typedef tuple<pair<OuterTypes, InnerTypes>...> type;

where OuterTypes and InnerTypes are template type parameter packs.

There is a horrible inefficiency in
TemplateArgumentLoc::getPackExpansionPattern(), where we need to
create copies of TypeLoc data because our interfaces traffic in
TypeSourceInfo pointers where they should traffic in TypeLocs
instead. I've isolated in efficiency in this one routine; once we
refactor our interfaces to traffic in TypeLocs, we can eliminate it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122278 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
87dd697dcc8ecb64df73ae64d61b8c80ff0c157c 20-Dec-2010 Douglas Gregor <dgregor@apple.com> Clean up the handling of template argument packs, especially in the
area of printing template arguments. The functionality changes here
are limited to cases of variadic templates that aren't yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122250 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
umpXML.cpp
emplateBase.cpp
ypePrinter.cpp
7536dd5e6c99584481b7dab68b7e7d8df9c54054 20-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
STContext.cpp
STImporter.cpp
ypePrinter.cpp
e6a365d772a6b455f1e23ac9ae5f40d65a55a18c 19-Dec-2010 John McCall <rjmccall@apple.com> Motions towards simplifying how we deal with attribute-qualified function types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122162 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7f1b98760d419a09b2261c1ef901f6bc1ff33e19 18-Dec-2010 John McCall <rjmccall@apple.com> Apply attributes to explicit specializations. Specializations which
don't provide their own explicit visibility attributes should get them
from the template. Fixes rdar://problem/8778497.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122136 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ecea19f00a911c50dc20fe94e548f488ded47adb 17-Dec-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator returns a lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122021 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
e186269a8a41dbff1ebea2c251048892979d1078 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in various kinds of
declarations. This is a work in progress, as I go through the C++
declaration grammar to identify where unexpanded parameter packs can
occur.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121912 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f24e54a0c8f0621dc1e964e79dd2fc47f6a2e723 15-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Silence GCC warning about control reaching the end of the function and explicitly mark that all cases are handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121855 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
bebbe0d9b7568ce43a464286bee49429489ef483 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Variadic templates: extend the Expr class with a bit that specifies
whether the expression contains an unexpanded parameter pack, in the
same vein as the changes to the Type hierarchy. Compute this bit
within all of the Expr subclasses.

This change required a bunch of reshuffling of dependency
calculations, mainly to consolidate them inside the constructors and
to fuse multiple loops that iterate over arguments to determine type
dependence, value dependence, and (now) containment of unexpanded
parameter packs.

Again, testing is painfully sparse, because all of the diagnostics
will change and it is more important to test the to-be-written visitor
that collects unexpanded parameter packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121831 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
xpr.cpp
xprCXX.cpp
emplateBase.cpp
ype.cpp
8cc246c9a68c783a5b90d2e8b8927521cb3a49b7 15-Dec-2010 John McCall <rjmccall@apple.com> Function types are compatible (in the C sense) if their regparms are identical.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121821 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
723df245307a530da5433dfb43accf187dc3e243 14-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added missing IgnoreParens().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ypeLoc.cpp
8786da77984e81d48e0e1b2bd339809b1efc19f3 14-Dec-2010 John McCall <rjmccall@apple.com> Rewrite ComplexExprEvaluator::VisitCastExpr to use cast kinds, and fix
the basic casting logic to insert intermediate casts and preserve the
exact complex-cast design. Fixes a crash in the test suite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121776 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e23cf437fe76b1ed02d63c3f61b456fd48a915f5 14-Dec-2010 John McCall <rjmccall@apple.com> Restore r121752 without modification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xprCXX.cpp
ype.cpp
5bfe232d1f07a6fd160fcf82c277c055a412a1c0 14-Dec-2010 John McCall <rjmccall@apple.com> 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
STContext.cpp
STImporter.cpp
xprCXX.cpp
ype.cpp
0e88aa7100da32acc63bc8a4dcb946ed517868f1 14-Dec-2010 John McCall <rjmccall@apple.com> 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
STContext.cpp
STImporter.cpp
xprCXX.cpp
ype.cpp
d0937224f383c7cc72c947119380f9713a070c73 13-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
estedNameSpecifier.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
140a2bd77539b4537010d8cd6a0a3805ce724b3e 13-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Skip ParenType on function instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121720 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
96fc8e4086df323c49f17cac594db1d2f066a2e9 11-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Improved complex constants evaluation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121616 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e005d19456e6fb73ace33f25e02ac10e22dd063f 10-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCMessageExpr::getReceiverRange() to get the source range of the receiver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121517 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f40f0d5a382395e0301d7dcbeaa2b8e90b8973b1 10-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
xpr.cpp
075f8f1b6bed4d1b224c74f87508534cc6392ce6 10-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added ParenType type node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ype.cpp
ypePrinter.cpp
49f4e1cbd839da27ff4814b4ea6d85a79f786cbd 10-Dec-2010 John McCall <rjmccall@apple.com> 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
STContext.cpp
STDiagnostic.cpp
tmtDumper.cpp
ype.cpp
ypePrinter.cpp
f7616b9067790757f4e12e834b216c53c8c04ebe 10-Dec-2010 Douglas Gregor <dgregor@apple.com> Move the "volatile" bit into QualType's "fast" qualifier set,
increasing the required type alignment from 8 to 16. This provides a
2.5% speedup for -fsyntax-only on a token-cached Cocoa.h, while only
increasing memory consumption in the ASTContext by 0.8%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121474 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
90f1450c109fbbd333001165bbd986061f7c4513 10-Dec-2010 John McCall <rjmccall@apple.com> Treat visibility on an enclosing namespace as a non-explicit source of
visibility. Fixes PR8713.

I've disabled a test which was testing that you can #pragma pop visibility
to get out of a namespace's visibility attribute. We should probably just
diagnose that as an error unless it's instrumental to someone's system
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121459 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8f1509446fc51db0473ea1241910c06353a153b8 09-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
ecl.cpp
5a821198203bdd469175408c4c4c805cc3240159 09-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix another unnecessary-struct-padding issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121352 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
43ddd9f2027bdd9c36336a342e9c0dd2aa13f836 09-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Before determining the effect the alignment of base struct will have in the aligment of the sub-struct,
take into account if the sub-struct is packed and its maximum field alignment.

Fixes rdar://8745206

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121335 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
f187237d916afa97c491ac32fe98be7d335c5b63 08-Dec-2010 Francois Pichet <pichet2000@gmail.com> 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
xpr.cpp
xprClassification.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
cad2c59b0c087edea83d0fbf6eabde4a7960c778 08-Dec-2010 Douglas Gregor <dgregor@apple.com> Fix two thinkos and add a test for importing the AST of a category
implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121263 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
954e0c75c42f321945aff8b9ee96da43cd90c752 07-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement AST import for Objective-C property implementations
(@synthesize and @dynamic).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121159 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
56ed7927232256516efcf6afb7bd59bad1e7af71 07-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> Cast CachedLinkage to linkage to avoid "comparison between signed and unsigned integer" warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121143 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3daef29bf390dbdb3603748280afd5827d1811da 07-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement ASTImporter support for Objective-C category implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121139 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
9f71a8f4c7a182a5236da9e747d57cc1d1bd24c2 07-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xprConstant.cpp
ype.cpp
dd182ff10b9145e432dea1fd2fb67100ccca3b10 07-Dec-2010 Douglas Gregor <dgregor@apple.com> Extern the ASTImporter to import @implementation declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121097 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
38c2b730a8553fa1cf369d0c5567f8b5d0a3dda8 07-Dec-2010 Francois Pichet <pichet2000@gmail.com> Fix enumerator not handled in switch warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121084 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
6f18fca241bf060bccbea52e5e436e17562bc9b3 07-Dec-2010 John McCall <rjmccall@apple.com> Kill FullExpr, as it was not, in fact, used anywhere in the code base.
I'm not opposed to the idea in concept, but there's no point in preserving
abortive experiments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121083 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ullExpr.cpp
6ad6f2848d7652ab2991286eb48be440d3493b28 07-Dec-2010 Francois Pichet <pichet2000@gmail.com> 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
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
89d63e5e4f4423455f7ee6b1e85143c34d088128 06-Dec-2010 Douglas Gregor <dgregor@apple.com> Use the unused merge() function, fixing an minor, unintended change I
introduced in r121023.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121025 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
381d34e0b205ca27bcc7e7c1652561941c437965 06-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
ecl.cpp
b5f35bae05f1ce3ae62ca52b266a086fd019e89b 06-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
ecl.cpp
eclBase.cpp
eclCXX.cpp
d016ec204c54d766c4561d43548551ffde0e6b43 06-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Add BlocksAttr assert on __block specific
routines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4765fa05b5652fcc4356371c2f481d0ea9a1b007 06-Dec-2010 John McCall <rjmccall@apple.com> 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
ecl.cpp
eclPrinter.cpp
xpr.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
01b2e4e3e2fbd60e62539f7e8e8b99575fa8a5b0 06-Dec-2010 John McCall <rjmccall@apple.com> Clarify the logic for when to build an overloaded binop. In particular,
build one when either of the operands calls itself type-dependent;
previously we were building when one of the operand types was dependent,
which is not always the same thing and which can lead to unfortunate
inconsistencies later. Fixes PR8739.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120990 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
00eb3f9c5b33e3d99aee1f8b75dd9c9678fdd66b 04-Dec-2010 Francois Pichet <pichet2000@gmail.com> 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
eclCXX.cpp
eclPrinter.cpp
9c5d70cee1fab3f988f9cd40316071b088a3f19d 04-Dec-2010 John McCall <rjmccall@apple.com> Make IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().
Abramo noticed this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120898 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ec276bf91627058a61adc9ba9175dd10d4c1a5aa 04-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence "comparison between signed and unsigned integer expressions" warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120897 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f6a1648197562e0b133440d612d9af297d0a86cc 04-Dec-2010 John McCall <rjmccall@apple.com> Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
74b2756bc1f1f5f7c189996fe7e4cd3efef70263 04-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose when accessing property in a class method and
no property accessor class method to be found, instead of
crashing in IRGen. // rdar://8703553


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120855 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a88cefd266c428be33cc06f7e8b00ff8fc97c1ff 03-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> 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
STImporter.cpp
ecl.cpp
eclPrinter.cpp
2357207a5753547740c70a12c3b37f71afa93f8a 03-Dec-2010 Douglas Gregor <dgregor@apple.com> 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
ecl.cpp
eclBase.cpp
eclCXX.cpp
f91d7572ee7fa6f2926c8e7e816039a1154a59f8 02-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Merge transparent union types using member's unqualified type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120736 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b97c403176a5937575e7c5eea20026edfbe947f5 02-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Merge transparent union types using member's canonical param type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120729 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c04d9d1be026cb201a716df1cd28a88878958bee 02-Dec-2010 Douglas Gregor <dgregor@apple.com> Fix inverted return value in the ASTImporter. No matter how much LLVM
code I wrote, returning "true" on error is still unnatural.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120727 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
830937bc1100fba7682f7c32c40512085870f50c 02-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> IR Gen. part of API support for __block cxx
objects imported into blocks. //rdar://8594790.
Will have a test case coming (as well as one
sent to llvm test suite).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120713 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7bd245b42cb3fb3da8877faf748538dd0b0154fb 02-Dec-2010 John McCall <rjmccall@apple.com> Tweaks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120701 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
3bddf5c2173a0a8bf900fe10f07b38e95e09c745 02-Dec-2010 John McCall <rjmccall@apple.com> ObjC support in the XML dumper.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120700 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
12f78a6741a4cb3d904340f8d3d2714568b50e7a 02-Dec-2010 John McCall <rjmccall@apple.com> 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
xpr.cpp
xprClassification.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
3a1c36c099df4dcc94d1d24516a8a2c809c764d4 02-Dec-2010 Douglas Gregor <dgregor@apple.com> Eliminate two uses of NDEBUG in headers that cause different symbols
to be available in debug vs. release builds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120629 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
26ac3f30ecef21749c00a4b1a08dd15d772dd5aa 02-Dec-2010 Douglas Gregor <dgregor@apple.com> Extend ExternalASTSource with the ability to lazily complete the
definition of an Objective-C class. Unlike with C/C++ classes, we
don't have a well-defined point in Sema where Objective-C classes are
checked for completeness, nor do we need to involve Sema when
completing a class. Therefore, we take the appropriate of having the
external AST source mark a particular Objective-C class as having an
external declaration; when using one of the accessors of an
Objective-C class that has an external declaration, we request that
the external AST source fill in the Objective-C class definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120627 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1ceee5c42d5c410217f67d384eecc6ea4a2bba9b 01-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Sema/AST work for capturing copy init expression
to be used in copy helper synthesis of __block
variables. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120617 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9fa8c4652afd4ee0faa70b563688d56c51c7fc93 01-Dec-2010 Douglas Gregor <dgregor@apple.com> AST printing for scoped enumerations and enumerations with a fixed underlying type, from Daniel Wallin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120576 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
b7b2688bab0eac053d3e2938b329c8e523fd252b 01-Dec-2010 John McCall <rjmccall@apple.com> Eliminate vtables from the Type hierarchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120562 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0ae287a498b8cec2086fe6b7e753cbb3df63e74a 01-Dec-2010 John McCall <rjmccall@apple.com> Restore the lvalue-to-rvalue conversion patch with a minimal fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120555 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d5dc83a85c1b9aa32f8262126183df5d71c357ae 01-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement AST import support for class template specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120523 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
040afaeea2313dc69fd532995ac88cccdd62da56 30-Nov-2010 Douglas Gregor <dgregor@apple.com> Implement basic AST importing and merging support for class template
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120448 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
7907fad723a0f4764a2396df620d9c58725b3053 30-Nov-2010 Douglas Gregor <dgregor@apple.com> Eliminate more pointless default statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120446 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
20fbe7c4772d537c1f779b1ff89cbb57d1d9afff 30-Nov-2010 John McCall <rjmccall@apple.com> L-value to r-value conversion is not ready for prime-time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120433 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7e4857931bfe27bb355275bc7ec1eaa44612dfff 30-Nov-2010 John McCall <rjmccall@apple.com> Introduce an r-value to l-value cast kind. I'm not promising anything
about the reliability of this yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120422 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6710cf1d5f3ab31524af6d72278ec5952f75b3c4 30-Nov-2010 John McCall <rjmccall@apple.com> Make the dumper safe against null declaration names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120421 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
aab440b2cb0e583aeaf21f08c8247456f3142a23 30-Nov-2010 Nick Lewycky <nicholas@mxc.ca> Take John McCall's suggestion and fix this silly gcc warnings in a way that
Doug isn't likely to rip back out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120409 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f402943e6a3b2cdffaf2644191fa1c1515722eea 30-Nov-2010 Douglas Gregor <dgregor@apple.com> I hate pointless default statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120402 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1b51e3b2cbf929a7acc126e9d659e67d819a11e7 30-Nov-2010 Nick Lewycky <nicholas@mxc.ca> Add a default clause to avoid this GCC warning:
Type.cpp:1000: warning: control reaches end of non-void function


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120376 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bbd340717422bf011d56cd0164d2576601368111 30-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Incomplete enum types not to be treated as integer type
when checking for integer signed/unsigned-ness. PR8694,
// rdar://8707031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120345 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2a601eb4cd9190ed52cc1c990c5a8c5ee852bce6 29-Nov-2010 Douglas Gregor <dgregor@apple.com> I hate default statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120293 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0629cbe86b6d890076548778ed8597ee298adcba 29-Nov-2010 Douglas Gregor <dgregor@apple.com> Teach the ASTImporter how to create CXXMethodDecls. Somehow, this case was missed previously

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120289 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f8b3015060096a946d91578d0f3b65d3097a4ebb 28-Nov-2010 Anders Carlsson <andersca@mac.com> Look through parentheses when deciding whether an expr is a temporary object. Fixes PR8683.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120247 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
dae0cb52e4e3d46bbfc9a4510909522197a92e54 25-Nov-2010 Anders Carlsson <andersca@mac.com> Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
ecordLayoutBuilder.cpp
0b9fb2f6b4845bfe5e25b576ae8f2ffa284f9cb1 25-Nov-2010 Anders Carlsson <andersca@mac.com> Remove the PrimaryBaseInfo class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120134 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
c9e814ba193f38a7b08268612248f63beb279bb3 25-Nov-2010 Anders Carlsson <andersca@mac.com> Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120133 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
245656ec65ec600ef1ab05f4c8d9f780542d689d 24-Nov-2010 Anders Carlsson <andersca@mac.com> Use the newly added function in ASTRecordLayoutBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120131 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3a03765f706024f8b054635631547287bdd1831b 24-Nov-2010 Anders Carlsson <andersca@mac.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120130 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
46170f9c7d561d0f94af34a4b5da909d2584370a 24-Nov-2010 Anders Carlsson <andersca@mac.com> Add CXXRecordDecl::getIndirectPrimaryBases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120129 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
13cf5e2e223ebfc8ec0459913b2fc9ec1e5fa760 24-Nov-2010 John McCall <rjmccall@apple.com> Appease versions of GCC which don't correctly support injected class
names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120091 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
26c25c95a1eeeed09265525de300670eb5e9c015 24-Nov-2010 John McCall <rjmccall@apple.com> This is probably an important file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120089 91177308-0d34-0410-b5e6-96231b3b80d8
umpXML.cpp
f35142413974e9dfe2c5f202084db4bd1c2073e9 24-Nov-2010 John McCall <rjmccall@apple.com> Add -cc1 -ast-dump-xml, an excessively detailed XML dump of the internals
of the ASTs. Only available in assertions builds. No stability guarantee.

This is intended solely as a debugging tool. I'm not sure if the goals
are sufficiently aligned with the XML printer to allow a common
implementation.

Currently just falls back on the StmtDumper to display statements,
which means it doesn't produce valid XML in those cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120088 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
7eb0a9eb0cde8444b97f9c5b713d9be7a6f1e607 24-Nov-2010 John McCall <rjmccall@apple.com> Switch a lot of call-sites over to using the new value-kind calculations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120084 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprClassification.cpp
dfa1edbebeda7ec3a7a9c45e4317de9241aa9883 23-Nov-2010 John McCall <rjmccall@apple.com> A few tweaks to the value-kind computation:
- Default argument expressions pick up the value kind of the incoming
expression, not the value kind of the parameter it initializes.
- When building a template argument for substitution, A::x is an rvalue
if x is an instance method.
- Anonymous struct/union paths pick up value kind the same way that
normal member accesses do; extract out a common code path for this.

Enable the value-kind assertion, now that it passes self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120055 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
39b49bcaaddb1049234fca9500c0ac02c088e23d 23-Nov-2010 Chris Lattner <sabre@nondot.org> 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
STImporter.cpp
d98114647e16796a976b04af79975b4f0eacf22b 21-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Fix a bunch of IndirectFieldDecl-related warnings.

- Negative ChainingSize doesn't make sense, make it unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119943 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
87c2e121cf0522fc266efe2922b58091cd2e0182 21-Nov-2010 Francois Pichet <pichet2000@gmail.com> 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
STImporter.cpp
ecl.cpp
eclBase.cpp
xprClassification.cpp
44aa1f397855f130e88e62ffc1029f7f83bb5d2e 20-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
tmt.cpp
a25b6a4b43e8b9611f7506e5fe1b448833b10a46 19-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
tmt.cpp
b95cfe4bb01f18a112bcb7eea3b82bc8d6dfe20b 19-Nov-2010 Douglas Gregor <dgregor@apple.com> Make sure to print cvr-qualifiers on function declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119817 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
33e4e70c8c0a17e0ccb7465d96556b077a68ecb1 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
STImporter.cpp
ecordLayoutBuilder.cpp
0943168ac126b8047f30f6bd215fbe7db14d61ba 18-Nov-2010 John McCall <rjmccall@apple.com> Add an assertion, fix a whole bunch of bugs, comment the assertion
out because there are still bugs left.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119722 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
45ab4b5f8961dadcef6545ed6956da5daf95c6cb 18-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (see
http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to
rjmccall for all the coaching!

Approved by rjmccall


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119697 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
f89e55ab1bfb3ea997f8b02997c611a02254eb2d 18-Nov-2010 John McCall <rjmccall@apple.com> 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
STImporter.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
xprClassification.cpp
tmtDumper.cpp
08f92e3a5dead1f1ee656678a7f06e43279d6e50 17-Nov-2010 Chris Lattner <sabre@nondot.org> a metric ton of refactoring later, Sema::getLocationOfStringLiteralByte
no longer depends on Preprocessor, so we can move it out of Sema into
a nice new StringLiteral::getLocationOfByte method that can be used by
any AST client.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119481 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a4ffd85a6684e42f900aad5459e58ad91bb88755 17-Nov-2010 Douglas Gregor <dgregor@apple.com> 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
eclObjC.cpp
e38be617437ccdcc180c5a49e447cbcd07539292 17-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes synthesis of type for the object which holds info.
about a __block cxx object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119411 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cb49c48960fc2686b5fceff434398f25498f10f4 16-Nov-2010 John McCall <rjmccall@apple.com> Simplify some complex emission and implement correct semantics for
assignment to volatiles in C. This in effect reverts some of mjs's
work in and around r72572. Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119344 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
b418d74c11498b7e1044103131e2e3be4d63512e 16-Nov-2010 John McCall <rjmccall@apple.com> Simplify some complex emission and implement correct semantics for
assignment to volatiles in C. This in effect reverts some of mjs's
work in and around r72572. Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119344 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
ee970edb9d20980454c749019f46ef9573e26c5c 16-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> Have CXXDeleteExpr::getDestroyedType return the actual destroyed type
in more situations. In particular, for code like

template<class T> void Fn() { T* x; delete x; }

getDestroyedType() will now return T rather than T*, as it would
before this change. On the other hand, for code like this:

template<class T> void Fn() { T x; delete x; }

getDestroyedType() will return an empty QualType(), since it doesn't
know what the actual destroyed type would be. Previously, it would
return T.

OKed by rjmccall


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119334 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
a437ad3ec5b407ede394d74e6f9f463fa3657dbe 16-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> Have CXXDeleteExpr::getDestroyedType return the actual destroyed type
in more situations. In particular, for code like

template<class T> void Fn() { T* x; delete x; }

getDestroyedType() will now return T rather than T*, as it would
before this change. On the other hand, for code like this:

template<class T> void Fn() { T x; delete x; }

getDestroyedType() will return an empty QualType(), since it doesn't
know what the actual destroyed type would be. Previously, it would
return T.

OKed by rjmccall


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119334 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
a4ffbd8c8f55681d39dd2be1efa60b9870f6ae34 16-Nov-2010 John McCall <rjmccall@apple.com> Kill CK_Unknown and flesh out the documentation for the existing CastKinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119331 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
e2b768877b77fa4e00171ee6e6443722e0f3d111 16-Nov-2010 John McCall <rjmccall@apple.com> Kill CK_Unknown and flesh out the documentation for the existing CastKinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119331 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
ef2f196d370d46dae19ba6587c7f0d278373dac8 16-Nov-2010 Bob Wilson <bob.wilson@apple.com> Update TypePrinter::PrintVector to handle new Neon vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119302 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
ec33cbeab96f33007ac19a57bab454519cd94fe9 16-Nov-2010 Bob Wilson <bob.wilson@apple.com> Update TypePrinter::PrintVector to handle new Neon vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119302 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
321a749b60c1650934a77da0a136eddd42a9d66f 16-Nov-2010 Bob Wilson <bob.wilson@apple.com> ASTContext::getVectorType should preserve the vector kind for canonical types.
This is needed for Neon types when it is most natural to define them in terms
of a typedef. For example, Neon poly8_t is a typedef for "signed char", and
we want to define polynomial vectors as vectors of that typedef. Without this
change, the result will be a generic GCC-style vector. I think this is safe
for other vector types as well, but I would appreciate a review of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119300 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
231da7eb3dd13007e5e40fffe48998e5ef284e06 16-Nov-2010 Bob Wilson <bob.wilson@apple.com> ASTContext::getVectorType should preserve the vector kind for canonical types.
This is needed for Neon types when it is most natural to define them in terms
of a typedef. For example, Neon poly8_t is a typedef for "signed char", and
we want to define polynomial vectors as vectors of that typedef. Without this
change, the result will be a generic GCC-style vector. I think this is safe
for other vector types as well, but I would appreciate a review of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119300 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1ebdd533402ce4e115e3a588754032ced20855a3 16-Nov-2010 John McCall <rjmccall@apple.com> 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
xpr.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
7cd7d1ad33fdf49eef83942e8855fe20d95aa1b9 16-Nov-2010 John McCall <rjmccall@apple.com> 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
xpr.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
92e8526fdbca4eeecc924f7ce667d00551098f9e 15-Nov-2010 Ted Kremenek <kremenek@apple.com> Add method ParentMap::addStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119181 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
d6543f8bbac18cdb678a67da2a676c30c2941eca 15-Nov-2010 Ted Kremenek <kremenek@apple.com> Add method ParentMap::addStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119181 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
6b4052d120c3ef414a822b3cff063432a1df3186 15-Nov-2010 John McCall <rjmccall@apple.com> Assorted work leading towards the elimination of CK_Unknown.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119138 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
daa8e4e888758d55a7a759dd4a91b83921cef222 15-Nov-2010 John McCall <rjmccall@apple.com> Assorted work leading towards the elimination of CK_Unknown.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119138 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
c948dee3af99fe58d4f94a6727b2a7c9f98434fc 14-Nov-2010 John McCall <rjmccall@apple.com> Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions; the last batch was specific to promotions.
I think this is the full set we need. I do think dividing the cast
kinds into floating and integral is probably a good idea.

Annotate a *lot* more C casts with useful cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119036 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
f3ea8cfe6b1c2ef0702efe130561e9e66708d799 14-Nov-2010 John McCall <rjmccall@apple.com> Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions; the last batch was specific to promotions.
I think this is the full set we need. I do think dividing the cast
kinds into floating and integral is probably a good idea.

Annotate a *lot* more C casts with useful cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119036 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
0bf22e6c0c3413f491ea179db51a45bcf2381391 13-Nov-2010 John McCall <rjmccall@apple.com> Introduce five new cast kinds for various conversions into and
between complex types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118994 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
2bb5d00fcf71a7b4d478d478be778fff0494aff6 13-Nov-2010 John McCall <rjmccall@apple.com> Introduce five new cast kinds for various conversions into and
between complex types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118994 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
0e4ca01531c7c2a854c10e8dc47b857125513f67 13-Nov-2010 John McCall <rjmccall@apple.com> Bring UsualArithmeticConversionsType back into Sema and cast the
operands appropriately. There are a lot of missing complex-related
cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118993 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cf33b24441798f538fb5ab089edbba2ac3ba819c 13-Nov-2010 John McCall <rjmccall@apple.com> Bring UsualArithmeticConversionsType back into Sema and cast the
operands appropriately. There are a lot of missing complex-related
cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118993 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4f6199189cdc8acb40d76c24122f57672485baec 13-Nov-2010 John McCall <rjmccall@apple.com> Introduce a null-to-pointer implicit cast kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
404cd1669c3ba138a9ae0a619bd689cce5aae271 13-Nov-2010 John McCall <rjmccall@apple.com> Introduce a null-to-pointer implicit cast kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
2fea9955b4496cdcc4356b103236f7b93a261f70 12-Nov-2010 Bob Wilson <bob.wilson@apple.com> Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118901 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f69eb7cf8e616b5aad7911ec6f79b24b0a009227 12-Nov-2010 Bob Wilson <bob.wilson@apple.com> Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118901 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
70eddbfa09174de7d44b6a5cf7ecd55c4b97bee0 12-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
ypePrinter.cpp
cb7b1e17b63967317ab5cc55682168cf0380519a 12-Nov-2010 Douglas Gregor <dgregor@apple.com> Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
ypePrinter.cpp
b3e547db227afec80fd921b4dbff66bd91da992f 10-Nov-2010 Bob Wilson <bob.wilson@apple.com> 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
STContext.cpp
STImporter.cpp
ypePrinter.cpp
e86d78cf4754a6aef2cf9a33d847aa15338e276f 10-Nov-2010 Bob Wilson <bob.wilson@apple.com> 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
STContext.cpp
STImporter.cpp
ypePrinter.cpp
929f496b833d84f048809a496cd3449401047628 10-Nov-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclCXX.cpp
826faa22bae112e01293a58534a40711043cce65 10-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclCXX.cpp
8f015ffc4e7f0af60ed699737565beae79599b43 09-Nov-2010 John McCall <rjmccall@apple.com> Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118636 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
091f23f1d6d4bcffd6641cda72a6831e08c02ea7 09-Nov-2010 John McCall <rjmccall@apple.com> Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118636 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
28a226b02fd749c9b6d6cf43aac0e32c7c7da449 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Restore patch reversed in r118475. Fixes
// rdar://8632525


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ba8bda05fefd3bb2f1ef201784b685f715bdde29 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Restore patch reversed in r118475. Fixes
// rdar://8632525


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d22d23d26ea72e9f68804cce92133ce3a4e61adc 09-Nov-2010 Charles Davis <cdavis@mines.edu> Use the right calling convention when mangling names in the Microsoft C++
mangler. Now member functions and pointers thereof have their calling
convention mangled as __thiscall if they have the default CC (even though,
they technically still have the __cdecl CC).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118598 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ee743f903858e337434ac0335f147f4de4ecae05 09-Nov-2010 Charles Davis <cdavis@mines.edu> Use the right calling convention when mangling names in the Microsoft C++
mangler. Now member functions and pointers thereof have their calling
convention mangled as __thiscall if they have the default CC (even though,
they technically still have the __cdecl CC).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118598 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
81d3ee953415297592892daee8ad1381706875d8 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Reverse patch for // rdar://8632525. It might
has broken a build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c8c62c4075688b206dc9ac2c5b24a362018b718b 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Reverse patch for // rdar://8632525. It might
has broken a build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
012a8e0d85b51fa90c3d2efba7fc6f2a197a132d 09-Nov-2010 Ted Kremenek <kremenek@apple.com> Fix InitListExpr::getSourceRange() to work in the case of no locations for '(' and ')'. This can happen
in the case of transparent unions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118472 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c4ba51f365a3cd3374b3ef87272a9b3e517cd5d3 09-Nov-2010 Ted Kremenek <kremenek@apple.com> Fix InitListExpr::getSourceRange() to work in the case of no locations for '(' and ')'. This can happen
in the case of transparent unions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118472 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ec49003352e31056fd5edabc9bad0b18d20029a5 08-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Provide a precise builtin declaration for objc_msgSend
to avoid a bogus warning. Fixes //rdar: //8632525


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118451 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ed171b80e49c1ef3dcb9c2aa238cc50340ac6e90 08-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Provide a precise builtin declaration for objc_msgSend
to avoid a bogus warning. Fixes //rdar: //8632525


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118451 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
49faccdf4e9532c5c1e80581aab8ee622cf26a07 08-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Improve our handling of C++ [class.copy]p3, which specifies that a
constructor template will not be used to copy a class object to a
value of its own type. We were eliminating all constructor templates
whose specializations look like a copy constructor, which eliminated
important candidates. Fixes PR8182.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118418 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6493cc50b66c2d097b3e22514bbe303048c4a8ff 08-Nov-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of C++ [class.copy]p3, which specifies that a
constructor template will not be used to copy a class object to a
value of its own type. We were eliminating all constructor templates
whose specializations look like a copy constructor, which eliminated
important candidates. Fixes PR8182.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118418 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
99cb76d06906fd6c126da9c22f7af15c8658457b 08-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> 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
STContext.cpp
ecl.cpp
eclTemplate.cpp
emplateBase.cpp
ypePrinter.cpp
910f8008fea79120489a53593fe971b0b8a4a740 08-Nov-2010 Douglas Gregor <dgregor@apple.com> 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
STContext.cpp
ecl.cpp
eclTemplate.cpp
emplateBase.cpp
ypePrinter.cpp
529f9cfa88f8be4014575b212c5a30d2db6dae07 05-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Put class into an anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118293 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
752c2e930a3ec30b5e338845fd5e7baae532ee69 05-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Put class into an anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118293 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
151e9e51f98174052f23abce842358bcd9a13833 04-Nov-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Don't be so eager to replace UsingDecls in a DeclContext's lookup table;
check that the TargetNestedNameDecl is the same first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118239 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c80117e7971c34088f3e254c849ec3a40205d2c3 04-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't be so eager to replace UsingDecls in a DeclContext's lookup table;
check that the TargetNestedNameDecl is the same first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118239 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
06010fd3df8cf6e4d61015b00a914eac64c74c31 04-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> add a comment to my last commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118212 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
643f84353b3b7bbf9b73bcbc7da0ef8a39a5ca99 04-Nov-2010 Douglas Gregor <dgregor@apple.com> add a comment to my last commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118212 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a5632560a85642ca1eb5a1268c7b9bf8c01fd9f2 04-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> When canonicalizing nested-name-specifiers involving dependent names
or dependent specializations, rip apart the dependent name/dependent
specialization to recanonicalize its pieces, because
nested-name-specifiers store "dependent-type::identifier" differently
than types do. Fixes PR7419.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118211 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
264bf66d55563dd86a3d7e06738aa427de512d2c 04-Nov-2010 Douglas Gregor <dgregor@apple.com> When canonicalizing nested-name-specifiers involving dependent names
or dependent specializations, rip apart the dependent name/dependent
specialization to recanonicalize its pieces, because
nested-name-specifiers store "dependent-type::identifier" differently
than types do. Fixes PR7419.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118211 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6dbcbbcfcdcc44c8f7641dc788d2523cf1a09b5b 03-Nov-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
STImporter.cpp
389db16c63eec6ecfa9b235155252d8da766e94e 03-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
STImporter.cpp
6cb4432d0b7a50db290d63e28ba4fc238f2d1cdd 03-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Improve source-location information for CXXConstructExpr nodes, by
ensuring that they cover all of their child nodes. There's still a
clang_getCursor()-related issue with CXXFunctionalCastExprs with
CXXConstructExprs as children (see FIXME in the test case); I'll look
at that separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118132 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
40749ee585abc84fbb3c8fdbd8aaac062f153062 03-Nov-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information for CXXConstructExpr nodes, by
ensuring that they cover all of their child nodes. There's still a
clang_getCursor()-related issue with CXXFunctionalCastExprs with
CXXConstructExprs as children (see FIXME in the test case); I'll look
at that separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118132 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4d14fa6708bd93e3c177cddd267fc440a85d2aeb 02-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes an assertion violation when bind to temporary
expression is a dependent expression.
// rdar: // 8620524 and PR7851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118066 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
b8e39236f05b2f71fb2632673948499fd54e2a34 02-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes an assertion violation when bind to temporary
expression is a dependent expression.
// rdar: // 8620524 and PR7851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118066 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0319344b2a65ba82c613a268c071975591180906 02-Nov-2010 John McCall <rjmccall@apple.com> Unbreak private_extern, which apparently we had zero tests for.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118034 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
35cebc3eea898637057b10b5cf7dd08b1d788980 02-Nov-2010 John McCall <rjmccall@apple.com> Unbreak private_extern, which apparently we had zero tests for.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118034 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
28c6f7494e01ac9c3ad3a9e000950cdd3228c8a5 02-Nov-2010 John McCall <rjmccall@apple.com> Ignore attributes on classes when calculating visibility for members
with their own explicit visibility attributes. Basically we only want to
apply a single visibility attribute from any particular ancestry.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117998 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3698748400478880d2a146ef9eaa111cd0e60522 02-Nov-2010 John McCall <rjmccall@apple.com> Ignore attributes on classes when calculating visibility for members
with their own explicit visibility attributes. Basically we only want to
apply a single visibility attribute from any particular ancestry.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117998 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3cd261bde617e30f9c59634cf5491d33ee2f8f39 01-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Restore patch for PR8453 which was undone in r117829
(was project bugs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117951 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
de5b17ea3c74d2844ed035a1edfa6479866139b5 01-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Restore patch for PR8453 which was undone in r117829
(was project bugs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117951 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
908200b4754e1544a13c602c412e66ce32d74635 01-Nov-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Emit error when using a bound member function for something other than calling it.

Also avoids IRGen crashes due to accepting invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117943 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
11ab79030938209f50691acae0ddb65e72a58ca9 01-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit error when using a bound member function for something other than calling it.

Also avoids IRGen crashes due to accepting invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117943 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3c77778b3bc320839dcc056462f77a6a19f817f4 01-Nov-2010 Anders Carlsson <andersca@mac.com> Don't update empty field subobjects for bitfields. Fixes PR8519.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117921 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fa84fbad4863e030b149febc88288514efca34b2 01-Nov-2010 Anders Carlsson <andersca@mac.com> Don't update empty field subobjects for bitfields. Fixes PR8519.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117921 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4983f413d19229f6b7f9360959e20fcdf2ade75a 01-Nov-2010 John McCall <rjmccall@apple.com> Only apply -fvisibility-inlines-hidden to definitions. Apparently
isInlined() just gives meaningless results for non-definitions.

Fixes rdar://problem/8614470



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117887 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
66cbcf3f150d075fead7c5935b6e9c61a32cf3d4 01-Nov-2010 John McCall <rjmccall@apple.com> Only apply -fvisibility-inlines-hidden to definitions. Apparently
isInlined() just gives meaningless results for non-definitions.

Fixes rdar://problem/8614470



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117887 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
dc3f078a707ebc217a47157c7e70616fd1a6b146 01-Nov-2010 Anders Carlsson <andersca@mac.com> Get rid of more calls to getBaseClassOffsetInBits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117883 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6a3567442307864eac52bb84ce41465753513635 01-Nov-2010 Anders Carlsson <andersca@mac.com> Get rid of more calls to getBaseClassOffsetInBits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117883 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a0e85119fcead14c33fa031a6aec9ff24ddc9d68 01-Nov-2010 Anders Carlsson <andersca@mac.com> Port over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117882 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
3069a0d28637ad0ad583d9fdd7bc6bc6aa677fb5 01-Nov-2010 Anders Carlsson <andersca@mac.com> Port over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117882 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
aa82a0ca2a1b5376ba2301990e284249e6b57dd7 01-Nov-2010 Anders Carlsson <andersca@mac.com> Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117881 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
a14f5979572aa25c03d24750ee4724d2031d4ede 01-Nov-2010 Anders Carlsson <andersca@mac.com> Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117881 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
ee1f346dd8d063108837cef243b9a686aa8cbee1 31-Oct-2010 Anders Carlsson <andersca@mac.com> Start converting over the RecordLayoutBuilder next.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117878 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a2311513524ecef954d2b438bfbe09aa9511b660 31-Oct-2010 Anders Carlsson <andersca@mac.com> Start converting over the RecordLayoutBuilder next.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117878 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fc502c1b203e67b1f9a9e364425b6dc89a0a49e9 31-Oct-2010 Anders Carlsson <andersca@mac.com> EmptyObjectMap now uses CharUnits wherever possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117877 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
a3d4380d6662a373bc78f915947e5bc06e985e91 31-Oct-2010 Anders Carlsson <andersca@mac.com> EmptyObjectMap now uses CharUnits wherever possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117877 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
da78af1dd34ee17f54524a02b5ff3a8475246db5 31-Oct-2010 Anders Carlsson <andersca@mac.com> More CharUnits conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117875 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8c6acc6be0fbd4127d16c1c0e12a9362462e6e0c 31-Oct-2010 Anders Carlsson <andersca@mac.com> More CharUnits conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117875 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c0f4b2444897033281f5a613993e50467945d0e8 31-Oct-2010 Anders Carlsson <andersca@mac.com> More CharUnits conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117874 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fe5ef73149514e513a231a1df1a5938f3ad1545a 31-Oct-2010 Anders Carlsson <andersca@mac.com> More CharUnits conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117874 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e0dbd947aae9a7995499ccb56e0611a45c4350be 31-Oct-2010 Anders Carlsson <andersca@mac.com> Use CharUnits in the EmptyClassOffsets map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117873 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d8da76365f40a0c12c7d802a0da2aaacf4b2cf99 31-Oct-2010 Anders Carlsson <andersca@mac.com> Use CharUnits in the EmptyClassOffsets map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117873 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ba90dab5280f08052d52c0aea7fa06b5e91f324f 31-Oct-2010 Anders Carlsson <andersca@mac.com> Baby steps towards using only CharUnits for base class offsets in ASTRecordLayout. Start by storing the offsets in CharUnits in the ASTRecordLayout object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117869 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
376bda924ac92462a22d6a22ea65d8c1bb8f26f3 31-Oct-2010 Anders Carlsson <andersca@mac.com> Baby steps towards using only CharUnits for base class offsets in ASTRecordLayout. Start by storing the offsets in CharUnits in the ASTRecordLayout object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117869 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e15d2ab3c0ff08d09527eb9cb8da54c0e3832c25 31-Oct-2010 Anders Carlsson <andersca@mac.com> Teach the constant expr evaluator about derived-to-base casts when no virtual bases are involved. Fixes PR5974.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117868 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5c5a764fcd256df6f6cfbce5cdd2a2dfb2c45e95 31-Oct-2010 Anders Carlsson <andersca@mac.com> Teach the constant expr evaluator about derived-to-base casts when no virtual bases are involved. Fixes PR5974.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117868 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bb28fdd1eebcb2362a3d771c9b1b57bb25ab5486 31-Oct-2010 Anders Carlsson <andersca@mac.com> Don't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes PR8507.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117850 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
96e93660124c8028a4c3bcc038ab0cdd18cd7ab2 31-Oct-2010 Anders Carlsson <andersca@mac.com> Don't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes PR8507.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117850 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ec9110c7e57830708717b81a84f807301b377367 30-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Emit an error when trying to form a pointer-to-member to a bitfield.

As a bonus, avoids a crash on the IRGen side due to accepting invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117842 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0f279e756e3df69f9e071c572805e5d3e89123a2 30-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit an error when trying to form a pointer-to-member to a bitfield.

As a bonus, avoids a crash on the IRGen side due to accepting invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117842 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cfcafb690f4a3fc42e4c1861b57881837fea212a 30-Oct-2010 Daniel Dunbar <daniel@zuster.org> Revert r117678, "Qualified 'id' should implement all of static class type's", it breaks things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117829 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2e8994e5549455d62b1b8b2ad2dc6ebbf544d3c4 30-Oct-2010 Daniel Dunbar <daniel@zuster.org> Revert r117678, "Qualified 'id' should implement all of static class type's", it breaks things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117829 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2de759ee4804419e8a58cf81eb4d4fd256f7635d 30-Oct-2010 John McCall <rjmccall@apple.com> Better solution: calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations. Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117781 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
af14603ca61757cf4361b583b45639a04c57e651 30-Oct-2010 John McCall <rjmccall@apple.com> Better solution: calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations. Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117781 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
3a4c468b38249be33f7e049c8b943e9782b4da66 30-Oct-2010 John McCall <rjmccall@apple.com> GCC faithfully calculates visibility for variables independently of
whether it's a declaration or not, then ignores that information for
declarations unless it was explicitly given. It's not totally clear
how that should be mapped into a sane system, but make an effort.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117780 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ee30102a9ef32cdbf0afe0e4c07a53d265a18f98 30-Oct-2010 John McCall <rjmccall@apple.com> GCC faithfully calculates visibility for variables independently of
whether it's a declaration or not, then ignores that information for
declarations unless it was explicitly given. It's not totally clear
how that should be mapped into a sane system, but make an effort.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117780 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
80209e6370362654179ee9aba339ec903a5ba789 30-Oct-2010 Chris Lattner <sabre@nondot.org> Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117775 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclObjC.cpp
xpr.cpp
xprCXX.cpp
tmt.cpp
3248854a5d16e1de17c58e05f726bdef9f042df2 30-Oct-2010 Chris Lattner <sabre@nondot.org> Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117775 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclObjC.cpp
xpr.cpp
xprCXX.cpp
tmt.cpp
c4c06ff08b812b1149b45c766e052b33688aa58f 30-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> 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
eclCXX.cpp
7c789c1a3f77f24032aa0bed2afacdb9e094e952 30-Oct-2010 Douglas Gregor <dgregor@apple.com> 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
eclCXX.cpp
555a1dc275adafe74fd7606617cea0270b242d94 30-Oct-2010 John McCall <rjmccall@apple.com> Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117729 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
110e8e56af30363072c140285961592b0107f789 30-Oct-2010 John McCall <rjmccall@apple.com> Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117729 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9b2d9e8915b29d6e8858d7462b10e5358d0c600d 29-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Qualified 'id' should implement all of static class type's
protocols, including those added to class, super class
and categories; otherewise issue a warning. This fixes
pr8453.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117678 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0483dceea00e47eeef0f3e7aa2bf72d71dc469ac 29-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Qualified 'id' should implement all of static class type's
protocols, including those added to class, super class
and categories; otherewise issue a warning. This fixes
pr8453.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117678 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
be866a94beb7bb37034d9e0deddfed221bec2106 29-Oct-2010 Daniel Dunbar <daniel@zuster.org> Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117653 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
034f55c1eb93aee61cef5a015eb1d5ba06d3b3d4 29-Oct-2010 Daniel Dunbar <daniel@zuster.org> Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117653 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b0b83983f7fec52224f78b1fb03e5eaeb93e9a83 29-Oct-2010 John McCall <rjmccall@apple.com> Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117644 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
87a4ed905e2febe64021dcdfcdc7f00b27e92f32 29-Oct-2010 John McCall <rjmccall@apple.com> Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117644 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bc098fb883d32b67f1ab446cb4d6c38fb113ffb8 29-Oct-2010 Charles Davis <cdavis@mines.edu> Add a hook to the CXXABI object to get the default method calling convention.
This isn't used yet, because someone more experienced than I needs to look
at the type system about gutting getCanonicalCallConv().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117638 91177308-0d34-0410-b5e6-96231b3b80d8
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
424ae9882e8a6eecc9dfe7c2d8623e72b2563873 29-Oct-2010 Charles Davis <cdavis@mines.edu> Add a hook to the CXXABI object to get the default method calling convention.
This isn't used yet, because someone more experienced than I needs to look
at the type system about gutting getCanonicalCallConv().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117638 91177308-0d34-0410-b5e6-96231b3b80d8
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
8d3e88ec7829c67b3e68edd7361c1d668061947a 29-Oct-2010 John McCall <rjmccall@apple.com> When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117628 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0df9587ab011c12968fcbe3518666b2117afe350 29-Oct-2010 John McCall <rjmccall@apple.com> When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117628 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bc811c23e8db814a478edd099d3b0b1c070478c0 28-Oct-2010 John McCall <rjmccall@apple.com> Don't apply -fvisibility-inlines-hidden to extern templates.
Part 2 of rdar://problem/8595231



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117567 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
479edbc8d0777e1bcf30ec3c90ebfb81bd5f4f28 28-Oct-2010 John McCall <rjmccall@apple.com> Don't apply -fvisibility-inlines-hidden to extern templates.
Part 2 of rdar://problem/8595231



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117567 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
47f979c07d6273bb24b64adcef1fe488f53d82b9 28-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Initialize the ASTMutationListener. Thanks goes to Abramo Bagnara!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117541 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9a44b5f5593bd8a385d06b07c564795f643ec8da 28-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initialize the ASTMutationListener. Thanks goes to Abramo Bagnara!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117541 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ed022b71b0e1d96d924ad681fd591f65f669503e 28-Oct-2010 John McCall <rjmccall@apple.com> Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker. With that done, turn an indirect goto into a
protected scope into a hard error; otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.

If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117539 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
95c225de9fa3d79f70ef5008c0279580a7d9dcad 28-Oct-2010 John McCall <rjmccall@apple.com> Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker. With that done, turn an indirect goto into a
protected scope into a hard error; otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.

If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117539 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
e25e6d31745f808a600c5c5b20ef7511f27cd28e 28-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
100050bf643bcfe2d06bdcef491e387171249260 28-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
162ab3200fb02522f07c2b51f8d87b7fd473b72d 28-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclTemplate.cpp
bef1a7b9c175d37e4a727e6ce68bd05232fa6970 28-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclTemplate.cpp
2a4a2dc9f7e5989725f132abda889c0dfef3461f 28-Oct-2010 John McCall <rjmccall@apple.com> Abandon the type-visibility optimization for functions. GCC doesn't do it,
and it's too much trouble to push for. Fixes PR8478.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
67fa6d5ea630c800c3c96e129129aba93d1487c2 28-Oct-2010 John McCall <rjmccall@apple.com> Abandon the type-visibility optimization for functions. GCC doesn't do it,
and it's too much trouble to push for. Fixes PR8478.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
33f6c3baf2be78c3a8f6f8e4d5fb8174c48ee92a 28-Oct-2010 John McCall <rjmccall@apple.com> When computing visibility, use the latest declaration's explicit visibility
attribute.

Part of rdar://problem/8595231



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e7bc9722c807030409178d4af8ce8d1260bbd821 28-Oct-2010 John McCall <rjmccall@apple.com> When computing visibility, use the latest declaration's explicit visibility
attribute.

Part of rdar://problem/8595231



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
07a82cafd1223c5d223377b078335252f6e607c4 28-Oct-2010 John McCall <rjmccall@apple.com> Don't override explicit visibility attributes on class members with
type-based visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117500 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6f4ac4b18fdfc410b547c82457fd7b229e48ec16 28-Oct-2010 John McCall <rjmccall@apple.com> Don't override explicit visibility attributes on class members with
type-based visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117500 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6a708e29f59d5c3c60ad3c707ed7d8deac19da7d 28-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> 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
eclTemplate.cpp
c8e5cf8f725e111965debb7130ef7466c0c73884 28-Oct-2010 Douglas Gregor <dgregor@apple.com> 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
eclTemplate.cpp
5c893f7845f175b6a7b00483595f7db9e8d16852 27-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> 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
ecl.cpp
06c919300ce39e50ed7f6dff5025c8ed96dcf221 27-Oct-2010 Douglas Gregor <dgregor@apple.com> 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
ecl.cpp
8d333e150526172be006c30636c568e582d5e4f3 27-Oct-2010 Chandler Carruth <chandlerc@gmail.com> Add helper for extracting the CXXRecordDecl for the implicit argument to
a member call expression. This has proved to be a common pattern for users of
RecursiveASTVisitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117439 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
007a9b1c632bfaac20e41c60cbe07fdc6d0e647c 27-Oct-2010 Chandler Carruth <chandlerc@gmail.com> Add helper for extracting the CXXRecordDecl for the implicit argument to
a member call expression. This has proved to be a common pattern for users of
RecursiveASTVisitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117439 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
c6a530df661d6811cbb10897fb88bdaa60d4478e 26-Oct-2010 John McCall <rjmccall@apple.com> Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
There's probably still significant padding waste on x86-64 UNIXen, but
the difference in 32-bit compiles should be significant.

There are a lot of Expr nodes left that could lose a word this way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117359 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
8e6285af719adc6f86d6faa235d22a08eb68ee3a 26-Oct-2010 John McCall <rjmccall@apple.com> Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
There's probably still significant padding waste on x86-64 UNIXen, but
the difference in 32-bit compiles should be significant.

There are a lot of Expr nodes left that could lose a word this way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117359 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
c8149b0df721d5ec08cb73021aa69e0b429d9a3f 26-Oct-2010 John McCall <rjmccall@apple.com> 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
STContext.cpp
3fa5cae9b3812cab9fab6c042c3329bb70a3d046 26-Oct-2010 John McCall <rjmccall@apple.com> 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
STContext.cpp
2243560c1b13d7746210c710dd8b39c0b9867981 26-Oct-2010 John McCall <rjmccall@apple.com> A couple of tweaks to the visibility rules:
- tags with C linkage should ignore visibility=hidden
- functions and variables with explicit visibility attributes should
ignore the linkage of their types
Either of these should be sufficient to fix PR8457.

Also, FileCheck-ize a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117351 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
ac65c6208d48b0f9b4661c30c28997a280ac5ba6 26-Oct-2010 John McCall <rjmccall@apple.com> A couple of tweaks to the visibility rules:
- tags with C linkage should ignore visibility=hidden
- functions and variables with explicit visibility attributes should
ignore the linkage of their types
Either of these should be sufficient to fix PR8457.

Also, FileCheck-ize a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117351 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
33ef9375258c2b83fdd49ceb3af93fb084773cb6 26-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> 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
STContext.cpp
32adc8bd6f05d1e26cc221102e48609da2c446ba 26-Oct-2010 Douglas Gregor <dgregor@apple.com> 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
STContext.cpp
fe1419904bce9fcd0423c0735ccee25445fecd61 25-Oct-2010 Chandler Carruth <chandlerc@gmail.com> 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
xprCXX.cpp
428edafa9eb80e01dd40aab31d4166a787a741e1 25-Oct-2010 Chandler Carruth <chandlerc@gmail.com> 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
xprCXX.cpp
83bf722acb37fcbd0468a782dcc219575ed48dd8 24-Oct-2010 Peter Collingbourne <peter@pcc.me.uk> Implement GNU C extension: two types are compatible if they appear
as a function argument, one of the types is a transparent union type
and the other type is compatible with a union member

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117243 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4846675e0e42d1802b0ffd8972a45e72aeb3758d 24-Oct-2010 Peter Collingbourne <peter@pcc.me.uk> Implement GNU C extension: two types are compatible if they appear
as a function argument, one of the types is a transparent union type
and the other type is compatible with a union member

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117243 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
094028ba7d3fd22d7d186f68b8c0b470f74260cb 24-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclCXX.cpp
b6cc0e1a789c3f33e3f4b1ee768e679a9beab941 24-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclCXX.cpp
60eadb6557fb19d5e83521a4834e56b2b849e164 24-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
ecl.cpp
565bf30bf5607b9740d288d8d9c45cf38ea75298 24-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
ecl.cpp
d9f2c76d28b9f8b2c58282666fc18f592c722496 24-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
STContext.cpp
eclBase.cpp
eclCXX.cpp
7b90340c9c7d07aef4e301e72b5e8a30d5f4f0c8 24-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
STContext.cpp
eclBase.cpp
eclCXX.cpp
0d12fcb65793e1bb5d5351c428d26ec9cd9b2a64 23-Oct-2010 Chandler Carruth <chandlerc@gmail.com> Update to use 'LLVM_*' macro names for attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117201 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
61e38285c54d5f3cad610cb421fad1504373e082 23-Oct-2010 Chandler Carruth <chandlerc@gmail.com> Update to use 'LLVM_*' macro names for attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117201 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
82254439b368de855d1e66440071017a1f2d4f0a 22-Oct-2010 John McCall <rjmccall@apple.com> 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
ecl.cpp
ype.cpp
1fb0caaa7bef765b85972274e3b434af2572c141 22-Oct-2010 John McCall <rjmccall@apple.com> 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
ecl.cpp
ype.cpp
589649f2f1703b72b37ff1a1776b8ac842b928a4 22-Oct-2010 Benjamin Kramer <benny.kra@googlemail.com> Move classes into anonymous namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
cb9c07418b699bd2b8384d31ff4392df7d76eb7c 22-Oct-2010 Benjamin Kramer <benny.kra@googlemail.com> Move classes into anonymous namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
91d4578cba8b8bba891056b8b96583ec71023aac 21-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.

Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0bab54cf82cd679152197c7a2eb938f8aa9f07dd 21-Oct-2010 Douglas Gregor <dgregor@apple.com> Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.

Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0fc35a77b2a5843fd536a5ad566e5f7779e9bb8c 21-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
b41d899a6023385c00a61eb9dd3e44db9dc7994e 21-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
3ac707097a306424889db03af1aad5402cb67fe6 21-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When implicit members are added to a C++ record, notify the serializer so that a chained PCH writes the definition again.
Thanks to Doug for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116975 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
046c03bc392db4b3f55e326d25565a787dbb9cc4 21-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When implicit members are added to a C++ record, notify the serializer so that a chained PCH writes the definition again.
Thanks to Doug for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116975 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4fe37db5acc06521348b9ef7384ca7cf8c4fb350 20-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Had the wrong type for ArgType. :-( Fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116893 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
c87fa06caeaec2d6cb9772a187708a8bf6cf187c 20-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Had the wrong type for ArgType. :-( Fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116893 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
6e62169f8f824a51efb78a14b41e2b786070a295 20-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> The type-to-delete may not be a pointer if it's a dependent type.
Here's example code:
---
template<class T> class MyClass {
struct S { };
S* NewS() { return new S; }
void DeleteS() { delete NewS(); }
};
---
CXXDeleteExpr::getDestroyedType() on the 'delete NewS()' expression
would crash before this change. Now it returns a dependent type
object. Solution suggested by dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116891 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0fa0b78c82b864be1f956ca4af9564db7c8bb5b6 20-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> The type-to-delete may not be a pointer if it's a dependent type.
Here's example code:
---
template<class T> class MyClass {
struct S { };
S* NewS() { return new S; }
void DeleteS() { delete NewS(); }
};
---
CXXDeleteExpr::getDestroyedType() on the 'delete NewS()' expression
would crash before this change. Now it returns a dependent type
object. Solution suggested by dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116891 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f4b75eed4bde5cd6995b23f411a9bfdbdc8d9dae 19-Oct-2010 Andrew Trick <atrick@apple.com> Putting back safe fixes 116836,116837,116838


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116866 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
220a9c82dc76a83a7f930879bf176783866c0514 19-Oct-2010 Andrew Trick <atrick@apple.com> Putting back safe fixes 116836,116837,116838


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116866 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6123163e8ebab6e6f8fdb2fbcddbf42616368fac 19-Oct-2010 Andrew Trick <atrick@apple.com> 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
ecl.cpp
7cffb55ef5845f86b41b83c332e4b453ee4dcb16 19-Oct-2010 Andrew Trick <atrick@apple.com> 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
ecl.cpp
dcb5abf17e36782350c5905c46946ddab9d78320 19-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Minor optimization; if we have a CXXRecordDecl we can get the definition decl directly without iterating over the redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116837 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0a2e0976d60264724b9a1e39d3f63660c94b607d 19-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Minor optimization; if we have a CXXRecordDecl we can get the definition decl directly without iterating over the redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116837 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
fa6a11a4734c3097b553969157acd67a8220e219 15-Oct-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Treat __extension__ like ParenExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116569 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b9eb35ced8369c8c8479efc17712faaf34e16c56 15-Oct-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Treat __extension__ like ParenExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116569 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
084ff0118a8a97513e725202a9ee4b35ed78a36c 14-Oct-2010 John McCall <rjmccall@apple.com> 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
ype.cpp
b870b88df784c2940efce448ebfaf54dece14666 14-Oct-2010 John McCall <rjmccall@apple.com> 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
ype.cpp
b43819e11870c7e1f9fb8572c2b62a1c446c66ae 14-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
ecordLayoutBuilder.cpp
36d2fd44bfeec417bbd7465218353abb8bf7e95d 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
ecordLayoutBuilder.cpp
eba7248ef9edc233d7e1ed89347c4cf2d5c2b89b 14-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
ecl.cpp
eclBase.cpp
eb5e9986e577b1e2bff3cca5973a2494fb593fbb 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
ecl.cpp
eclBase.cpp
7241e85cb216e6d122511c74cd96d98d0fd77e30 14-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> 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
xpr.cpp
xprClassification.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
8ac2d449820fd0df00fcbde5bf82165c1f49854d 14-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> 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
xpr.cpp
xprClassification.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
f11e7f7a1d04438e9bacdcfb04a110ea01dcadee 14-Oct-2010 John McCall <rjmccall@apple.com> Compress bit fields / enums from ReferenceType, BuiltinType, FunctionType, and
ObjCObjectType into Type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116472 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
71c3673d1e3756d8ef3cbc559fcad1d0b2f18a1f 14-Oct-2010 John McCall <rjmccall@apple.com> Compress bit fields / enums from ReferenceType, BuiltinType, FunctionType, and
ObjCObjectType into Type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116472 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
b0efb27f8928c8cdfd4b94b547ec9d87e31066cd 13-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a bit into Type that keeps track of whether there are any
unnamed or local types within that type. This bit is cached along with
the linkage of a type, so that it can be recomputed (e.g., when we see
that a typedef has given a name to an anonymous declaration).

Use this bit when checking C++03 [temp.arg.type]p2, so that we don't
walk template argument types repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116413 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
db4d4bb03df52920cf379797a7ff5c9900f938a6 13-Oct-2010 Douglas Gregor <dgregor@apple.com> Introduce a bit into Type that keeps track of whether there are any
unnamed or local types within that type. This bit is cached along with
the linkage of a type, so that it can be recomputed (e.g., when we see
that a typedef has given a name to an anonymous declaration).

Use this bit when checking C++03 [temp.arg.type]p2, so that we don't
walk template argument types repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116413 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e5ab6f7366103282ac9d851bd66b4a0d5e8e6819 13-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Compute whether a type is variably modified as we build the type,
rather than walking the type's structure every time we request this
information. Performance optimization; no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116409 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
35495eb14f22c4e96956912e23ca2a433227ad8c 13-Oct-2010 Douglas Gregor <dgregor@apple.com> Compute whether a type is variably modified as we build the type,
rather than walking the type's structure every time we request this
information. Performance optimization; no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116409 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ef84934a67ea13c93678e4236f0d28d1467a2844 13-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116391 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3bd5b6c3c2ad1d5a6f88cf21f627e8d4f03c4df4 13-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116391 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e623a9ee0ecf0983949e4b627d4221e303dce876 12-Oct-2010 John McCall <rjmccall@apple.com> Progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116287 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2cd11fefb62c580651e4269e1488381c2d6d07ad 12-Oct-2010 John McCall <rjmccall@apple.com> Progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116287 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
13e47eecb1470d59e399952280e68c16e302c75d 12-Oct-2010 John McCall <rjmccall@apple.com> Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116281 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2a984cad5ac3fdceeff2bd99daa7b90979313475 12-Oct-2010 John McCall <rjmccall@apple.com> Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116281 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d7ef5b26dba42b89869dd6f845a8b83093cbf9f0 11-Oct-2010 Daniel Dunbar <daniel@zuster.org> IRgen/Obj-C: Fix encoding of "long double".
- The mind boggles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116226 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3a0be84b2aed8563150cdbd976a98838afa261eb 11-Oct-2010 Daniel Dunbar <daniel@zuster.org> IRgen/Obj-C: Fix encoding of "long double".
- The mind boggles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116226 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b6d627c62b09f33f7d390132b662cbf5828b90d7 09-Oct-2010 John McCall <rjmccall@apple.com> Permit constant evaluation of const floating-point variables with
constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
189d6ef40eff11b83b2cda941d5ed89a5cef09b2 09-Oct-2010 John McCall <rjmccall@apple.com> Permit constant evaluation of const floating-point variables with
constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
df8e391abb083ea901108528cbd505980dccf695 09-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> 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
STContext.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
ype.cpp
1274ccd90aec0b205fc838c3d504821ccfb55482 09-Oct-2010 Douglas Gregor <dgregor@apple.com> 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
STContext.cpp
STImporter.cpp
ecl.cpp
eclBase.cpp
ype.cpp
9f34cffd32fceb5055c86bb6914077a9c209709a 08-Oct-2010 John McCall <rjmccall@apple.com> __attribute__((aligned(n))) directly specifies the alignment of a declaration
unless it's a non-packed field, in which case it can only increase the
alignment. [[align]] effectively works the same way for well-formed code
(because it's ill-formed for [[align]] to decrease alignment ever).

Fixes rdar://problem/8335865



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116070 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4081a5c5f1381c4ec77f8ab3866693917e4329c4 08-Oct-2010 John McCall <rjmccall@apple.com> __attribute__((aligned(n))) directly specifies the alignment of a declaration
unless it's a non-packed field, in which case it can only increase the
alignment. [[align]] effectively works the same way for well-formed code
(because it's ill-formed for [[align]] to decrease alignment ever).

Fixes rdar://problem/8335865



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116070 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
08bd5de9afb2a60e60fbb7530aee5de64e085121 07-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a crash encoding ivars of vector types and
to match gcc's encoding. Fixes //rdar: // 8519948.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115980 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e6012c7ecb9d848f4091c8c48e7d9946cc36b23f 07-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a crash encoding ivars of vector types and
to match gcc's encoding. Fixes //rdar: // 8519948.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115980 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b0406ccde76ee9b4f8601a693f4cd49388873a73 06-Oct-2010 Stephen Hines <srhines@google.com> Add LOCAL_MODULE_TAGS to clang Android.mk files.

Change-Id: Iba0dd9023388948d2c3fcb3522cea5d5d9a264a7
ndroid.mk
14b135ed28e79e44f1e3237209d24cac3af9e91b 06-Oct-2010 John McCall <rjmccall@apple.com> Use a more conventional/efficient implementation for isEnumeralType()
and isBuiltinType().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115724 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
3ff83dd534ccc828203670ce3f5125a4eb4199f8 06-Oct-2010 John McCall <rjmccall@apple.com> Use a more conventional/efficient implementation for isEnumeralType()
and isBuiltinType().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115724 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
661c3e664b30047c5f59c6b89c1baad4884bc542 02-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115387 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
81134ad7a056e45b7cb4ee1b562ab8c8413d65b7 02-Oct-2010 Douglas Gregor <dgregor@apple.com> Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115387 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
22d14e8ce25f73ad06931bbff0213882249829a3 02-Oct-2010 Chris Lattner <sabre@nondot.org> enhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
are required to be ICE's. No clients of this new functionality yet!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115366 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
14e0e7436cf6650a72052baea1f8ebe644cef489 02-Oct-2010 Chris Lattner <sabre@nondot.org> enhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
are required to be ICE's. No clients of this new functionality yet!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115366 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
17a51c4ff44317ca7faa0e9f4d5b86c649a95936 02-Oct-2010 Chris Lattner <sabre@nondot.org> random cleanups, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115361 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
33daae66462e8f51ee153463b32bdefd60c801aa 02-Oct-2010 Chris Lattner <sabre@nondot.org> random cleanups, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115361 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b5288692a4e585568459261b8aa1ab5aa1aff524 01-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> 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
STContext.cpp
dab60ad68a3a98d687305941a3852e793705f945 01-Oct-2010 Douglas Gregor <dgregor@apple.com> 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
STContext.cpp
968488bc2b43e040122e0a074daf1e078d9b8f8a 01-Oct-2010 Chris Lattner <sabre@nondot.org> Various builtins a require an integer constant. Not providing
one results in an obscure error from the backend that doesn't make
sense. Capture this information in the .def files for builtins with
a new "I" modifier letter indicating the an argument needs to be an ICE.

Nothing uses this yet, but sema will eventually enforce this (eliminating
some special cases from semachecking.cpp) and codegen will use this to
force an ICE value, preventing backend error messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115302 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
393bd8e185692a451b2ba16bdfc9e7d3543b4217 01-Oct-2010 Chris Lattner <sabre@nondot.org> Various builtins a require an integer constant. Not providing
one results in an obscure error from the backend that doesn't make
sense. Capture this information in the .def files for builtins with
a new "I" modifier letter indicating the an argument needs to be an ICE.

Nothing uses this yet, but sema will eventually enforce this (eliminating
some special cases from semachecking.cpp) and codegen will use this to
force an ICE value, preventing backend error messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115302 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
70331cc565257d7959a68e168e2b820c15b690ef 30-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make the FileID import map key on FileID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115118 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
535a3e20104461c136654d59fb833ae80644ae79 30-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make the FileID import map key on FileID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115118 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
1c0131e5b7914bfd65abf07004f07c5881591fdc 29-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115026 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e80622fd48261b6e5c7e6629dcfee2f76b124487 29-Sep-2010 Douglas Gregor <dgregor@apple.com> Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115026 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
62ad8842288762f483eba3af9e9956e3444b281e 29-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115007 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7a39dd01edc43aa5f058e7259a39737fc1f43792 29-Sep-2010 Douglas Gregor <dgregor@apple.com> Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115007 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f48dc0e6de265a849c4ef938ba6666b679c9e0b6 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit in
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114993 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
2138664dd2cff39de52ff11ca35f653c20b2e4b0 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit in
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114993 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
88a8e683b56be0b9629d7c58d0d5423058132a57 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114984 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
85606ebf3dd1b5dd81a59ef25b5ad47627664774 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114984 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
13a6750d53b50870295e599cee062c3c299e5b55 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114980 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
2cf9d656f6283f2a8be0549da110d7cfbb1ea4b2 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114980 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
a420ef387d84290854387e4735a3ca3ab13aa562 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Reinstate r114921, which I've exonerated via a self-host build.

Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114977 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9fe183ae1ec568716501f861235afecebee8cd45 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Reinstate r114921, which I've exonerated via a self-host build.

Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114977 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
99c210e3c34130c08b1ce86ffc2b594a087cb354 28-Sep-2010 Bill Wendling <isanbard@gmail.com> Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
2a674e8e443b7a3e77957078248fb52b3b1ec321 28-Sep-2010 Bill Wendling <isanbard@gmail.com> Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
36da5c4ee51506f0c0a95008872e281a373498e1 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e10288c1e9e06dbd715f47bfaa22ce5d65fdf096 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cbd60a6b8b2a296e3a68b92a8398a4dedcfc950d 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114925 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4a74df5901330c577d0a30d052338d06bbf9e279 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114925 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
921255c54a74568ce4cf22e2ad0be6f2d8a40efc 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114924 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
cdbfa6c4113411debfed9ffec2a45bd50b13e10f 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114924 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
af80314a085ba7ee3ca18ca97e75806c87adef02 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114921 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6e3c7713ca126c76053cc092670a949a5e15ddaf 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114921 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cb807137848e8b6585f1d58ebfe53729131d9afa 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114918 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0ed2e0823cc7b727abd9307db4cd887f293eebe2 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114918 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7348ee8f60a5f5541164fe849c34c4b0c4c0fb9e 28-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to support transparent_union arguments
passed to nonnull attributed functions. Implements radar
6857843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114917 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ff3a078d2a67db9ae6ff4cc0f799a209f85a4e91 28-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to support transparent_union arguments
passed to nonnull attributed functions. Implements radar
6857843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114917 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d01c4c7e227fce7200b84349859b8c50ee0a35bb 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> 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
eclCXX.cpp
3e9438b5251a547253d64169863c2909b9b2772a 28-Sep-2010 Douglas Gregor <dgregor@apple.com> 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
eclCXX.cpp
5889acf37f03a14ba7eb3406572f10d95f785e6b 28-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114899 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
27c08ab4859d071efa158a256f7e47e13d924443 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114899 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
28abaf338c3165a1b14bb91b1e649b4ece22e02e 27-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().

This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114889 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
5c0646b98b203d105c10ad8cc11be11cc99a4218 27-Sep-2010 Douglas Gregor <dgregor@apple.com> Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().

This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114889 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
98049391f9fa72b0a56ba02250ad79ff12be0c87 27-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Copying result of object property reference expression
into a temporary is elidable as well.
(Finishes up radar 8291337).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114845 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
db148be93c9af45da1f3aa9302c577618a56e6ea 27-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Copying result of object property reference expression
into a temporary is elidable as well.
(Finishes up radar 8291337).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114845 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1cde322deae864b37dfafabb2c14e3fb35c62cc5 27-Sep-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed isConstantInitializer for __builtin_choose_expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114820 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5cadfab3f2e7660453211eb0e00314bd40d93014 27-Sep-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed isConstantInitializer for __builtin_choose_expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114820 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0f881c3735a8f5962943d799105adb63a873a2c2 24-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch implements passing arrays to functions expecting
vla. Implements pr7827.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
745da3a5bb4ea35f93f50301e7fbbb7d78d3b6bb 24-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch implements passing arrays to functions expecting
vla. Implements pr7827.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
003a582e6b61ab0c76db684c90147f8aab723681 22-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Implement -Wpadded and -Wpacked.

-Wpadded warns when undesired padding is introduced in a struct. (rdar://7469556)
-Wpacked warns if a struct is given the packed attribute, but the packed attribute has no effect
on the layout or the size of the struct. Such structs may be mis-aligned for little benefit.

The warnings are emitted at the point where layout is calculated, that is at RecordLayoutBuilder.
To avoid calculating the layouts of all structs regardless of whether they are needed or not,
I let the layouts be lazily constructed when needed. This has the disadvantage that the above warnings
will be emitted only when they are used for IR gen, and not e.g with -fsyntax-only:

$ cat t.c
struct S {
char c;
int i;
};
void f(struct S* s) {}

$ clang -fsyntax-only -Wpadded t.c
$ clang -c -Wpadded t.c -o t.o
t.c:3:7: warning: padding struct 'struct S' with 3 bytes to align 'i' [-Wpadded]
int i;
^
1 warning generated.

This is a good tradeoff between providing the warnings and not calculating layouts for all
structs in case the user has enabled a couple of rarely used warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114544 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
78a916ec5ff5b66adec3c499e1b9af7b87668309 22-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -Wpadded and -Wpacked.

-Wpadded warns when undesired padding is introduced in a struct. (rdar://7469556)
-Wpacked warns if a struct is given the packed attribute, but the packed attribute has no effect
on the layout or the size of the struct. Such structs may be mis-aligned for little benefit.

The warnings are emitted at the point where layout is calculated, that is at RecordLayoutBuilder.
To avoid calculating the layouts of all structs regardless of whether they are needed or not,
I let the layouts be lazily constructed when needed. This has the disadvantage that the above warnings
will be emitted only when they are used for IR gen, and not e.g with -fsyntax-only:

$ cat t.c
struct S {
char c;
int i;
};
void f(struct S* s) {}

$ clang -fsyntax-only -Wpadded t.c
$ clang -c -Wpadded t.c -o t.o
t.c:3:7: warning: padding struct 'struct S' with 3 bytes to align 'i' [-Wpadded]
int i;
^
1 warning generated.

This is a good tradeoff between providing the warnings and not calculating layouts for all
structs in case the user has enabled a couple of rarely used warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114544 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
55d7c1787246c4a84fa303ee0f5a221e10c0aebc 19-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Warn when an expression result in a LabelStmt is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114314 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d2827af6f96d441d72315dbe6d8505c3be0f2aa6 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn when an expression result in a LabelStmt is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114314 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b005955c704be40d41a7cc8d08d5dddc2ca41194 18-Sep-2010 Ted Kremenek <kremenek@apple.com> Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114235 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
c57d655921ad0b20e1af50cbab5595520bd5da85 18-Sep-2010 Ted Kremenek <kremenek@apple.com> Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114235 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
a13162c718c930ae0b1c22b300adb3eb814f1e4b 16-Sep-2010 John McCall <rjmccall@apple.com> Right, there are *two* cases of pr-value class-type expressions that don't
derive from temporaries of the same type. Black-list member expressions
as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114071 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
19e60ad937af50843a653fa19c8be6a83a64f24f 16-Sep-2010 John McCall <rjmccall@apple.com> Right, there are *two* cases of pr-value class-type expressions that don't
derive from temporaries of the same type. Black-list member expressions
as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114071 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0950dbc68005b34acb4c4970af5e883dadde5968 15-Sep-2010 John McCall <rjmccall@apple.com> Tweak comment as suggested by Sebastian.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114019 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
58277b57f9492d0234748be89bcad48b322c5cf7 15-Sep-2010 John McCall <rjmccall@apple.com> Tweak comment as suggested by Sebastian.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114019 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c1226787962c6550878b4e0df3c4bbb0fbf4b3a2 15-Sep-2010 John McCall <rjmccall@apple.com> one piece of code is responsible for the lifetime of every aggregate
slot. The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision. The main obstacle here is that
IR-generation must be much more careful about making sure that exactly



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113962 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
558d2abc7f9fd6801cc7677200992313ae90b5d8 15-Sep-2010 John McCall <rjmccall@apple.com> one piece of code is responsible for the lifetime of every aggregate
slot. The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision. The main obstacle here is that
IR-generation must be much more careful about making sure that exactly



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113962 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8923ba566b1d8f281ddcb803d6f6a5d45df23091 15-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Fix classification of statement expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113917 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
226cbfcd97e400ac1c1afc06d646424136cfe196 15-Sep-2010 Douglas Gregor <dgregor@apple.com> Fix classification of statement expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113917 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
3b2c9345bf8cf5c5eace1cbca6329a8266a92c90 15-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> RHS of property expression assignment requires
copy initialization before passing it to
a setter. Fixes radar 8427922.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113885 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
c4e1a6815235ade1a4affe3511ca5ce2dcc64467 15-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> RHS of property expression assignment requires
copy initialization before passing it to
a setter. Fixes radar 8427922.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113885 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
c00411820af08810fa952049c5ea1c9819cbfb60 15-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
5833b0b831d6afae2885e6af420e2bda639652e6 15-Sep-2010 Douglas Gregor <dgregor@apple.com> When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
3049ec9961d1a1f0570a24dc601e6a362129b35d 10-Sep-2010 Shih-wei Liao <sliao@google.com> Merge changes from upstream repository (r112367)

Change-Id: Ib88c8fd890e7c8c5597ea2b86cfa934438965c08
201b90641327e810dd785178f47429e932bf963b 14-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the default case in the expression-classification code, so
that we're sure to keep it updated when new expression kinds
emerge. Also fixes a few little bugs in the classification of
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113864 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
4178b573b82449c2d888ea1f0957a478534e118c 14-Sep-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default case in the expression-classification code, so
that we're sure to keep it updated when new expression kinds
emerge. Also fixes a few little bugs in the classification of
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113864 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
fe0fb28bcfc69003c77765352186302b6ba30a90 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> 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
MakeLists.txt
560a921b85773ac7c2d1a7a4aec4682c822c5cb4 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> 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
MakeLists.txt
be19ac06518581e1080abb13cb6eafff431b2585 14-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113794 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
751025d5d174ab75dc3788211581d9fbe6224841 14-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113794 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8510a307c69112f0df8805501c0682e28513b527 13-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> 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
xprCXX.cpp
xprConstant.cpp
0dfd848fa4c9664852ba8c929a8bd3fce93ddca2 13-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> 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
xprCXX.cpp
xprConstant.cpp
d829ec2516b47e194273d95093f629464737c84f 13-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Avoid setters in ASTDeclReader::VisitClassTemplatePartialSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113743 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
8fed4b4bc93cce4d15bdb79f9e30cc25a93c8143 13-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Avoid setters in ASTDeclReader::VisitClassTemplatePartialSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113743 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
3daab9435cc7a545a008430887550acc0473049f 11-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Test destructors in delete expressions and of temporaries for throwing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113664 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0b34cf7399e61ef33dc5a3af405351822eeb5f3e 11-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Test destructors in delete expressions and of temporaries for throwing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113664 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
52f52b04cb07144eba019ccd7dae0ce4f18cec84 11-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Address Doug's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113650 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5221d8f2da008689f7ff9476e6522bb2b63ec1a3 11-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Address Doug's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113650 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
42591fac8f92efab995608d36060579a9b688d66 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> 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
MakeLists.txt
5a7f34958ca6f2fa8a52e9921cf521cbb92ae070 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> 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
MakeLists.txt
a88c04670bdf0072fe21812fc0b8e30299fbfb9b 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> First version of a testcase, plus fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113624 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
295995c9c3196416372c9cd35d9cedb6da37bd3d 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> First version of a testcase, plus fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113624 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
287e188b96e61b218be777ade96ff894e8c01a99 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Define and implement CXXNoexceptExpr. Create it in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113623 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
2e156225a29407a50dd19041aa5750171ad44ea3 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Define and implement CXXNoexceptExpr. Create it in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113623 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
f0cc32bb48ba5a6e06393f8fa32c91f432579bc8 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Expr::CanThrow, a function that applies the noexcept operator rules to expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113621 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
369e51fa400aeb5835bb9af4634ea516c11429a7 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Expr::CanThrow, a function that applies the noexcept operator rules to expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113621 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8e6989c6fcf9a6fcb410641fbda783e560d40bb4 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make CallExpr::getCalleeDecl look through pointer derefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113620 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
200121569dc6cff10a1fb6ed7500098770b9dd25 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make CallExpr::getCalleeDecl look through pointer derefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113620 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
20991b29460183852044712a03fa1647e9a14176 10-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Support strlen() and __builtin_strlen() as constant expressions with
the call argument is a string literal. Fixes
<rdar://problem/8413477>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113580 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5726d405e71f11feaaf0c8f518abe26e909537a4 10-Sep-2010 Douglas Gregor <dgregor@apple.com> Support strlen() and __builtin_strlen() as constant expressions with
the call argument is a string literal. Fixes
<rdar://problem/8413477>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113580 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
783c10d7a1509c6ae297a34be06e619ca6bd86c4 10-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> property reference expression used on lhs of assignment
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113555 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
4088ec00f035cf3ced00aab7dac611ce6ec1988e 10-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> property reference expression used on lhs of assignment
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113555 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
7c19c19eac2eb4815dd086173ee6d990478264b1 09-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> 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
xprCXX.cpp
3d37c0ada0e46b87be0a10e8d52d990a97d3907a 09-Sep-2010 Douglas Gregor <dgregor@apple.com> 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
xprCXX.cpp
38a9425a248a9479dbbc245b4a4dd03be3c06c8a 09-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
ecl.cpp
a626a3d0fb74455651f742c0938902a42e6e71c8 09-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
ecl.cpp
5c3f73a560567da2aefddd2c11606b01bc0afefb 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Initialize 'AllEnumCasesCovered' in SwitchStmt's constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113448 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
780d885e77710626695e581e56aef228b291a9b7 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Initialize 'AllEnumCasesCovered' in SwitchStmt's constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113448 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
0d4739a839520772aab5652dd1dcd5009ddc1969 09-Sep-2010 Francois Pichet <pichet2000@gmail.com> Fix warnings caused by new CXXUuidofExprClass enumerator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113444 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9be88403e965cc49af76c9d33d818781d44b333e 09-Sep-2010 Francois Pichet <pichet2000@gmail.com> Fix warnings caused by new CXXUuidofExprClass enumerator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113444 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
49ab4fb2638909d6713fbdeac9da96d38a4630a8 08-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113419 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
d580e5636568cdc8db0584dd3b7a53323f981e48 08-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113419 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5aed99a6e77ca28d524315fc3d500610e4abc5af 08-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Clean up some of the CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113416 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bfae8bd6259460ae0668cad39c141504511d19b0 08-Sep-2010 Douglas Gregor <dgregor@apple.com> Clean up some of the CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113416 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
545f1ccf514d62d9ad5bb1c1e1063c945d2cf897 08-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113414 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
56a965c0f77c9e6bffd65cc8f8796442a8527381 08-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113414 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1b8b1fd85b12180523a12cf2841806f5cfab1fd6 08-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
65b63ec1410f09e1f3cdb847018d678b8f8fc3f7 08-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
6fa68948f7d604946617deb5de14ce3d7905b21c 08-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a crash when overloading id with objc_object*.
Radar 8400356.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113397 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d1877953f06df6df9b2cd5fc04b49e80eec66019 08-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a crash when overloading id with objc_object*.
Radar 8400356.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113397 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
8474ba33ad986765ec3664b38478846b4dfa5e77 08-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
ecl.cpp
eclTemplate.cpp
emplateName.cpp
6b5415196327fa8ef00f028ba175fafef1738ae1 08-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
ecl.cpp
eclTemplate.cpp
emplateName.cpp
4d58b6820c0a78959a00e45dd77a55178e8c6d94 08-Sep-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator implementation part 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
01b7c3028da5bbcb9f8e52ba67e4613070de0e60 08-Sep-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator implementation part 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
599d675f806426575d43296fe05cd0e8193514e4 08-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow (cv) void and incomplete arrays to be passed to the type traits.

Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113326 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
607a1788d9529c8e8494ac528764aa2c678a1a97 08-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow (cv) void and incomplete arrays to be passed to the type traits.

Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113326 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
95bea5fdd03b244075607f1d3e94754e2d95ddf7 08-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> 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
xprCXX.cpp
tmtPrinter.cpp
ab6677ec401cfd2c82b34e4cdfebd55a9dc25778 08-Sep-2010 Douglas Gregor <dgregor@apple.com> 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
xprCXX.cpp
tmtPrinter.cpp
abc69809195e31749d9f72a306acf5cace6755e0 08-Sep-2010 Ted Kremenek <kremenek@apple.com> Fix DeclPrinter to not include '=' in printing when no initializer is provided for a VarDecl. Patch by Jim Goodnow II!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113296 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
bccfd31ac3b7769d681d56d514ad3a0a6e7b5d93 08-Sep-2010 Ted Kremenek <kremenek@apple.com> Fix DeclPrinter to not include '=' in printing when no initializer is provided for a VarDecl. Patch by Jim Goodnow II!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113296 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
5b8552c7a4a4db82b98b490bdb67a1a07a794345 07-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> 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
xprCXX.cpp
1bb2a93ab7b1499dda6f6b58865bd0dce1864228 07-Sep-2010 Douglas Gregor <dgregor@apple.com> 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
xprCXX.cpp
f765e7955fa622d2dcd4238b6356c8c642cc1aaf 06-Sep-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of unnecessary return.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113132 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fdac7d4f8b94c5005b6f5d21b44548aa182e16ef 06-Sep-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of unnecessary return.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113132 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0db67e8c1036ec028bb8a47021a7978f89e91743 06-Sep-2010 Eli Friedman <eli.friedman@gmail.com> PR7242: Make sure to use a different context for evaluating constant
initializers, so the result of the evaluation doesn't leak through
inconsistently. Also, don't evaluate references to variables with
initializers with side-effects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113128 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a7dedf7004e8ac3f947d6817370b2778fa648c2b 06-Sep-2010 Eli Friedman <eli.friedman@gmail.com> PR7242: Make sure to use a different context for evaluating constant
initializers, so the result of the evaluation doesn't leak through
inconsistently. Also, don't evaluate references to variables with
initializers with side-effects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113128 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
573f43ba346726e8435e8c71b9a724c50b3a73b0 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const id<NSFoo> *" instead of "id<NSFoo> const *".

I think this wraps up all the legal cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113096 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
d7e52b8141c8fbff1b9f9e7960c925a00953cc12 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const id<NSFoo> *" instead of "id<NSFoo> const *".

I think this wraps up all the legal cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113096 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
b75d49b98ed5d3cf2d3aab35a6fd7f4d19ab7b94 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const id<NSFoo> *" not "id<NSFoo> const*"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113095 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
78643b050cd6d6370e5a9a686ab6bc942959137f 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const id<NSFoo> *" not "id<NSFoo> const*"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113095 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
bb41ffc63a26aa50fcfec51dc847dd082ba06d63 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const std::vector<int>*" not "std::vector<int> const*"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113094 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
2f69a816a0986caa24d8e4273a3f83420b05f707 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const std::vector<int>*" not "std::vector<int> const*"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113094 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
7f2fbbd209e3dfe99576008fab475b91bdf6f775 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const _Complex float *" not "_Complex float const *"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113093 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
219b9e46f8ca5ec4441e4a449f449e246c4770a2 05-Sep-2010 Chris Lattner <sabre@nondot.org> "const _Complex float *" not "_Complex float const *"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113093 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
da004db50cc2f5917b3a94d5cc54b4a6e85fdb05 05-Sep-2010 Chris Lattner <sabre@nondot.org> 'const std::type_info*' instead of 'std::type_info const*'



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113092 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
0c42bb653dc40b1caae010618831e320af824b18 05-Sep-2010 Chris Lattner <sabre@nondot.org> 'const std::type_info*' instead of 'std::type_info const*'



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113092 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
5a77e583f77fd9ccf5878441069225e9136d28f9 05-Sep-2010 Chris Lattner <sabre@nondot.org> print "const intptr_t" instead of "intptr_t const"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113091 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
66cf2d1290c598fcbaf1c6b50411f2513daf3b3e 05-Sep-2010 Chris Lattner <sabre@nondot.org> print "const intptr_t" instead of "intptr_t const"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113091 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
03028a90c18c484ab477e6535441ec5825a7328a 05-Sep-2010 Chris Lattner <sabre@nondot.org> make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning. As usual, the most
fun with this sort of change is updating all the testcases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
58f9e13e87e57236fee4b914eea9be6f92a1c345 05-Sep-2010 Chris Lattner <sabre@nondot.org> make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning. As usual, the most
fun with this sort of change is updating all the testcases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
e02c77dd762ac5018524c976da4ea58a884f377a 05-Sep-2010 Chris Lattner <sabre@nondot.org> revert this, it isn't safe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113088 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
59742de0f9d4fbd421b69ed0c1b6c7a6d83339fb 05-Sep-2010 Chris Lattner <sabre@nondot.org> revert this, it isn't safe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113088 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
b1efe714aea27e2c654b6001895274fe1d6419cb 05-Sep-2010 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113087 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
37edc00b6a08dcb094d812782ea4bfedab3b6445 05-Sep-2010 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113087 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
374c4d02b5f70ab07b15fc78ff5d0fd4e2f7c8da 05-Sep-2010 Chris Lattner <sabre@nondot.org> revise r112365 to fix the actual problem: the isa<TagType>(Underlying)
check in the "typedef for anonymous type" check should have been a
getAs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113085 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
c3f8c0731ef59ba79753f89f1c108b8134f6ae83 05-Sep-2010 Chris Lattner <sabre@nondot.org> revise r112365 to fix the actual problem: the isa<TagType>(Underlying)
check in the "typedef for anonymous type" check should have been a
getAs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113085 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
586019a5254bfbe01abf6921fa7dd72744c17225 04-Sep-2010 Zhanyong Wan <wan@google.com> fix a crash in RecursiveASTVisitor's child classes (PR8403); reviewed by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113038 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
f38ef0c63a39306e835a91fd989cf30182a592e2 04-Sep-2010 Zhanyong Wan <wan@google.com> fix a crash in RecursiveASTVisitor's child classes (PR8403); reviewed by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113038 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
23cf1f9d0f258b16fb5c07a14ceb7aba4562903e 03-Sep-2010 Dawn Perchik <dawn@burble.org> Add symantic support for the Pascal calling convention via
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions). Support still needs to be added to llvm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112939 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
52fc314e1b5e1baee6305067cf831763d02bd243 03-Sep-2010 Dawn Perchik <dawn@burble.org> Add symantic support for the Pascal calling convention via
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions). Support still needs to be added to llvm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112939 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ypePrinter.cpp
a85dad8a28feae7e96e6e14d76942596a2283875 03-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement __has_virtual_destructor. Patch by Steven Watanabe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112905 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
d4b25cbde13fc973673234f26de48c940723e679 03-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement __has_virtual_destructor. Patch by Steven Watanabe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112905 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
499d0f4b4f76328812ed192cb9800791dc333170 02-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> 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
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
e2ca6d4a2f41876930fbd304caa706452d2569d8 02-Sep-2010 Douglas Gregor <dgregor@apple.com> 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
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
4ac972be29df254eb6b299e305bb9ae5e54db7a0 01-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Fix the source-range information for an EnumConstantDecl; previously,
it did not include the initializer expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112739 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8e7139c9554230df64325f70fe202c83491ba7f5 01-Sep-2010 Douglas Gregor <dgregor@apple.com> Fix the source-range information for an EnumConstantDecl; previously,
it did not include the initializer expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112739 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7a819efa72cc057766b606624a12ee1f36f28b2e 01-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Transfer calling-convention attributes down to member function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
afac01d7e76f28d5e5a5c377369cc400919387ee 01-Sep-2010 Douglas Gregor <dgregor@apple.com> Transfer calling-convention attributes down to member function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8b4221f4e362f2263bb87550fd4c58ee32fa4366 01-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> 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
eclCXX.cpp
0a35bceb7768fc0be62cb644a4e31d8bfd9fb44a 01-Sep-2010 Douglas Gregor <dgregor@apple.com> 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
eclCXX.cpp
51e8eea95cb6886b76e9d72eadce34aba72dd35a 01-Sep-2010 Ted Kremenek <kremenek@apple.com> 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
STContext.cpp
STImporter.cpp
eclObjC.cpp
53b9441b5a81a24fa1f66f3f6416f1e36baa9c2f 01-Sep-2010 Ted Kremenek <kremenek@apple.com> 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
STContext.cpp
STImporter.cpp
eclObjC.cpp
458da213564aae23c42bd0ff6e906de7fd73b8cd 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make inline namespace not be transparent after all. The concept simply doesn't fit. Instead, special-case the few places where transparent contexts have the desired behavior for inline namespaces. Fixes a redeclaration issue in inline namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112637 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
410c4f2eb5e6a8c2318cacb9a6751f1b4fcff166 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make inline namespace not be transparent after all. The concept simply doesn't fit. Instead, special-case the few places where transparent contexts have the desired behavior for inline namespaces. Fixes a redeclaration issue in inline namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112637 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5e1fe4d264f3777fbd3afd3301e0e515d88425d8 31-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> 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
tmtDumper.cpp
f9b949fecf339a2c9bd97dd11a272c4878f85ce4 31-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> 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
tmtDumper.cpp
8111eeeea1237a95d4483ab2b1bb5bc41eda225d 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement the __has_nothrow trait family, by Steven Watanabe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112577 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
c238f09a268cd87a2568f6c97181252687ae07b1 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement the __has_nothrow trait family, by Steven Watanabe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112577 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
6bd5085ed4a787ab6a534719505b0a84f6606164 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Enable inline namespaces in the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112564 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
4e4d57069cf9402728e05f7fc856295a86e4801f 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Enable inline namespaces in the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112564 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
92ae2b40f721121f8944a1bb3c69b23d96bcff31 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112563 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
7a126a474fdde06382b315b4e3d8ef0a21d4dc31 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112563 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
fc3a2f7c4e6d3796e331b62f2355291f507e47fb 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Decl::getEnclosingNamespaceContext has no reason to explicitly skip transparent contexts, and would be wrong to do so with inline namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112562 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
51a8a378012b5d6a1306fdd75bd135fea3e23b7b 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Decl::getEnclosingNamespaceContext has no reason to explicitly skip transparent contexts, and would be wrong to do so with inline namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112562 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
28a209c7deee1ce5b6f101fabbedf74fa626e557 30-Aug-2010 Sean Hunt <rideau3@gmail.com> Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
6cf750298d3621d8a10a6dd07fcee8e274b9d94d 30-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
7e248dedc344f47e2a4e91fc81da0542677c2934 30-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Heap-allocate the attribute vectors in
ASTContext::DeclAttrs. Otherwise, iterators will go stale when the
DenseMap reallocates, which can cause crashes when, e.g., looping over
the attributes in a template to instantiate them and add the results
to the instantiation of that template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6320064d0c60fa8683f5623881c9394fd4aa7689 30-Aug-2010 Douglas Gregor <dgregor@apple.com> Heap-allocate the attribute vectors in
ASTContext::DeclAttrs. Otherwise, iterators will go stale when the
DenseMap reallocates, which can cause crashes when, e.g., looping over
the attributes in a template to instantiate them and add the results
to the instantiation of that template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0fd5a8586deed8910d4e62ef0df12f0e6f48f24b 29-Aug-2010 Sean Hunt <rideau3@gmail.com> Implement C++0x user-defined string literals.

The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112458 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
0016d519b831859526b79405cdae4c64c73731c8 29-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement C++0x user-defined string literals.

The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112458 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
0af240e27946edfe7cc0bb425ca54d0817d2b468 28-Aug-2010 Chris Lattner <sabre@nondot.org> improve comment, patch by Vladimir Kirillov!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112374 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
c7acc66050a96571739eeb017a867df27e6bcfc3 28-Aug-2010 Chris Lattner <sabre@nondot.org> improve comment, patch by Vladimir Kirillov!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112374 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
8b1ec8e2848bccb44913ace5d0425f4db20b43ec 28-Aug-2010 Gabor Greif <ggreif@gmail.com> suppress annoying textual repetition as 'aka'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112365 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
d52787433142ee5957fc84fe7c3d3d1218a80556 28-Aug-2010 Gabor Greif <ggreif@gmail.com> suppress annoying textual repetition as 'aka'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112365 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
a53d7f2521cfe49435fb52d4bd62110a7fbe5a27 28-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
STImporter.cpp
xpr.cpp
9996a7f06a3c5b4554692e7177930cf4e8ef09af 28-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
STImporter.cpp
xpr.cpp
580dec2c9965112b0c9854467aa7ae1463c4ea94 27-Aug-2010 John McCall <rjmccall@apple.com> Propagate whether an id-expression is the immediate argument of
an '&' expression from the second caller of ActOnIdExpression.

Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.

Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a
permitted form of use for member functions.

Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112258 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
9c72c6088d591ace8503b842d39448c2040f3033 27-Aug-2010 John McCall <rjmccall@apple.com> Propagate whether an id-expression is the immediate argument of
an '&' expression from the second caller of ActOnIdExpression.

Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.

Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a
permitted form of use for member functions.

Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112258 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
639b747d340294d2576078075503c0b6e620b920 27-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Don't recurse twice when we can recurse once

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112246 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
df1367af26cb2959775e9511108f12dcd2370a27 27-Aug-2010 Douglas Gregor <dgregor@apple.com> Don't recurse twice when we can recurse once

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112246 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f680d9ef70e596ada56e0fc91a3f17dad2a81e5a 26-Aug-2010 John McCall <rjmccall@apple.com> 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
ecl.cpp
eclPrinter.cpp
tmtDumper.cpp
d931b086984257de68868a64a235c2b4b34003fb 26-Aug-2010 John McCall <rjmccall@apple.com> 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
ecl.cpp
eclPrinter.cpp
tmtDumper.cpp
22ce6f959936cbf714e8bdc9a4afe0d1e3570ef5 26-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112112 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8028bfaa96f3dbe224cc3766a04e9a68f22e4a64 26-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112112 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aeb70b12ab1af1ba7e5e48cee3903d1a768bca90 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
arentMap.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprClassification.cpp
xprConstant.cpp
arentMap.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
6f072329e9c9b7d44f0fa2a34528193a6f478414 25-Aug-2010 John McCall <rjmccall@apple.com> 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
STImporter.cpp
xpr.cpp
xprClassification.cpp
tmtDumper.cpp
tmtProfile.cpp
5baba9d98364a3525d6afa15a04cdad82fd6dd30 25-Aug-2010 John McCall <rjmccall@apple.com> 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
STImporter.cpp
xpr.cpp
xprClassification.cpp
tmtDumper.cpp
tmtProfile.cpp
b9a751e1e9cca15b12dcc6d6005d7465ff799b5e 25-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Make sure volatile variables are emitted even if static. Fixes rdar://8315219

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112043 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f869d205c5985121b8134a9174ed8d3b136637b5 25-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make sure volatile variables are emitted even if static. Fixes rdar://8315219

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112043 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c537587eae9c934dcd898ea022a96473d06b43ad 25-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Plug leak. The DenseMaps of CXXRecordLayoutInfo weren't freed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112006 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
42f81e674ba420406d9efb8b52d4e59e613ebcea 25-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Plug leak. The DenseMaps of CXXRecordLayoutInfo weren't freed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112006 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
1743691bdf694eff22d7b1d301966a5c6d5752ef 25-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Use a smart pointer instead of delete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112005 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
cfe17e5c82762cc854012e472b66f4278f0a4a2a 25-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use a smart pointer instead of delete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112005 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
693a734a0661bb432d95442fd9b459e6e37293e2 23-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> 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
eclObjC.cpp
000835d0b04345c0014c603fe6339b3bc154050e 23-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> 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
eclObjC.cpp
4167f7f99a33db82545e444a0afcc893e61b2675 23-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Add a virtual destructor to the base of another class hierarchy with virtual
methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111804 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6d09a194bb296948ef05f6bff4435752450389fe 23-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Add a virtual destructor to the base of another class hierarchy with virtual
methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111804 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
08f845b775c7be1a417b1b20b445d47b5c72a1bb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a7e6845660f91ec611427e1db842780e1ec12bdb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
68086b9ad26c471322449ea1c030c2ac8397fd07 22-Aug-2010 John McCall <rjmccall@apple.com> The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that
it deserves its own enumerator. Obviously the implementations should
closely follow the Itanium ABI except in cases of divergence.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111749 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXABI.h
taniumCXXABI.cpp
ee79a4c30e5d1c5285551c9a25b8ec6d45d46aa7 22-Aug-2010 John McCall <rjmccall@apple.com> The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that
it deserves its own enumerator. Obviously the implementations should
closely follow the Itanium ABI except in cases of divergence.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111749 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXABI.h
taniumCXXABI.cpp
a812f2ff9e4b765646d8432357dc81388e6574d7 21-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
a60786b46eaa4766bb57fb3ca4e0191b3f73e42a 21-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
d74787f07ed2c35f61f437960b9182f256f6b45a 20-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> 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
STContext.cpp
eclObjC.cpp
2c18bb7c9fca66c30b6eabbdcbc6399d24a54fa9 20-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> 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
STContext.cpp
eclObjC.cpp
5da76f97ef7e8602f2dbca62056bbc28dea61cce 20-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
074dcc8ef8c5df7a155c85648e8eae786bee6cab 20-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
eclBase.cpp
94123d2d6164c19fe11d639459a054455f2ee887 20-Aug-2010 Ying Wang <wangying@google.com> Fix sim build.

Note that this only makes the sim build green, but the built images won't work for sure:
No libbcc.so, which depends on something else that can not build in sim mode.
No x86 bitcode is generated as well, I believe.

Change-Id: Idca8378427196622ac77cd56a38c6a160f03ba22
ndroid.mk
e120d10fc804b77c6830f4f4c32e7095603cc071 20-Aug-2010 John McCall <rjmccall@apple.com> 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
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
096832c5ed5b9106fa177ebc148489760c3bc496 20-Aug-2010 John McCall <rjmccall@apple.com> 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
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
122e206843830426190e32fb79d7a00f5d8754f1 19-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types. An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.

This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111512 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
34fd628d22f54baddf30cf80c401b2f862a31b23 19-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types. An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.

This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111512 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
c63a11dd0d93a5e86b8bc7fdac107e2d706c76c6 19-Aug-2010 Charles Davis <cdavis@mines.edu> Add some enum goodness as requested by Chris. Now instead of storing the
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.

And yes, this time, I started from a clean build directory, and
all the tests passed. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111507 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
20cf717034ba1f20fc47c025ecb72ed9b631ad13 19-Aug-2010 Charles Davis <cdavis@mines.edu> Add some enum goodness as requested by Chris. Now instead of storing the
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.

And yes, this time, I started from a clean build directory, and
all the tests passed. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111507 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
260feb803989b0bcc64811a8ac709d2768f89d2f 19-Aug-2010 John McCall <rjmccall@apple.com> Restore the build



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111498 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b61b7d24f3f8fee5ef7c92187d2a9bb3df5a5192 19-Aug-2010 John McCall <rjmccall@apple.com> Restore the build



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111498 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e79f073bd9968ad8cf745078b2666bab81217981 19-Aug-2010 Charles Davis <cdavis@mines.edu> Add a special RecordLayoutBuilder for the Microsoft C++ ABI.

All it does right now is add space for two vtable pointers instead of one
when a class has both virtual methods and virtual bases. This is a requirement
of the Microsoft ABI, since it has separate vtables for methods and bases. Other
stuff will come up over time, but we'll cross those bridges when we get to
them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111493 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c9f8aece7e111f90265dfad9a81f3f517be948de 19-Aug-2010 Charles Davis <cdavis@mines.edu> Add a special RecordLayoutBuilder for the Microsoft C++ ABI.

All it does right now is add space for two vtable pointers instead of one
when a class has both virtual methods and virtual bases. This is a requirement
of the Microsoft ABI, since it has separate vtables for methods and bases. Other
stuff will come up over time, but we'll cross those bridges when we get to
them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111493 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c8a316e75b46cbfaa7303b3b0e749e666ea4b3a9 19-Aug-2010 Sean Hunt <rideau3@gmail.com> 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
STContext.cpp
ttrImpl.cpp
MakeLists.txt
eclBase.cpp
ecordLayoutBuilder.cpp
cf807c4dfdb23e8fa3f400e0b24ef5b79db7a530 19-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> 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
STContext.cpp
ttrImpl.cpp
MakeLists.txt
eclBase.cpp
ecordLayoutBuilder.cpp
64a5f6f7034808988c3596cf340a879c0c501869 18-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111338 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2767ce2e21d8bc17869b8436220bce719b3369e4 18-Aug-2010 Douglas Gregor <dgregor@apple.com> Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111338 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
184fbd446d81db7e83904b2f98757abcb6c95a6b 18-Aug-2010 Daniel Dunbar <daniel@zuster.org> StringRef'ication of lots stuff, patch by Peter Davies!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
tmtPrinter.cpp
4087f27e5416c799bcb6be072f905be752acb61c 18-Aug-2010 Daniel Dunbar <daniel@zuster.org> StringRef'ication of lots stuff, patch by Peter Davies!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
tmtPrinter.cpp
3c414771dd09faf7277d629451f9e43bfc3dc4bf 17-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111275 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
a8fb24fa3151567056f6125999cea69e39604f35 17-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111275 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
f4a059c45c915d2fe26cfb4531137d5c4a7715f5 17-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> A member function never has "C" linkage. Fixes <rdar://problem/8318976>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111238 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
45975531e3e93033b41e04974340e4e8f7481d61 17-Aug-2010 Douglas Gregor <dgregor@apple.com> A member function never has "C" linkage. Fixes <rdar://problem/8318976>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111238 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
07f1c636bc60ee0c863003e37257f59d4fa978f4 17-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData(). Patch by Peter Davies (with some tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111229 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtDumper.cpp
tmtPrinter.cpp
2f4eaef37476ae6891ede8ba215d0f6fd093629b 17-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData(). Patch by Peter Davies (with some tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111229 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtDumper.cpp
tmtPrinter.cpp
ea9f4488367e13a1604b16ccf675b7d4b9ea5d97 17-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Move a bunch of code out of the ComplexExprEvaluator class definition;
no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111207 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b2dc7f59fe4c762cba73badc3bbc6f356fcd7b5b 17-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Move a bunch of code out of the ComplexExprEvaluator class definition;
no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111207 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2e71feebc8f0b3a5a168e9bb79e5ea92f931f9b3 16-Aug-2010 Charles Davis <cdavis@mines.edu> Implement support for member pointers under the Microsoft C++ ABI in the
AST library.

This also adds infrastructure for supporting multiple C++ ABIs in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111117 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
071cc7deffad608165b1ddd5263e8bf181861520 16-Aug-2010 Charles Davis <cdavis@mines.edu> Implement support for member pointers under the Microsoft C++ ABI in the
AST library.

This also adds infrastructure for supporting multiple C++ ABIs in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111117 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
XXABI.h
taniumCXXABI.cpp
icrosoftCXXABI.cpp
2ae71fb3d7670152a76766e2b5e743b17068af39 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Call the base class in StmtProfiler::VisitOverloadExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111110 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
7b3e3f6bf69780ac0bd85f55fc71c0c084367977 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Call the base class in StmtProfiler::VisitOverloadExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111110 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
8fd84e931fd6134623479a3bb0b0c12cc97a10bc 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111101 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c83d2d7d8914a0fe00d679a262f2bdae7689f16d 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111101 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a256f5f41fbc9723df79ce52bf6c0855df786f06 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Remove dead code, caught by unused function warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111091 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ypeLoc.cpp
ba6f816d633e3b88c38c6896c2d78d19489650f2 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove dead code, caught by unused function warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111091 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ypeLoc.cpp
bab9a737e3a118a0f69c9222e82a2f80a0063c6c 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Call the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111089 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
c35919b637e6a95147d6df3f25521f1a423ef033 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Call the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111089 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
611d0d4a74947a34176388fb1f226fe72bce0b6e 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Some refactoring on StmtPrinter to avoid unused function warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111088 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
78e4cc70cf4ffc8c537e0a72fbe653b127eed358 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Some refactoring on StmtPrinter to avoid unused function warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111088 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
07f6f492d4efad860caa7bf931501624a5f8cb6c 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add ATTRIBUTE_UNUSED to methods not supposed to be used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111087 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ed635e4bff56ffc50d9ad2929eee9d7ffc516c2d 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ATTRIBUTE_UNUSED to methods not supposed to be used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111087 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
36deee56466fd493211464cbcfef3dd4543a376c 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Commit improved version of 111026 & 111027.

Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bbc6454bb98d6a6ecbaafa715222c5db834307f2 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Commit improved version of 111026 & 111027.

Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c44afc381f75c89eca0ddd87935a3a532c7a8eb4 14-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7884: Fix the implementations of __real__ and __imag__ on real floats.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111080 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
43efa31fe601bb7c3f132f02246dc3c903d9f361 14-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7884: Fix the implementations of __real__ and __imag__ on real floats.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111080 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2925631d2ed8a57d528978909101da9a61fe4f5d 13-Aug-2010 John McCall <rjmccall@apple.com> Properly give unique-external linkage to members of member templates
instantiated with unique-external parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111012 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3cdfc4d1862b7195159c376a4542b440037dac6a 13-Aug-2010 John McCall <rjmccall@apple.com> Properly give unique-external linkage to members of member templates
instantiated with unique-external parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111012 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1b21c5748eeb17fbe28d96c73e96f70001495043 13-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Zap unused UnaryOperator::OffsetOf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110996 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
de7e66256b1bdfcf6526994825a8c8fced52a31c 13-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Zap unused UnaryOperator::OffsetOf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110996 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
6c7e76b7b22ff1ce8d76cc0ad9fd2e5578467fbc 12-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes block type matching bug. Radar 8302845.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110950 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
192b1464dce385ac1947eb8258c3a0cd4444c726 12-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes block type matching bug. Radar 8302845.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110950 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e58479760ac3cc56f8f59ddf7e25982298581bf2 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName inside UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110912 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ef3dce817d43faadbf21ce9102d33a9d84b02e09 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName inside UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110912 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c86cc5ddd65451de8551a9978664afe16646690f 12-Aug-2010 Jordy Rose <jediknil@belkadan.com> Remove OwnershipAttr::Kind, since it's essentially redundant with attr::Kind the way it's being used. Also fix isa<OwnershipAttr> support, break more-than-80-char lines, and other miscellaneous ownership attr cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110908 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
2a479929f70d32f626778ef6e70ef46d3a37f74e 12-Aug-2010 Jordy Rose <jediknil@belkadan.com> Remove OwnershipAttr::Kind, since it's essentially redundant with attr::Kind the way it's being used. Also fix isa<OwnershipAttr> support, break more-than-80-char lines, and other miscellaneous ownership attr cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110908 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
f7401424f9b5b4648e180a80a6552e6e93c802ae 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
2577743c5650c646fb705df01403707e94f2df04 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
07d87b418a9899b382796c698ebab186067d61ee 11-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do with the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110840 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
27372b4f1f402e95dd479ecf40c39ca71c15619f 11-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do with the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110840 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
5a24acfed51d1233e325f43af5b2147ad9c31e04 11-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
STImporter.cpp
eclObjC.cpp
eclPrinter.cpp
ype.cpp
deacbdca554298ccdf636f19c6094a8825ec6b34 11-Aug-2010 Douglas Gregor <dgregor@apple.com> Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
STImporter.cpp
eclObjC.cpp
eclPrinter.cpp
ype.cpp
28fe01a7b9e70607e703c0f6876b2effab56bb41 10-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Instead of having a specific CXTranslationUnit_* option flag for
"editing" mode, introduce a separate function
clang_defaultEditingTranslationUnitOptions() that retrieves the set of
options. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110613 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
b1c031be513705d924038f497279b9b599868ba1 10-Aug-2010 Douglas Gregor <dgregor@apple.com> Instead of having a specific CXTranslationUnit_* option flag for
"editing" mode, introduce a separate function
clang_defaultEditingTranslationUnitOptions() that retrieves the set of
options. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110613 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
9d202272883096751921e0860f9df659d4ab66b6 09-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for forward declarations and the definition.
- Eagerly create ObjCInterfaceTypes for declarations.
- The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another.
- Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
STImporter.cpp
eclObjC.cpp
eclPrinter.cpp
ype.cpp
74c730ad1f6818b676b0bad46d806a9176950328 09-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for forward declarations and the definition.
- Eagerly create ObjCInterfaceTypes for declarations.
- The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another.
- Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
STImporter.cpp
eclObjC.cpp
eclPrinter.cpp
ype.cpp
f14c94246a3e098aee463411b90da4f0f2eacaaf 09-Aug-2010 John Thompson <john.thompson.jtsoftware@gmail.com> Added vecreturn attribute parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110609 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
35cc9627340b15232139b3c43fcde5973e7fad30 09-Aug-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Added vecreturn attribute parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110609 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
33282ae8205b3a9375d434d267219751e22731a7 09-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Warn if class object does not implement qualified
id's protocols. Fixes radar 8154220.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110583 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d1909bbc8aa8b468527250766c8f4e67379da2d6 09-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Warn if class object does not implement qualified
id's protocols. Fixes radar 8154220.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110583 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
30a171f86dc5a68d525781d64dfa651f3413b1ad 09-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Revert the dump functions to send output to llvm::errs(), matching the LLVM convention; suggestion by Daniel.

'-ast-print' / '-ast-dump' command line options still send output to llvm::outs().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110569 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
9668033ee4c25efd019e6c7e6dd96aa2e6364a46 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert the dump functions to send output to llvm::errs(), matching the LLVM convention; suggestion by Daniel.

'-ast-print' / '-ast-dump' command line options still send output to llvm::outs().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110569 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
e004547e55aa2e69d1a7ee3d037605c5b1e9f6c3 07-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Allow reference binding of a reference of Objective-C object type to
an lvalue of another, compatible Objective-C object type (e.g., a
subclass). Introduce a new initialization sequence step kind to
describe this binding, along with a new cast kind. Fixes PR7741.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110513 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
569c3166874324c24011f8ade6978421f0d39b3c 07-Aug-2010 Douglas Gregor <dgregor@apple.com> Allow reference binding of a reference of Objective-C object type to
an lvalue of another, compatible Objective-C object type (e.g., a
subclass). Introduce a new initialization sequence step kind to
describe this binding, along with a new cast kind. Fixes PR7741.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110513 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
cb8377b51f907ab910989f76593fbe6a3f1d7e9e 07-Aug-2010 John McCall <rjmccall@apple.com> Note that a CXXConstructExpr is zeroing when dumping it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110510 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
f8cf0b028c7a5b632c3a711813cd44a9d9642537 07-Aug-2010 John McCall <rjmccall@apple.com> Note that a CXXConstructExpr is zeroing when dumping it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110510 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0cf5885d618c1de7806e691c328c1540fa040a19 07-Aug-2010 John McCall <rjmccall@apple.com> Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths. Avoids a separate allocation and
another word of overhead in cases needing inheritance paths. Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprCXX.cpp
tmtDumper.cpp
f871d0cc377a1367b519a6cce26be74607566eba 07-Aug-2010 John McCall <rjmccall@apple.com> Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths. Avoids a separate allocation and
another word of overhead in cases needing inheritance paths. Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprCXX.cpp
tmtDumper.cpp
78e544db7a28b16601365de08d4a352459b11071 06-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce implicit conversions between AltiVec vectors and GCC
vectors, from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110437 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
255210ef415b9893f0e3794e8d9a704194c12f3c 06-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce implicit conversions between AltiVec vectors and GCC
vectors, from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110437 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0629e6403126369d15585aeed9a7f6faf7f5cf17 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
aa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
f735e4deaa90d4ed0b76d42d2459ac952157f0cd 05-Aug-2010 John McCall <rjmccall@apple.com> operator<< on a DiagnosticBuilder should *always* output exactly one thing.
Null template arguments are bad, but they're better than crashing with an
argument mismatch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110312 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
67c4a0ca65dd72784a1778264938c8ba45506cea 05-Aug-2010 John McCall <rjmccall@apple.com> operator<< on a DiagnosticBuilder should *always* output exactly one thing.
Null template arguments are bad, but they're better than crashing with an
argument mismatch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110312 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
2fd2f7e034165b23a762bf9221adaee5c0599786 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of isObjectType; when C++ says "object type", it generally
just means "not a function type", not "not a function type or void". This
changes behavior slightly, but generally in a way which accepts more code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110303 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
1357869bc5983cdfbc986db1f3d18265bb34cb0e 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of isObjectType; when C++ says "object type", it generally
just means "not a function type", not "not a function type or void". This
changes behavior slightly, but generally in a way which accepts more code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110303 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
d54b283f73b9e6805dc9dc3eb9c9bbbe7a4d1c1e 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Drop an unjustified limitation from Type::isObjectType(). Fixes PR7801 and doesn't seem to break anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110295 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7f584bbe9c2de8455bfb572d4ab571628c6c024e 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Drop an unjustified limitation from Type::isObjectType(). Fixes PR7801 and doesn't seem to break anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110295 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
67575e6c198aea7ed5369be14ffb1972069287a8 03-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Send AST dumping/printing to stdout instead of stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110123 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
bc1e1467f747d653c402ae58ed200b9f8a736a01 03-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Send AST dumping/printing to stdout instead of stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110123 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
d1fbcf83ba134e32a48362e4e8349ba86bf6409c 02-Aug-2010 John McCall <rjmccall@apple.com> Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110063 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4204f07fc8bffe6d320b2de95fea274ccf37a17b 02-Aug-2010 John McCall <rjmccall@apple.com> Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110063 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
295dcb357afc5f6215405709cba1498f14bd673d 02-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove mutable data on TagType and InjectedClassNameType, by instead walking the declaration chain in search of a definition. This is necessary for a sane chained PCH implementation. No observable performance change on Carbon.h syntax-only, and bootstraps cleanly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110051 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
ed48a8faa10b6750f334540711c7b3949bbfb3ae 02-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove mutable data on TagType and InjectedClassNameType, by instead walking the declaration chain in search of a definition. This is necessary for a sane chained PCH implementation. No observable performance change on Carbon.h syntax-only, and bootstraps cleanly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110051 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
c747ecafbb218e469bfcaec770b1be2fe628ad30 02-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Compute width/align of objc builtin types (id, etc)
for radar 8258797.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110047 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e04f5fc25cf49e8a5b836459d836c20dc3229a95 02-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Compute width/align of objc builtin types (id, etc)
for radar 8258797.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110047 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b59a623ae9a1f22cfa30a92c2cca645face971d8 01-Aug-2010 John McCall <rjmccall@apple.com> Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109986 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b4b9b15c597a923a03ad0a33cdc49b67e5cc4450 01-Aug-2010 John McCall <rjmccall@apple.com> Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109986 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
49ce9b642327c1a3f94c38c0b5211daa14a54f48 31-Jul-2010 Ted Kremenek <kremenek@apple.com> After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking. Patch by Andrew McGregor!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109939 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
dd0e490c24aeade2c59ca4cae171199f6af9f02e 31-Jul-2010 Ted Kremenek <kremenek@apple.com> After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking. Patch by Andrew McGregor!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109939 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
9f3208d05927f010d791201e0dc3224c16d1258f 30-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor find*Specialization functions using SpecEntryTraits

This patch reimplements the find*Specialization family of member
functions of {Class,Function}TemplateDecl in terms of a common
implementation that uses SpecEntryTraits to obtain the most recent
declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109869 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
4048590d5774fd4b08661b5cf59b6f90b62f283a 30-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor find*Specialization functions using SpecEntryTraits

This patch reimplements the find*Specialization family of member
functions of {Class,Function}TemplateDecl in terms of a common
implementation that uses SpecEntryTraits to obtain the most recent
declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109869 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
61c4fedf17b52134f6d0401110b6680f36ca6b9f 30-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When we are deserializing the lexical decls of a DeclContext from PCH, notify the PCHReader to hold off passing Decls
to the consumer until the DeclContext is fully prepared.

Before, due to recursive loading, we could be in a situation where we would try to deserialize the decls of a DeclContext which was already doing that, and bad things would happen. In the specific case I encountered, the lexical decls would
form a cycle and we would enter infinite loop territory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109857 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0dbbc042518e6ba903dd6f815cbb8704595cc937 30-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When we are deserializing the lexical decls of a DeclContext from PCH, notify the PCHReader to hold off passing Decls
to the consumer until the DeclContext is fully prepared.

Before, due to recursive loading, we could be in a situation where we would try to deserialize the decls of a DeclContext which was already doing that, and bad things would happen. In the specific case I encountered, the lexical decls would
form a cycle and we would enter infinite loop territory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109857 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
7e596c9266bbc144f40882ee7a9044a5f52525f5 30-Jul-2010 Ted Kremenek <kremenek@apple.com> Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109833 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
2d6c906585c292c9de78eff3b42af06332857252 30-Jul-2010 Ted Kremenek <kremenek@apple.com> Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109833 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ec008c2ac13539de3597693759a50ed6597e66a4 30-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Teach isIncompleteType() to look through sugar when it is dealing with
Objective-C object and interface types. This is part of PR7741.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109808 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d0221526bcc81f49eff5c992978176e83ada3bc7 30-Jul-2010 Douglas Gregor <dgregor@apple.com> Teach isIncompleteType() to look through sugar when it is dealing with
Objective-C object and interface types. This is part of PR7741.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109808 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
8fac2eb1ee050aaf6cab1fb5e944c2b20c5a8b7b 29-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Change the name to something less terrible; suggestion by Doug. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109797 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4ac7c0bb39696e92fd220118fedc484c09a69870 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change the name to something less terrible; suggestion by Doug. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109797 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eb19f2e5ff5db362f5d018129cf2637997a44e28 29-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Weak references and variables that are not definitions are not required for early codegen/deserialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109796 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ab411c8c2efed8f2403bf8596e780c0f2f905a19 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Weak references and variables that are not definitions are not required for early codegen/deserialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109796 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1ac53087c7b810990070ff80e5953669d339c55d 29-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl
needs to be deserialized during PCH loading for codegen purposes.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.

This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109784 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
90e99a84ddd020e8fda79643748243725a2ed071 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl
needs to be deserialized during PCH loading for codegen purposes.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.

This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109784 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
057077941512583a3ca7ab136c4e1100295b666f 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Implement RedeclarableTemplateDecl::getNextRedeclaration

This patch uses the newly added Latest field of CommonBase to provide
a getNextRedeclaration() implementation for RedeclarableTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109756 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
f88718ea0ca0d64b7fd31d109f1d9ec769a9c45f 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Implement RedeclarableTemplateDecl::getNextRedeclaration

This patch uses the newly added Latest field of CommonBase to provide
a getNextRedeclaration() implementation for RedeclarableTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109756 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
48a788b3337f2e9299486bb1edb4dc1fe7dadd16 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Store latest redeclaration for each redeclarable template declaration

This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase
class which is used to store the latest redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109755 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
8a798a7f7d88dc9865fad7da648e5cef8580c65a 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Store latest redeclaration for each redeclarable template declaration

This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase
class which is used to store the latest redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109755 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
3a0ba0efc321d7b1ab3ab2b970b5645fd226a4e2 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor redeclarable template declarations

This patch refactors much of the common code in ClassTemplateDecl and
FunctionTemplateDecl into a common base class RedeclarableTemplateDecl
together with support functions in a template class RedeclarableTemplate.

The patch also includes similar refactoring for these classes' PCH
reader and writer implementations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109754 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
9eabebafc165a67812eacc184806e7bf34c5f0a5 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor redeclarable template declarations

This patch refactors much of the common code in ClassTemplateDecl and
FunctionTemplateDecl into a common base class RedeclarableTemplateDecl
together with support functions in a template class RedeclarableTemplate.

The patch also includes similar refactoring for these classes' PCH
reader and writer implementations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109754 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
5e8bf80a15e1d16cfb67c9776f743aabba28060e 29-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Allow a looser form of compatibility checking (which ignores
qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109751 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
447234dd459a00a5ed9b7c3e066162cd7a75bf2d 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Allow a looser form of compatibility checking (which ignores
qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109751 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9ccff7c5d83a7c5465439c70de8543f13e72cdfd 27-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Fix recording of offsets of types in dependent PCHs.
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109474 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
681d7237e1014bf64dd5ead6bf74ae55cdd19e61 27-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Fix recording of offsets of types in dependent PCHs.
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109474 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5089d4a591bffa4b39ee39080762dfb74578f878 26-Jul-2010 Dan Gohman <gohman@apple.com> It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109441 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
55c6570bf6f4342203eb0ff0816fe28e6c55964a 26-Jul-2010 Dan Gohman <gohman@apple.com> It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109441 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
c0dd65e0f3e986a09729455447f3ef6d40bf3256 26-Jul-2010 Dan Gohman <gohman@apple.com> Fix namespace polution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3c46e8db99196179b30e7ac5c20c4efd5f3926d7 26-Jul-2010 Dan Gohman <gohman@apple.com> Fix namespace polution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b2e3e246d5d736b72f0bd1190324a1029b09ffba 26-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add source location information to C++ base specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109396 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
5606220447c7901ba8d80147ddab893bb7949dd5 26-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add source location information to C++ base specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109396 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
9176528dc9ca6e2be1e7c2f848989c1701ff854e 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Remove a bunch of trivial destructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109382 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7cb6bd70f9436f630a508ba017414ca2466eeb35 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove a bunch of trivial destructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109382 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d01fbaddde95f6c229661bf31c4532acbb22e945 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Move Type destructor out-of-line

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109381 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
afb6416bf7f04a00c44092e802f335bb3636489c 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Move Type destructor out-of-line

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109381 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
30f3bc42d4b61a386e52675b9c9af6c912aa1cd9 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Remove destructors from declaration nodes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109380 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclTemplate.cpp
a2da780b325e78c6c6bbbb766459a73243c3cf9e 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove destructors from declaration nodes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109380 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclTemplate.cpp
e0a25e956e2fbbaf666b975fd3947cd250c53285 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> I lied. Kill off a few more Destroy methods

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109379 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
eclGroup.cpp
1de22a26c0e126b08edb2eda9d9091c021d96dc6 25-Jul-2010 Douglas Gregor <dgregor@apple.com> I lied. Kill off a few more Destroy methods

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109379 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
eclGroup.cpp
4359888554d723e2c91fa470c0651044f771cc06 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Kill off the last Destroy method in the AST library

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109378 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
37db4db11b95e32d4ba205d9246c940025666f97 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Kill off the last Destroy method in the AST library

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109378 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
1994615488b9c729eb7c3c854a6d5e1c1ca78bde 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
ullExpr.cpp
tmt.cpp
ype.cpp
ff331c15729f7d4439d253c97f4d60f2a7ffd0c6 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
ullExpr.cpp
tmt.cpp
ype.cpp
dc44f37a59e789997989d105bd99501f3670f56f 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Make ASTContext always use the BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109375 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
63fe86bee66fc145942c56b2cc564ea0b9b9ea12 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Make ASTContext always use the BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109375 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
57cff32124cd5b95f3e1a5da12d3fff7e8892943 23-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109229 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f60946222721d9ba3c059563935c17b84703187a 23-Jul-2010 Douglas Gregor <dgregor@apple.com> Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109229 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c3024bdaee612382a1eee67b77aff7a6450feaa6 22-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
3fe104154dd2e8ffb351142d74f308938b5c99bf 22-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
994e5a2fd3895964e9d2109dac1318c0afbdb490 22-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write FriendTemplateDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109113 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
554e6aa2da082575514607c3639c246c04b3232a 22-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write FriendTemplateDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109113 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
33a4d62010b996b75c4a7f2f8dff9acbdf258cc5 22-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support C++ try/catch statements for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109112 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
7cb45e37b6f924d9ddbc53ac023bbaadb4ca3534 22-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support C++ try/catch statements for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109112 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
5416a2ad2fd6ad18846b9c2f6122ae0d417e24dd 20-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108834 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
2c853e401ca406d417eb916e867226050e7be06b 20-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108834 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
7b659e613e7fe157ad5202cab1c972e64b4f357e 20-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Hide the specializations folding sets of ClassTemplateDecl as an implementation detail (InsertPos
leaks though) and add methods to its interface for adding/finding specializations.

Simplifies its users a bit and we no longer need to replace specializations in the folding set with
their redeclarations. We just return the most recent redeclarations.

As a bonus, it fixes http://llvm.org/PR7670.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108832 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
cc0b1bc979b650a8a8b34b2032a074fd7724a90d 20-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Hide the specializations folding sets of ClassTemplateDecl as an implementation detail (InsertPos
leaks though) and add methods to its interface for adding/finding specializations.

Simplifies its users a bit and we no longer need to replace specializations in the folding set with
their redeclarations. We just return the most recent redeclarations.

As a bonus, it fixes http://llvm.org/PR7670.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108832 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
a7a77ab274626a371e240b9e49c9231bdb7df092 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update ImplicitCastExpr to be able to represent an XValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprClassification.cpp
tmtDumper.cpp
tmtProfile.cpp
906082edf2aea1c6de2926f93a8d7121e49d2a54 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update ImplicitCastExpr to be able to represent an XValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
xprClassification.cpp
tmtDumper.cpp
tmtProfile.cpp
20d9229f0e4c4f374f1ef39c1076f35525f79bbb 20-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to type match comparing Objective-C Classes which implement
protocols (Radar 8191774).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108758 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a8f8dac6a29f6d33474a38a32ce9dd859b696da9 20-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to type match comparing Objective-C Classes which implement
protocols (Radar 8191774).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108758 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ef006823ecd2344aa0b47065d6d2b2bcbe95a853 18-Jul-2010 Chris Lattner <sabre@nondot.org> BUILD_ARCHIVE is the default for libraries, no need to set it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
9638eef7e3b2ca30406c5d369a44aa49ff26b201 18-Jul-2010 Chris Lattner <sabre@nondot.org> BUILD_ARCHIVE is the default for libraries, no need to set it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
f80e489a72ca033e1ac2774d2632cdeb23e36ece 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Added PCH/ASTImporter code for ObjCIvarDecl's field.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108627 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ac0021ba802e193e0f9f8207768c7862c7603bc0 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Added PCH/ASTImporter code for ObjCIvarDecl's field.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108627 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
630a33b8918966620dfc5ced0f9ef17eab76ec94 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108599 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ad51e74030a59a8aa4ef0ebca1d7a701602ef53b 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108599 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8c90b02120e2f49bf695e6013049ab9d3caac2e7 14-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new cast kind for an "lvalue bitcast", which handles
reinterpret_casts (possibly indirectly via C-style/functional casts)
on values, e.g.,

int i;
reinterpret_cast<short&>(i);

The IR generated for this is essentially the same as for

*reinterpret_cast<short*>(&i).

Fixes PR6437, PR7593, and PR7344.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108294 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
e39a3894513349908cdb3beba2614e53cb288e6c 14-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce a new cast kind for an "lvalue bitcast", which handles
reinterpret_casts (possibly indirectly via C-style/functional casts)
on values, e.g.,

int i;
reinterpret_cast<short&>(i);

The IR generated for this is essentially the same as for

*reinterpret_cast<short*>(&i).

Fixes PR6437, PR7593, and PR7344.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108294 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
2350fb26d59692c6006ec5d33b8215e96055bdb6 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Whenever we're creating an expression that is typically an rvalue
(e.g., a call, cast, etc.), immediately adjust the expression's type
to strip cv-qualifiers off of all non-class types (in C++) or all
types (in C). This effectively extends my previous fix for PR7463,
which was restricted to calls, to other kinds of expressions within
similar characteristics. I've audited every use of
getNonReferenceType() in the code base, switching to the newly-renamed
getNonLValueExprType() where necessary.

Big thanks to Eli for pointing out just how incomplete my original fix
for PR7463 actually was. We've been handling cv-qualifiers on rvalues
wrong for a very, very long time. Fixes PR7463.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108253 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
6398235d7890a81b785ea5af3b6e66d86bf184cc 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Whenever we're creating an expression that is typically an rvalue
(e.g., a call, cast, etc.), immediately adjust the expression's type
to strip cv-qualifiers off of all non-class types (in C++) or all
types (in C). This effectively extends my previous fix for PR7463,
which was restricted to calls, to other kinds of expressions within
similar characteristics. I've audited every use of
getNonReferenceType() in the code base, switching to the newly-renamed
getNonLValueExprType() where necessary.

Big thanks to Eli for pointing out just how incomplete my original fix
for PR7463 actually was. We've been handling cv-qualifiers on rvalues
wrong for a very, very long time. Fixes PR7463.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108253 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
5954946f38bfc7cf57f07b846f744d1a25a03535 13-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Silence Doug's favorite GCC warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108247 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6dc1ef87044e6b177d4df0d2b593a94616180b3d 13-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Silence Doug's favorite GCC warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108247 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
13767543229d759e3c51dea5fa1cc531effb08ce 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like

new (int [size])

to a warning, add a Fix-It to remove the parentheses, and make this
diagnostic work properly when it occurs in a template
instantiation. <rdar://problem/8018245>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108242 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4bd40318cbea15310a37343db46de96c4fcc15e6 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like

new (int [size])

to a warning, add a Fix-It to remove the parentheses, and make this
diagnostic work properly when it occurs in a template
instantiation. <rdar://problem/8018245>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108242 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
6ff237965f97c96152e52fee566f03af687d86aa 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> When computing the canonical profile of a DeclRefExpr or MemberExpr,
don't include the nested-name-specifier or template arguments: they
were only relevant when resolving the declaration. Fixes PR7460.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108235 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
218f47ff746b2216e949e79a287c034fd0bd8713 13-Jul-2010 Douglas Gregor <dgregor@apple.com> When computing the canonical profile of a DeclRefExpr or MemberExpr,
don't include the nested-name-specifier or template arguments: they
were only relevant when resolving the declaration. Fixes PR7460.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108235 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
8079eee9128444d02bebf24410126f9d55399f84 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it for
non-class types.

Centralized the computation of the call expression type in
QualType::getCallResultType() and some helper functions in other nodes
(FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant
callers of getResultType() to getCallResultType().

Fixes PR7598 and PR7463, along with a bunch of getResultType() call
sites that weren't stripping references off the result type (nothing
stripped cv-qualifiers properly before this change).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108234 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
5291c3cec0dbe8ad1d8e7e67e93af2b1586d5400 13-Jul-2010 Douglas Gregor <dgregor@apple.com> When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it for
non-class types.

Centralized the computation of the call expression type in
QualType::getCallResultType() and some helper functions in other nodes
(FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant
callers of getResultType() to getCallResultType().

Fixes PR7598 and PR7463, along with a bunch of getResultType() call
sites that weren't stripping references off the result type (nothing
stripped cv-qualifiers properly before this change).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108234 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
a351bf90f109c26fe7d943cd09dcee711dc387d9 13-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Instantiate attributes when first building an instantiated
VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108218 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8dd0c5626455cdf94280783e85e413eed6cbf3d9 13-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Instantiate attributes when first building an instantiated
VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108218 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
bd9046ee7f084d316e5d2e92bdb9c266529767ef 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Copy over attributes to instantiated variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108195 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
cad8d31117800f804ee4f313134162edac8f8813 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Copy over attributes to instantiated variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108195 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
343bc4ac3ca28ee5f51fb8c03f2145c3c20e44b0 10-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add PCH support for the remaining C++ exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108042 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
6d00c1365dd3601f6d93bbda9162913c57ae788f 10-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add PCH support for the remaining C++ exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108042 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
5a3798ed1e18642d21ed8ee5f0ba9663b8dcf84a 09-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix a crashing but trying to print a TemplateTemplateParmDecl
for code like this:
template<template<typename T> class U> class V {};

The problem is that the DeclPrinter assumed all TemplateDecls
have a getTemplatedClass(), but template template params don't
(so we got a NULL dereference). The solution is to detect if
we're a template template param, and construct the template
class name ('class U') specially in this case.

OKed by dgregor and chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108007 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
0193a72c6fc873c0c83119ab1e6f089719e09e1a 09-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix a crashing but trying to print a TemplateTemplateParmDecl
for code like this:
template<template<typename T> class U> class V {};

The problem is that the DeclPrinter assumed all TemplateDecls
have a getTemplatedClass(), but template template params don't
(so we got a NULL dereference). The solution is to detect if
we're a template template param, and construct the template
class name ('class U') specially in this case.

OKed by dgregor and chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108007 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
2d562147b4d12f5ca3f1d3265c4703244182603b 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> When performing substitution of template arguments within the body of
a template, be sure to include the template arguments from the
injected-class-name. Fixes PR7587.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107895 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
24bae92f08ae098cc50a602d8cf1273b423e14da 08-Jul-2010 Douglas Gregor <dgregor@apple.com> When performing substitution of template arguments within the body of
a template, be sure to include the template arguments from the
injected-class-name. Fixes PR7587.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107895 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
7b1d67a3a0fd7ca693a5633b00b44341f09af5b9 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107872 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
663e380d7b2de2bbf20e886e05371195bea9adc4 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107872 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0ec494632efdc9cd55608bc98d175a68084acbad 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
ed8abf18329df67b0abcbb3a10458bd8c1d2a595 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
fa0b6fca56fc75c359c07a5fb1a6f328c93e61ca 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
84745677f64863e025a6733cb29d0b94bc3a6ae2 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
38c8fe9cdead9e73d84548a6e3c8a9fb680bcb98 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
016a4a90c8e75d59de731fa3aa98f0a55656e66c 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
xprClassification.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
f5cca89547e881c9878525d14c436ca7e67a8ca1 07-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> When printing statistics for the ASTContext, also print them for its BumpPtrAllocator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107790 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3472430ae163ab0a4d2839db3d9b0d5a54871808 07-Jul-2010 Douglas Gregor <dgregor@apple.com> When printing statistics for the ASTContext, also print them for its BumpPtrAllocator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107790 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
820de0b2042ef6628452262da6d5ec5ff2a7588d 07-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Remove Decl::getCompoundBody().

This has 2 (slight) advantages:
-Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt.
-Better tracking of Decl::getBody()'s callsites.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107771 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5f1bfc10a12d9759444eb433f52a85d2e0058967 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove Decl::getCompoundBody().

This has 2 (slight) advantages:
-Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt.
-Better tracking of Decl::getBody()'s callsites.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107771 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c5c7e14bf5a24163ccaf47e21228d977c698be2f 07-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Simplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107770 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6717ef4e695cb37b69dead5fae486c73f8a44a28 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107770 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
327727783bbdf4a7f2bc08b6aa7d3a58a5ee412c 07-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
06a54a38be5054c910ffc92db60edab23f9ea105 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
85e6ce74f0a1c79f204f1f0312366bf1f6a9a70d 07-Jul-2010 John McCall <rjmccall@apple.com> Don't consider casted non-global pointers to be evaluatable.
Fixes rdar://problem/8154689



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107755 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0f2b692bb10be35fdc60d0a72a847bdd73124670 07-Jul-2010 John McCall <rjmccall@apple.com> Don't consider casted non-global pointers to be evaluatable.
Fixes rdar://problem/8154689



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107755 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
385b4d574901c8b01c0f9fa4c86a9eb5e6ca9461 06-Jul-2010 Tom Care <tcare@apple.com> Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.

Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107706 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
db2fa8a7eb67b1e8f32a590b8e000e1259cff91a 06-Jul-2010 Tom Care <tcare@apple.com> Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.

Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107706 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
fb699f1e2cec64761b2347afb56dff378cb2bbb9 06-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Improve the accuracy of getSourceRange() for DeclaratorDecl and
TagDecl subclasses when out-of-line template declaration information
is available, from Peter Collingbourne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107686 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1693e154bef16ca060b5e3786d8528ddc11f5637 06-Jul-2010 Douglas Gregor <dgregor@apple.com> Improve the accuracy of getSourceRange() for DeclaratorDecl and
TagDecl subclasses when out-of-line template declaration information
is available, from Peter Collingbourne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107686 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6d1a96df21e510082d22c002ad87e8c01016aee4 06-Jul-2010 Tom Care <tcare@apple.com> Added several helper functions to Stmt to recursively check for different elements (macros, enum constants, etc).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107675 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
7d6228fc77baf405c6554bb47904fc197e33b488 06-Jul-2010 Tom Care <tcare@apple.com> Added several helper functions to Stmt to recursively check for different elements (macros, enum constants, etc).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107675 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
10bfc5813682c82c3e0329ed8582e8d92f8f4f1f 05-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write some source location for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107616 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7b081c8604efd33bc7f7e5c1e9427a031eedb2b4 05-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write some source location for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107616 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e0dabf9cc0f323ab90e963233fd9a7aafd1c4b5a 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix a regression of a previous commit of mine (rdar://8158953).

Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107598 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
400f5125e2432d648f2c8a31b36a7f318a880c47 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix a regression of a previous commit of mine (rdar://8158953).

Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107598 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e4c9c5400738b7bfb9a477049993f16696ce32b1 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
c91e9f439ae85d5f79a6b65672f1d7d1b55ccda0 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
e01318c4742b5873742c56f96f9c9be54af6e862 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When adding a visible decl, deserialize the visible decls and add it.

Before this commit, visible decls added before deserialization were ignored.
This was not an issue since name lookup (that usually comes before the addition) forces deserialization
but it is an issue for lazily declared class implicit members.

We can use a PCH'ed <string> now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107596 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5586b019c18024b2967d027a17d5a05584a8b181 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When adding a visible decl, deserialize the visible decls and add it.

Before this commit, visible decls added before deserialization were ignored.
This was not an issue since name lookup (that usually comes before the addition) forces deserialization
but it is an issue for lazily declared class implicit members.

We can use a PCH'ed <string> now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107596 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a0b52cc3c2161509acf2c0b9470cb8db105d2ff8 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.

Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
006113841bdae1edb77aef75ba1ffdf2e55a3094 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.

Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5e881aacf6176c20270f664a85761351158f9c78 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write specialization info of static data members for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107593 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9421adc43891e272156fab640e5d5ee5054b779c 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write specialization info of static data members for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107593 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8894af18af4f933e99fef9641fc225b9823a385c 03-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

4/159 implicit default constructors created
18/236 implicit copy constructors created
70/241 implicit copy assignment operators created
0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
1827403a7138946305c0058f262e02b595cf882f 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

4/159 implicit default constructors created
18/236 implicit copy constructors created
70/241 implicit copy assignment operators created
0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
1cdf4d0686667b7f80c37cdc87679d824819bb5a 03-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare implicit copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
225843186e3972ce798d3de00f86da9008b15a0e 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare implicit copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
cbc2ab01c76cc7dea081cd23071514d88bc9fae9 02-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare copy-assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
a376d10acfacf19d6dfa41069f7929739a18dd7a 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare copy-assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
b9aa39a0fad9109684a960bf91e13ceeeb2425e3 02-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare the implicitly-declared destructor in a C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
4923aa25eb39d64106a5817c02d560a3aecf8b2c 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare the implicitly-declared destructor in a C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
d6e3ef14a37c5c59b6c5e727d4a1dd4eeb6ad078 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Disable Decl::CheckAccessDeclContext() temporarily.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107478 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
04aed0edee1fe0bad807afb69f484c5e807800af 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Disable Decl::CheckAccessDeclContext() temporarily.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107478 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3a3d08e839c78fe8dda69c3706825826dce92b3e 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fully read/write CXXRecordDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
37ffed3b7f229844cae2463ff82b527506c86c74 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fully read/write CXXRecordDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8e3a4439cca2392c63451037ca97eb7037574c91 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> - Allow a typedef type to be read from PCH even if its decl is currently initializing.
- Fix creation of TemplateSpecializationType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9763e221e16026ddf487d2564ed349d2c874a1a1 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> - Allow a typedef type to be read from PCH even if its decl is currently initializing.
- Fix creation of TemplateSpecializationType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b69c228c5fc1240fbc72e8f9ac48f5d58a77581c 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add some side-effect free Create methods for TypeDecl subclasses and use them for PCH reading.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107468 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
b8b03e6df1cc89e701a809c6a47c41f31b7a9e50 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add some side-effect free Create methods for TypeDecl subclasses and use them for PCH reading.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107468 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
eb04f8714fcf4b01aa74718a54a058186babeb10 02-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Provide exception specifications for implicitly-declared default constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107437 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eb8c670d2949eb62005eca36c64c9461f2a2173e 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Provide exception specifications for implicitly-declared default constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107437 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
29922ee81076649d7be599b7258bcdfc84c26ebd 01-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Provide exception specifications for implicitly-declared copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107429 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0d405db2d847acba979a74d747894bcf4d580fe3 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Provide exception specifications for implicitly-declared copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107429 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
45c5e7c236f638b5a783dd5843c7a52b3d279a89 01-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Provide an exception-specification for an implicitly-declared
copy-assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107406 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b87786f045d798b070980c108c922e1475d27b15 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Provide an exception-specification for an implicitly-declared
copy-assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107406 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5ece84ce202e7747e58ccacf24f1a7b85f9a2335 01-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Remove unnecessary ASTContext parameter from
CXXRecordDecl::getDestructor(); no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107394 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
1d110e05e0ff48c1c7a483d6b7fd094cdf28316a 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameter from
CXXRecordDecl::getDestructor(); no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107394 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
142fbe8202f71220ee81e5d69077abac05183108 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> AST: Propogate printing policy to types in a bunch more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107311 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
6cb5b5fde5188af722d25d5bb80d05edf67578b2 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> AST: Propogate printing policy to types in a bunch more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107311 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
d0e9b7c33d637ecc0771457247a46d2be6069ef7 30-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Nasty rewriter bug which turns out to have an easy fix in
rewriting a c-style cast expression in statement printer.
Fixes radar 8143056.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107289 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
03e80e446edac1479bab1daa14e8bd9a46bd6c52 30-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Nasty rewriter bug which turns out to have an easy fix in
rewriting a c-style cast expression in statement printer.
Fixes radar 8143056.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107289 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c18db1629e1486945287bc6b17e0a213f5247752 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix rdar://8139785 "implement warning on dead expression in comma operator"

As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:

x || test_logical_foo1();

emitted a bogus "expression result unused" for 'x'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107274 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
25973455aed1cdc9c40b208c792b5db4f8f1297d 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix rdar://8139785 "implement warning on dead expression in comma operator"

As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:

x || test_logical_foo1();

emitted a bogus "expression result unused" for 'x'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107274 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f5b2e4e507e7014d09331fda4e7f0d5682d13660 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support C++ friend declarations for PCH.

This commit 'introduces' a slightly different way to restore the state of the AST object.
It makes PCHDeclReader/PCHDeclWriter friends and gives them access to the private members of the object.
The rationale is to avoid using/modifying the AST interfaces for PCH read/write so that to:

-Avoid complications with objects that have side-effects during creation or when using some setters.
-Not 'pollute' the AST interface with methods only used by the PCH reader/writer
-Allow AST objects to be read-only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107219 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.cpp
6764334dfa73d67cbbb1b1fc8fe00440aad00f2a 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support C++ friend declarations for PCH.

This commit 'introduces' a slightly different way to restore the state of the AST object.
It makes PCHDeclReader/PCHDeclWriter friends and gives them access to the private members of the object.
The rationale is to avoid using/modifying the AST interfaces for PCH read/write so that to:

-Avoid complications with objects that have side-effects during creation or when using some setters.
-Not 'pollute' the AST interface with methods only used by the PCH reader/writer
-Allow AST objects to be read-only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107219 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.cpp
65252808798c80bccdd45cbd20b765d48ea77818 29-Jun-2010 Daniel Dunbar <daniel@zuster.org> Sema: Fix a subtle i64 -> i32 truncation which broke layout of large structures
with bit-fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107185 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
84b0316f720bd089d87acb21ec0002b2da33e6c9 29-Jun-2010 Daniel Dunbar <daniel@zuster.org> Sema: Fix a subtle i64 -> i32 truncation which broke layout of large structures
with bit-fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107185 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8dccf0ab1ae2c845fc3b61cb042046ab21f79ac3 29-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> Delete assert in ComputeKeyFunction. The function runs fine without it, since
there's an explicit guard on isPolymorphic, and virtual bases don't affect the
key function calculation. This allows people to call
ASTContext::getKeyFunction on arbitrary classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107143 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fe8ec01bba74f6841576a2ee93d2c62cdfa4eff2 29-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> Delete assert in ComputeKeyFunction. The function runs fine without it, since
there's an explicit guard on isPolymorphic, and virtual bases don't affect the
key function calculation. This allows people to call
ASTContext::getKeyFunction on arbitrary classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107143 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
32a0917c65c4d7badb3d043e2d19f28f3cddcc73 29-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Prefer llvm_unreachable(...) to assert(false && ...). This is important as
without it we might exit a non-void function without returning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107106 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
0010bca8afaed0236c4910640f6bc1bcf1984125 29-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Prefer llvm_unreachable(...) to assert(false && ...). This is important as
without it we might exit a non-void function without returning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107106 91177308-0d34-0410-b5e6-96231b3b80d8
xprClassification.cpp
fdf2127ed0a1b3e966b2f640ff7b03baf7106aed 28-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce Expr::Classify and Expr::ClassifyModifiable, which determine the classification of an expression under the C++0x taxology (value category). Reimplement isLvalue and isModifiableLvalue using these functions. No regressions in the test suite from this, and my rough performance check doesn't show any regressions either.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107007 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xpr.cpp
xprClassification.cpp
2111c855343a0530e236bf0862358ec8d67b28f3 28-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce Expr::Classify and Expr::ClassifyModifiable, which determine the classification of an expression under the C++0x taxology (value category). Reimplement isLvalue and isModifiableLvalue using these functions. No regressions in the test suite from this, and my rough performance check doesn't show any regressions either.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107007 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xpr.cpp
xprClassification.cpp
55e641cf56260e9213e724a3fff7cebd2adbf890 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support DependentScopeDeclRefExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106998 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
12dffcddb60380c5bed4f085a1f51534afda3b87 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support DependentScopeDeclRefExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106998 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
5c7218457cd04feadea685d7ee9c2d286e9894dc 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix various bugs in recent commits for C++ PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106995 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
dc767e368471288bef8716d19b0e929647246bfc 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix various bugs in recent commits for C++ PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106995 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
36633ae1d4e6cff08557e7dcfaaad355015f7306 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support UnresolvedLookupExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106832 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
bd65bb511c26549c96b829c1282e4c877588564a 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support UnresolvedLookupExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106832 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
48d8d808b7f109f33eeda88192874b0708684892 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support UnresolvedMemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106831 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
a77eb0862507b900a10fa352af1568e639ed10b1 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support UnresolvedMemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106831 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
93f872664c3a7ed49491f9ca37ccb00d581dd5eb 24-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support a couple more C++ Exprs for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106727 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
8dfbd8b252ba4e6cf4b7a3422f6ef0ca21312dfe 24-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support a couple more C++ Exprs for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106727 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
0a5ea76d1c951cab7c6dbf3b52ce2dcce1c9dbb2 23-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Modify ClassTemplateSpecializationDecl and ClassTemplatePartialSpecializationDecl to allow PCH read/write.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106624 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
94d228d3454a3f6436526d15b2ad7fc90246fe54 23-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Modify ClassTemplateSpecializationDecl and ClassTemplatePartialSpecializationDecl to allow PCH read/write.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106624 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
9484f8eade39f9d22deb26abdd6c1c804b820eac 23-Jun-2010 Chris Lattner <sabre@nondot.org> improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ypePrinter.cpp
788b0fd67e1992f23555454efcdb16a19dfefac3 23-Jun-2010 Chris Lattner <sabre@nondot.org> improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ypePrinter.cpp
ce492a32789c503d84c777bbf16cd40b07884c2b 23-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Vector types are not arithmetic types, either. Note that we now ban
__real myvec and __imag myvec, since they aren't all that useful (it's
just an identity function) but we might want to use them in more
restricted cases in the future (e.g., "__real mycomplexvec" could
extract the real parts of a vector of complex numbers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106601 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
00619623af0b9d3271e31402ec1a95e84c2c4526 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Vector types are not arithmetic types, either. Note that we now ban
__real myvec and __imag myvec, since they aren't all that useful (it's
just an identity function) but we might want to use them in more
restricted cases in the future (e.g., "__real mycomplexvec" could
extract the real parts of a vector of complex numbers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106601 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
a20e00282c792f039b1abecec2b00fb392a19dae 23-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to provide separate ASTs for multiple ObjC class extension
declarations (implements radar 7928731).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclObjC.cpp
80aa1cd7973561889e51c1c152c8990a8de9c953 23-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to provide separate ASTs for multiple ObjC class extension
declarations (implements radar 7928731).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
eclObjC.cpp
cc9e1651775d03a652b65b01a99a97fb9642f1ed 23-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Teach Type::isRealType() that vector types are never real types. All
of the callers of isRealType() already assumed this, and one of them
(increment/decrement) mistakenly permitted increments of vector types
because of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106596 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4b1317264037732fff3653ac6f494b124c726e1b 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Teach Type::isRealType() that vector types are never real types. All
of the callers of isRealType() already assumed this, and one of them
(increment/decrement) mistakenly permitted increments of vector types
because of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106596 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e4a621552c52b7733af4b8c684abc54769ff0ec6 23-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
0c293ea13d452c1a47a05ada5a5ee9acc69c66cc 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1a7c1b12a61ed17f914c9d557dd6666e0253c133 23-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Change Type::isFloatingType() to reflect the actual definition of a
"floating type" in C, which does not include vector types. Introduce
Type::hasFloatingRepresentation() for the places where we want to know
whether the underlying representation is one or more floating-point
values. Remove some hacks we had where the former behavior of
Type::isFloatingType() was at odds with the language definition of the
term.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106584 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
8eee119bf4f1693dde17b8552c1f9f81bf2b681e 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Change Type::isFloatingType() to reflect the actual definition of a
"floating type" in C, which does not include vector types. Introduce
Type::hasFloatingRepresentation() for the places where we want to know
whether the underlying representation is one or more floating-point
values. Remove some hacks we had where the former behavior of
Type::isFloatingType() was at odds with the language definition of the
term.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106584 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
27af33596d39eebc6a70af17022e09237fba96a8 22-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Make it easier to read/write the template part of FunctionDecl.

Introduce:
-FunctionDecl::getTemplatedKind() which returns an enum signifying what kind of templated
FunctionDecl it is.
-An overload of FunctionDecl::setFunctionTemplateSpecialization() which accepts arrays of
TemplateArguments and TemplateArgumentLocs
-A constructor to TemplateArgumentList which accepts an array of TemplateArguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
d0913557c800c8a712fb554032a833619f23bc56 22-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make it easier to read/write the template part of FunctionDecl.

Introduce:
-FunctionDecl::getTemplatedKind() which returns an enum signifying what kind of templated
FunctionDecl it is.
-An overload of FunctionDecl::setFunctionTemplateSpecialization() which accepts arrays of
TemplateArguments and TemplateArgumentLocs
-A constructor to TemplateArgumentList which accepts an array of TemplateArguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
b377aed9fc0a90a0788af717c5a37c871061b7ce 22-Jun-2010 Chris Lattner <sabre@nondot.org> implement support for -finstrument-functions, patch by Nelson
Elhage!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106507 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
7255a2d997b15beae82e627052fdb1b2474495c2 22-Jun-2010 Chris Lattner <sabre@nondot.org> implement support for -finstrument-functions, patch by Nelson
Elhage!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106507 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
880e7654b8ac173f0275d947ccd0d328efc2926b 22-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
43dec6bbde2d0a16c35978983761c8b7030c8e18 22-Jun-2010 Douglas Gregor <dgregor@apple.com> Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
6e86ecc546446a3ccc3b42f44afb458b8d2f2c30 21-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a corner case bug whereby declaring and defining an extern variable in a
particular sequence causes its definition to not be generated in the object file.
(fixes radar 8071804).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106424 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2bf6d7b1f7406ca4dfe841d4f6ef4b91dce195e4 21-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a corner case bug whereby declaring and defining an extern variable in a
particular sequence causes its definition to not be generated in the object file.
(fixes radar 8071804).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106424 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e7c0620f661ae13977dd84808a6272d8b256e4ff 21-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Combine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in FunctionTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106412 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
5bf1bdc2fedb0c29b5fcdb4abc852aa85b4fe26a 21-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Combine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in FunctionTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106412 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
7d389db9973da96f2d8d1c6b883b870982cb29ec 19-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Initial support for reading templates from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106392 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
8731ca76acf81826df7048bffd0c44c7c0f96c7f 19-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initial support for reading templates from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106392 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
8afa992603cad8847139aafd3de333f80f757cd5 19-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Initial support for writing templates to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106391 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
90b715e0df34eae2b50b9b43ec60828ed31dcf94 19-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initial support for writing templates to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106391 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
2f08858b0aa8e90be4e3682aac0797582624f7cd 18-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Implements Sema part of init_priority(priority) attribute
(radar 8076356) - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106322 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
521f12d3dfdbb0e93d1bcb503d074e67acdc489c 18-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Implements Sema part of init_priority(priority) attribute
(radar 8076356) - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106322 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
e11f2e1ba3a82176eff14f21ba1ea9e15207fe04 18-Jun-2010 Ted Kremenek <kremenek@apple.com> Change two static variables into instance variables of ASTContext. This allows us to have multiple copies
of ASTContext at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106258 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f057bf78a69d37ee511430c88852a85eea19ad15 18-Jun-2010 Ted Kremenek <kremenek@apple.com> Change two static variables into instance variables of ASTContext. This allows us to have multiple copies
of ASTContext at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106258 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b2f395069145e9853bfc33a63dd0aa0efb5ff1e2 18-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c070cc602d6eefea881f71a60de09e05b54c3fdd 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3f783a68df59e3cbdbfc6d1220db3524bd81a530 17-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Do not treat @selector as lvalue (unlike g++).
Patch by Nico Weber (pr7390).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
949bd4b611f4be575d63da36c94c3662dfa4d459 17-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Do not treat @selector as lvalue (unlike g++).
Patch by Nico Weber (pr7390).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cf6969912fc58e59a4a0c24ba90a803d80033c28 17-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Objective-c++ IRGen. Support for @selector expression as
an lvalue. Fixes PR7390.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106235 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
03b2960c14aede6ac82bdef32247094ebb72fa69 17-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Objective-c++ IRGen. Support for @selector expression as
an lvalue. Fixes PR7390.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106235 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
976d174ca7df21123db7901c5d8d0af328bc1568 17-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Update CMake build system for ARM NEON generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106220 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
2390b62f3afd9cc83d03a1972d4533eb52c246a4 17-Jun-2010 Douglas Gregor <dgregor@apple.com> Update CMake build system for ARM NEON generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106220 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
c35d522ecf68ce9f2e75e76b26e6965d7204b151 17-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Don't ast-print the builtin __[u]int128_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106212 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
2574f6f35a54c1c1b5bcef1e69417fe58f566c11 17-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't ast-print the builtin __[u]int128_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106212 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
00f90b974369ccd699c3d29e4edef8526d78083c 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ee6e4b4baa1acd85ba8b142862ac5986621aaffd 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
cac02dc2db388820b0353c8b6509b3b709274344 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Implement first TD-based usage of attributes.

Currently, there are two effective changes:

- Attr::Kind has been changed to attr::Kind, in a separate namespace
rather than the Attr class. This is because the enumerator needs to
be visible to parse.
- The class definitions for the C++0x attributes other than aligned are
generated by TableGen.

The specific classes generated by TableGen are controlled by an array in
TableGen (see the accompanying commit to the LLVM repository). I will be
expanding the amount of code generated as I develop the new attributes system
while initially keeping it confined to these attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106172 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
387475d0c18aaeb022108de9d33b6c9fb7998843 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Implement first TD-based usage of attributes.

Currently, there are two effective changes:

- Attr::Kind has been changed to attr::Kind, in a separate namespace
rather than the Attr class. This is because the enumerator needs to
be visible to parse.
- The class definitions for the C++0x attributes other than aligned are
generated by TableGen.

The specific classes generated by TableGen are controlled by an array in
TableGen (see the accompanying commit to the LLVM repository). I will be
expanding the amount of code generated as I develop the new attributes system
while initially keeping it confined to these attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106172 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
9951415a2b9daf6bfc6711c5f267289764e5a5f9 16-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Canonicalize template template parameters when canonicalizing a
template name that refers to such a parameter. It's amazing that this
problem didn't surface earlier. Fixes PR7387.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106147 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3e1274f2b99cb99c03cc8e2c6517c37d330b597a 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Canonicalize template template parameters when canonicalizing a
template name that refers to such a parameter. It's amazing that this
problem didn't surface earlier. Fixes PR7387.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106147 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
25560122fbc4a39c864695b170e4ff9009e1f273 16-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Revert r106099; it broke self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106100 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
eclTemplate.cpp
ypePrinter.cpp
efed5c832de630715dd42211dd3b2aab5dd97a1b 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Revert r106099; it broke self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106100 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
eclTemplate.cpp
ypePrinter.cpp
a7bf34440df135029859cedd15a83072dc08ae66 16-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TemplateTypeParmType::getDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106099 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
eclTemplate.cpp
ypePrinter.cpp
6cd8087e66d706f2317865f86c865fd9bc6969c9 16-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TemplateTypeParmType::getDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106099 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
eclTemplate.cpp
ypePrinter.cpp
7fcbab0d9ed96afbdcc3dd4ad876bcbf452fd25f 16-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.

Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106074 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
9d3347a5887d2d25afe8b0bd35783a72ec86cce2 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.

Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106074 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
59327f06fa557d652e0560e6895c93db70ea5ec7 16-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
2ade35e2cfd554e49d35a52047cea98a82787af9 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
e20fe742fcb704d5ba9dcafa1bb47488053e6652 15-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Allocate template parameter lists for out-of-line definitions via the
ASTContext rather than via the normal heap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106008 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c722ea4fbf886d6460b256b5e819a4ee751d5fff 15-Jun-2010 Douglas Gregor <dgregor@apple.com> Allocate template parameter lists for out-of-line definitions via the
ASTContext rather than via the normal heap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106008 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2424a2336d182591da7d8a595dcb41b3c35ee450 14-Jun-2010 Chris Lattner <sabre@nondot.org> Fix:
Decl.cpp:716:28: warning: initialization of pointer of type 'clang::VarDecl *' from literal 'false' [-Wbool-conversions]
VarDecl *LastTentative = false;
^
RewriteRope.cpp:535:12: warning: initialization of pointer of type '<anonymous>::RopePieceBTreeNode *' from literal 'false'
[-Wbool-conversions]
return false;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105946 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f0ed9ef428a051bafc914b9935dcd1d1aa30cf3f 14-Jun-2010 Chris Lattner <sabre@nondot.org> Fix:
Decl.cpp:716:28: warning: initialization of pointer of type 'clang::VarDecl *' from literal 'false' [-Wbool-conversions]
VarDecl *LastTentative = false;
^
RewriteRope.cpp:535:12: warning: initialization of pointer of type '<anonymous>::RopePieceBTreeNode *' from literal 'false'
[-Wbool-conversions]
return false;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105946 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a2ecbe91b9326cfef3d281d2be249fe25d9ff1eb 13-Jun-2010 Anders Carlsson <andersca@mac.com> Do the same short-circuit optimization when laying out bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105920 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e3362bc104f401564a68ef2e0e5fd89f440cf4fc 13-Jun-2010 Anders Carlsson <andersca@mac.com> Do the same short-circuit optimization when laying out bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105920 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
f82f4894308678162ad6df8a701f0771611c0bd5 13-Jun-2010 Anders Carlsson <andersca@mac.com> Implement part of the EmptySubobjectMap optimization described in PR6998. We still need to do this for bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105919 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5ccfdd8d215c7bf324a14523c71ed328325c2bc8 13-Jun-2010 Anders Carlsson <andersca@mac.com> Implement part of the EmptySubobjectMap optimization described in PR6998. We still need to do this for bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105919 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
486c883ca29f6b50bb8ded372ad5bb2970fd4101 13-Jun-2010 John McCall <rjmccall@apple.com> TemplateSpecializationType's isCurrentInstantiation bit can be derived
from its canonical type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105912 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
71d74bc0d6e522ce7c21a599db8e19d3883b518f 13-Jun-2010 John McCall <rjmccall@apple.com> TemplateSpecializationType's isCurrentInstantiation bit can be derived
from its canonical type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105912 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
e126f73aaca758b4076d26ab25ef02ed99e9240b 12-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added template parameters info for out-of-line definitions of class template methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105882 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9b9348889d85fc9daf943c64e3ac3fb021a4f028 12-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added template parameters info for out-of-line definitions of class template methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105882 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f6ac61987ba4f5b95eb97817253664121c69cab5 12-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Don't omit class explicit instantiation from AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105880 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
c98971d5c994caed9452aeadd0122c855e0f4de1 12-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Don't omit class explicit instantiation from AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105880 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
a9fdd99688dccae42721e8ca24433f6e6f6ba48b 12-Jun-2010 John McCall <rjmccall@apple.com> When deciding whether an expression has the boolean nature, don't look through
explicit casts. Fixes PR7359.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105871 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6907fbe758d23e1aec4c0a67e7b633d1d855feb4 12-Jun-2010 John McCall <rjmccall@apple.com> When deciding whether an expression has the boolean nature, don't look through
explicit casts. Fixes PR7359.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105871 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3b566498b52227123af5d3fc1baef3e75f886f15 12-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix PCH issue. Attributes of a declaration were truncated to just one when the decl was read from a PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105852 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1715bf5ed87c792c63278e739bc492921d512a88 12-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix PCH issue. Attributes of a declaration were truncated to just one when the decl was read from a PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105852 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
66d1debf0562f6acf8ff8a3825fed04451ae87c5 11-Jun-2010 John McCall <rjmccall@apple.com> Fix the constant evaluator for AltiVec-style vector literals so that the
vector is filled with the given constant; we were just initializing the
first element.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105824 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a7d6c221558fa8117aa1d1fd41cf0046c5c9fade 11-Jun-2010 John McCall <rjmccall@apple.com> Fix the constant evaluator for AltiVec-style vector literals so that the
vector is filled with the given constant; we were just initializing the
first element.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105824 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
02cd8e64ab4b62f88c62f63320ddd17466764022 11-Jun-2010 John McCall <rjmccall@apple.com> Don't store ASTContext references in the TST nodes just to support profiling.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105820 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ef99001908e799c388f1363b1e607dad5f5b57d3 11-Jun-2010 John McCall <rjmccall@apple.com> Don't store ASTContext references in the TST nodes just to support profiling.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105820 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
775bd4daffb0aca43bb65d4a7907d3bf6b059a47 11-Jun-2010 John McCall <rjmccall@apple.com> Provide an Objective C mangling for wchar_t. Patch by Nico Weber!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105818 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
24da7093a84e4eb92731e0565ab655697b2ed08f 11-Jun-2010 John McCall <rjmccall@apple.com> Provide an Objective C mangling for wchar_t. Patch by Nico Weber!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105818 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
52b136ace347ee82e11145927e37980157bacb35 11-Jun-2010 John McCall <rjmccall@apple.com> Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.

Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
emplateBase.cpp
ype.cpp
ypePrinter.cpp
33500955d731c73717af52088b7fc0e7a85681e7 11-Jun-2010 John McCall <rjmccall@apple.com> Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.

Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
emplateBase.cpp
ype.cpp
ypePrinter.cpp
e6a9c1e8077cbcd71419141a50c5637294ad98a5 09-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added inherited info to template and non-type arguments of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105716 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
d92f7a297c0ed3f7d0ebcbb557e1d4c1925b8c72 09-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added inherited info to template and non-type arguments of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105716 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
68d94c7f72d49fad4aaf3eaaf472f9047934fd4a 09-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Tweak our handling of the notion of a standard conversion sequence
being a subsequence of another standard conversion sequence. Instead
of requiring exact type equality for the second conversion step,
require type *similarity*, which is type equality with cv-qualifiers
removed at all levels. This appears to match the behavior of EDG and
VC++ (albeit not GCC), and feels more intuitive. Big thanks to John
for the line of reasoning that supports this change: since
cv-qualifiers are orthogonal to the second conversion step, we should
ignore them in the type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105678 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5a57efd7bf88a4a13018e0471ded8063a4abe8af 09-Jun-2010 Douglas Gregor <dgregor@apple.com> Tweak our handling of the notion of a standard conversion sequence
being a subsequence of another standard conversion sequence. Instead
of requiring exact type equality for the second conversion step,
require type *similarity*, which is type equality with cv-qualifiers
removed at all levels. This appears to match the behavior of EDG and
VC++ (albeit not GCC), and feels more intuitive. Big thanks to John
for the line of reasoning that supports this change: since
cv-qualifiers are orthogonal to the second conversion step, we should
ignore them in the type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105678 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6c1246e8d90b69442b66f14056b620c259fc9979 09-Jun-2010 Ted Kremenek <kremenek@apple.com> Fix memory leak in ASTContext where ASTRecordLayout objects involving C++ structures wouldn't have
their associated memory destroyed when using a BumpPtrAllocator. These objects internally use
a DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105659 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
dcfcfbec478f7ed96cd8d92f30c29bd4e30d5b9c 09-Jun-2010 Ted Kremenek <kremenek@apple.com> Fix memory leak in ASTContext where ASTRecordLayout objects involving C++ structures wouldn't have
their associated memory destroyed when using a BumpPtrAllocator. These objects internally use
a DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105659 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ed5bf62969af84e508b62c0a9b19756bbfb2ce38 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
c4dec1c58eeb2ef46cdb64120eb6b819c6927afb 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e55e5e35d511ea62e635374aeca1c09ba7ce6d88 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
afed099bd2e759efd4bb63fdc525d3445f94cc13 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
25a78a2b716ecd6ae47be0014ba569829dd4c9a0 08-Jun-2010 Anders Carlsson <andersca@mac.com> Correctly handle fields with virtual bases containing empty subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105628 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
45f5b54d67215639ae6585d12df5133e99180c2b 08-Jun-2010 Anders Carlsson <andersca@mac.com> Correctly handle fields with virtual bases containing empty subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105628 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d7ef560adcf52e875e72826757b8c230fa17d95e 08-Jun-2010 Anders Carlsson <andersca@mac.com> When checking whether we can place a base subobject at an offset, we don't need to go past the highest offset that's known to contain an empty base subobject.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105611 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2177ab7be5256e691a115356fcb8f3eef9c9733f 08-Jun-2010 Anders Carlsson <andersca@mac.com> When checking whether we can place a base subobject at an offset, we don't need to go past the highest offset that's known to contain an empty base subobject.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105611 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b5c13c3531e55b7cf98e5a673f0ae9c0f12e8026 08-Jun-2010 Anders Carlsson <andersca@mac.com> Minor cleanups to the empty subobject map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105608 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c8cb462e57ac13518a170fe52b77bb8656234b35 08-Jun-2010 Anders Carlsson <andersca@mac.com> Minor cleanups to the empty subobject map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105608 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c8bfd0f8bb22ea019c673898bbdb07a834f0d821 08-Jun-2010 Shih-wei Liao <sliao@google.com> Git hiccup. Retry....

Change-Id: I5a329137a43f36bab32ea62386ade11da550c0b0
ndroid.mk
200213f20fef82c10b7da00873c99b93cee6da63 08-Jun-2010 Shih-wei Liao <sliao@google.com> Fix llvm.mk and the other 49 mk files

Change-Id: I5aa02363c1083297d163a575f5a35c495f950230
ndroid.mk
b9805b6ffe18062027f2150f0b701d2873617fc5 05-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added AccessSpecDecl node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105525 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclPrinter.cpp
6206d53f67613958ae1b023aba337ebb46f11a8b 05-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added AccessSpecDecl node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105525 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclPrinter.cpp
dd7031f9abb330acaca44755b499988cba487f00 05-Jun-2010 John McCall <rjmccall@apple.com> Alter the interface of GetTypeForDeclarator to return a TypeSourceInfo*.
This is never null, but the associated type might be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105503 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bf1a028246d884a540aeafa38e89be59a269b072 05-Jun-2010 John McCall <rjmccall@apple.com> Alter the interface of GetTypeForDeclarator to return a TypeSourceInfo*.
This is never null, but the associated type might be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105503 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bfa7c00b14aea814fdbfc693bba43cbd25878775 05-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Correctly align large arrays in x86-64. This fixes PR5599.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105500 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6deecb0d46bcfd048e651d2db7c4fb0d6407da96 05-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Correctly align large arrays in x86-64. This fixes PR5599.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105500 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c3b388c3d05f654a6c8e2effe6025ba53df5b7f2 04-Jun-2010 John McCall <rjmccall@apple.com> Remember type source information for Objective C property declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105484 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
83a230c83a54190366138c1a4f4310ef838b88fc 04-Jun-2010 John McCall <rjmccall@apple.com> Remember type source information for Objective C property declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105484 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
ea285162342df160e7860e26528bc7110bc6c0cd 04-Jun-2010 Shih-wei Liao <sliao@google.com> Initial slang.

Change-Id: I4f84a741e5fbc440cd4c251406d2b611a237f713
PValue.cpp
STConsumer.cpp
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ndroid.mk
ttrImpl.cpp
MakeLists.txt
XXInheritance.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclFriend.cpp
eclGroup.cpp
eclObjC.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
ullExpr.cpp
nheritViz.cpp
akefile
estedNameSpecifier.cpp
arentMap.cpp
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtProfile.cpp
tmtViz.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
ypeLoc.cpp
ypePrinter.cpp
40d63d2c8b4cedfec60ffcbb7a6b45bf38dcc993 04-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Added a field to BlockDeclRefExpr for future use.
No functionality change yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105479 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
89f9d3a7651d1225f3f56ae3387c83b98a26da00 04-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Added a field to BlockDeclRefExpr for future use.
No functionality change yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105479 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
ca8b08f69aab18583db68507e89982b1481bf35a 04-Jun-2010 John McCall <rjmccall@apple.com> Preserve more information from a block's original function declarator, if one
was given. Remove some unnecessary accounting from BlockScopeInfo. Handle
typedef'ed function types until such time as we decide not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105478 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c71a4915ca216847599d03cab4ed1c5086b0eb43 04-Jun-2010 John McCall <rjmccall@apple.com> Preserve more information from a block's original function declarator, if one
was given. Remove some unnecessary accounting from BlockScopeInfo. Handle
typedef'ed function types until such time as we decide not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105478 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
00af20e9eb452635d3944165d43020e6751cd634 04-Jun-2010 Anders Carlsson <andersca@mac.com> Add a short circuit in isVirtuallyDerivedFrom.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105457 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
1c4c397c581ad7106fc911fc4592c7aca163b5bc 04-Jun-2010 Anders Carlsson <andersca@mac.com> Add a short circuit in isVirtuallyDerivedFrom.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105457 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
c9a2627f31ab34f07c2a857358ce02ed6f3d92c5 04-Jun-2010 David Chisnall <csdavec@swan.ac.uk> Fixed Objective-C type encoding for bitfields for the GNU runtime to match the encoding used by GCC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105451 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
64fd7e86c1a90d9ff78e4a0bd79f69499667a4e3 04-Jun-2010 David Chisnall <csdavec@swan.ac.uk> Fixed Objective-C type encoding for bitfields for the GNU runtime to match the encoding used by GCC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105451 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
caa539fd0a5b9e2033a60a4c1f5910208c49c454 03-Jun-2010 John McCall <rjmccall@apple.com> Hack in some really terrible C++ record PCH support that I need right now.
This is required in order to test:

The ASTImporter should set base classes after formally entering the definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105401 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5250f27420386452a21692a6292c99ee7febdac4 03-Jun-2010 John McCall <rjmccall@apple.com> Hack in some really terrible C++ record PCH support that I need right now.
This is required in order to test:

The ASTImporter should set base classes after formally entering the definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105401 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
1d512f28ed192aecb039c8178d57a103221ab393 03-Jun-2010 Anders Carlsson <andersca@mac.com> Add all final overriders to the map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105374 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
ffdb2d2a8860c601b35575855494f45d85cf14d9 03-Jun-2010 Anders Carlsson <andersca@mac.com> Add all final overriders to the map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105374 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
60d14ff16083101abbc6348f09103f753473c090 01-Jun-2010 John McCall <rjmccall@apple.com> Alter the ExternalASTSource interface to permit by-name lookups. PCH continues to
bring in the entire lookup table at once.

Also, give ExternalSemaSource's vtable a home. This is important because otherwise
any reference to it will cause RTTI to be emitted, and since clang is compiled
with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's
RTTI). So this change makes it possible to subclass ExternalSemaSource from projects
compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105268 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
76bd1f387e6a7b7abfe53f63b3bd429b97bb80f0 01-Jun-2010 John McCall <rjmccall@apple.com> Alter the ExternalASTSource interface to permit by-name lookups. PCH continues to
bring in the entire lookup table at once.

Also, give ExternalSemaSource's vtable a home. This is important because otherwise
any reference to it will cause RTTI to be emitted, and since clang is compiled
with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's
RTTI). So this change makes it possible to subclass ExternalSemaSource from projects
compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105268 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b7be965ff561d784a5de8d794b56a442085c8760 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclBase.cpp
9a55591af3e5506b95a9718e15380129fbfc5ebc 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclBase.cpp
89068f4bc610f6b6c13367641ff06540353998ae 30-May-2010 Anders Carlsson <andersca@mac.com> And now for the best part: Removing the old code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105162 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c15503d77bb109ab33f1a865cc318de18a3a1adf 30-May-2010 Anders Carlsson <andersca@mac.com> And now for the best part: Removing the old code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105162 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ebe4ab87bf824b922822c36a1727b63b4996a30d 30-May-2010 Anders Carlsson <andersca@mac.com> Turn on the new empty base subobject tracking code. It's a bit faster than the previous code. However, it still has quadratic performance, something which I intend to fix shortly in a subsequent patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105161 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
83a45e7dab892e9efd3515eca4eb5b81bc3f2126 30-May-2010 Anders Carlsson <andersca@mac.com> Turn on the new empty base subobject tracking code. It's a bit faster than the previous code. However, it still has quadratic performance, something which I intend to fix shortly in a subsequent patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105161 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0d8404994a45bed97c8296736296ad1dadb5f84a 29-May-2010 Anders Carlsson <andersca@mac.com> Cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105114 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4137d517700a1b0f834535545c3f1676f40abcfb 29-May-2010 Anders Carlsson <andersca@mac.com> Cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105114 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b1a000e82a4534949eb367c34cfeda2a27a8a830 29-May-2010 Anders Carlsson <andersca@mac.com> Make EmptySubobjectMap::CanPlaceBaseAtOffset take a BaseSubobjectInfo as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105113 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5b1319c78061e76d70cca50fb3343b25928e001b 29-May-2010 Anders Carlsson <andersca@mac.com> Make EmptySubobjectMap::CanPlaceBaseAtOffset take a BaseSubobjectInfo as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105113 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2223278d3415b4e60ebeee7d5e8d2e137026db10 29-May-2010 Anders Carlsson <andersca@mac.com> Change RecordLayoutBuilder::LayoutBase to take a BaseSubobjectInfo. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105112 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b1d880b15f6b254349bd7a700e6b4f2ec1c24f5b 29-May-2010 Anders Carlsson <andersca@mac.com> Change RecordLayoutBuilder::LayoutBase to take a BaseSubobjectInfo. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105112 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
68323da86b5feb7cdcacb0a207ad777a2949bccf 29-May-2010 Anders Carlsson <andersca@mac.com> Rework the way virtual primary bases are added when laying out classes. Instead of doing it as a separate step, we now use the BaseSubobjectInfo and use it when laying out the bases. This fixes a bug where we would either not add a primary virtual base at all, or add it at the wrong offset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105110 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3cd09ccbb1a750a7b40593a7b0a2d95ee2a0ba0e 29-May-2010 Anders Carlsson <andersca@mac.com> Rework the way virtual primary bases are added when laying out classes. Instead of doing it as a separate step, we now use the BaseSubobjectInfo and use it when laying out the bases. This fixes a bug where we would either not add a primary virtual base at all, or add it at the wrong offset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105110 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
cc7c1e8ebb07f2211c11071193d6c3471e0dcddb 29-May-2010 Anders Carlsson <andersca@mac.com> Change LayoutVirtualBase to also take a BaseSubobjectInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105104 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
276b491b44b473d91610432aa335927b2c7ad152 29-May-2010 Anders Carlsson <andersca@mac.com> Change LayoutVirtualBase to also take a BaseSubobjectInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105104 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a6d4a4432c11904b93c5fb54b9610c42e6f124a1 29-May-2010 Anders Carlsson <andersca@mac.com> Change RecordLayoutBuilder::LayoutNonVirtualBase to take a BaseSubobjectInfo. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105103 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
07cebc57123db6a50c7c293e44a9647ce069952b 29-May-2010 Anders Carlsson <andersca@mac.com> Change RecordLayoutBuilder::LayoutNonVirtualBase to take a BaseSubobjectInfo. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105103 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
471236d319346f0cdff45528bb2b7a60b0855a76 29-May-2010 Anders Carlsson <andersca@mac.com> Move computing the base subobject info for a class into the RecordLayoutBuilder because we're going to need it to be able to correctly add offsets for primary virtual bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105102 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6e26454ecceb20938b866717dc8a72c6d37d224d 29-May-2010 Anders Carlsson <andersca@mac.com> Move computing the base subobject info for a class into the RecordLayoutBuilder because we're going to need it to be able to correctly add offsets for primary virtual bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105102 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3d38ac201ef3e3385bd6696a16a99602b5c373a7 29-May-2010 John McCall <rjmccall@apple.com> Copy source information for the inner type of an elaborated type; fixes some
valgrind problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105062 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4e449836c0deee9cfd92d32cb7d843759fa6452b 29-May-2010 John McCall <rjmccall@apple.com> Copy source information for the inner type of an elaborated type; fixes some
valgrind problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105062 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
afb50e8c7dfd3d5c10408e2a764543cfc068b2ee 28-May-2010 Douglas Gregor <doug.gregor@gmail.com> Only provide a source location for an anonymous tag if the location is valid

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105010 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
16834e88b9102b7c6562a6bb8a8931a58ebda900 28-May-2010 Douglas Gregor <dgregor@apple.com> Only provide a source location for an anonymous tag if the location is valid

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105010 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
b0a2a9cbbc8e36273426cb5c78ad049a739d145a 28-May-2010 Anders Carlsson <andersca@mac.com> Rename BaseInfo to BaseSubobjectInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105007 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ea2f41c584b9741a591e11c83819b31856f5bc18 28-May-2010 Anders Carlsson <andersca@mac.com> Rename BaseInfo to BaseSubobjectInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105007 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
cfd39ca77c1c4f3a149b81cd59da1bd0acd772b4 28-May-2010 Anders Carlsson <andersca@mac.com> Move BaseInfo outside of the EmptySubobject class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105002 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4a25799760982b3363f3c4eb6df953d70e35e37d 28-May-2010 Anders Carlsson <andersca@mac.com> Move BaseInfo outside of the EmptySubobject class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105002 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
33bf24b6c409519bd3bff02fca66988e073d85e4 28-May-2010 John McCall <rjmccall@apple.com> Roll back r104941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104990 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2b7baf0816a40af3fde3a3e174192a549b785a50 28-May-2010 John McCall <rjmccall@apple.com> Roll back r104941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104990 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
65c142e3f6681b65406f8c9f0ac7cf3de866e010 28-May-2010 John McCall <rjmccall@apple.com> Add a new attribute on records, __attribute__((adl_invisible)), and define
the x86-64 __va_list_tag with this attribute. The attribute causes the
affected type to behave like a fundamental type when considered by ADL.

(x86-64 is the only target we currently provide with a struct-based
__builtin_va_list)

Fixes PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104941 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1d0a5856d066f9030efbe3e0d9bbbb50ea597b99 28-May-2010 John McCall <rjmccall@apple.com> Add a new attribute on records, __attribute__((adl_invisible)), and define
the x86-64 __va_list_tag with this attribute. The attribute causes the
affected type to behave like a fundamental type when considered by ADL.

(x86-64 is the only target we currently provide with a struct-based
__builtin_va_list)

Fixes PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104941 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
574fc90972044c50c1e13ba6306e9d20376e1299 27-May-2010 Anders Carlsson <andersca@mac.com> More work on the empty subobject map. This code is not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104861 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
812a3456b63708a5972f712e9e4b54d3cc436378 27-May-2010 Anders Carlsson <andersca@mac.com> More work on the empty subobject map. This code is not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104861 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8f869a16b34f9c3acabac0945f7cf9da97e3bd92 27-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fix 80-column.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104847 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
81148e9c24687564b3dd13bcb5e5e9f5100c0c95 27-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fix 80-column.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104847 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
806ead89679bc072086d677ef9f0fd6598b745d5 27-May-2010 Fariborz Jahanian <fjahanian@apple.com> Objective-c++ IR gen.
Flag synthesized struct decl. as non-empty so
CXX side of ir gen does not skip its Null initialization.
Fixes radar 8027844 for objc++'s collection statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104837 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
38c9ab880b843a128f8d895d3e2e24877e178788 27-May-2010 Fariborz Jahanian <fjahanian@apple.com> Objective-c++ IR gen.
Flag synthesized struct decl. as non-empty so
CXX side of ir gen does not skip its Null initialization.
Fixes radar 8027844 for objc++'s collection statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104837 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3cfaa6cdce59d7f14090daa8b5d5a2f60347215c 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Add initial support for '#pragma options align=mac68k'.
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
holes I'd appreciate any failing test cases!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104809 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c6082fe347a414a2e19f2ad8fe41720f10733296 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Add initial support for '#pragma options align=mac68k'.
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
holes I'd appreciate any failing test cases!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104809 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fbc8468fd28e402693eaff0e53eb153e07c1b782 27-May-2010 Anders Carlsson <andersca@mac.com> More work on the new empty subobject map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104808 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
58b16b6e46716e24f1cdaa0a5e1253415c4e30b3 27-May-2010 Anders Carlsson <andersca@mac.com> More work on the new empty subobject map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104808 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c05f2a19275cdadd22551d9ff58d36bb465fbe1f 27-May-2010 Daniel Dunbar <daniel@zuster.org> Strip trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104801 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0aa7edbc1f579787c4f69144fd1b04e777d89391 27-May-2010 Daniel Dunbar <daniel@zuster.org> Strip trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104801 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2da5d143b02c2fdcfba7ba6ccc2976b8af46bb92 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Add AlignMac68kAttr, not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104800 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
4e9255f4ad5f87217995eeb488a7c5b336bb732d 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Add AlignMac68kAttr, not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104800 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
8df8ff1b1d982e97d323d354379234802b6b9b3d 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ecordLayoutBuilder.cpp
8a2c92cab213bd7e28ff669577e815cd70bafbe3 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ecordLayoutBuilder.cpp
d6007f9acc37ac27bb889ee26161ef213ca808b0 27-May-2010 Anders Carlsson <andersca@mac.com> More work on the empty subobjects map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104787 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
261febd091cd05325ae202b7d388a2d266bbf126 27-May-2010 Anders Carlsson <andersca@mac.com> More work on the empty subobjects map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104787 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5dfbaf6afc3278ee7164daf8454712acbb83f086 26-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added source order to CXXBaseOrMemberInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104712 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a0af3b453160fc4c67363c204da13820b0586909 26-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added source order to CXXBaseOrMemberInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104712 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
62954e3380ac51a21791fc152ba93e658e128c5f 26-May-2010 Anders Carlsson <andersca@mac.com> Move ComputeEmptySubobjectSizes to EmptySubobjectMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104702 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0c54fc91322faaa78422c3aaec261a26e45d7f8c 26-May-2010 Anders Carlsson <andersca@mac.com> Move ComputeEmptySubobjectSizes to EmptySubobjectMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104702 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e3364bd67a0b0db5ecf47a3611150239130e5d06 26-May-2010 Anders Carlsson <andersca@mac.com> Stub out the EmptySubobjectsMap class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104701 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6a91c0328c81fe1be4e5380fb0e586cafee53b26 26-May-2010 Anders Carlsson <andersca@mac.com> Stub out the EmptySubobjectsMap class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104701 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
f000460e16955e134263155095d4be21ea3d382b 26-May-2010 Anders Carlsson <andersca@mac.com> Inline the RecordLayoutBuilder constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104700 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0efac254e385f06e34158aaa351942c80149042f 26-May-2010 Anders Carlsson <andersca@mac.com> Inline the RecordLayoutBuilder constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104700 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ebbe2588347fe063179df6aefe4cbb0103e46597 26-May-2010 Anders Carlsson <andersca@mac.com> Add a Layout overload that takes a CXXRecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104695 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
c6cab68ae1f8ebdcabaf51391dba09bfbad02e4f 26-May-2010 Anders Carlsson <andersca@mac.com> Add a Layout overload that takes a CXXRecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104695 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
099325882037c3ee1ce949e842c80e7c8c779590 26-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Move RecordLayoutBuilder into an anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104693 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
7e220286410422ed1dc0409a9cb9708fe50e3df0 26-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Move RecordLayoutBuilder into an anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104693 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5b5744b0e34bdc68eb408bc523b23cfd212c6431 26-May-2010 Anders Carlsson <andersca@mac.com> Rename ASTRecordLayoutBuilder to RecordLayoutBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104688 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
7d0918acd134ab93b7d3eb6add93dfde37b1f7b3 26-May-2010 Anders Carlsson <andersca@mac.com> Rename ASTRecordLayoutBuilder to RecordLayoutBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104688 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e599259f21aafbf64f7184e24a2fd3da2726ee44 26-May-2010 Anders Carlsson <andersca@mac.com> Remove RecordLayoutBuilder.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104687 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
c49a7d505dd527044efdcfb5f3f347de345c3ff4 26-May-2010 Anders Carlsson <andersca@mac.com> Remove RecordLayoutBuilder.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104687 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
68c428433ff237a9d408a52f9afdc001d54b3081 26-May-2010 Anders Carlsson <andersca@mac.com> Move the ASTRecordLayoutBuilder class declaration into the .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104686 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
9392fa63e45716e32061d05673fa28909f325b02 26-May-2010 Anders Carlsson <andersca@mac.com> Move the ASTRecordLayoutBuilder class declaration into the .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104686 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
4116fcb9a96e59c52fad16d6c072f401a09e39fb 26-May-2010 Anders Carlsson <andersca@mac.com> Fix thinko and remove another unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104683 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
aa230b7bd2054e70e9500aff584845cb1cc34ca7 26-May-2010 Anders Carlsson <andersca@mac.com> Fix thinko and remove another unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104683 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3a7f7d3bbd9b1ea80e850a99c8bcae7dcfbbe76e 26-May-2010 Anders Carlsson <andersca@mac.com> Fix build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104682 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4831710518be9f506f0bc2d11bec6205061fc119 26-May-2010 Anders Carlsson <andersca@mac.com> Fix build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104682 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
28dbf3f71d0e5acf64263672f87a6645292772b9 26-May-2010 Anders Carlsson <andersca@mac.com> No need to use the PrimaryBaseInfo struct in the builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104681 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
28fdd0a8b450c1329b3303e5cf8e8a788a0ef85a 26-May-2010 Anders Carlsson <andersca@mac.com> No need to use the PrimaryBaseInfo struct in the builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104681 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
90073cafbf64f792dd2c0bd1e85032ef320493b8 26-May-2010 Anders Carlsson <andersca@mac.com> Remove FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104674 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
400b06dde52df439b25264fbbc0271d96d27903c 26-May-2010 Anders Carlsson <andersca@mac.com> Remove FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104674 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
30e2c14f05fff708b8f4bc239e816658c4aa3148 26-May-2010 Anders Carlsson <andersca@mac.com> Fold the other Layout overload into its sole call site.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104673 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
2f64e377d1aa733b81a4c5e78e32a62c41426626 26-May-2010 Anders Carlsson <andersca@mac.com> Fold the other Layout overload into its sole call site.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104673 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
f9115040c46312aa56ab97bb2479fb4abc350162 26-May-2010 Anders Carlsson <andersca@mac.com> Fold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDecl pointer into its only callsite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104672 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
36cdc61b98460c06ee07710f77b911675fdce6a7 26-May-2010 Anders Carlsson <andersca@mac.com> Fold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDecl pointer into its only callsite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104672 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
ece336d55f7ffe7ba24a29daee0313ab1dc89b47 26-May-2010 Anders Carlsson <andersca@mac.com> Move the relevant ASTContext member functions that deal with ASTRecordLayoutBuilder into RecordLayoutBuilder.cpp. This matches the way we interact with other builder classes (CGRecordLayoutBuilder, VTableBuilder and VTTBuilder) and it also allows for making ASTRecordLayoutBuilder a private class without a header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104671 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
1e641ce1c169b4b0cac3d7ad6da44b323453049c 26-May-2010 Anders Carlsson <andersca@mac.com> Move the relevant ASTContext member functions that deal with ASTRecordLayoutBuilder into RecordLayoutBuilder.cpp. This matches the way we interact with other builder classes (CGRecordLayoutBuilder, VTableBuilder and VTTBuilder) and it also allows for making ASTRecordLayoutBuilder a private class without a header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104671 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
56b90f8c7fc63125c4cb72b622b172b4cc8a7133 25-May-2010 Ted Kremenek <kremenek@apple.com> Allocate the contents of TemplateArgumentList using ASTContext's allocator. This fixes
a massive memory leak when using a BumpPtrAllocator in ASTContext.

Added a FIXME, as the Destroy method for TemplateArgumentList isn't getting called.
This means we will instead leak when using the MallocAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104633 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
3458d43b68cc2fd1cb2b2304614e1dc3419820d8 25-May-2010 Ted Kremenek <kremenek@apple.com> Allocate the contents of TemplateArgumentList using ASTContext's allocator. This fixes
a massive memory leak when using a BumpPtrAllocator in ASTContext.

Added a FIXME, as the Destroy method for TemplateArgumentList isn't getting called.
This means we will instead leak when using the MallocAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104633 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
896ffe7d885a5eebd847da871344744b3d615134 25-May-2010 Chris Lattner <sabre@nondot.org> make -ast-dump print something like this for declstmts:
(DeclStmt 0x3405550 <line:3:4, col:11>
0x34053a0 "int x")
instead of:
(DeclStmt 0x3405550 <line:3:4, col:11>
0x34053a0 "int x"

which has unbalanced parens (PR7228)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104620 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
a46325e7b9c07adcfcf25566ba6ccce033a63e61 25-May-2010 Chris Lattner <sabre@nondot.org> make -ast-dump print something like this for declstmts:
(DeclStmt 0x3405550 <line:3:4, col:11>
0x34053a0 "int x")
instead of:
(DeclStmt 0x3405550 <line:3:4, col:11>
0x34053a0 "int x"

which has unbalanced parens (PR7228)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104620 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
c53f982bba536ed5513cdc57883d05ca2dab55cf 24-May-2010 Douglas Gregor <doug.gregor@gmail.com> A type- or value-dependent expression cannot use bitfield
promotion. Fixes <rdar://problem/8020920>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104545 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ceafbdeb93ecf323cca74e660bf54504c86f3b71 24-May-2010 Douglas Gregor <dgregor@apple.com> A type- or value-dependent expression cannot use bitfield
promotion. Fixes <rdar://problem/8020920>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104545 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6e629b8ba96edc3ff60af670b32381843da8270d 23-May-2010 Douglas Gregor <doug.gregor@gmail.com> It turns out that people love using VLAs in templates, too. Weaken our
VLA restrictions so that one can use VLAs in templates (even
accidentally), but not as part of a non-type template parameter (which
would be very bad).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104471 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
a481ec4150ad203440852a2bfee0883dd26f7530 23-May-2010 Douglas Gregor <dgregor@apple.com> It turns out that people love using VLAs in templates, too. Weaken our
VLA restrictions so that one can use VLAs in templates (even
accidentally), but not as part of a non-type template parameter (which
would be very bad).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104471 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
76bda258ee7feb86f569666d95cc403b37f82555 23-May-2010 Douglas Gregor <doug.gregor@gmail.com> Move OverloadExpr over to a ASTContext-allocated pointer for its
storage, rather than an UnresolvedSet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104469 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
928e6fcf66fc4f342bcf7cc96bf56986c9c2a833 23-May-2010 Douglas Gregor <dgregor@apple.com> Move OverloadExpr over to a ASTContext-allocated pointer for its
storage, rather than an UnresolvedSet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104469 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d6a9427b13d3f1d5762de2d683268821c7853fdd 23-May-2010 Douglas Gregor <doug.gregor@gmail.com> Provide the overloaded functions for UnresolvedLookupExpr and
UnresolvedMemberExpr in their constructors, rather than adding them
after the fact. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104468 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
5a84dec38cfa9e084377a3167b474c79283c82fa 23-May-2010 Douglas Gregor <dgregor@apple.com> Provide the overloaded functions for UnresolvedLookupExpr and
UnresolvedMemberExpr in their constructors, rather than adding them
after the fact. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104468 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
75a9505863ea5d3b903e8827830f5d3e00d0f9b4 23-May-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of all of the class and function template's "common"
pointers in the ASTContext, so that the folding sets stored inside
them will be deallocated when the ASTContext is destroyed (under
-disable-free). <rdar://problem/7998824>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104465 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
0054531488928a424666ac11fcdc6bcc5112de52 23-May-2010 Douglas Gregor <dgregor@apple.com> Keep track of all of the class and function template's "common"
pointers in the ASTContext, so that the folding sets stored inside
them will be deallocated when the ASTContext is destroyed (under
-disable-free). <rdar://problem/7998824>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104465 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
8f47bc85f58f7e6b7b32a22b9811a2b40d444d1b 23-May-2010 Anders Carlsson <andersca@mac.com> When recording empty subobjects we should always look at the primary virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104464 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
bfcdc40cbc213d91d91513ba8e1fbde65734ddf4 23-May-2010 Anders Carlsson <andersca@mac.com> When recording empty subobjects we should always look at the primary virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104464 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4a9e6e0ce0c07674a409d0ffdf01a95b888acff6 23-May-2010 Douglas Gregor <doug.gregor@gmail.com> Even though we don't unique VLA types, we still need to build a
canonical type where the element type is canonical. Fixes PR7206.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104461 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
715e9c8a39437347e838aa108df443fe1086d359 23-May-2010 Douglas Gregor <dgregor@apple.com> Even though we don't unique VLA types, we still need to build a
canonical type where the element type is canonical. Fixes PR7206.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104461 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7dff079a1f312fd1db7376c8362f5e9a96c7fb48 21-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Improved TypeLoc::getSourceRange().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104382 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
e4aec0eae303e926643c7239cf7b0197ea9f63e2 21-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Improved TypeLoc::getSourceRange().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104382 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
90f2dca178e6c2076cd74dc78fb4b22128e0f048 21-May-2010 Douglas Gregor <doug.gregor@gmail.com> Use CanQualType to enforce the use of a canonical type argument to
CXXBasePaths::isAmbiguous(), rather than just asserting that we have a
canonical type. Fixes PR7176.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104374 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
e0d5fe2a417b84ac8b51927ebeb8f1c9ae492760 21-May-2010 Douglas Gregor <dgregor@apple.com> Use CanQualType to enforce the use of a canonical type argument to
CXXBasePaths::isAmbiguous(), rather than just asserting that we have a
canonical type. Fixes PR7176.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104374 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
b3f7ed710d899ec70a2aa0b65c82f37a04e4e340 21-May-2010 John McCall <rjmccall@apple.com> Introduce a method to get from an anonymous struct or union record declaration
to the associated object declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104309 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bc365c53606ab90537576cb48d93a54ce3fb0cb5 21-May-2010 John McCall <rjmccall@apple.com> Introduce a method to get from an anonymous struct or union record declaration
to the associated object declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104309 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ff92ad2e768122cf2adf1d4ac818bde68491c4c0 20-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104226 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e03db98d67111ebf7622d9086951aacc24406b66 20-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104226 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
77e8e18b02560741e07052f35f29894f0a787091 20-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Renamed misleading getSourceRange -> getLocalSourceRange and getFullSourceRange -> getSourceRange for TypeLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104220 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
xprCXX.cpp
emplateBase.cpp
ypeLoc.cpp
bd054dba8a3023821f2a0951b0fae05e3522a7c9 20-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Renamed misleading getSourceRange -> getLocalSourceRange and getFullSourceRange -> getSourceRange for TypeLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104220 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
xprCXX.cpp
emplateBase.cpp
ypeLoc.cpp
357f3b377abe85dd33a59122c90a361ea4226353 20-May-2010 John McCall <rjmccall@apple.com> Support implicitly closing on 'this' in a block. Fixed PR7165.

(the codegen works here, too, but that's annoying to test without execution)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104202 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea1471e0e967548c596a71469702f8846dbaf3c0 20-May-2010 John McCall <rjmccall@apple.com> Support implicitly closing on 'this' in a block. Fixed PR7165.

(the codegen works here, too, but that's annoying to test without execution)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104202 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eb77138104d1adbd3402ec40f404c415db03f569 20-May-2010 Chris Lattner <sabre@nondot.org> just add a fixme for the StructuredArgs leak, it shouldn't affect
c++'03 code and variadic support "needs work".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104195 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
304d0faa6cac3111074cc400c1c573a6e611872b 20-May-2010 Chris Lattner <sabre@nondot.org> just add a fixme for the StructuredArgs leak, it shouldn't affect
c++'03 code and variadic support "needs work".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104195 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
699e6bdb52ad5cc144a678dd80bc346b66a9e977 20-May-2010 Chris Lattner <sabre@nondot.org> switch TemplateArgumentListBuilder to hold its flat argument list in a smallvector
instead of new[]'d. This greatly reduces the number of new[]'s, and guess what,
they were all leaked.

This adds a fixme in this hunk:

unsigned NumPackArgs = NumFlatArgs - PackBeginIndex;
+ // FIXME: NumPackArgs shouldn't be negative here???
if (NumPackArgs)
- PackArgs = &FlatArgs[PackBeginIndex];
+ PackArgs = FlatArgs.data()+PackBeginIndex;

where test/SemaTemplate/variadic-class-template-2.cpp is accessing the vector
out of range and NumPackArgs is negative. I assume variadic template args are
completely hosed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104194 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
98d279ba8092186f606abaa8298f13a0816b9cf2 20-May-2010 Chris Lattner <sabre@nondot.org> switch TemplateArgumentListBuilder to hold its flat argument list in a smallvector
instead of new[]'d. This greatly reduces the number of new[]'s, and guess what,
they were all leaked.

This adds a fixme in this hunk:

unsigned NumPackArgs = NumFlatArgs - PackBeginIndex;
+ // FIXME: NumPackArgs shouldn't be negative here???
if (NumPackArgs)
- PackArgs = &FlatArgs[PackBeginIndex];
+ PackArgs = FlatArgs.data()+PackBeginIndex;

where test/SemaTemplate/variadic-class-template-2.cpp is accessing the vector
out of range and NumPackArgs is negative. I assume variadic template args are
completely hosed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104194 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
8f782aa0b75cff1481e87720af7c22aed21cb7ff 20-May-2010 Chris Lattner <sabre@nondot.org> fix the TemplateArgumentList copy constructor to not
be a copy constructor (since it isn't one semantically)
and fix the ownership bits it sets to be correct!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104192 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
885989109ade7cb4dc493e25da41456c64b3cf6a 20-May-2010 Chris Lattner <sabre@nondot.org> fix the TemplateArgumentList copy constructor to not
be a copy constructor (since it isn't one semantically)
and fix the ownership bits it sets to be correct!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104192 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
bc7412f5096d9329664f5a1119d09f75d035e13a 20-May-2010 Chris Lattner <sabre@nondot.org> Clarify TemplateArgumentList ownership over its "flat" and
"structure" arg lists, the first step to fixing some massive
memory leaks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104191 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
56ef550c5eeea0714c635782776389df2a177584 20-May-2010 Chris Lattner <sabre@nondot.org> Clarify TemplateArgumentList ownership over its "flat" and
"structure" arg lists, the first step to fixing some massive
memory leaks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104191 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
3fc091df2d07bc3b13e91d915050d5309cb83c11 19-May-2010 Fariborz Jahanian <fjahanian@apple.com> Adds support for ObjC++'s GC attribute on declaration of
object variables and functions returning such objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104168 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2390a72a3ebd37737fec5ba1385db9c3bb22fc59 19-May-2010 Fariborz Jahanian <fjahanian@apple.com> Adds support for ObjC++'s GC attribute on declaration of
object variables and functions returning such objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104168 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
735f00a7c156895359bf71cdbe89c7979216fe5e 19-May-2010 Douglas Gregor <doug.gregor@gmail.com> Fill in some silly defaults to silence a GCC warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104140 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
8f43d52b46b600b2eb4e62550f7a6d7a78fd001b 19-May-2010 Douglas Gregor <dgregor@apple.com> Fill in some silly defaults to silence a GCC warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104140 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
949d2c031f173ec539d1aa667bba503fda7fb763 19-May-2010 Douglas Gregor <doug.gregor@gmail.com> Cache the linkage of a type within its canonical type, eliminating
some seriously non-linear performance with deeply nested template
instantiations, as shown in PR6998.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104139 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
60e7064d78f1a29cf969f255a19a9ae25e6bc128 19-May-2010 Douglas Gregor <dgregor@apple.com> Cache the linkage of a type within its canonical type, eliminating
some seriously non-linear performance with deeply nested template
instantiations, as shown in PR6998.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104139 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
dc4d6feb0c4f81110cef67e785e3e8374384ba5f 19-May-2010 Ted Kremenek <kremenek@apple.com> Add clang support for IBOutletCollection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104135 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
857e918a8a40deb128840308a318bf623d68295f 19-May-2010 Ted Kremenek <kremenek@apple.com> Add clang support for IBOutletCollection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104135 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
d83686bcce42cab1184da1f9c6980c238510edd6 19-May-2010 Douglas Gregor <doug.gregor@gmail.com> Profile type-dependent uses of overloaded operators in C++ the same
way regardless of whether some overloaded operator functions were
found by name lookup within the template. Fixes PR6851.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104107 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
a89064aa4695d9a2fec24efcc74ca0e795aaa17c 19-May-2010 Douglas Gregor <dgregor@apple.com> Profile type-dependent uses of overloaded operators in C++ the same
way regardless of whether some overloaded operator functions were
found by name lookup within the template. Fixes PR6851.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104107 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
01890a8487ae3330abc501b455e2092545d54775 18-May-2010 Douglas Gregor <doug.gregor@gmail.com> Add support for Microsoft's __thiscall, from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104026 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ype.cpp
ypePrinter.cpp
f813a2c03fcb05381b3252010435f557eb6b3cde 18-May-2010 Douglas Gregor <dgregor@apple.com> Add support for Microsoft's __thiscall, from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104026 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ype.cpp
ypePrinter.cpp
f4d35912dc6a2f46a9ea2a4392aa29098af661be 18-May-2010 Sean Hunt <rideau3@gmail.com> Switch over the tablegen to use much prettier range technology
Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def
files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104017 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
7381d5cfbd599fa2b9e215011ad7cbd449de231a 18-May-2010 Sean Hunt <rideau3@gmail.com> Switch over the tablegen to use much prettier range technology
Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def
files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104017 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
61f01e88a6591783a9d03a971f0d93c86fc32529 18-May-2010 John McCall <rjmccall@apple.com> Teach the ObjC mangler to ignore member pointers just like gcc does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104001 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
532ec7baf2d0791abc9551ef856a537711c5774a 18-May-2010 John McCall <rjmccall@apple.com> Teach the ObjC mangler to ignore member pointers just like gcc does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104001 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cca3b567dafc1d3125f476ae19bf82d84b16e4c1 18-May-2010 John McCall <rjmccall@apple.com> Comments and assorted cleanups for the Objective C type AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103986 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e175a6f6ede0ae31165a18ac8bf4e8d2681b39f8 18-May-2010 John McCall <rjmccall@apple.com> Comments and assorted cleanups for the Objective C type AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103986 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
52642f49f8aa1c79c7a4afe7c1bb27dd4fa709ea 17-May-2010 Douglas Gregor <doug.gregor@gmail.com> Teach ASTContext::getUnqualifiedArrayType() how to look through
typedefs. As a drive-by, teach hit how to build VLA types, since those
will eventually be supported in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103958 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9dadd94e1c17fa030d1f88d8f2113ff59ccc6714 17-May-2010 Douglas Gregor <dgregor@apple.com> Teach ASTContext::getUnqualifiedArrayType() how to look through
typedefs. As a drive-by, teach hit how to build VLA types, since those
will eventually be supported in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103958 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0ffa1562cac74870592f234ebd5aa8360ee8d2d5 17-May-2010 Douglas Gregor <doug.gregor@gmail.com> Determine when the instantiation of a friend function defined inside a
class template conflicts with an existing (non-template)
definition. This is another part of PR6952.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6cfacfe54c75baa4d67f1fbdf4f80644b662818e 17-May-2010 Douglas Gregor <dgregor@apple.com> Determine when the instantiation of a friend function defined inside a
class template conflicts with an existing (non-template)
definition. This is another part of PR6952.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5fd580a5d29885361e2cf18ed13efe809d4f6563 16-May-2010 Chandler Carruth <chandlerc@gmail.com> When constant folding reference variables with an initializer to the
initializer, don't fold paramters. Their initializers are just default
arguments which can be overridden. This fixes some spectacular regressions due
to more things making it into the constant folding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103904 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
761c94e3bffef0fcb8b4bbf202fd5ee73db134f3 16-May-2010 Chandler Carruth <chandlerc@gmail.com> When constant folding reference variables with an initializer to the
initializer, don't fold paramters. Their initializers are just default
arguments which can be overridden. This fixes some spectacular regressions due
to more things making it into the constant folding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103904 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5f4445edf65347bc1c6efbeb8b40b26c6000717c 16-May-2010 John McCall <rjmccall@apple.com> Avoid doing two switches in TypeLoc's initialize() loop. The optimizer
can probably do this for us, but it's actually somewhat nicer to write it
out here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103893 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
7eb914b1398e636845ce4ae8dd7022f72429d8c9 16-May-2010 John McCall <rjmccall@apple.com> Avoid doing two switches in TypeLoc's initialize() loop. The optimizer
can probably do this for us, but it's actually somewhat nicer to write it
out here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103893 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
f4f254c60f644f08dea9cfbe0865016a5ef748a6 15-May-2010 John McCall <rjmccall@apple.com> Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xpr.cpp
ype.cpp
ypePrinter.cpp
c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44e 15-May-2010 John McCall <rjmccall@apple.com> Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
xpr.cpp
ype.cpp
ypePrinter.cpp
1fa068248824ae0e40c8120ed65406a13c859a74 14-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added Expr::EvaluateAsAnyLValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103780 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e17a6436b429e4b18a5e157061fb13bbc677b3b0 14-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added Expr::EvaluateAsAnyLValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103780 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
321fbfaa8fb998f171780081267bff44425d8090 13-May-2010 Chandler Carruth <chandlerc@gmail.com> Teach the AKA calculation to look at sugar on the pointee type for pointers and
references. This is a WIP as we should handle function pointers, etc. Reshuffle
the code to do this to facilitate recursing in this manner, and to check for
the type already being printed first rather than last.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103712 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
1733bc3747f242ddaea5b953d27f514253843e31 13-May-2010 Chandler Carruth <chandlerc@gmail.com> Teach the AKA calculation to look at sugar on the pointee type for pointers and
references. This is a WIP as we should handle function pointers, etc. Reshuffle
the code to do this to facilitate recursing in this manner, and to check for
the type already being printed first rather than last.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103712 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
6f52e3c5663a669ec61379e933e0fe7ad2f1a566 13-May-2010 Chris Lattner <sabre@nondot.org> add a couple of key functions for classes without them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103688 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
bef0efd11bc4430a3ee437a3213cec5c18af855a 13-May-2010 Chris Lattner <sabre@nondot.org> add a couple of key functions for classes without them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103688 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
ab1f1819386bd718899582eb6426b2619b11e2cf 11-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Merged Elaborated and QualifiedName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103517 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
estedNameSpecifier.cpp
ype.cpp
ypePrinter.cpp
465d41b92b2c862f3062c412a0538db65c6a2661 11-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Merged Elaborated and QualifiedName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103517 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ecl.cpp
eclCXX.cpp
estedNameSpecifier.cpp
ype.cpp
ypePrinter.cpp
7b24d6fea6c7377048fed851d37f6287e810a124 11-May-2010 Douglas Gregor <doug.gregor@gmail.com> Static data members intialized in-class that have constant values are
value-dependent if their initializers are value-dependent; my recent
tweak to these dependent rules overstepped by taking away this
value-dependents. Fixes a Boost.GIL regression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103476 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
85bcd9920582f4d3879d8fbbaf4ca4fe09690160 11-May-2010 Douglas Gregor <dgregor@apple.com> Static data members intialized in-class that have constant values are
value-dependent if their initializers are value-dependent; my recent
tweak to these dependent rules overstepped by taking away this
value-dependents. Fixes a Boost.GIL regression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103476 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fec2e5a353370a9f9500edf9fa68477294ab5493 11-May-2010 Douglas Gregor <doug.gregor@gmail.com> Fix indentation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103465 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7ed5bd3e27a6f2b37ee0449aa818116cbd03306e 11-May-2010 Douglas Gregor <dgregor@apple.com> Fix indentation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103465 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6263812a963ba616bb0f8c6933510bcba4fc2e07 11-May-2010 Douglas Gregor <doug.gregor@gmail.com> A DeclRefExpr that refers to a member function or a static data member
of the current instantiation is value-dependent. The C++ standard
fails to enumerate this case and, therefore, we missed it. Chandler
did all of the hard work of reducing the last remaining
Boost.PtrContainer failure (which had to do with static initialization
in the Serialization library) down to this simple little test.

While I'm at it, clean up the dependence rules for template arguments
that are declarations, and implement the dependence rules for template
argument packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103464 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
bb6e73fcf60fa5a4cc36c14744dc366b658443b5 11-May-2010 Douglas Gregor <dgregor@apple.com> A DeclRefExpr that refers to a member function or a static data member
of the current instantiation is value-dependent. The C++ standard
fails to enumerate this case and, therefore, we missed it. Chandler
did all of the hard work of reducing the last remaining
Boost.PtrContainer failure (which had to do with static initialization
in the Serialization library) down to this simple little test.

While I'm at it, clean up the dependence rules for template arguments
that are declarations, and implement the dependence rules for template
argument packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103464 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ype.cpp
f9c47f2d86e4cf90f50b2f2e44c48705f4c9bbde 11-May-2010 Douglas Gregor <doug.gregor@gmail.com> Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103458 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a5fdd9ce694b1c2dbfd225cb6f55ef743d1ab562 11-May-2010 Douglas Gregor <dgregor@apple.com> Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103458 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
40cb1b8a4b306732502de20a60e3498fbcf0ed3f 11-May-2010 John McCall <rjmccall@apple.com> Refactor the constant-evaluator so that it only supports a single form
of constant-evaluation. Formerly you could control whether it accepted
local l-values or not; now it always evaluates local l-values in the core
routines, but filters them out where consumed by the top-level routines.
This will make it much easier to cache evaluability.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103444 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
42c8f87eb60958170c46767273bf93e6c96125bf 11-May-2010 John McCall <rjmccall@apple.com> Refactor the constant-evaluator so that it only supports a single form
of constant-evaluation. Formerly you could control whether it accepted
local l-values or not; now it always evaluates local l-values in the core
routines, but filters them out where consumed by the top-level routines.
This will make it much easier to cache evaluability.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103444 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9b5950a974c52c637cde314bc810e1d639aae6a5 10-May-2010 Ted Kremenek <kremenek@apple.com> Allocate most of DeclarationNamesTable using ASTContext's allcocator. The only things that
aren't allocated this way are the internal FoldingSets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103429 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
45d9c2d2b1b4ada29160edadc071db9779c0ec07 10-May-2010 Ted Kremenek <kremenek@apple.com> Allocate most of DeclarationNamesTable using ASTContext's allcocator. The only things that
aren't allocated this way are the internal FoldingSets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103429 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
d245d9a6a359e2e5c7b3d949bf8161e6412010e3 10-May-2010 Ted Kremenek <kremenek@apple.com> Start converting pieces of DeclarationNameTable to be allocated using ASTContext's allocator.
While DeclarationNameTable doesn't leak, it uses 'malloc' too often. Start with having
'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method
to DeclarationNameTable that is called by ~ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103426 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
ac9590effa90406767a544005ed1de52e258306b 10-May-2010 Ted Kremenek <kremenek@apple.com> Start converting pieces of DeclarationNameTable to be allocated using ASTContext's allocator.
While DeclarationNameTable doesn't leak, it uses 'malloc' too often. Start with having
'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method
to DeclarationNameTable that is called by ~ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103426 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
9b92799c22e4763de73b8143738963b518327a75 10-May-2010 Ted Kremenek <kremenek@apple.com> Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's allocator. Fixes <rdar://problem/7961605>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103421 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d04ed416be7c55bddddab1fa3fd38a0113a6b3da 10-May-2010 Ted Kremenek <kremenek@apple.com> Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's allocator. Fixes <rdar://problem/7961605>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103421 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1c5427abb817eb3e1a49fb77c6bce3a7c31aab4b 10-May-2010 Daniel Dunbar <daniel@zuster.org> Fix refacto in r103387, noticed by Christopher Jefferson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103406 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
90556d43dc697a675eda81ed80f2f585662bca4d 10-May-2010 Daniel Dunbar <daniel@zuster.org> Fix refacto in r103387, noticed by Christopher Jefferson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103406 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
348ecb4b46038b0bcfd268fac1188e076c33eded 10-May-2010 Anders Carlsson <andersca@mac.com> Add an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103403 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
ecafebe28f379bf45eaca4bf8469e2586eba9902 10-May-2010 Anders Carlsson <andersca@mac.com> Add an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103403 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
44ac7ee30ffa3bc71cc1e3b4787f0181666c579a 10-May-2010 Anders Carlsson <andersca@mac.com> More work on handling empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103402 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3159ffeb233021bb38d7c75f214998de741d5663 10-May-2010 Anders Carlsson <andersca@mac.com> More work on handling empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103402 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
f4304a25d5df6f5a44db3b4d49a35fa55417ae4b 10-May-2010 Chris Lattner <sabre@nondot.org> pch'ify CXXNewExpr and CXXZeroInitValueExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103390 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
5921863d8f24084797863b5df37842113bac4352 10-May-2010 Chris Lattner <sabre@nondot.org> pch'ify CXXNewExpr and CXXZeroInitValueExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103390 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
20913f759605075f8e7b552798106dcfa636383f 10-May-2010 Chris Lattner <sabre@nondot.org> fix refactor-o


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103388 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
aff32cb549af7235b61694dcf5d7d90064326b6e 10-May-2010 Chris Lattner <sabre@nondot.org> fix refactor-o


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103388 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2a29863f61f241641ffa8c7398233e4e5f32abe0 10-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d2598368876cfe40bc8465540033bc5b5e58d8af 10-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
fe8d7d440f0d72df08ab6b5f887fb1f4a1f6e192 09-May-2010 Anders Carlsson <andersca@mac.com> Cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103370 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ddae877b5d1657398f6a8f528dbd3f20dc19607f 09-May-2010 Anders Carlsson <andersca@mac.com> Cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103370 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
070aaeac417cf0f715968b1f4974c651f1f147ad 09-May-2010 Anders Carlsson <andersca@mac.com> Actually compute the empty subobject sizes. No functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103363 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
836fc14e6cdad2362fc31f11bf7b14832cba34b9 09-May-2010 Anders Carlsson <andersca@mac.com> Actually compute the empty subobject sizes. No functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103363 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
57f57f6e54ac1fee2cf920545b95e4c52ac7ded7 09-May-2010 Douglas Gregor <doug.gregor@gmail.com> Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103360 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c6dfe194f623b02c123759f235b504d4850fc178 09-May-2010 Douglas Gregor <dgregor@apple.com> Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103360 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f4be20c3c45287bb2971efcf6959e91620b15371 09-May-2010 Anders Carlsson <andersca@mac.com> Add a SizeOfLargestEmptySubobject member to ASTRecordLayout. For C++ classes this will hold the largest empty subobject or 0 if the class doesn't have any empty subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103359 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
c3fddeb4384de2238ec03c77be6bee606725609e 09-May-2010 Anders Carlsson <andersca@mac.com> Add a SizeOfLargestEmptySubobject member to ASTRecordLayout. For C++ classes this will hold the largest empty subobject or 0 if the class doesn't have any empty subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103359 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a4f7ff4959c7a5a0ff5e093facad76671e176f28 08-May-2010 Douglas Gregor <doug.gregor@gmail.com> When printing a non-viable overload candidate that failed due to
conflicting deduced template argument values, give a more specific
reason along with those values, e.g.,

test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template
ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long')
const T& min(const T&, const T&);
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103339 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
a933319ebf754396623165f9dc0a29c2a48879f5 08-May-2010 Douglas Gregor <dgregor@apple.com> When printing a non-viable overload candidate that failed due to
conflicting deduced template argument values, give a more specific
reason along with those values, e.g.,

test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template
ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long')
const T& min(const T&, const T&);
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103339 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
978d5da55b705d7ba53ddc07f909d82cc0e73d9f 08-May-2010 John McCall <rjmccall@apple.com> The FP constant evaluator was missing a few cases of unary operators that return floats
but whose operand isn't a float: specifically, __real__ and __imag__. Instead
of filtering these out, just implement them.

Fixes <rdar://problem/7958272>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103307 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
abd3a857ace59100305790545d1baae5877b8945 08-May-2010 John McCall <rjmccall@apple.com> The FP constant evaluator was missing a few cases of unary operators that return floats
but whose operand isn't a float: specifically, __real__ and __imag__. Instead
of filtering these out, just implement them.

Fixes <rdar://problem/7958272>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103307 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b063d153c55d662ec34f4773387bc45d2289ff74 07-May-2010 Chris Lattner <sabre@nondot.org> add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6ad9ac097918fbdeb443ea7b99d4db9e49b28534 07-May-2010 Chris Lattner <sabre@nondot.org> add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
66580b5b53f752d3fe3d6559937eb043e8a3fbc9 07-May-2010 John McCall <rjmccall@apple.com> Make that null-dereference fix a little clearer by rearranging some code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103298 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3554283157190e67918fad4221a5e6faf9317362 07-May-2010 John McCall <rjmccall@apple.com> Make that null-dereference fix a little clearer by rearranging some code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103298 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a421e4671767b9886a4d511aaad3f14f0b050cd4 07-May-2010 John McCall <rjmccall@apple.com> Fix a potential null dereference in the pointer-to-bool evaluator; caught by
Eli Friedman.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103297 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ce87e6d501e4c924f246d2ebf82d780690589351 07-May-2010 John McCall <rjmccall@apple.com> Fix a potential null dereference in the pointer-to-bool evaluator; caught by
Eli Friedman.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103297 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
eece23845f7c0aade296cec58b5aa0b5b533c28d 07-May-2010 John McCall <rjmccall@apple.com> Change the pointer / lvalue constant evaluators to build into a target reference
and return a bool.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103296 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
efdb83e26f9a1fd2566afe54461216cd84814d42 07-May-2010 John McCall <rjmccall@apple.com> Change the pointer / lvalue constant evaluators to build into a target reference
and return a bool.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103296 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
66904085ef1078c6020129d0051c322a5e9022d3 07-May-2010 John McCall <rjmccall@apple.com> Change the complex constant evaluator to return a bool instead of an APValue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103268 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f4cf1a18d09d57b757b3cb47eab36c1457091ef7 07-May-2010 John McCall <rjmccall@apple.com> Change the complex constant evaluator to return a bool instead of an APValue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103268 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
61342ac4674a004fe2f331537a10d0f2466317dd 07-May-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR4386 by implementing gcc's old behaviour (4.2) when initializing
variables with a comparison of a function pointer with 0.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103253 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a7d3c04fcfe9d4af2f7758f46aef26b1a8f8ac09 07-May-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR4386 by implementing gcc's old behaviour (4.2) when initializing
variables with a comparison of a function pointer with 0.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103253 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
91e16093252fdfd1237b3ca450c4ccd8681581a7 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> And finally, revert the accidental check-in part of the previous reversion. I'm on a roll.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103249 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
edd558543558e4a43eb71d2a1c9cbe7d45d1e0b2 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> And finally, revert the accidental check-in part of the previous reversion. I'm on a roll.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103249 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
708c7b8d2509e62c513262714902e0a3ba35c3dc 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Revert 103247, it causes lots of test failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103248 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
0aa866f955deea1851918c2c9fbf60d7afd0ce1f 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Revert 103247, it causes lots of test failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103248 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
334b3cc9a5fd7446e5efac80b2cebb5331d4b87c 07-May-2010 John McCall <rjmccall@apple.com> Change Evaluate* in the constant evaluator to enforce being given an argument of
the right type. It turns out that the code was already doing this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103238 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7db7acbbb84b82d0522266a50ebabc3a52a9e5d1 07-May-2010 John McCall <rjmccall@apple.com> Change Evaluate* in the constant evaluator to enforce being given an argument of
the right type. It turns out that the code was already doing this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103238 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b9a87306d5ae654300703a0725f829e748a6de85 07-May-2010 John McCall <rjmccall@apple.com> Move CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
like a good idea at the time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
d905f5ad540c415d1a21b4f8b7bd715bfb7bb920 07-May-2010 John McCall <rjmccall@apple.com> Move CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
like a good idea at the time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
8d57785aaeb269e68d495ce63c7c59f187835890 07-May-2010 Fariborz Jahanian <fjahanian@apple.com> Implement encoding of methods which have instantiated
template arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103221 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6fb94391dc7cb11fd4bbdb969bbab11b6b48c223 07-May-2010 Fariborz Jahanian <fjahanian@apple.com> Implement encoding of methods which have instantiated
template arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103221 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
dd757aeb8cc31d73e3c83044e438d429d0506945 06-May-2010 John McCall <rjmccall@apple.com> Push TypeSourceInfo::getTypeLoc() into a header file so that it's
inlineable. That header file has to be TypeLoc.h, which means that
TypeLoc.h needs to depend on Decl.h because TypeSourceInfo doesn't
have its own header. That could be remedied, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103176 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3c385c28cf1f27b193a620d2e51f814873362ceb 06-May-2010 John McCall <rjmccall@apple.com> Push TypeSourceInfo::getTypeLoc() into a header file so that it's
inlineable. That header file has to be TypeLoc.h, which means that
TypeLoc.h needs to depend on Decl.h because TypeSourceInfo doesn't
have its own header. That could be remedied, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103176 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e2ba5f6ed00499333dc72435d27c59a500d0f6ec 06-May-2010 John McCall <rjmccall@apple.com> Remember the number of positive and negative bits used by the enumerators of
an enum in the enum decl itself. Use some spare bits from TagDecl for this
purpose.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103173 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
1b5a618c59025898806160ed5e7f0ff5bb79e482 06-May-2010 John McCall <rjmccall@apple.com> Remember the number of positive and negative bits used by the enumerators of
an enum in the enum decl itself. Use some spare bits from TagDecl for this
purpose.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103173 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
397af2649e603382ca76dde80f50d2fe9c373c3f 06-May-2010 Chandler Carruth <chandlerc@gmail.com> Mark a variable as used in the absence of asserts to silence a GCC warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103165 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a8426972609c908b529ab26c69c35586d8bc06a8 06-May-2010 Chandler Carruth <chandlerc@gmail.com> Mark a variable as used in the absence of asserts to silence a GCC warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103165 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
84e55065156b3e56d6997b97daf748c99953e9c4 06-May-2010 Douglas Gregor <doug.gregor@gmail.com> Partial and full specializations of a class template may have a
different tag kind ("struct" vs. "class") than the primary template,
which has an affect on access control.

Should fix the last remaining Boost.Accumulors failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103144 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
13c8577201e4fc0ddac5f09d05fd1778832137d1 06-May-2010 Douglas Gregor <dgregor@apple.com> Partial and full specializations of a class template may have a
different tag kind ("struct" vs. "class") than the primary template,
which has an affect on access control.

Should fix the last remaining Boost.Accumulors failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103144 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
20e7979ca05e7f33ed9b9ef1f071c392650f481f 06-May-2010 John McCall <rjmccall@apple.com> Add IgnoreParenImpCasts() to Expr, which is basically like IgnoreParenCasts
except it only skips implicit casts.

Also fix ObjCImplicitGetterSetterRefExpr's child_begin to skip the base expression
if it's actually a type reference (which you get with static property references).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103132 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2fc46bf1a9bc31d50f82de37c70ea257d3cded27 06-May-2010 John McCall <rjmccall@apple.com> Add IgnoreParenImpCasts() to Expr, which is basically like IgnoreParenCasts
except it only skips implicit casts.

Also fix ObjCImplicitGetterSetterRefExpr's child_begin to skip the base expression
if it's actually a type reference (which you get with static property references).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103132 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ef2008e92d1b320db947c63bc9e795d2ae39e2a2 05-May-2010 Sean Hunt <rideau3@gmail.com> Reapplying patch to change StmtNodes.def to StmtNodes.td, this time
with no whitespace. This will allow statements to be referred to in
attribute TableGen files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103087 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
4bfe1968410ea8ffe3b4f629addd7c4bcf484765 05-May-2010 Sean Hunt <rideau3@gmail.com> Reapplying patch to change StmtNodes.def to StmtNodes.td, this time
with no whitespace. This will allow statements to be referred to in
attribute TableGen files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103087 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
fa2ce27369f457c7a0c5ae5f682a793316cc587d 05-May-2010 Sean Hunt <rideau3@gmail.com> Revert r103072; I accidentally ended up deleting a bunch of trailing
whitespace which makes this patch unreadable. Will recommit without the
whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103086 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
c302113179a1c2b1254224ea9b6f5316ceeb375c 05-May-2010 Sean Hunt <rideau3@gmail.com> Revert r103072; I accidentally ended up deleting a bunch of trailing
whitespace which makes this patch unreadable. Will recommit without the
whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103086 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
d131290ee2068b996311073e68d5aba798632cb7 05-May-2010 Douglas Gregor <doug.gregor@gmail.com> Reimplement code generation for copying fields in the
implicitly-generated copy constructor. Previously, Sema would perform
some checking and instantiation to determine which copy constructors,
etc., would be called, then CodeGen would attempt to figure out which
copy constructor to call... but would get it wrong, or poke at an
uninstantiated default argument, or fail in other ways.

The new scheme is similar to what we now do for the implicit
copy-assignment operator, where Sema performs all of the semantic
analysis and builds specific ASTs that look similar to the ASTs we'd
get from explicitly writing the copy constructor, so that CodeGen need
only do a direct translation.

However, it's not quite that simple because one cannot explicit write
elementwise copy-construction of an array. So, I've extended
CXXBaseOrMemberInitializer to contain a list of indexing variables
used to copy-construct the elements. For example, if we have:

struct A { A(const A&); };

struct B {
A array[2][3];
};

then we generate an implicit copy assignment operator for B that looks
something like this:

B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { }

CodeGen will loop over the invented variables i0 and i1 to visit all
elements in the array, so that each element in the destination array
will be copy-constructed from the corresponding element in the source
array. Of course, if we're dealing with arrays of scalars or class
types with trivial copy-assignment operators, we just generate a
memcpy rather than a loop.

Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes
all of its regression tests.

Conspicuously missing from this patch is handling for the exceptional
case, where we need to destruct those objects that we have
constructed. I'll address that case separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103079 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fb8cc253420e93cee33d29df5a2bdae6aaf16e39 05-May-2010 Douglas Gregor <dgregor@apple.com> Reimplement code generation for copying fields in the
implicitly-generated copy constructor. Previously, Sema would perform
some checking and instantiation to determine which copy constructors,
etc., would be called, then CodeGen would attempt to figure out which
copy constructor to call... but would get it wrong, or poke at an
uninstantiated default argument, or fail in other ways.

The new scheme is similar to what we now do for the implicit
copy-assignment operator, where Sema performs all of the semantic
analysis and builds specific ASTs that look similar to the ASTs we'd
get from explicitly writing the copy constructor, so that CodeGen need
only do a direct translation.

However, it's not quite that simple because one cannot explicit write
elementwise copy-construction of an array. So, I've extended
CXXBaseOrMemberInitializer to contain a list of indexing variables
used to copy-construct the elements. For example, if we have:

struct A { A(const A&); };

struct B {
A array[2][3];
};

then we generate an implicit copy assignment operator for B that looks
something like this:

B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { }

CodeGen will loop over the invented variables i0 and i1 to visit all
elements in the array, so that each element in the destination array
will be copy-constructed from the corresponding element in the source
array. Of course, if we're dealing with arrays of scalars or class
types with trivial copy-assignment operators, we just generate a
memcpy rather than a loop.

Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes
all of its regression tests.

Conspicuously missing from this patch is handling for the exceptional
case, where we need to destruct those objects that we have
constructed. I'll address that case separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103079 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
468e42e9ca5531889f8f1aa4fa467d277c701638 05-May-2010 Douglas Gregor <doug.gregor@gmail.com> Unbreak CMake build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103077 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
71b1d0e5f07de274af2b3c48955af66b1b7f0403 05-May-2010 Douglas Gregor <dgregor@apple.com> Unbreak CMake build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103077 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
c418cd479d17c9f5ded9cb0f54b07d6bfe12ac73 05-May-2010 Sean Hunt <rideau3@gmail.com> Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103072 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
9d90d62e1661720d9cf533290b4227c4fde780a4 05-May-2010 Sean Hunt <rideau3@gmail.com> Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103072 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtProfile.cpp
5539e9a586cb74a14d19975b952b8400ae861ffc 04-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Let StmtDumper.cpp handle using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103006 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0ca43595e9e8dcf62a2ab6f5c7f4666bfb230b6a 04-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Let StmtDumper.cpp handle using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103006 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
ae6d8b1e1d16d096c4cd5866f23606b47a8466b6 03-May-2010 Anders Carlsson <andersca@mac.com> Change CXXConstructExpr::Create to take a ConstructionKind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102884 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
fcaeef2ae00ec643eb024e0aca2c98701cf5627c 03-May-2010 Anders Carlsson <andersca@mac.com> Change CXXConstructExpr::Create to take a ConstructionKind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102884 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f6920f6e926e81aa5e5815d011e8b85e3d252b89 03-May-2010 Anders Carlsson <andersca@mac.com> Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102879 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
72e96fd181b19b8d01144a685cda6e955584c7ea 03-May-2010 Anders Carlsson <andersca@mac.com> Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102879 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
82ffffd44d4de0ccb064b855cbcbe7916a693393 01-May-2010 Douglas Gregor <doug.gregor@gmail.com> Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

- For a class subobject, call the appropriate copy-assignment
operator, after overload resolution has determined what that is.
- For an array of scalar types or an array of class types that have
trivial copy assignment operators, construct a call to
__builtin_memcpy.
- For an array of class types with non-trivial copy assignment
operators, synthesize a (possibly nested!) for loop whose inner
statement calls the copy constructor.
- For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102853 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
06a9f3680d22529a2fcf20c52d71cf221d99d910 01-May-2010 Douglas Gregor <dgregor@apple.com> Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

- For a class subobject, call the appropriate copy-assignment
operator, after overload resolution has determined what that is.
- For an array of scalar types or an array of class types that have
trivial copy assignment operators, construct a call to
__builtin_memcpy.
- For an array of class types with non-trivial copy assignment
operators, synthesize a (possibly nested!) for loop whose inner
statement calls the copy constructor.
- For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102853 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e39df17b8abbf6685c8b8a284613f3c5a6204320 30-Apr-2010 John McCall <rjmccall@apple.com> When synthesizing Objective C records, give the synthetic fields public
access. Fixes an assertion.

Fixes rdar://problem/7927811. Too lazy to reduce a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102776 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2888b65aae768f54062505330df7be230a0510c7 30-Apr-2010 John McCall <rjmccall@apple.com> When synthesizing Objective C records, give the synthetic fields public
access. Fixes an assertion.

Fixes rdar://problem/7927811. Too lazy to reduce a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102776 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2561ef1c48e1d2b579440add8664245adb58d541 30-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102762 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
72be24f39c162448e53dd73cf57cc6357114361e 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102762 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8375c580a7e7511e13d2ffdacfc9da7e2dd48af1 30-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a sequence number into class template partial
specializations, which keeps track of the order in which they were
originally declared. We use this number so that we can always walk the
list of partial specializations in a predictable order during matching
or template instantiation. This also fixes a failure in Boost.Proto,
where SourceManager::isBeforeInTranslationUnit was behaving
poorly in inconsistent ways.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102693 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
dc60c1eb4acbde6edcec9760de92f9098593d915 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce a sequence number into class template partial
specializations, which keeps track of the order in which they were
originally declared. We use this number so that we can always walk the
list of partial specializations in a predictable order during matching
or template instantiation. This also fixes a failure in Boost.Proto,
where SourceManager::isBeforeInTranslationUnit was behaving
poorly in inconsistent ways.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102693 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
a8d7ca6e37fb2aba356c16ca9c31cafa7ae68584 30-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> When we start the definition of a class template, set the
InjectedClassNameType's Decl to point at the definition. It's a little
messy, but we do the same thing with classes and their record types,
since much of Clang expects that the TagDecl* one gets out of a type
is the definition. Fixes several Boost.Proto failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102691 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9ffce2182e4fe72052d620698d272207f494b1cf 30-Apr-2010 Douglas Gregor <dgregor@apple.com> When we start the definition of a class template, set the
InjectedClassNameType's Decl to point at the definition. It's a little
messy, but we do the same thing with classes and their record types,
since much of Clang expects that the TagDecl* one gets out of a type
is the definition. Fixes several Boost.Proto failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102691 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bdb04c06a2028c650aa189cbd763b5129905c662 29-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> When determining a standard conversion sequence involves resolving the
address of an overloaded function (or function template), perform that
resolution prior to determining the implicit conversion
sequence. This resolution is not part of the implicit conversion
sequence itself.

Previously, we would always consider this resolution to be a
function pointer decay, which was a lie: there might be an explicit &
in the expression, in which case decay should not occur. This caused
the CodeGen assertion in PR6973 (where we created a
pointer to a pointer to a function when we should have had a pointer
to a function), but it's likely that there are corner cases of
overload resolution where this would have failed.

Cleaned up the code involved in determining the type that will
produced afer resolving the overloaded function reference, and added
an assertion to make sure the result is correct. Fixes PR6973.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102650 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ad4e02f1711e5e90f4e653397b626e0d1929002c 29-Apr-2010 Douglas Gregor <dgregor@apple.com> When determining a standard conversion sequence involves resolving the
address of an overloaded function (or function template), perform that
resolution prior to determining the implicit conversion
sequence. This resolution is not part of the implicit conversion
sequence itself.

Previously, we would always consider this resolution to be a
function pointer decay, which was a lie: there might be an explicit &
in the expression, in which case decay should not occur. This caused
the CodeGen assertion in PR6973 (where we created a
pointer to a pointer to a function when we should have had a pointer
to a function), but it's likely that there are corner cases of
overload resolution where this would have failed.

Cleaned up the code involved in determining the type that will
produced afer resolving the overloaded function reference, and added
an assertion to make sure the result is correct. Fixes PR6973.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102650 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
584dfa221f1428b2164e375c4137339e3ab7d6d7 29-Apr-2010 Ted Kremenek <kremenek@apple.com> Add FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl::isVariadic().
Do some minor refactoring along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102635 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9498d388810d284d3970aef0d69fa4d069fd6caf 29-Apr-2010 Ted Kremenek <kremenek@apple.com> Add FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl::isVariadic().
Do some minor refactoring along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102635 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
aef584b8d239fffab1af04cdcee88d0a559d12a2 29-Apr-2010 Mon P Wang <wangmp@apple.com> A not equal for an unordered relation should return true as specified in IEEE-754, e.g.,
NAN != NAN ? 1 : 0 should return 1. Also fix the case for complex.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102598 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fc39dc4c7886723310419b1869cf651ca55b7af4 29-Apr-2010 Mon P Wang <wangmp@apple.com> A not equal for an unordered relation should return true as specified in IEEE-754, e.g.,
NAN != NAN ? 1 : 0 should return 1. Also fix the case for complex.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102598 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
089b1bece1d6f9ecb72db87e0e01965be9a91742 29-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102571 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
cc8a5d5f90bbbbcb46f342117b851b7e07ec34f1 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102571 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
ce6b353d4b551b98c4282486fd13ef3b3bcf6e31 29-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

1) CodeGen cannot handle the case where __builtin_offsetof is not a
constant expression, so it produces an error. So, to avoid
regressing in C, we retain the old UnaryOperator-based
__builtin_offsetof implementation in C while using the shiny new
OffsetOfExpr implementation in C++. The old implementation can go
away once we have proper CodeGen support for this case, which we
expect won't cause much trouble in C++.

2) __builtin_offsetof doesn't work well with non-POD class types,
particularly when the designated field is found within a base
class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102542 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
8ecdb65716cd7914ffb2eeee993fa9039fcd31e8 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

1) CodeGen cannot handle the case where __builtin_offsetof is not a
constant expression, so it produces an error. So, to avoid
regressing in C, we retain the old UnaryOperator-based
__builtin_offsetof implementation in C while using the shiny new
OffsetOfExpr implementation in C++. The old implementation can go
away once we have proper CodeGen support for this case, which we
expect won't cause much trouble in C++.

2) __builtin_offsetof doesn't work well with non-POD class types,
particularly when the designated field is found within a base
class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102542 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtProfile.cpp
19a11f15701530fe119f722684460a5023b1c1cd 28-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102501 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6a15c8586cc3e5d6e01c4c4e8b4374584569b58f 28-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102501 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0847be48ff466b9676d7668ce50cc5ecce07ab62 28-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Reduce string trashing in getQualifiedNameAsString.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102498 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
68eebbb6279cf5d5133963b1474f0765c589cf3a 28-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Reduce string trashing in getQualifiedNameAsString.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102498 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9705697d18844b35cbeeb747cfc9aa6d7d86241e 27-Apr-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Removed spaces at end of line. (Test commit.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102465 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
493ec51db3a0cfa6f32e612c92c8eb0580dc9ebc 27-Apr-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Removed spaces at end of line. (Test commit.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102465 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
aa310e67048c3ac62c193c3f400a798c76ae1383 27-Apr-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of
function types.

This could potentially have unexpected side-effects, so look here if there are
new regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
24f2801e2c0ac5c1fc8549ed8f91b4d0fbd8c6ac 27-Apr-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of
function types.

This could potentially have unexpected side-effects, so look here if there are
new regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
de27f52df1dad2ac0d7ff06f5c6642715df76e2c 27-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> When explicitly building a temporary object (CXXTemporaryObjectExpr),
keep track of whether we need to zero-initialize storage prior to
calling its constructor. Previously, we were only tracking this when
implicitly constructing the object (a CXXConstructExpr).

Fixes Boost's value-initialization tests, which means that the
Boost.Config library now passes all of its tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102461 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1c63b9c15d48cb8c833a4b2d6fd6c496c0766e88 27-Apr-2010 Douglas Gregor <dgregor@apple.com> When explicitly building a temporary object (CXXTemporaryObjectExpr),
keep track of whether we need to zero-initialize storage prior to
calling its constructor. Previously, we were only tracking this when
implicitly constructing the object (a CXXConstructExpr).

Fixes Boost's value-initialization tests, which means that the
Boost.Config library now passes all of its tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102461 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
95c54dfa43c5159d2854910c21cc03374238e94e 27-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> During template instantiation, set the naming class of
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the
naming class we computed when building the expression in the
template...

... which we didn't always do correctly. Teach
UnresolvedMemberExpr::getNamingClass() all about the new
representation of injected-class-names in templates, so that it can
return a naming class that is the current instantiation.

Also, when decomposing a template-id into its template name and its
arguments, be sure to set the naming class on the LookupResult
structure.

Fixes PR6947 the right way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102448 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ype.cpp
c96be1ea33cdf63d07cec48d18fe8e3afea48f8d 27-Apr-2010 Douglas Gregor <dgregor@apple.com> During template instantiation, set the naming class of
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the
naming class we computed when building the expression in the
template...

... which we didn't always do correctly. Teach
UnresolvedMemberExpr::getNamingClass() all about the new
representation of injected-class-names in templates, so that it can
return a naming class that is the current instantiation.

Also, when decomposing a template-id into its template name and its
arguments, be sure to set the naming class on the LookupResult
structure.

Fixes PR6947 the right way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102448 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ype.cpp
14701e6eca559eb663b7fe2825de943ee7afcac1 27-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> More simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102447 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b170ca5f4a8397c10e52050ff5df6885a3e6eca9 27-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> More simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102447 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
67ce775bb0d6b2d8cd67f5d9c91218808d00b736 27-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Move CollectIvarsToConstructOrDestruct to Sema
from AST, consider ivar array of objects
(per Doug's comment).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102446 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
786cd154f2a48d2b464679d33fcd5df0cd794c06 27-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Move CollectIvarsToConstructOrDestruct to Sema
from AST, consider ivar array of objects
(per Doug's comment).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102446 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
16776c2b3f7cded50372c00b78044262388811cd 27-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify some code. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102445 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0237941e0beb0c929934b66ad29443b484d987fe 27-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify some code. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102445 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7d1fa6bc4ce659bf626d37928d3e280e3accb400 27-Apr-2010 Enea Zaffanella <zaffanella@cs.unipr.it> Wrap a couple of long lines. (Test commit.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102420 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
049c51eadcfed8ae8636f9591f4c4c020399eacd 27-Apr-2010 Enea Zaffanella <zaffanella@cs.unipr.it> Wrap a couple of long lines. (Test commit.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102420 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4578a3a1441eb22b68d909fa35d82e6ee7204e38 27-Apr-2010 John McCall <rjmccall@apple.com> Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization. That is to
say, in
template <class T> class A { ... };
or
template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context. This allows us to track the
current instantiation appropriately even inside AST routines. It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
eclCXX.cpp
eclTemplate.cpp
ype.cpp
ypePrinter.cpp
31f17ecbef57b5679c017c375db330546b7b5145 27-Apr-2010 John McCall <rjmccall@apple.com> Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization. That is to
say, in
template <class T> class A { ... };
or
template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context. This allows us to track the
current instantiation appropriately even inside AST routines. It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
eclCXX.cpp
eclTemplate.cpp
ype.cpp
ypePrinter.cpp
1271d6f682ac66067db6d3ca309a8d3707891ebf 27-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> New method to construct/destruct ivars that have non-trivial default
constructors or destructors, not used yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102403 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
184d7900e0202ac468710b731e42075129bb6000 27-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> New method to construct/destruct ivars that have non-trivial default
constructors or destructors, not used yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102403 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f5b3dfc64b7c705cfb60f73767d0f7efc49f20be 27-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Improve source-location information in a C++ typeid (type) expression
by using TypeSourceInfo, cleaning up the representation
somewhat. Teach getTypeOperand() to strip references and
cv-qualifiers, providing the semantic view of the type without
requiring any extra storage (the unmodified type remains within the
TypeSourceInfo). This fixes a bug found by Boost's call_traits test.

Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid
routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId
functions, which perform the semantic analysis for typeid(type) and
typeid(expression), respectively. We now perform less work at template
instantiation time (we don't look for std::type_info again) and can
give better diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102393 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
57fdc8a4382164955c7b30d09f4ce46fc7e67659 27-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information in a C++ typeid (type) expression
by using TypeSourceInfo, cleaning up the representation
somewhat. Teach getTypeOperand() to strip references and
cv-qualifiers, providing the semantic view of the type without
requiring any extra storage (the unmodified type remains within the
TypeSourceInfo). This fixes a bug found by Boost's call_traits test.

Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid
routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId
functions, which perform the semantic analysis for typeid(type) and
typeid(expression), respectively. We now perform less work at template
instantiation time (we don't look for std::type_info again) and can
give better diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102393 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
6cb535784c071d1a662aeac8e548e8757dd1a969 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102386 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
fb87b89fc9eb103e19fb8e4b925c23f0bd091b99 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102386 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ype.cpp
ff0b45f255aedeca5155e50ef2c603c26142f4fc 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Make the static type of the exception variable in an Objective-C
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that
will change soon. No effective functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102341 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
c00d8e18ad3d903acfeb5d05163ce90713066a3f 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Make the static type of the exception variable in an Objective-C
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that
will change soon. No effective functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102341 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
b12093a3bb6fe8578e3f33318030a13da928de38 24-Apr-2010 Anders Carlsson <andersca@mac.com> Actually produce base paths for CastExprs of kind CK_DerivedToBase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102259 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
5cf86ba6b5a724bf91cb52feade1158f1fbeb605 24-Apr-2010 Anders Carlsson <andersca@mac.com> Actually produce base paths for CastExprs of kind CK_DerivedToBase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102259 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
a0494768db49126986e425913f6ad77f9e3dfdce 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add BasePath arguments to all cast expr constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102258 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
41b2dcd465f1e438502c420effc9d0c747f9db8f 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add BasePath arguments to all cast expr constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102258 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
8bf515b1f6e8ecdcbd3ebcc99fe08ea22fc7fd95 24-Apr-2010 Anders Carlsson <andersca@mac.com> CastExpr should not hold a pointer to the base path. More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102249 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
f1b48b7014992155286d58bb1676f9f51031d18b 24-Apr-2010 Anders Carlsson <andersca@mac.com> CastExpr should not hold a pointer to the base path. More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102249 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
xpr.cpp
e6867ce8ab3d1ec6c32be66fa145ff1682bd5526 24-Apr-2010 Anders Carlsson <andersca@mac.com> Rename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifierArray. More to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102245 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7ab9d574d27ecee1f130e5755aa403e5ab529b6b 24-Apr-2010 Anders Carlsson <andersca@mac.com> Rename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifierArray. More to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102245 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1a2c1a806b8322d095e20481a2815bc4275900aa 24-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102221 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtDumper.cpp
tmtPrinter.cpp
8f5e3dd32e443768d9dbbad7191e123e6733750c 24-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102221 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtDumper.cpp
tmtPrinter.cpp
301ea81936fb6061341b17d73c34d9fbd2fdb423 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add an InheritancePath parameter to the ImplicitCastExpr constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102218 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
88465d3e996e627bbaa11099b039ddab66d5af2c 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add an InheritancePath parameter to the ImplicitCastExpr constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102218 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
dc010fabb200bef288416ed2943b4a8fe87648fa 23-Apr-2010 Anders Carlsson <andersca@mac.com> Destroy the inheritance path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102211 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a3bddeda81ca784bed5501d79e1e7c53befaa91d 23-Apr-2010 Anders Carlsson <andersca@mac.com> Destroy the inheritance path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102211 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
170d1b88f0c77ec5b81f22419f197cefc7b175d6 23-Apr-2010 Anders Carlsson <andersca@mac.com> Turn CXXMethodVector into a generic class template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102208 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
046861b912ed72bdc364d7905180ee63e5b08870 23-Apr-2010 Anders Carlsson <andersca@mac.com> Turn CXXMethodVector into a generic class template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102208 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b057bb40702a9fb498d623a3be6f110fad650761 23-Apr-2010 John McCall <rjmccall@apple.com> Recommit my change to how C++ does elaborated type lookups, now with
two bugfixes which fix selfhost and (hopefully) the nightly tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102198 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
0d6b1640eb4d1a4a0203235cfdfcdaf3335af36d 23-Apr-2010 John McCall <rjmccall@apple.com> Recommit my change to how C++ does elaborated type lookups, now with
two bugfixes which fix selfhost and (hopefully) the nightly tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102198 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
f0b08496aea4aaa2fbe12b8c3af61072c206a30c 23-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More work toward implementing
NeXt's -fno-constant-cfstrings - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102189 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2bb5ddaff86ee73d2cea7ec1835978afc88a83f0 23-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More work toward implementing
NeXt's -fno-constant-cfstrings - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102189 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e20b812c499916b8b1c6fbd52823ca6b4c6413ec 23-Apr-2010 Chris Lattner <sabre@nondot.org> david conrad points out that {|} in inline assembly on arm are not asm
variants. This fixes neon inline asm which my patch for PR6780 broke.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102181 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
9bffb0701d02a10e77e1ac0f196074eed6466ed0 23-Apr-2010 Chris Lattner <sabre@nondot.org> david conrad points out that {|} in inline assembly on arm are not asm
variants. This fixes neon inline asm which my patch for PR6780 broke.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102181 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
224f7914a1a4144edf8d45611ecfed9de563121d 23-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102174 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
00b40d3f2fb8b2f9043daf3dd4558bff98346b3c 23-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102174 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
c51fdda5ba5bd2a30276d3084769b76055309f57 23-Apr-2010 John McCall <rjmccall@apple.com> C++ doesn't really use "namespaces" for different kinds of names the same
way that C does. Among other differences, elaborated type specifiers
are defined to skip "non-types", which, as you might imagine, does not
include typedefs. Rework our use of IDNS masks to capture the semantics
of different kinds of declarations better, and remove most current lookup
filters. Removing the last remaining filter is more complicated and will
happen in a separate patch.

Fixes PR 6885 as well some spectrum of unfiled bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102164 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
d04efc98d08731e31bd73f430803acc5ffa9040a 23-Apr-2010 John McCall <rjmccall@apple.com> C++ doesn't really use "namespaces" for different kinds of names the same
way that C does. Among other differences, elaborated type specifiers
are defined to skip "non-types", which, as you might imagine, does not
include typedefs. Rework our use of IDNS masks to capture the semantics
of different kinds of declarations better, and remove most current lookup
filters. Removing the last remaining filter is more complicated and will
happen in a separate patch.

Fixes PR 6885 as well some spectrum of unfiled bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102164 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclBase.cpp
d7298f54400d484b4b04393e48bdbe5c2cf3a5a3 23-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Make TemplateDecl and ObjCContainerDecl abstract

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102145 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
baf633b41fc1cb42fd5e128954550bf1853f2a8d 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Make TemplateDecl and ObjCContainerDecl abstract

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102145 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
9761a64100c53e687c57a5529f9ca54fef11e1aa 23-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Kill off IDNS_ObjCImplementation and IDNS_ObjCCategoryName; they
aren't and never were used. There's a gap in the bit pattern for IDNS
now, but I'm sure *someone* will fill it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102143 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
bd4187bb6f4a0cfe7d6d2c8e8856b16bca2f0748 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Kill off IDNS_ObjCImplementation and IDNS_ObjCCategoryName; they
aren't and never were used. There's a gap in the bit pattern for IDNS
now, but I'm sure *someone* will fill it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102143 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
7da31c178c1982b1fb3c28ae1aa280c05a32601e 22-Apr-2010 John McCall <rjmccall@apple.com> Use the naming class from the overloaded lookup when access-checking an
address of overloaded function, instead of assuming that a nested name
specifier was used. A nested name specifier is not required for static
functions.

Fixes PR6886.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102107 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
e9ee23edd17c4bb7f271e67f8790792b4de677fc 22-Apr-2010 John McCall <rjmccall@apple.com> Use the naming class from the overloaded lookup when access-checking an
address of overloaded function, instead of assuming that a nested name
specifier was used. A nested name specifier is not required for static
functions.

Fixes PR6886.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102107 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
abe2354f279c7992c260c29c1d48fd8ed6ce50a2 22-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for Objective-C++ message sends. We
support dependent receivers for class and instance messages, along
with dependent message arguments (of course), and check as much as we
can at template definition time.

This commit also deals with a subtle aspect of template instantiation
in Objective-C++, where the type 'T *' can morph from a dependent
PointerType into a non-dependent ObjCObjectPointer type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102071 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
92e986e0adb79e8a47f738bd608e6c97c547641d 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement template instantiation for Objective-C++ message sends. We
support dependent receivers for class and instance messages, along
with dependent message arguments (of course), and check as much as we
can at template definition time.

This commit also deals with a subtle aspect of template instantiation
in Objective-C++, where the type 'T *' can morph from a dependent
PointerType into a non-dependent ObjCObjectPointer type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102071 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1abc0cda1e4eb528bc8a7702ddf6fcd045b96161 22-Apr-2010 Dan Gohman <gohman@apple.com> When computing the alignof value for a vector type, ensure that
the alignment is a power of 2, even in the esoteric case of a
vector element which does not have a power-of-2 sizeof value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102036 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8eefcd353c1d06a10104f69e5079ebab3183f9a3 22-Apr-2010 Dan Gohman <gohman@apple.com> When computing the alignof value for a vector type, ensure that
the alignment is a power of 2, even in the esoteric case of a
vector element which does not have a power-of-2 sizeof value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102036 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4a0a0aeb4b8c3906a4c510e1874a6322e02c7a01 21-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> CXXNamedCastExpr is actually an abstract expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101994 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d8383d45e41ba2316610e5d638d2872e37b67cfb 21-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> CXXNamedCastExpr is actually an abstract expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101994 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
aa598756ea06cb4de58fa775892e02f57e71537b 21-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

1) Send to a object instance described by an expression (e.g., [x method:5])
2) Send to a class described by the class name (e.g., [NSString method:5])
3) Send to a superclass class (e.g, [super method:5] in class method)
4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

1) Unchanged; the object instance is represented by an Expr*.

2) Previously stored the ObjCInterfaceDecl* referring to the class
receiving the message. Now stores a TypeSourceInfo* so that we know
how the class was spelled. This both maintains typedef information
and opens the door for more complicated C++ types (e.g., dependent
types). There was an alternative, unused representation of these
sends by naming the class via an IdentifierInfo *. In practice, we
either had an ObjCInterfaceDecl *, from which we would get the
IdentifierInfo *, or we fell into the case below...

3) Previously represented by a class message whose IdentifierInfo *
referred to "super". Sema and CodeGen would use isStr("super") to
determine if they had a send to super. Now represented as a
"class super" send, where we have both the location of the "super"
keyword and the ObjCInterfaceDecl* of the superclass we're
targetting (statically).

4) Previously represented by an instance message whose receiver is a
an ObjCSuperExpr, which Sema and CodeGen would check for via
isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
where we have both the location of the "super" keyword and the
ObjCInterfaceDecl* of the superclass we're targetting
(statically). Note that ObjCSuperExpr only has one remaining use in
the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

if (message has a receiver expression) {
// instance message
if (isa<ObjCSuperExpr>(...)) {
// send to super
} else {
// send to an object
}
} else {
// class message
if (name->isStr("super")) {
// class send to super
} else {
// send to class
}
}

with a switch

switch (E->getReceiverKind()) {
case ObjCMessageExpr::SuperInstance: ...
case ObjCMessageExpr::Instance: ...
case ObjCMessageExpr::SuperClass: ...
case ObjCMessageExpr::Class:...
}

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101972 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
04badcf84c8d504d8491c7c7e29b58f52cb16640 21-Apr-2010 Douglas Gregor <dgregor@apple.com> Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

1) Send to a object instance described by an expression (e.g., [x method:5])
2) Send to a class described by the class name (e.g., [NSString method:5])
3) Send to a superclass class (e.g, [super method:5] in class method)
4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

1) Unchanged; the object instance is represented by an Expr*.

2) Previously stored the ObjCInterfaceDecl* referring to the class
receiving the message. Now stores a TypeSourceInfo* so that we know
how the class was spelled. This both maintains typedef information
and opens the door for more complicated C++ types (e.g., dependent
types). There was an alternative, unused representation of these
sends by naming the class via an IdentifierInfo *. In practice, we
either had an ObjCInterfaceDecl *, from which we would get the
IdentifierInfo *, or we fell into the case below...

3) Previously represented by a class message whose IdentifierInfo *
referred to "super". Sema and CodeGen would use isStr("super") to
determine if they had a send to super. Now represented as a
"class super" send, where we have both the location of the "super"
keyword and the ObjCInterfaceDecl* of the superclass we're
targetting (statically).

4) Previously represented by an instance message whose receiver is a
an ObjCSuperExpr, which Sema and CodeGen would check for via
isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
where we have both the location of the "super" keyword and the
ObjCInterfaceDecl* of the superclass we're targetting
(statically). Note that ObjCSuperExpr only has one remaining use in
the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

if (message has a receiver expression) {
// instance message
if (isa<ObjCSuperExpr>(...)) {
// send to super
} else {
// send to an object
}
} else {
// class message
if (name->isStr("super")) {
// class send to super
} else {
// send to class
}
}

with a switch

switch (E->getReceiverKind()) {
case ObjCMessageExpr::SuperInstance: ...
case ObjCMessageExpr::Instance: ...
case ObjCMessageExpr::SuperClass: ...
case ObjCMessageExpr::Class:...
}

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101972 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
e468a5b227a6b73a21e3af372a1bee309ef826a8 21-Apr-2010 Ted Kremenek <kremenek@apple.com> Specify linkage for Objective-C declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101953 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
becc308ff32df8c5738ffb958f8033189d62d6f2 21-Apr-2010 Ted Kremenek <kremenek@apple.com> Specify linkage for Objective-C declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101953 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d8dc8f7f327f2d7f4517e71b54ddaf38b6e7c3e9 20-Apr-2010 Chris Lattner <sabre@nondot.org> push some source location information down through the compiler,
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101939 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
e127a0d80155b45dafe77f2b4380e5fa111a3345 20-Apr-2010 Chris Lattner <sabre@nondot.org> push some source location information down through the compiler,
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101939 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
09c065d401711172d50cd39a03cd2fc90a0e644b 20-Apr-2010 Chris Lattner <sabre@nondot.org> remove some extraneous qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101912 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4992bdde387c5f033bb450a716eaabc0fda52688 20-Apr-2010 Chris Lattner <sabre@nondot.org> remove some extraneous qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101912 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
944c37abb8acd1e14e73176922ee351db6a0f62f 20-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
16573fa9705b546b7597c273b25b85d6321e2b33 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
a3817fdf040372b8f46f31a7015497e731f6a4fb 19-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101815 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
8d8ab749f6f8bb63ea2cd2b589c0f050b67fc5cc 19-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101815 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
f659b239aa691ee558fd4ba0ef0a68ce396857d3 19-Apr-2010 Dan Gohman <gohman@apple.com> Fix -Wcast-qual warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101786 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
ecordLayoutBuilder.cpp
cb421fa690da545b58a720abe5f1c49b166dbde7 19-Apr-2010 Dan Gohman <gohman@apple.com> Fix -Wcast-qual warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101786 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
ecordLayoutBuilder.cpp
bb414b5e6266a9c1063ebc6cdf595ddfdd6c4e0e 17-Apr-2010 Anders Carlsson <andersca@mac.com> If a wide bit-field is inside a union its offset should always be 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101668 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
de9f153b2348f590151504888c22cb937134cd27 17-Apr-2010 Anders Carlsson <andersca@mac.com> If a wide bit-field is inside a union its offset should always be 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101668 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
566e7eca199ecccb73cd8305faae30d2dbe8efb6 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add printName to DeclarationName which prints the human-readable name on a
raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101633 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclarationName.cpp
f6cde77d7bc34bbee26b086ff192637af8e9da59 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add printName to DeclarationName which prints the human-readable name on a
raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101633 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclarationName.cpp
13946c261d641cd1745b59d36ae1420c2aea20ae 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
eclPrinter.cpp
xpr.cpp
ecordLayoutBuilder.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
900fc6388e803868a34b9483510c345e9b49d7eb 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
eclPrinter.cpp
xpr.cpp
ecordLayoutBuilder.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
bd344d9ce594b0bd536c00e31d7c7cbb5b2408c7 17-Apr-2010 Chris Lattner <sabre@nondot.org> make our existing "switch on bool" warning work for C. Since
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101576 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2b334bb3126a67895813e49e6228dad4aec0b4d6 17-Apr-2010 Chris Lattner <sabre@nondot.org> make our existing "switch on bool" warning work for C. Since
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101576 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1aa2c1220cb0200320d5ad7fd9573f5bf3bd5b2f 16-Apr-2010 Anders Carlsson <andersca@mac.com> Remove printfs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101470 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4b16e97ff7761cfc61a42b15dfce5d868335196f 16-Apr-2010 Anders Carlsson <andersca@mac.com> Remove printfs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101470 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d1704274c9e72dda026d3ef158746aa426b57ef4 16-Apr-2010 Anders Carlsson <andersca@mac.com> More work on wide bit-fields, WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101467 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
4cf6f5fdc529f0b4412505e2e6af099370a479b3 16-Apr-2010 Anders Carlsson <andersca@mac.com> More work on wide bit-fields, WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101467 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3b3a608e24bae557bc09512327a91d1aab04ef8a 16-Apr-2010 Anders Carlsson <andersca@mac.com> Rename the ASTContext member 'Context'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101462 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
0f0e9b0ace2a970d31ac31811f07e0b1d93501d6 16-Apr-2010 Anders Carlsson <andersca@mac.com> Rename the ASTContext member 'Context'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101462 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
5eb2335afcf147071de800b65040f122809f86e6 15-Apr-2010 Anders Carlsson <andersca@mac.com> Split adding the primary virtual base offsets out into a separate pass. This fixes a bug where we would lay out virtual bases in the wrong order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101373 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
97913576dbe624971bf18726899983d211d742c0 15-Apr-2010 Anders Carlsson <andersca@mac.com> Split adding the primary virtual base offsets out into a separate pass. This fixes a bug where we would lay out virtual bases in the wrong order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101373 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3d1c024dc8dba472a520f00053a4422154614cf0 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> Tweak spelling (Bitfield -> BitField)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101369 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b6830d616a068971f13e1e213e06a945c8c93cea 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> Tweak spelling (Bitfield -> BitField)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101369 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ffa6d1ca26643972b8b6bf394e0cc1cb757643ef 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> Add TargetInfo::useBitfieldTypeAlignment().
- Used to determine whether the alignment of the type in a bit-field is
respected when laying out structures. The default is true, targets can
override this as needed.

- This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in
gcc. The AST/Sema implementation only affects one line, unless I have
forgotten something. I'd appreciate further review.

- IRgen still needs to be updated to fully support this (which is effectively
PR5591).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101356 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b6a169395c1b30c76daffebcbd2164b6247a5d21 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> Add TargetInfo::useBitfieldTypeAlignment().
- Used to determine whether the alignment of the type in a bit-field is
respected when laying out structures. The default is true, targets can
override this as needed.

- This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in
gcc. The AST/Sema implementation only affects one line, unless I have
forgotten something. I'd appreciate further review.

- IRgen still needs to be updated to fully support this (which is effectively
PR5591).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101356 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6b2b26cc0b0b304e31bffe984cf2db1c24ec864f 14-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Add encoding of reference types like gcc does for objc methods and
blocks. Fixes PR6468.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101196 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa1d76163e4b0b1cc54e222be67379f8c02e8ffa 14-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Add encoding of reference types like gcc does for objc methods and
blocks. Fixes PR6468.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101196 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6e1f2241cecf3eebbc551d4bc83938136d12ea78 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Use ASTVector instead of std::vector for the Exprs in InitListExpr. Performance
measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance
change, but now the vector isn't leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101195 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
709210feee317b8d6690dd1d15c2b74cfe55e261 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Use ASTVector instead of std::vector for the Exprs in InitListExpr. Performance
measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance
change, but now the vector isn't leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101195 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
42be94c436ce4ec42911c68725264ec632d21cef 14-Apr-2010 John McCall <rjmccall@apple.com> Fix an embarrasing memory error. I was apparently very tired when I wrote this
code the first time.

Fixes PR6827.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101184 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
21c0160959961b3a6ab3308608ee3fde182ecb49 14-Apr-2010 John McCall <rjmccall@apple.com> Fix an embarrasing memory error. I was apparently very tired when I wrote this
code the first time.

Fixes PR6827.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101184 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
38555aad1717a6929037cd1efc2157ac75156896 13-Apr-2010 Daniel Dunbar <daniel@zuster.org> Remove unnecessary cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101176 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
4895a8ca41352b9ce572cd64ffa93208898e7546 13-Apr-2010 Daniel Dunbar <daniel@zuster.org> Remove unnecessary cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101176 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
186df80638c71e9ca3d4dd8800afec00a91c933c 13-Apr-2010 Chris Lattner <sabre@nondot.org> Teach HasSideEffect about InitListExprs. Not having
this caused us to codegen dead globals like this:

struct foo { int a; int b; };

static struct foo fooarray[] = {
{1, 2},
{4},
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101150 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
363ff23cfddb51abe4ee4212a6dd3c9b534fcc8b 13-Apr-2010 Chris Lattner <sabre@nondot.org> Teach HasSideEffect about InitListExprs. Not having
this caused us to codegen dead globals like this:

struct foo { int a; int b; };

static struct foo fooarray[] = {
{1, 2},
{4},
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101150 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
580de3c5ca180bdef2f4e1c0b721fb3bf48a9ef2 12-Apr-2010 Anders Carlsson <andersca@mac.com> Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101004 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
80638c5e6395344c1e6096542b0ff3b8bfb2139e 12-Apr-2010 Anders Carlsson <andersca@mac.com> Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101004 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e2e84e593dc7f90c85a66d9cc8fce276ff161ddc 10-Apr-2010 Anders Carlsson <andersca@mac.com> Fix another vbase layout bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100952 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
573021fc10d0668a9d59888bdfc259e3a304b405 10-Apr-2010 Anders Carlsson <andersca@mac.com> Fix another vbase layout bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100952 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6e8b363bf748388142ec6dd8444faea9f567ab50 10-Apr-2010 Anders Carlsson <andersca@mac.com> Add a simple debug-only verification pass to the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100951 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a1e87162d36f94d3dc58ff3f0743d6026635a0c6 10-Apr-2010 Anders Carlsson <andersca@mac.com> Add a simple debug-only verification pass to the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100951 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2070fbfa57a1dcb8bc5594fd66522d89189e1dec 10-Apr-2010 Anders Carlsson <andersca@mac.com> Simplify the virtual base layout code and fix a bug where we wouldn't store the offset for a virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100940 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
bdda6c1788dfdb890e1eccd13b949b1cc875eeaa 10-Apr-2010 Anders Carlsson <andersca@mac.com> Simplify the virtual base layout code and fix a bug where we wouldn't store the offset for a virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100940 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b33ebd3aa2318ef1938cac5f5720f122342ff798 09-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression caused by implementing cstyle methods
for objc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100865 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
4ecb25fa94897b2c03510292acace710e5262ba5 09-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression caused by implementing cstyle methods
for objc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100865 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5739fe3c388afdb288db79183b966aeb96dead6e 08-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Implement method type encoding in the presense
of c-style arguments. Completes radar 7445205.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100813 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
7732cc9c0fdc97a2f8cce4e5933d8103213d1aef 08-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Implement method type encoding in the presense
of c-style arguments. Completes radar 7445205.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100813 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
130d4732076de1ba74b7e5c6257362599a34bbd2 08-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a misuse of iterators when iterating through block's
parameters list for encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100788 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6f46c2653c1545cc3fef0c0df996d18160160ce8 08-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a misuse of iterators when iterating through block's
parameters list for encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100788 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ded708ad2f2931c5974a3254a9705408523d6a51 08-Apr-2010 John McCall <rjmccall@apple.com> Implement dependent friend function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100753 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
af2094e7cecadf36667deb61a83587ffdd979bd3 08-Apr-2010 John McCall <rjmccall@apple.com> Implement dependent friend function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100753 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e41639e4277f1104b3a4d724c727645bda80231d 08-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100746 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
bf9e48cbaaa23d990dbedf9489513500bd0b9751 08-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100746 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
85c95262de036719f872ae38187d751e575df82e 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> When a template (without arguments) is passed as a template type
parameter, explicitly ask the user to give it arguments. We used to
complain that it wasn't a type and expect the user to figure it out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100729 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
db88d8ad74097e2601d81ee863ce46a8a48a7034 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> When a template (without arguments) is passed as a template type
parameter, explicitly ask the user to give it arguments. We used to
complain that it wasn't a type and expect the user to figure it out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100729 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
e6c39d3a3e77c17bb9aa97be6e2e1ae2dbd654db 07-Apr-2010 Shih-wei Liao <sliao@google.com> libbcc

Change-Id: Ieaa3ebd5a38f370752495549f8870b534eeedfc5
PValue.cpp
STConsumer.cpp
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ttrImpl.cpp
MakeLists.txt
XXInheritance.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclGroup.cpp
eclObjC.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
ullExpr.cpp
nheritViz.cpp
akefile
estedNameSpecifier.cpp
arentMap.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtProfile.cpp
tmtViz.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
ypeLoc.cpp
ypePrinter.cpp
c70db7352f4ef15e16308c1fc8854c4f08760dad 07-Apr-2010 Ted Kremenek <kremenek@apple.com> Don't emit an 'unused expression' warning for '||' and '&&' expressions that contain assignments
or similar side-effects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100676 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c46a246f5fb00bf8448a1081e7d7e73bb6dbfbf5 07-Apr-2010 Ted Kremenek <kremenek@apple.com> Don't emit an 'unused expression' warning for '||' and '&&' expressions that contain assignments
or similar side-effects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100676 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e1cd8b0e2681559f4d085ac963606122d1891270 06-Apr-2010 John McCall <rjmccall@apple.com> Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup. My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100562 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
161755a09898c95d21bfff33707da9ca41cd53c5 06-Apr-2010 John McCall <rjmccall@apple.com> Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup. My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100562 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
02a97ac90e6656dbb2999fe94d097fcc7e251a9d 06-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Put type restriction on convesion to nonconforming 'id' back in
block pointer type comparison.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100533 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a98344869c278295f38e106583906377520079b8 06-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Put type restriction on convesion to nonconforming 'id' back in
block pointer type comparison.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100533 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f980d86f4cf44a22403e95ab884f05fcd518ecc9 06-Apr-2010 Chris Lattner <sabre@nondot.org> Match MemoryBuffer API changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100484 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
a0a270c0f1c0a4e3482438bdc5f4a7bd3d25f0a6 06-Apr-2010 Chris Lattner <sabre@nondot.org> Match MemoryBuffer API changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100484 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
efe6c6158b22d5e04dfea48037d7a2f16bd10e3d 05-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Extend the type printing policy to allow one to turn off the printing
of file locations for anonymous tag types (e.g., "enum <anonymous at
t.h:15:6>"), which can get rather long.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100470 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
84139d6ef8967cfdb70d37378a7a65cc4827d44d 05-Apr-2010 Douglas Gregor <dgregor@apple.com> Extend the type printing policy to allow one to turn off the printing
of file locations for anonymous tag types (e.g., "enum <anonymous at
t.h:15:6>"), which can get rather long.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100470 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
a0ce4f0a26d33d618f24feb182b1985d04dc370a 05-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6780, properly handling the IR {|} escapes in inline asm strings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100449 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
018b54e5c3d31dc03e2a874d58ae258651087296 05-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6780, properly handling the IR {|} escapes in inline asm strings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100449 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
eaa54658da013e6191210ca3598ba13e3f6a7f2b 02-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Add ObjCIvarDecl::getContainingInterface().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100227 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
27a961a6adab85cfcf7e48485bbec9237719ae96 02-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Add ObjCIvarDecl::getContainingInterface().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100227 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6b63ce63213dd5938d5ef862d112a5c61cdb7a9e 02-Apr-2010 Daniel Dunbar <daniel@zuster.org> Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants on the provided DeclContext.
- Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100213 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
a06549226f45d5b72169a3d054415616dd1014a2 02-Apr-2010 Daniel Dunbar <daniel@zuster.org> Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional invariants on the provided DeclContext.
- Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100213 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
0fedc2fc0a4dc1cf55ece57b339ca0e20d342ff0 02-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100196 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2f59979a7cc7929f53c9984423b0abeb83113442 02-Apr-2010 Douglas Gregor <dgregor@apple.com> Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100196 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6cd177b0a29a19cf65750f1f42d135c7a89a6804 01-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Relax the typesafty rules of block pointers types which
take'id' or return 'id' in their type. Fixes radar 7814131.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100129 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
699fca2d7aeb854e4c4d68b3483734b52b7cc932 01-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Relax the typesafty rules of block pointers types which
take'id' or return 'id' in their type. Fixes radar 7814131.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100129 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ec6d392c816684e9679a3d04f742fa3991f5fe1e 01-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Change the representation of dependent elaborated-type-specifiers
(such as "class T::foo") from an ElaboratedType of a TypenameType to a
DependentNameType, which more accurately models the underlying
concept.

Improve template instantiation for DependentNameType nodes that
represent nested-name-specifiers, by performing tag name lookup and
checking the resulting tag appropriately. Fixes PR5681.

There is still much testing and cleanup to do in this area.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100054 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4033642464e8ba0982f88f34cffad808d247b393 01-Apr-2010 Douglas Gregor <dgregor@apple.com> Change the representation of dependent elaborated-type-specifiers
(such as "class T::foo") from an ElaboratedType of a TypenameType to a
DependentNameType, which more accurately models the underlying
concept.

Improve template instantiation for DependentNameType nodes that
represent nested-name-specifiers, by performing tag name lookup and
checking the resulting tag appropriately. Fixes PR5681.

There is still much testing and cleanup to do in this area.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100054 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ca7a15360ebda535be0f3281baf6bd4310b9b6d4 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Extend DependentNameType with a keyword enum that specifies whether
this was parsed as a typename-specifier, elaborated-type-specifier
(including the kind), or just a dependent qualified type name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100039 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypePrinter.cpp
4a2023f5014e82389d5980d307b89c545dbbac81 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Extend DependentNameType with a keyword enum that specifies whether
this was parsed as a typename-specifier, elaborated-type-specifier
(including the kind), or just a dependent qualified type name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100039 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypePrinter.cpp
387b0fc2d81da3b564801d77e2f20681ee868887 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Remove the AST statistics tracking I added yesterday; it didn't pan out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100027 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xpr.cpp
tmt.cpp
ype.cpp
db2eb5abf4c082d1f0c5c45e39d8cd0300f81e38 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove the AST statistics tracking I added yesterday; it didn't pan out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100027 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xpr.cpp
tmt.cpp
ype.cpp
725b41e4eefc6d19b6215f24489acbc2e1641765 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ype.cpp
ypePrinter.cpp
4714c12a1ab759156b78be8f109ea4c12213af57 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ype.cpp
ypePrinter.cpp
504813dc37b3b584f722ac1acdb3d2e64c78998f 31-Mar-2010 John McCall <rjmccall@apple.com> Regularize support for naming conversion functions in using decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99979 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
32daa4223ccb2c0afe5fbe151c6eb1ab64816957 31-Mar-2010 John McCall <rjmccall@apple.com> Regularize support for naming conversion functions in using decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99979 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
27160d35e436d2611ade7eb76d31da99b38a32ac 31-Mar-2010 John McCall <rjmccall@apple.com> Introduce a new kind of derived-to-base cast which bypasses the need for
null checks, and make sure we elide null checks when accessing base class
members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99963 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
23cba801e11b03929c44f8cf54578305963a3476 31-Mar-2010 John McCall <rjmccall@apple.com> Introduce a new kind of derived-to-base cast which bypasses the need for
null checks, and make sure we elide null checks when accessing base class
members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99963 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2ffdc0f8242c22c4bca8bbc2390be61a8a80e4b8 31-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99940 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
425ef72306d4ff6b3698b744353e5f0e56b4b884 31-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99940 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
0c525edf14d4cf5aaf8f6954433c0476d0bc6a65 30-Mar-2010 John McCall <rjmccall@apple.com> Propagate the "found declaration" (i.e. the using declaration instead of
the underlying/instantiated decl) through a lot of API, including "intermediate"
MemberExprs required for (e.g.) template instantiation. This is necessary
because of the access semantics of member accesses to using declarations:
only the base class *containing the using decl* need be accessible from the
naming class.

This allows us to complete an access-controlled selfhost, if there are no
recent regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99936 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6bb8017bb9e828d118e15e59d71c66bba323c364 30-Mar-2010 John McCall <rjmccall@apple.com> Propagate the "found declaration" (i.e. the using declaration instead of
the underlying/instantiated decl) through a lot of API, including "intermediate"
MemberExprs required for (e.g.) template instantiation. This is necessary
because of the access semantics of member accesses to using declarations:
only the base class *containing the using decl* need be accessible from the
naming class.

This allows us to complete an access-controlled selfhost, if there are no
recent regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99936 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
433d7d2c70b9be3f9edd40579f512ecab8755049 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ype.cpp
ypePrinter.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ype.cpp
ypePrinter.cpp
eb6c0f92e1ddc70ccce0c7ee92666a816773493d 30-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce new AST statistics that keep track of the number of isa (or
dyn_cast) invocations for C++ and Objective-C types, declarations,
expressions, and statements. The statistics will be printed when
-print-stats is provided to Clang -cc1, with results such as:

277073 clang - Number of checks for C++ declaration nodes
13311 clang - Number of checks for C++ expression nodes
18 clang - Number of checks for C++ statement nodes
174182 clang - Number of checks for C++ type nodes
92300 clang - Number of checks for Objective-C declaration nodes
9800 clang - Number of checks for Objective-C expression nodes
7 clang - Number of checks for Objective-C statement nodes
65733 clang - Number of checks for Objective-C type nodes

The statistics are only gathered when NDEBUG is not defined, since
they introduce potentially-expensive operations into very low-level
routines (isa).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99912 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xpr.cpp
tmt.cpp
ype.cpp
f540305c5d834ad9412b41805b81a74249b7c5af 30-Mar-2010 Douglas Gregor <dgregor@apple.com> Introduce new AST statistics that keep track of the number of isa (or
dyn_cast) invocations for C++ and Objective-C types, declarations,
expressions, and statements. The statistics will be printed when
-print-stats is provided to Clang -cc1, with results such as:

277073 clang - Number of checks for C++ declaration nodes
13311 clang - Number of checks for C++ expression nodes
18 clang - Number of checks for C++ statement nodes
174182 clang - Number of checks for C++ type nodes
92300 clang - Number of checks for Objective-C declaration nodes
9800 clang - Number of checks for Objective-C expression nodes
7 clang - Number of checks for Objective-C statement nodes
65733 clang - Number of checks for Objective-C type nodes

The statistics are only gathered when NDEBUG is not defined, since
they introduce potentially-expensive operations into very low-level
routines (isa).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99912 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
xpr.cpp
tmt.cpp
ype.cpp
8b4dd8d60bb7f244c084c62d42b2ad3f0d46f9fd 30-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add Support for 'warn_unused_result" attribute on
objective-c methods. (radar 7418262).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99903 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f031774aa2638b4d3f487e7e44180c1f89b867ef 30-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add Support for 'warn_unused_result" attribute on
objective-c methods. (radar 7418262).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99903 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2ff387f58d91043f1651c01a117482b5fe79985d 30-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> When copying a partial diagnostic into a DependentDiagnostic, allocate
storage for that partial diagnostic via the ASTContext's
BumpPtrAllocator rather than using up slots in the ASTContext's
cache. Now that we do this, we don't have to worry about destroying
dependent diagnostics when destroying a DependentStoredDeclsMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99854 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b836518bfc0a2ad5e22a670c82fa070ed83ea909 30-Mar-2010 Douglas Gregor <dgregor@apple.com> When copying a partial diagnostic into a DependentDiagnostic, allocate
storage for that partial diagnostic via the ASTContext's
BumpPtrAllocator rather than using up slots in the ASTContext's
cache. Now that we do this, we don't have to worry about destroying
dependent diagnostics when destroying a DependentStoredDeclsMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99854 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8072597e1d95bcd34bf81697f2eeff70c1a54909 30-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Optimize PartialDiagnostic's memory-allocation behavior by placing a
cache of PartialDiagnostic::Storage objects into an allocator within
the ASTContext. This eliminates a significant amount of malloc
traffic, for a 10% performance improvement in -fsyntax-only wall-clock
time with 403.gcc's combine.c.

Also, eliminate the RequireNonAbstractType hack I put in earlier,
which was but a symptom of this larger problem.

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
fe6b2d481d91140923f4541f273b253291884214 30-Mar-2010 Douglas Gregor <dgregor@apple.com> Optimize PartialDiagnostic's memory-allocation behavior by placing a
cache of PartialDiagnostic::Storage objects into an allocator within
the ASTContext. This eliminates a significant amount of malloc
traffic, for a 10% performance improvement in -fsyntax-only wall-clock
time with 403.gcc's combine.c.

Also, eliminate the RequireNonAbstractType hack I put in earlier,
which was but a symptom of this larger problem.

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8438a2e5160e4ecf595f7ecde4e16b90a77f4be5 29-Mar-2010 Anders Carlsson <andersca@mac.com> When collecting virtual bases it's very important to use the canonical type of the base class. Otherwise, we might add the same virtual base class twice if the virtual base is an instantiated template. Fixes PR6251.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99829 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
1c3639351f8c252ddcc13d234cabf8780b1c235f 29-Mar-2010 Anders Carlsson <andersca@mac.com> When collecting virtual bases it's very important to use the canonical type of the base class. Otherwise, we might add the same virtual base class twice if the virtual base is an instantiated template. Fixes PR6251.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99829 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
69770037b95e2126b0a8567d95351ddbe722baac 29-Mar-2010 Anders Carlsson <andersca@mac.com> Fix a nasty bug in the virtual base computation which would lead to us initializing virtual bases in the wrong order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99806 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6f6de731808ffd3664f0a179d1cb694c4e7e5342 29-Mar-2010 Anders Carlsson <andersca@mac.com> Fix a nasty bug in the virtual base computation which would lead to us initializing virtual bases in the wrong order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99806 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fdee3fd78798a34a1b2215f48199196c1fb0ad3a 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Be a bit more consistent in using operator->

This patch moves some methods from QualType to Type and changes the users to
use -> instead of .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99805 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
802c66edc5073991f2315ea84ecace1867c6027f 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Be a bit more consistent in using operator->

This patch moves some methods from QualType to Type and changes the users to
use -> instead of .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99805 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
38626a353447e03ea3cf670e55d626100197b9f0 26-Mar-2010 John McCall <rjmccall@apple.com> Properly account for redeclarations when explicitly instantiating class templates.
What happens here is that we actually turn the first declaration into a
definition, regardless of whether it was actually originally a definition,
and furthermore we do this all after we've instantiated all the declarations.
This exposes a bug in my DefinitionData patch where it was only setting the
DefinitionData for previous declarations, not future declarations.
Fortunately, there's an iterator for that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99657 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2243288c4826905b5a0837f6f21d9d821688652e 26-Mar-2010 John McCall <rjmccall@apple.com> Properly account for redeclarations when explicitly instantiating class templates.
What happens here is that we actually turn the first declaration into a
definition, regardless of whether it was actually originally a definition,
and furthermore we do this all after we've instantiated all the declarations.
This exposes a bug in my DefinitionData patch where it was only setting the
DefinitionData for previous declarations, not future declarations.
Fortunately, there's an iterator for that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99657 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ce381cff11e5dc61e24621bb26d4f9f3c07444ea 24-Mar-2010 John McCall <rjmccall@apple.com> Implement a framework for the delay of arbitrary diagnostics within
templates. So delay access-control diagnostics when (for example) the target
of a friend declaration is a specific specialization of a template.

I was surprised to find that this was required for an access-controlled selfhost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99383 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
0c01d18094100db92d38daa923c95661512db203 24-Mar-2010 John McCall <rjmccall@apple.com> Implement a framework for the delay of arbitrary diagnostics within
templates. So delay access-control diagnostics when (for example) the target
of a friend declaration is a specific specialization of a template.

I was surprised to find that this was required for an access-controlled selfhost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99383 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
cd2f20c3de88eeb5a53346e876123e47e1a37e66 24-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Implement computation of the final overriders for each virtual
function within a class hierarchy (C++ [class.virtual]p2).

We use the final-overrider computation to determine when a particular
class is ill-formed because it has multiple final overriders for a
given virtual function (e.g., because two virtual functions override
the same virtual function in the same virtual base class). Fixes
PR5973.

We also use the final-overrider computation to determine which virtual
member functions are pure when determining whether a class is
abstract or diagnosing the improper use of an abstract class. The
prior approach to determining whether there were any pure virtual
functions in a class didn't cope with virtual base class subobjects
properly, and could not easily be fixed to deal with the oddities of
subobject hiding. Fixes PR6631.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99351 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
7b2fc9d3c97f2526528a8b686af1589054025ca0 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement computation of the final overriders for each virtual
function within a class hierarchy (C++ [class.virtual]p2).

We use the final-overrider computation to determine when a particular
class is ill-formed because it has multiple final overriders for a
given virtual function (e.g., because two virtual functions override
the same virtual function in the same virtual base class). Fixes
PR5973.

We also use the final-overrider computation to determine which virtual
member functions are pure when determining whether a class is
abstract or diagnosing the improper use of an abstract class. The
prior approach to determining whether there were any pure virtual
functions in a class didn't cope with virtual base class subobjects
properly, and could not easily be fixed to deal with the oddities of
subobject hiding. Fixes PR6631.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99351 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
778abf2acd5ebf1f252ddc77a5b7f7d5167e02d2 22-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> More clean up of ivars which are either in class extensions and
implementation or synthesized into an implementation. Also,
fixes a code gen. bug when ivars are itroduced in interleaved
implementations. (related to radar 7547942).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99193 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3bfacdf6f0706987c1b33c625cd68fb880881c22 22-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> More clean up of ivars which are either in class extensions and
implementation or synthesized into an implementation. Also,
fixes a code gen. bug when ivars are itroduced in interleaved
implementations. (related to radar 7547942).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99193 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0ba0dc0a1a9c868010c0e2b9e03c3a6c4f880b2a 22-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Sort calls to add_clang_library()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99191 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
909e6aaa4f6015ca0cfa0ff32acbc29d37f182aa 22-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Sort calls to add_clang_library()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99191 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
878dbb84cb14b5d61e6941841eea00e5737eb07a 20-Mar-2010 Daniel Dunbar <daniel@zuster.org> Evaluate: Fix a subtle bug in the pointer evaluator in which we would do an
expression computation in the wrong bit-width, and end up generating a totally
bogus array reference (_g0+8589934546).
- This showed up on Prolangs/cdecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99042 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e0cdb4edd8f265d0fd22d178d03c597dd201cda2 20-Mar-2010 Daniel Dunbar <daniel@zuster.org> Evaluate: Fix a subtle bug in the pointer evaluator in which we would do an
expression computation in the wrong bit-width, and end up generating a totally
bogus array reference (_g0+8589934546).
- This showed up on Prolangs/cdecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99042 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
effc786f47716410eb470ac4ed0294abe4deb3b6 19-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Remove the capture, serialization, and deserialization of comment
ranges as part of the ASTContext. This code is not and was never used,
but contributes ~250k to the size of the Cocoa.h precompiled
header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c6fbbedb3e90ff2f04828c36fd839e01468679f5 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove the capture, serialization, and deserialization of comment
ranges as part of the ASTContext. This code is not and was never used,
but contributes ~250k to the size of the Cocoa.h precompiled
header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ebb091487d88180a5670a48dc77d0292862cf58d 19-Mar-2010 Ted Kremenek <kremenek@apple.com> Make the CIndex API more resilient to being used on invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98981 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ebfa339321f8a4df9d5011e591a615d5765107d5 19-Mar-2010 Ted Kremenek <kremenek@apple.com> Make the CIndex API more resilient to being used on invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98981 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2423e99c455d06b310f87644d963e5d97f968e18 19-Mar-2010 John McCall <rjmccall@apple.com> Pretty-print anonymous types using their kind and presumed location.
Fixes PR6643. Patch by Mike M!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98946 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
73061d054128e486e70e0f2874b23d6eca067e5b 19-Mar-2010 John McCall <rjmccall@apple.com> Pretty-print anonymous types using their kind and presumed location.
Fixes PR6643. Patch by Mike M!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98946 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
09098fcbca461a478259d933ae5cf9c8168d2ca7 18-Mar-2010 Ted Kremenek <kremenek@apple.com> Make PredefinedExpr::ComputeName() more robust to incorrect
code when we are printing the name of an Objective-C method
whose class has not been declared. Fixes <rdar://problem/7495713>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98874 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b03d33edaf24af2893a50caee4d2c99839242c44 18-Mar-2010 Ted Kremenek <kremenek@apple.com> Make PredefinedExpr::ComputeName() more robust to incorrect
code when we are printing the name of an Objective-C method
whose class has not been declared. Fixes <rdar://problem/7495713>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98874 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
42bd56c8c7545a3e1b6d510712139551e0da43f7 18-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Some cleanup, change diagnostic when assigning to
a property which is not lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98848 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
90c71268f04369328e8f579007b8b4f1da9feea0 18-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Some cleanup, change diagnostic when assigning to
a property which is not lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98848 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9bec00f10ef63d6483eeffdfd6174d94bec0231e 17-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> objective-c patch to provide type safty when blocks are passing or
returning objc objects. There will be a corresponding objective-c++
patch soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98696 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
132f2a2da34f378fc675b9e174564b0f52c31d98 17-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> objective-c patch to provide type safty when blocks are passing or
returning objc objects. There will be a corresponding objective-c++
patch soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98696 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2c9c4584acb6ca7ef35bde8b96f81acc9e66ee75 16-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wshadow. Based on a patch by Mike M.!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98684 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8472af4df9292e02fb25c952d25a81f3ca296252 16-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wshadow. Based on a patch by Mike M.!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98684 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5fb9b355e182d1ec046cdc061855d3ffb691e967 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98630 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f6ac97b101c8840efa92bf29166077ce4049e293 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98630 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
331eb3639454b3470a666553cd798f32a42a9c2e 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98598 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
36c35ba0aca641e60e5dbee8efbc620c08b9bd61 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98598 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
40e0148c249727d064c9aef48aca7c896c8d21c1 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98594 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f715ca12bfc9fddfde75f98a197424434428b821 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98594 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
72898076bbfe83ff42f2c478fb10e5391948123b 15-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98585 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aea67dbd653a2dd6dd5cc2159279e81e855b2482 15-Mar-2010 Douglas Gregor <dgregor@apple.com> Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98585 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
950c119aee83ad009dad80836de21bd9a19cc676 15-Mar-2010 Ted Kremenek <kremenek@apple.com> Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ObjCInterfaceDecl.
Also change this method to lookup property declarations using DeclContext::lookup().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98574 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
37cafb077ad5b170acae77e566638603011ef4c0 15-Mar-2010 Ted Kremenek <kremenek@apple.com> Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ObjCInterfaceDecl.
Also change this method to lookup property declarations using DeclContext::lookup().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98574 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3ae69a5219df72a1a976ec03370cf8f78f50191e 15-Mar-2010 Ted Kremenek <kremenek@apple.com> Change ObjCCategoryDecl::FindPropertyDeclaration() to lookup
property decls using DeclContext::lookup().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98571 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
de09d0c9694f01a99870a8825266d44a29ebb325 15-Mar-2010 Ted Kremenek <kremenek@apple.com> Change ObjCCategoryDecl::FindPropertyDeclaration() to lookup
property decls using DeclContext::lookup().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98571 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0ce756b8d20f6ceea8e810d8ced84fe150314b1a 15-Mar-2010 Ted Kremenek <kremenek@apple.com> Make 'findPropertyDecl()' a static method of ObjCPropertyDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98570 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9f550ff05d496e6b9480e5619a21d9da0c9e27c1 15-Mar-2010 Ted Kremenek <kremenek@apple.com> Make 'findPropertyDecl()' a static method of ObjCPropertyDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98570 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e88b6e3c31125b4bb55d60aa3b982735d308c792 15-Mar-2010 John McCall <rjmccall@apple.com> Remember declaration scope qualifiers in the AST. Imposes no memory overhead
on unqualified declarations.

Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy(). I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98540 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
b6217665c6a987f2d6c8665fd70365d7719ac4df 15-Mar-2010 John McCall <rjmccall@apple.com> Remember declaration scope qualifiers in the AST. Imposes no memory overhead
on unqualified declarations.

Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy(). I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98540 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ecl.cpp
eclCXX.cpp
d2adbba2406e58a4ffefa47676b970ab656f357d 15-Mar-2010 John McCall <rjmccall@apple.com> Remember access paths for visible conversion decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98539 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b05b5f35f114505182b076aa70002843c0669beb 15-Mar-2010 John McCall <rjmccall@apple.com> Remember access paths for visible conversion decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98539 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c5e336be5dd97a8a9c6a61000e97342c990bcb71 13-Mar-2010 John McCall <rjmccall@apple.com> Check compatibility of vector types using their canonicalizations.
Fixes an assertion arising C overload analysis, but really I can't imagine
that this wouldn't cause a thousand other uncaught failures.

Fixes PR6600.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98400 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1c471f3e1c0ec8cbc82447bb35908dfc55463e46 13-Mar-2010 John McCall <rjmccall@apple.com> Check compatibility of vector types using their canonicalizations.
Fixes an assertion arising C overload analysis, but really I can't imagine
that this wouldn't cause a thousand other uncaught failures.

Fixes PR6600.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98400 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
27c4182d9c44e33a144944a4123b5bc6d6d7a854 12-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Allow users to set CPPFLAGS and CXXFLAGS on the make command line.

Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
3352406820d133c78161e8d710f95b8ac152a1e7 12-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Allow users to set CPPFLAGS and CXXFLAGS on the make command line.

Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
5570021146ec9ed50c891a0af626fec316db896f 12-Mar-2010 John McCall <rjmccall@apple.com> Remember whether a ParmVarDecl was spelled with a default argument or
whether it inherited one from a previous declaration.

Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98362 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
bf73b352acb7a2d041ce8b50171dd7f8e2b2c1bb 12-Mar-2010 John McCall <rjmccall@apple.com> Remember whether a ParmVarDecl was spelled with a default argument or
whether it inherited one from a previous declaration.

Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98362 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
faab297caf346330bb3bc96b3b68eb0cc6395a8b 12-Mar-2010 John McCall <rjmccall@apple.com> Improve the unused-value check to look into comma expressions and filter out
voids in sub-expressions. Patch by Mike M!

Fixes PR4806.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98335 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0faede6f31b07bcec7b776f2b420c3ea9bb3e58c 12-Mar-2010 John McCall <rjmccall@apple.com> Improve the unused-value check to look into comma expressions and filter out
voids in sub-expressions. Patch by Mike M!

Fixes PR4806.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98335 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
897c3169affd0817efe175993965ad4ad2739dc0 12-Mar-2010 John McCall <rjmccall@apple.com> Extend the builtin syntax to allow address-space qualifiers on pointers and
references. Based on a patch by Arnaud de Grandmaison!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98327 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
187ab37a05b8f7015b9f39cc8cd9129a0c6d0b48 12-Mar-2010 John McCall <rjmccall@apple.com> Extend the builtin syntax to allow address-space qualifiers on pointers and
references. Based on a patch by Arnaud de Grandmaison!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98327 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e67d87863563c575c611fe2d45cc0aac5ad3330c 12-Mar-2010 John McCall <rjmccall@apple.com> Implement basic support for friend types and functions in non-dependent
contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98321 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclFriend.cpp
d60e22e601852ae1345f01514318a0951dc09f89 12-Mar-2010 John McCall <rjmccall@apple.com> Implement basic support for friend types and functions in non-dependent
contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98321 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclFriend.cpp
755efc993c384007d8eb0c97a54288b3aaaa1dbc 11-Mar-2010 Ted Kremenek <kremenek@apple.com> For ivars created using @synthesize, set their DeclContext to be
the @implementation (instead of the @interface) and actually add
the ivar to the DeclContext (which we weren't doing before).

This allows us to simplify ASTContext::CollectNonClassIvars() by
removing ASTContext::CollectProtocolSynthesizedIvars(). Now all
ivars can be found by either inspecting the ObjCInterfaceDecl and
its companion ObjCImplementationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98280 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7d2aa11c5c3b85a9d727ff868de666ba3bff5b59 11-Mar-2010 Ted Kremenek <kremenek@apple.com> For ivars created using @synthesize, set their DeclContext to be
the @implementation (instead of the @interface) and actually add
the ivar to the DeclContext (which we weren't doing before).

This allows us to simplify ASTContext::CollectNonClassIvars() by
removing ASTContext::CollectProtocolSynthesizedIvars(). Now all
ivars can be found by either inspecting the ObjCInterfaceDecl and
its companion ObjCImplementationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98280 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e62539e7e553de6a944f5662e9ad4d3b6efc73a7 11-Mar-2010 John McCall <rjmccall@apple.com> Split C++ friend declarations into their own header/implementation file.
I'm expecting this portion of the AST to grow and change, and I'd like to
be able to do that with minimal recompilation. If this proves unnecessary
when access control is fully-implemented, I'll fold the classes back into
DeclCXX.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98249 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclBase.cpp
eclCXX.cpp
eclFriend.cpp
92b7f70c924cbf4514e9e434cea7def51ab49860 11-Mar-2010 John McCall <rjmccall@apple.com> Split C++ friend declarations into their own header/implementation file.
I'm expecting this portion of the AST to grow and change, and I'd like to
be able to do that with minimal recompilation. If this proves unnecessary
when access control is fully-implemented, I'll fold the classes back into
DeclCXX.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98249 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclBase.cpp
eclCXX.cpp
eclFriend.cpp
1ebb2343ad88d5db8e408a393444a7128b7c6229 11-Mar-2010 Anders Carlsson <andersca@mac.com> More record layout builder cleanup and simplification.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98238 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
37147ea14f39a8522e32e3ba4d043a2a33fff90c 11-Mar-2010 Anders Carlsson <andersca@mac.com> More record layout builder cleanup and simplification.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98238 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a473c54c36491062662c4d23921f4f2d0d1aa23d 11-Mar-2010 Anders Carlsson <andersca@mac.com> Get rid of the PrimaryBase parameter from LayoutVirtualBases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98233 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
88f4296e85d49e4ea63cda729cd5f696824c67ce 11-Mar-2010 Anders Carlsson <andersca@mac.com> Get rid of the PrimaryBase parameter from LayoutVirtualBases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98233 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
389a4f707d374c52dccb9c2cc3268ac6925700da 11-Mar-2010 Anders Carlsson <andersca@mac.com> More cleanup towards fixing the real bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98232 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
622e2477d0698d734671523389277e10d8566e26 11-Mar-2010 Anders Carlsson <andersca@mac.com> More cleanup towards fixing the real bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98232 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
388749b8c3c70bbf5dfb8823d173d9ee4e7e4239 11-Mar-2010 Anders Carlsson <andersca@mac.com> Replace the class offset vectors in RecordLayoutBuilder with maps instead so we'll have faster lookup and so we can detect duplicates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98231 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
147b5ddc6c8618a9d70a83f90de409e444ae705b 11-Mar-2010 Anders Carlsson <andersca@mac.com> Replace the class offset vectors in RecordLayoutBuilder with maps instead so we'll have faster lookup and so we can detect duplicates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98231 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
08295b891d8ab4bc5c1827b57049af988fbef18e 11-Mar-2010 Anders Carlsson <andersca@mac.com> More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98230 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
584e1dfaf6ab682cebe4fe51f55f0ae3215d303f 11-Mar-2010 Anders Carlsson <andersca@mac.com> More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98230 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fcb18ec9910e8e3bd525905cead0012db126fd95 11-Mar-2010 Anders Carlsson <andersca@mac.com> More record layout builder cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98229 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
23a5fcba194c3dec737f296860d75327d85cc349 11-Mar-2010 Anders Carlsson <andersca@mac.com> More record layout builder cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98229 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
20b6798280c8a4c2359cade6f744924970b56f4f 11-Mar-2010 Anders Carlsson <andersca@mac.com> Assert that primary bases always have offset 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98223 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
b6ee4b0146266ff7ce37c7d0a0c036bda50aa813 11-Mar-2010 Anders Carlsson <andersca@mac.com> Assert that primary bases always have offset 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98223 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
d880d5093e51b7190fe22be5d7ffab982fe8ca48 11-Mar-2010 Ted Kremenek <kremenek@apple.com> Remove unused 'IVars' field from ObjCInterfaceDecl. That functionality
has migrated to DeclContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98213 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
568eb6c87896db19dfb27b394669e05b8cbb27b3 11-Mar-2010 Ted Kremenek <kremenek@apple.com> Remove unused 'IVars' field from ObjCInterfaceDecl. That functionality
has migrated to DeclContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98213 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1567fd6037c29c553904f8cdeee2f0c0806da382 11-Mar-2010 Anders Carlsson <andersca@mac.com> Remove the IndirectPrimary parameter in LayoutVirtualBases; it's already there as a member variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98211 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
9dc82d2193971ed57dc657dbd21249a2c57da376 11-Mar-2010 Anders Carlsson <andersca@mac.com> Remove the IndirectPrimary parameter in LayoutVirtualBases; it's already there as a member variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98211 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
8c1fc3d554067117e7dae53cea0ea87cde7e42ad 11-Mar-2010 Anders Carlsson <andersca@mac.com> More cleanup and simplification of the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98208 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
200c5c2d9488165626925235ff918e3d744d785a 11-Mar-2010 Anders Carlsson <andersca@mac.com> More cleanup and simplification of the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98208 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
f02bbf7a29f9b6de380a520151b486871afa2045 10-Mar-2010 Anders Carlsson <andersca@mac.com> Get rid of the LayoutBaseNonVirtually; it was used to lay out a base either as a non-virtual base or a virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98198 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
e3bdbee47059839d5e24acab5ee7b925285f573e 10-Mar-2010 Anders Carlsson <andersca@mac.com> Get rid of the LayoutBaseNonVirtually; it was used to lay out a base either as a non-virtual base or a virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98198 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
6c03c449319a994daab96c2abca68aea73090c6b 10-Mar-2010 Anders Carlsson <andersca@mac.com> More shuffling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98197 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
e239b9d5da3bdc722d29c276b261c136ca9f4eaa 10-Mar-2010 Anders Carlsson <andersca@mac.com> More shuffling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98197 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
0e4b73c1c9d6bba52c9d66b1573a77964f0022a0 10-Mar-2010 Anders Carlsson <andersca@mac.com> Cleanups, no functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98196 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
4c3a7b04a682ee2dbb73fd78441b07869cc3024d 10-Mar-2010 Anders Carlsson <andersca@mac.com> Cleanups, no functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98196 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
1f256b8cba10ff20a07df16c806b650cba130cbe 10-Mar-2010 John McCall <rjmccall@apple.com> Suppress the tag when printing an ElaboratedType if the language options
claim this is C. We don't make ElaboratedTypes in C, but sometimes
the language options during pretty-print lie to us.

The rewriter should really be fixed to not rely on how types are pretty-printed,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98189 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
327fb2d32243e1206b69c5f05d4fa2e3d89a0dcb 10-Mar-2010 John McCall <rjmccall@apple.com> Suppress the tag when printing an ElaboratedType if the language options
claim this is C. We don't make ElaboratedTypes in C, but sometimes
the language options during pretty-print lie to us.

The rewriter should really be fixed to not rely on how types are pretty-printed,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98189 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
98624359b74071fdf2575b5b1afb5d3a3a86b4a3 10-Mar-2010 John McCall <rjmccall@apple.com> When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
estedNameSpecifier.cpp
ypePrinter.cpp
7c2342dd4c9947806842e5aca3d2bb2e542853c9 10-Mar-2010 John McCall <rjmccall@apple.com> When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
estedNameSpecifier.cpp
ypePrinter.cpp
6d7b68bd47850e53cdb0b9a7872675ea43715566 10-Mar-2010 John McCall <rjmccall@apple.com> Allow the fast path through ASTContext::getTypeDeclType to be inlined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98138 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
becb8d5a6ab5103393eac5344ae69bcb860601dd 10-Mar-2010 John McCall <rjmccall@apple.com> Allow the fast path through ASTContext::getTypeDeclType to be inlined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98138 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
55851d6d117e79db3a891bcb821acd19592b2178 10-Mar-2010 John McCall <rjmccall@apple.com> Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
eclBase.cpp
eclCXX.cpp
eclTemplate.cpp
ypePrinter.cpp
3cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4 10-Mar-2010 John McCall <rjmccall@apple.com> Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
eclBase.cpp
eclCXX.cpp
eclTemplate.cpp
ypePrinter.cpp
d8da8143c954c34d62eb3e2d33ae5055626bb856 09-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Don't error when a block pointer is passed to a
vararg functions/methods. Fixes radar 7725203.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98070 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2263f822c31d0855ca8c48bfd9624322bf776f0b 09-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Don't error when a block pointer is passed to a
vararg functions/methods. Fixes radar 7725203.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98070 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
76beecb2c5869cbbac79863f1666b8ec69226d34 09-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Replace copy loops with memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98055 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
bb9357cf8f9b79fdf9af4613748d5dc4929c72d3 09-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Replace copy loops with memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98055 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.cpp
f769e8ab4bd15a1552a6f198a2cd34afa1f02d9a 08-Mar-2010 Ted Kremenek <kremenek@apple.com> Allocate ASTRecordLayout objects using the allocator associated with ASTContext.
This allows them to be allocated using a BumpPtrAllocated
in the common case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97978 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
ecordLayout.cpp
ecordLayoutBuilder.cpp
503524acc73f2f8280080ca0d200377406001b65 08-Mar-2010 Ted Kremenek <kremenek@apple.com> Allocate ASTRecordLayout objects using the allocator associated with ASTContext.
This allows them to be allocated using a BumpPtrAllocated
in the common case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97978 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
ecordLayout.cpp
ecordLayoutBuilder.cpp
f03f5f6c50378476d7fd10edfa0ed8f4c01e38da 08-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Extend ObjCMessageExpr for class method sends with the source location
of the class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97943 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c2350e553b853ad00914faf23fa731e5fc4a8a5c 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Extend ObjCMessageExpr for class method sends with the source location
of the class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97943 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
44032ab343048030bd4332b3e5ccb59974908918 08-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of type source information in the return type of an
Objective-C method declaration, e.g., for

- (Foo *)myMethod;

we now have TypeSourceInfo for the Foo*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97942 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
4bc1cb6aa635a5bf8fae99bf69c56c724c1e786c 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep track of type source information in the return type of an
Objective-C method declaration, e.g., for

- (Foo *)myMethod;

we now have TypeSourceInfo for the Foo*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97942 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclObjC.cpp
704334111420dc14e5787355626a903b34298bd2 05-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to build qualifier on objective-c
pointer types. Fixes radar 7626768.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97847 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a42286486c85402c65f9d30df17e6b1b037a6ade 05-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to build qualifier on objective-c
pointer types. Fixes radar 7626768.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97847 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e9bc8eb41210a241e1b402366f4810c531b15918 05-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> When we invalidate a declaration, make it public, so that it doesn't
trigger access control or one of the many assertions we have for valid
access specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97767 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
42738573253da1bd61f9c44f8d77f600d3b0cd1c 05-Mar-2010 Douglas Gregor <dgregor@apple.com> When we invalidate a declaration, make it public, so that it doesn't
trigger access control or one of the many assertions we have for valid
access specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97767 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
09039e83ed2d4679928c69865dc19a8a1ffbfb5a 03-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Implement name hiding for names found through virtual base subobjects
that are hidden by other derived base subobjects reached along a
lookup path that does *not* pass through the hiding subobject (C++
[class.member.lookup]p6). Fixes PR6462.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97640 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
4e6ba4be8ddeca2978da6b9bae02cbe9594f2ef4 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement name hiding for names found through virtual base subobjects
that are hidden by other derived base subobjects reached along a
lookup path that does *not* pass through the hiding subobject (C++
[class.member.lookup]p6). Fixes PR6462.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97640 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
e63aca1ffde2b363bbce66847a14672c354e6149 03-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Refactor CXXRecordDecl::lookupInBases() to push the recursion down a
level. No functionality change, and it obeys access control this
time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97634 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
89b7702c9a64e12093ed34fc02dc3cfbb6eb133a 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Refactor CXXRecordDecl::lookupInBases() to push the recursion down a
level. No functionality change, and it obeys access control this
time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97634 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
bb14aa0dc63e10afa7132416a7f171fe2665b249 03-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Revert r97618. Access control sucks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97621 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
7f7f5f2803290121a1f78e041411ffc49b4c37fc 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert r97618. Access control sucks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97621 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
b68bf8d0a12645d180dcfc80f8ad95738085b95f 03-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Factor out the recursive lookup into C++ base classes into a separate,
static function. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97618 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
3262a0f7b8c5484635b591dc83125fd24d6ad016 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Factor out the recursive lookup into C++ base classes into a separate,
static function. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97618 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
0464fbe197b98ca4154939e3964b615d02729635 03-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the static map of overridden C++ methods, which was going to
come back to bite us at some point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97607 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
7d10b7eb670b821741b4c96f6cf7afbc3bb39abe 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Eliminate the static map of overridden C++ methods, which was going to
come back to bite us at some point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97607 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
0d432abff06e87a821e4b337339857ff8ea713a4 02-Mar-2010 John McCall <rjmccall@apple.com> Split out types that are non-canonical unless dependent as their own
category. Use this in a few places to eliminate unnecessary TST cases and
do some future-proofing. Provide terrible manglings for typeof. Mangle
decltype with some hope of accuracy.

Our manglings for some of the cases covered in the testcase are different
from gcc's, which I've raised as an issue with the ABI list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97523 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ad5e73887052193afda72db8efcb812bd083a4a8 02-Mar-2010 John McCall <rjmccall@apple.com> Split out types that are non-canonical unless dependent as their own
category. Use this in a few places to eliminate unnecessary TST cases and
do some future-proofing. Provide terrible manglings for typeof. Mangle
decltype with some hope of accuracy.

Our manglings for some of the cases covered in the testcase are different
from gcc's, which I've raised as an issue with the ABI list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97523 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cd5db0d91efc39af8090a754857823317d97b8af 28-Feb-2010 John McCall <rjmccall@apple.com> Support constant-evaluation of __builtin_nans* as well as the correct constant
evaluation of __builtin_nan*. Most of the work to make this work is in LLVM.

Fixes <rdar://problem/7696712> and part of PR 5255.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97383 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
db7b72a82a6834680ccf1eeb51dc57e6d935c655 28-Feb-2010 John McCall <rjmccall@apple.com> Support constant-evaluation of __builtin_nans* as well as the correct constant
evaluation of __builtin_nan*. Most of the work to make this work is in LLVM.

Fixes <rdar://problem/7696712> and part of PR 5255.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97383 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a8916e256e298e07e0d0f5fbee4bc7f8ee354d67 27-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Skip dependent virtual base classes; fixes PR6413.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97291 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5fe8c04009eff540ebaa0cceb2e75c3908322e11 27-Feb-2010 Douglas Gregor <dgregor@apple.com> Skip dependent virtual base classes; fixes PR6413.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97291 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d56fc0f9970dd972e6e0109a0d8d86cc7f91b59d 26-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.

This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97209 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6d90870fe821a9b1a7822d3e28032042d03e5680 26-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.

This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97209 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fca31fd9079cc0c0e3198ad442a1a4e0a7c08f2d 25-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Forgot to include nested protocols in collection, resulting in
bogus warning. Fixes radar 7682116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97157 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b2f812165676230bce5d0215e49a4749c451ca9c 25-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Forgot to include nested protocols in collection, resulting in
bogus warning. Fixes radar 7682116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97157 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7245a51b0677dec904fff139ee23b375c238a78d 25-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97092 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
a2e7dd2f4a50d835351153aee568d35ccc986310 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97092 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
73ec616e0974b9bcc911323653706a853589fc71 25-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Retain complete source information for the type after the '~' in a
CXXPseudoDestructorExpr.

Update template instantiation for pseudo-destructor expressions to use
this source information and to make use of
Sema::BuildPseudoDestructorExpr when the base expression is dependent
or refers to a scalar type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97079 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
26d4ac97fb514bb60c2536eae6f203dc569159d9 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Retain complete source information for the type after the '~' in a
CXXPseudoDestructorExpr.

Update template instantiation for pseudo-destructor expressions to use
this source information and to make use of
Sema::BuildPseudoDestructorExpr when the base expression is dependent
or refers to a scalar type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97079 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
191b5a78948059d28ccb6265d9f8f240b92f2ebd 24-Feb-2010 John McCall <rjmccall@apple.com> References to const int parameters with ICE default arguments are not ICEs.
Fixes PR6373.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97037 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f604a5648d201d2350e1631a755121e9b837f9f2 24-Feb-2010 John McCall <rjmccall@apple.com> References to const int parameters with ICE default arguments are not ICEs.
Fixes PR6373.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97037 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
76741ab2cc358fa7b9287607d06b171ae9691d6b 23-Feb-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
11e8ce7380856abee188b237c2600272df2ed09d 23-Feb-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
6bf7b024d23271f7e59f5c1eaded0ca169208333 23-Feb-2010 Charles Davis <cdavis@mines.edu> When a reference to a field of a struct/union/class is passed to the
__alignof__ operator, make sure to take into account the packed alignment
of the struct/union/class itself. Matches GCC's behavior and fixes PR6362.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96884 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
05f62474dd2b0f1cb69adbe0787f2868788aa949 23-Feb-2010 Charles Davis <cdavis@mines.edu> When a reference to a field of a struct/union/class is passed to the
__alignof__ operator, make sure to take into account the packed alignment
of the struct/union/class itself. Matches GCC's behavior and fixes PR6362.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96884 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
278a77e1278a5ec9574254e51da33a3b803690d4 23-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> More support for ivars in class extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96850 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
0e5ad255729ee86b8ed57e659029008984517cde 23-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> More support for ivars in class extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96850 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
b85912f3fa881281f014555108851086a1bfb73a 23-Feb-2010 John McCall <rjmccall@apple.com> Perform two more constructor/destructor code-size optimizations:

1) emit base destructors as aliases to their unique base class destructors
under some careful conditions. This is enabled for the same targets that can
support complete-to-base aliases, i.e. not darwin.

2) Emit non-variadic complete constructors for classes with no virtual bases
as calls to the base constructor. This is enabled on all targets and in
theory can trigger in situations that the alias optimization can't (mostly
involving virtual bases, mostly not yet supported).

These are bundled together because I didn't think it worthwhile to split them,
not because they really need to be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96842 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c0bf462cf35fe050bddbd8bff967298e4a67e79d 23-Feb-2010 John McCall <rjmccall@apple.com> Perform two more constructor/destructor code-size optimizations:

1) emit base destructors as aliases to their unique base class destructors
under some careful conditions. This is enabled for the same targets that can
support complete-to-base aliases, i.e. not darwin.

2) Emit non-variadic complete constructors for classes with no virtual bases
as calls to the base constructor. This is enabled on all targets and in
theory can trigger in situations that the alias optimization can't (mostly
involving virtual bases, mostly not yet supported).

These are bundled together because I didn't think it worthwhile to split them,
not because they really need to be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96842 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ac1391d21e3ac122ba71ac6eb4d3d685184b64d2 22-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Don't assert that we have a valid access specifier on an invalid
declaration. This is the trivial part of PR6365.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96792 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
fdd8ab11bc40c7f206c8f1e892faa002cc6536b1 22-Feb-2010 Douglas Gregor <dgregor@apple.com> Don't assert that we have a valid access specifier on an invalid
declaration. This is the trivial part of PR6365.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96792 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f0b25c88f1ae2d15003633b82445267be99c4e66 22-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Set access specifiers on imported declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96788 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
325bf177ac0f1db7888e2d7b194515466ba91762 22-Feb-2010 Douglas Gregor <dgregor@apple.com> Set access specifiers on imported declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96788 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
e08f580e7d5f1a9f88448d269395f7a51971d729 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ce056bcaa1c97b89a4b2de2112c62d060863be2b 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ba6d6c196ac79b70e26daebcb3a60e3cf0dba820 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST import for C++ member functions, including constructors, destructors, and conversions. Unfortunately, this cannot be tested yet, since we don't have C++ PCH support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96741 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c144f3534e2f7a70ea9ebf8dd83090a2883d61fb 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST import for C++ member functions, including constructors, destructors, and conversions. Unfortunately, this cannot be tested yet, since we don't have C++ PCH support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96741 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eeab036d3562528384c663d405a52780f0a0987b 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST importing for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96740 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
788c62d1e87bfb596078817237f672a5f000999a 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST importing for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96740 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
7984b63fa582e6c1173a85386d80556b046a31b2 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Collect the code that imports all of the members of a declaration context into a single function, ImportDeclContext. Use it rather than explicit loops. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96739 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
083a821bbd02bbc521275a2f144abe39a6c2745c 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Collect the code that imports all of the members of a declaration context into a single function, ImportDeclContext. Use it rather than explicit loops. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96739 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b30152fd8308b0351e7f377a5dbed95aa8ff5cee 21-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Make Decl::isOutOfLine() virtual, and use that to determine when definitions
are for out of line declarations more easily. This simplifies the logic and
handles the case of out-of-line class definitions correctly. Fixes PR6107.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96729 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8761d680eaa7386e03f51286f4b84a1ffe575e2e 21-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Make Decl::isOutOfLine() virtual, and use that to determine when definitions
are for out of line declarations more easily. This simplifies the logic and
handles the case of out-of-line class definitions correctly. Fixes PR6107.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96729 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
38e9420d42304844bf68550a9270d00408b976f8 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Revert: "Change InitListExpr to allocate the array for holding references"

This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ba7bc5584b8d46f4e8deb3a9d363256908fa86ea 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Revert: "Change InitListExpr to allocate the array for holding references"

This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
95f694e24a4a27da3b02d2a4a79a57a6435226a8 19-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Add a missing break. Cocoa.h can now be merged twice into the same AST context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96650 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
0e12b44081c6395a6d60a05a85a6012f7bb23b16 19-Feb-2010 Douglas Gregor <dgregor@apple.com> Add a missing break. Cocoa.h can now be merged twice into the same AST context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96650 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
2ad6a16fe694494c72c7050d15b950f8d23c8472 19-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96648 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
008847a70ab122a99911149199855060fb3753b4 19-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96648 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
7eee9d4c573ceae99dffffa390ddcbcac25dfbc6 19-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import for sizeof and alignof expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
bd249a542878a626192746c1e0c0b21f164e6df7 19-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import for sizeof and alignof expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
62f809873a8408d05ade1e2348b326e662b1a92c 19-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96646 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
440806306674e23ad74726208cbdc6f37849dd9d 19-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96646 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
3bf2d1973342618db1e8d5946229bc0260567370 19-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96643 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f638f9580ba0da99a66668f00e1a1d4987067bdd 19-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96643 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b17fe9006135d1e6b6d7b545a772b9042c671c0b 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9f9269e810bfe9aea0a57b09250be215808fc1a2 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
292f520b74b449be401d37c8da567d631dbb8b96 19-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
11062e11236b7bc689dad150e8b490fd6b063ec3 19-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
d76f8b4cbaabab9ce1046518714f366ea77c3a51 18-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Try to fix the auroraux buildbot. I suspect it has a "#define SEC" somewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96577 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
bb2d176c4f434e9e73f63f2f9d128f63ce3e10d0 18-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Try to fix the auroraux buildbot. I suspect it has a "#define SEC" somewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96577 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
0741fcc888a6b3607a1486d270f46fc49907e5d8 18-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import for character literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96557 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b2e400aae8c62c4e1616016f40618baace0da065 18-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import for character literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96557 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
49592d6af7cf683aec5d2a27e2cd81ce697860c5 18-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import for forward declarations of Objective-C protocols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96555 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
2b785022973202ea6bafe304a50eb3cac1a0aeb8 18-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import for forward declarations of Objective-C protocols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96555 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
dbdf4801b2ce551f7e1f38abc7bb660f5c5315b4 18-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement import of forward declarations of Objective-C classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96554 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
a2bc15b7463a9f85a5bff1531d833c278426a733 18-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement import of forward declarations of Objective-C classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96554 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
77566154052bdde0930ec8bb2c2acde267a7f29f 18-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import of Objective-C categories.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96551 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b4677b62a8e9bba0913dfe1456bd9d689cdbccac 18-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import of Objective-C categories.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96551 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
121f3eb1c120089a920ba7e7c0188a07fad59022 18-Feb-2010 Ted Kremenek <kremenek@apple.com> Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively. These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
31c780d95a830f0187cfcbb1016ce88f50a7dfe1 18-Feb-2010 Ted Kremenek <kremenek@apple.com> Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively. These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ce7d637fbfa8761a859fbebc66c956cec62ac995 17-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST importing of ImplicitParamDecls, despite the sad fact
that we can't test it yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96516 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
2cd00932b9b5403047139ce8cfaa3ae47966f894 17-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST importing of ImplicitParamDecls, despite the sad fact
that we can't test it yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96516 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
8960b491f253cfd6842350e05104c1f98d4ceaee 17-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST merging for Objective-C properties.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96483 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
e3261624c1870e52d7efc2ac83e647713361ac6c 17-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST merging for Objective-C properties.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96483 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b91663971598eb8b3e78b7a3d7e23328f8132133 17-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> AST import for Objective-C protocols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96478 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
2e2a400383c7a64a927f61eeed596b08928e1d4b 17-Feb-2010 Douglas Gregor <dgregor@apple.com> AST import for Objective-C protocols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96478 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
3cf68a9d706d41b069a57d75b0995562df4565c8 17-Feb-2010 Ted Kremenek <kremenek@apple.com> Add IBAction attribute to keep the IBOutlet attribute company.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
efbddd23173ea5633cc8a004f1014c68c3ac6593 17-Feb-2010 Ted Kremenek <kremenek@apple.com> Add IBAction attribute to keep the IBOutlet attribute company.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
221ffa76a5265603da1294954a7a0f3486cb86dd 17-Feb-2010 Tanya Lattner <tonic@nondot.org> Fix unused function warning to handle used attributes and redeclarations. Update test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96444 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
12ead498c4bc279472b21d446bfccec0f654779e 17-Feb-2010 Tanya Lattner <tonic@nondot.org> Fix unused function warning to handle used attributes and redeclarations. Update test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96444 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
19f7e7d1e7e4bf7a26d46c9278b05f83fdc67ccc 17-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST importing and checking for Objective-C method declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96442 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c3f2d2bb839593eed8861bce14228df0faf7b6c0 17-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST importing and checking for Objective-C method declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96442 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
dfac6238822b929afbc4c8e3c05b9b9ee0272cd9 17-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST importing of Objective-C instance variables.
Check superclasses when merging two Objective-C @interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96420 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
2e55e3af2f6d6c0509495357fade95105dd144cd 17-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST importing of Objective-C instance variables.
Check superclasses when merging two Objective-C @interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96420 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
56c054e27cc00e53824a40e83297f3e4382ca324 16-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new kind of failed result for isLvalue/isModifiableLvalue
which describes temporary objects of class type in C++. Use this to
provide a more-specific, remappable diagnostic when takin the address
of such a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96396 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e873fb74219f48407ae0b8fa083aa7f0b6ff1427 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Introduce a new kind of failed result for isLvalue/isModifiableLvalue
which describes temporary objects of class type in C++. Use this to
provide a more-specific, remappable diagnostic when takin the address
of such a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96396 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
971c9348cec3345b58b448a9bf6b836612d331d4 16-Feb-2010 John McCall <rjmccall@apple.com> White-list comma expressions with the literal 0 as their RHS against
unused-value warnings. This is a common macro idiom.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96326 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bf0ee354163f87623a4b60412544243911332343 16-Feb-2010 John McCall <rjmccall@apple.com> White-list comma expressions with the literal 0 as their RHS against
unused-value warnings. This is a common macro idiom.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96326 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d7757931fd2f6fb2dc272e3cde0f2251c392e1ed 16-Feb-2010 John McCall <rjmccall@apple.com> Make the various type-decl Types (and their associated ASTContext routines)
accept const decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96325 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
19c8576b7328f4dc2d07682f5da552875c1912ef 16-Feb-2010 John McCall <rjmccall@apple.com> Make the various type-decl Types (and their associated ASTContext routines)
accept const decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96325 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
8fbfa85d82363455c17d374e028b5f6217f0a40f 16-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Skeleton for importing Objective-C classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96306 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
a12d294db5bd59cd8836b9bd0dafadaaa2e3dd8a 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Skeleton for importing Objective-C classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96306 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c94fe413f94a42971eb8a23a00ac7c5c38b0bef3 16-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Cope with anonymous tags defined within declarators by structurally
comparing their types under the assumption that they are equivalent,
rather than importing the types and then checking for compatibility. A
few minor tweaks here:
- Teach structural matching to handle compatibility between
function types with prototypes and those without prototypes.
- Teach structural matching that an incomplete record decl is the
same as any other record decl with the same name.
- Keep track of pairs of declarations that we have already checked
(but failed to find as structurally matching), so we don't emit
diagnostics repeatedly.
- When importing a typedef of an anonymous tag, be sure to link the
imported tag type to its typedef.

With these changes, we survive a repeated import of <stdlib.h> and
<stdio.h>. Alas, the ASTNodeImporter is getting a little grotty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96298 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ea35d11905f756ad33b87bd89cd3ac1e7ce57994 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Cope with anonymous tags defined within declarators by structurally
comparing their types under the assumption that they are equivalent,
rather than importing the types and then checking for compatibility. A
few minor tweaks here:
- Teach structural matching to handle compatibility between
function types with prototypes and those without prototypes.
- Teach structural matching that an incomplete record decl is the
same as any other record decl with the same name.
- Keep track of pairs of declarations that we have already checked
(but failed to find as structurally matching), so we don't emit
diagnostics repeatedly.
- When importing a typedef of an anonymous tag, be sure to link the
imported tag type to its typedef.

With these changes, we survive a repeated import of <stdlib.h> and
<stdio.h>. Alas, the ASTNodeImporter is getting a little grotty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96298 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f584f2392641e1ef754c17a46f2e52334ebbf545 15-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Reimplement the structural-equality checks used to determine whether
two types in different AST contexts are equivalent. Rather than
transforming the type from one context into the other context, we
perform a deep structural comparison of the types. This change
addresses a serious problem with recursive data types like

struct ListNode {
int value;
struct ListNode *Next;
} xList;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96278 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
73dc30b71e218ba2b776b10d07dc2aff09cb2c47 15-Feb-2010 Douglas Gregor <dgregor@apple.com> Reimplement the structural-equality checks used to determine whether
two types in different AST contexts are equivalent. Rather than
transforming the type from one context into the other context, we
perform a deep structural comparison of the types. This change
addresses a serious problem with recursive data types like

struct ListNode {
int value;
struct ListNode *Next;
} xList;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96278 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
76a5c369ed6ab5f15886a6258371994eaea96c0c 15-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Class continuation now has its own property ast for
those declared in it. This is to allow duplicate
property diagnostics for properties declared in class extensions
multiple times (radar 7629420) and for future use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96276 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
25760611365be23556b32332f8a66ae21ea93ecf 15-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Class continuation now has its own property ast for
those declared in it. This is to allow duplicate
property diagnostics for properties declared in class extensions
multiple times (radar 7629420) and for future use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96276 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
5af9394b0b2e7a7af18c43d183cdd7b4eb8a37da 15-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify code. If we can reach here, the base must be virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96211 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
94ba380b820cde3fb9d97d5f07ac709ebbb6ac1e 15-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify code. If we can reach here, the base must be virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96211 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a15d447d289b822f10edb3ff2c52932d62104ee5 13-Feb-2010 Daniel Dunbar <daniel@zuster.org> Add newline.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96116 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
af667588d53de22795c5304f1496ccaac2a71402 13-Feb-2010 Daniel Dunbar <daniel@zuster.org> Add newline.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96116 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
ceeffb036421ad7fd6f361e64d03bf8d0b0caffa 13-Feb-2010 John McCall <rjmccall@apple.com> Switch the standard DeclarationName comparator to be a tri-valued comparator.
Use that while fixing a nasty misuse of qsort in vtable codegen which, somehow,
has not actually caused a crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96062 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
7fe0b9ea2c8137c035402e6ea01dfdfbc93214cb 13-Feb-2010 John McCall <rjmccall@apple.com> Switch the standard DeclarationName comparator to be a tri-valued comparator.
Use that while fixing a nasty misuse of qsort in vtable codegen which, somehow,
has not actually caused a crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96062 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
c278833b8c6df0010f402942ed561fa3c1e00c78 13-Feb-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6274: teach constant folding to evaluate __builtin_expect.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96054 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c4a2638b5ef3e2d35d872614ceb655a7a22c58be 13-Feb-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6274: teach constant folding to evaluate __builtin_expect.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96054 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5d9b06134bd92acf490bb57ec8d0613df10cf511 13-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Funnel changes to the ImportedDecls list in the ASTImporter through a
single Imported function, in preparation for fixing a serious design
flaw.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96044 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5ce5dab3c30e4255b8f62b148b6a86f09a444aaa 13-Feb-2010 Douglas Gregor <dgregor@apple.com> Funnel changes to the ImportedDecls list in the ASTImporter through a
single Imported function, in preparation for fixing a serious design
flaw.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96044 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
494ab3167ba14e70c84a2e6e7a7f387a9217872d 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST importing and merging for enumeration types and
enumerators, along with ImplicitCastExprs to make it work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96024 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
36ead2e992abb30aa3b4a40b4c8cb22cc9389fef 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST importing and merging for enumeration types and
enumerators, along with ImplicitCastExprs to make it work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96024 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f5cdb74e02596bf4d902c2cb7dffcc06548498e6 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Don't error when setting a sub-structure variable via objc properties
in objective-c++ mode (do it for objective-c only).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96012 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2d901df3940ec1e63a0f9e846f5db3152698b6fb 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Don't error when setting a sub-structure variable via objc properties
in objective-c++ mode (do it for objective-c only).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96012 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
56ca04563c38d5c7d4e3b1c4fac6d14cc30ad3fa 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810.
(Also removes a FIXME).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96003 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
432a8893f7e30d141d7f279bd00b741a3cdac81f 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810.
(Also removes a FIXME).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96003 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9038077f3e207d63a2a943f1aef18e29430218a3 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Simplify incomplete-array merging code in the AST importer, thanks to
Daniel's suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95987 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
d014542e1c6710d2c230b65b0cfcb8302a596b21 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Simplify incomplete-array merging code in the AST importer, thanks to
Daniel's suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95987 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
1db06c74927825d54dc5074ee43276d6f3277cdc 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a latent bug found by Ahmed Charles, where we were calling
ASTContext::getFunctionType with the wrong set of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95986 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1bf40248e3f0d743df77b5b44dbff72c235cbf20 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Fix a latent bug found by Ahmed Charles, where we were calling
ASTContext::getFunctionType with the wrong set of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95986 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cfa5385fc4589194e929d63b8185339a393b1b18 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Handle AST merges of incomplete class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95941 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
e72b5dc556805ea4c91f0ae6d8f8404fc341b687 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Handle AST merges of incomplete class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95941 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
4fc71f8b92264f2d119bb2d28b1d42649aaf20f8 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix leak in CXXNewExpr where the SubExprs array would get allocated directly using 'new[]' instead of the allocator associated with ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95933 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ad7fe864862305c2f71e047cdf6706ef43aebdc0 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix leak in CXXNewExpr where the SubExprs array would get allocated directly using 'new[]' instead of the allocator associated with ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95933 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2e3f7d3a78a8d63791b7af1e33d4c16b5bd38037 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95931 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
e2f769b5c20e7e26ba1f76612ac524853fd095c6 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95931 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
e6d8816efc582dc04cf793e78dc9be2d4b81cf3d 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95930 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
eb3b324800598cc3d5385fbad95ae5cff2c79113 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95930 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
984a375f11d74480963146861d78b2396ca7ed9a 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> When AST merging for record declarations fails, warn about the
incompatibility and show where the structural differences are. For
example:

struct1.c:36:8: warning: type 'struct S7' has incompatible definitions
in different translation units
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here
struct S7 { int i : 8; unsigned j : 16; } x7;
^

There are a few changes to make this work:
- ASTImporter now has only a single Diagnostic object, not multiple
diagnostic objects. Otherwise, having a warning/error printed via
one Diagnostic and its note printed on the other Diagnostic could
cause the note to be suppressed.
- Implemented import functionality for IntegerLiteral (along with
general support for statements and expressions)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95900 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
4800d95d28b20eca5d57c108ae3d2e6e312c1182 11-Feb-2010 Douglas Gregor <dgregor@apple.com> When AST merging for record declarations fails, warn about the
incompatibility and show where the structural differences are. For
example:

struct1.c:36:8: warning: type 'struct S7' has incompatible definitions
in different translation units
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here
struct S7 { int i : 8; unsigned j : 16; } x7;
^

There are a few changes to make this work:
- ASTImporter now has only a single Diagnostic object, not multiple
diagnostic objects. Otherwise, having a warning/error printed via
one Diagnostic and its note printed on the other Diagnostic could
cause the note to be suppressed.
- Implemented import functionality for IntegerLiteral (along with
general support for statements and expressions)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95900 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c0c30b203cd1e17a8688d3719e3ac7400f758709 11-Feb-2010 Anders Carlsson <andersca@mac.com> More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95887 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
848fa64143fbe5ae62a601ad61277f741e54dfab 11-Feb-2010 Anders Carlsson <andersca@mac.com> More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95887 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
64474f20248057f0c7cd6e2332811ce32e502d5a 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Use the allocator associated with ASTContext to allocate the args
array associated with NonNullAttr. This fixes yet another leak when
ASTContext uses a BumpPtrAllocator.

Fixes: <rdar://problem/7637150>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95863 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
5961611172f1c210fbbaa55b3c692e13b1fc7be4 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Use the allocator associated with ASTContext to allocate the args
array associated with NonNullAttr. This fixes yet another leak when
ASTContext uses a BumpPtrAllocator.

Fixes: <rdar://problem/7637150>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95863 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
2e7e2138cf03a0b0a0c3ae6da773ff138ce39e17 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) by
storing the set of StoredDeclsMaps in an internal vector of void*.
This isn't an ideal solution, but for the time being this fixes a
major memory leak with these DenseMaps not being freed.

Fixes: <rdar://problem/7634755>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95861 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
3478eb6872d836600caf45b0f81c2065d685d6e0 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) by
storing the set of StoredDeclsMaps in an internal vector of void*.
This isn't an ideal solution, but for the time being this fixes a
major memory leak with these DenseMaps not being freed.

Fixes: <rdar://problem/7634755>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95861 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
222ea5b36692d59f7feab62ea52b4c698514a27f 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ecl.cpp
3d2c43e9a7ca55f5ddc1f0c77d8f5e5ea7c1b573 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ecl.cpp
cb88a1522340ce77e45991250b8599bbc9f92dbf 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Remove another redundant ASTContext parameter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95843 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
2d5b70386d6f5553b667b6e407ca781b4ca2009e 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Remove another redundant ASTContext parameter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95843 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
eclCXX.cpp
47bedd03ccebfcf7f6156aed64ef45a9e6318145 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
838db383b69b9fb55f55c8e9546477df198a4faa 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
ecl.cpp
d00b532ca61c8efe030a58d5fa57e47446154223 11-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose when user provided getter is being used as lvalue
using property dot-syntax. Fixes radar 7628953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95838 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e9ff443040cb571ae2c5c2626c4dc9a9a812d84a 11-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose when user provided getter is being used as lvalue
using property dot-syntax. Fixes radar 7628953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95838 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0953831bd17a3ec879d4ddbbf33cbb2c67560fb0 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95836 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
XXInheritance.cpp
ecl.cpp
952b017601f9c82b51119c3a1600f1312a833db9 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95836 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
STImporter.cpp
XXInheritance.cpp
ecl.cpp
fd55fad6f8d0b82717f86d9b9fe5a346864ca30a 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic AST merging for classes, structs, and unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95833 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
96a01b4acf76fb8fe1e05341a97a27b39fb0b914 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement basic AST merging for classes, structs, and unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95833 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
0e99a69f84925542bb6620d4c196bcec6e2f1467 11-Feb-2010 Charles Davis <cdavis@mines.edu> Add support for the force_align_arg_pointer attribute. This is an x86-specific
attribute, so it uses Anton's new target-specific attribute support. It's
supposed to ensure that the stack is 16-byte aligned, but since necessary
support is lacking from LLVM, this is a no-op for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95820 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
5a0164d6ab843ca61437ec59a504365cb1c98f43 11-Feb-2010 Charles Davis <cdavis@mines.edu> Add support for the force_align_arg_pointer attribute. This is an x86-specific
attribute, so it uses Anton's new target-specific attribute support. It's
supposed to ensure that the stack is 16-byte aligned, but since necessary
support is lacking from LLVM, this is a no-op for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95820 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
ad4bef3001beb21e6c4df7346343854399270e99 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Move TypedefDecl importer to match the ordering in DeclNodes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95805 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
9e5d996444e40fdf5cce44ee82bec0d4e3df3d56 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Move TypedefDecl importer to match the ordering in DeclNodes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95805 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
52e5cd68aae0ef2f85da925e5e3f49a3641ea997 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic support for merging function declarations across
translation units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95794 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
a404ea673cbee5e74af710a5f1ab571e71580b67 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for merging function declarations across
translation units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95794 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
f8fd82ba49827db0f6a6ba00c55a7b56b12a19fa 10-Feb-2010 Shih-wei Liao <sliao@google.com> Check in LLVM r95781.
PValue.cpp
STConsumer.cpp
STContext.cpp
STDiagnostic.cpp
STImporter.cpp
ttrImpl.cpp
MakeLists.txt
XXInheritance.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclGroup.cpp
eclObjC.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
ullExpr.cpp
nheritViz.cpp
akefile
estedNameSpecifier.cpp
arentMap.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtProfile.cpp
tmtViz.cpp
emplateBase.cpp
emplateName.cpp
ype.cpp
ypeLoc.cpp
ypePrinter.cpp
835388f96300e636c310d406f996b8833dc074c9 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement AST importing and merging for typedefs. As part of this, provide a lame implementation for importing TypeSourceInfos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95783 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
82fc4bfa6f8ea35488b9038dd83d40766c3645cf 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement AST importing and merging for typedefs. As part of this, provide a lame implementation for importing TypeSourceInfos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95783 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
30b9d7de0c5c0a25bbb051022f3e296d5692c82e 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Teach AST merging that variables with incomplete array types can be
merged with variables of constant array types. Also, make sure that we
call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has
a LangOptions to work with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95782 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
0f962a8e61e1c094a89df17f9d3ad947d31c4e5c 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Teach AST merging that variables with incomplete array types can be
merged with variables of constant array types. Also, make sure that we
call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has
a LangOptions to work with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95782 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b29a303b4c641fba17d2a25aefce44049bd10a1e 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Reverse a partial fix patch for radar 7214820. It broke some code and
I don't have time to refix it for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95733 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6de8b62ae42818c0bd8878b0d1900e17c7c43e0e 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Reverse a partial fix patch for radar 7214820. It broke some code and
I don't have time to refix it for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95733 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f9646bbcd669c6afc2c2b0a630793d39a2c896f6 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic support for importing source locations from one AST
into another AST, including their include history. Here's an example
error that involves a conflict merging a variable with different types
in two translation units (diagnosed in the third AST context into
which everything is merged).

/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5:
error: external variable 'x2' declared with incompatible types in
different translation units ('int' vs. 'double')
int x2;
^
In file included from
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3:
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8:
note: declared here with type 'double'
double x2;
^

Although we maintain include history, we do not maintain macro
instantiation history across a merge. Instead, we map down to the
spelling location (for now!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95732 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
885237354fd902998c6ae9d7cc3dc8de96b123dc 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for importing source locations from one AST
into another AST, including their include history. Here's an example
error that involves a conflict merging a variable with different types
in two translation units (diagnosed in the third AST context into
which everything is merged).

/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5:
error: external variable 'x2' declared with incompatible types in
different translation units ('int' vs. 'double')
int x2;
^
In file included from
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3:
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8:
note: declared here with type 'double'
double x2;
^

Although we maintain include history, we do not maintain macro
instantiation history across a merge. Instead, we map down to the
spelling location (for now!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95732 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
5716d5e3feaf4919942d97ec46e2130913bf6b4f 09-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Complain about types and declarations that we don't know how to import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95706 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
89cc9d6e2aaf794fbd2c228a3755c19062ca0ba0 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Complain about types and declarations that we don't know how to import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95706 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
545667c28edd700756332a08bb59b8b7cbd385c1 09-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Move the diagnostic argument formatting function out of Sema and make
it available within the AST library, of which Sema is one client. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95701 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
MakeLists.txt
79a9a3417929e340e84dcbc06ed9c3a277cad959 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Move the diagnostic argument formatting function out of Sema and make
it available within the AST library, of which Sema is one client. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95701 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.cpp
MakeLists.txt
49216b909765ac03a39829b9e60b1e3c601f3342 09-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95683 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
9bed8798964d9f07599c2c9199701f86fbc70e20 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95683 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c09415f37710ed7d38d9fc7914c9f6a298f5614f 09-Feb-2010 John McCall <rjmccall@apple.com> Reset the found-virtual-base state unless the *current* base produces a path,
not *any* base up to now has produced a path. Fixes PR 6254.

I'll do the access-control part of this patch RSN.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95638 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
ed814cc4cd2bd4d32cbb4bfde3cc59ccae723a92 09-Feb-2010 John McCall <rjmccall@apple.com> Reset the found-virtual-base state unless the *current* base produces a path,
not *any* base up to now has produced a path. Fixes PR 6254.

I'll do the access-control part of this patch RSN.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95638 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
1b60285d38b1d9c443b897cf42d85a7cfee54309 08-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate a pointer of storage in each ObjCInterfaceType and
ObjCObjectPointerType AST node by allocating the list of protocols
after the type node itself. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
fd6a0887a099256c35a5b23e9afd517ffe95fa0a 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate a pointer of storage in each ObjCInterfaceType and
ObjCObjectPointerType AST node by allocating the list of protocols
after the type node itself. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
e4dca7ffe0e2ad8462c66386f7456b6c760453e9 08-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Merge block/function pointer types with objc's __weak
attribute properly and avoid bogus warning. This is
an objective-c fix only. objective-c++ follows different code
pass and requires separate fix (which will come at a later time).
Fixes radar 7214820.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95571 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
15ced59e27cdc4c4978b9422ca5f8805f7f64b64 08-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Merge block/function pointer types with objc's __weak
attribute properly and avoid bogus warning. This is
an objective-c fix only. objective-c++ follows different code
pass and requires separate fix (which will come at a later time).
Fixes radar 7214820.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95571 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7e8004acc5e6861e1b0f35c3fb1984754036a156 08-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic importing and merging of variable declarations within
the AST importer. This doesn't actually do anything (yet), because we
don't have driver logic for merging ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95570 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
089459a16bf7e9cd10617d1fac5ec0240a0a1ee6 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement basic importing and merging of variable declarations within
the AST importer. This doesn't actually do anything (yet), because we
don't have driver logic for merging ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95570 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
b05e4a517ecf1d95f0ec7d18185e598ed9b17348 08-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Ensure that a operator delete overload is rocognized regardless of cv-quals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95553 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e228ba97c9aff14dcf788773b8af455b9d85f210 08-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Ensure that a operator delete overload is rocognized regardless of cv-quals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95553 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
24f033a685022615f7529fe8dafe4d71ad45c5dd 08-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Cache imported types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95543 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
169fba50da76d71723cd1d91629cabb310f8bf9e 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Cache imported types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95543 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
c743f352128875749c12d1bb6e806a0388720eb0 06-Feb-2010 John McCall <rjmccall@apple.com> Per discussion, remove the explicit restriction on static const data members with
out-of-line initializers as integer constant expressions. Fixes PR6206.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95463 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1f1b3b3bdec84e2204f18732e3241f6907a17309 06-Feb-2010 John McCall <rjmccall@apple.com> Per discussion, remove the explicit restriction on static const data members with
out-of-line initializers as integer constant expressions. Fixes PR6206.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95463 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ad760b38613b3f7f1024b011f6109bed1487b32e 05-Feb-2010 John McCall <rjmccall@apple.com> Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95436 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
04a67a6aa3dfdc92d57f7f8d93ba397348c868a4 05-Feb-2010 John McCall <rjmccall@apple.com> Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95436 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
0dfa56b5b0e2fb319d759dba8748419a5fa2a63a 05-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Initial skeleton of an AST "importer", which will take AST elements from
one context and import them into another context, merging them
according to language-specific rules. This is a skeleton. It doesn't
work, it isn't testable, but I want it in version control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95395 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
MakeLists.txt
1b2949d27ec72894dec017c330c0548af4bb2476 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Initial skeleton of an AST "importer", which will take AST elements from
one context and import them into another context, merging them
according to language-specific rules. This is a skeleton. It doesn't
work, it isn't testable, but I want it in version control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95395 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.cpp
MakeLists.txt
e9fdd8930642637f5121b3f227dc6a2331d73e1d 05-Feb-2010 John McCall <rjmccall@apple.com> Always start tag definitions before completing them. Assert same.

Fixes latent and not-so-latent objc++ and blocks++ bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95340 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
5cfa011e61e14e6f2e1659047d809706c0e4c6a3 05-Feb-2010 John McCall <rjmccall@apple.com> Always start tag definitions before completing them. Assert same.

Fixes latent and not-so-latent objc++ and blocks++ bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95340 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
438d00a23413bb5e63afa12a975fd2f2e6216293 05-Feb-2010 John Thompson <john.thompson.jtsoftware@gmail.com> First stage of adding AltiVec support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypePrinter.cpp
82287d19ded35248c4ce6a425ce74116a13ce44e 05-Feb-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> First stage of adding AltiVec support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypePrinter.cpp
ff48492bf0bafea3cc3f549bad578259ccc67a81 04-Feb-2010 John McCall <rjmccall@apple.com> Extract a common structure for holding information about the definition
of a C++ record. Exposed a lot of problems where various routines were
silently doing The Wrong Thing (or The Acceptable Thing in The Wrong Order)
when presented with a non-definition. Also cuts down on memory usage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95330 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
86ff308724171494395a840fd2efbe25e62f352e 04-Feb-2010 John McCall <rjmccall@apple.com> Extract a common structure for holding information about the definition
of a C++ record. Exposed a lot of problems where various routines were
silently doing The Wrong Thing (or The Acceptable Thing in The Wrong Order)
when presented with a non-definition. Also cuts down on memory usage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95330 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
d7291a6a5877594febc49adb7f69cfb354d80516 04-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Fix an obscure crash found in the Boost.MPL test suite, along with a
ton of potential crashes of the same kind. The fundamental problem is
that type creation was following a dangerous pattern when using its
FoldingSets:
1) Use FindNodeOrInsertPos to see if the type is available
2) If not, and we aren't looking at a canonical type, build the
canonical type
3) Build and insert the new node into the FoldingSet

The problem here is that building the canonical type can, in very rare
circumstances, force the hash table inside the FoldingSet to
reallocate. That invalidates the insertion position we computed in
step 1, and in step 3 we end up inserting the new node into the wrong
place. BOOM!

I've audited all of ASTContext, fixing this problem everywhere I found
it. The vast majority of wrong code was C++-specific (and *ahem*
written by me), so I also audited other major folding sets in the C++
code (e.g., template specializations), but found no other instances of
this problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95315 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
789b1f640205e81b5af250693246120f1ce9d147 04-Feb-2010 Douglas Gregor <dgregor@apple.com> Fix an obscure crash found in the Boost.MPL test suite, along with a
ton of potential crashes of the same kind. The fundamental problem is
that type creation was following a dangerous pattern when using its
FoldingSets:
1) Use FindNodeOrInsertPos to see if the type is available
2) If not, and we aren't looking at a canonical type, build the
canonical type
3) Build and insert the new node into the FoldingSet

The problem here is that building the canonical type can, in very rare
circumstances, force the hash table inside the FoldingSet to
reallocate. That invalidates the insertion position we computed in
step 1, and in step 3 we end up inserting the new node into the wrong
place. BOOM!

I've audited all of ASTContext, fixing this problem everywhere I found
it. The vast majority of wrong code was C++-specific (and *ahem*
written by me), so I also audited other major folding sets in the C++
code (e.g., template specializations), but found no other instances of
this problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95315 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
db5993538c7f29ea7331dcb7292c083e1bab798c 04-Feb-2010 John McCall <rjmccall@apple.com> Allow calling convention attributes to apply to types. Patch by Chip Davis!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95291 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
f82b4e85b1219295cad4b5851b035575bc293010 04-Feb-2010 John McCall <rjmccall@apple.com> Allow calling convention attributes to apply to types. Patch by Chip Davis!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95291 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
21c79801767f2d7b22562a1f391c19c88d98ad14 03-Feb-2010 Anders Carlsson <andersca@mac.com> Don't try to fold DeclRefExprs that point to ParmVarDecls. This had the side-effect of always folding the expression to the default argument of the parameter. For example:

void f(int a = 10) {
return a;
}

would always return 10, regardless of the passed in argument.

This fixes another 600 test failures. We're now down to only 137 failures!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95262 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f6b6025a4e26bb0295a57e0efece73253038f278 03-Feb-2010 Anders Carlsson <andersca@mac.com> Don't try to fold DeclRefExprs that point to ParmVarDecls. This had the side-effect of always folding the expression to the default argument of the parameter. For example:

void f(int a = 10) {
return a;
}

would always return 10, regardless of the passed in argument.

This fixes another 600 test failures. We're now down to only 137 failures!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95262 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2e2e4bf788e3723a7646dae664808c541d9d4ded 03-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Define two types to be "compatible" in C++ if they are the same, and
remove some age-old FIXMEs and C++ workarounds within the
type-compatibility logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95249 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0e709abafbd939326850501f795cc7a92c88a354 03-Feb-2010 Douglas Gregor <dgregor@apple.com> Define two types to be "compatible" in C++ if they are the same, and
remove some age-old FIXMEs and C++ workarounds within the
type-compatibility logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95249 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a3af6913e8d3eef8e1fb5c42534a97702fb3bf98 03-Feb-2010 Daniel Dunbar <daniel@zuster.org> Revert "Numerous changes to selector handling:", this breaks a whole bunch of
working code, for no apparent reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95244 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6d5a1c28593443f3973ef38f8fa042d59182412d 03-Feb-2010 Daniel Dunbar <daniel@zuster.org> Revert "Numerous changes to selector handling:", this breaks a whole bunch of
working code, for no apparent reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95244 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a63467cd7a5cc108b6788f056dfc4c81df660a7c 03-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> When determining whether a function without a prototype is compatible
with a function with a prototype, treat parameters of enumeration type
based on the enumeration type's promotion type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95238 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b0f8eacfdcd0d43f51e669f2d723992d4af9f746 03-Feb-2010 Douglas Gregor <dgregor@apple.com> When determining whether a function without a prototype is compatible
with a function with a prototype, treat parameters of enumeration type
based on the enumeration type's promotion type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95238 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b93a009003f19418ef0ef0d8a42a3895562c7391 03-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> When a function or variable somehow depends on a type or declaration
that is in an anonymous namespace, give that function or variable
internal linkage.

This change models an oddity of the C++ standard, where names declared
in an anonymous namespace have external linkage but, because anonymous
namespace are really "uniquely-named" namespaces, the names cannot be
referenced from other translation units. That means that they have
external linkage for semantic analysis, but the only sensible
implementation for code generation is to give them internal
linkage. We now model this notion via the UniqueExternalLinkage
linkage type. There are several changes here:

- Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage
when the declaration is in an anonymous namespace.
- Added Type::getLinkage() to determine the linkage of a type, which
is defined as the minimum linkage of the types (when we're dealing
with a compound type that is not a struct/class/union).
- Extended NamedDecl::getLinkage() to consider the linkage of the
template arguments and template parameters of function template
specializations and class template specializations.
- Taught code generation to rely on NamedDecl::getLinkage() when
determining the linkage of variables and functions, also
considering the linkage of the types of those variables and
functions (C++ only). Map UniqueExternalLinkage to internal
linkage, taking out the explicit checks for
isInAnonymousNamespace().

This fixes much of PR5792, which, as discovered by Anders Carlsson, is
actually the reason behind the pass-manager assertion that causes the
majority of clang-on-clang regression test failures. With this fix,
Clang-built-Clang+LLVM passes 88% of its regression tests (up from
67%). The specific numbers are:

LLVM:
Expected Passes : 4006
Expected Failures : 32
Unsupported Tests : 40
Unexpected Failures: 736

Clang:
Expected Passes : 1903
Expected Failures : 14
Unexpected Failures: 75

Overall:
Expected Passes : 5909
Expected Failures : 46
Unsupported Tests : 40
Unexpected Failures: 811

Still to do:
- Improve testing
- Check whether we should allow the presence of types with
InternalLinkage (in addition to UniqueExternalLinkage) given
variables/functions internal linkage in C++, as mentioned in
PR5792.
- Determine how expensive the getLinkage() calls are in practice;
consider caching the result in NamedDecl.
- Assess the feasibility of Chris's idea in comment #1 of PR5792.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95216 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
0b6bc8bd7a1d2a7d7478d13d78cff94cacad61fc 03-Feb-2010 Douglas Gregor <dgregor@apple.com> When a function or variable somehow depends on a type or declaration
that is in an anonymous namespace, give that function or variable
internal linkage.

This change models an oddity of the C++ standard, where names declared
in an anonymous namespace have external linkage but, because anonymous
namespace are really "uniquely-named" namespaces, the names cannot be
referenced from other translation units. That means that they have
external linkage for semantic analysis, but the only sensible
implementation for code generation is to give them internal
linkage. We now model this notion via the UniqueExternalLinkage
linkage type. There are several changes here:

- Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage
when the declaration is in an anonymous namespace.
- Added Type::getLinkage() to determine the linkage of a type, which
is defined as the minimum linkage of the types (when we're dealing
with a compound type that is not a struct/class/union).
- Extended NamedDecl::getLinkage() to consider the linkage of the
template arguments and template parameters of function template
specializations and class template specializations.
- Taught code generation to rely on NamedDecl::getLinkage() when
determining the linkage of variables and functions, also
considering the linkage of the types of those variables and
functions (C++ only). Map UniqueExternalLinkage to internal
linkage, taking out the explicit checks for
isInAnonymousNamespace().

This fixes much of PR5792, which, as discovered by Anders Carlsson, is
actually the reason behind the pass-manager assertion that causes the
majority of clang-on-clang regression test failures. With this fix,
Clang-built-Clang+LLVM passes 88% of its regression tests (up from
67%). The specific numbers are:

LLVM:
Expected Passes : 4006
Expected Failures : 32
Unsupported Tests : 40
Unexpected Failures: 736

Clang:
Expected Passes : 1903
Expected Failures : 14
Unexpected Failures: 75

Overall:
Expected Passes : 5909
Expected Failures : 46
Unsupported Tests : 40
Unexpected Failures: 811

Still to do:
- Improve testing
- Check whether we should allow the presence of types with
InternalLinkage (in addition to UniqueExternalLinkage) given
variables/functions internal linkage in C++, as mentioned in
PR5792.
- Determine how expensive the getLinkage() calls are in practice;
consider caching the result in NamedDecl.
- Assess the feasibility of Chris's idea in comment #1 of PR5792.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95216 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ype.cpp
bc7aeabe736622530eabe68e1dfac51fd3e5f9dd 03-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Implement Doug's suggestion. Eliminate the Stmts pointer from CXXTryStmt and instead allocate the statements after the object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95199 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a1a396df16c02b22983b5c9592022fd9237d4866 03-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Implement Doug's suggestion. Eliminate the Stmts pointer from CXXTryStmt and instead allocate the statements after the object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95199 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f7752965429bab3b29c855b74b1f50f8b4e5b737 03-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Remove the SmallVector from CXXTryStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95190 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
b0e4cb6a88a4b4bd2ecdcc622e852fa3e20290c9 03-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Remove the SmallVector from CXXTryStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95190 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f1f1590dc4c3ddec947ce5b0c6d7c03c057fbea7 03-Feb-2010 David Chisnall <csdavec@swan.ac.uk> Numerous changes to selector handling:

- Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit.

- Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant.

- Recognise @selector() expressions as valid static initialisers (as GCC does).

- Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load.

- Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this:

- (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL)
withObject: (id)object;

Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes.

- Made @selector() expressions emit type info if available and the runtime supports it.

Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95189 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a8fa96e366ab36145a5500dd4fbea717c217f131 03-Feb-2010 David Chisnall <csdavec@swan.ac.uk> Numerous changes to selector handling:

- Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit.

- Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant.

- Recognise @selector() expressions as valid static initialisers (as GCC does).

- Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load.

- Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this:

- (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL)
withObject: (id)object;

Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes.

- Made @selector() expressions emit type info if available and the runtime supports it.

Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95189 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
19f36e292e6a6dabde1156d1aaa342cfa805ea8a 03-Feb-2010 John McCall <rjmccall@apple.com> Remove abstract expression kinds from the StmtClass enum. Update a few users
appropriately. Call out a few missing cases in the expression mangler.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95176 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
09cc141c89a5e9f305c17d7a88298647df16cedd 03-Feb-2010 John McCall <rjmccall@apple.com> Remove abstract expression kinds from the StmtClass enum. Update a few users
appropriately. Call out a few missing cases in the expression mangler.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95176 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
43ec96da71b94f064ed6a3031025208d23acd592 02-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement promotion for enumeration types.

WHAT!?!

It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.

In this commit:
- Enum types with a promotion type of "int" or "unsigned int" are
promotable.
- Tweaked the computation of promotable types for enums
- For all of the ABIs, treat enum types the same way as their
underlying types (*not* their promotion types) for argument passing
and return values
- Extend the ABI tester with support for enumeration types



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
aa74a1e49f7c4b89539830290f76fe2c3e97187f 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement promotion for enumeration types.

WHAT!?!

It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.

In this commit:
- Enum types with a promotion type of "int" or "unsigned int" are
promotable.
- Tweaked the computation of promotable types for enums
- For all of the ABIs, treat enum types the same way as their
underlying types (*not* their promotion types) for argument passing
and return values
- Extend the ABI tester with support for enumeration types



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d75026e7cc5af4b2f4e51b33080eb39d74d05e4e 02-Feb-2010 John McCall <rjmccall@apple.com> Dump the constructor type for a CXXConstructExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95106 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
d4bbdfebe9bd13defa977a934bf73fc2ce3b2817 02-Feb-2010 John McCall <rjmccall@apple.com> Dump the constructor type for a CXXConstructExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95106 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
6e11ea37fcfd3740522fc40b566ac2fbc60931c0 02-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a C++ regression where redefinitions weren't diagnosed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95096 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e2c52d29e483b4167bd5d8e3265c2fb7c38fbcd5 02-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a C++ regression where redefinitions weren't diagnosed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95096 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
573aed17ff75e0d159aa9623d556aa32c8d54c54 02-Feb-2010 John McCall <rjmccall@apple.com> Extract a common base class between UnresolvedLookupExpr and
UnresolvedMemberExpr and employ it in a few places where it's useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95072 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7bb12da2b0749eeebb21854c77877736969e59f2 02-Feb-2010 John McCall <rjmccall@apple.com> Extract a common base class between UnresolvedLookupExpr and
UnresolvedMemberExpr and employ it in a few places where it's useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95072 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
8cb23faaa8f07087e40d95432b575a810a4e1417 01-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94999 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
31310a21fb2a9f13950f864f681c86080b05d5b2 01-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94999 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
08fbf08fc4fc3816971556bad895d9c9d88966b7 31-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94968 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e9d12b6c50c1e9b05443db099e21026c5991a93b 31-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94968 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bbe7ff8e44e5a1dbf5e26c93afeb8eef479a2a54 31-Jan-2010 Anders Carlsson <andersca@mac.com> Diagnose binding a non-const reference to a vector element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94963 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
093802675b1548f2a5f44c29938d65cce00d58bb 31-Jan-2010 Anders Carlsson <andersca@mac.com> Diagnose binding a non-const reference to a vector element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94963 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e3129df6079a8e0028250d71a10b71dcf728d78a 31-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Rework base and member initialization in constructors, with several
(necessarily simultaneous) changes:

- CXXBaseOrMemberInitializer now contains only a single initializer
rather than a set of initialiation arguments + a constructor. The
single initializer covers all aspects of initialization, including
constructor calls as necessary but also cleanup of temporaries
created by the initializer (which we never handled
before!).

- Rework + simplify code generation for CXXBaseOrMemberInitializers,
since we can now just emit the initializer as an initializer.

- Switched base and member initialization over to the new
initialization code (InitializationSequence), so that it

- Improved diagnostics for the new initialization code when
initializing bases and members, to match the diagnostics produced
by the previous (special-purpose) code.

- Simplify the representation of type-checked constructor initializers in
templates; instead of keeping the fully-type-checked AST, which is
rather hard to undo at template instantiation time, throw away the
type-checked AST and store the raw expressions in the AST. This
simplifies instantiation, but loses a little but of information in
the AST.

- When type-checking implicit base or member initializers within a
dependent context, don't add the generated initializers into the
AST, because they'll look like they were explicit.

- Record in CXXConstructExpr when the constructor call is to
initialize a base class, so that CodeGen does not have to infer it
from context. This ensures that we call the right kind of
constructor.

There are also a few "opportunity" fixes here that were needed to not
regress, for example:

- Diagnose default-initialization of a const-qualified class that
does not have a user-declared default constructor. We had this
diagnostic specifically for bases and members, but missed it for
variables. That's fixed now.

- When defining the implicit constructors, destructor, and
copy-assignment operator, set the CurContext to that constructor
when we're defining the body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94952 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
xprCXX.cpp
9db7dbb918ca49f4ee6c181e4917e7b6ec547353 31-Jan-2010 Douglas Gregor <dgregor@apple.com> Rework base and member initialization in constructors, with several
(necessarily simultaneous) changes:

- CXXBaseOrMemberInitializer now contains only a single initializer
rather than a set of initialiation arguments + a constructor. The
single initializer covers all aspects of initialization, including
constructor calls as necessary but also cleanup of temporaries
created by the initializer (which we never handled
before!).

- Rework + simplify code generation for CXXBaseOrMemberInitializers,
since we can now just emit the initializer as an initializer.

- Switched base and member initialization over to the new
initialization code (InitializationSequence), so that it

- Improved diagnostics for the new initialization code when
initializing bases and members, to match the diagnostics produced
by the previous (special-purpose) code.

- Simplify the representation of type-checked constructor initializers in
templates; instead of keeping the fully-type-checked AST, which is
rather hard to undo at template instantiation time, throw away the
type-checked AST and store the raw expressions in the AST. This
simplifies instantiation, but loses a little but of information in
the AST.

- When type-checking implicit base or member initializers within a
dependent context, don't add the generated initializers into the
AST, because they'll look like they were explicit.

- Record in CXXConstructExpr when the constructor call is to
initialize a base class, so that CodeGen does not have to infer it
from context. This ensures that we call the right kind of
constructor.

There are also a few "opportunity" fixes here that were needed to not
regress, for example:

- Diagnose default-initialization of a const-qualified class that
does not have a user-declared default constructor. We had this
diagnostic specifically for bases and members, but missed it for
variables. That's fixed now.

- When defining the implicit constructors, destructor, and
copy-assignment operator, set the CurContext to that constructor
when we're defining the body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94952 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
xprCXX.cpp
91bf2808d35954720b487d7835aa4a1462d1af1b 31-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Try to unbreak MSVC build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94951 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a05315436746963c4034555ca725956507e14553 31-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Try to unbreak MSVC build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94951 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
537e0c99dbda2df6ebea04b3419bef3ba7af5a83 31-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR6156 and test several of the basic aspects of non-type template arguments
when implicitly supplied to the injected class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94948 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
b7de181d912690958e82c01f1b3d752d3d4ab43b 31-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR6156 and test several of the basic aspects of non-type template arguments
when implicitly supplied to the injected class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94948 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
e5a62222721fc93c69bf152c728e2a0a72094671 31-Jan-2010 Anders Carlsson <andersca@mac.com> Remove the SmallVectors from AsmStmt. Fixes PR6105.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94926 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
966146e89141804ff6492739a2a6e6592ca671c7 31-Jan-2010 Anders Carlsson <andersca@mac.com> Remove the SmallVectors from AsmStmt. Fixes PR6105.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94926 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
5f72946a2b22f3f6bb161381089af01377e811bd 30-Jan-2010 Anders Carlsson <andersca@mac.com> Use IdentifierInfo * instead of std::string for the AsmStmt names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94925 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
ff93dbd887e40588ed55d135037bb9287488b285 30-Jan-2010 Anders Carlsson <andersca@mac.com> Use IdentifierInfo * instead of std::string for the AsmStmt names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94925 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
ead8a0bc7adecff9a3fb33d8c782d1b65d209342 30-Jan-2010 Anders Carlsson <andersca@mac.com> Fix thinko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94922 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
95c9ce952dd90f0ef66660c905fe99c51b7e835d 30-Jan-2010 Anders Carlsson <andersca@mac.com> Fix thinko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94922 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f34045cd1957b33432ae2dfa2758ef4320f2ab9a 30-Jan-2010 Anders Carlsson <andersca@mac.com> Even more AsmStmt cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94921 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
acb6bcb442936f3c14126fdd473307c17647cb84 30-Jan-2010 Anders Carlsson <andersca@mac.com> Even more AsmStmt cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94921 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
3c0139ea8b51400424c97b36cd0413f0808eb2ad 30-Jan-2010 Anders Carlsson <andersca@mac.com> Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94918 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
fdba9c069023f686e2608affde02c82131ee1cf8 30-Jan-2010 Anders Carlsson <andersca@mac.com> Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94918 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
65e062564573a156ea409ade687dd7de6878fa46 30-Jan-2010 Anders Carlsson <andersca@mac.com> Add an assert to make sure that we don't try to mess with overridden methods for class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94907 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c076c450e4fdc7be27c8541b273451f28345044a 30-Jan-2010 Anders Carlsson <andersca@mac.com> Add an assert to make sure that we don't try to mess with overridden methods for class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94907 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8e97a38c31a2587f9cdcca5ec240883adb1c0888 29-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Fix reference binding of const lvalue references to bit-fields, which
requires a temporary. Previously, we were building an initialization
sequence that bound to the bit-field as if it were a real lvalue. Note
that we previously (and still) diagnose binding of non-const
references to bit-fields, as we should.

There's no real way to test that this code is correct, since reference
binding does not *currently* have any representation in the AST. This
fix should make it easier for that to happen, so I've verified this
fix with...

Added InitializationSequence::dump(), to print an initialization
sequence for debugging purposes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94826 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
de4b1d86bf48bc2a84bddf6b188f6da53eaea845 29-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix reference binding of const lvalue references to bit-fields, which
requires a temporary. Previously, we were building an initialization
sequence that bound to the bit-field as if it were a real lvalue. Note
that we previously (and still) diagnose binding of non-const
references to bit-fields, as we should.

There's no real way to test that this code is correct, since reference
binding does not *currently* have any representation in the AST. This
fix should make it easier for that to happen, so I've verified this
fix with...

Added InitializationSequence::dump(), to print an initialization
sequence for debugging purposes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94826 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9d995ff111efce46ec3b76316b1d97268e7fe2dc 29-Jan-2010 Anders Carlsson <andersca@mac.com> Add an CXXBindReferenceExpr (not used just yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94791 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
eb60edffa147e061278c436e513b0df9b4c4e7f6 29-Jan-2010 Anders Carlsson <andersca@mac.com> Add an CXXBindReferenceExpr (not used just yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94791 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
07c3d6914503af0fe4ab23fedfe848ff527f0e9d 27-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94681 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
8b752f10c394b140f9ef89e049cbad1a7676fc25 27-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94681 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
6994e1a96ebc69f63b92df433d30f578f3d92f1d 27-Jan-2010 John McCall <rjmccall@apple.com> Implement access control for overloaded functions. Suppress access control
diagnostics in "early" lookups, such as during typename checks and when building
unresolved lookup expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94647 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
c373d48502ca7683ab55385f5bd624d778eb288d 27-Jan-2010 John McCall <rjmccall@apple.com> Implement access control for overloaded functions. Suppress access control
diagnostics in "early" lookups, such as during typename checks and when building
unresolved lookup expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94647 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7d87b046af89a29ea0969851ed69aa5a9b96fa2a 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add 'volatile' to first argument of all
sync compare_and_swap to match them with gcc.
It also fixes a few incorrect argument defitions.
(fixes radar 7540291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94607 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
013af39d2a6a2e684f5a458c97890c52cddb7157 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add 'volatile' to first argument of all
sync compare_and_swap to match them with gcc.
It also fixes a few incorrect argument defitions.
(fixes radar 7540291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94607 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0b7e1ec48c061711034350ef7976339ae94dad80 26-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Bring some semblance of order into Decl.h and Decl.cpp. While at it, fix some typo comments and remove an unused and unimplemented function prototype. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94599 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7783bfc066776a63d6a2cd28329d4d149647bfdc 26-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Bring some semblance of order into Decl.h and Decl.cpp. While at it, fix some typo comments and remove an unused and unimplemented function prototype. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94599 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0374d5215df3e6ad58c227cf791dbf5dc420c02c 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Correct cut-and-paste error in doxygen comment for newly introduced
getTypeAlignInChars().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94553 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
16e20cce43385001f33f8e3f90ee345609c805d1 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Correct cut-and-paste error in doxygen comment for newly introduced
getTypeAlignInChars().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94553 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7aa70146e9cc0f441600426c3e926c9fbfb02283 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Add getTypeAlignInChars() for use in code that works in alignments in character
units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94552 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
86fa4311c8a330957ff5b765fbb0a7750ecd38c9 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Add getTypeAlignInChars() for use in code that works in alignments in character
units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94552 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f4b34a030729fff07d8a6501bfabbbd097c15045 24-Jan-2010 Chris Lattner <sabre@nondot.org> -fno-rtti is now the default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
0bb46d285cb2bb0f582d0935f58f57a9be8bf2cd 24-Jan-2010 Chris Lattner <sabre@nondot.org> -fno-rtti is now the default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
de344bdcfd849680f534721f8029e6afc58f869c 24-Jan-2010 Anders Carlsson <andersca@mac.com> Implement instantiation of AsmStmts (Crazy, I know)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94361 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
703e39486689d6660e75f6b6de0068db031a51c7 24-Jan-2010 Anders Carlsson <andersca@mac.com> Implement instantiation of AsmStmts (Crazy, I know)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94361 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
ee1ca8b4a4c64beb8384e54e69576a6b409a0d05 23-Jan-2010 David Chisnall <csdavec@swan.ac.uk> Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94274 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0d13f6fdbdd6f06e2449b8834dda53334abd399a 23-Jan-2010 David Chisnall <csdavec@swan.ac.uk> Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94274 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7db083f218f6dca7312610367675183343c91dd3 23-Jan-2010 John McCall <rjmccall@apple.com> Implement elementary access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94268 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
92f883177b162928a8e632e4e3b93fafd2b26072 23-Jan-2010 John McCall <rjmccall@apple.com> Implement elementary access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94268 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
5e163b4148a48be2fc8921bdb7a1cd86a09b6ad0 22-Jan-2010 Mike Stump <mrs@apple.com> Be sure to select primary bases among the nearly empties in preorder,
not just among the direct bases. Before we where missing nearly
empties that were bases of virtual base classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94208 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6ebee078ec83dbeb61abd95967ec385a15f6af91 22-Jan-2010 Mike Stump <mrs@apple.com> Be sure to select primary bases among the nearly empties in preorder,
not just among the direct bases. Before we where missing nearly
empties that were bases of virtual base classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94208 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
35ac8b42f9b300af9bd50e5efd8a3e80aed78dfa 22-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

Minor other tweaks needed to make this work:
- Extend Preprocessor::getLocForEndOfToken() to accept an offset
from the end, making it easy to move to the last character in the
token (rather than just past the end of the token).
- In Lexer::MeasureTokenLength(), the length of whitespace is zero.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94200 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
33e9abd21083a0191a7676a04b497006d2da184d 22-Jan-2010 Douglas Gregor <dgregor@apple.com> Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.

Minor other tweaks needed to make this work:
- Extend Preprocessor::getLocForEndOfToken() to accept an offset
from the end, making it easy to move to the last character in the
token (rather than just past the end of the token).
- In Lexer::MeasureTokenLength(), the length of whitespace is zero.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94200 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5ed791b2da3b283f9e414b9ce79db6db45c896ea 22-Jan-2010 John McCall <rjmccall@apple.com> Create function, block, and template parameters in the context of the
translation unit. This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts. This gives us the nice property that everything created
in a record DC should have access in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94122 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
7a9813ced7455b8a33a807489ca77a4f809c8a73 22-Jan-2010 John McCall <rjmccall@apple.com> Create function, block, and template parameters in the context of the
translation unit. This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts. This gives us the nice property that everything created
in a record DC should have access in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94122 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
39abeeb809b1c9cdd18d0d338aa8cbf71748d8d2 21-Jan-2010 Ted Kremenek <kremenek@apple.com> Allocate the 'Protocols' array in ObjCInterfaceType and
ObjCObjectPointerType using the allocator associated with ASTContext.
Not only does this fix a memory leak, but it also makes these arrays
BumpPtrAllocated (in the typical case).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94090 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
71842cc07aafdebc9b180322ebb46f530beca5d6 21-Jan-2010 Ted Kremenek <kremenek@apple.com> Allocate the 'Protocols' array in ObjCInterfaceType and
ObjCObjectPointerType using the allocator associated with ASTContext.
Not only does this fix a memory leak, but it also makes these arrays
BumpPtrAllocated (in the typical case).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94090 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
bf430198a91b6f352db12499d423464278fdb660 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to implement rewriting of properties.
Fixes radar 7562952.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d0502407c1b41b2ace326f355d7b7a6876246223 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to implement rewriting of properties.
Fixes radar 7562952.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2815dc14e57c57c7d6212be2687f5df937c451a3 20-Jan-2010 John McCall <rjmccall@apple.com> First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them.

Will actually consume this information soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
eclBase.cpp
46460a68f6508775e98c19b4bb8454bb471aac24 20-Jan-2010 John McCall <rjmccall@apple.com> First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them.

Will actually consume this information soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
eclBase.cpp
8d326ceb3e196f350b6a286f5ae3127ee10788e8 20-Jan-2010 John McCall <rjmccall@apple.com> Give UnresolvedSet the ability to store access specifiers for each declaration.
Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93959 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
xprCXX.cpp
eec51cf1ba5f0e62c9cdb81b5c63babdd6e649ab 20-Jan-2010 John McCall <rjmccall@apple.com> Give UnresolvedSet the ability to store access specifiers for each declaration.
Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93959 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
xprCXX.cpp
e50840f0e342a17dba0fbcdb309baa803bd6eded 19-Jan-2010 Eric Christopher <echristo@apple.com> Update and move around comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93942 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b2aaf51ed73a4774322a39a0dd59d0fe7e3258c0 19-Jan-2010 Eric Christopher <echristo@apple.com> Update and move around comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93942 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b1f3c5b6d59000378616b02f940292db99dfc6ce 18-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> float, double, and long double do need extra data in the
BuiltinTypeLoc structure. Thanks, Enea!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93763 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
d038f361d2b4368af7ab85bd04d5aafcc3ea649d 18-Jan-2010 Douglas Gregor <dgregor@apple.com> float, double, and long double do need extra data in the
BuiltinTypeLoc structure. Thanks, Enea!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93763 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
bc6fcc7a405e5d9caf60f0485f374446300bc3cf 18-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Improve source-location information for builtin TypeLocs, from Enea
Zaffanella (with a couple of my tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93733 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
ddf889a2ad2888f1dea573987bbe952d9912c1a0 18-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information for builtin TypeLocs, from Enea
Zaffanella (with a couple of my tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93733 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
31cc550280fe5c50d7f6ff57978ec083d284b53b 18-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Encoding calling conventions in the type system, from Charles Davis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ab8bbf4ebd3e3e6eab913cb044772a62b7581941 18-Jan-2010 Douglas Gregor <dgregor@apple.com> Encoding calling conventions in the type system, from Charles Davis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f658702f2cd01e7b648a7131cb00ff55bc371e9a 16-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> When we are instantiating a member function of a local class, be sure
to merge the local instantiation scope with the outer local
instantiation scope, so that we can instantiate declarations from the
function owning the local class. Fixes an assert while instantiating
Boost.MPL's BOOST_MPL_ASSERT_MSG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93651 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
79c2278a66d8fc0943774d1b7c71a32f7764e1e2 16-Jan-2010 Douglas Gregor <dgregor@apple.com> When we are instantiating a member function of a local class, be sure
to merge the local instantiation scope with the outer local
instantiation scope, so that we can instantiate declarations from the
function owning the local class. Fixes an assert while instantiating
Boost.MPL's BOOST_MPL_ASSERT_MSG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93651 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
efae5800004586a05ac2f6153e71771d6e7187fd 16-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.

The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93639 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3db211b617c5073aa70eb25d37ed44ae0dca17c4 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.

The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93639 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7158dd960d2b47b2f2ab7bf94fa1702ca2778cdd 16-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of the source locations for each protocol reference in
Objective-C classes, protocol definitions, forward protocol
declarations, and categories. This information isn't actually used
yet; that's coming next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93636 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
18df52bbb5d28ca082064d31ae7558dbdae52377 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Keep track of the source locations for each protocol reference in
Objective-C classes, protocol definitions, forward protocol
declarations, and categories. This information isn't actually used
yet; that's coming next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93636 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d1bebc82c31bc2b932114c34e3817ab5a589e5e9 15-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> When determining whether a DeclRefExpr is value-dependent when it
references a const variable of integral type, the initializer may be
in a different declaration than the one that name-lookup saw. Find the
initializer anyway. Fixes PR6045.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93514 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
501edb6a54524555ad27fbf41a7920dc756b08c6 15-Jan-2010 Douglas Gregor <dgregor@apple.com> When determining whether a DeclRefExpr is value-dependent when it
references a const variable of integral type, the initializer may be
in a different declaration than the one that name-lookup saw. Find the
initializer anyway. Fixes PR6045.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93514 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
710d1169e49242b6852b7e6611528917f2cb77ec 15-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Convert the type of the LValue offset variable in APValue to CharUnits, moving
the LValue-related methods of APValue out of line to avoid header file leaching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93512 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
a73058324197b7bdfd19307965954f626e26199d 15-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Convert the type of the LValue offset variable in APValue to CharUnits, moving
the LValue-related methods of APValue out of line to avoid header file leaching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93512 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xprConstant.cpp
d53936ede29c21c7f937368abec6eb6b7e4ca9f0 14-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> When qualified lookup into the current instantiation fails (because it
finds nothing), and the current instantiation has dependent base
classes, treat the qualified lookup as if it referred to an unknown
specialization. Fixes PR6031.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93433 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9edad9b6184c730a73dc9241c043ea3bae54189f 14-Jan-2010 Douglas Gregor <dgregor@apple.com> When qualified lookup into the current instantiation fails (because it
finds nothing), and the current instantiation has dependent base
classes, treat the qualified lookup as if it referred to an unknown
specialization. Fixes PR6031.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93433 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9b7ddcee05fc0121e6ab275b01c138cc50d75e2c 13-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewrite bug rewriting a block call argument which has a trvial
constructor. Fixes radar 7537770.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93358 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c75da518fde1f3b93643ac4e376ff2acd260facd 13-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewrite bug rewriting a block call argument which has a trvial
constructor. Fixes radar 7537770.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93358 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
6469dffc68a0b6fb195096b473763f3e1476b954 13-Jan-2010 John McCall <rjmccall@apple.com> Add type source information for both kinds of typeof types.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93344 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
cfb708c354e2f30ccc5cba9d644650f408a1ec3e 13-Jan-2010 John McCall <rjmccall@apple.com> Add type source information for both kinds of typeof types.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93344 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
23b70b8d8a7271402c433f023e3012717a03cc6b 13-Jan-2010 Sean Hunt <rideau3@gmail.com> Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93315 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclarationName.cpp
a6c058dd75c5563cced821fc16766a7cc179e00c 13-Jan-2010 Sean Hunt <rideau3@gmail.com> Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93315 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclarationName.cpp
8d1563a9c50fbde7ce7d4d79f21a6f9abc9a20e1 12-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Fix the CodeGen half of PR5911 by changing reference initialization to
correctly look through arrays to see cv-qualifiers. Also enhances the routine
for doing this to preserve more type sugaring for diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93252 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5535c38a2fcface6c13bc8bbeca66882de2fa227 12-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Fix the CodeGen half of PR5911 by changing reference initialization to
correctly look through arrays to see cv-qualifiers. Also enhances the routine
for doing this to preserve more type sugaring for diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93252 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
95a2734ce439ae19030278c66e8a8112781273e8 11-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a problem related to rewrite of anonymous unions.
(fixes radar 6948022)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93186 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
97fd83a8d827400afda3c5fba0840c1f10007239 11-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a problem related to rewrite of anonymous unions.
(fixes radar 6948022)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93186 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
7a5bd1189974bff4cc180f89bb444e9a5c1db545 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Change return type of getObjCEncodingTypeSize() to CharUnits as the units are in characters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93171 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa8741a1db98eef05f09b1200dba94aa5dc3bc3d 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Change return type of getObjCEncodingTypeSize() to CharUnits as the units are in characters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93171 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ba171099c6991c1bdc65631c7b89dc1ea746e786 11-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Implement name lookup for conversion function template specializations
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given

struct X { template<typename T> operator T*(); } x;

when we call

x.operator int*();

we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,

template<> X::operator float*() { /* ... */ }

and when calling or otherwise naming a conversion function (as in the
first example).

This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93162 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ypePrinter.cpp
48026d26fb58e413544874eead5491b1452e2ebf 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement name lookup for conversion function template specializations
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given

struct X { template<typename T> operator T*(); } x;

when we call

x.operator int*();

we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,

template<> X::operator float*() { /* ... */ }

and when calling or otherwise naming a conversion function (as in the
first example).

This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93162 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ypePrinter.cpp
549ba49e99494d17bcade748696f3f48384a46cb 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
0bb4d1988e810f9d2576e5ae92a1a2c8d91fec17 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Make clone() method out-of-line for Attr classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93120 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
MakeLists.txt
fc5d5133357e36b9b83edd7cd10080d783f19010 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Make clone() method out-of-line for Attr classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93120 91177308-0d34-0410-b5e6-96231b3b80d8
ttrImpl.cpp
MakeLists.txt
8ca761bc62a3749d80becb3e49dd54098c9079d3 07-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92867 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
319d57f21600dd2c4d52ccc27bd12ce260b174e7 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92867 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d1d512126e4c3f6090ef56bc15f91cc7c1239f31 06-Jan-2010 Mike Stump <mrs@apple.com> Fix spelling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92816 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1e5fd7f8e90e0953e5c59cbbbc130633d84a1e37 06-Jan-2010 Mike Stump <mrs@apple.com> Fix spelling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92816 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
274441d6d0e400c029074801e9de3c5d335c00bc 06-Jan-2010 John McCall <rjmccall@apple.com> Add Expr::EvaluateAsBooleanCondition(), which does unprincipled folding to
try to evaluate an expression as a constant boolean condition. This has
the same intended semantics as used in folding conditional operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92805 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cd7a445c6b46c5585580dfb652300c8483c0cb6b 06-Jan-2010 John McCall <rjmccall@apple.com> Add Expr::EvaluateAsBooleanCondition(), which does unprincipled folding to
try to evaluate an expression as a constant boolean condition. This has
the same intended semantics as used in folding conditional operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92805 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a32cdfb7f79b52f2f533002207b5262b6ba3e24e 05-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Improve key-function computation for templates. In particular:
- All classes can have a key function; templates don't change that.
non-template classes when computing the key function.
- We always mark all of the virtual member functions of class
template instantiations.
- The vtable for an instantiation of a class template has weak
linkage.

We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92753 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
bd6d6197fcfc98356ea60e816365eb0648b69556 05-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve key-function computation for templates. In particular:
- All classes can have a key function; templates don't change that.
non-template classes when computing the key function.
- We always mark all of the virtual member functions of class
template instantiations.
- The vtable for an instantiation of a class template has weak
linkage.

We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92753 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
4788fa9f8674f14ded9720c548c7d98b76b90eba 05-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Revert r92318. Instead fix the analyzer: do not call
ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92723 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5ea95fc163e9fb4fd7506b6a0c26decd67022943 05-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Revert r92318. Instead fix the analyzer: do not call
ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92723 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0794480f99e8bfbcc70d178422c3e8033719081c 05-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> if an arraytype is canonical, then its element is guaranteed to be canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c1ae0a8b0022a9fbb50d3413139f36ec5d8a63be 05-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> if an arraytype is canonical, then its element is guaranteed to be canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bf8cc88a863ad503648b9fc01ace1c1f8812c196 04-Jan-2010 Mike Stump <mrs@apple.com> Remember if the AsmStmt came from Microsoft-style inline assembly code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92526 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
3b11fd3b52e7b88233c602407c151d07cb093e75 04-Jan-2010 Mike Stump <mrs@apple.com> Remember if the AsmStmt came from Microsoft-style inline assembly code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92526 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
81bcc4ac937f901e9e94754122350ee673dce573 03-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> __builtin_object_size(ptr, type) returns -1 for type = {0,1} if there are any side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92453 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3f27b384801de26ce7efaa395699b42719372f24 03-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> __builtin_object_size(ptr, type) returns -1 for type = {0,1} if there are any side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92453 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
09eb7d3b0b638f14f570716b4e4e17a92695348a 30-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> The element type should also be canonicalized. Add a case for VariableArrayType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92318 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a8c6c448c9d3b09efdaf05023427bb8baafcc9dc 30-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> The element type should also be canonicalized. Add a case for VariableArrayType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92318 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e6cd706648aa42c1022d30c68e3b77f2a7a68a73 30-Dec-2009 John McCall <rjmccall@apple.com> Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92283 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5126fd0dd92c4ec211c837ee78d5ce59c68dcbd5 30-Dec-2009 John McCall <rjmccall@apple.com> Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92283 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
26f205b92434a4f2d857d2266f80e532981cd2dc 30-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure to explicitly pass type/value dependence to Expr constructor. This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92281 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2333f7727f97018d6742e1e0938133bcfad967ab 30-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure to explicitly pass type/value dependence to Expr constructor. This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92281 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8f36583a712cf7f8dd6d88712739572c4642629e 29-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.

This fixes several aspects of PR5542, but not all of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92248 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
28e318cc6008c2bc008f0caee70dc736a03d6289 29-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.

This fixes several aspects of PR5542, but not all of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92248 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
79f414435ef406f9fb3dc7733b93715ac6313425 29-Dec-2009 Anders Carlsson <andersca@mac.com> Get rid of FixedWidthIntType, as suggested by Chris and Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
f5f7d864f5067d1ea4bff7fcf41b53a43b7b48ba 29-Dec-2009 Anders Carlsson <andersca@mac.com> Get rid of FixedWidthIntType, as suggested by Chris and Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypePrinter.cpp
5e84148b95ffc48a61b2a1164d75f782d003fbd7 28-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Fix for PR5871. Make __PRETTY_FUNCTION__ work for member functions defined in a class local to a function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92200 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3521d01aed2f55b66c7ce2ad47541a9974079699 28-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Fix for PR5871. Make __PRETTY_FUNCTION__ work for member functions defined in a class local to a function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92200 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9eec813d2e60b4e9dc0c47c001ebefa629e3df21 27-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix PointerExprEvaluator::VisitCastExpr so it doesn't misfold C++ casts which
it doesn't know how to fold, like derived-to-base casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92173 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
09a8a0e6ec1252cad52666e9dbb21002b9c80f38 27-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix PointerExprEvaluator::VisitCastExpr so it doesn't misfold C++ casts which
it doesn't know how to fold, like derived-to-base casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92173 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
54c3bdb28cf113c94d7f7506f7932ccbfc3aac5d 27-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Fix for PR5872. Add static specifier and const/volatile qualifiers to member functions in __PRETTY_FUNCTION__ predefined expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92171 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4eadcc569223135e13353c9381b448986e3f7053 27-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Fix for PR5872. Add static specifier and const/volatile qualifiers to member functions in __PRETTY_FUNCTION__ predefined expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92171 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3cc4b35bacf2de5e7ac286b8d0ba949947dc8527 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
54d76db0aa7107597cac0b80d8e138a37e6d1de9 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
5afa2e34fbeeb13c1dc4ab566fdb06eb425ca123 25-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Fix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY_FUNCTION__ predefined expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92149 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6be112049b24ffaa8508646aa695834b4b5ca2b2 25-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Fix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY_FUNCTION__ predefined expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92149 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
75e8c707255745e44fb2da09feebeeaa5442fa72 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92115 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
6281213d87e71b76f64c4ca62fbe7a97f18ae0a0 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92115 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d3fff74aff2196ffc8149c0cd284b0de76aec623 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned by ForStmt to include the initializer of the condition variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92112 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f0d975f25b1d71612fcbd58ce8abbbc4532c6bb5 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned by ForStmt to include the initializer of the condition variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92112 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
40d9c798afe5da69537f8a2967a6ed3861d105e3 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Modify WhileStmt::child_begin()/child_end() to include the initializer for the condition variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92104 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
7d02b8c3be58676a03046eef9d056063e55ada3e 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Modify WhileStmt::child_begin()/child_end() to include the initializer for the condition variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92104 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
0b742a528b0ce0c51b9e91468b11d4e35cd3cd14 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Modify SwitchStmt::child_begin()/child_end() to include the initializer for the condition variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92100 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a3be0eaa5c253bbf1e4eb61b0a3a9c869b94aee9 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Modify SwitchStmt::child_begin()/child_end() to include the initializer for the condition variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92100 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
0b8d65bed5dbc84e88780ea7198bf99d9a4471f1 24-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> support the warn_unused_result in C++ class methods

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92095 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cb1c77f90d4e747b83a0d0cc125dc01567378f82 24-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> support the warn_unused_result in C++ class methods

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92095 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
30c9e46fd571f58d42ba8060ec5376318bf109ea 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add StmtIterator support for iterating over both the condition
variable initializer and the other expressions in an IfStmt.

This change required adding a 'DoDestroy()' method for IfStmt that did
not include destroying the initializer (since that is owned by the
VarDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92089 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtIterator.cpp
35628d1f17c817f8c240208db7ba490e3109981b 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add StmtIterator support for iterating over both the condition
variable initializer and the other expressions in an IfStmt.

This change required adding a 'DoDestroy()' method for IfStmt that did
not include destroying the initializer (since that is owned by the
VarDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92089 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtIterator.cpp
74ad412c8f5727a8108c46b25b7675e7005ecfbb 24-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> When we see a CXXDefaultArgExpr during template instantiation, rebuild
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92078 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
036aed18662e0193aafe0e8ae13d2e57efe6df25 24-Dec-2009 Douglas Gregor <dgregor@apple.com> When we see a CXXDefaultArgExpr during template instantiation, rebuild
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92078 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
67d5907ec238ceb55cdbd00895b92887bda91b63 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Increase StmtIterator size by one pointer (separating out the Stmt** from the union including Decl* and Decl**).
This change is setup for adding StmtIterator support for condition variables in IfStmt, WhileStmt, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92070 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
b03f630a5d4256220ac48a6f04b765c34c9e8993 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Increase StmtIterator size by one pointer (separating out the Stmt** from the union including Decl* and Decl**).
This change is setup for adding StmtIterator support for condition variables in IfStmt, WhileStmt, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92070 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
860811a1b5b2fbb1a6db11e9c468b0bc6f5003f2 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Tidy up ~ASTContext a bit by turning orphan compound statements into
for loops. Also do not manually free the Type objects when the
'FreeMemory' flag is set, as they will be deallocated when the
BumpPtrAllocator is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92047 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bbfd68dd5288c435cfd6aef1264263e5f856958d 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Tidy up ~ASTContext a bit by turning orphan compound statements into
for loops. Also do not manually free the Type objects when the
'FreeMemory' flag is set, as they will be deallocated when the
BumpPtrAllocator is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92047 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
918683ef98bf33c9526bacea7ca860cfc34589b3 23-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> When using a default function argument for a function template (or
member function thereof), perform the template instantiation each time
the default argument is needed. This ensures that
(1) We get different CXXTemporary objects for each instantiation, and
(2) Any other instantiations or definitions triggered by the
instantiation of the default argument expression are guaranteed to
happen; previously, they might have been suppressed, e.g., because
they happened in an unevaluated context.

This fixes the majority of PR5810. However, it does not address the
problem where we may have multiple uses of the same CXXTemporary
within an expression when the temporary came from a non-instantiated
default argument expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92015 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
65222e82d97af2120b3952d19cbd3cd923f4b43e 23-Dec-2009 Douglas Gregor <dgregor@apple.com> When using a default function argument for a function template (or
member function thereof), perform the template instantiation each time
the default argument is needed. This ensures that
(1) We get different CXXTemporary objects for each instantiation, and
(2) Any other instantiations or definitions triggered by the
instantiation of the default argument expression are guaranteed to
happen; previously, they might have been suppressed, e.g., because
they happened in an unevaluated context.

This fixes the majority of PR5810. However, it does not address the
problem where we may have multiple uses of the same CXXTemporary
within an expression when the temporary came from a non-instantiated
default argument expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92015 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ad1010d663754058b1fa43a0ebe47d27e195d661 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> move a few more symbols to .rodata/.data.rel.ro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
2550d70aabb5f603e8f74cc5fb6a69a7af5b51f3 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> move a few more symbols to .rodata/.data.rel.ro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
0e20d24cf8ee04e4eb616534fb09948b51a9aa96 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add 'DeclStmt::DoDestroy()' which doesn't actually recurse over its child expressions (via StmtIterator), as those expressions are owned by the Decls and Types (which are destroyed elsewhere). This fixes a crasher reported in <rdar://problem/7487294>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91990 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
tmt.cpp
e7809d49413febf078d0503753987fe9f6061a68 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add 'DeclStmt::DoDestroy()' which doesn't actually recurse over its child expressions (via StmtIterator), as those expressions are owned by the Decls and Types (which are destroyed elsewhere). This fixes a crasher reported in <rdar://problem/7487294>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91990 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
tmt.cpp
51088401ab6d3ffd6420163d51c4545e1be9a96d 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix CXXConstructExpr::getSourceRange() to not include the source ranges of CXXDefaultArgExprs when computing its range (since these expressions have no source range, and using them will make the encompassing range invalid).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91984 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
e383768f7f5d45ca4af0b1c11cbf072de18bce98 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix CXXConstructExpr::getSourceRange() to not include the source ranges of CXXDefaultArgExprs when computing its range (since these expressions have no source range, and using them will make the encompassing range invalid).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91984 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1de3142b329b55ac8682e8af4e639cf2827c976d 23-Dec-2009 Eric Christopher <echristo@apple.com> Update for the intrinsic changes in llvm: the object size intrinsic
only takes a boolean second argument now. Update tests accordingly.
Currently the builtin still accepts the full range for compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91983 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fee667f35e64751baa7fefe70b4e7bab06c8cd86 23-Dec-2009 Eric Christopher <echristo@apple.com> Update for the intrinsic changes in llvm: the object size intrinsic
only takes a boolean second argument now. Update tests accordingly.
Currently the builtin still accepts the full range for compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91983 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bf5d664fbba567d910833938ee01a1e6bf7ad6cf 23-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Remove CharUnits::toString() to eliminate dependence on <string>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91978 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
harUnits.cpp
775f2eb49116baeb0c97d2085fac30174e2ebd43 23-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Remove CharUnits::toString() to eliminate dependence on <string>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91978 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
harUnits.cpp
d2d3b515609587914cd5afc33c899b73492014d2 22-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
avoid #including CharUnits.h in ASTContext.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91903 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bdc601b196c48d4cd56a5ceb45d41ae4e87371ab 22-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
avoid #including CharUnits.h in ASTContext.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91903 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b94a110b0e81aad5bb0156e4bf55eed7adc9ff56 22-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9e9199d8649cf3e10c98a69403f05dbb666d8fb1 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8963a92688127e20554315c8a965734cf3318929 21-Dec-2009 Chris Lattner <sabre@nondot.org> indentation fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91807 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
caabf9bf331156e96dacb072385901fdfa057ec1 21-Dec-2009 Chris Lattner <sabre@nondot.org> indentation fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91807 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
86a7c7a112be801d31dd8a3989f5f0f8f731ab5d 21-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR4010: add support for the warn_unused_result for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d20254f2875d0004c57ee766f258dbcee29f4841 21-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR4010: add support for the warn_unused_result for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
16bfeb78c3d1b162052c3a55159a61468c346660 19-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> A CXXExprWithTemporaries expression is an lvalue if its subexpression
is an lvalue. Fixes PR5787.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91765 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2d48e7811216b2a2d15dcf7e4be8f73ad48cc60a 19-Dec-2009 Douglas Gregor <dgregor@apple.com> A CXXExprWithTemporaries expression is an lvalue if its subexpression
is an lvalue. Fixes PR5787.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91765 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
98a7ca63dc27a78ab274af09b2ccf0c80ea54a9a 19-Dec-2009 Chris Lattner <sabre@nondot.org> <string> already comes in from CharUnits.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91737 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.cpp
11b88eb5c345b166d5ba33496005118a04baf2cf 19-Dec-2009 Chris Lattner <sabre@nondot.org> <string> already comes in from CharUnits.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91737 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.cpp
aa38e98236bd7cf9df78d68b86a2d408ced4792e 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Add and tidy doxygen comments and move implementation of toString() to newly
created CharUnits.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91719 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
harUnits.cpp
c3c90b25cf321d851314f0f19f67e9a00df0da0d 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Add and tidy doxygen comments and move implementation of toString() to newly
created CharUnits.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91719 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
harUnits.cpp
e951d9cda8108d8f71a7b02154b4b7860e5d132e 18-Dec-2009 John McCall <rjmccall@apple.com> Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax. This proved remarkably easy to "fix" once
I settled on how I was going to approach it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91633 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e129d44aab6324aa2094d68730a7843c41a4e45f 18-Dec-2009 John McCall <rjmccall@apple.com> Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax. This proved remarkably easy to "fix" once
I settled on how I was going to approach it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91633 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
158df1c7b4604fbde219753ec23cd931ca1612f7 16-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91548 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
16006c901315fa12a108b4e571f187f4b676e426 16-Dec-2009 Douglas Gregor <dgregor@apple.com> When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91548 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
9ee8cfaddbea93d70d7edcbec4c77beee0b8553c 16-Dec-2009 Anders Carlsson <andersca@mac.com> More work on the FullExpr class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91513 91177308-0d34-0410-b5e6-96231b3b80d8
ullExpr.cpp
d4a0552ea56c934fc7d2072bf61802cafa8cfd13 16-Dec-2009 Anders Carlsson <andersca@mac.com> More work on the FullExpr class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91513 91177308-0d34-0410-b5e6-96231b3b80d8
ullExpr.cpp
10a2b23ef59f4e4de0172a0ebe8ceeb5bb027206 16-Dec-2009 Anders Carlsson <andersca@mac.com> Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action::FullExpr to Action::MakeFullExpr to avoid name clashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91494 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ullExpr.cpp
5ee56e95c3905d2e7bc403631b03865cdbdd8a42 16-Dec-2009 Anders Carlsson <andersca@mac.com> Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action::FullExpr to Action::MakeFullExpr to avoid name clashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91494 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ullExpr.cpp
afe90ebd9ce0079385245d72f893d2da32c3692b 16-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
99a2e600f9e2e51d3ce10fb6f27191677ac65b2a 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
16640d5b58859b171c052ce26c1b07dffcc702b4 16-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose attempting to assign to a sub-structure of an ivar
using objective-c property. (fixes radar 7449707)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91474 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2514a309204341798f96912ce7a90841bea59727 16-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose attempting to assign to a sub-structure of an ivar
using objective-c property. (fixes radar 7449707)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91474 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
aa43f81f2f155a0ed8d0c9dfce11eaec516b85a3 15-Dec-2009 Anders Carlsson <andersca@mac.com> ShouldDestroyTemporaries? I don't think so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtProfile.cpp
0ece491d8f62ce67f047491a6703fac0d3bd4ff4 15-Dec-2009 Anders Carlsson <andersca@mac.com> ShouldDestroyTemporaries? I don't think so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtProfile.cpp
b057a6b9f0891dc5de5e984bb8769301bee50ad6 15-Dec-2009 Anders Carlsson <andersca@mac.com> If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91439 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
337cba4b3e17b98cfa512dfd12e57f4ccb0859be 15-Dec-2009 Anders Carlsson <andersca@mac.com> If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91439 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
594e63b2e95faaee4e73a69edd2ac8c975d339a5 15-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Elaborated types are specifier types, based on a patch from Cornelius

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91431 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7c67395283dae28408138176cafec00c42987459 15-Dec-2009 Douglas Gregor <dgregor@apple.com> Elaborated types are specifier types, based on a patch from Cornelius

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91431 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
dcbf08f1765a91c8c902d453cd0850188f2638e1 14-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Improve template instantiation for object constructions in several ways:

- During instantiation, drop default arguments from constructor and
call expressions; they'll be recomputed anyway, and we don't want
to instantiate them twice.
- Rewrote the instantiation of variable initializers to cope with
non-dependent forms properly.

Together, these fix a handful of problems I introduced with the switch
to always rebuild expressions from the source code "as written."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91315 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6eef519fc8a97bb7ca6066f23d35e10f06b2c1b5 14-Dec-2009 Douglas Gregor <dgregor@apple.com> Improve template instantiation for object constructions in several ways:

- During instantiation, drop default arguments from constructor and
call expressions; they'll be recomputed anyway, and we don't want
to instantiate them twice.
- Rewrote the instantiation of variable initializers to cope with
non-dependent forms properly.

Together, these fix a handful of problems I introduced with the switch
to always rebuild expressions from the source code "as written."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91315 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
21164e4cbcd3ac1f8a80a2dcbebc8e08fc17cf23 14-Dec-2009 Anders Carlsson <andersca@mac.com> Rename dump to dumpDeclContext, so that call RD->dump() won't dump the decl context by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91256 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
84834432289a810e713f82f1ed94a99ad8a5c2ea 14-Dec-2009 Anders Carlsson <andersca@mac.com> Rename dump to dumpDeclContext, so that call RD->dump() won't dump the decl context by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91256 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
b053bff48230137a33fff2c871a27d72fe2b4bc2 13-Dec-2009 Anders Carlsson <andersca@mac.com> More improvements to checking allocation and deallocation functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91244 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
156c78e4ef14e5f7ba251554ea8f2dbec573fef3 13-Dec-2009 Anders Carlsson <andersca@mac.com> More improvements to checking allocation and deallocation functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91244 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9d02e7c5fa4e30ceb52a2956c0018ec41a5b6da0 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
9f61aa9e280adea9fbf3365f0e4f6ed568c9885a 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
4b779b3b686bbd883b8f9dc5c9eb7c263da58bfc 12-Dec-2009 Anders Carlsson <andersca@mac.com> Factor operator new declaration checking out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91189 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a3ccda58913cc1a4b8564e349448b12acc462da7 12-Dec-2009 Anders Carlsson <andersca@mac.com> Factor operator new declaration checking out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91189 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eb264b1e729713043c0921ef84559dac75af9fdc 11-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allow C-style cast from 'void *' to block pointer type.
(fixes radar 7465023).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91171 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3b27f1a80e4e433b503efd344c909eeafaa9033c 11-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allow C-style cast from 'void *' to block pointer type.
(fixes radar 7465023).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91171 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fe24cd494c4cb0204cd9ad4669595c8e87c87cea 11-Dec-2009 John McCall <rjmccall@apple.com> StmtDumper::VisitUnresolvedLookupExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91163 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
9d5f35e1124bbaa4a8944f7409478d45cb839de5 11-Dec-2009 John McCall <rjmccall@apple.com> StmtDumper::VisitUnresolvedLookupExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91163 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
e7c6ad00c2a108347af4f315f87397d716e959ec 11-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRef.getAsInteger instead of temporary string + strtol. No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91118 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
330358056acf05445273f4f4004dfd283a2ecc4d 11-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRef.getAsInteger instead of temporary string + strtol. No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91118 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5555f2e6ecd5a73c8fb08bdbed3b28d509213ab1 11-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a crash trying to access a category name in
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91081 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
737061fc2948776f941e1854a9bc6ebd070d9151 11-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a crash trying to access a category name in
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91081 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
95efe4d129a2e4ddefad90ac164700da1e6e9405 10-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Clean up enum constants so that they're finally sane. Fixes PR3173 and a
recently introduced crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91070 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
29a7f3342c3c6dd15d914c61ae22246c36d51ce7 10-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Clean up enum constants so that they're finally sane. Fixes PR3173 and a
recently introduced crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91070 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
9e1d5827a6feaf18cb72a9d8eca80645e2075528 10-Dec-2009 John McCall <rjmccall@apple.com> Implement redeclaration checking and hiding semantics for using declarations. There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not. In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9f54ad4381370c6b771424b53d219e661d6d6706 10-Dec-2009 John McCall <rjmccall@apple.com> Implement redeclaration checking and hiding semantics for using declarations. There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not. In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
fd665d27b26a1d6e0549b79df0bb433a0d356e76 10-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> spread 'const' love to some variables. this considerably reduces the amount of dirty data around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
68f7a2426227476bcfa33ada70b708c82419dfdc 10-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> spread 'const' love to some variables. this considerably reduces the amount of dirty data around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
99abc5f70b22a4b9ff6ea396f91cb1979732674d 10-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Code gen for ObjCIsaExpr AST used as lvalue.
(fixes radar 7457534).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90995 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
820bca41c3899374775d2a1dfc2ef2e22aaf1c7b 10-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Code gen for ObjCIsaExpr AST used as lvalue.
(fixes radar 7457534).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90995 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
da86f093507a7733ae955d7511b88f8bf4f61752 10-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
20093b4bf698f292c664676987541d5103b65b15 10-Dec-2009 Douglas Gregor <dgregor@apple.com> Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
232523601c62daf54c4b35597e953f5e91b2bb98 09-Dec-2009 Anders Carlsson <andersca@mac.com> Add DeclContext::dump.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90974 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
2b7d8ddc746a9096f8af4bd0d8b07eae523864b5 09-Dec-2009 Anders Carlsson <andersca@mac.com> Add DeclContext::dump.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90974 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
472f89244393933f55431259174d6e7ca14d44a6 09-Dec-2009 John McCall <rjmccall@apple.com> First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to. This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
842aef8d942a880eeb9535d40de31a86838264cb 09-Dec-2009 John McCall <rjmccall@apple.com> First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to. This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
db55000d28c6d4094bf42e88ad57e2e00ce57597 09-Dec-2009 Anders Carlsson <andersca@mac.com> In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than one heirarchy of classes. John, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90948 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
ca910e84ea026a898c7184d3f3608403005b9bc0 09-Dec-2009 Anders Carlsson <andersca@mac.com> In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than one heirarchy of classes. John, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90948 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
f649a723918ae081408f162b5786727cfddbdb51 09-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Implemented an implicit conversion from "noreturn" function types (and
pointers thereof) to their corresponding non-noreturn function
types. This conversion is considered an exact match for
overload-resolution purposes. Note that we are a little more strict
that GCC is, because we encode noreturn in the type system, but that's
a Good Thing (TM) because it does not allow us to pretend that
potentially-returning function pointers are non-returning function
pointers.

Fxies PR5620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90913 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
43c79c2b07abc7ba6d9f243b84ee6539de4d2652 09-Dec-2009 Douglas Gregor <dgregor@apple.com> Implemented an implicit conversion from "noreturn" function types (and
pointers thereof) to their corresponding non-noreturn function
types. This conversion is considered an exact match for
overload-resolution purposes. Note that we are a little more strict
that GCC is, because we encode noreturn in the type system, but that's
a Good Thing (TM) because it does not allow us to pretend that
potentially-returning function pointers are non-returning function
pointers.

Fxies PR5620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90913 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b40fd078725fb497ce5fcca8e20b73681b888bbd 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Added a missing case to a switch statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90902 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4cbf9d43cc47bb7a070c5c5026521d7d6a8f73c7 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Added a missing case to a switch statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90902 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8223ec2682ffd2046247550c495ec845a4820bc4 08-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for exception specifications. Also,
print exception specifications on function types and
declarations. Fixes <rdar://problem/7450999>.

There is some poor source-location information here, because we don't
track locations of the types in exception specifications. Filed PR5719.

Failures during template instantiation of the signature of a function
or function template have wrong point-of-instantiation location
information. I'll tackle that with a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ypePrinter.cpp
0ae7b3f1d5403265f693ed75384603ca8fbba74d 08-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for exception specifications. Also,
print exception specifications on function types and
declarations. Fixes <rdar://problem/7450999>.

There is some poor source-location information here, because we don't
track locations of the types in exception specifications. Filed PR5719.

Failures during template instantiation of the signature of a function
or function template have wrong point-of-instantiation location
information. I'll tackle that with a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ypePrinter.cpp
b85c1556de06cc741c9465e669cbe8c2c559ffde 08-Dec-2009 John McCall <rjmccall@apple.com> DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
dbd872f273a8dbf22e089b3def6c09f0a460965d 08-Dec-2009 John McCall <rjmccall@apple.com> DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
060ea1c5dcaf20098a60679c11274a32eb1f4c7d 08-Dec-2009 John McCall <rjmccall@apple.com> Add CXXRecordDecl::forallBases to walk an inheritance hierarchy with non-lookup
semantics and CXXRecordDecl::isProvablyNotDerivedFrom to assist with
pre-instantiation diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90842 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
e8174bc483615e79614d9284a50ac94831e8b7c6 08-Dec-2009 John McCall <rjmccall@apple.com> Add CXXRecordDecl::forallBases to walk an inheritance hierarchy with non-lookup
semantics and CXXRecordDecl::isProvablyNotDerivedFrom to assist with
pre-instantiation diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90842 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
62de4fc38bb2d7f733d638bf71112fb7f6113d0c 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5710: make sure to put function template specializations into the
DeclContext, so they don't completely disappear from the AST.

I don't particularly like this fix, but I don't see any obviously better way
to deal with it, and I think it's pretty clearly an improvement; comments
welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90835 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6bc20135a2c46f97da15994095616a305be35c6a 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5710: make sure to put function template specializations into the
DeclContext, so they don't completely disappear from the AST.

I don't particularly like this fix, but I don't see any obviously better way
to deal with it, and I think it's pretty clearly an improvement; comments
welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90835 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
bcf561b40e745eb53b3df99ddb93c8a4e97083d0 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Misc key function fixes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90831 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
61eab8872168af6eb1e0047a82901096cf145e27 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Misc key function fixes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90831 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
fce5f79b3a28f1f8c4abab4f31fbd5c803ddf75c 07-Dec-2009 Anders Carlsson <andersca@mac.com> Instantiated or specialized class templates never have a key function. This (and the previous check-in) fixes PR5557.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90753 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
863dbcb45eb7b1e663f2d62be0fbdda6d9aa13ef 07-Dec-2009 Anders Carlsson <andersca@mac.com> Instantiated or specialized class templates never have a key function. This (and the previous check-in) fixes PR5557.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90753 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0a97b7d4712dbfa203dbb5f7fa6c394228cb6b2f 07-Dec-2009 Anders Carlsson <andersca@mac.com> getTemplateSpecializationKind should be const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90750 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b13e357dac872bc7d507a770c4fb0f7b47ff0ac9 07-Dec-2009 Anders Carlsson <andersca@mac.com> getTemplateSpecializationKind should be const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90750 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
39cf32a9e9019054816da59a27b52416d9a664e0 07-Dec-2009 Anders Carlsson <andersca@mac.com> Move key functions to a separate map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90745 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
f53df2398e07d13be9962b95aebc19b31706fa33 07-Dec-2009 Anders Carlsson <andersca@mac.com> Move key functions to a separate map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90745 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
7755c88dcbfa1d4273fd97bdd3415c5c2aa19039 07-Dec-2009 John McCall <rjmccall@apple.com> DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
emplateBase.cpp
a93c934af4fbf97cbe8e649d82e68ccacfe57c95 07-Dec-2009 John McCall <rjmccall@apple.com> DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
emplateBase.cpp
2246dafc073e64a9829d747e71310d63a2d2c99e 07-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Don't print a void return type for C++ constructors and destructors when generating a predefined expr for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90725 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3a1ce1ed0f5686384e712837bad28c576622e442 07-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Don't print a void return type for C++ constructors and destructors when generating a predefined expr for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90725 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
76f672aad5e7b2677cbc594453042e2e3a29f0d1 06-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Move helper onto CXXMethodDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90716 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
d7d7f67c1dd8626520bb243d3928f59d32424534 06-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Move helper onto CXXMethodDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90716 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
cd60cac52f1bba21c35af9b0091465a0c66b558c 06-Dec-2009 Anders Carlsson <andersca@mac.com> Add rudimentary support for member pointers to CGDebugInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90711 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
20f12a20ba9cfa6f8d53c8304e24f50903c45184 06-Dec-2009 Anders Carlsson <andersca@mac.com> Add rudimentary support for member pointers to CGDebugInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90711 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8c1ab41ece780c315be1509c08827b76cc7d3b37 05-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Tweak "key function" rules so that they work for templates with virtual
inline functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90645 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
378fe06b93752669d8a7dd8fa7000094b9679267 05-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Tweak "key function" rules so that they work for templates with virtual
inline functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90645 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
caf383ae337966d67380b6b161fab17ec2b53d04 04-Dec-2009 John McCall <rjmccall@apple.com> Fix "using typename" and the instantiation of non-dependent using declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypeLoc.cpp
ypePrinter.cpp
ed97649e9574b9d854fa4d6109c9333ae0993554 04-Dec-2009 John McCall <rjmccall@apple.com> Fix "using typename" and the instantiation of non-dependent using declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypeLoc.cpp
ypePrinter.cpp
65ee555e12c18db527ae7db88163145bcf6f8094 04-Dec-2009 Anders Carlsson <andersca@mac.com> Be a little more clever about inline member functions that are marked inline in the inline class declaration but not in the actual definition:

class A {
inline void f();
}

void A::f() { }

This is not the most ideal solution, since it doesn't work 100% with regular functions (as my FIXME comment states).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90607 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
48eda2c5d6d2a5c95775a1a3a8a22428bb6869c6 04-Dec-2009 Anders Carlsson <andersca@mac.com> Be a little more clever about inline member functions that are marked inline in the inline class declaration but not in the actual definition:

class A {
inline void f();
}

void A::f() { }

This is not the most ideal solution, since it doesn't work 100% with regular functions (as my FIXME comment states).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90607 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f3497adb0e0329bd32c4129cc2ac6e692b7ffcfd 04-Dec-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Fix for PR5650 - Revised vector_size attribute handling to be done earlier before declaration is finalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90600 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
6e132aab867c189b1c3ee7463ef9d2b1f03a294d 04-Dec-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix for PR5650 - Revised vector_size attribute handling to be done earlier before declaration is finalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90600 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
2ed2ca150395db08e9ac31401c2ea00fe10a76b9 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make the type of the Decl referred to by a MemberExpr a bit more precise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90549 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f595cc41c4d95fe323f8a2b209523de9956f874d 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make the type of the Decl referred to by a MemberExpr a bit more precise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90549 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ed499d2ef7d56bd48a9da678e3db71cf00c18013 04-Dec-2009 Anders Carlsson <andersca@mac.com> Make sure that overridden method decls are always canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90542 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3aaf486af649d6be464e6b937c8181529ffef931 04-Dec-2009 Anders Carlsson <andersca@mac.com> Make sure that overridden method decls are always canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90542 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
08a9dc64721d9945fb4d2f226b2197411117d321 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5447: teach Evaluate to deal with floating-point conditionals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90521 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
67f85fcdab64f36233a7211f963ed1cccffcbfb8 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5447: teach Evaluate to deal with floating-point conditionals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90521 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e883d27dfdf59eeac18f9276bf2460a549e68d31 03-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Add recursion guards to ice-checking and evaluation for declrefs, so we
don't infinitely recurse for cases we can't evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90480 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
c013118155077cf8bdaef743c5dbce760114eed3 03-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Add recursion guards to ice-checking and evaluation for declrefs, so we
don't infinitely recurse for cases we can't evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90480 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
2f5b7a8b9a82804a119ac53a8d69aeab48181eb5 03-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> A new helper function to set various bits in the class when
a new virtual function is declared/instantiated. it is used
in couple of places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90470 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e7184df728bb339633d88c774b5097dd9318cc8a 03-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> A new helper function to set various bits in the class when
a new virtual function is declared/instantiated. it is used
in couple of places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90470 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
2b50918fa2304555963214b21b551289fad889c9 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Kill a few more random stderr uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90441 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
e7cb7e4570842297f698bd7fd8d85520fc008acd 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Kill a few more random stderr uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90441 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
e3490e0f4704a99b912ca04f614400bbe1928362 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Convert StmtDumper to raw_ostream. I forget why.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90435 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
806c12e64ccbf7a259aa49dfe929724b4853baae 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Convert StmtDumper to raw_ostream. I forget why.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90435 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
75067d2c35093b2c9cd4f96a3d5e2df0b5383d17 03-Dec-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce the notion of literal types, as specified in C++0x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90361 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ype.cpp
ccf43505dbc47da041c06125f90b3bd3ac7eac97 03-Dec-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce the notion of literal types, as specified in C++0x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90361 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ype.cpp
2409a21ff088c4aab328a9d32fb96502efd9de18 02-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Improve source location information for C++ member initializers in a
constructor, by keeping the DeclaratorInfo* rather than just the type
and a single location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90355 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
802ab45fea51beff12f386329d4928811a479c6e 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Improve source location information for C++ member initializers in a
constructor, by keeping the DeclaratorInfo* rather than just the type
and a single location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90355 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3901b72e9ecb9bc37106905b4f4a6e861a7029b5 02-Dec-2009 Anders Carlsson <andersca@mac.com> In Sema, whenever we think that a function is going to cause a vtable to be generated, we mark any virtual implicit member functions as referenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90327 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
5ec02ae147760c32ad5b6fb0fec30ab3b3696778 02-Dec-2009 Anders Carlsson <andersca@mac.com> In Sema, whenever we think that a function is going to cause a vtable to be generated, we mark any virtual implicit member functions as referenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90327 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
54d93fde6518761f600ccc71dad2e9b5e0e93ebf 02-Dec-2009 John McCall <rjmccall@apple.com> r90313, in which OverloadedFunctionDecl is removed and never spoken of again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90313 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
xpr.cpp
tmtProfile.cpp
51fa86f738a9768fac4e1cad7bdde53774b5b322 02-Dec-2009 John McCall <rjmccall@apple.com> r90313, in which OverloadedFunctionDecl is removed and never spoken of again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90313 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
xpr.cpp
tmtProfile.cpp
894fc4791408c58549d78f6fa333d7e2c1dd5f4e 02-Dec-2009 John McCall <rjmccall@apple.com> Push overloaded function templates through the parser using a totally different
leaked data structure than before. This kills off the last remaining
explicit uses of OverloadedFunctionDecl in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90306 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
0bd6feb9e9d40fc889fd47e899985125a43dfed8 02-Dec-2009 John McCall <rjmccall@apple.com> Push overloaded function templates through the parser using a totally different
leaked data structure than before. This kills off the last remaining
explicit uses of OverloadedFunctionDecl in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90306 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
317ae5eb67c34b9be76e991c7851d72dd355f78d 01-Dec-2009 John McCall <rjmccall@apple.com> Rework how we support C++ implicit member accesses. If we can resolve an
implicit member access to a specific declaration, go ahead and create
it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as
appropriate. Otherwise, create an UnresolvedMemberExpr or
DependentScopeMemberExpr with a null base expression.

By representing implicit accesses directly in the AST, we get the ability
to correctly delay the decision about whether it's actually an instance
member access or not until resolution is complete. This permits us
to correctly avoid diagnosing the 'problem' of 'MyType::foo()'
where the relationship to the type isn't really known until instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90266 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
aa81e1658d87b9011125c632aa902d154ae4b02c 01-Dec-2009 John McCall <rjmccall@apple.com> Rework how we support C++ implicit member accesses. If we can resolve an
implicit member access to a specific declaration, go ahead and create
it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as
appropriate. Otherwise, create an UnresolvedMemberExpr or
DependentScopeMemberExpr with a null base expression.

By representing implicit accesses directly in the AST, we get the ability
to correctly delay the decision about whether it's actually an instance
member access or not until resolution is complete. This permits us
to correctly avoid diagnosing the 'problem' of 'MyType::foo()'
where the relationship to the type isn't really known until instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90266 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
17d49f6cbf2b351708ced774a4b9340ecd4ec595 01-Dec-2009 Ted Kremenek <kremenek@apple.com> Allocate MultipleDC objects using the allocator associated with
ASTContext instead of malloc. Besides reducing malloc traffic, this
also removes a source of memory leaks when using a BumpPtrAllocator
for the allocator of ASTContext. There are still leaks when using
MallocAllocator because Decl::Destroy() isn't fully finished.

Fixes: <rdar://problem/7431556>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90174 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
94a39005e3733f2e498f2642be95507dda184ca1 01-Dec-2009 Ted Kremenek <kremenek@apple.com> Allocate MultipleDC objects using the allocator associated with
ASTContext instead of malloc. Besides reducing malloc traffic, this
also removes a source of memory leaks when using a BumpPtrAllocator
for the allocator of ASTContext. There are still leaks when using
MallocAllocator because Decl::Destroy() isn't fully finished.

Fixes: <rdar://problem/7431556>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90174 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
79af29e9baa26318af6fda91db377c863c997412 01-Dec-2009 Anders Carlsson <andersca@mac.com> Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1a5e0d7f18485e4fb958f96dcddff3e4486a4069 01-Dec-2009 Anders Carlsson <andersca@mac.com> Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
abb74cc24e06928418871be6535520b14d714a8e 30-Nov-2009 John McCall <rjmccall@apple.com> Eliminate the use of OverloadedFunctionDecl in member expressions.
Create a new UnresolvedMemberExpr for these lookups. Assorted hackery
around qualified member expressions; this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90161 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
129e2df52ed7e0434b3f1cf1867fd6a5cb083ff6 30-Nov-2009 John McCall <rjmccall@apple.com> Eliminate the use of OverloadedFunctionDecl in member expressions.
Create a new UnresolvedMemberExpr for these lookups. Assorted hackery
around qualified member expressions; this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90161 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
011c5a02450ed959679d4ebfd2fdb8198b3cba18 30-Nov-2009 Mike Stump <mrs@apple.com> Add const to accessors that don't modify the object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90153 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
6515afe50c8d69dbb029b85f879cb2e083854b6c 30-Nov-2009 Mike Stump <mrs@apple.com> Add const to accessors that don't modify the object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90153 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
2818bd26562e1a2b7d7e9fb31d72f698a5748289 30-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a crash when ivar type is a __strong SEL. Fallout from
recent change to make SEL a builtin type (fixes radar 7425510).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90145 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8d2c0a9814e56c2b22e22d1045181c735aef62fd 30-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a crash when ivar type is a __strong SEL. Fallout from
recent change to make SEL a builtin type (fixes radar 7425510).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90145 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3081d565319e1abdfca8257cac1bd031c72a4d41 30-Nov-2009 Tobias Grosser <grosser@fim.uni-passau.de> Adapt to the DOTGraphTraits changes in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90137 91177308-0d34-0410-b5e6-96231b3b80d8
tmtViz.cpp
006b0eb3e11162d8c06372db813ac9f71a7a16e8 30-Nov-2009 Tobias Grosser <grosser@fim.uni-passau.de> Adapt to the DOTGraphTraits changes in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90137 91177308-0d34-0410-b5e6-96231b3b80d8
tmtViz.cpp
8407ef47f548c87f6578727e6cf61c73d14d9dd6 29-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90078 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
tmt.cpp
2024f4d4b0d57616f79ea742fa782d633d414462 29-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90078 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
tmt.cpp
c481191979b4ca7f2c5511ce9cc4d0fe65fd1d46 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
3e518bda00d710754ca077cf9be8dd821e16a854 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
171519480d16f99e676fd04895940b7bf794ffb5 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove VISIBILITY_HIDDEN from lib/AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90043 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
770b4a8834670e9427d3ce5a1a8472eb86f45fd2 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove VISIBILITY_HIDDEN from lib/AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90043 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
c8a9e76a468ba844969b8e637c20d5d171ed20dc 27-Nov-2009 Anders Carlsson <andersca@mac.com> Use a PointerIntPair for the PrimaryBaseInfo. Yay for clever LLVM data structures!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90020 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
261fba6cf57a09a1f1d0c4a4c4856aaa62753242 27-Nov-2009 Anders Carlsson <andersca@mac.com> Use a PointerIntPair for the PrimaryBaseInfo. Yay for clever LLVM data structures!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90020 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
89f16283ed2f1df67eae86fe9fdd28a82909b768 27-Nov-2009 Anders Carlsson <andersca@mac.com> Add a new PrimaryBaseInfo struct that combines the record decl of a primary base with whether it's virtual or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90018 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
ce2009ab2f59894dbcc847e25e05abe78c296e95 27-Nov-2009 Anders Carlsson <andersca@mac.com> Add a new PrimaryBaseInfo struct that combines the record decl of a primary base with whether it's virtual or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90018 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
cfe8d37a3bcdbcbaffd2cdc3e57f0e31e49d84d2 26-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Slight tweak to the algorithm for getLinkage().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89932 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e9d6554ba78fb81e810fdaec9b2c98ab96526e83 26-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Slight tweak to the algorithm for getLinkage().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89932 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
96c4d512d3ce2f9c900de3ae50623583959bf5a4 26-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89895 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
369a3bd9979cf529eed529aa037de713c213e47d 26-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89895 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c01f9e5cbcab06ff67a12e97897300bbc40f63e1 25-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Implement the rules in C++ [basic.link] and C99 6.2.2 for computing
the linkage of a declaration. Switch the lame (and completely wrong)
NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(),
along with the "can this declaration be a template argument?" check
that started all of this.

Fixes -fsyntax-only for PR5597.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89891 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d85b5b9b8fcf53906d9a61649b3657ca0d902017 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement the rules in C++ [basic.link] and C99 6.2.2 for computing
the linkage of a declaration. Switch the lame (and completely wrong)
NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(),
along with the "can this declaration be a template argument?" check
that started all of this.

Fixes -fsyntax-only for PR5597.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89891 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e16949907574662cb76b58caf13b1a4601276bc5 25-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
99e9b4d172f6877e6ba5ebe75bb8238721f5e01c 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
47e18bea5f3330ad69725c7d8d23a5a3f862d14e 24-Nov-2009 John McCall <rjmccall@apple.com> Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
DependentScopeDeclRefExpr support storing templateids. Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.

This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.

Also resolves a few FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89785 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
f7a1a744eba4b29ceb0f20af8f34515d892fdd64 24-Nov-2009 John McCall <rjmccall@apple.com> Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
DependentScopeDeclRefExpr support storing templateids. Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.

This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.

Also resolves a few FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89785 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
457afc93c071f6bf414b29c2feec83d2dea9d505 24-Nov-2009 John McCall <rjmccall@apple.com> Helper function for turning a TemplateName into a DeclarationName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89782 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
80ad16f4b2b350ddbaae21a52975e63df5aafc2c 24-Nov-2009 John McCall <rjmccall@apple.com> Helper function for turning a TemplateName into a DeclarationName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89782 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
01a89cd57f3a24404a9422fa9b64109782a5cc2a 24-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Teach Evaluate to handle member expressions referring to enum constants and
static member constants. No significant visible difference at the moment
because it conservatively assumes the base has side effects. I'm planning to
use this for CodeGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89738 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
043097507f99b1156bfd8bad41e7d5166ae4b9b6 24-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Teach Evaluate to handle member expressions referring to enum constants and
static member constants. No significant visible difference at the moment
because it conservatively assumes the base has side effects. I'm planning to
use this for CodeGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89738 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0c3adf2e82b92df0cac948cc501d2bd7584944a9 23-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Fixe a crash in encoding of SEL type caused by recent changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89696 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
60bce3ef20a4c9684e3825cdd739fefb9810327d 23-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Fixe a crash in encoding of SEL type caused by recent changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89696 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7deb1a5f25fa38306fec3b79129df808fdb90eb6 23-Nov-2009 Anders Carlsson <andersca@mac.com> Handle converting member pointers to bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89692 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bc0e0781da778bd5eb41a810419912893ae20448 23-Nov-2009 Anders Carlsson <andersca@mac.com> Handle converting member pointers to bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89692 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2380a5875ed09da01b8686536e2a4d7577a7bddf 23-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Make 'SEL' pointer to a builtin type and not an
objective-c pointer type. This was a serious mishap and
luckily, Ted's test caught that (and patch fixes the test case).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89680 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
04765ac135e0c4e6b78651c2a287d80a32b2b8b9 23-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Make 'SEL' pointer to a builtin type and not an
objective-c pointer type. This was a serious mishap and
luckily, Ted's test caught that (and patch fixes the test case).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89680 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1c5ecf0835f3153ad95c8972ac6e657717e4ab36 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89668 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
5d484e8cf710207010720589d89602233de61d01 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89668 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
b4a0a8293aff2c6160e11edb51d8715a670248c6 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Let using directives refer to namespace aliases. Fixes PR5479.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89657 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
eb0d8c95b43549ebf1acbb78d597901ace6dc8b7 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Let using directives refer to namespace aliases. Fixes PR5479.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89657 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
18706c78025874d2448fe6bf4e9475a4569f4b7d 23-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Canonical template arguments that are template template parameters by
their template parameter depth and position, so that we can match
redeclarations appropriately. Fixes PR5527 and PR5528.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89654 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
74295b3408178bd0e97c2090dac911817778b582 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Canonical template arguments that are template template parameters by
their template parameter depth and position, so that we can match
redeclarations appropriately. Fixes PR5527 and PR5528.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89654 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
39e1291cdbae6ce02b7642b12dd39af8762cfa93 23-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Centralize and complete the computation of value- and type-dependence for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89649 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
xpr.cpp
0da76df9218d7c27b471b0a4d83a5b29fe24e5b4 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Centralize and complete the computation of value- and type-dependence for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89649 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
xpr.cpp
ed9480970db65f8705eeba0760fbe8feefe6389b 23-Nov-2009 John McCall <rjmccall@apple.com> Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class. Use it pervasively throughout Sema.

My fingers hurt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
ype.cpp
ypePrinter.cpp
d5532b6cfff2977e0c59fa6ead7f7973984a620d 23-Nov-2009 John McCall <rjmccall@apple.com> Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class. Use it pervasively throughout Sema.

My fingers hurt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
ype.cpp
ypePrinter.cpp
ec517776dfa1cd63110ca4e09e98d757fbea81ef 22-Nov-2009 Anders Carlsson <andersca@mac.com> When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89611 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
e4fc0d97420e13d13c9664a3c27c17aa7c1e47b9 22-Nov-2009 Anders Carlsson <andersca@mac.com> When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89611 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
7d68836441bd0a6dd0651c6348da57fdb9de94bb 22-Nov-2009 Anders Carlsson <andersca@mac.com> Move bit-field layout out into a separate function. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89604 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
42dbcc4d8f0c483693befc76f37ca6dc4e0844e1 22-Nov-2009 Anders Carlsson <andersca@mac.com> Move bit-field layout out into a separate function. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89604 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a238d6daa15f845738a8b15a3bc9f5b84617744b 21-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:

Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.

Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89561 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypePrinter.cpp
13dcd00615de5c4279d97bdf63cd5f0a14fd9dcc 21-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:

Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.

Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89561 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ypePrinter.cpp
ed5d77b9f592ae8f6b750bc7dbf0ebff5f9e1db1 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> DeclPrinter: Indent access specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89552 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
512ce60311b93b6f9a144fb2cf9fe4225f5d57b2 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> DeclPrinter: Indent access specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89552 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
4b7111c501f61fb9a618408324f179c9dac00136 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add 1+2 consts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89546 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c52365674b5b157a0486f75c12dd9f4cc41d8089 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add 1+2 consts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89546 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a32612ec0fdca70ce6dea0c7477e64bef1691906 21-Nov-2009 John McCall <rjmccall@apple.com> "Incremental" progress on using expressions, by which I mean totally ripping
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of
a function template in the lookup results.

Incidentally fixes a problem with argument-dependent lookup where we were
still performing ADL even when the lookup results contained something from
a block scope.

Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.

The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89544 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
ba13543329afac4a0d01304ec2ec4924d99306a6 21-Nov-2009 John McCall <rjmccall@apple.com> "Incremental" progress on using expressions, by which I mean totally ripping
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of
a function template in the lookup results.

Incidentally fixes a problem with argument-dependent lookup where we were
still performing ADL even when the lookup results contained something from
a block scope.

Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.

The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89544 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
53529e8c71aa94b2ea008510a577d59ba8afe3f6 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
bbd37c62e34db3f5a95c899723484a76c71d7757 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
8182d63828ad84eed671cf412935b0505f7d2256 20-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Deduce a ConstantArrayType from a value-dependent initializer list
rather than punting to a DependentSizedArrayType, tightening up our
type checking for template definitions. Thanks, John!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89407 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
73460a32bc5299a5927d23d2e464d72af796eabf 20-Nov-2009 Douglas Gregor <dgregor@apple.com> Deduce a ConstantArrayType from a value-dependent initializer list
rather than punting to a DependentSizedArrayType, tightening up our
type checking for template definitions. Thanks, John!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89407 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ccb556aedb901dfaad70f5ea8b815e7c47a533e6 19-Nov-2009 John McCall <rjmccall@apple.com> Draw a brighter line between "unresolved" expressions, where we have done the
appropriate lookup and simply can't resolve the referrent yet, and
"dependent scope" expressions, where we can't do the lookup yet because the
entity we need to look into is a dependent type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89402 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
865d447ac6a4721ab58e898d014a21f2eff74b06 19-Nov-2009 John McCall <rjmccall@apple.com> Draw a brighter line between "unresolved" expressions, where we have done the
appropriate lookup and simply can't resolve the referrent yet, and
"dependent scope" expressions, where we can't do the lookup yet because the
entity we need to look into is a dependent type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89402 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
393c00d16a75731eceb7f815751722e4b4a950e4 19-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Cope with an amusingly little anomaly with dependent types and
incomplete array initialization, where we have the following in a
template:

int a[] = { 1, 2, something-value-dependent };
// ...
sizeof(a);

The type of "a" appears to be a non-dependent IncompleteArrayType, but
treating it as such makes the sizeof(a) fail at template definition
time. We now correctly handle this by morphing the IncompleteArrayType
into a DependentSizedArrayType with a NULL expression, indicating that
its size has no corresponding expression (and, therefore, the type is
distinct from others).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89366 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cb78d8852a454684c987220132cdb5e54dd00121 19-Nov-2009 Douglas Gregor <dgregor@apple.com> Cope with an amusingly little anomaly with dependent types and
incomplete array initialization, where we have the following in a
template:

int a[] = { 1, 2, something-value-dependent };
// ...
sizeof(a);

The type of "a" appears to be a non-dependent IncompleteArrayType, but
treating it as such makes the sizeof(a) fail at template definition
time. We now correctly handle this by morphing the IncompleteArrayType
into a DependentSizedArrayType with a NULL expression, indicating that
its size has no corresponding expression (and, therefore, the type is
distinct from others).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89366 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9d020f660eea532c69449d77862f842b1538c62b 18-Nov-2009 John McCall <rjmccall@apple.com> Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
7ba107a1863ddfa1664555854f0d7bdb3c491c92 18-Nov-2009 John McCall <rjmccall@apple.com> Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
1df77a912b351f6c9d668b1c335abf301f04a8ab 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Add ObjCClassDecl::getSourceRange().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89179 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2dbdd622d02d1bfbe1e5bcf421b07b74c7a748f1 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Add ObjCClassDecl::getSourceRange().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89179 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d1448cac120e790d85643475f88a02ede2fb53fa 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Add SourceLocations to ObjCClassDecl for the class identifiers referenced by @class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89170 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
eclPrinter.cpp
321c22f1c4271c3d9a3d4d3fc18847f948ab595b 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Add SourceLocations to ObjCClassDecl for the class identifiers referenced by @class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89170 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
eclPrinter.cpp
9ded0033a8b194fe90bfc969551d0c3c93504ede 17-Nov-2009 Ted Kremenek <kremenek@apple.com> Do not register ObjCInterfaceDecls implicitly created by @class in the
current DeclContext. These "imaginary" declarations pose issues for
clients searching DeclContext for actual declarations. Instead,
register them for name lookup, and add the ObjCInterfaceDecl later to
the DeclContext when we hit an actual @interface declaration.

This also fixes a bug where the invariant that the Decls in a
DeclContext are sorted in order of their appearance is no longer
violated. What could happen is that an @class causes an
ObjCInterfaceDecl to get added first to the DeclContext, then the
ObjCClassDecl itself is added, and then later the SourceLocation of
the ObjCInterfaceDecl is updated with the correct location (which is
later in the file). This breaks an assumed invariant in
ResolveLocation.cpp (and possibly other clients).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89160 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c32b1d82c1f6d0f0d6c615beb3b6bdfbfbea7098 17-Nov-2009 Ted Kremenek <kremenek@apple.com> Do not register ObjCInterfaceDecls implicitly created by @class in the
current DeclContext. These "imaginary" declarations pose issues for
clients searching DeclContext for actual declarations. Instead,
register them for name lookup, and add the ObjCInterfaceDecl later to
the DeclContext when we hit an actual @interface declaration.

This also fixes a bug where the invariant that the Decls in a
DeclContext are sorted in order of their appearance is no longer
violated. What could happen is that an @class causes an
ObjCInterfaceDecl to get added first to the DeclContext, then the
ObjCClassDecl itself is added, and then later the SourceLocation of
the ObjCInterfaceDecl is updated with the correct location (which is
later in the file). This breaks an assumed invariant in
ResolveLocation.cpp (and possibly other clients).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89160 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
93e324813bd8c55ac19aaac0123eb4e294a6fa44 17-Nov-2009 David Chisnall <csdavec@swan.ac.uk> Added block type introspection support.

As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89134 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5e530af5d51572a0ed5dbe50da54bd333840c63d 17-Nov-2009 David Chisnall <csdavec@swan.ac.uk> Added block type introspection support.

As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89134 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e5e575a5d90774a745771120de9268aecafdca67 17-Nov-2009 Anders Carlsson <andersca@mac.com> Fix PR5531.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89106 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
58beed91d468863b8c85bce43425422703838d27 17-Nov-2009 Anders Carlsson <andersca@mac.com> Fix PR5531.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89106 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5b05662377e2fd448c3e356aa6cc0bfe9e38bb35 17-Nov-2009 John McCall <rjmccall@apple.com> Instead of hanging a using declaration's target decls directly off the using
decl, create shadow declarations and put them in scope like normal.
Work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89048 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
9488ea120e093068021f944176c3d610dd540914 17-Nov-2009 John McCall <rjmccall@apple.com> Instead of hanging a using declaration's target decls directly off the using
decl, create shadow declarations and put them in scope like normal.
Work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89048 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
2fb7bee22e3174d9103071aee16fc9ab7affe879 17-Nov-2009 Anders Carlsson <andersca@mac.com> Unify the way destructor epilogues are generated for synthesized and regular destructors. Also fix PR5529.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89034 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
9f853df0d3c25c646907a7b7ef22398370def00f 17-Nov-2009 Anders Carlsson <andersca@mac.com> Unify the way destructor epilogues are generated for synthesized and regular destructors. Also fix PR5529.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89034 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
4f4b5bcdce90be1ebc9373c500cc07cfb458400c 17-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> When querying type qualifiers on QualType via one of the "non-local"
interfaces (which are used throughout the front end), combine the
qualifiers on the QualType instance with the qualifiers on the
canonical type to produce the set of qualifiers that, semantically,
apply to that type. This should design away a large category of
"qualifier-hidden-behind-a-typedef" buts like we saw in PR5383.

Performance-wise, this caused a regression of ~0.5% on Cocoa.h, but
it's totally worth it. We may actually be able to get a little more
performance back by using CanQualType more often.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89018 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
fa1a06e80706846fa15e0bd44671bdc3dfc53d84 17-Nov-2009 Douglas Gregor <dgregor@apple.com> When querying type qualifiers on QualType via one of the "non-local"
interfaces (which are used throughout the front end), combine the
qualifiers on the QualType instance with the qualifiers on the
canonical type to produce the set of qualifiers that, semantically,
apply to that type. This should design away a large category of
"qualifier-hidden-behind-a-typedef" buts like we saw in PR5383.

Performance-wise, this caused a regression of ~0.5% on Cocoa.h, but
it's totally worth it. We may actually be able to get a little more
performance back by using CanQualType more often.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89018 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
c79209789205c9de5fcc7aedfd6308057d40b618 16-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXInheritance.cpp
eclCXX.cpp
ypePrinter.cpp
a4923eb7c4b04d360cb2747641a5e92818edf804 16-Nov-2009 Douglas Gregor <dgregor@apple.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXInheritance.cpp
eclCXX.cpp
ypePrinter.cpp
ae19aec6ef278120a001cc9a371412b9cda65276 16-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add constant evaluation for comma operator with floating-point operand. Fixes
PR5449.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88885 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7f92f0362ef2cf218bc19bb83e1a97dd254b5527 16-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add constant evaluation for comma operator with floating-point operand. Fixes
PR5449.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88885 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c5678f16b3f9bf121b2ea06fb91c997c83bff2f7 16-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Fix a missing include from r88876.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88879 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
894993f48aedbed10519416052a7c6a47ad365bb 16-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Fix a missing include from r88876.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88879 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
f824ae9fcb35d15cb840582682435bb73d00c52d 15-Nov-2009 Anders Carlsson <andersca@mac.com> Add DeclarationName::dump().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88876 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
70f5bc77dbe4172bde860e15d8b3c29e0d5005cb 15-Nov-2009 Anders Carlsson <andersca@mac.com> Add DeclarationName::dump().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88876 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
eeda0f8bc363b39cbafb8f382fff96680155b037 14-Nov-2009 Anders Carlsson <andersca@mac.com> When dumping implicit cast exprs, print out whether the cast is an lvalue cast or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88821 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0e489ea67da94ca5ba3df67cab4f0da61d56367d 14-Nov-2009 Anders Carlsson <andersca@mac.com> When dumping implicit cast exprs, print out whether the cast is an lvalue cast or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88821 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
28ba618cd243313276bc8fa830995495e8e1591b 14-Nov-2009 Anders Carlsson <andersca@mac.com> Add an internal CreateRecordDecl that will create a CXXRecordDecl when compiling C++ and a RecordDecl otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88816 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
79cbc7dd2aacd85a28f469b5dc73c4ea296e7072 14-Nov-2009 Anders Carlsson <andersca@mac.com> Add an internal CreateRecordDecl that will create a CXXRecordDecl when compiling C++ and a RecordDecl otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88816 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e0eb15e014e6d9d4f819cbfacb26a068d1421ee7 14-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> If we attempt to add a constructor template specialization that looks
like a copy constructor to the overload set, just ignore it. This
ensures that we don't try to use such a constructor as a copy
constructor *without* triggering diagnostics at the point of
declaration.

Note that we *do* diagnose such copy constructors when explicitly
written by the user (e.g., as an explicit specialization).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88733 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
66724ea67d7d598b937d86fa66f03f09a1c758f3 14-Nov-2009 Douglas Gregor <dgregor@apple.com> If we attempt to add a constructor template specialization that looks
like a copy constructor to the overload set, just ignore it. This
ensures that we don't try to use such a constructor as a copy
constructor *without* triggering diagnostics at the point of
declaration.

Note that we *do* diagnose such copy constructors when explicitly
written by the user (e.g., as an explicit specialization).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88733 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
36eeb3dcc70b38527b866045b673f3345056092f 14-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88724 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fd47648b5d351ff6d1a3e886e1c3d10712ba4675 14-Nov-2009 Douglas Gregor <dgregor@apple.com> Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88724 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7f42c4ac73a969da3c4df93a1435f4f4cc32a1cd 14-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> A constructor template cannot be instantiated to a copy
constructor. Make sure that such declarations can never be formed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88718 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cad84b7c12564ff37feb66d6d004bb609bea8788 14-Nov-2009 Douglas Gregor <dgregor@apple.com> A constructor template cannot be instantiated to a copy
constructor. Make sure that such declarations can never be formed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88718 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
840186769433bb1743097e3144d9b90b9aacce88 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87087 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
444be7366d0a1e172c0290a1ea54c1cb16b5947c 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87087 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a0e2783cbc13e5a0212f4597ebb3a9641f41a2ed 12-Nov-2009 Anders Carlsson <andersca@mac.com> Add a CK_BaseToDerived cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86994 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
11de6de25a0110cd7be97eef761ef3b189781da6 12-Nov-2009 Anders Carlsson <andersca@mac.com> Add a CK_BaseToDerived cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86994 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1a4349171dda651e1a070d817a250f5c47ac2015 12-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> When comparing template parameter lists, distinguish between three cases:
- Comparing template parameter lists to determine if we have a redeclaration
- Comparing template parameter lists to determine if we have equivalent
template template parameters
- Comparing template parameter lists to determine whether a template
template argument is valid for a given template template parameter.

Previously, we did not distinguish between the last two cases, which
got us into trouble when we were looking for exact type matches
between the types of non-type template parameters that were dependent
types. Now we do, so we properly delay checking of template template
arguments until instantiation time.

Also, fix an accidental fall-through in a case statement that was
causing crashes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86992 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
fb898e17cff919bd28b88e9d93301d6e2cc5cbd1 12-Nov-2009 Douglas Gregor <dgregor@apple.com> When comparing template parameter lists, distinguish between three cases:
- Comparing template parameter lists to determine if we have a redeclaration
- Comparing template parameter lists to determine if we have equivalent
template template parameters
- Comparing template parameter lists to determine whether a template
template argument is valid for a given template template parameter.

Previously, we did not distinguish between the last two cases, which
got us into trouble when we were looking for exact type matches
between the types of non-type template parameters that were dependent
types. Now we do, so we properly delay checking of template template
arguments until instantiation time.

Also, fix an accidental fall-through in a case statement that was
causing crashes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86992 91177308-0d34-0410-b5e6-96231b3b80d8
ypePrinter.cpp
bff06d8fa05294f339620d8d9045064c3af4d04d 12-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Improve source-location information for implicitly-generated member call expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86989 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
00b98c229ef28a5e82943bb23d09fb46d24ca381 12-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve source-location information for implicitly-generated member call expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86989 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1845bc260fd7ffa3035c8c5fbeb86b4685b49938 12-Nov-2009 John McCall <rjmccall@apple.com> Random const correctness, and incidentally use computeDeclContext when building
a using declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86942 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
af8e6ed61b5e80ab95632b63f583af79dcb62590 12-Nov-2009 John McCall <rjmccall@apple.com> Random const correctness, and incidentally use computeDeclContext when building
a using declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86942 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
556a951c9cc08f486749e7e4c374a5e73bbc84bf 12-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Template argument deduction for template template parameters. This
permits, among other things, ripping apart and reconstructing
templates via partial specialization:

template<typename T>
struct DeepRemoveConst { typedef T type; };

template<typename T>
struct DeepRemoveConst<const T> {
typedef typename DeepRemoveConst<T>::type type;
};

template<template<typename> class TT, typename T>
struct DeepRemoveConst<TT<T> > {
typedef TT<typename DeepRemoveConst<T>::type> type;
};

Also, fix a longstanding thinko in the code handling partial ordering
of class template partial specializations. We were performing the
second deduction without clearing out the results of the first
deduction. It's amazing we got through so much code with such a
horrendous error :(



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86893 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
db0d4b751e83b8841b8f48f913f17e50467f13d4 12-Nov-2009 Douglas Gregor <dgregor@apple.com> Template argument deduction for template template parameters. This
permits, among other things, ripping apart and reconstructing
templates via partial specialization:

template<typename T>
struct DeepRemoveConst { typedef T type; };

template<typename T>
struct DeepRemoveConst<const T> {
typedef typename DeepRemoveConst<T>::type type;
};

template<template<typename> class TT, typename T>
struct DeepRemoveConst<TT<T> > {
typedef TT<typename DeepRemoveConst<T>::type> type;
};

Also, fix a longstanding thinko in the code handling partial ordering
of class template partial specializations. We were performing the
second deduction without clearing out the results of the first
deduction. It's amazing we got through so much code with such a
horrendous error :(



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86893 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa4980d02d39c89191d526e4ccc3dd60fd9ad844 11-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Fix speculative parsing of dependent template names in
nested-name-specifiers so that they don't gobble the template name (or
operator-function-id) unless there is also a
template-argument-list. For example, given

T::template apply

we would previously consume both "template" and "apply" as part of
parsing the nested-name-specifier, then error when we see that there
is no "<" starting a template argument list. Now, we parse such
constructs tentatively, and back off if the "<" is not present. This
allows us to parse dependent template names as one would use them for,
e.g., template template parameters:

template<typename T, template<class> class X = T::template apply>
struct MetaSomething;

Also, test default arguments for template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86841 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
7bb87fca7d22a8a194d04188746b90f46512975f 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Fix speculative parsing of dependent template names in
nested-name-specifiers so that they don't gobble the template name (or
operator-function-id) unless there is also a
template-argument-list. For example, given

T::template apply

we would previously consume both "template" and "apply" as part of
parsing the nested-name-specifier, then error when we see that there
is no "<" starting a template argument list. Now, we parse such
constructs tentatively, and back off if the "<" is not present. This
allows us to parse dependent template names as one would use them for,
e.g., template template parameters:

template<typename T, template<class> class X = T::template apply>
struct MetaSomething;

Also, test default arguments for template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86841 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
4caaa5efe3d0c19a4fc7ecc17db3a7b7e59ce38c 11-Nov-2009 Mike Stump <mrs@apple.com> Fixup spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86792 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
37acf5a57f87abdbb4ac6115c5f3f09295ec2dc3 11-Nov-2009 Mike Stump <mrs@apple.com> Fixup spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86792 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
63c8e75e3df30caab2d7251514a0d7ddc9cb39a2 11-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a new representation for template template
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames.

The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.

This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
- the inability to use dependent template names as template template
arguments
- template template parameter default arguments cannot be
instantiation

However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
ypePrinter.cpp
788cd06cf8e868a67158aafec5de3a1f408d14f3 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Introduce a new representation for template template
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames.

The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.

This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
- the inability to use dependent template names as template template
arguments
- template template parameter default arguments cannot be
instantiation

However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
ypePrinter.cpp
b538285b0a49b5ddedf494f9d4e5902015c2c64e 10-Nov-2009 Jeffrey Yasskin <jyasskin@google.com> Fix clang's use of DenseMap iterators after r86636 fixed their constness.
Patch by Victor Zverovich!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3958b502404b4bd67f26fee398cb347abe89e6a8 10-Nov-2009 Jeffrey Yasskin <jyasskin@google.com> Fix clang's use of DenseMap iterators after r86636 fixed their constness.
Patch by Victor Zverovich!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
db8393ca63e3a82398c3bfb4e7b441d72995d707 10-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Move all of the type-printing logic to its own C++ source file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86629 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
estedNameSpecifier.cpp
ype.cpp
ypePrinter.cpp
fee8a3c003a8894002810a6373bd5b895290974e 10-Nov-2009 Douglas Gregor <dgregor@apple.com> Move all of the type-printing logic to its own C++ source file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86629 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
estedNameSpecifier.cpp
ype.cpp
ypePrinter.cpp
ae823f473f976e10a1d8dc03b440f64503883b9a 09-Nov-2009 Anders Carlsson <andersca@mac.com> __uint128_t is indeed an unsigned integer type. Fixes PR5435.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86561 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1c03ca30ae962199ef702324b48550f6af7fdc32 09-Nov-2009 Anders Carlsson <andersca@mac.com> __uint128_t is indeed an unsigned integer type. Fixes PR5435.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86561 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
afcfd753e6c5d50edb13dd0b7f46fc40f6aa8fa0 07-Nov-2009 John McCall <rjmccall@apple.com> Implement -Wconversion. Off by default, in the non-gcc group. There's
significant work left to be done to reduce the false-positive rate here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86326 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
680523a91dd3351389667c8de17121ba7ae82673 07-Nov-2009 John McCall <rjmccall@apple.com> Implement -Wconversion. Off by default, in the non-gcc group. There's
significant work left to be done to reduce the false-positive rate here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86326 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
72923c67a05cdca1ff042668bf9ddbe4355d962f 07-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Make sure isCopyAssignment is only true for actual copy assignment operators,
instead of all assignment operators. The mistake messes up IRGen because
it ends up assuming that the assignment operator is actually the implicit
copy assignment operator, and therefore tries to emit the RHS as an lvalue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86307 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
88fad6310d3104e3ac4ab685227beabaa76faf7b 07-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Make sure isCopyAssignment is only true for actual copy assignment operators,
instead of all assignment operators. The mistake messes up IRGen because
it ends up assuming that the assignment operator is actually the implicit
copy assignment operator, and therefore tries to emit the RHS as an lvalue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86307 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c06278a89dde070041ed01d9ae0b208d45b91d03 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86174 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
632d772a78db7e2cd9b36f8a22aee49d44486fbf 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86174 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
90157f6d8093abd6c42c97481f5b9cd8252c6139 05-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Added support for static variables which require
initialization before main. Fixes pr5396.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86145 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
393c247fe025ccb5f914e37e948192ea86faef8c 05-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Added support for static variables which require
initialization before main. Fixes pr5396.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86145 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
66a430ad6a74eb79cd26cf589427a102f17f9cbe 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Allow the element type of arrays to be incomplete in C++.
This fixes PR5048. Also fix a bug where zero-sized arrays weren't warned about when the size was unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86136 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
923d56d436f750bc1f29db50e641078725558a1b 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Allow the element type of arrays to be incomplete in C++.
This fixes PR5048. Also fix a bug where zero-sized arrays weren't warned about when the size was unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86136 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
8a93d3366647de97b4b13b1cc268c701a4220314 05-Nov-2009 Mike Stump <mrs@apple.com> Refine layout for indirect virtual base classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86116 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
968db3364611a475909b5e76969d2f5472e65597 05-Nov-2009 Mike Stump <mrs@apple.com> Refine layout for indirect virtual base classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86116 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a911b099d2454d39b22abda92f620754c25af4e7 04-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Give DeclarationName's operator< a more predictable, useful ordering

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86055 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
d6b5f13ba3b8d03656d272df5454a9f0a22f139b 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Give DeclarationName's operator< a more predictable, useful ordering

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86055 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
d2c55c0e84cc1fd9a8f3e01adab452de2e63cfb9 04-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Store the unresolved class type in MemberPointerType's Class field,
from Peter Collingbourne!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86030 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
87c12c4a4667279dacb3d4a93c64b49148a0ff79 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Store the unresolved class type in MemberPointerType's Class field,
from Peter Collingbourne!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86030 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d1319d2d62b108c7c24c92e73d4d101b035d1037 04-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Implement support for parsing dependent template-ids that refer to
overloaded operators, e.g.,

p->template operator+<T>()




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85989 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
ca1bdd7c269a2390d43c040a60511edd017ee130 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement support for parsing dependent template-ids that refer to
overloaded operators, e.g.,

p->template operator+<T>()




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85989 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
c9f5eac5c940cc542c7f26560653cfeecd264545 04-Nov-2009 Mike Stump <mrs@apple.com> Refine volatile handling, specifically, we must have the canonical
type to look at the volatile specifier. I found these all from just
hand auditing the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85967 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
df317bf71653eeb235da8337b1e8e790f9653aa4 04-Nov-2009 Mike Stump <mrs@apple.com> Refine volatile handling, specifically, we must have the canonical
type to look at the volatile specifier. I found these all from just
hand auditing the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85967 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
bca012404f0b9b0eef1bc42e8e44e5e04454a671 03-Nov-2009 Chris Lattner <sabre@nondot.org> silence a warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85931 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cf184655319cf7a5b811067cff9d26a5741fd161 03-Nov-2009 Chris Lattner <sabre@nondot.org> silence a warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85931 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
80958b844d3bbab2c8cdd883851907e9a7ef9a31 03-Nov-2009 Mike Stump <mrs@apple.com> Refine codegen for covariant thunks that return references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85916 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
9c21289a866b677d21ed3d5ecfdfd5ced5a55410 03-Nov-2009 Mike Stump <mrs@apple.com> Refine codegen for covariant thunks that return references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85916 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ce45a081aec95156d0c3ab5ab9ca0d37ac268372 02-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Property declared in continuation class can only be used to
change a readonly property declared in the class (and its inherited protocols)
to writable property. (Fixes radar 7350645).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85836 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a6f14e1a7ee3a9343a838297c73ca87fddb9ed4a 02-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Property declared in continuation class can only be used to
change a readonly property declared in the class (and its inherited protocols)
to writable property. (Fixes radar 7350645).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85836 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d27690df1ba4d032a5afe8a0178410539b0919c7 01-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> When determining whether a reference to a static data member is an
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85741 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
cf3293eaeb3853d12cff47e648bbe835004e929f 01-Nov-2009 Douglas Gregor <dgregor@apple.com> When determining whether a reference to a static data member is an
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85741 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
a361738debf89e0210270ab209eac26881b8a317 30-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a crazy canonical-types bug because canonicalizing a
dependently-sized array type with a given expression might end up
returning a non-canonical type; see through that non-canonical type to
the underlying canonical type. Yes, I have a test case; no, I can't
reduce it to the point where it's worth checking in :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85633 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
87a924e37dc40c6e3e2b33d1dbd646aeccf4c15b 30-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix a crazy canonical-types bug because canonicalizing a
dependently-sized array type with a given expression might end up
returning a non-canonical type; see through that non-canonical type to
the underlying canonical type. Yes, I have a test case; no, I can't
reduce it to the point where it's worth checking in :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85633 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
82e297e6fad97051d4fdf3ef7b0a18f0ce3cc3aa 30-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> When looking for a copy-assignment operator to determine the cv-qualifiers on its argument type, ignore assignment operator templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85629 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
682054c52e8e7ebd7280e13d2cb26f8a9a17485a 30-Oct-2009 Douglas Gregor <dgregor@apple.com> When looking for a copy-assignment operator to determine the cv-qualifiers on its argument type, ignore assignment operator templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85629 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
01530b13a7a16858a8505fa90499e7ccae7baa35 30-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> This patch computes composite type of two objective-c expressions
used in a conditional expression by finding the most-derived common
super class of the two and qualifies the resulting type by the
intersection of the protocl qualifier list of the two objective-c
pointer types. ( this is continuation of radar 7334235).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85554 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e23fa2d0e84d1b878e012442a726c664216a9adf 30-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> This patch computes composite type of two objective-c expressions
used in a conditional expression by finding the most-derived common
super class of the two and qualifies the resulting type by the
intersection of the protocl qualifier list of the two objective-c
pointer types. ( this is continuation of radar 7334235).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85554 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
691c8c98e422ea1cfbcd14006b874c0fc1f90714 30-Oct-2009 Anders Carlsson <andersca@mac.com> Add a CK_DerivedToBaseMemberPointer cast kind and use it in Sema (Still no codegen).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85552 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1a31a18db9d657751f38c724adc0d62e86852bd7 30-Oct-2009 Anders Carlsson <andersca@mac.com> Add a CK_DerivedToBaseMemberPointer cast kind and use it in Sema (Still no codegen).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85552 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
abe84d3316a002df684a595d9bfa54e9bc3e64fb 30-Oct-2009 Mike Stump <mrs@apple.com> Fix one more bug with __builtin_object_size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85538 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3f0147e161df4725ff15fbb731f4f727afcc229f 30-Oct-2009 Mike Stump <mrs@apple.com> Fix one more bug with __builtin_object_size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85538 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3d3c085b441678d5cac46322c10be9d35ddeb813 29-Oct-2009 Steve Naroff <snaroff@apple.com> - Add/tweak some comments.
- change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl().

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85528 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0d69b8cc8e90a9364771837cb42d7031b4cbb984 29-Oct-2009 Steve Naroff <snaroff@apple.com> - Add/tweak some comments.
- change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl().

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85528 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f2b0ec41ad26b45739b1e56198f8173e575a13f8 29-Oct-2009 Mike Stump <mrs@apple.com> Fix some issues Daniel pointed out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85526 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
980ca220848d27ef55ef4c2d37423461a8ed0da3 29-Oct-2009 Mike Stump <mrs@apple.com> Fix some issues Daniel pointed out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85526 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9260ee905bf6adf1084464ae9abe6a68c2e59cd3 29-Oct-2009 John McCall <rjmccall@apple.com> A few TemplateArgumentLoc clean-ups. Try to remember the Expr for a declaration.
Provide an API for getting the SourceRange of a TAL and use it judiciously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85520 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
828bff2079b6a91ecd7ed5b842c59527d7682789 29-Oct-2009 John McCall <rjmccall@apple.com> A few TemplateArgumentLoc clean-ups. Try to remember the Expr for a declaration.
Provide an API for getting the SourceRange of a TAL and use it judiciously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85520 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.cpp
588613178e3a10e2b840c8f4db9e058f2fec0005 29-Oct-2009 John McCall <rjmccall@apple.com> Track source information for template arguments and template specialization
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
833ca991c1bfc967f0995974ca86f66ba1f666b5 29-Oct-2009 John McCall <rjmccall@apple.com> Track source information for template arguments and template specialization
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
xpr.cpp
xprCXX.cpp
tmtProfile.cpp
emplateBase.cpp
ype.cpp
1bffadc0d7351f9d155ca1f62141cc571279f3d0 29-Oct-2009 John McCall <rjmccall@apple.com> Extract TemplateArgument into a new header just for common template
classes. Move its implementation into a new module.

This will seem marginally more justified in a bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85499 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclTemplate.cpp
emplateBase.cpp
275c10a8a4a43219f67d8d2c912ec6294d9d9af2 29-Oct-2009 John McCall <rjmccall@apple.com> Extract TemplateArgument into a new header just for common template
classes. Move its implementation into a new module.

This will seem marginally more justified in a bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85499 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclTemplate.cpp
emplateBase.cpp
7d70b6fb19b0e05447bea3ae32697c541ba31b3c 29-Oct-2009 Chris Lattner <sabre@nondot.org> optimize out some ifdefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85453 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d8ee95fd4fb8fb00ad999dffad5fa1613c68a113 29-Oct-2009 Chris Lattner <sabre@nondot.org> optimize out some ifdefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85453 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c55a11bb31cf885afdc8e62f560f356bc0fdd4a9 29-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Implement support for semantic checking and template instantiation of
class template partial specializations of member templates. Also,
fixes a silly little bug in the marking of "used" template parameters
in member templates. Fixes PR5236.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85447 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ed9c0f90b7e0811c209b95e39fe07c211c531285 29-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement support for semantic checking and template instantiation of
class template partial specializations of member templates. Also,
fixes a silly little bug in the marking of "used" template parameters
in member templates. Fixes PR5236.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85447 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
684d1911e47a3ba0677a82d1dbc0c6e273ad3dd1 29-Oct-2009 Chris Lattner <sabre@nondot.org> Implement clang support for indirect branch and address of label
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d9becd1846e2c72bf6ad283faa1b048f33dd3afe 29-Oct-2009 Chris Lattner <sabre@nondot.org> Implement clang support for indirect branch and address of label
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
36a9bd2b121814bf4fd61ae3da359e0e497610d2 28-Oct-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/7330784>. Avoid crashing on 'Class<p>' when generating meta-data for a class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85440 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
27d20a24a1b816cecbd142727d2c81af5a6a111b 28-Oct-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/7330784>. Avoid crashing on 'Class<p>' when generating meta-data for a class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85440 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
86745d0b87fdbbdee81ce226f2bc325088f25d22 28-Oct-2009 Mike Stump <mrs@apple.com> Refine __builtin_object_size. Don't try and get a size for things
that don't have sizes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85435 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
460d138c19be357414e4ab56ec880e5451f95cb4 28-Oct-2009 Mike Stump <mrs@apple.com> Refine __builtin_object_size. Don't try and get a size for things
that don't have sizes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85435 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
328dfba354e78880d5fa7077e0554ed93b371127 28-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Implement proper linkage for explicit instantiation declarations of
inlined functions. For example, given

template<typename T>
class string {
unsigned Len;

public:
unsigned size() const { return Len; }
};

extern template class string<char>;

we now give the instantiation of string<char>::size
available_externally linkage (if it is ever instantiated!), as
permitted by the C++0x standard.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85340 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7d9c3c92c90ae36d58ec21bc53c4c08e02ac3555 28-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement proper linkage for explicit instantiation declarations of
inlined functions. For example, given

template<typename T>
class string {
unsigned Len;

public:
unsigned size() const { return Len; }
};

extern template class string<char>;

we now give the instantiation of string<char>::size
available_externally linkage (if it is ever instantiated!), as
permitted by the C++0x standard.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85340 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7872ee90a6a7002574321da3fafb39ca9b035e30 28-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Type of a conditional expression with two distinct objective-c
class pointer is the most derived common class of the two.
This is <rdar://problem/7334235>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85337 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
db07b3f7cdcb505329c1280d7cf70791739a7cad 28-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Type of a conditional expression with two distinct objective-c
class pointer is the most derived common class of the two.
This is <rdar://problem/7334235>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85337 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3d1abbaaeb4ec137205e073fb41fe52326c2e2aa 27-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. Ensure we handle expressions with
side-effects up front, as when we switch to the llvm intrinsic call
for __builtin_object_size later, it will have two evaluations.

We also finish off the intrinsic version of the code so we can just
turn it on once llvm has the intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85324 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c4c9045dabfc0f0d37dea1b3eb2992654d5b2db1 27-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. Ensure we handle expressions with
side-effects up front, as when we switch to the llvm intrinsic call
for __builtin_object_size later, it will have two evaluations.

We also finish off the intrinsic version of the code so we can just
turn it on once llvm has the intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85324 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8b43240c2af348312e8b5d5bcb53018a238879a5 27-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce FunctionDecl::isInlined() to tell whether a function should
be inlined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7ced9c8529b734e313f62a3b81189d6f402f6713 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Introduce FunctionDecl::isInlined() to tell whether a function should
be inlined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
21c878fe794911621478ec927e03d3c44866ca9b 27-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclPrinter.cpp
0130f3cc4ccd5f46361c48d5fe94133d74619424 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclPrinter.cpp
df79222c1d35830ff1e38e82e01ef186bc52ede5 27-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Explicit instantiation suppresses the instantiation of non-inline
function template specializations and member functions of class
template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85300 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3b846b6c252972a6f142aa226c1e65aebd0feeca 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Explicit instantiation suppresses the instantiation of non-inline
function template specializations and member functions of class
template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85300 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cc04c7d8f91caa9fabeda99728c18407f2ba68c8 27-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> An explicit instantiation definition only instantiations those class
members that have a definition. Also, use
CheckSpecializationInstantiationRedecl as part of this instantiation
to make sure that we diagnose the various kinds of problems that can
occur with explicit instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85270 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0d03514da06dffb39a260a1228ea3fd01d196fa4 27-Oct-2009 Douglas Gregor <dgregor@apple.com> An explicit instantiation definition only instantiations those class
members that have a definition. Also, use
CheckSpecializationInstantiationRedecl as part of this instantiation
to make sure that we diagnose the various kinds of problems that can
occur with explicit instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85270 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
07677bbc5b3ebd35868bc3a2a6fd4597373485e0 27-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. Also handle stack based objects. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85174 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
660e6f79a138a30a437c02142f23e7ef4eb21b2e 27-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. Also handle stack based objects. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85174 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4e930c282a06a088e84e6b34c5bb721ed8fd52c7 26-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. When we run out of object, be sure
to clamp at 0 bytes left. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85157 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
06bc9bcc705e5fee714d4b00c3c3c9f01715c195 26-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. When we run out of object, be sure
to clamp at 0 bytes left. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85157 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
92505649c9769b18453feea32b21146cf911e35a 26-Oct-2009 Mike Stump <mrs@apple.com> Be sure to zero-extend. And refactor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85140 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4fc8758077ced5cdc11f30a5ed07e9af71d5787a 26-Oct-2009 Mike Stump <mrs@apple.com> Be sure to zero-extend. And refactor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85140 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d3be5cda6ab48629d28ae9f0609f526dff16eb87 26-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85136 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
64eda9e50b593f935c95bd1edc98c4bfda03f601 26-Oct-2009 Mike Stump <mrs@apple.com> __builtin_object_size refinements. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85136 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e670df714312e47c62ab4ef4d44db682a55fb604 26-Oct-2009 Chandler Carruth <chandlerc@gmail.com> Update location of DataTypes.h to reflect move in LLVM with r85086.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85087 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
9f8eb2032030482b1d3de86e9bee725d93564302 26-Oct-2009 Chandler Carruth <chandlerc@gmail.com> Update location of DataTypes.h to reflect move in LLVM with r85086.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85087 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
11cb5fb202107a6beb7c86ff7e94ecb04e0ed423 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85055 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
9994a34f6cf842721ba7723edc0b9036229fe387 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85055 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
5d2aff40095c5b16c6b1277952dd175a3d5eca97 24-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Switch alloca/sprintf to SmallString/raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84996 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f5942a44880be26878592eb052b737579349411e 24-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Switch alloca/sprintf to SmallString/raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84996 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7f96d1fe90385d6477dbff418408a5563c3022e3 24-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ba6a9bd384df475780be636ca45bcef5c5bbd19f 24-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b9624abdd8c4ab492413153adb468d648457b2ab 24-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Fix overload resolution when calling a member template or taking the
address of a member template when explicit template arguments are
provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84991 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3eefb1c4bd2c562e43f25e0dba657bb32361dd14 24-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix overload resolution when calling a member template or taking the
address of a member template when explicit template arguments are
provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84991 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
74dab4ec38eff71dc127fe27a90a60e6c2ab4403 24-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Make the local buffer overflow safe.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84981 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4d0d85c3370f2726c74ba0ece0a5e712830a1d82 24-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Make the local buffer overflow safe.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84981 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
85aba2aaed01af3b77ffa0eac5bc76292f041e48 24-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Fixe a buffer overflow problem which causes a crash
in a certain project. Need to have a permananent fix later
(FIXME added).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84980 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
60aeaddb123762e15efe7f268afe033448b70023 24-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Fixe a buffer overflow problem which causes a crash
in a certain project. Need to have a permananent fix later
(FIXME added).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84980 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b57ab7949f6b2ec0dd49f750843fab093592cacd 24-Oct-2009 John McCall <rjmccall@apple.com> Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,
but also remove some methods that cause ambiguities, and generally
make CanQual<blah> more analogous to QualType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84976 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e27ec8ad56dbf1efb2de004b90fbbb86f740e3f1 24-Oct-2009 John McCall <rjmccall@apple.com> Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,
but also remove some methods that cause ambiguities, and generally
make CanQual<blah> more analogous to QualType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84976 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4c0178018d47522afaa494620b5f8f98a808e976 24-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Correct a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84973 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
06a59bb8260ce3d52de761865dee90f90054a5cc 24-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Correct a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84973 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
54d2596d47cc4ae9067d3b05f533d2176ef8492a 23-Oct-2009 John McCall <rjmccall@apple.com> Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation. This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclPrinter.cpp
58e4677a948e80c92deeebbcd3bdd9266adda798 23-Oct-2009 John McCall <rjmccall@apple.com> Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation. This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclPrinter.cpp
48527cf92c374e24f3a06dd9ab6fd58c0004d393 23-Oct-2009 John McCall <rjmccall@apple.com> Add ASTContext::getTrivialDeclaratorInfo, which initializes a new
source info block with a single location.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84970 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a4eb74d4dfe126c686dc708fec444c85ffb73b47 23-Oct-2009 John McCall <rjmccall@apple.com> Add ASTContext::getTrivialDeclaratorInfo, which initializes a new
source info block with a single location.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84970 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1d5d81452d1e5f93f0fd6537a5909b1fcf94bb73 23-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

namespace N { int i; }
int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
a2813cec2605ce7878d1b13471d685f689b251af 23-Oct-2009 Douglas Gregor <dgregor@apple.com> Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

namespace N { int i; }
int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
4ea8425c9601895fa137f877bc784f75f20adac6 23-Oct-2009 John McCall <rjmccall@apple.com> When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
reference type. Also, preserve the original spelling of the reference type.
Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
the various ObjC TypeLocs. Preserve the spelling of protocol lists except in
the canonical form.
* Preserve some level of source type structure on parameter types, but
canonicalize on the canonical function type. This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84907 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
54e14c4db764c0636160d26c5bbf491637c83a76 23-Oct-2009 John McCall <rjmccall@apple.com> When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
reference type. Also, preserve the original spelling of the reference type.
Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
the various ObjC TypeLocs. Preserve the spelling of protocol lists except in
the canonical form.
* Preserve some level of source type structure on parameter types, but
canonicalize on the canonical function type. This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84907 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
7480534aa1979f5c8a6c1d59ede223ba21f280e5 22-Oct-2009 John McCall <rjmccall@apple.com> Canonicality is a property of qualified types, not unqualified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXInheritance.cpp
eclTemplate.cpp
467b27b9a24bdc823218ad1ad0e37673b6cc1e83 22-Oct-2009 John McCall <rjmccall@apple.com> Canonicality is a property of qualified types, not unqualified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
XXInheritance.cpp
eclTemplate.cpp
cb088463bcec05655885c6d0343f691025e131a2 22-Oct-2009 Chris Lattner <sabre@nondot.org> fix PR5265: the size of a float3 should be rounded up to its alignment.
This ensures that arrays of float3 are correctly padded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84833 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9fcfe926432f3c3f7e9a61219e55c352fd358e45 22-Oct-2009 Chris Lattner <sabre@nondot.org> fix PR5265: the size of a float3 should be rounded up to its alignment.
This ensures that arrays of float3 are correctly padded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84833 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1722951a44aeac688e05d9f9310097ef6fa233d5 22-Oct-2009 Mike Stump <mrs@apple.com> Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84817 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
083c25eea14bb4cc4ecc3ec763c60e2e609e22bd 22-Oct-2009 Mike Stump <mrs@apple.com> Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84817 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8bfdb67857d364c61550ba22301a9a8b935e32fb 22-Oct-2009 Mike Stump <mrs@apple.com> Refine collection of BlockDeclRefExprs. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84787 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
38e1627e895cd276186ebf177f75ba5d229c3fd7 22-Oct-2009 Mike Stump <mrs@apple.com> Refine collection of BlockDeclRefExprs. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84787 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3726e21e172d2456babf9a8fcb932650942e5bb3 21-Oct-2009 Mike Stump <mrs@apple.com> Complete out debug info generation for captured __block variables. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
af7b44d847d3e44c43346d508b2e55a6254b6e9d 21-Oct-2009 Mike Stump <mrs@apple.com> Complete out debug info generation for captured __block variables. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f9c1e2a127f577045d22ccdcb4a6a3d8bf4fc800 21-Oct-2009 Mike Stump <mrs@apple.com> Prep work to always preallocate BlockDeclRefExprs so that we can
generate the debug information for the first parameter to the block
invoke functions. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84737 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea26cb522e88fc86b0d1cae61dcefcfe4cc20231 21-Oct-2009 Mike Stump <mrs@apple.com> Prep work to always preallocate BlockDeclRefExprs so that we can
generate the debug information for the first parameter to the block
invoke functions. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84737 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7ab70b0f6cd7046804ab3fa21ad6631e6f021065 21-Oct-2009 John McCall <rjmccall@apple.com> Add TypeLocBuilder, an API for incrementally creating TypeLocs. Change
the API for creating DeclaratorInfos to allow callers to provide an exact
size.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
109de5ead1dfcb3bc985cddb8cb3ed5bcecad88d 21-Oct-2009 John McCall <rjmccall@apple.com> Add TypeLocBuilder, an API for incrementally creating TypeLocs. Change
the API for creating DeclaratorInfos to allow callers to provide an exact
size.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7ec499ecbdabd1c77acc30026ca9e576be629b75 20-Oct-2009 Mike Stump <mrs@apple.com> Refine the type of the first parameter to block invoke functions.
WIP. I have yet to find the magic incantation to get the structure
type to be defined. If someone has a pointer, love to hear it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84590 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
adaaad3715c9c26cdcfdfe3401a13d7b4423ddcf 20-Oct-2009 Mike Stump <mrs@apple.com> Refine the type of the first parameter to block invoke functions.
WIP. I have yet to find the magic incantation to get the structure
type to be defined. If someone has a pointer, love to hear it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84590 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
165e5d08a767201157e135e75c55b04577120fa5 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Suppress build warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84453 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
a4ee4429e2e3d974edd121e26108d2ce6378c751 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Suppress build warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84453 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
1ed2bb804102b54d62426d8aa4f60bcd6f2a6cb0 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
xpr.cpp
ype.cpp
01eb9b9683535d8a65c704ad2c545903409e2d36 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
xpr.cpp
ype.cpp
b816548812c8dcfe9080b86b900ec94396fdcdc8 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
- OS.write(II->getName() ...) -> OS << II->getNameStr()
- Avoid std::string concatenation
- Use getNameStr().str() when an std::string is really needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84437 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ype.cpp
5ffe14ca96bd662de7820f6875d3f04789a640c1 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
- OS.write(II->getName() ...) -> OS << II->getNameStr()
- Avoid std::string concatenation
- Use getNameStr().str() when an std::string is really needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84437 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ype.cpp
03b6887fba9685a66992650252b2af29759de4cf 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move clients to use IdentifierInfo::getNameStart() instead of getName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmt.cpp
tmtDumper.cpp
ype.cpp
e013d685c6689ac7ae103ee88acf573422d1ed6a 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move clients to use IdentifierInfo::getNameStart() instead of getName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmt.cpp
tmtDumper.cpp
ype.cpp
62f4687f170499c40c1da5778377b52d1d21488f 18-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Add FloatingCast to getCastKindName's list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84427 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c6b29163557d02da5d2a4a06f986f0480291f51f 18-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Add FloatingCast to getCastKindName's list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84427 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ac892b549fb25b82a60a28309837b823b45083f5 18-Oct-2009 Anders Carlsson <andersca@mac.com> Add some more cast kinds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84423 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
82debc7d282e723e58d183bfa89ddc2500a8daaf 18-Oct-2009 Anders Carlsson <andersca@mac.com> Add some more cast kinds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84423 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5cc4b067c9a94ff7a98c34b4a8b14f2643980c79 18-Oct-2009 John McCall <rjmccall@apple.com> When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly; instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter. This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type. I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it. The new function also does
The Right Thing more often, I think: e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84412 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
49a832bd499d6f61c23655f1fac99f0dd229756e 18-Oct-2009 John McCall <rjmccall@apple.com> When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly; instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter. This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type. I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it. The new function also does
The Right Thing more often, I think: e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84412 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
e067a38c9d946385fdafdca7441fed51beecb10e 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
- Really this should be simplified by the FIXME above, but I'm too deep in DFS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84392 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4b55b24410a2739c589c4b9e84a364161c9a17e5 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
- Really this should be simplified by the FIXME above, but I'm too deep in DFS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84392 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bf443dc66aaad548e33694ac8cd5be3ed7dcfe77 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add FIXME... maybe Nate will get bored? :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84389 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a2b34eb7d19d1d199a244da20afe12353e3593ac 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add FIXME... maybe Nate will get bored? :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84389 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
14c3221c184cd7305ee9c7d4514caa5c13265b78 18-Oct-2009 John McCall <rjmccall@apple.com> Clone the full Type hierarchy into the TypeLoc hierarchy. Normalize
TypeLoc class names to be $(Type classname)Loc. Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH. Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ypeLoc.cpp
51bd803fbdade51d674598ed45da3d54190a656c 18-Oct-2009 John McCall <rjmccall@apple.com> Clone the full Type hierarchy into the TypeLoc hierarchy. Normalize
TypeLoc class names to be $(Type classname)Loc. Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH. Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ypeLoc.cpp
bc86022a492369a3aad94d27958c252b56f190e5 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Simplify ExtVectorElementExpr::containsDuplicateElements().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84380 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
150274299b0bc2efda45783f99bef3f9f6e807ac 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Simplify ExtVectorElementExpr::containsDuplicateElements().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84380 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fe3b81fccf046092da96e00568865fe4045e5913 17-Oct-2009 Chris Lattner <sabre@nondot.org> teach getCorrespondingUnsignedType how to handle vectors of integers,
fixing PR4838.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84353 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6a2b9261bf9c973c7122d9d1febce24a38fa862d 17-Oct-2009 Chris Lattner <sabre@nondot.org> teach getCorrespondingUnsignedType how to handle vectors of integers,
fixing PR4838.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84353 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
824b995ee50b6d679a52f5d9e0efd910f5b37143 17-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84334 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
813a97b3eee957eac3ac1fb111b8892fb9afd0d4 17-Oct-2009 Douglas Gregor <dgregor@apple.com> Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84334 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
04b3dcd8226f569d6ff85bebdd47406fb4945cca 17-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84287 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
bdfe48ac80573e026595af91e541474dbf02565f 17-Oct-2009 Douglas Gregor <dgregor@apple.com> While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84287 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
7776acedfc946a7dd0c91c7d6f40b2eac909f560 17-Oct-2009 John McCall <rjmccall@apple.com> Allow TypeLocs to be fully initialized with a single SourceLocation. This
will be the keystone of converting existing rewrites to be rewrites on TypeLocs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84286 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
4ce74bd425dccd9d9ad6ccfc9ffbc01698a6e71a 17-Oct-2009 John McCall <rjmccall@apple.com> Allow TypeLocs to be fully initialized with a single SourceLocation. This
will be the keystone of converting existing rewrites to be rewrites on TypeLocs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84286 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
551bc1f4cd792579735f79e935d07e1a26e34d81 16-Oct-2009 Anders Carlsson <andersca@mac.com> Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84245 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
16a8904f3f5ed19158657e1da95e5902fbee66f7 16-Oct-2009 Anders Carlsson <andersca@mac.com> Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84245 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5e564fd5a07022a4603e0b4d0856ad06196a1730 16-Oct-2009 Anders Carlsson <andersca@mac.com> Add a ToVoid cast kind and start using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84241 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ebeaf2031c968143c531bfe232d7507f20c57347 16-Oct-2009 Anders Carlsson <andersca@mac.com> Add a ToVoid cast kind and start using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84241 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
32b25ab7d4b3355b804e367c90f5cd55f4c9187e 16-Oct-2009 John McCall <rjmccall@apple.com> Remove the ConstantArrayType subtypes. This information is preserved in the
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84222 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
46a617a792bfab0d9b1e057371ea3b9540802226 16-Oct-2009 John McCall <rjmccall@apple.com> Remove the ConstantArrayType subtypes. This information is preserved in the
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84222 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f445d2d26b272f4180b5c08a5c335077f594492c 15-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Simplify checking of explicit template specialization/explicit
instantiation redeclaration semantics for function template
specializations and member functions of class template
specializations. Also, record the point of instantiation for
explicit-instantiated functions and static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84188 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0a897e32a09d290aa5b375444fe33928e47168bb 15-Oct-2009 Douglas Gregor <dgregor@apple.com> Simplify checking of explicit template specialization/explicit
instantiation redeclaration semantics for function template
specializations and member functions of class template
specializations. Also, record the point of instantiation for
explicit-instantiated functions and static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84188 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6816472475db68c155dc71a0a4402b5a0f2cfb0c 15-Oct-2009 John McCall <rjmccall@apple.com> Better living through metaprogramming. Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc. Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers. Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84168 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
34a0447b8072e0da14c0980597da9d03a1495662 15-Oct-2009 John McCall <rjmccall@apple.com> Better living through metaprogramming. Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc. Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers. Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84168 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
89f408a6b2d78c18b79163415ba155c1029fab63 14-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Give explicit and implicit instantiations of static data members of
class templates the proper linkage.

Daniel, please look over the CodeGenModule bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84140 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1028c9f0afc1cc5f4951b39b7067fa57c1fea07b 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Give explicit and implicit instantiations of static data members of
class templates the proper linkage.

Daniel, please look over the CodeGenModule bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84140 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3377acc532d272744e956203abb45b6862336bcd 14-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Testing and some minor fixes for explicit template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84129 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
663b5a0be7261c29bc4c526a71cffcfa02d4153e 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Testing and some minor fixes for explicit template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84129 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
a5f23032a0ff1bd164b2ea5329335ebb57cfdb73 14-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Member function templates (and instantiations/specializations thereof)
are never copy constructors or copy assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84057 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
77da3f4815069dbd029823edb072425551143cb1 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Member function templates (and instantiations/specializations thereof)
are never copy constructors or copy assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84057 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9d731dbc401f2cd8cf729e60b98fb036c2f8a593 14-Oct-2009 Chris Lattner <sabre@nondot.org> fix test/CodeGen/statements.c on 32-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84039 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
430656e1c392dcd9f17fe91a495421d69fca1bc8 14-Oct-2009 Chris Lattner <sabre@nondot.org> fix test/CodeGen/statements.c on 32-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84039 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
db056de08969d15cbc275de3e955db2f375ff8ae 13-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> When explicitly specializing a member that is a template, mark the
template as a specialization. For example, this occurs with:

template<typename T>
struct X {
template<typename U> struct Inner { /* ... */ };
};

template<> template<typename T>
struct X<int>::Inner {
T member;
};

We need to treat templates that are member specializations as special
in two contexts:

- When looking for a definition of a member template, we look
through the instantiation chain until we hit the primary template
*or a member specialization*. This allows us to distinguish
between the primary "Inner" definition and the X<int>::Inner
definition, above.
- When computing all of the levels of template arguments needed to
instantiate a member template, don't add template arguments
from contexts outside of the instantiation of a member
specialization, since the user has already manually substituted
those arguments.

Fix up the existing test for p18, which was actually wrong (but we
didn't diagnose it because of our poor handling of member
specializations of templates), and add a new test for member
specializations of templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83974 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
fd056bc86a8b22a9421b5d921bbca276d0f9d0f7 13-Oct-2009 Douglas Gregor <dgregor@apple.com> When explicitly specializing a member that is a template, mark the
template as a specialization. For example, this occurs with:

template<typename T>
struct X {
template<typename U> struct Inner { /* ... */ };
};

template<> template<typename T>
struct X<int>::Inner {
T member;
};

We need to treat templates that are member specializations as special
in two contexts:

- When looking for a definition of a member template, we look
through the instantiation chain until we hit the primary template
*or a member specialization*. This allows us to distinguish
between the primary "Inner" definition and the X<int>::Inner
definition, above.
- When computing all of the levels of template arguments needed to
instantiate a member template, don't add template arguments
from contexts outside of the instantiation of a member
specialization, since the user has already manually substituted
those arguments.

Fix up the existing test for p18, which was actually wrong (but we
didn't diagnose it because of our poor handling of member
specializations of templates), and add a new test for member
specializations of templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83974 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
62177111c9fddf48eab22cca11110bd47977cbba 13-Oct-2009 Chris Lattner <sabre@nondot.org> Teach sema and codegen about the difference between address of labels,
which is a common idiom to improve PIC'ness of code using the addr of
label extension. This implementation is a gross hack, but the only other
alternative would be to teach evalutate about this horrid combination.
While GCC allows things like "&&foo - &&bar + 1", people don't use this
in practice. This implements PR5131.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83957 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3ae9f48ae0d07a5aa352bf03c944f557a5ac4c95 13-Oct-2009 Chris Lattner <sabre@nondot.org> Teach sema and codegen about the difference between address of labels,
which is a common idiom to improve PIC'ness of code using the addr of
label extension. This implementation is a gross hack, but the only other
alternative would be to teach evalutate about this horrid combination.
While GCC allows things like "&&foo - &&bar + 1", people don't use this
in practice. This implements PR5131.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83957 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
128121838edc20d691df3eff6506d88dbf28d81c 13-Oct-2009 Chris Lattner <sabre@nondot.org> make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83940 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bc8d42c6f1565c0b2f93ad524edebfd7a4e6cac6 13-Oct-2009 Chris Lattner <sabre@nondot.org> make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83940 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c176c0af307cfcd6cd9d9069ac7fb29d8da1d4bf 12-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83890 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
b3ae4fcd4314a9c1c46d41b200883599c32025b4 12-Oct-2009 Douglas Gregor <dgregor@apple.com> Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83890 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
52f24e6d2307a19eacc5fb393d59b9a131df96b2 12-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Use CanQualType (instead of QualType) to store collection of visible
canonical conversion types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83869 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f4e462c2c2f4cb76c5a75d952adeb4355f32f6a7 12-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Use CanQualType (instead of QualType) to store collection of visible
canonical conversion types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83869 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
de974e4207c428f0953af0e2c05d66a7b6c394a5 09-Oct-2009 John McCall <rjmccall@apple.com> Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines. Call out uses which assume a single
result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f36e02d4aff98bf2e52e342e0038d4172fbb5e64 09-Oct-2009 John McCall <rjmccall@apple.com> Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines. Call out uses which assume a single
result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ec0240c63cbf1e94db49fc2dd03c33988925ba53 09-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Installation of Clang libraries and headers, from Axel Naumann!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83582 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
14ea5696417a8e8d244a07091284cdeba57c6d4d 09-Oct-2009 Douglas Gregor <dgregor@apple.com> Installation of Clang libraries and headers, from Axel Naumann!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83582 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
618363d21a50b6ce4fe7a4565d3cac125dbfbdad 08-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Implement [expr.mptr.oper]p6 for '->*' operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83562 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
27d4be5b3f455275ff6b6afe5ce155d6435081d7 08-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Implement [expr.mptr.oper]p6 for '->*' operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83562 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ee25955ef5c9d6eefc9333080c22e76eedc96c7d 08-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Refactoring to further simplify collection of visible conversion
functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83552 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
12af63bd2498c1af44b9a50eb0de5839487809d4 08-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Refactoring to further simplify collection of visible conversion
functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83552 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
89f31cf5d2248186424147302dc1bfeadcd3528c 08-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f6b1185f0a8a209c06dfc1efdb6a59cc851e970c 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f044bb1ea8e4a0d6840a7638ae8e8fd054c6917b 08-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
251b4ff2578e26959a4c036140ccd61c5e9292f2 08-Oct-2009 Douglas Gregor <dgregor@apple.com> For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
193fb2be18e531ad344bf02099a72fd05b17d846 08-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of whether a member function instantiated from a member
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83509 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2db323294ac02296125e1e0beb4c3595992e75bb 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Keep track of whether a member function instantiated from a member
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83509 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
68a8293229299e6d6593c18c828ec27736101ca4 07-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes problem in finding visible convertion functions of a class
where matching conversion types in base classes were still visible.
Plus refactoring and cleanup.
Added a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83485 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0351a1e2e17c1edf27f90c23fbf65d8fcad995c4 07-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes problem in finding visible convertion functions of a class
where matching conversion types in base classes were still visible.
Plus refactoring and cleanup.
Added a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83485 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
52b65bfee21a591797b4d74d41de121867469de2 07-Oct-2009 Mike Stump <mrs@apple.com> Fix eof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83433 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
82109bd64a8494c801263c11f4d2294f47e21807 07-Oct-2009 Mike Stump <mrs@apple.com> Fix eof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83433 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.cpp
c54f652cb72837e087f396dfbcf6dbeaa500c08d 06-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
XXInheritance.cpp
a8f32e0965ee19ecc53cd796e34268377a20357c 06-Oct-2009 Douglas Gregor <dgregor@apple.com> Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
XXInheritance.cpp
9e7f9b017f7b6d4072c7d7f3ada980ec822a34c7 06-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Refixed pr5086 by letting Expr::isNullPointerConstant
handle checking for a null pointer for a zero-valued
enumerator; moving the test case from CodeGen to Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83350 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
56fc0d18caf9c829647a5e3ce35197f0d7e0feee 06-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Refixed pr5086 by letting Expr::isNullPointerConstant
handle checking for a null pointer for a zero-valued
enumerator; moving the test case from CodeGen to Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83350 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bf61958d1d40c54ab73946acf3c0f1baa10054b6 05-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> tweaked my last patch to 1) preserve the protocol in
extension class's protocol list so its AST is complete.
2) Because of this no need to issue warning on unimplemeted
methods coming from the extended class protocols
because warning is issued when class definition is seen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83326 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b106fc635b1523952332131785b700453a936e49 05-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> tweaked my last patch to 1) preserve the protocol in
extension class's protocol list so its AST is complete.
2) Because of this no need to issue warning on unimplemeted
methods coming from the extended class protocols
because warning is issued when class definition is seen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83326 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7eb9e2e342729219ed2dc0c39b80710db97f5547 05-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement Protocols on class extensions.
<rdar://problem/7269631> Protocols on class extensions don't work



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83322 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
339798eae1eb61c50ca68766ed028c0a16d0a284 05-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement Protocols on class extensions.
<rdar://problem/7269631> Protocols on class extensions don't work



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83322 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a8c2a718fb630c03598280c5e8176a5331c6b88e 03-Oct-2009 Anders Carlsson <andersca@mac.com> Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
26bc220377705292a0519a71d3ea3aef68fcfec6 03-Oct-2009 Anders Carlsson <andersca@mac.com> Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b36cf1c496192714a73be212156f9215d35276bd 02-Oct-2009 Steve Naroff <snaroff@apple.com> - Remove Sema::FindMethodInNestedImplementations().
- Add ObjCInterfaceDecl::lookupPrivateInstanceMethod().
- Convert clients.

No functionality change - One less method in Sema:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83224 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d789d3d985e28c9404e62157af46dcb7331920e0 02-Oct-2009 Steve Naroff <snaroff@apple.com> - Remove Sema::FindMethodInNestedImplementations().
- Add ObjCInterfaceDecl::lookupPrivateInstanceMethod().
- Convert clients.

No functionality change - One less method in Sema:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83224 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
df41c4d4174d9d12829544508c9786d9e2290915 01-Oct-2009 John McCall <rjmccall@apple.com> Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9aeed32282fe8a775c24c01c923717ca86695685 01-Oct-2009 John McCall <rjmccall@apple.com> Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0afd9f4ac27a7cef40c7a879f4b3fac0c612a218 30-Sep-2009 John McCall <rjmccall@apple.com> Desugaring optimizations. Add single-step desugaring methods to all
concrete types. Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate. Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83116 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bf1cc05907ceb2081e8158b26f3d3f48b31caad3 30-Sep-2009 John McCall <rjmccall@apple.com> Desugaring optimizations. Add single-step desugaring methods to all
concrete types. Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate. Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83116 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7c10e9e6304a7ab7175c9bdadf5c75b39db1b856 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Pull TypeLocVisitor into its own header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
0c411806d540f7158bf12fee5c10f7de2647de76 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pull TypeLocVisitor into its own header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
96eac694184d88ab34e621e7d44f3dc526927398 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ObjCInterfaceLoc which provides type source information for ObjC interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83097 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
eb66759e9a1d7c041354d132a14674b2d948059b 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCInterfaceLoc which provides type source information for ObjC interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83097 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
225d6ca735de81dfb9bdc95645e30c6ba9514f43 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListLoc for keeping source location information for protocol references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83094 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
f352bddf015e537350416c296dd2963524f554f9 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListLoc for keeping source location information for protocol references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83094 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
3921aa9c84f6876fdf2b7feb596ccb94fb83989e 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListType type subclass.

This is used only for keeping detailed type source information for protocol references,
it should not participate in the semantics of the type system.

Its protocol list is not canonicalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83093 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
24fab41057e4b67ed69a6b4027d5ae0f2f6934dc 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListType type subclass.

This is used only for keeping detailed type source information for protocol references,
it should not participate in the semantics of the type system.

Its protocol list is not canonicalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83093 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
6cbe8f397e8fd4aa01310bcefdcbe36639eea7e0 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce Type::getTypeClassName() that returns the string associated with the TypeClass enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
cd01f17358dc8ef19338c0e2321138dd0a6160d9 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Type::getTypeClassName() that returns the string associated with the TypeClass enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7c9745c42bd7714a8f52bc5039bc65809da9e30c 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce TypeLoc::getSourceRange().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83089 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
68006af18fb880cd8547ce797152111b810aa0ba 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce TypeLoc::getSourceRange().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83089 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.cpp
0a1f4eb1b3533b9fc898feb44cb6c09da5d97ff8 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> -Introduce TypeLoc::getOpaqueData()
-Make TypeLoc's constructor public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83088 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b735471f3848065120d7210e557b5f0d37ed4c43 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Introduce TypeLoc::getOpaqueData()
-Make TypeLoc's constructor public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83088 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b532d84f56b8cce3c92b8a0e4fe1d929c1d067cf 29-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Handle C++ delete expressions when the overloaded delete operator is a
"usual deallocation function" with two arguments. CodeGen will have to
handle this case specifically, since the value for the second argument
(the size of the allocated object) may have to be computed at run
time.

Fixes the Sema part of PR4782.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83080 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9091656e423f2354e53b2b3baa95b3eb5510badc 29-Sep-2009 Douglas Gregor <dgregor@apple.com> Handle C++ delete expressions when the overloaded delete operator is a
"usual deallocation function" with two arguments. CodeGen will have to
handle this case specifically, since the value for the second argument
(the size of the allocated object) may have to be computed at run
time.

Fixes the Sema part of PR4782.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83080 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cff17421f6486c8baf51cea99a95d486f2ee735f 29-Sep-2009 Mike Stump <mrs@apple.com> Fix http://llvm.org/PR5090.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83035 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
740256bafbba6c5b5cb95a5c5bd7db161f3b2833 29-Sep-2009 Mike Stump <mrs@apple.com> Fix http://llvm.org/PR5090.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83035 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
986d177fbc817b81035ef75f152ce9070d9f63d7 28-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Add all of the C99 complex builtins prefixed with __builtin_

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83020 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d3a23b238a2b2c0f11e6ac4951c7410a8c5717bf 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Add all of the C99 complex builtins prefixed with __builtin_

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83020 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
76ee308b7fc21f689473a9138a5562d6ee8c89f1 26-Sep-2009 Anders Carlsson <andersca@mac.com> Make Decl::dump const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82878 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
f88df8652e0726fe9eee5d78f92e3c5b34d0a537 26-Sep-2009 Anders Carlsson <andersca@mac.com> Make Decl::dump const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82878 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8ecca4009bed8362b809f4729d81ba705f020455 26-Sep-2009 Anders Carlsson <andersca@mac.com> Address comment from Daniel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82865 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ff2460883bd4b0760c4ca36c7f024e34c78b9e12 26-Sep-2009 Anders Carlsson <andersca@mac.com> Address comment from Daniel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82865 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
9b5d0b54bdcdcd2daa3e2ebfbf5060950829a15d 26-Sep-2009 Anders Carlsson <andersca@mac.com> Rename NextOffset to DataSize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82832 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a223935e5cf82e939e1ca1da4111d63025a04e39 26-Sep-2009 Anders Carlsson <andersca@mac.com> Rename NextOffset to DataSize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82832 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
1bd9024313606bcc4edb4e86d7fa22e500faba89 26-Sep-2009 Anders Carlsson <andersca@mac.com> Start at NextOffset when laying out bases as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82831 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
dfde681bddd525fd8dcebc98865ff74682d8b833 26-Sep-2009 Anders Carlsson <andersca@mac.com> Start at NextOffset when laying out bases as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82831 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
66ea6860b413b0b878c6f037ca80a200060ef2bf 26-Sep-2009 Anders Carlsson <andersca@mac.com> Use NextOffset when laying out a field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82828 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
7e41038723bf77132674f55b12f60e24e5473b33 26-Sep-2009 Anders Carlsson <andersca@mac.com> Use NextOffset when laying out a field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82828 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
9ad014ccec780dacf2865d035615009f3717a47f 25-Sep-2009 Anders Carlsson <andersca@mac.com> Even more work on empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82770 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1eca99b815e531eba63233c0558af0dc971387aa 25-Sep-2009 Anders Carlsson <andersca@mac.com> Even more work on empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82770 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a983907aeaeb7e1d5c5a951bdfa01be03d0a314d 25-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> Fix MSVC build by renaming a variable. PR5043

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bdbeeb50c5d182c591bd8797dc0485921df19e9d 25-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> Fix MSVC build by renaming a variable. PR5043

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eadb1e8ff5a7d778576df4c4d7ce0eadc3fd867e 25-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Fix checking for a null pointer constant when the expression itself is
value-dependent. Audit (and fixed) all calls to
Expr::isNullPointerConstant() to provide the correct behavior with
value-dependent expressions. Fixes PR5041 and a crash in libstdc++
<locale>.

In the same vein, properly compute value- and type-dependence for
ChooseExpr. Fixes PR4996.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82748 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ce94049b69f75b44c18584fe79cd238978b6b0d5 25-Sep-2009 Douglas Gregor <dgregor@apple.com> Fix checking for a null pointer constant when the expression itself is
value-dependent. Audit (and fixed) all calls to
Expr::isNullPointerConstant() to provide the correct behavior with
value-dependent expressions. Fixes PR5041 and a crash in libstdc++
<locale>.

In the same vein, properly compute value- and type-dependence for
ChooseExpr. Fixes PR4996.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82748 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a61dc35f27f61c97297121f7c6eca4678d4ee9a6 25-Sep-2009 Anders Carlsson <andersca@mac.com> Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82746 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a4c6081abd5582515b110bdcb576b4b85536467b 25-Sep-2009 Anders Carlsson <andersca@mac.com> Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82746 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
ad571b45cadf91b0ce32dc47a0b591bc4d31130a 25-Sep-2009 Anders Carlsson <andersca@mac.com> Handle array fields that contain empty structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82744 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
fbbce49c116aa8c8c7c0707cb6048b55f70461a9 25-Sep-2009 Anders Carlsson <andersca@mac.com> Handle array fields that contain empty structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82744 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.cpp
89d0fafc6c5d745d700f7a8bd3d4d44186166f65 25-Sep-2009 Anders Carlsson <andersca@mac.com> More work on empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82736 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
6026504302763f74102592602b392cecd5ced3ae 25-Sep-2009 Anders Carlsson <andersca@mac.com> More work on empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82736 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
451b7b9a60208869cf5d6d958134cb104343949f 25-Sep-2009 John McCall <rjmccall@apple.com> Make it really, really easy to change the alignment of Type (and ExtQuals).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82730 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6b304a0254a13f42390b865ff5ba668a49cc58ae 25-Sep-2009 John McCall <rjmccall@apple.com> Make it really, really easy to change the alignment of Type (and ExtQuals).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82730 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
04f30d3ffeaf87f6db1cc6664901b73569f9753f 25-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> WIP implementation of explicit function template specialization. This
first implementation recognizes when a function declaration is an
explicit function template specialization (based on the presence of a
template<> header), performs template argument deduction + ambiguity
resolution to determine which template is being specialized, and hooks

There are many caveats here:
- We completely and totally drop any explicitly-specified template
arguments on the floor
- We don't diagnose any of the extra semantic things that we should
diagnose.
- I haven't looked to see that we're getting the right linkage for
explicit specializations

On a happy note, this silences a bunch of errors that show up in
libstdc++'s <iostream>, although Clang still can't get through the
entire header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82728 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
b9aa6b214c8fbc3e081dde575eef1f0913d48bdc 25-Sep-2009 Douglas Gregor <dgregor@apple.com> WIP implementation of explicit function template specialization. This
first implementation recognizes when a function declaration is an
explicit function template specialization (based on the presence of a
template<> header), performs template argument deduction + ambiguity
resolution to determine which template is being specialized, and hooks

There are many caveats here:
- We completely and totally drop any explicitly-specified template
arguments on the floor
- We don't diagnose any of the extra semantic things that we should
diagnose.
- I haven't looked to see that we're getting the right linkage for
explicit specializations

On a happy note, this silences a bunch of errors that show up in
libstdc++'s <iostream>, although Clang still can't get through the
entire header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82728 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
3ddc81456e4ee7e1017f17860053f3eec505a50e 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
tmtDumper.cpp
ype.cpp
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
tmtDumper.cpp
ype.cpp
caf6c0ffdf2b278e1b8457bc64b916b26bda3dbd 24-Sep-2009 Anders Carlsson <andersca@mac.com> More improvements with laying out empty bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82682 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ffbdefc7a24c01a0f77425423278774796a3aa53 24-Sep-2009 Anders Carlsson <andersca@mac.com> More improvements with laying out empty bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82682 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
e8bf526845ab85a5cc05c319b663e3b8360d5716 24-Sep-2009 Anders Carlsson <andersca@mac.com> More work on empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82679 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1345bd2b093e78620c32f5148b1279ed290188e8 24-Sep-2009 Anders Carlsson <andersca@mac.com> More work on empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82679 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2a39a45ff943eb58a3367efd314d5d584e83c6db 24-Sep-2009 Anders Carlsson <andersca@mac.com> Scaffolding for supporting empty bases/fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82678 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
9606149722bedfc48fc56cafc58de1139aef481d 24-Sep-2009 Anders Carlsson <andersca@mac.com> Scaffolding for supporting empty bases/fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82678 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
aa339184940ceb3aa0cac0b5cb45262796aa3341 23-Sep-2009 Chris Lattner <sabre@nondot.org> implement support for __builtin_eh_return_data_regno on x86-32 and x86-64.
This implements PR5034 and rdar://6836445.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82614 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
21fb98ee003e992b0c4e204d98a19e0ef544cae3 23-Sep-2009 Chris Lattner <sabre@nondot.org> implement support for __builtin_eh_return_data_regno on x86-32 and x86-64.
This implements PR5034 and rdar://6836445.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82614 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f7f4bb20b9ac86a6a89b74d78010c9d3160a7414 22-Sep-2009 Anders Carlsson <andersca@mac.com> If we already set a primary base, don't set it to the first nearly empty base class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82563 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
56cfdc183e6012201c7e0a45b04fe74fd1ab51e4 22-Sep-2009 Anders Carlsson <andersca@mac.com> If we already set a primary base, don't set it to the first nearly empty base class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82563 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
807822b7113ce8681539ff3f811fa578d73fb7ec 22-Sep-2009 Anders Carlsson <andersca@mac.com> Fix speling error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82562 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
8ebcdfe7992c90c22ef26c7743b6a08a6a837387 22-Sep-2009 Anders Carlsson <andersca@mac.com> Fix speling error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82562 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
99ab40c489d93734ea0494c2f998ecbd7ef4b820 22-Sep-2009 Anders Carlsson <andersca@mac.com> Explicitly initialize the PrimaryBase and PrimaryBaseWasVirtual members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82560 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0cd40e4f909b4172254c83ae7291576204a588b8 22-Sep-2009 Anders Carlsson <andersca@mac.com> Explicitly initialize the PrimaryBase and PrimaryBaseWasVirtual members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82560 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1fc329a118d55cd29f71712374a8791523124123 22-Sep-2009 Mike Stump <mrs@apple.com> Yes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82559 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a48f552c74fadd9b0c1c5d11478ef144f480fc4f 22-Sep-2009 Mike Stump <mrs@apple.com> Yes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82559 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a8ed55e1a43313f9af183d09770740019be37251 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add safe part of previous (reverted) commit, necessary to update to LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82540 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
932eb6dd3fcb3dc2d43ed3e042d12d4c9172ac71 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add safe part of previous (reverted) commit, necessary to update to LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82540 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
e9cf475532e5ec11c23413a2ab4829064d56fd5b 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Switch a few clients over to StringLiteral::getString.", this is breaking some projects, but I don't have a test case yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82539 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
f015b034159d40e7033309e50036804eb1971787 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Switch a few clients over to StringLiteral::getString.", this is breaking some projects, but I don't have a test case yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82539 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
286e7fdc93f1e40abe133dfee24eedf3c730fb80 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Switch a few clients over to StringLiteral::getString.
- Switching all of them out-of-my-current-scope-of-interest, sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82515 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
df4eee9b035cc4b95b1ea72635e7429d06b0ecc8 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Switch a few clients over to StringLiteral::getString.
- Switching all of them out-of-my-current-scope-of-interest, sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82515 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
0700c31e43f6d1805de0e8a34420b5eecec92690 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add StringLiteral::getString -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82514 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b648023da23e8b227cdda57a241db4c6f368726b 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add StringLiteral::getString -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82514 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bbb56d126f2f1c094d848a473d785c04eabe0803 22-Sep-2009 Anders Carlsson <andersca@mac.com> Store the set of indirect primary bases directly in the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82513 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3f066522342538509cf0aa4f381503b43fbdb68b 22-Sep-2009 Anders Carlsson <andersca@mac.com> Store the set of indirect primary bases directly in the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82513 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
eda27ebb43b553db8d72a3ab2b929695f39b0cb0 22-Sep-2009 Mike Stump <mrs@apple.com> Fix doc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82511 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
196efbf095d75180305a45f3033caa1003746604 22-Sep-2009 Mike Stump <mrs@apple.com> Fix doc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82511 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
17a07a1724c34d4fe8f86a945d27294b941d354f 22-Sep-2009 Anders Carlsson <andersca@mac.com> Record layout builder cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82502 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
e4feb834fb1a6b03291ed78fd32d13729b5a3c4a 22-Sep-2009 Anders Carlsson <andersca@mac.com> Record layout builder cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82502 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
cac0eaf6caa1035b6a971b32adeea895ba14715c 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
ype.cpp
183700f494ec9b6701b6efe82bcb25f4c79ba561 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclPrinter.cpp
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
ype.cpp
531c6c65a09b4c67e94d7e9a433fee53015f8cf0 18-Sep-2009 Daniel Dunbar <daniel@zuster.org> Disable questionable code for handling isNullPointerConstant on value dependent
expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82217 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f515b2268f829adfbfdb751f54d102b53ed0285c 18-Sep-2009 Daniel Dunbar <daniel@zuster.org> Disable questionable code for handling isNullPointerConstant on value dependent
expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82217 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
197ab4b0517d53bc8ac274adf14c2504a268f00c 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> Fix two crashes on value dependent expressions (shift and null-pointer check).
- Doug, please check.

- PR4940.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82129 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3f180c618970d1369726b9229c0370617e05c7cb 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> Fix two crashes on value dependent expressions (shift and null-pointer check).
- Doug, please check.

- PR4940.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82129 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
20e67548173bd3c35c233939dcf7a1fe51b34a17 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82128 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7e88a60d38b36695520e4f8d9279766ef111a662 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82128 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fdde190fae9cadfdde8ea1a5ef52eec6f294930f 17-Sep-2009 Anders Carlsson <andersca@mac.com> Temporary band-aid for handling empty classes somewhat better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82124 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b237fd6f36145c023ed12fe83f21727cbe197158 17-Sep-2009 Anders Carlsson <andersca@mac.com> Temporary band-aid for handling empty classes somewhat better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82124 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
d3752bb8f625553c35705edcd125a511162043a5 17-Sep-2009 Anders Carlsson <andersca@mac.com> When creating function types, remove any top-level CVR qualifications in the function type argument types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82093 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
83913e36c847052966d9ff60d760ea7231ed8b6b 17-Sep-2009 Anders Carlsson <andersca@mac.com> When creating function types, remove any top-level CVR qualifications in the function type argument types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82093 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d3ad986df2a0accecb98f83881ce20c3874e9d76 17-Sep-2009 John McCall <rjmccall@apple.com> Improved representation and support for friend class templates. Angst about same.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82088 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
dd4a3b0065b9a7e7b00073df415a798886c090f3 17-Sep-2009 John McCall <rjmccall@apple.com> Improved representation and support for friend class templates. Angst about same.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82088 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
fd5356c088c55119a6e4bccd62f1667219cef610 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Do not generate write-barrier in indirect assignment to
a weak object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82061 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
59a53fa3f8ea73bae52ea36d0038f76e9f10729c 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Do not generate write-barrier in indirect assignment to
a weak object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82061 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a8b75a017d2f241fb074014555f916c7bc2b86f2 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> In building list of visible conversion functions, use
result type of template convesion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81943 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a5c1294b2cf967fa80b118f504830395964ef8a2 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> In building list of visible conversion functions, use
result type of template convesion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81943 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
97eecea84f314e390f2f5c19948f063b25d4896c 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> 1) don't do overload resolution in selecting conversion
to pointer function for delete expression. 2)
Treat type conversion function and its 'const' version
as identical in building the visible conversion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81930 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8b915e7048b20b0feb60ec90c365a8eb68360cd4 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> 1) don't do overload resolution in selecting conversion
to pointer function for delete expression. 2)
Treat type conversion function and its 'const' version
as identical in building the visible conversion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81930 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
07e303a31a72a6222dc5699afa2f17158ee37491 15-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure we're comparing the canonical types when we determine
whether a constructor is a copy constructor.

Sadly, I wasn't able to get down to a test case smaller than libstdc++'s
<string>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81913 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
14e0b3d8a58d8e2d6d154c17f13e9881d3740784 15-Sep-2009 Douglas Gregor <dgregor@apple.com> Make sure we're comparing the canonical types when we determine
whether a constructor is a copy constructor.

Sadly, I wasn't able to get down to a test case smaller than libstdc++'s
<string>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81913 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cebb824cf2fb8701a7e4a744de1ab064375e1c5e 15-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Implement partial ordering of class template partial specializations
(C++ [temp.class.order]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81866 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
bf4ea56cdc376cef5a12abf6bf18dc34805c2226 15-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement partial ordering of class template partial specializations
(C++ [temp.class.order]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81866 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
e3ffcdc86649d032d1d928653a3e0807653d0931 15-Sep-2009 Anders Carlsson <andersca@mac.com> Handle reinterpret_cast between integral types and pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81837 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7f9e646b7ed47bc8e9a60031ad0c2b55031e2077 15-Sep-2009 Anders Carlsson <andersca@mac.com> Handle reinterpret_cast between integral types and pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81837 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c2fc7ee832bf89ac0f42a6b1f7ec4ecc71a9fa9f 15-Sep-2009 Anders Carlsson <andersca@mac.com> Codegen support for nullptr from C++0x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81835 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c1eb14a66fdd955aff3f957a5843295f27952bdd 15-Sep-2009 Anders Carlsson <andersca@mac.com> Codegen support for nullptr from C++0x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81835 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2a4d203b7ce58fd16f4265a9440279c3a4d48fed 14-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Using the property dot-syntax to invoke a non-eixsting
structure-valued setter should cause a user error instead of
crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81769 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c3f48cd3f08c384de50a3eeceaa79f4800a35f19 14-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Using the property dot-syntax to invoke a non-eixsting
structure-valued setter should cause a user error instead of
crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81769 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ed52be042b68b329a9ca40030e809547bc527d6c 13-Sep-2009 Eli Friedman <eli.friedman@gmail.com> Add utility to evaluate lvalues which are an offset relative to a stack
location. Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81672 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b2f295c8050fb8c141bf2cf38eed0a56e99d0092 13-Sep-2009 Eli Friedman <eli.friedman@gmail.com> Add utility to evaluate lvalues which are an offset relative to a stack
location. Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81672 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d7e072a022193d8fab49a31e5875025661e8c4fa 13-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Rework the way we determine whether an externally visible symbol is
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1fc09a92d0bffda20e06fa882388c01e192e2069 13-Sep-2009 Douglas Gregor <dgregor@apple.com> Rework the way we determine whether an externally visible symbol is
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
35f4a44b3e18caf85f8accba09e74e2ae8dd6f7e 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More improvement in building list of visible conversion
functions for a class when needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81624 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
faebcbbc7ca36e57a710f4690ee4f7fdf1d062ee 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More improvement in building list of visible conversion
functions for a class when needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81624 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
21ded519fdd8f9bf08d7f85e35920ba32d81626a 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Removed Context argument from couple of methods which don't
need them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81621 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
debc629300e4c6c774b7d2a1d3c665c2c719e803 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Removed Context argument from couple of methods which don't
need them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81621 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3b3f5749ef24073d20a9d235540ddd540bb38110 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More work toward having an access method for visible
conversion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81618 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6250921cc5bd3493a0d99fa2c32ec9716767a965 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More work toward having an access method for visible
conversion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81618 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a51c20938769d33ad75db6dfe7f7e9082999d8c7 12-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81590 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
7814e6d6645d587891293d59ecf6576defcfac92 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81590 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
4c7050d630d296460793c5dddccd09b823e0ca27 12-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Remove unnecessary ASTContext parameters from isMain and isExternC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81589 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
48a83b5e7ae4051c7c11680ac00c1fa02d610a62 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameters from isMain and isExternC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81589 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d3693926e6834c657d1b64b68f790f36daf5f8c2 12-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate FunctionDecl::getBodyIfAvailable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81588 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
af3280fadbdab6305581955c973e1229970958eb 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Eliminate FunctionDecl::getBodyIfAvailable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81588 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e5296e84db1394af4bb63ae126f2ba82418a4f72 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> No need to build the visible conversionfunction list for root class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81583 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4f213d3d7427c267776328c419044ed94783241f 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> No need to build the visible conversionfunction list for root class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81583 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b0abe0316f62bd3175cc7e34dc54ce1c27769867 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build visible conversion function list lazily and make its
first use in calling the conversion function on delete statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81576 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5346278f81930e7fd0545bbbb2fc217c6921b109 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build visible conversion function list lazily and make its
first use in calling the conversion function on delete statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81576 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6bd72d4b2c8aef8b667feb91c1144e68f712d6f4 11-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Tweak the semantics of FunctionDecl::isOutOfLine to consider an
instantiation of a member function template or member function of a
class template to be out-of-line if the definition of that function
template or member function was defined out-of-line. This ensures that
we get the correct linkage for explicit instantiations of out-of-line
definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81562 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
9f185076dc8b79c8240b20a8746da96beb3f147b 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Tweak the semantics of FunctionDecl::isOutOfLine to consider an
instantiation of a member function template or member function of a
class template to be out-of-line if the definition of that function
template or member function was defined out-of-line. This ensures that
we get the correct linkage for explicit instantiations of out-of-line
definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81562 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
f40d6390380632f6cc7964074fe97744c765c256 11-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Cleanup and test C++ default arguments. Improvements include:

- Diagnose attempts to add default arguments to templates (or member
functions of templates) after the initial declaration (DR217).
- Improve diagnostics when a default argument is redefined. Now, the
note will always point at the place where the default argument was
previously defined, rather than pointing to the most recent
declaration of the function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81548 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6cc1518b9f15ca846b8c35518eeae9557935678d 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Cleanup and test C++ default arguments. Improvements include:

- Diagnose attempts to add default arguments to templates (or member
functions of templates) after the initial declaration (DR217).
- Improve diagnostics when a default argument is redefined. Now, the
note will always point at the place where the default argument was
previously defined, rather than pointing to the most recent
declaration of the function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81548 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
541ebfb9469f442190f1d21f093a1279f6ec0a1a 11-Sep-2009 John McCall <rjmccall@apple.com> When stringizing a NamedDecl for a diagnostic, treat the template
specialization types differently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81512 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
136a6988960ac3aeb96f298da7a1a182db7217cd 11-Sep-2009 John McCall <rjmccall@apple.com> When stringizing a NamedDecl for a diagnostic, treat the template
specialization types differently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81512 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
dfdfcb0e3aa078285da702e458c88387a703afd0 11-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Diagnose VLAs as an error in C++.

Also, treat the GNU __null as an integral constant expression to match
GCC's behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81490 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
043cad21b78c6b02597cdc7b6ead32388e27ebc7 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Diagnose VLAs as an error in C++.

Also, treat the GNU __null as an integral constant expression to match
GCC's behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81490 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f1f317fd0276c0e66c7d15b016dc2b3117793e60 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a regression where write-barrier was not being generated
for block pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81479 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
75212ee91313bc1b6dd826d9b173541bc4016539 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a regression where write-barrier was not being generated
for block pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81479 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cbd44e9d76bd0481f93382976240868ce0c0efae 11-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate some "default"s in CheckICE.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81477 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f299124fe491879fed48f611f6f299382d114dd4 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Eliminate some "default"s in CheckICE.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81477 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8489c9e02a98685b2bcee1e237eb81af7c3dccaa 10-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> static_cast, reinterpret_cast, and const_cast can all be used in C++
integral constant expressions (for conversions to integer types,
naturally). I don't *think* that const_casts will ever get to this
point, but I also can't convince myself that they won't... so I've
taken the safe route and allowed the ICE checking code to look at
const_cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81453 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
59600d80b7e34e819cd25dd67f661aa1f3d9099d 10-Sep-2009 Douglas Gregor <dgregor@apple.com> static_cast, reinterpret_cast, and const_cast can all be used in C++
integral constant expressions (for conversions to integer types,
naturally). I don't *think* that const_casts will ever get to this
point, but I also can't convince myself that they won't... so I've
taken the safe route and allowed the ICE checking code to look at
const_cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81453 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4ed32e95d2de203884ed4af3d254d252137f20ba 10-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> When performing unqualified name lookup into a DeclContext, also look into
all of the parent DeclContexts that aren't represented within the
Scope chain. This fixes some name-lookup problems in out-of-line
definitions of members of nested classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81451 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
e942bbe02b6fb332d1f13d38c6e1980b416cf89a 10-Sep-2009 Douglas Gregor <dgregor@apple.com> When performing unqualified name lookup into a DeclContext, also look into
all of the parent DeclContexts that aren't represented within the
Scope chain. This fixes some name-lookup problems in out-of-line
definitions of members of nested classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81451 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
343aad6b139537dc285f667a406ccdf63da7a8d4 10-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81394 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
39da0b8145eaec7da7004f9b3645c5c9f4f63b1d 10-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81394 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
25cf760b54d3b88633827501013bc51a29b28aba 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
estedNameSpecifier.cpp
arentMap.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtProfile.cpp
tmtViz.cpp
emplateName.cpp
ype.cpp
ypeLoc.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
eclTemplate.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
estedNameSpecifier.cpp
arentMap.cpp
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtProfile.cpp
tmtViz.cpp
emplateName.cpp
ype.cpp
ypeLoc.cpp
cc00fc02fb26921c2f1f99632ea1d96aa5d4d183 09-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Initial stab at implement dependent member references to member
templates, e.g.,

x.template get<T>

We can now parse these, represent them within an UnresolvedMemberExpr
expression, then instantiate that expression node in simple cases.

This allows us to stumble through parsing LLVM's Casting.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81300 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
emplateName.cpp
3b6afbb99a1c44b4076f8e15fb7311405941b306 09-Sep-2009 Douglas Gregor <dgregor@apple.com> Initial stab at implement dependent member references to member
templates, e.g.,

x.template get<T>

We can now parse these, represent them within an UnresolvedMemberExpr
expression, then instantiate that expression node in simple cases.

This allows us to stumble through parsing LLVM's Casting.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81300 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
emplateName.cpp
ae517f55589566776bf365099bedc212b68df426 09-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More objc GC's API work for array of pointers declared
as __strong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81283 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7f4f86a2167abc116275e49c81350fc3225485e5 09-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More objc GC's API work for array of pointers declared
as __strong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81283 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6fb019f2873c3391d140d2ad99c60528568d4ad9 08-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure to access APValue's data via a char array (rather than
through an array of void*), so that we don't run afoul of the
strict-aliasing rules in C++ 3.10p15. Unfortunately, GCC 4.4 still
complains about this code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81251 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
983004686a1bfc816f7aeb47bac7e16049550278 08-Sep-2009 Douglas Gregor <dgregor@apple.com> Make sure to access APValue's data via a char array (rather than
through an array of void*), so that we don't run afoul of the
strict-aliasing rules in C++ 3.10p15. Unfortunately, GCC 4.4 still
complains about this code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81251 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
2c087d5956b1921cdb4015a493453526aa06c487 08-Sep-2009 Anders Carlsson <andersca@mac.com> Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam Weinig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81237 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
xpr.cpp
3a082d81006e7a2e01a6e431a22e21c78490ff8f 08-Sep-2009 Anders Carlsson <andersca@mac.com> Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam Weinig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81237 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
xpr.cpp
d42b0d9c2c541eb8fc8bc75a47408cd4be0efabd 08-Sep-2009 Anders Carlsson <andersca@mac.com> Clean up the CXXConstructExpr constructor, add Arg getters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81178 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
bcb11d01c034f967503bd98f28bdf458c1ab8001 08-Sep-2009 Anders Carlsson <andersca@mac.com> Clean up the CXXConstructExpr constructor, add Arg getters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81178 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1c1c520be520e9b8ef21e3f9aee761d973032792 07-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> More <sstream> removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81150 91177308-0d34-0410-b5e6-96231b3b80d8
tmtViz.cpp
05c73c5f28eac0cacc263238e8ce3f86b9e17d8e 07-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> More <sstream> removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81150 91177308-0d34-0410-b5e6-96231b3b80d8
tmtViz.cpp
eb2d9903919ab0e200639cfa38cb4cbc7f95a06d 06-Sep-2009 Anders Carlsson <andersca@mac.com> Reapply 81096, now with a fix. Spot the bug:

for (unsigned i = numargs; i < NumArgs; ++i)
Args[0] = 0;

;)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81123 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
21e1c4ea0a96bcecfe5976304d84779949058648 06-Sep-2009 Anders Carlsson <andersca@mac.com> Reapply 81096, now with a fix. Spot the bug:

for (unsigned i = numargs; i < NumArgs; ++i)
Args[0] = 0;

;)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81123 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f8aa664d57e8b14d130f0b4172e82e68f82d2400 06-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
destroying the CXXConstructExpr.", this is causing test failures across the
board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81100 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4355be0758856cf7645e264d4813831dc27ce78c 06-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
destroying the CXXConstructExpr.", this is causing test failures across the
board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81100 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0629ba100635769496d5b050b39fe5bea35ea36e 06-Sep-2009 Anders Carlsson <andersca@mac.com> Initialize default CXXConstructExpr arguments to 0. Fixes a crash when destroying the CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81096 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
657bff7ff399d08812a3b3324dbbebf68b0df07d 06-Sep-2009 Anders Carlsson <andersca@mac.com> Initialize default CXXConstructExpr arguments to 0. Fixes a crash when destroying the CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81096 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
fbec6a92f5bf5cbae1ea922f8ec04d6a6d18682f 05-Sep-2009 John McCall <rjmccall@apple.com> Start emitting ElaboratedTypes in C++ mode. Support the effort in various
ways: remove elab types during desugaring, enhance pretty-printing to allow
tags to be suppressed without suppressing scopes, look through elab types
when associating a typedef name with an anonymous record type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81065 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
ype.cpp
2191b20bfb31fc0e22a158f6b4204cd0b7dbd0fd 05-Sep-2009 John McCall <rjmccall@apple.com> Start emitting ElaboratedTypes in C++ mode. Support the effort in various
ways: remove elab types during desugaring, enhance pretty-printing to allow
tags to be suppressed without suppressing scopes, look through elab types
when associating a typedef name with an anonymous record type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81065 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
ype.cpp
379448fc7bc91bba33e3d2df073f6cf011960b96 05-Sep-2009 John McCall <rjmccall@apple.com> Basic support for representing elaborated type specifiers
directly in the AST. The current thinking is to create these
only in C++ mode for efficiency. But for now, they're not being
created at all; patch to follow.

This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.

Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81057 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
7da2431c23ef1ee8acb114e39692246e1801afc2 05-Sep-2009 John McCall <rjmccall@apple.com> Basic support for representing elaborated type specifiers
directly in the AST. The current thinking is to create these
only in C++ mode for efficiency. But for now, they're not being
created at all; patch to follow.

This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.

Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81057 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
8e7e4609012900d1a0eafafb49b5089acddf5b7a 05-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81053 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d0e3daf2b980b505e535d35b432c938c6d0208ef 05-Sep-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81053 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3e36851cc872a3e8461234e69642852d46b545ce 04-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81009 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
a71d819bb8f50c28938db0f2867d3fb6e2ce5910 04-Sep-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81009 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtProfile.cpp
d973a5b70656235344c32934cb677ff349ee4c31 04-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> When searching for a default constructor or copy constructor, skip constructor templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81002 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d93bacf13bda3055a51a1160bca5e8d851d67eb7 04-Sep-2009 Douglas Gregor <dgregor@apple.com> When searching for a default constructor or copy constructor, skip constructor templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81002 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fd02518096d78c6d4ccf1156e64cd4dd34221444 04-Sep-2009 John McCall <rjmccall@apple.com> Correctly handle elaborated template ids. Still not handled properly for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80977 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f1bbbb49f06a7462476cd88166fccda5feb15cab 04-Sep-2009 John McCall <rjmccall@apple.com> Correctly handle elaborated template ids. Still not handled properly for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80977 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d4b30098043a0f4273818c5a6cec4b7ca629d22b 04-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to instantiate destructors used to destruct
base and data members when they are needed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80967 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
34374e6ce5710a91c478f69379220ff20c3e7f15 04-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to instantiate destructors used to destruct
base and data members when they are needed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80967 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f988e2228fd3d7a78ee4ad03be58bb919e7c918e 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics in variety of situations involving
reference/const data members when user has declared
the constructor. This necessitated some non-minor
refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80934 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
80545ad0f9b8e52177a8c37bd140bae0ffbd0cc6 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics in variety of situations involving
reference/const data members when user has declared
the constructor. This necessitated some non-minor
refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80934 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0f927cf843bfe5a54ad059ab17d0beeffeec2275 03-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80925 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtProfile.cpp
a38c687ef5354678b9d76a7b29354159f2b83736 03-Sep-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80925 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtProfile.cpp
4584765b41dc942a8e37a562411c473e585dd44c 03-Sep-2009 Anders Carlsson <andersca@mac.com> Add CastExpr::getCastKindName and use it in the StmtDumper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80862 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
f8ec55a104e55961f8666f773dce99bbc628298f 03-Sep-2009 Anders Carlsson <andersca@mac.com> Add CastExpr::getCastKindName and use it in the StmtDumper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80862 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
ad979bd99b8a3afa145e78d66bd8eac8d249a9c5 03-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80856 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
2700dcde044893642b9b77638e052aa90be7cd51 03-Sep-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80856 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
faa28fb5d0a3267b330425a8eee40eb9199f468a 02-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80783 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6946baf3542dcb1ed0d98d0fdda451d1c39a49c2 02-Sep-2009 Douglas Gregor <dgregor@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80783 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
31812be8a6ad32139a8837b61461f8ddc29d214c 02-Sep-2009 John McCall <rjmccall@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80745 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclPrinter.cpp
d7eff68dbbbc6b3f8dfd44f6a833c2b320a96e9a 02-Sep-2009 John McCall <rjmccall@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80745 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclPrinter.cpp
b40b119d6dbbba465ae9a967fc27abdbd83c0c30 02-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> After a conversation with Doug. I added a fix me to
where we build the constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80735 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a4ad5ab45fb0990a5076614f3cfc2eae30ab9755 02-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> After a conversation with Doug. I added a fix me to
where we build the constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80735 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
80f0075a200e7c7cec5a986723955a4285dcd82b 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> In CXXBaseOrMemberInitializer, don't confuse CtorTocall with
AnonUnionMember. Fixes PR4826.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80721 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
72f6d678c8de9f3a770e8ae5fc4979abf3940668 01-Sep-2009 Douglas Gregor <dgregor@apple.com> In CXXBaseOrMemberInitializer, don't confuse CtorTocall with
AnonUnionMember. Fixes PR4826.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80721 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b6feaf3f96a6f93e4afcc103a058f63c78f105b3 01-Sep-2009 Anders Carlsson <andersca@mac.com> Add a CK_FunctionToPointerDecay cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80719 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
b633c4ee622df81d4572ef57dac54ebed69bb9bf 01-Sep-2009 Anders Carlsson <andersca@mac.com> Add a CK_FunctionToPointerDecay cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80719 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
23026c84139c97017f9eaa148a39ff346fc0e42d 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a crasher involving template instantiation of non-dependent
expressions making use of an overloaded operator. Thanks for the test
case, Anders!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80679 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8f1d89e40ac853903916b88b850fb9638609173d 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Fix a crasher involving template instantiation of non-dependent
expressions making use of an overloaded operator. Thanks for the test
case, Anders!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80679 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
20c55141395e22b6002b42ef30fcf4238402e48c 01-Sep-2009 Anders Carlsson <andersca@mac.com> Don't assert when instantiating member references to fields in anonymous structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80657 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d8b285fee4471f393da8ee30f552ceacdc362afa 01-Sep-2009 Anders Carlsson <andersca@mac.com> Don't assert when instantiating member references to fields in anonymous structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80657 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d33e328e84080d75879182f882b578ffa7db52ab 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

x->f<int>()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80646 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
c4bf26fbdff42967d660f505a83f75a4df2cc752 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

x->f<int>()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80646 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
c1991bf37685134f7a139f22883a6c7448aa0f62 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80642 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
83f6faf37d9bf58986bedc9bc0ea897a56b4dbad 01-Sep-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80642 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
ea7c7ce3586b1a1774fe41c53267bc7c5dfad6bf 01-Sep-2009 John McCall <rjmccall@apple.com> Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80636 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ab88d97734f1260402a0c6a8f6b77bed7ed4e295 01-Sep-2009 John McCall <rjmccall@apple.com> Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80636 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
efccbec93fa2bc73800857b0208b583cb3d68d78 31-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
also be adding explicit template arguments as an additional
"adornment". No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80628 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
0979c805475d1ba49b5d6ef93c4d2ce6d2eab6ed 31-Aug-2009 Douglas Gregor <dgregor@apple.com> Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
also be adding explicit template arguments as an additional
"adornment". No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80628 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
4704044b4d5edf558d3069a17cf0d22beb3b06c9 31-Aug-2009 Daniel Dunbar <daniel@zuster.org> Fix a -Asserts warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80606 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e32ecce8a181640c2f3d3939f9a9bfe8927df767 31-Aug-2009 Daniel Dunbar <daniel@zuster.org> Fix a -Asserts warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80606 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
495ec1c2fb604a861bc6b7e83916c4deb14e8c81 30-Aug-2009 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80446 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c5573a81a83c4173c92c7e91b01371b7223d88c4 30-Aug-2009 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80446 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
65f016b033e2aea4f0892629ed4e0c5d90c00a41 29-Aug-2009 Anders Carlsson <andersca@mac.com> Add a workaround for decls that come from friend decls pointing to undeclared classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80438 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclPrinter.cpp
35eda446cdf5b4e95a80ffacbf6c7f7478c6d927 29-Aug-2009 Anders Carlsson <andersca@mac.com> Add a workaround for decls that come from friend decls pointing to undeclared classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80438 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclPrinter.cpp
f736ea0ca7292b6cf6703ab50655b4c7e328215d 29-Aug-2009 Anders Carlsson <andersca@mac.com> In DeclPrinter, assert when asked to print AS_None.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80437 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
018e9fead456a6bdcde68dba7cc1aa4a7ee8d639 29-Aug-2009 Anders Carlsson <andersca@mac.com> In DeclPrinter, assert when asked to print AS_None.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80437 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8197c48a5bedf9418f8616ee4b6ed98e4bfd2ed3 29-Aug-2009 Anders Carlsson <andersca@mac.com> Improve instantiation of UnresolvedUsingDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80434 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0d8df780aef1acda5962347a32591efc629b6748 29-Aug-2009 Anders Carlsson <andersca@mac.com> Improve instantiation of UnresolvedUsingDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80434 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
99aa43241a83ae52eaaeaa9ff64afcdca1f89d8e 29-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of mostly-unused, buggy method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80432 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
d933a0198f3ccce9c73bf2951625315b911d37bf 29-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of mostly-unused, buggy method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80432 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
73e4dbc233044fd5ad7a9efd3053275a99d540e9 29-Aug-2009 John McCall <rjmccall@apple.com> For consistency, just make friend declarations AS_public.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80420 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5fee110ac106370f75592df024001de73edced2a 29-Aug-2009 John McCall <rjmccall@apple.com> For consistency, just make friend declarations AS_public.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80420 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6d68ad4556299aea1408c20fffc9c3e9444313a7 29-Aug-2009 Anders Carlsson <andersca@mac.com> Store the SourceLocation of right parentheses in member initializers. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80416 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8c57a66a2aa59939a902ffa8c4ad0ddd5b949a21 29-Aug-2009 Anders Carlsson <andersca@mac.com> Store the SourceLocation of right parentheses in member initializers. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80416 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e6fe83ed6842d20969adf19389a2de5038d59e42 29-Aug-2009 Anders Carlsson <andersca@mac.com> Don't assert that friend declarations must have access specifiers for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80415 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
54f70e19c872f5f3fa66343ce4a1a5e0c707eb09 29-Aug-2009 Anders Carlsson <andersca@mac.com> Don't assert that friend declarations must have access specifiers for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80415 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3f3a85ad3e24e093ed92c0f16c6d3f91171d0dd0 29-Aug-2009 Anders Carlsson <andersca@mac.com> Add printing of access specifiers to DeclPrinter. The formatting is pretty bad but it works :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80402 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
0d59292581dbaa4203451709077de40e0ad72c18 29-Aug-2009 Anders Carlsson <andersca@mac.com> Add printing of access specifiers to DeclPrinter. The formatting is pretty bad but it works :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80402 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
cc6b85d68cdcb334790e64fb1cfc0b016e759b3a 29-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> path to ir-gen 12.3.1 Conversion by constructor



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80398 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
7fe5d72fbc8605b60d42d32394248ea76cf763a0 29-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> path to ir-gen 12.3.1 Conversion by constructor



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80398 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
cd2f2f1b17fa72e824a4cde8d8b27fa6dfe1abb1 28-Aug-2009 Anders Carlsson <andersca@mac.com> Improve support for using decls in the decl printer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80386 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
f53eaa59c4936f9b095e69557ce7366b26ca90cb 28-Aug-2009 Anders Carlsson <andersca@mac.com> Improve support for using decls in the decl printer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80386 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
948945747bcd09eabe2504c1798d41edcefdf92b 28-Aug-2009 Anders Carlsson <andersca@mac.com> Fix this for real.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80377 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
faccd72e2448b552f17992eaba6cfe12ec497e58 28-Aug-2009 Anders Carlsson <andersca@mac.com> Fix this for real.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80377 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7de15913bed5143cebaf1ea32eba3d26a9e4ae83 28-Aug-2009 John McCall <rjmccall@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
02cace78cf48cc26686bd5b07c78606abca13bcd 28-Aug-2009 John McCall <rjmccall@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
4e75006e36f088f43ebd712025b1742871e6d0ed 28-Aug-2009 Anders Carlsson <andersca@mac.com> Check in UnresolvedUsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80336 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
665b49c62d637d16826036118f92d35f116f3ef3 28-Aug-2009 Anders Carlsson <andersca@mac.com> Check in UnresolvedUsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80336 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
430390dc279d39481598846b973d51786cf9e357 27-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> When checking whether one declaration context encloses another, make sure to look at the primary contexts. Thanks to Eli for the test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80212 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6dd38daf1495367db8fe9e9a5cacb7420cf08e27 27-Aug-2009 Douglas Gregor <dgregor@apple.com> When checking whether one declaration context encloses another, make sure to look at the primary contexts. Thanks to Eli for the test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80212 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
e399ad4e75a7cb3e0abd0b8210f66393711d1360 27-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> 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?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80167 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
bd4c4aebe6035e7a7125470cc9f0f92511230ee3 27-Aug-2009 Douglas Gregor <dgregor@apple.com> 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?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80167 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
768dc3fe09e2a6b19c57be32418c2684b5e18a81 26-Aug-2009 Mike Stump <mrs@apple.com> More work for conversion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80142 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
be3289d0e00b89722d91b4e4e167627ff7189677 26-Aug-2009 Mike Stump <mrs@apple.com> More work for conversion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80142 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
3e208d820f141072cfbb82bee660850654932e66 26-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80056 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
dacd434c49658286c380c7b4c357d76d53cb4aa1 26-Aug-2009 Douglas Gregor <dgregor@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80056 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
c03d3303fb298ae86bf5d5d6c98755928fdbde00 26-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80044 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
495c35d291da48c4f5655bbb54d15128ddde0d4d 26-Aug-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80044 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b315db012304981bd64aabc8d8e7fd06e4aac90c 25-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Skip over bases/fields with dependent types.
Fixes pr4771.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79999 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c87efbd2cbd13e68ea771275f03d1bbd1b741e47 25-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Skip over bases/fields with dependent types.
Fixes pr4771.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79999 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
27eca86795675caa21a642efa54118644f7c4575 25-Aug-2009 Dan Gohman <gohman@apple.com> Update clang for raw_fd_ostream no longer requiring F_Force.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79991 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
b044c473a155b7e827680635c1699cb2b5b6c0ee 25-Aug-2009 Dan Gohman <gohman@apple.com> Update clang for raw_fd_ostream no longer requiring F_Force.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79991 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
665e4699310d5933ebd0548687da779a1b691e16 25-Aug-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr now returns an OwningExprResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79975 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
da3f4e2dd5938145f132be237a2ed5914cc86702 25-Aug-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr now returns an OwningExprResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79975 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a9c4b8c3f80112082fa4c7cae7aa92892195ec4c 24-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes pr4763.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79923 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
77a2b4f3618608be3e93b12df898d088f8e38337 24-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes pr4763.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79923 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0fbc71c858f622540711ca91a6cc58bc96b2935f 24-Aug-2009 Edwin Török <edwintorok@gmail.com> Fix build of clang with gcc-4.4: #include <cstdio> was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79916 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f42e4a6e089e8413247400fe58ad299193371f9c 24-Aug-2009 Torok Edwin <edwintorok@gmail.com> Fix build of clang with gcc-4.4: #include <cstdio> was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79916 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
2ec1729793a77b86a31abd65da4b93cacbdf6b34 23-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Replace cerr with errs().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79854 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
6cb7c1a43b0c8f739d1f54b7fdae5ede86033496 23-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Replace cerr with errs().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79854 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
f1cbf9ce9d4b8388b03766eb0bc19deaff96d225 23-Aug-2009 Daniel Dunbar <daniel@zuster.org> cerr -> errs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79844 91177308-0d34-0410-b5e6-96231b3b80d8
tmtViz.cpp
68eaf00dec2de004ca4dceef2664add43d454069 23-Aug-2009 Daniel Dunbar <daniel@zuster.org> cerr -> errs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79844 91177308-0d34-0410-b5e6-96231b3b80d8
tmtViz.cpp
50353f11e6421455826f76023b745df8284938c9 23-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Don't install Clang libraries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79824 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
7ebe97166a4d720a187ab08ba927027e0d32274c 23-Aug-2009 Douglas Gregor <dgregor@apple.com> Don't install Clang libraries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79824 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
24e9f340da71711f2d6c5ce842018772170616af 23-Aug-2009 Chris Lattner <sabre@nondot.org> adjust for raw_fd_ostream api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79809 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
92bcc27ada5788c5f5057fa051b2600ec27c7e17 23-Aug-2009 Chris Lattner <sabre@nondot.org> adjust for raw_fd_ostream api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79809 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
512f4ba8728430f8b7c015123fe12eecd8991dc0 23-Aug-2009 Anders Carlsson <andersca@mac.com> Add CK_NullToMemberPointer and CK_BaseToDerivedMemberPointer cast kinds. Make -ast-dump print out the cast kinds of cast expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79787 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
27a5b9b9babd1e4f8a19c5c9c0736c4b311c79b2 23-Aug-2009 Anders Carlsson <andersca@mac.com> Add CK_NullToMemberPointer and CK_BaseToDerivedMemberPointer cast kinds. Make -ast-dump print out the cast kinds of cast expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79787 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
8c860df7de4a8e2e56020ad1907b81d1c242738a 22-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79693 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
65ec1fda479688d143fe2403242cd9c730c800a1 22-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79693 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
050cabf8b5ba0448c07fca099f3bcfceb1ad77a1 21-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79658 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
dec06664a1c4d8984251083db2215875aea1c80d 21-Aug-2009 Douglas Gregor <dgregor@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79658 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
dae3e75fa046ddb930251c67b65e2f6cf97db7d0 21-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Introduce getConstantArrayElementCount API and use it in
construction/destruction of array members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79637 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0de78998e7bda473b408437053e48661b510d453 21-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Introduce getConstantArrayElementCount API and use it in
construction/destruction of array members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79637 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f07ede5977e41a441d60fefcbed3a97ee434634f 21-Aug-2009 Mike Stump <mrs@apple.com> We now support overriding base functions in vtables. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79587 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b9871a253d351e8776cfa5483d6330d5dffe4562 21-Aug-2009 Mike Stump <mrs@apple.com> We now support overriding base functions in vtables. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79587 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
42556e426eaf5b19971c2dd15c0564657fcdd235 21-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
a5d82000f7b173a0a5ce34dc8c09a03f98d9e439 21-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclTemplate.cpp
128cdc592c93af458ae89032d83dc75242eac52d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
09105f52b1f28cbb1374c27c3c70f5517e2c465d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
1931cc820eeece9852582c3c3896c8e548f698a8 20-Aug-2009 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79510 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
04e8357f6801e9ff52673e7e899a67bbabf9de93 20-Aug-2009 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79510 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1259462d1b5be9d0cc5a8e0f160bb16dcc6fffc5 19-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Update CMakeLists.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79416 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ad97866feb07ad0ab7ba6fd1cdce939ea6dcb836 19-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Update CMakeLists.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79416 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
6ae7d117d878330ed52c8c50265168678b348cae 19-Aug-2009 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a95d75769edae299816ec7fd9bbcdf1ef617c5c9 19-Aug-2009 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b17120c5d87b1b078891071188b89ec4fe6857bf 19-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
a1d5662d96465f0fddf8819d245da4d19b892eff 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclTemplate.cpp
f1a75054ec58a51b415e7cc1b317e20ec3504c32 19-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79391 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
ypeLoc.cpp
b17166c8077cd900cca83a895c43b30ea6660598 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79391 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
ypeLoc.cpp
5bb99723ed13ea4fe0d6b9bbb837b3c04daacd29 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79371 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
d2ae5aa732e8587816fd7a7be911460e337c178e 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79371 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
1c4da457d434b07b67f4d7dbb0b31351142de64d 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
154440e6a8fa6ac5bca395876d79b530b39a2c1c 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtProfile.cpp
44663db1b5b82107ccb94fe1cc08de2b1adf3fac 17-Aug-2009 David Chisnall <csdavec@swan.ac.uk> Initial patch to support definitions of id and Class from headers in Objective-C code.

This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79248 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0f436560640a1cff5b6d96f80f540770f139453f 17-Aug-2009 David Chisnall <csdavec@swan.ac.uk> Initial patch to support definitions of id and Class from headers in Objective-C code.

This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79248 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6e3a78d95abb742d9deaec2a3f4d1b84185e15ed 16-Aug-2009 Mike Stump <mrs@apple.com> Refine vbase offset calculations. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79198 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
fe3010d09cec5cd06e31a3d57fe188a04d9bfa17 16-Aug-2009 Mike Stump <mrs@apple.com> Refine vbase offset calculations. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79198 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3a8e32d8bb668f3e883a6e8c96958907341ec9b2 16-Aug-2009 Chris Lattner <sabre@nondot.org> fix my previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79191 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5e94a0d82b1f49be41c35a73106b219e3f588c8c 16-Aug-2009 Chris Lattner <sabre@nondot.org> fix my previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79191 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
66930524e2a62dd09821eebf7466899942b48fa1 16-Aug-2009 Chris Lattner <sabre@nondot.org> This is an attempt to improve loc info for 'unused result' expression
warnings, but it fails because we don't have the location of the .
and I don't understand ObjCKVCRefExpr. I'll revisit this later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79190 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a50089ec68a583d13718107c1b0c898f0903709e 16-Aug-2009 Chris Lattner <sabre@nondot.org> This is an attempt to improve loc info for 'unused result' expression
warnings, but it fails because we don't have the location of the .
and I don't understand ObjCKVCRefExpr. I'll revisit this later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79190 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
16497746dd3a8c97feedabd36be912844d45eb17 16-Aug-2009 Anders Carlsson <andersca@mac.com> Call MaybeBindToTemporary for overloaded binary and unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79173 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2d46eb21eb2c904831b0e9f75ab3523384c70e66 16-Aug-2009 Anders Carlsson <andersca@mac.com> Call MaybeBindToTemporary for overloaded binary and unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79173 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b8ff3403512a9c12cb4efd0a7e97520529ae58e6 16-Aug-2009 Anders Carlsson <andersca@mac.com> Add MaybeBindToTemporary calls for member call expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79171 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6f68027af2b6ce294a2706f23a1d3cb7ca1b8d37 16-Aug-2009 Anders Carlsson <andersca@mac.com> Add MaybeBindToTemporary calls for member call expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79171 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c57b8274f551699e29ad32707b04a1dcb0925210 16-Aug-2009 Mike Stump <mrs@apple.com> Cleanups and fixups for calculating the virtual base offsets. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79156 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
276b9f1d814f4f6551cc3000590759a34185d6da 16-Aug-2009 Mike Stump <mrs@apple.com> Cleanups and fixups for calculating the virtual base offsets. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79156 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
c9754d898b3e78085796d1c8f5c119b91904978d 16-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix test failure due to uninitialized member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79145 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
97c134ea0d41403e04cbcf0085fea3f10f21ec86 16-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix test failure due to uninitialized member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79145 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
10747ff6448c87cdfd2b438042738036ecb5de86 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Implement __is_empty. Patch by Sean Hunt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79143 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
1d954f6a0057cb55a3a5d483904a3c57d03c996f 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Implement __is_empty. Patch by Sean Hunt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79143 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4712db06c75945e8d50cbb2243a79e8bbde4e207 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4721: adjust CodeGen and ASTContext so that we have a
consistent model for handling size expressions for VLAs.

The model is essentially as follows: VLA types own their associated
expression. In some cases, we need to create multiple VLA types to
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging). If we need to create multiple types based off of
the same VLA declaration, we use the new refcounting functionality so they can
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.

I'm not particularly attached to the VLA types owning the expression,
but we're stuck with at least until someone comes up with a way
to walk the VLA expressions for a declaration.

I did the parallel fix in ASTContext for DependentSizedArrayType, but I
haven't really looked closely at it, so there might still be issues
there.

I'll clean up the code duplication in ASTContext in a followup commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79071 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bbed6b964414145b29e7b60b3e538093734ea3f8 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4721: adjust CodeGen and ASTContext so that we have a
consistent model for handling size expressions for VLAs.

The model is essentially as follows: VLA types own their associated
expression. In some cases, we need to create multiple VLA types to
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging). If we need to create multiple types based off of
the same VLA declaration, we use the new refcounting functionality so they can
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.

I'm not particularly attached to the VLA types owning the expression,
but we're stuck with at least until someone comes up with a way
to walk the VLA expressions for a declaration.

I did the parallel fix in ASTContext for DependentSizedArrayType, but I
haven't really looked closely at it, so there might still be issues
there.

I'll clean up the code duplication in ASTContext in a followup commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79071 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cb6dd8a2171c0e8e996078a91377b8e9b31c40a3 15-Aug-2009 John McCall <rjmccall@apple.com> Disable all recognition of main() in -ffreestanding. Addresses bug #4720.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
07a5c22bb6fb0674c95205ae189365bf8e1b695e 15-Aug-2009 John McCall <rjmccall@apple.com> Disable all recognition of main() in -ffreestanding. Addresses bug #4720.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
90b024c73a40a034bc7b7e3a794b7bc2c47268a7 14-Aug-2009 Anders Carlsson <andersca@mac.com> Fix spacing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78981 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0e67f9dc4d7d554f2146f2d028c5338109208485 14-Aug-2009 Anders Carlsson <andersca@mac.com> Fix spacing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78981 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
42368bbdc9866806962ce35f27ba7372410bd639 14-Aug-2009 Mike Stump <mrs@apple.com> Deconflate virtual base offsets from non-virtual base offsets.
Deconflate a virtual base primary from a non-virtual base.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78971 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
215389180617e4edb8aa95a5526509948ed1416f 14-Aug-2009 Mike Stump <mrs@apple.com> Deconflate virtual base offsets from non-virtual base offsets.
Deconflate a virtual base primary from a non-virtual base.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78971 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
d362329d1adbaf0c3a35443da349647d190c2bbe 14-Aug-2009 Mike Stump <mrs@apple.com> We can't avoid doing the work to find all the indirect primary virtual
base classes as we'll need that to layout the virtual bases...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78954 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0880e75541899bc1cdd73c50eb549110b5916c59 14-Aug-2009 Mike Stump <mrs@apple.com> We can't avoid doing the work to find all the indirect primary virtual
base classes as we'll need that to layout the virtual bases...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78954 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2eade572224815acd9b98796b5ac3fdcb2975ead 14-Aug-2009 Mike Stump <mrs@apple.com> Refine vtable layout for virtual bases and keep better track of
primaries. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78950 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
4ef980984fd0e131fca3f9e6ba15e8a79cabf88c 14-Aug-2009 Mike Stump <mrs@apple.com> Refine vtable layout for virtual bases and keep better track of
primaries. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78950 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a3b5a7a303c414f15652d0f6fea06470fcc5709f 13-Aug-2009 Mike Stump <mrs@apple.com> Prep for vbase layout refinements. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78882 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
d53cef178ddf90386d343dccfe28c531b93cfe8f 13-Aug-2009 Mike Stump <mrs@apple.com> Prep for vbase layout refinements. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78882 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
9b5a9fa38b00f4b4baf9c919671a6d0cd01156c1 13-Aug-2009 Mike Stump <mrs@apple.com> Refine virtual base layout. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78873 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
94d0bceeb3afd82293326261c793b45023fd3cab 13-Aug-2009 Mike Stump <mrs@apple.com> Refine virtual base layout. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78873 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
04500242a5c45dd1165547dcaafd88956e197edd 13-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> More toward synthesizing copy assignments. SWIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78861 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0270b8aa3f9b50ec3acd1abfd2b97377a3e1bb05 13-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> More toward synthesizing copy assignments. SWIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78861 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c819a617de6febb8a9f7599ad19df45dc30eebed 13-Aug-2009 Mike Stump <mrs@apple.com> Remove another done audit FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78847 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0a5cfd86dec28c0a3bc28742da8a19d5f63581be 13-Aug-2009 Mike Stump <mrs@apple.com> Remove another done audit FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78847 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3fb78c3a21725de3074f4be50221030d6f6aec43 13-Aug-2009 Mike Stump <mrs@apple.com> Refactor a bit and remove some FIXME audit markers, now that the code
has been audited for correctness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78846 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
02b16238a39d9b83674c3a531b6aaaf066ac95f2 13-Aug-2009 Mike Stump <mrs@apple.com> Refactor a bit and remove some FIXME audit markers, now that the code
has been audited for correctness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78846 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
11391b7e25fe03a8f380a233137d14465e1074ec 12-Aug-2009 Mike Stump <mrs@apple.com> Refine primary vbase selection ordering. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78844 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
d76264e0b20470267249660ab947197cf6d6e31f 12-Aug-2009 Mike Stump <mrs@apple.com> Refine primary vbase selection ordering. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78844 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
23a7302d3447acb67ac823ebb96eb68dea99da6d 12-Aug-2009 Nate Begeman <natebegeman@mac.com> Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78783 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
888376a2bbcfc2f047902249f8455918e2489ae1 12-Aug-2009 Nate Begeman <natebegeman@mac.com> Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78783 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6e276f160fc19305faa93ace2af00debcaea82b2 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Warn on use of property dot syntax when unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78760 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6cc670e2eb6d5bae0e41a8ab8be4f02c4a0c72cf 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Warn on use of property dot syntax when unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78760 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
434f4388c325d817906645ee3065c499dd688df7 12-Aug-2009 Anders Carlsson <andersca@mac.com> Add some information about temporaries to the statement dumper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78754 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0eca1b609a2a272b6af1a3ead48186c8a15ae9b4 12-Aug-2009 Anders Carlsson <andersca@mac.com> Add some information about temporaries to the statement dumper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78754 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
92c7b16d2d171d92187c44a2cf8fa34b0314602a 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to warn if a property which is 'assign' by default
may not implement NSCopying protocol in -fobjc-gc[-only] mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
0fd8904c5f71a11d29f67716c3ebdf7ad1c855fb 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to warn if a property which is 'assign' by default
may not implement NSCopying protocol in -fobjc-gc[-only] mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
7be34f4c71849160496fc33f5e7a1a150e9d0add 11-Aug-2009 John McCall <rjmccall@apple.com> Add a FriendClassDecl type for holding declarations of friend types in
the AST, and create such declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78719 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
c48fbdfb83a5e50fed693f0bdda3396e5b67051d 11-Aug-2009 John McCall <rjmccall@apple.com> Add a FriendClassDecl type for holding declarations of friend types in
the AST, and create such declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78719 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
a5485e6e609123a9020c42c77d30a398a947a58d 11-Aug-2009 Chris Lattner <sabre@nondot.org> Fix rdar://7126285: don't warn on unused ObjC property access
that uses "dot syntax" since it might have a side effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78704 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ab0e8873c37bfcd292a17dafc61d6baff7caf30d 11-Aug-2009 Chris Lattner <sabre@nondot.org> Fix rdar://7126285: don't warn on unused ObjC property access
that uses "dot syntax" since it might have a side effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78704 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fef75cbb293a4684ae4799d0f4211c4b78fcaf3b 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78700 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e64941280877d065a27e8cefd2a9038256d0e3ac 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78700 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3649308db6bd13b6e3ada598cad1cc40daaf504d 11-Aug-2009 John McCall <rjmccall@apple.com> Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air; you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78653 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
3f9a8a60614b763785d54ad08821745d03a4af70 11-Aug-2009 John McCall <rjmccall@apple.com> Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air; you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78653 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
7df1ff1411c12140732198a696a3a47d232c7252 11-Aug-2009 Mike Stump <mrs@apple.com> Implement more of the inductive case for vtable layout involving
virtual base primaries and improve the layout of classes with virtual
bases. WIP.

Hey, I've decided I want a change to FileCheck, I need to ensure that
the group is together, nothing in between. Can we change it to check
the match line is from the line immediately following the last matched
line, if the source for the matched line is immediately after the
source for the previously matched line?

// CHECK: 1
// CHECK: 2
// CHECK: 3

// CHECK: 4
// CHECK: 5
// CHECK: 6

would require 1 2 and 3 to be continuous in the output, and 4 5 and 6
to be continuous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78638 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
49520944c688a9d5fc78d0c2af544b825873477b 11-Aug-2009 Mike Stump <mrs@apple.com> Implement more of the inductive case for vtable layout involving
virtual base primaries and improve the layout of classes with virtual
bases. WIP.

Hey, I've decided I want a change to FileCheck, I need to ensure that
the group is together, nothing in between. Can we change it to check
the match line is from the line immediately following the last matched
line, if the source for the matched line is immediately after the
source for the previously matched line?

// CHECK: 1
// CHECK: 2
// CHECK: 3

// CHECK: 4
// CHECK: 5
// CHECK: 6

would require 1 2 and 3 to be continuous in the output, and 4 5 and 6
to be continuous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78638 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
f4805667c3f9c67ebb29bafa1ed4cb63c7b33829 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fix an indentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78624 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
89350bee4cdee96ba7cdf43c83d7878dbb3a4a00 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fix an indentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78624 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
32cea8bfffba6eab679bdd9ef4c1c70630d36b5b 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Support for anonymous union in ctor's initializer and
bunch of FIXMEs for their is-gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78623 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8c64e007d9b2f719613f7d79b0b32d2f50da9332 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Support for anonymous union in ctor's initializer and
bunch of FIXMEs for their is-gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78623 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
e85f43d31101a875a6621e43bde21dcc13d860ff 11-Aug-2009 Nate Begeman <natebegeman@mac.com> Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
2ef13e5abef0570a9f567b4671367275c05d4d34 11-Aug-2009 Nate Begeman <natebegeman@mac.com> Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
48cf40f8f2e06e54a63ff13f06a567f5cf489404 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
1df5109f475bcbc528eb1fb9fdb179dcadbb33a6 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
bc8e297c7d620cd63eeb31c641dc7f51a1076785 09-Aug-2009 Nate Begeman <natebegeman@mac.com> AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
25b4fdb9d63095448e6cbc97b8865b36b0c8cbb6 09-Aug-2009 Nate Begeman <natebegeman@mac.com> AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtProfile.cpp
6008eacb196e700b83b242499c04f893ec07266b 08-Aug-2009 Anders Carlsson <andersca@mac.com> Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78490 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a5dd722bdf2f74a1a249fe6661d96a7236aee0f0 08-Aug-2009 Anders Carlsson <andersca@mac.com> Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78490 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
c915fa76c5429bbc235d8993dc218ad20bc26e3b 08-Aug-2009 Anders Carlsson <andersca@mac.com> Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).

This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a860e755f1f9f071b6a6a2f96128a6a258f5c331 08-Aug-2009 Anders Carlsson <andersca@mac.com> Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).

This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2665057a9cbee200a2c2c0cb7b8585c698d86e52 08-Aug-2009 Anders Carlsson <andersca@mac.com> Get rid of Stmt::Clone now that we can reference count statements instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78452 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
d497206844a894a0557e927adf29b34fe960dffd 08-Aug-2009 Anders Carlsson <andersca@mac.com> Get rid of Stmt::Clone now that we can reference count statements instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78452 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
a5d06285584d8c5d4db1ebe09e6c48536b37794d 08-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
43d9d9243329b1b75d1a6efdad9f16d6fb386b8e 08-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
bea9cc83e485cc548edde19a25add74ded7cdbb1 07-Aug-2009 Mike Stump <mrs@apple.com> Add ability to generate vcall offsets for primary virtual base.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78396 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
928f1506eb38bb26a1284b876213a8f5244f6933 07-Aug-2009 Mike Stump <mrs@apple.com> Add ability to generate vcall offsets for primary virtual base.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78396 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
e7545629eb1bf23badcf749ee1ac1d944ce82e2b 07-Aug-2009 Mike Stump <mrs@apple.com> Fix some const_cast issues. This is the beginning of the rabbit hole.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78393 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
e607ed068334bacb8d7b093996b4671c6ca79e25 07-Aug-2009 Mike Stump <mrs@apple.com> Fix some const_cast issues. This is the beginning of the rabbit hole.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78393 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
53e8e4b098c89c1833abf07f79e88a9843298317 07-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Separate Stmt::Destroy into the entrypoint for destroying a statement
or expression (Destroy) from the virtual function used to actually
destroy a given expression (DoDestroy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78375 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
42602bb40aefcc2751d4078ba88aacf4d965c9bd 07-Aug-2009 Douglas Gregor <dgregor@apple.com> Separate Stmt::Destroy into the entrypoint for destroying a statement
or expression (Destroy) from the virtual function used to actually
destroy a given expression (DoDestroy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78375 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
05207215eaf409b415caa9c87d2d1db686c4c779 06-Aug-2009 Mike Stump <mrs@apple.com> Layout virtual bases. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78308 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
eb19fa948173502f47c26357c2ec41aa4be197b4 06-Aug-2009 Mike Stump <mrs@apple.com> Layout virtual bases. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78308 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
2c472967d284a585768228e998d42714c1dea7b0 06-Aug-2009 Mike Stump <mrs@apple.com> Fix spell-o.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78303 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
a71d5713ea5e14eaf07ef978cef1c3ad492311f6 06-Aug-2009 Mike Stump <mrs@apple.com> Fix spell-o.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78303 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ab3a9b1d25ed2286808c7c0edf337cc05ed9873c 06-Aug-2009 Mike Stump <mrs@apple.com> Fixup object layout when we have a primary base (it goes first). Start preping for
virtual base layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78265 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
2effeca6b4461c56c9b2d38778cd718be006f90e 06-Aug-2009 Mike Stump <mrs@apple.com> Fixup object layout when we have a primary base (it goes first). Start preping for
virtual base layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78265 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8b82eeb5416860903addcb2244445b909573421f 06-Aug-2009 Mike Stump <mrs@apple.com> Calculate the primary base class better and use that when laying down
the vtable. Still a work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78252 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
6f376336138ea719e3c4757ae046a5768043b276 06-Aug-2009 Mike Stump <mrs@apple.com> Calculate the primary base class better and use that when laying down
the vtable. Still a work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78252 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
0e4fd459db34963bed19d8028f9a5f5303e2c6c2 05-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Fix canonical type construction for function types with the noreturn
attribute. Fixes PR4865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78224 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
47259d9ca7840dd66f06f5f11da7768b23d1e0fd 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix canonical type construction for function types with the noreturn
attribute. Fixes PR4865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78224 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cfe6ae592450d8466b4d78b59ff4526266549a9a 05-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
eclarationName.cpp
50d62d1b4a98adbc83de8f8cd1379ea1c25656f7 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
eclarationName.cpp
beb68c4546bd8cbd1950ca900fd32b96762eea89 05-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Support for use of default argument in constructors.
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78132 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2eeed7bc4fd457ac57ff32ab3b02674588545f65 05-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Support for use of default argument in constructors.
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78132 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7b0b83f39b4db3fa3c48cc7bb2ca11a365da13f7 03-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments
when instantiating members of that class template partial
specialization. Fixes PR4607.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77925 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
37d93e9252026d4fb836d9c05d0122a2d46e56be 03-Aug-2009 Douglas Gregor <dgregor@apple.com> Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments
when instantiating members of that class template partial
specialization. Fixes PR4607.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77925 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
655658aed81e6cc0e9c031de9961c2fb30e385ba 02-Aug-2009 Daniel Dunbar <daniel@zuster.org> Compute end_overridden_methods in a way that keeps ENABLE_EXPENSIVE_CHECKS
happy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77850 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
637ec3237da533470fd14e64f7597934291467c7 02-Aug-2009 Daniel Dunbar <daniel@zuster.org> Compute end_overridden_methods in a way that keeps ENABLE_EXPENSIVE_CHECKS
happy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77850 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ce956abb4b478ec438d78666c0f3f98f775003ef 02-Aug-2009 Daniel Dunbar <daniel@zuster.org> Avoid accessing invalid std::vector element; this makes clang
ENABLE_EXPENSIVE_CHECKS clean on x86_64-.*-darwin10.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77831 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0908c333cc251540dfcf17ac4a9b07ea6da27aaf 02-Aug-2009 Daniel Dunbar <daniel@zuster.org> Avoid accessing invalid std::vector element; this makes clang
ENABLE_EXPENSIVE_CHECKS clean on x86_64-.*-darwin10.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77831 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7e8c9931ee0159731141425ab43afcd61ef3cc5f 31-Jul-2009 Mike Stump <mrs@apple.com> Add code to setup the vtable pointer in the constructor. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77699 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
f121677b6bbbf4e4a51ee7a1120b77adf187bad4 31-Jul-2009 Mike Stump <mrs@apple.com> Add code to setup the vtable pointer in the constructor. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77699 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ecordLayoutBuilder.cpp
56183e05894d1d78364d061176452c89b6602383 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Make canonicalization of overloaded function declarations match the
Itanium C++ ABI's name mangling, since both are related to the notion
of "equivalent" function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77678 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
6f2c46b58894d5a81ad7ed7654e3768c72aa0d74 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Make canonicalization of overloaded function declarations match the
Itanium C++ ABI's name mangling, since both are related to the notion
of "equivalent" function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77678 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
9cd2011322ead9a6b1f6483b2d1c6d76d9aadf9d 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Canonicalize template template parameters. We can't test this yet, but
it's "obviously correct" :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77677 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
a2ffb983a4db32e11860a65309e8e2b72f556763 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Canonicalize template template parameters. We can't test this yet, but
it's "obviously correct" :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77677 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
f6013a1d9d940b8cad5ffe413a7dced67ec1952f 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Canonicalize function parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77676 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
4a3f780f4f74a80f9b4bc42e38ad60170d5ebd0c 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Canonicalize function parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77676 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
e89589445d7688087024aebd4d188f3a7326e0d5 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Canonicalization and profiling for overloaded function declarations,
for those extra-esoteric cases. Not that any two given C++ compilers
agree on this test case, but this change gives us a strong definition
of equivalent types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77664 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
6ebd15e81a4d44ac51c24bffe2705586d5edffee 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Canonicalization and profiling for overloaded function declarations,
for those extra-esoteric cases. Not that any two given C++ compilers
agree on this test case, but this change gives us a strong definition
of equivalent types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77664 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
0c1d966bf0f3c5f7a787840c514c3d92fb4cbb3b 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Canonicalize dependent extended vector types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77663 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
2ec09f1dc123e1942ed756e8ee4fef86451eac9e 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Canonicalize dependent extended vector types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77663 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
8718ffafed64bce51eba9b9e3b9f86d883e77f26 31-Jul-2009 Mike Stump <mrs@apple.com> Whitespace around else canonicalization and fix 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77655 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9fdbab3cbc2fc04bcaf5768023d83707f3151144 31-Jul-2009 Mike Stump <mrs@apple.com> Whitespace around else canonicalization and fix 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77655 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7fc8ed7fb83dd8bcd680756624e290d0702d281d 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Build canonical types for dependently-sized array types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77647 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
04d4beee4b86af20a9e4457023d3925cab8f9908 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Build canonical types for dependently-sized array types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77647 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
d63e16cae1577c934a6637baebd04c2bdcd2ebf8 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Canonicalization of dependent C++0x decltype types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77643 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
9d702ae1cd5cfa19d884cbef77e1df99395138bb 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Canonicalization of dependent C++0x decltype types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77643 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
63d22fa6071690209b339451e4939de120a45e70 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Canonicalization for dependent typeof(expr) types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77639 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
ype.cpp
b197572cf1cd70a817a1f546478cb2cb9112c48e 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Canonicalization for dependent typeof(expr) types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77639 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
ype.cpp
5117b7fef27c0eb4e993732b48e30ed754248446 30-Jul-2009 Mike Stump <mrs@apple.com> Update based upon comments. Explain why we have an assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77612 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
b49ef009e431c92d73287367122b0aaa1aa60175 30-Jul-2009 Mike Stump <mrs@apple.com> Update based upon comments. Explain why we have an assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77612 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
0c67b17e6ffd0038710d4a4d67f532664e4f24e0 30-Jul-2009 Mike Stump <mrs@apple.com> We'll also need a vtable pointer if we have virtual bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77610 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
90f67083882915c2c6227839f3c2afcd64c5af3d 30-Jul-2009 Mike Stump <mrs@apple.com> We'll also need a vtable pointer if we have virtual bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77610 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
1930d2011783c0355a37ef2aa5d9e27ad4784f42 30-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Support out-of-line definitions of the members of class template
partial specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77606 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
b88e888404ad0a2bdd9bfae457e8530bb38a87c5 30-Jul-2009 Douglas Gregor <dgregor@apple.com> Support out-of-line definitions of the members of class template
partial specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77606 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
3bc07b852eefbbcd83bdfc42010582eddd715e31 30-Jul-2009 Mike Stump <mrs@apple.com> Fix type to be consistent with the rest of the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77560 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
f66eab0bc2a181dee341437ad53cddd5a633586e 30-Jul-2009 Mike Stump <mrs@apple.com> Fix type to be consistent with the rest of the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77560 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
79b2bed4cf386ebdcaa114d7a774e4e4365389b3 30-Jul-2009 Mike Stump <mrs@apple.com> Add ability to layout the vtable pointer in trivial cases. I noticed
that we would silently do bad things with virtual bases in the layout
code, so, we just turn them off. When people do better things with
them, we can turn them back on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77556 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
3dee6efcad9ad56d14f7edd1c29924f0b876a7f9 30-Jul-2009 Mike Stump <mrs@apple.com> Add ability to layout the vtable pointer in trivial cases. I noticed
that we would silently do bad things with virtual bases in the layout
code, so, we just turn them off. When people do better things with
them, we can turn them back on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77556 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
fc76c5e03c0fe5d537dac43f45d9302d2ecc4c1a 30-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> There's no point in going through the getAs<TagType> stuff to find the definition of a tag, since tags rarely have more than one or two declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77546 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e5bb6d49522f5119740a2c87e466725300fee88f 30-Jul-2009 Douglas Gregor <dgregor@apple.com> There's no point in going through the getAs<TagType> stuff to find the definition of a tag, since tags rarely have more than one or two declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77546 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
19e567a7f976257558abc106e3ace3cc2c98f561 30-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Make tag declarations redeclarable. This change has three purposes:

1) Allow the Index library (and any other interested client) to walk
the set of declarations for a given tag (enum, union, class,
whatever). At the moment, this information is not readily available.

2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
to a TagType (for which getDecl() will return the tag definition, if
one exists). This property won't exist for class template partial
specializations.

3) Make the canonical declaration of a TagDecl actually canonical,
e.g., so that it does not change when the tag is defined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77523 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
8e9e9ef5348bce1a8f0741a5684fac3de9701c28 30-Jul-2009 Douglas Gregor <dgregor@apple.com> Make tag declarations redeclarable. This change has three purposes:

1) Allow the Index library (and any other interested client) to walk
the set of declarations for a given tag (enum, union, class,
whatever). At the moment, this information is not readily available.

2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
to a TagType (for which getDecl() will return the tag definition, if
one exists). This property won't exist for class template partial
specializations.

3) Make the canonical declaration of a TagDecl actually canonical,
e.g., so that it does not change when the tag is defined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77523 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclTemplate.cpp
d00cd9ec368acf3e615d55f659eca4639044ba7d 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
ecordLayoutBuilder.cpp
ype.cpp
6217b80b7a1379b74cced1c076338262c3c980b3 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
ecordLayoutBuilder.cpp
ype.cpp
7f169884d194ae050930bf50485fc2f3ef584509 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> No longer need to keep base class offsets in the offset
table as it has its own place now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77491 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
8a8a629844d26c24dc0147d55a32a937b14b9381 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> No longer need to keep base class offsets in the offset
table as it has its own place now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77491 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
6631cb4e3387064a019f6d677356298a8f7b08b9 29-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> [llvm up]

A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
d99cbe66403ee39c2ee58024b9582b95649a4fc5 29-Jul-2009 Douglas Gregor <dgregor@apple.com> [llvm up]

A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
99eef4a6d3632a78155e7639a9f91d10b33e8218 29-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Use the new statement/expression profiling code to unique dependent
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77462 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
ype.cpp
828e226ab7ed08b3eb766549e9d3306432137460 29-Jul-2009 Douglas Gregor <dgregor@apple.com> Use the new statement/expression profiling code to unique dependent
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77462 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtProfile.cpp
ype.cpp
90e18745436d0889e8bb7fba650263b38f05694e 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Code refactoring to define getCXXRecordDeclForPointerType
and use it in several places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77411 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
a91d6a6619a91d0ca7102d8ab5678d855f04d850 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Code refactoring to define getCXXRecordDeclForPointerType
and use it in several places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77411 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
06cac85d7ff58a3fb08f792f457471eddf2de02f 29-Jul-2009 Mike Stump <mrs@apple.com> Some minor cleanups, thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f711c41dd9412a8182793259d355c4f6979ed5ed 29-Jul-2009 Mike Stump <mrs@apple.com> Some minor cleanups, thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
04580fbca3a91f56c0af18e831ca5b2702e5529d 29-Jul-2009 Mike Stump <mrs@apple.com> Some style fixes, thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77400 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fd612dbb23cd31c03c898ae53ff18d0dfd8488f9 29-Jul-2009 Mike Stump <mrs@apple.com> Some style fixes, thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77400 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4262bc9b6a07a78efce52344577130936d1f4296 29-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor the code that produces a TemplateSpecializationType, so that
canonicalization for dependent TemplateSpecializationTypes occurs
within ASTContext::getTemplateSpecializationType. Also, move template
argument canonicalization into ASTContext::getCanonicalTemplateArgument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77388 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
1275ae098acda31fe0e434510c729fcfed0458a1 29-Jul-2009 Douglas Gregor <dgregor@apple.com> Refactor the code that produces a TemplateSpecializationType, so that
canonicalization for dependent TemplateSpecializationTypes occurs
within ASTContext::getTemplateSpecializationType. Also, move template
argument canonicalization into ASTContext::getCanonicalTemplateArgument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77388 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
8a02a9c03585a5941ce0d64cdc1eb5deecdcee28 29-Jul-2009 Chris Lattner <sabre@nondot.org> remove extraneous braces


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77386 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9a5a7e7351f78345a72c4956af25590f6d40ebcd 29-Jul-2009 Chris Lattner <sabre@nondot.org> remove extraneous braces


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77386 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f2221dfb6c649cdda22c56112e55c5ee6f397908 28-Jul-2009 Anders Carlsson <andersca@mac.com> Add a field for C++ specific data to ASTRecordLayout. Use it to store the non-virtual size and alignment + base offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77352 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
b2fafd4978166114c54748a73738d8b2c3a37e2b 28-Jul-2009 Anders Carlsson <andersca@mac.com> Add a field for C++ specific data to ASTRecordLayout. Use it to store the non-virtual size and alignment + base offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77352 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
34796b6bad2b10b2517dbe4445060ea9321801e8 28-Jul-2009 Chris Lattner <sabre@nondot.org> fix PR4633: cast to void should silence the 'unused expression' warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77344 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fb84664349ca6f37f5ec4df440f6c362cca62470 28-Jul-2009 Chris Lattner <sabre@nondot.org> fix PR4633: cast to void should silence the 'unused expression' warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77344 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
78bd31d30d0abccf3b8fec908f72c5b808c5de42 28-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a typo in a comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77324 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
00aa3a64b48278a490344f72eb2405e58849b051 28-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix a typo in a comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77324 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
455cfb88523c88804f3916046221a65663208154 28-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Profiling the pointer of a canonical type is sufficient to uniquely identify the type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77321 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
d584eb25189a545d20eb196273f1f85f9a17f92a 28-Jul-2009 Douglas Gregor <dgregor@apple.com> Profiling the pointer of a canonical type is sufficient to uniquely identify the type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77321 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
2f77e81d5abbefbc37a17b4bc240ce7def2de99f 28-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Finish profile support for statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77320 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
3fe81fc59ce984e968e9dc91b232cc2740a74aa0 28-Jul-2009 Douglas Gregor <dgregor@apple.com> Finish profile support for statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77320 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
432d2f51e7598c2b09298ee8d8aaf36508ca8949 28-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Complete profile support for C++ and Objective-C expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77318 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
071f4ebbc9bc4ee6f73f9529d7997ae674b1eacb 28-Jul-2009 Douglas Gregor <dgregor@apple.com> Complete profile support for C++ and Objective-C expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77318 91177308-0d34-0410-b5e6-96231b3b80d8
tmtProfile.cpp
1a6ead2dc2ad27217b6b22572390f83013f637e9 28-Jul-2009 Daniel Dunbar <daniel@zuster.org> CallExpr's SubExprs sometimes were allocated in the wrong place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77302 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
68a049cab6015a7437bec5661601b7d37d23c70c 28-Jul-2009 Daniel Dunbar <daniel@zuster.org> CallExpr's SubExprs sometimes were allocated in the wrong place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77302 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b230eac0d43ae1952dc1c5fa8754f0dd7dce1496 28-Jul-2009 John McCall <rjmccall@apple.com> Reimplement QualifierSet using a single word, as requested by dgregor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77299 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7a1bcdf26d48c2c40e900a973f7ffca45f451526 28-Jul-2009 John McCall <rjmccall@apple.com> Reimplement QualifierSet using a single word, as requested by dgregor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77299 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
029f78742367275bc5d895d6cbe88922d8d4dcfa 28-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Implement ObjCMethodDecl::getCanonicalDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77298 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e7f9d301a10b4b3223e91d9be4362b44cba0a212 28-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement ObjCMethodDecl::getCanonicalDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77298 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0f3b8429f32a51c2bff25198295f1c155bfabffe 28-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> -Add ObjCCategoryImplDecl::getCategoryClass() which returns the category interface decl.
-Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to
a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77297 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4292073a858f72769fa405b48390620c8932f8ae 28-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Add ObjCCategoryImplDecl::getCategoryClass() which returns the category interface decl.
-Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to
a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77297 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a06e3baec8643a853934ee64b4b3fe4c5cffea3a 28-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77296 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a8530375168f578e9039837c58054d55655c981b 28-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77296 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ed2f9296431718d81ff66ebb5e677a07f870b87f 28-Jul-2009 Mike Stump <mrs@apple.com> Make longjmp a real builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
782fa308a765aeac2acb39c4e697c937ec21185b 28-Jul-2009 Mike Stump <mrs@apple.com> Make longjmp a real builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5c088cbc435fd831c7585faea59c8c7e1d06fc8a 28-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Add a Profile function for statements so that we can (eventually) determine
when statements and expressions are equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77284 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
tmtProfile.cpp
41ef0c3472a3d09c29bc1792f3d26842f2b8a695 28-Jul-2009 Douglas Gregor <dgregor@apple.com> Add a Profile function for statements so that we can (eventually) determine
when statements and expressions are equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77284 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
tmtProfile.cpp
a74be80426cab26602715a512a9ba76372764fc8 28-Jul-2009 Mike Stump <mrs@apple.com> Ensure we can work through typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77265 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e24aea225ec87b935ede6c21c964dd47a4afb810 28-Jul-2009 Mike Stump <mrs@apple.com> Ensure we can work through typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77265 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5963a2d6180c750c357f48aa09bd58316ee011e2 27-Jul-2009 Mike Stump <mrs@apple.com> Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
fd350b5b4ae557d6b74899b945e77508f33149a9 27-Jul-2009 Mike Stump <mrs@apple.com> Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
b2082e1c1199d8499f7a75e914ffbcf60c6c1d1e 27-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Make ObjCImplDecl inherit from ObjCContainerDecl.

ObjCContainerDecl now is the root class for objc decls that contain methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
aecae629269fae3bf484baf1d109e9a89d14eead 27-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make ObjCImplDecl inherit from ObjCContainerDecl.

ObjCContainerDecl now is the root class for objc decls that contain methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
beacbb1e9eca663c52a943a9149abb6c89bf0524 27-Jul-2009 Mike Stump <mrs@apple.com> Fix PR4624.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77176 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2d3c191e1d5545e1724ee6e0550c70eef54beff2 27-Jul-2009 Mike Stump <mrs@apple.com> Fix PR4624.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77176 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea8642663359c75e58104620a33e3815f24a6614 26-Jul-2009 Mike Stump <mrs@apple.com> Preserve qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77097 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6dcbc294f9b2c45680dd3227e885712c2814ec0e 26-Jul-2009 Mike Stump <mrs@apple.com> Preserve qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77097 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
088f18a9adf05f57136cdc993b67b2cf84cb34fa 26-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor ObjCImplDecl::getInstanceMethod/getClassMethod into one
ObjCImplDecl::getMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77094 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
16f06bb41b1b02ff0847bc41b89818472053d672 26-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor ObjCImplDecl::getInstanceMethod/getClassMethod into one
ObjCImplDecl::getMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77094 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9ac39f328184ba1cb6602497408741d984a53590 26-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor ObjCInterfaceDecl::lookupInstanceMethod/lookupClassMethod into one
ObjCInterfaceDecl::lookupMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77093 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
aa5420c1e36ab8e0e4bb87239d8b73a3a8ce75db 26-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor ObjCInterfaceDecl::lookupInstanceMethod/lookupClassMethod into one
ObjCInterfaceDecl::lookupMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77093 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
aba400caab2a1606f17710b609141f530adb368e 26-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor ObjCProtocolDecl::lookupInstanceMethod/lookupClassMethod into one
ObjCProtocolDecl::lookupMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77092 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
094e2bb6730d63e0f6919e4839522a43b7644181 26-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor ObjCProtocolDecl::lookupInstanceMethod/lookupClassMethod into one
ObjCProtocolDecl::lookupMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77092 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7a7757baeb9e59c543cccbc3c5c0aafeeea8b041 26-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor ObjCContainerDecl::getInstanceMethod/getClassMethod into one
ObjCContainerDecl::getMethod.

Avoids code duplication.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77091 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
467c0b165072689ef87fe8d9cd47a5b63485bcdc 26-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor ObjCContainerDecl::getInstanceMethod/getClassMethod into one
ObjCContainerDecl::getMethod.

Avoids code duplication.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77091 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1bb806498909a43a7829edb21c42606335d69694 25-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn as a type attribute, handle printing for them and handle
calls to noreturn function pointers when CFG building.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77089 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
2455636163fdd18581d7fdae816433f886d88213 25-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn as a type attribute, handle printing for them and handle
calls to noreturn function pointers when CFG building.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77089 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
a0107def0d562eeda9ea7d45039e7a054d9ac320 25-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen for non-virtual base class initialization
in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77087 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
742cd1b7bb86b52b23b335d47abbd842dac0e1bf 25-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen for non-virtual base class initialization
in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77087 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
3e2a54d3b453f66d9aebcad2899eba5d05be0009 25-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Some code refactoring per Daniel's feedback.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77030 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
08c6357918c8c4bf00ede6936c7b64c7d89e7c41 25-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Some code refactoring per Daniel's feedback.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77030 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
181fe794b8945defefc63443b15fe99a15f0a28b 24-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for static data members that are defined out-of-line.

Note that this also fixes a bug that affects non-template code, where we
were not treating out-of-line static data members are "file-scope" variables,
and therefore not checking their initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77002 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
7caa6825f42a0f7e97d6fc06233133c42b218e46 24-Jul-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for static data members that are defined out-of-line.

Note that this also fixes a bug that affects non-template code, where we
were not treating out-of-line static data members are "file-scope" variables,
and therefore not checking their initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77002 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
56bacebf94f7cce59d0719a4678416204df295ba 24-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> More work toward initialization of objects
in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76980 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
50b8eea3f36881a988a5757e0f6e15d45900324b 24-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> More work toward initialization of objects
in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76980 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
29d293b79901491af6da2e2368ea8e506402e1fe 24-Jul-2009 Steve Naroff <snaroff@apple.com> Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).

Still need back-end CodeGen for ObjCIsaExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76979 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
f242b1b0c4e998911cb96b2ba7e27ab4a5abaed3 24-Jul-2009 Steve Naroff <snaroff@apple.com> Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).

Still need back-end CodeGen for ObjCIsaExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76979 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
4af0523edc341c6e7bb4499c45ce45397f2dc979 24-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> This patch fixes the implementations of the __has_trivial_destructor
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76916 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
xprCXX.cpp
xprConstant.cpp
ype.cpp
5e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766 24-Jul-2009 Douglas Gregor <dgregor@apple.com> This patch fixes the implementations of the __has_trivial_destructor
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76916 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
xprCXX.cpp
xprConstant.cpp
ype.cpp
7c1771cc1016fac539b364f350f0e33ce11aadb2 24-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose when base classes and members to be intialized
with constructors don't have a matching constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76913 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
87595e46ccd61c9b7c08074c2c64b66b5c0fc694 24-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose when base classes and members to be intialized
with constructors don't have a matching constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76913 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
95254bc9257d9bcb425c84bbb94a0b47d5e8ee0a 23-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.

Removed the ActOnClassTemplate action, which is no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76881 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bd1099efde211cbb63fce3feee4ebcc6bac58781 23-Jul-2009 Douglas Gregor <dgregor@apple.com> Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.

Removed the ActOnClassTemplate action, which is no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76881 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
99eb86b296883b55bb49b7c56c7ffa50039b351c 23-Jul-2009 Steve Naroff <snaroff@apple.com> Remove a bunch of FIXME's related to ObjC type checking.

- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible().
- Tweak several test cases to accommodate the new/improved type checking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76830 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4084c306635b70f37029dca938444e6013f08684 23-Jul-2009 Steve Naroff <snaroff@apple.com> Remove a bunch of FIXME's related to ObjC type checking.

- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible().
- Tweak several test cases to accommodate the new/improved type checking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76830 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
898f5745d68202867f72ccbc9fb4156fc43d26a7 23-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Add constructor used to initialize base/member in
CXXBaseOrMemberInitializer AST node. Needed by
its clients to do the initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76826 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d7b27e1c17d40c72a1ccf8868315bf0c5271aa54 23-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Add constructor used to initialize base/member in
CXXBaseOrMemberInitializer AST node. Needed by
its clients to do the initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76826 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f2fedc6aa0e3f74f3c53ff33cf432ba97258c94d 22-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix some memory allocation/deallocation issues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76783 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
2aef06d3447f048ac4c9c3d2c67d643523a74993 22-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix some memory allocation/deallocation issues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76783 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
774cb9907e8f7550f9ea1c05e51e79588ed63c99 22-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix a nasty little use-after-free bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76779 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ab22c43320ae813e4f6214f48968216b7cb09b90 22-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix a nasty little use-after-free bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76779 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ce849de3017918c807c019c58dabf661527f7376 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Improved on performance of the algorithm for proper ordering of
ctor's initialization of bases and fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76776 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
aa26650966e13fc462985d9b8fbe420c01edf014 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Improved on performance of the algorithm for proper ordering of
ctor's initialization of bases and fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76776 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6eeaa783e8dafae28b0bf30d72fde8704d536f3e 22-Jul-2009 Mike Stump <mrs@apple.com> Use isa instead of dyn_cast for conditionals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8e1fab243ab8023b7ee3899745386b3b3a4258f8 22-Jul-2009 Mike Stump <mrs@apple.com> Use isa instead of dyn_cast for conditionals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f73c851b2b05f4a5eabed6227179b49802ddc53c 22-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> "This patch implements the restrictions on union members detailed in
[class.union]p1", from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76766 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
1f2023ab8b35e0f665eb6c0f11dd6d9b9bca12b8 22-Jul-2009 Douglas Gregor <dgregor@apple.com> "This patch implements the restrictions on union members detailed in
[class.union]p1", from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76766 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
1373b6f58b2d8e2c2d6865eae4a4bd06a71a001b 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Allocate BaseOrMemberInitializers and CXXBaseSpecifier nodes
via ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76758 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
71c6e714778740d98cd01252101d0aaf1efa1553 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Allocate BaseOrMemberInitializers and CXXBaseSpecifier nodes
via ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76758 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0b60cf8c244e6bf36ff3f9262b917cccf488b8a8 22-Jul-2009 Steve Naroff <snaroff@apple.com> Fix a couple recent ABI regressions noticed during code review (fallout from the ObjC type system rewrite).

It's unfortunate that the mangling includes the low-level structs. Nevertheless, we need this for binary compatibility with GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76755 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9533a7fdb8397421f3be52e879442460a87389f6 22-Jul-2009 Steve Naroff <snaroff@apple.com> Fix a couple recent ABI regressions noticed during code review (fallout from the ObjC type system rewrite).

It's unfortunate that the mangling includes the low-level structs. Nevertheless, we need this for binary compatibility with GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76755 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
27bc49f518604f310aca9ed21be0bee12bdc6237 22-Jul-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6770276> Support Class<Proto> syntax.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76741 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
470301bac9c8abfc6b451b3b669c6695a9fd1518 22-Jul-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6770276> Support Class<Proto> syntax.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76741 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
01e249d790c57e1646f63bad466075a623e02f1b 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Minor mod. per Doug's comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76708 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cf1831204b2b575fc57b851172f0426559ae482c 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Minor mod. per Doug's comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76708 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4e1272381cf2553bcc4394bc1690be1b954f6be6 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76663 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
393612e6c7727f1fee50039254d9f434364cc0b2 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76663 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
9060d0e1f3cf3feccdc9022a33b79b4063fe7cd4 21-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
741dd9a7e1d63e4e385b657e4ce11c5d96d44f72 21-Jul-2009 Douglas Gregor <dgregor@apple.com> Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
57f4dfed70cb54d47d263879b9f7929062fba7f4 21-Jul-2009 Duncan Sands <baldrick@free.fr> Disambiguate an if statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76547 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
98f2cca4b2731b5d43da7c1582dd443ecead658d 21-Jul-2009 Duncan Sands <baldrick@free.fr> Disambiguate an if statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76547 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
29c3387a826f2efea0882bb304a9699744a3f8f4 21-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Implement the virtual getNextRedeclaration() for ObjCMethodDecl.

If it's in an ObjCContainerDecl, its "redeclaration" is the method definition in the corresponding ObjCImplDecl.
If it's in an ObjCImplDecl, its "redeclaration" is the method in the interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76512 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
57ea6bee79cc60ba20c7886b453f40f380dce1b1 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement the virtual getNextRedeclaration() for ObjCMethodDecl.

If it's in an ObjCContainerDecl, its "redeclaration" is the method definition in the corresponding ObjCImplDecl.
If it's in an ObjCImplDecl, its "redeclaration" is the method in the interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76512 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
200968606a3c72e1e53efc2a8ebe48f1e1510706 21-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1cb35dd4840d21cec58648361180d5688446a9ca 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3a4d98341a3b016f6bf2559dde5f3d9d8bf5f358 21-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> - Introduce ASTContext::getObjCImplementation() and ASTContext::setObjCImplementation() which use a DenseMap to associate
an interface/category with its implementation (if one exists).

- Introduce ObjCInterfaceDecl::get/setImplementation() and ObjCCategoryDecl::get/setImplementation() that use the above methods.

- Add a compiler error for when a category is reimplemented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76508 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
8a1d722f13df383600f36d77f842957c8adb5f1b 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> - Introduce ASTContext::getObjCImplementation() and ASTContext::setObjCImplementation() which use a DenseMap to associate
an interface/category with its implementation (if one exists).

- Introduce ObjCInterfaceDecl::get/setImplementation() and ObjCCategoryDecl::get/setImplementation() that use the above methods.

- Add a compiler error for when a category is reimplemented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76508 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
8194a544b410d6d49ca892e2c0139367d8ea16c5 20-Jul-2009 Steve Naroff <snaroff@apple.com> 5 cleanups to ObjCObjectPointerType work:

- Remove Sema::CheckPointeeTypesForAssignment(), a temporary API I added to ease migration to ObjCObjectPointerType. Convert Sema::CheckAssignmentConstraints() to no longer depend on the temporary API.
- Sema::ConvertDeclSpecToType(): Replace a couple FIXME's with an important comment/example.
- Sema::GetTypeForDeclarator(): Get the protocol's from the interface, NOT the declspec (to support the following C typedef idiom: "typedef C<P> T; T *obj").
- Sema::ObjCQualifiedIdTypesAreCompatible(): Removed some dead code.
- ASTContext::getObjCEncodingForTypeImpl(): Some minor cleanups.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76443 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
67ef8eaea8a0a2073147a8d863f0e3f30d525802 20-Jul-2009 Steve Naroff <snaroff@apple.com> 5 cleanups to ObjCObjectPointerType work:

- Remove Sema::CheckPointeeTypesForAssignment(), a temporary API I added to ease migration to ObjCObjectPointerType. Convert Sema::CheckAssignmentConstraints() to no longer depend on the temporary API.
- Sema::ConvertDeclSpecToType(): Replace a couple FIXME's with an important comment/example.
- Sema::GetTypeForDeclarator(): Get the protocol's from the interface, NOT the declspec (to support the following C typedef idiom: "typedef C<P> T; T *obj").
- Sema::ObjCQualifiedIdTypesAreCompatible(): Removed some dead code.
- ASTContext::getObjCEncodingForTypeImpl(): Some minor cleanups.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76443 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
975428bfbf8a308361628246b21e7eab766156d3 19-Jul-2009 Daniel Dunbar <daniel@zuster.org> Add include needed for MSVC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76359 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
75cc2c484873dfbc53a026f5cc50095fd67510ac 19-Jul-2009 Daniel Dunbar <daniel@zuster.org> Add include needed for MSVC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76359 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.h
a3833fc69e81555b96d619a12802c2f47e67c975 19-Jul-2009 Daniel Dunbar <daniel@zuster.org> Update CMake


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76351 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
e464183c9cc74e6fe7cb14eff260066c5b4654ce 19-Jul-2009 Daniel Dunbar <daniel@zuster.org> Update CMake


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76351 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
c1a999278716d6af9639aa0f0d5d5267cde4ad81 19-Jul-2009 Anders Carlsson <andersca@mac.com> Handle layout of non-virtual base classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76348 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
74cbe226207fd101623638dadfa7fbada04ff2a6 19-Jul-2009 Anders Carlsson <andersca@mac.com> Handle layout of non-virtual base classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76348 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
29795a59c8db686b1b41bc82ee90af06aa31f543 18-Jul-2009 Anders Carlsson <andersca@mac.com> Refactor field layout into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76343 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a2df41c107d3c5f5bff2d090fab77734e0da735d 18-Jul-2009 Anders Carlsson <andersca@mac.com> Refactor field layout into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76343 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
a035994089b81de429a362590714c89d6097c331 18-Jul-2009 Anders Carlsson <andersca@mac.com> Rename NextOffset to DataSize, which better matches the Itanium C++ ABI

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76339 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
243a68551ac9ec71bf341e062418e33eb4f286ff 18-Jul-2009 Anders Carlsson <andersca@mac.com> Rename NextOffset to DataSize, which better matches the Itanium C++ ABI

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76339 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
5d3825891051fa6009e63f4862c33b4090442b81 18-Jul-2009 Anders Carlsson <andersca@mac.com> Migrate over to the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76338 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.h
29445a0542d128cd7ee587ee52229670b9b54a12 18-Jul-2009 Anders Carlsson <andersca@mac.com> Migrate over to the record layout builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76338 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecordLayoutBuilder.h
cda251c5cb6f56fc19be15bc78b1c592be6bc046 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Re-enable 'test/SemaTemplate/temp_class_spec_neg.cpp', after commenting out the cause of the crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76337 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e7f38406a38f453e83000a1e52a5ec0aada66e51 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Re-enable 'test/SemaTemplate/temp_class_spec_neg.cpp', after commenting out the cause of the crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76337 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1f11cc7e6599307202352c905cd3fc7dbd8da47b 18-Jul-2009 Anders Carlsson <andersca@mac.com> More layout builder work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76333 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
93fab9d67ca62e3e291803e5a1309473d6e00344 18-Jul-2009 Anders Carlsson <andersca@mac.com> More layout builder work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76333 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
eba0868ee14aec8b1d137feac786ffc5322132f4 18-Jul-2009 Anders Carlsson <andersca@mac.com> Add a new ASTRecordLayoutBuilder class. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76330 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
bda4c1015e27ac82d31afb4519dd53586e61a51a 18-Jul-2009 Anders Carlsson <andersca@mac.com> Add a new ASTRecordLayoutBuilder class. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76330 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayoutBuilder.cpp
ecordLayoutBuilder.h
63f1ad9bb3a6330182b1d2e6477e316ce499ccd5 18-Jul-2009 Anders Carlsson <andersca@mac.com> Revert r75641.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76327 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
19cc4abea06a9b49e0e16a50d335c064cd723572 18-Jul-2009 Anders Carlsson <andersca@mac.com> Revert r75641.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76327 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
202442314830f83b88ad116ad417557f1d85385c 18-Jul-2009 Steve Naroff <snaroff@apple.com> Fix typo from r76321.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76322 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e61ad0b7063fcd97204b1cce5558685144267eb6 18-Jul-2009 Steve Naroff <snaroff@apple.com> Fix typo from r76321.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76322 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
77763c58e3b7783c8e54671c2b696ecd81ed524f 18-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ObjCQualifiedInterfaceType:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76321 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c15cb2af27514ecc879daba9aa01389c5203685d 18-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ObjCQualifiedInterfaceType:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76321 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
4253ec52f603b100f545440d74a737f0e42e2bdc 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce a redecl_iterator in Decl class, so that we can do a "iterate over all declarations of the same decl" without knowing the exact type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76298 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1e4bc099882626059f14d687ed7a1a5518b7f3c2 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce a redecl_iterator in Decl class, so that we can do a "iterate over all declarations of the same decl" without knowing the exact type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76298 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
80ad73bad9b360387336ef4c87d98b66f97b6926 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce the Redeclarable template class, which serves as a base type defining the common interface for Decls that can be redeclared.
Make FunctionDecl and VarDecl use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76297 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f23e839e9ddea324c743d26da43fb767f90ca223 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce the Redeclarable template class, which serves as a base type defining the common interface for Decls that can be redeclared.
Make FunctionDecl and VarDecl use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76297 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e9d5bb076ba865bb636c7271cd5d104cb5655134 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove getFirstDeclaration/getLatestDeclaration from FunctionDecl and VarDecl.

Their usefulness is questionable since redecl_iterator was introduced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76275 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f00068bd7540639405130ff658025d863da41744 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove getFirstDeclaration/getLatestDeclaration from FunctionDecl and VarDecl.

Their usefulness is questionable since redecl_iterator was introduced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76275 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
17c7cab301f05a9e88924b00f5988eecdca2c12f 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76274 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
97fbaa2a38804268a024f1a104b43fcf8b4411b0 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76274 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
e3fb785e3bed062f3d0fe49b6beead5ba27d7136 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl::getCanonicalDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76273 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
b57a4fe73b8227c0dba651818b8495dfca61e530 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl::getCanonicalDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76273 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
d9b39bfecbc4faec367c3b2b53b8a3c7f71bdc3b 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
ype.cpp
35366a67baa970c287c714c957cf78a4131cf60d 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
ype.cpp
eb346745b27c1c96694ddf9a31fc86627ca0f0a5 17-Jul-2009 Chris Lattner <sabre@nondot.org> objc methods can't be an operand to callexpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76179 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6346f963145ed18b6edf50a78753b47db505e912 17-Jul-2009 Chris Lattner <sabre@nondot.org> objc methods can't be an operand to callexpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76179 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c2aab6fc972d6f5f1d32897768ab9673f930d3c1 17-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> Refactor code into a new CallExpr::getDirectCallee() method. Simplify some
code with the new method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76164 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a00425414e8c209cabc25d1826b200aeb94259af 17-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> Refactor code into a new CallExpr::getDirectCallee() method. Simplify some
code with the new method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76164 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
60d5671481f35143349d08261af20f08facbde17 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
ype.cpp
5cad1f74469d4d8b4fc51fe53a7837778aeb6107 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclPrinter.cpp
eclarationName.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
nheritViz.cpp
ype.cpp
6a6c0971f29d9fb7cb5e7318a4a493ed1331258c 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replace Type::getAsReferenceType() with Type::getAs<ReferenceType>().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76132 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
808825cd08704d1cccef605f8cd3ef83c93eac78 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replace Type::getAsReferenceType() with Type::getAs<ReferenceType>().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76132 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f5de0a3cbaa216daf2ea7e42611bbd1ebad42fa7 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
1a1a6e2bd4c5aefd7fd643cf25915f9623a02e59 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclPrinter.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
ba927fcab0eb1748bed5bf8af58507116a9dc522 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Move the source-level CFG from libAST to libAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76092 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
MakeLists.txt
e41611aa2237d06a0ef61db4528fb2883a8defcd 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Move the source-level CFG from libAST to libAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76092 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
MakeLists.txt
a960479e82ebf6c28dfc5843f0d8bf34db5702e3 16-Jul-2009 Steve Naroff <snaroff@apple.com> Cleanup a couple loops and improve a comment (based on feedback from Fariborz).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76078 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8f16756441450ed9fb39316e47d107fc2a1ef35b 16-Jul-2009 Steve Naroff <snaroff@apple.com> Cleanup a couple loops and improve a comment (based on feedback from Fariborz).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76078 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ad75bd277827709b7597fb94de498548bff4ee23 16-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
f49545602089be5b1f744e04326b8a566f6d8773 16-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
0a51a999d5088c470c6714522231076dbd1c684d 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a stinko which caused an ast-print test failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75861 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
a8ded8be82f7d5f5fc93c8626cfa9ca9cee4199e 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a stinko which caused an ast-print test failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75861 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
e4bf8ab06b26f2a636acac96e74f7a64def15674 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> #ifdef'ed out -ast-print of destructors which caused
a test failure, until figuring out what caused the failure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75855 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
7b6248766dda6eb4c410d58db25a8dd2824f78cc 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> #ifdef'ed out -ast-print of destructors which caused
a test failure, until figuring out what caused the failure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75855 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
21e25e780b1a6a44bedef0dae4e89ebb982cacd1 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added ASTs to destructor decl AST for default destruction of object's
base/members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75849 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
560de45ccbf21c5e4dbeef3fc49f932e499cc181 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added ASTs to destructor decl AST for default destruction of object's
base/members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75849 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
6093e74141497b81adf3910d3fe17c0411ab2fac 15-Jul-2009 Ted Kremenek <kremenek@apple.com> Lexically order files in CMakeLists.txt files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75832 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
b3b73642bfb4417d6312725ad6cc8d73ae143aca 15-Jul-2009 Ted Kremenek <kremenek@apple.com> Lexically order files in CMakeLists.txt files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75832 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
7bffd37bd2642e9d1bf0d093e9c1a7b3467f3014 15-Jul-2009 Steve Naroff <snaroff@apple.com> Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).

This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
de2e22d33afec98324a66a358dfe0951b3c7259a 15-Jul-2009 Steve Naroff <snaroff@apple.com> Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).

This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
cdb9c6151ff3aa23eafd66d735c7ef1357c9a991 15-Jul-2009 Dan Gohman <gohman@apple.com> Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
92db2841691b2f2a99294872ead8887854297ed7 15-Jul-2009 Dan Gohman <gohman@apple.com> Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
0cdeff1402ce030e85a6d40f7194436c03fada8d 15-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75712 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
29146add4c9952f79b82b7f3d1f0bf0d4cb0e17e 15-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75712 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
39f29c18b186208d3ccdc5e1e5fa968460dda974 15-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug in building ctor-initializer AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75692 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
42a5217f141be476ca8ec229c3743dcb647f5ea4 15-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug in building ctor-initializer AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75692 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a30a904621ab0e4278df75b6d36a0d7993d32943 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Support data members of array type in default
ctor-initializer AST build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75662 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9b9f424329551a89c061568b39044bee86dedbd4 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Support data members of array type in default
ctor-initializer AST build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75662 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
402e9d47971eaf1e463f60ca0c5f6a3db6db9e7c 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Moved a FIXME to where it was meant to be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75651 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
639dead9d60d8eb9cc9131a8ed6147caae1d44ae 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Moved a FIXME to where it was meant to be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75651 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
79ae19a7c9421e17ba26ea9cbf5a7f4dcc015cde 14-Jul-2009 Steve Naroff <snaroff@apple.com> Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).

I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75650 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
58f9f2c884af6b72d036b746a016d8031d31cb7a 14-Jul-2009 Steve Naroff <snaroff@apple.com> Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).

I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75650 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9294d19c99e38be44342f84051431c371ccd4983 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build AST for ctor's initializer list according to
semantics of order of construction [class.init].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75649 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d01c915dda27bb0045687f0a08bbcab1dd40e652 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build AST for ctor's initializer list according to
semantics of order of construction [class.init].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75649 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7558ec6134e0291f6aa01a31d737848423fe642a 14-Jul-2009 Anders Carlsson <andersca@mac.com> Rename RecordLayout.h to ASTRecordLayout.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75641 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
3d598a5ab3c8aabce0a03a2f5dea65eee643e5ac 14-Jul-2009 Anders Carlsson <andersca@mac.com> Rename RecordLayout.h to ASTRecordLayout.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75641 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprConstant.cpp
b79574e54f3e1b135b87511399ea63363654c2ad 14-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ea218b8e8f9ba82d1c76bcb7e86d121a5f65ebed 14-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2bcacb61cf94b71e5c87f29d517f8dc29fe3993e 14-Jul-2009 Alisdair Meredith <public@alisdairm.net> Basic support for C++0x unicode types. Support for literals will follow in an incremental patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75622 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f5c209d23b20ada4a9b6235db50317239cbf6ae1 14-Jul-2009 Alisdair Meredith <public@alisdairm.net> Basic support for C++0x unicode types. Support for literals will follow in an incremental patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75622 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
aec06482447ca95c15f11a30f1c56b5e58673588 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> In Stmt::printPretty(), pass the SourceManager to dump().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75606 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ad42f06f998c45faed641180d852e46177e695cf 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Stmt::printPretty(), pass the SourceManager to dump().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75606 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
1d2f3a31ce12054cf7ef8b20822c0c533cba783c 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce redecl_iterator, used for iterating over the redeclarations of a FunctionDecl or VarDecl.

It iterates over all the redeclarations, regardless of the starting point. For example:

1) int f();
2) int f();
3) int f();

if you have the (2) FunctionDecl and call redecls_begin/redecls_end to iterate, you'll get this sequence:
(2)
(1)
(3)

The motivation to introduce this was that, previously, if (3) was a function definition,
and you called getBody() at (2), it would not return it, since getBody() iterated over the previous declarations only,
so it would only check (2) and (1).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75604 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c37929c9e0dba89770dc5f0fbcfa0c9046da0b06 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce redecl_iterator, used for iterating over the redeclarations of a FunctionDecl or VarDecl.

It iterates over all the redeclarations, regardless of the starting point. For example:

1) int f();
2) int f();
3) int f();

if you have the (2) FunctionDecl and call redecls_begin/redecls_end to iterate, you'll get this sequence:
(2)
(1)
(3)

The motivation to introduce this was that, previously, if (3) was a function definition,
and you called getBody() at (2), it would not return it, since getBody() iterated over the previous declarations only,
so it would only check (2) and (1).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75604 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
349185b29adbc4d043a4be22853f59c611cf22db 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce FunctionDecl::getLatestDeclaration() and VarDecl::getLatestDeclaration().

For multiple redeclarations they return the last one.

Also, add some non const versions of methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75603 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
03d5e3d03117a56097cea98f53198fb20de1eb35 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce FunctionDecl::getLatestDeclaration() and VarDecl::getLatestDeclaration().

For multiple redeclarations they return the last one.

Also, add some non const versions of methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75603 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9f000a334de72476b5dd0cf4548b845f751fe469 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce FunctionDecl::getFirstDeclaration() and VarDecl::getFirstDeclaration().

For multiple redeclarations they return the first one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75602 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7bf792fdde4641d865eba4a068d862d5300bd1e4 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce FunctionDecl::getFirstDeclaration() and VarDecl::getFirstDeclaration().

For multiple redeclarations they return the first one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75602 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a06a9dab263393b51d684461338946c552e1e23c 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write a CXXOperatorCallExpr from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75598 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ba0a9006dbc4814e1e35f82812cb5a1dad65e8b8 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write a CXXOperatorCallExpr from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75598 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b929dccf22b22a9e9dd09758a7d95227e8a19633 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Add the SourceLocation for the right brace in TagDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75590 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f602c8b6ce1a269c0bf8b3f049e923f4ea5c18e2 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add the SourceLocation for the right brace in TagDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75590 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c056273b824e474d6a5051b43a4dbe812431a322 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a minor bug in pretty printing of ctor defs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75549 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
939afd89bbb859b2ec2b1b9ae4fa3dd42e93ded0 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a minor bug in pretty printing of ctor defs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75549 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
df0e6781780af5af1da1ee88db22582b62e92c43 13-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added pretty-printing support for constructor definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75487 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
66192aded85fc1140ea4fbfa3e10f1dbc232769d 13-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added pretty-printing support for constructor definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75487 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
26e7385919e3b587baaf5b70678395ef4425cf7e 13-Jul-2009 Chris Lattner <sabre@nondot.org> minor cleanups, reduce nesting of if's with early return.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75442 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5 13-Jul-2009 Chris Lattner <sabre@nondot.org> minor cleanups, reduce nesting of if's with early return.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75442 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e0baa1ea65df59749bc000dce67ed2b6df58394f 11-Jul-2009 Alisdair Meredith <public@alisdairm.net> Fix breakage on Windows, cannot redeclare loop variable i in the immediate scope of loop. Rename variable to j.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75365 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
002b91fc1a5ea20658bd0af836bea540eaa51932 11-Jul-2009 Alisdair Meredith <public@alisdairm.net> Fix breakage on Windows, cannot redeclare loop variable i in the immediate scope of loop. Rename variable to j.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75365 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
68acecb4d2a3aa824de5551c16d9bdcecd854188 11-Jul-2009 Anders Carlsson <andersca@mac.com> Implement more of C++0x 'auto'. A variable with an auto type specifier must have an initializer. Also, move some tests around to match the C++0x draft better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75322 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6a75cd9c1d54625fca7b5477ab9545bcdbd85ea4 11-Jul-2009 Anders Carlsson <andersca@mac.com> Implement more of C++0x 'auto'. A variable with an auto type specifier must have an initializer. Also, move some tests around to match the C++0x draft better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75322 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
329ec22704eee011640ebf37c29343e82fb984c6 11-Jul-2009 Steve Naroff <snaroff@apple.com> This patch includes a conceptually simple, but very intrusive/pervasive change.

The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
14108da7f7fc059772711e4ffee1322a27b152a7 11-Jul-2009 Steve Naroff <snaroff@apple.com> This patch includes a conceptually simple, but very intrusive/pervasive change.

The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
0f6762bddddabd1dbd96d9c10b2f2a176283be66 10-Jul-2009 Anders Carlsson <andersca@mac.com> Fix type of 'this' and add a decltype test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75291 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4e579922ada4e19618710878c32543322f86c9c8 10-Jul-2009 Anders Carlsson <andersca@mac.com> Fix type of 'this' and add a decltype test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75291 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c1ce61b59d6d0c462133d0d375679bf822866e14 10-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build list of inherited virtual base classes
in their order of construction for each class and use it
to to check on propery order of base class construction
under -Wreorder option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75270 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
40c072f44ff081293f79909ecc518af23938108e 10-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build list of inherited virtual base classes
in their order of construction for each class and use it
to to check on propery order of base class construction
under -Wreorder option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75270 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
42f394e67047624dcc15d22239f615885ad712ac 10-Jul-2009 Anders Carlsson <andersca@mac.com> Fix a problem that Eli noticed, and that Doug helped me fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75265 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
563a03b1338d31c2462def43253a722bc885d384 10-Jul-2009 Anders Carlsson <andersca@mac.com> Fix a problem that Eli noticed, and that Doug helped me fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75265 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c7d6309ae91e5f97ba096eb50aa63dc40d85ef80 10-Jul-2009 Anders Carlsson <andersca@mac.com> Fix another decltype crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75175 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d5940ce01c5f6235c88a8b92e80b86e5b5abe212 10-Jul-2009 Anders Carlsson <andersca@mac.com> Fix another decltype crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75175 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
62f78762eb92e9d4abb045d76923c7ff09ab025d 08-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Implement template argument deduction when taking the address of a
function template. Most of the change here is in factoring out the
common bits used for template argument deduction from a function call
and when taking the address of a function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75044 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
83314aa1cf61ed2458a8a20c83b2d4708192d5dc 08-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement template argument deduction when taking the address of a
function template. Most of the change here is in factoring out the
common bits used for template argument deduction from a function call
and when taking the address of a function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75044 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6e2641067adfb98bab5adceeccd380bb5be36c27 08-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a corner case with argument-dependent lookup and overloaded function sets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74999 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
daa439a6c47d3299157b94a496bf22389bbc77a3 08-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix a corner case with argument-dependent lookup and overloaded function sets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74999 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
614e8f099b8334e2307d26d45cb066f01c4fd71b 08-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74984 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
082b02e8403d3ee9d2ded969fbe0e5d472f04cd8 08-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74984 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d1c0b682af81784cb991a5479097e795b5868bc4 08-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> The canonical type of typeof or decltype with a dependent type is itself,
not Context.DependentTy. I'll let Anders check in the test case for this one...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74975 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
dd0257c77719a13d4acd513df40b04300cbfc871 08-Jul-2009 Douglas Gregor <dgregor@apple.com> The canonical type of typeof or decltype with a dependent type is itself,
not Context.DependentTy. I'll let Anders check in the test case for this one...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74975 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
151fac73d9d9dd2f14606c124f54abbce2e19144 07-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74911 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c29f77b769bcc5b6dc85e72c8e3cc2e348e5cf25 07-Jul-2009 Douglas Gregor <dgregor@apple.com> Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74911 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b29c9b2f9e7fd23d65bfdbafb8787579d04e2108 07-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> A few change per Doug's feedback.
- Fariborz



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74909 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0d3c26c76997688eaf7e51764a66815652e09642 07-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> A few change per Doug's feedback.
- Fariborz



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74909 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fef5a6851c83be9ba9ae70a9b4b757b92e657a66 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Update CMake files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74864 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
0daea7a162bee39b1b1dd63b7bceccd3224a6a63 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Update CMake files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74864 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
75abd9c49cd26ed18bc99eafa34e3e733f92f3ca 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move ASTLocation and DeclReferenceMap from the AST library to the Index library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74859 91177308-0d34-0410-b5e6-96231b3b80d8
STLocation.cpp
eclReferenceMap.cpp
ccbcb70ee96cb67ed6c8b4142d050f3a6764edd7 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move ASTLocation and DeclReferenceMap from the AST library to the Index library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74859 91177308-0d34-0410-b5e6-96231b3b80d8
STLocation.cpp
eclReferenceMap.cpp
2fcbc1e545a47bc3cd1da08944516f17a6e08c56 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Rename 'ASTNode' -> 'ASTLocation'.

ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74858 91177308-0d34-0410-b5e6-96231b3b80d8
STLocation.cpp
STNode.cpp
MakeLists.txt
eclReferenceMap.cpp
874012b1fb80dff2ec227c726a0c63d55e3db63f 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename 'ASTNode' -> 'ASTLocation'.

ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74858 91177308-0d34-0410-b5e6-96231b3b80d8
STLocation.cpp
STNode.cpp
MakeLists.txt
eclReferenceMap.cpp
1d381135f0c9dcbac521112b3f6936caf871b91a 06-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
7e7eb3da052a6d80ddf2377cab0384c798f73f75 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
34909529d85f59ed1aff78787111881f4d6176a5 06-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix bitfield promotion in the presence of explicit casts, from Abrama Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74830 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6f4a69a3107e7ff1569c747f7c6bdf7cff8cbf55 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix bitfield promotion in the presence of explicit casts, from Abrama Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74830 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
78c50f1927f26e1c1e03b21e17f6cee8336d431e 06-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4502: add calculation of the integer conversion rank for
wchar_t.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74808 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a34267595534a72703290153a6f7e3da1adcec59 06-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4502: add calculation of the integer conversion rank for
wchar_t.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74808 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4054a66c33880360183bb6e48efe11dfbf2a0f52 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce the DeclReferenceMap class inside the AST library.

DeclReferenceMap (similar to ParentMap) is a helper class for mapping Decls to the AST nodes that reference them.
A client will initialize it by passing an ASTContext to its constructor and later use it to iterate over
the references of a Decl.
References are mapped and retrieved using the primary declaration (Decl::getPrimaryDecl()) of a particular Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74801 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclReferenceMap.cpp
2c2ba3e258961dd98cacffe3a2167bb6d958fd53 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce the DeclReferenceMap class inside the AST library.

DeclReferenceMap (similar to ParentMap) is a helper class for mapping Decls to the AST nodes that reference them.
A client will initialize it by passing an ASTContext to its constructor and later use it to iterate over
the references of a Decl.
References are mapped and retrieved using the primary declaration (Decl::getPrimaryDecl()) of a particular Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74801 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclReferenceMap.cpp
5ea54f629ae53a1be581920b98e90370e09d5fc4 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce the virtual method Decl::getPrimaryDecl().

When a Decl subclass can have multiple re-declarations in the same declaration context (like FunctionDecl),
getPrimaryDecl() will return a particular Decl that all of them will point to as the "primary" declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74800 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
fc7e2a8fbb08f0f496ac6cea0721fe72db8ce240 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce the virtual method Decl::getPrimaryDecl().

When a Decl subclass can have multiple re-declarations in the same declaration context (like FunctionDecl),
getPrimaryDecl() will return a particular Decl that all of them will point to as the "primary" declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74800 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
970cfe1c503f4e7d8dcf0581fb6ec7d0a94b8910 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ASTNode class into the AST library.

ASTNode is an immutable pair of a Decl and Stmt. If Stmt is not null, Decl should be its immediate parent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74797 91177308-0d34-0410-b5e6-96231b3b80d8
STNode.cpp
MakeLists.txt
c0824634334ff0bb66cf8fb260101a5faaebf4b7 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTNode class into the AST library.

ASTNode is an immutable pair of a Decl and Stmt. If Stmt is not null, Decl should be its immediate parent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74797 91177308-0d34-0410-b5e6-96231b3b80d8
STNode.cpp
MakeLists.txt
1094f4c714493a17cd114be49cbc35e9e31bc7b1 03-Jul-2009 Ted Kremenek <kremenek@apple.com> Fix a horrible CFG bug reported in <rdar://problem/7027684>. The wrong successor
block would get hooked up in some cases when processing empty compound
statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74743 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ed47fc67b8eeabacbbbdf853ba45f4900619904b 03-Jul-2009 Ted Kremenek <kremenek@apple.com> Fix a horrible CFG bug reported in <rdar://problem/7027684>. The wrong successor
block would get hooked up in some cases when processing empty compound
statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74743 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9cd0a3c6b68570a1c2788c5fec0ef4371fb48d81 02-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allocate list of bases in CXXRecordDecl
using ASTContxt allocation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74717 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5ffcd7b1ba8bfcb253f0a0bdf7c94c4d0270a4ab 02-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allocate list of bases in CXXRecordDecl
using ASTContxt allocation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74717 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a252b23fb4318b2bf84fa86bd9c55fd15a85b588 02-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Add support for retrieving the Doxygen comment associated with a given
declaration in the AST.

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment,
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile).

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
- We don't actually attempt to parse the comment blocks themselves,
beyond identifying them as Doxygen comment blocks to associate them
with a declaration.
- We won't find comment blocks that aren't adjacent to the
declaration, because we start our search based on the location of
the declaration.
- We don't go through the necessary hops to find, for example,
whether some redeclaration of a declaration has comments when our
current declaration does not. Similarly, we don't attempt to
associate a \param Foo marker in a function body comment with the
parameter named Foo (although that is certainly possible).
- Verification of my "no performance impact" claims is still "to be
done".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74704 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2e22253e03e175144aeb9d13350a12fd83f858be 02-Jul-2009 Douglas Gregor <dgregor@apple.com> Add support for retrieving the Doxygen comment associated with a given
declaration in the AST.

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment,
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile).

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
- We don't actually attempt to parse the comment blocks themselves,
beyond identifying them as Doxygen comment blocks to associate them
with a declaration.
- We won't find comment blocks that aren't adjacent to the
declaration, because we start our search based on the location of
the declaration.
- We don't go through the necessary hops to find, for example,
whether some redeclaration of a declaration has comments when our
current declaration does not. Similarly, we don't attempt to
associate a \param Foo marker in a function body comment with the
parameter named Foo (although that is certainly possible).
- Verification of my "no performance impact" claims is still "to be
done".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74704 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6b9f426a42c4bdbf2db2eaa40925768c464cffbc 02-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Look through vector types when determining the base type of a type for declarator printing. Bug found via the PCH tester

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74672 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
5068ab669970ba62020541251f1193b237d24ae3 02-Jul-2009 Douglas Gregor <dgregor@apple.com> Look through vector types when determining the base type of a type for declarator printing. Bug found via the PCH tester

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74672 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
bb70eb307c83d870333b8d6567cc7df61b4dcbc1 02-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Use Destroy for member initializer list clean up.
Per Doug's comments. Doug please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74666 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
73b85f3d7ccdff37bab7adafc6b06dfd03740058 02-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Use Destroy for member initializer list clean up.
Per Doug's comments. Doug please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74666 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
28b9c88a99fa93d03bd82455b498de9c77e50854 01-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Updated CXXConstructorDecl AST node for ctor-initilaizer list.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74639 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d45c36308e563e1fac1cd124d606f403f9a39a29 01-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Updated CXXConstructorDecl AST node for ctor-initilaizer list.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74639 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
18f16cc94232389e18ca5248f0b929c517090968 01-Jul-2009 Daniel Dunbar <daniel@zuster.org> Fix thinko in r74506, test condition for floats was inverted.
- Refactored slightly to make control flow more obvious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74637 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d906dc7605b2d6352e16c27a5d3fb5f1a1b44ac8 01-Jul-2009 Daniel Dunbar <daniel@zuster.org> Fix thinko in r74506, test condition for floats was inverted.
- Refactored slightly to make control flow more obvious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74637 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5ca84bccd83982d3941d68dd88139ca43f6322a0 01-Jul-2009 Steve Naroff <snaroff@apple.com> Rework Sema::CheckConditionalOperands(). No functionality change.

This was necessary to simplify some other changes I'm making (wrt ObjC type cleanups).

The idea is to separate the constraint checks for block pointers, ObjC pointers, and C pointers (the previous code combined them into one clause).

Note: This routine will be further simplified when I integrate the ObjC type cleanups (forthcoming).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74604 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7154a77e7c1f23418342d3b72836ab504aa7821e 01-Jul-2009 Steve Naroff <snaroff@apple.com> Rework Sema::CheckConditionalOperands(). No functionality change.

This was necessary to simplify some other changes I'm making (wrt ObjC type cleanups).

The idea is to separate the constraint checks for block pointers, ObjC pointers, and C pointers (the previous code combined them into one clause).

Note: This routine will be further simplified when I integrate the ObjC type cleanups (forthcoming).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74604 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1e6497a4afdd19097e92304b2d4316a59127b072 01-Jul-2009 Nate Begeman <natebegeman@mac.com> Implement Eli's feedback for vecto constant expressions;

For ExtVectorType, initializer is splatted to all elements.
For VectorType, initializer is bitcast to vector type.

Verified that for VectorType, output is identical to gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74600 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c0b8b19bd8056d6b5d831623a0825cce150f4507 01-Jul-2009 Nate Begeman <natebegeman@mac.com> Implement Eli's feedback for vecto constant expressions;

For ExtVectorType, initializer is splatted to all elements.
For VectorType, initializer is bitcast to vector type.

Verified that for VectorType, output is identical to gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74600 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2885775090f6b4b011ce8b1cb6045e3b2202e9a1 01-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Preliminary parsing and ASTs for template-ids that refer to function
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74563 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
edce4dd44732dfad69f28822dddcf2b8e92b4483 01-Jul-2009 Douglas Gregor <dgregor@apple.com> Preliminary parsing and ASTs for template-ids that refer to function
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74563 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
ab6e38adbcdbdb4e7d211b4ff7a52d871ea0e994 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
xprConstant.cpp
17945a0f64fe03ff6ec0c2146005a87636e3ac12 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclPrinter.cpp
xprConstant.cpp
ccb9efea4c1a88ccf62ac49d60f98b754897695a 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclPrinter.cpp
6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclPrinter.cpp
9a6fb96f74f39d19180dc87f4232ad3617f3f2de 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the printing related methods of Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74503 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
f1d60eaf3f70975ee262852af2d6aeabd140ed58 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the printing related methods of Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74503 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
f7993cb958999fa1656998d145ff6fc8f87de7dc 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Decl::getTranslationUnitDecl() should return itself when the Decl is a TranslationUnitDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74502 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9b34669c672e776a24616eb01cffcf7061356d26 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Decl::getTranslationUnitDecl() should return itself when the Decl is a TranslationUnitDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74502 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
fe5f9736723cbaae5423f98ebbd0f0f537b51de4 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
xpr.cpp
40b598eea1310ec9ed554d56ce3e25b34c585458 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
xpr.cpp
7099c789f054f1e7480f498d60aa94b0326c285f 30-Jun-2009 Chris Lattner <sabre@nondot.org> Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.

This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control. There are many fixme's, but I think things are slightly
better than they were before.

One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74493 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
ecl.cpp
estedNameSpecifier.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
ype.cpp
e4f2142d00fa5fdb580c4e2413da91882d955381 30-Jun-2009 Chris Lattner <sabre@nondot.org> Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.

This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control. There are many fixme's, but I think things are slightly
better than they were before.

One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74493 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
ecl.cpp
estedNameSpecifier.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
ype.cpp
89f61bd06f28e7898456433248f569a1cd67d02c 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> A more detailed diagnosis of ill-formed ctor-initializer
list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74480 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
47deacfa43625c6cc1b2008a0396ccb3af725fde 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> A more detailed diagnosis of ill-formed ctor-initializer
list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74480 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
696780627b917bb683cfcc196e370fc6ed620b12 30-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Improve code generation for function template specializations:
- Track implicit instantiations vs. the not-yet-supported explicit
specializations
- Give implicit instantiations of function templates (and member
functions of class templates) linkonce_odr linkage.
- Improve name mangling for function template specializations,
including the template arguments of the instantiation and the return
type of the function.

Note that our name-mangling is improved, but not correct: we still
don't mangle substitutions, although the manglings we produce can be
demangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74466 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1fd2dd145d9bcdf0b8d60a88e1795b6ae83656f5 30-Jun-2009 Douglas Gregor <dgregor@apple.com> Improve code generation for function template specializations:
- Track implicit instantiations vs. the not-yet-supported explicit
specializations
- Give implicit instantiations of function templates (and member
functions of class templates) linkonce_odr linkage.
- Improve name mangling for function template specializations,
including the template arguments of the instantiation and the return
type of the function.

Note that our name-mangling is improved, but not correct: we still
don't mangle substitutions, although the manglings we produce can be
demangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74466 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
27b6d2b2671814fd94f2f70f58feb68cefe609d1 29-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of function template specializations, to eliminate
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74454 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
127102b5196ffe04bdb70fd553fe62c265ab10a9 29-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of function template specializations, to eliminate
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74454 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
2a6dca1f553de927e0872e010f6935b6e8a10fa1 29-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> -Keep a reference to the ASTContext inside the TranslationUnitDecl.
-Introduce Decl::getASTContext() which returns the reference from the TranslationUnitDecl that it is contained in.

The general idea is that Decls can point to their own ASTContext so that it is no longer required to "manually" keep track and make sure that you pass the correct ASTContext to Decls' methods, e.g. methods like Decl::getAttrs should eventually not require a ASTContext parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74434 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
3708b3df2e86998dca4c006939014ea1174da834 29-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Keep a reference to the ASTContext inside the TranslationUnitDecl.
-Introduce Decl::getASTContext() which returns the reference from the TranslationUnitDecl that it is contained in.

The general idea is that Decls can point to their own ASTContext so that it is no longer required to "manually" keep track and make sure that you pass the correct ASTContext to Decls' methods, e.g. methods like Decl::getAttrs should eventually not require a ASTContext parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74434 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
ff1bf1a70cb5d6f8428727aa26994b6572347717 29-Jun-2009 Chris Lattner <sabre@nondot.org> Fix the FloatingLiteral API to take the isexact flag by value instead of
by pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74432 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
001d64dd2947c1ce06e3eac257a9a21c65ae4ff3 29-Jun-2009 Chris Lattner <sabre@nondot.org> Fix the FloatingLiteral API to take the isexact flag by value instead of
by pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74432 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2ed1a54888348f8056fd20fec3dd3bbd050c6a36 29-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Move FunctionDecl::TemplateSpecializationInfo out into its own class,
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74431 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
16e8be2ac532358d4e413fdfa2643b1876edda78 29-Jun-2009 Douglas Gregor <dgregor@apple.com> Move FunctionDecl::TemplateSpecializationInfo out into its own class,
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74431 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
979f8f0ed481821f2b2bf9e196d4c0024803d5b7 29-Jun-2009 Steve Naroff <snaroff@apple.com> Remove ASTContext::getObjCQualifiedIdType().
Convert clients to use ASTContext::getObjCObjectPointerType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74424 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
683087ffcf21d2a22cd2d0424b7f119168b47a8e 29-Jun-2009 Steve Naroff <snaroff@apple.com> Remove ASTContext::getObjCQualifiedIdType().
Convert clients to use ASTContext::getObjCObjectPointerType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74424 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
993a060816aa82ca90fc6ccab23000cd2803a9f2 27-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Improve support for overloaded operator templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74390 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
364e021e8cbbeebd4d2544053268a008cf9ee5a9 27-Jun-2009 Douglas Gregor <dgregor@apple.com> Improve support for overloaded operator templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74390 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9bd48664107071827487fbefaf5d94db5fcb7c9b 26-Jun-2009 Anders Carlsson <andersca@mac.com> An auto variable can't appear in its own initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74312 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e2bb224dee15d07bc9843acd4f3ded8eb0f835ed 26-Jun-2009 Anders Carlsson <andersca@mac.com> An auto variable can't appear in its own initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74312 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4a8498cc0f251e839912285112a014a5d1248648 26-Jun-2009 Anders Carlsson <andersca@mac.com> Implement enough of the 'auto' keyword so we can claim to support N2546.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74307 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e89d15944dd3be750a09805ad21222d2fa9321fa 26-Jun-2009 Anders Carlsson <andersca@mac.com> Implement enough of the 'auto' keyword so we can claim to support N2546.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74307 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8cd803e3d037b5a58abdac51c19d824035883442 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support:
Add support for scalar to vector and partially initialized vector constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74299 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e8c9e9218f215ec6089f12b076c7b9d310fd5194 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support:
Add support for scalar to vector and partially initialized vector constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74299 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
df5ab84157d78afb51148bb8e6aa7c1ee309c58a 26-Jun-2009 Anders Carlsson <andersca@mac.com> Add NamedDecl::getUnderlyingDecl that can see through UsingDecl and ObjCCompatibleAliasDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74279 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e136e0e1b74760d7ec3ede38e0e739d5c52a3c0a 26-Jun-2009 Anders Carlsson <andersca@mac.com> Add NamedDecl::getUnderlyingDecl that can see through UsingDecl and ObjCCompatibleAliasDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74279 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5847da50f7f3595bda61ec44776eadfcaa4da736 26-Jun-2009 Anders Carlsson <andersca@mac.com> See through UsingDecls in more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74269 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
58badb7a655d021fc67bb7ed0af95d6ea0c63eb1 26-Jun-2009 Anders Carlsson <andersca@mac.com> See through UsingDecls in more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74269 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6f5e054b35aed3e4d22d4bc29bc74e5003dd2038 26-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Implicit instantiation for function template specializations.

For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74232 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1637be727f2a0434c1ed7aa385ea1c18328b0ccd 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Implicit instantiation for function template specializations.

For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74232 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b60eb759cc2de7125e3554b7f48b2452ca807d82 26-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

template<typename T> T& deref(T* t) { return *t; }

void test(int *ip) {
int &ir = deref(ip);
}

Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
e53060fa78ad7e98352049f72787bdb7543e2a48 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

template<typename T> T& deref(T* t) { return *t; }

void test(int *ip) {
int &ir = deref(ip);
}

Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
e2ed6f7a96d7cc444f4a7f15775164b3eccc3c34 25-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74202 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
131f4658249b2a7d2d7e30fe07e84c484f79ef99 25-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74202 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
839b31ab3081f291fbd130e2554e8f266c2ba34c 25-Jun-2009 Anders Carlsson <andersca@mac.com> Extra asserts never hurt anybody, right?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74177 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
3d2065b6efaa62d345fc3a3d8a6651215e9767b2 25-Jun-2009 Anders Carlsson <andersca@mac.com> Extra asserts never hurt anybody, right?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74177 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
26dcdbb564412db1e45e8761f8454f4c8c9a7679 25-Jun-2009 Anders Carlsson <andersca@mac.com> Decltype needs to have a dependent type if the expr passed to it is type dependent. Fixes PR4444.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74175 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a07c33e64e1169e4261f7748c7f9191091a3ad2e 25-Jun-2009 Anders Carlsson <andersca@mac.com> Decltype needs to have a dependent type if the expr passed to it is type dependent. Fixes PR4444.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74175 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b437b862791590fc7e2df5156cba0ee8c7b1f363 25-Jun-2009 Ted Kremenek <kremenek@apple.com> Remove unneeded #includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74131 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
71edeb7b2279bd7015df75455de95e4fcae050b5 25-Jun-2009 Ted Kremenek <kremenek@apple.com> Remove unneeded #includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74131 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
09b8896d0f1e273bf616e9cd90f55d40da3fb7eb 24-Jun-2009 Anders Carlsson <andersca@mac.com> C++ decltype support (N2343)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74118 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
60a9a2a404a4cf259d39133383e922aa00ca9043 24-Jun-2009 Anders Carlsson <andersca@mac.com> C++ decltype support (N2343)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74118 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4da7546ee5efe199340dde7f2aaef1777e5d57a3 24-Jun-2009 Anders Carlsson <andersca@mac.com> Type::getDesugaredType needs to handle decltype types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74115 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
08fa2af5f60cdcb65b554ce2afe39016475cade4 24-Jun-2009 Anders Carlsson <andersca@mac.com> Type::getDesugaredType needs to handle decltype types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74115 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
93ab533a2e9522a2e9a7695cb7446812fc9e70a6 24-Jun-2009 Anders Carlsson <andersca@mac.com> Add a DecltypeType type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74099 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
395b475a4474f1c7574d927ad142ca0c7997cbca 24-Jun-2009 Anders Carlsson <andersca@mac.com> Add a DecltypeType type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74099 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
18ead7b45654af5efec2484a7487f61f2576bc1c 24-Jun-2009 Owen Anderson <resistor@mac.com> Update for LLVM API changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74085 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
tmtViz.cpp
02995ce680d1bcf9f17bcfdf759bd74b08aa3948 24-Jun-2009 Owen Anderson <resistor@mac.com> Update for LLVM API changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74085 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
tmtViz.cpp
b0fc999fb07646e67aab2a6bb3bb4ab0c95be384 23-Jun-2009 Anders Carlsson <andersca@mac.com> Check in a new template argument list builder that should work better for variadic templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73937 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
fb25052736439d72a557cddd41dfb927bcb3d3e5 23-Jun-2009 Anders Carlsson <andersca@mac.com> Check in a new template argument list builder that should work better for variadic templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73937 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
0dba8f2175f6b47f40547b6dacaf980a52c9d870 23-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Don't use operator overload '<' for SourceLocation, it has not semantic meaning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73932 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cb5f8f59322c352f51714c3de5d8047e70895165 23-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't use operator overload '<' for SourceLocation, it has not semantic meaning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73932 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ae78f1f229a41a329d2ea9a980fd033ad2150971 23-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73930 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
96888cc2515e55c9b5dd6798063bf4be2c22983a 23-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73930 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
599778ef5106277527d60a7cc9c3d8f0756a40c7 23-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> patch to mark use of implicit copy constructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73922 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
485f087407849a8989053122f52b8c07d1191b45 23-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> patch to mark use of implicit copy constructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73922 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
25822a01aed8142e2c3c60045cf92b6beb53fabf 22-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Addressing Doug's suggestions:

-Added comment for FunctionDecl::EndRangeLoc
-Removed a redundant check from FunctionDecl::setBody

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73886 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1a5364e0fa0482d8d477d6f136d52e503bbe13f4 22-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Addressing Doug's suggestions:

-Added comment for FunctionDecl::EndRangeLoc
-Removed a redundant check from FunctionDecl::setBody

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73886 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
77e15a5489d3ae286101e253c99d25581c5d73be 21-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed Protocol as TheProtocol so people can use clang header for
building obj-c++ clients. "Protocol" is a class name in Cocoa.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73854 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
262f9cf85294a1a0713420abc79d40f64aef7240 21-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed Protocol as TheProtocol so people can use clang header for
building obj-c++ clients. "Protocol" is a class name in Cocoa.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73854 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
545473e26c6df9a7d683436aba6f778f3637853c 20-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce Decl::getSourceRange() which, like Stmt::getSourceRange(), represents the range that the declaration covers.

Add initial support for NamespaceDecl, VarDecl, and FunctionDecl:
-NamespaceDecl range is from name to '}'
-VarDecl is from name to possible init expression
-FunctionDecl is from name to last parameter name or to end of its function body.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73821 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
55d608cbadf1e9c05064f9287c057d50b7df65b4 20-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::getSourceRange() which, like Stmt::getSourceRange(), represents the range that the declaration covers.

Add initial support for NamespaceDecl, VarDecl, and FunctionDecl:
-NamespaceDecl range is from name to '}'
-VarDecl is from name to possible init expression
-FunctionDecl is from name to last parameter name or to end of its function body.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73821 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
683a1144296b0d866dea5b8bee2c2948ad0b6312 20-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Parsing and AST support for using declarations, from John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73812 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
9cfbe48a7a20a217fdb2920b29b67ae7941cb116 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST support for using declarations, from John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73812 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
3603e0c11af0d958225d8db2f25ed2683d652436 19-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for implementation of C++'s object model. This is
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73782 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f8dcb866d344aa9355595e14c429852830b63095 19-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for implementation of C++'s object model. This is
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73782 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
68a7a6db3693e6df54a2198f3ee4e3f87e7f9ac0 18-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Some cleanups suggested by Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73713 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f6ddb737cb882ffbf0b75a9abd50b930cc2b9068 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Some cleanups suggested by Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73713 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
98da6aed9fbc7fc82dd581c7bb647412f7864299 18-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
xpr.cpp
68584ed35ad819a1668e3f527ba7f5dd4ae6a333 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
xpr.cpp
f27ef733ed988505288433714313488cc05ab5b0 18-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Removed deadcode related to addition of constructor
decls to a class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73650 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8bc3fa4eb6bcb307bef7965a9578afffe22eab4b 18-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Removed deadcode related to addition of constructor
decls to a class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73650 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c75c1a882cad91f2edc6a926eb8cd725abad2262 18-Jun-2009 Steve Naroff <snaroff@apple.com> First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bc 18-Jun-2009 Steve Naroff <snaroff@apple.com> First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
2a2e0405001f22e9026cb0dec219146996d1e7b6 17-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Support dependent extended vector types and template instantiation
thereof. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73641 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
9cdda0cf8528e3d595be9bfa002f0450074beb4d 17-Jun-2009 Douglas Gregor <dgregor@apple.com> Support dependent extended vector types and template instantiation
thereof. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73641 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
37bb2bd63d6a2dfeb4b8f2e07205e501e96e49e1 16-Jun-2009 Anders Carlsson <andersca@mac.com> Handle temporaries in default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73462 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f54741e6465692d3bdbae974ac3beeeab92e4a95 16-Jun-2009 Anders Carlsson <andersca@mac.com> Handle temporaries in default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73462 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4e3d355931542dc1a40c35c108f7e0b72876584c 16-Jun-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a type parameter type is a parameter pack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73452 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
76e4ce42a30cee4dc40ce7c6014874fbc4f9baa7 16-Jun-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a type parameter type is a parameter pack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73452 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
023cbac100a3d7efe76337de307fee5b181d07e4 15-Jun-2009 Anders Carlsson <andersca@mac.com> More parameter pack work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73395 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
3b36b66a00b7d5bab71b486a54694f0ae397bddb 15-Jun-2009 Anders Carlsson <andersca@mac.com> More parameter pack work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73395 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
584b50610476aa300c4b648d860c8938cc7f23cb 15-Jun-2009 Anders Carlsson <andersca@mac.com> Add a new 'Pack' argument kind to TemplateArgument. This is not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73391 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
d01b1da213aeb71fd40ff7fb78a194613cc1ece7 15-Jun-2009 Anders Carlsson <andersca@mac.com> Add a new 'Pack' argument kind to TemplateArgument. This is not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73391 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
34084c244d917d1981d7be052937325db5b21d1d 15-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4391: Tweak -ast-print output to generate valid output for edge cases
like "int x = + +3;".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73356 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
7df71ac778e5918883c826fdb3fff7d0feffc677 15-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4391: Tweak -ast-print output to generate valid output for edge cases
like "int x = + +3;".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73356 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
23ee0b754df851bb25e2120b4988d4d46c00737d 14-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4351: Add constant evaluation for constructs like "foo == NULL", where
foo has a constant address.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73321 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5bc86103767c2abcbfdd6518e0ccbbbb6aa59e0f 14-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4351: Add constant evaluation for constructs like "foo == NULL", where
foo has a constant address.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73321 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c46fcddc0bb2256110a710801f34a560453e3549 14-Jun-2009 Chris Lattner <sabre@nondot.org> Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73319 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
xpr.cpp
xprConstant.cpp
1b63e4f732dbc73d90abf886b4d21f8e3a165f6d 14-Jun-2009 Chris Lattner <sabre@nondot.org> Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73319 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
xpr.cpp
xprConstant.cpp
99ca9d64d362891c197bfda097e4994c41a67690 14-Jun-2009 Chris Lattner <sabre@nondot.org> move the various builtins stuff from libast to libbasic. This
fixes a layering violation in lib/Basic/Targets.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73318 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
MakeLists.txt
6b15cdc1312f8fc45c86ee75e2a85106700e97f6 14-Jun-2009 Chris Lattner <sabre@nondot.org> move the various builtins stuff from libast to libbasic. This
fixes a layering violation in lib/Basic/Targets.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73318 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
MakeLists.txt
950921c2eb50de386231062f91c88ff8adbd53b9 14-Jun-2009 Chris Lattner <sabre@nondot.org> prune #includes, Builtins.h/cpp no longer depends on libast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73317 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
f6c2a2a3ff0533334d15c96c24b22b57e13d4dd9 14-Jun-2009 Chris Lattner <sabre@nondot.org> prune #includes, Builtins.h/cpp no longer depends on libast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73317 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
260ad501d479ae610259272ad5ce13910b0cc0ac 14-Jun-2009 Chris Lattner <sabre@nondot.org> move GetBuiltinType from Builtin::Context to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73316 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
86df27bbdbb98c39ec2184695c0561209f91bedd 14-Jun-2009 Chris Lattner <sabre@nondot.org> move GetBuiltinType from Builtin::Context to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73316 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
9c395025d2a2309f4bb9d3f28efe313422482f88 13-Jun-2009 Anders Carlsson <andersca@mac.com> If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73284 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
31a08752eda39ca17154538e2f2587f8d339a1fa 13-Jun-2009 Anders Carlsson <andersca@mac.com> If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73284 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4ffb581f6eb74e56c74dd3566c68ee53da004b20 13-Jun-2009 Anders Carlsson <andersca@mac.com> More work on type parameter packs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73281 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
0ceffb51b28b09db67404058c642dcb1f877f6e8 13-Jun-2009 Anders Carlsson <andersca@mac.com> More work on type parameter packs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73281 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
c2018a7038b1bc6f2b8866472e4508d45f4139e1 13-Jun-2009 Anders Carlsson <andersca@mac.com> Improvements to TemplateArgumentListBuilder to make it work better with parameter packs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73272 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
67e332009c6e349dc34700f539747afcff990336 13-Jun-2009 Anders Carlsson <andersca@mac.com> Improvements to TemplateArgumentListBuilder to make it work better with parameter packs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73272 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
eebbf9aa9b9bd0f9e61f5e622dbf36a60836161b 13-Jun-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a type parameter is actually a type parameter pack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73261 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
eclTemplate.cpp
6d845ae1baf77691bca080e0762a1d45ee017f70 13-Jun-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a type parameter is actually a type parameter pack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73261 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
eclTemplate.cpp
b6eed6e84d81efeeda9e405fd6ec440b81510b14 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Delete method which is now trivial.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73043 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
26784c1dd1f3e395f024fd594646790421b3bbf3 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Delete method which is now trivial.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73043 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
45b1e22a0aeb450188be75c8ea07ea70a757ce20 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
687abffee40d0459fe5eecf3e5ee6e60be69d93c 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0ebbcba04c95cd6fc8033a862ddaebdc98875c26 07-Jun-2009 Anders Carlsson <andersca@mac.com> Instantiation support for more Obj-C expressions, string literals, @selector and @protocol expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73036 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
02d95baf23cbb29ea4ca58b3e8f54f92f845b900 07-Jun-2009 Anders Carlsson <andersca@mac.com> Instantiation support for more Obj-C expressions, string literals, @selector and @protocol expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73036 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9e8d7ca443bb7edaadf6ccff635e269c11ca4021 06-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Adds synthesize ivars to DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73000 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8019a7b55086da1b99dd156567d1f8c7e773d225 06-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Adds synthesize ivars to DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73000 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d2e57d9154d55251a4e94439dcdc96ab74f882ae 06-Jun-2009 Anders Carlsson <andersca@mac.com> Make ParmVarDecl::getDefaultArg() more robust, it now asserts that the argument is not unparsed. Add a new hasDefaultArg() and use it in places where getDefaultArg() was called when the argument was unparsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72984 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
ae0b4e7be78cf0dc2a6a333e865c2be9265774f9 06-Jun-2009 Anders Carlsson <andersca@mac.com> Make ParmVarDecl::getDefaultArg() more robust, it now asserts that the argument is not unparsed. Add a new hasDefaultArg() and use it in places where getDefaultArg() was called when the argument was unparsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72984 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
9eb1d82cf3244537303d6abdf9b633492343a482 06-Jun-2009 Mike Stump <mrs@apple.com> Avoid warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72976 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
412485d6659214285607aacd34ab2a25cfb6a67a 06-Jun-2009 Mike Stump <mrs@apple.com> Avoid warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72976 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
074cf971ecca9fb93427f5e2b044858570bdd9ba 05-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use of DeclContext for objc's ivars. No functionality
change. More to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72951 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
496b5a894c5ec5425de53909f5aac3fb4771a2ec 05-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use of DeclContext for objc's ivars. No functionality
change. More to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72951 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8f75fbcdd758570d095dde0ecbe1c42facacbac6 05-Jun-2009 Anders Carlsson <andersca@mac.com> Improvements to CXXExprWithTemporaries in preparation for fixing a bug with default arguments that have temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72944 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
99ba36de0d5b34624e74e77bffa73929617976cb 05-Jun-2009 Anders Carlsson <andersca@mac.com> Improvements to CXXExprWithTemporaries in preparation for fixing a bug with default arguments that have temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72944 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d9389beef9a889d95ea8417cc44db22e30ad9523 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Move CharIsSigned from TargetInfo to LangOptions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72928 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
15b91764d08e886391c865c4a444d7b51141c284 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Move CharIsSigned from TargetInfo to LangOptions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72928 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
558a3a34d4a317592ea7ec74dafb7e15debe64ad 05-Jun-2009 Anders Carlsson <andersca@mac.com> Make TemplateArgumentListBuilder take an ASTContext (because we're probably going to need it later). Move push_back to the .cpp file. If the passed in template argument is a type, assert that it's canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72918 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
9ba41645892da0000fe8a7832b80208f44dafeda 05-Jun-2009 Anders Carlsson <andersca@mac.com> Make TemplateArgumentListBuilder take an ASTContext (because we're probably going to need it later). Move push_back to the .cpp file. If the passed in template argument is a type, assert that it's canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72918 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
0233eb600f22b2023000778205f3ae1dfa3f5292 05-Jun-2009 Anders Carlsson <andersca@mac.com> Make the TemplateArgumentList take a TemplateArgumentListBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72917 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
e9c904b082ac3299831704a69066b86ab0f78bec 05-Jun-2009 Anders Carlsson <andersca@mac.com> Make the TemplateArgumentList take a TemplateArgumentListBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72917 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
6e9d02f2456d21fb4e377d781d3d81dffe5fb30c 05-Jun-2009 Anders Carlsson <andersca@mac.com> Change the specialization decls to take a TemplateArgumentListBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72916 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
91fdf6f576b91f023c3bebb0d3786aab555cb3c5 05-Jun-2009 Anders Carlsson <andersca@mac.com> Change the specialization decls to take a TemplateArgumentListBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72916 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
40bca767cd675be735fe3741b86aa2be1bc1c17d 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Minor simplification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72887 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ce1bca73aef9bbf6359ab8420278203dda81a054 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Minor simplification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72887 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
326cf66da4781c77722a24b498160ad99ece36ed 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4326: Handle constant evaluation for void* pointer subtraction
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72886 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
147bd641dd264fde2fc5a0074f30eace71016ea9 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4326: Handle constant evaluation for void* pointer subtraction
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72886 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
56b309a8384109ed31b29575b79c3cd6d0bceeca 04-Jun-2009 Anders Carlsson <andersca@mac.com> Minor improvements to template parameter writing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72848 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
0487f6652875e227773c61318e6b3a2759dd0342 04-Jun-2009 Anders Carlsson <andersca@mac.com> Minor improvements to template parameter writing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72848 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
ddc6d0ba0772a763add013386d583e7820035274 04-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate a warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72846 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
38999462749c22d49d1e1707206aaa4997636f4c 04-Jun-2009 Douglas Gregor <dgregor@apple.com> Eliminate a warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72846 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
b290be02fc9148b81c17b27df39d34b7cb8ab674 04-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Cleanup/Refactoring of ivar collection. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72827 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8e6ac1d80055fa37b9b84029c7e751624ba7f84c 04-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Cleanup/Refactoring of ivar collection. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72827 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4ea653d3fc36b54003323306ba3e7aa709e58a0a 04-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Template argument deduction for references

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72822 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d560d5025a0e5b1942d99d5f39005337b03a64c2 04-Jun-2009 Douglas Gregor <dgregor@apple.com> Template argument deduction for references

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72822 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
143b0088b0cc9db860c36b45f5cfca41b916cceb 03-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Place the GC attribute on the same relative pointer
position to make it consistant and to match gcc's behavior,
by placing it at the inner-most pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72784 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4027cd1b924e29784a49085b1717f35cdd719146 03-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Place the GC attribute on the same relative pointer
position to make it consistant and to match gcc's behavior,
by placing it at the inner-most pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72784 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
31231ee8e93d7e1e051b5a8b03d141653373bbe8 03-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Use "()" instead of "(void)" when pretty-printing a parameter-less function type for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72747 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7c94c4bb7b875dc1a2b23f77f1ed8013cf94abdb 03-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use "()" instead of "(void)" when pretty-printing a parameter-less function type for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72747 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
562d0eeba63e8ba31ed8b0a9e8c0ab5981d4d1ac 02-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose misuse of __strong attribute in a redeclaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72737 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
86f4385536a0b2202860ad4e20d84f9330b1a4f4 02-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose misuse of __strong attribute in a redeclaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72737 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
717e4fad26564c2b40336bb03c5acd40df3ca985 02-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics on __weak attribute mismatch.
Fixes an error recovery issue which caused a crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72733 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8df7a28269a1c0f4444928d0baea402b410e95f1 02-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics on __weak attribute mismatch.
Fixes an error recovery issue which caused a crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72733 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
430d9f10d954eb0df739a38ff0659fccb2bd7ca9 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix a silly typo in my previous objc_gc merging patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72723 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
354e53da656237e25518b3fafa3bf84de6e6f57e 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix a silly typo in my previous objc_gc merging patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72723 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
de43bf616a0328e537dec13a08d53bd39f4fbf3f 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Cleaned-up version of gc attribute type merging. I still don't like it
very much, but I have a feeling we're never going to have an
implementation that makes sense because of compatibility issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
07d258756dc856c6987c394a0972884e6ed46765 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Cleaned-up version of gc attribute type merging. I still don't like it
very much, but I have a feeling we're never going to have an
implementation that makes sense because of compatibility issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
85d9126ba6da0f6860a2c33193c31abc257b8f22 02-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> This patch attempts to fix the merging of __strong/__weak attributes
in merge_types. It is incomplete. We probably want to issue
a warning if user attempts to change the attribute from __weak to
__strong or vice-vera. It also assumes that a __weak/__strong
attribute can not be specified with other (currently one) type
attriute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72711 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
585f7b2f5c818d7579cffc91590bdc9e3d8b645d 02-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> This patch attempts to fix the merging of __strong/__weak attributes
in merge_types. It is incomplete. We probably want to issue
a warning if user attempts to change the attribute from __weak to
__strong or vice-vera. It also assumes that a __weak/__strong
attribute can not be specified with other (currently one) type
attriute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72711 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0ceca87a412419986679c121168150d1956fd9bd 01-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> A corner case of objc2 gc's write-barrier generation
for the Next runtime.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72703 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
102e390bcb5a1fb1a8fdbc8505e6dfd905374bbd 01-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> A corner case of objc2 gc's write-barrier generation
for the Next runtime.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72703 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
aeae1cee4c51540c5dc2a8893ebe6d638d640677 01-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Disable type merging with gc attributes. This has a number of nasty
properties at the moment:

1. It allows stuff like "__strong id x; __weak id x;".

2. For constructs like "__strong id x; id x;", subsequent references to
x lose the objc_gc attribute.

3. This incorrectly allows merges involving the address_space attribute.

4. Constructs like "id x; /* some code using x */ __weak id x;" don't
apply the objc_gc attribute consistently to all uses of x.

The first three can probably be fixed relatively easily; the fourth
would be extremely difficult to fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72683 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
852d63b806c5cbd730c6b9d696e2e27d02546b49 01-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Disable type merging with gc attributes. This has a number of nasty
properties at the moment:

1. It allows stuff like "__strong id x; __weak id x;".

2. For constructs like "__strong id x; id x;", subsequent references to
x lose the objc_gc attribute.

3. This incorrectly allows merges involving the address_space attribute.

4. Constructs like "id x; /* some code using x */ __weak id x;" don't
apply the objc_gc attribute consistently to all uses of x.

The first three can probably be fixed relatively easily; the fourth
would be extremely difficult to fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72683 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
58944acac481a17adc174389c1124892cbdfd979 31-May-2009 Douglas Gregor <doug.gregor@gmail.com> Initial infrastructure for class template partial specialization. Here
we have the basics of declaring and storing class template partial
specializations, matching class template partial specializations at
instantiation time via (limited) template argument deduction, and
using the class template partial specialization's pattern for
instantiation.

This patch is enough to make a simple is_pointer type trait work, but
not much else.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72662 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
c8ab2563ac8f7dcc4fdc518b5cc7015ecbb2f003 31-May-2009 Douglas Gregor <dgregor@apple.com> Initial infrastructure for class template partial specialization. Here
we have the basics of declaring and storing class template partial
specializations, matching class template partial specializations at
instantiation time via (limited) template argument deduction, and
using the class template partial specialization's pattern for
instantiation.

This patch is enough to make a simple is_pointer type trait work, but
not much else.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72662 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
0af57571cc6ae667905d234ab9c9d123848c8fb9 31-May-2009 Douglas Gregor <doug.gregor@gmail.com> Add a little FIXME for C++ class printing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72660 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
f757ae711513e5b2efa25fde1562315c0906bd68 31-May-2009 Douglas Gregor <dgregor@apple.com> Add a little FIXME for C++ class printing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72660 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
cb8e0c060390e2a97c736aab525eb1127b7d0176 31-May-2009 Anders Carlsson <andersca@mac.com> Clean up the newly added C++ AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72643 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
88eaf075c56672761b72cc50957db4a35bf24ebd 31-May-2009 Anders Carlsson <andersca@mac.com> Clean up the newly added C++ AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72643 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
5b839c8c9a2867a96fda009b1bcbadbf99034047 30-May-2009 Anders Carlsson <andersca@mac.com> Get rid of CXXTempVarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72637 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
1c02101999a576790b433ac4b5195e7ac4197347 30-May-2009 Anders Carlsson <andersca@mac.com> Get rid of CXXTempVarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72637 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
d8c8251c3d023650a9ebbdfe341328ada28e899e 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Some small fixes for fields of reference type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72636 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2be586108bb401019647791feca19ea03fd477ce 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Some small fixes for fields of reference type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72636 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5552c80bf4f02f764bb9d8708bbc686845bf9bb4 30-May-2009 Anders Carlsson <andersca@mac.com> Stop using CXXTempVarDecl and use CXXTemporary instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72634 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ff6b3d64c9f07155f1414411b8451d7bf8937c62 30-May-2009 Anders Carlsson <andersca@mac.com> Stop using CXXTempVarDecl and use CXXTemporary instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72634 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
7b7b25588fbcda3306d9725d863daed4f54699c2 30-May-2009 Anders Carlsson <andersca@mac.com> Remove VarDecl from CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72633 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
8e587a15da6d3457a418239d5eb4146fcbd209f3 30-May-2009 Anders Carlsson <andersca@mac.com> Remove VarDecl from CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72633 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
432ba3cd4f8c581555d10660de2f276c6ce58ce3 30-May-2009 Anders Carlsson <andersca@mac.com> Small fixes to CXXTemporary and CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72628 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
b859f35459ae3e1188d1e1b86df08d649695fd86 30-May-2009 Anders Carlsson <andersca@mac.com> Small fixes to CXXTemporary and CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72628 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
873176e53a2e499bfea5568f3a31556d38130b21 30-May-2009 Anders Carlsson <andersca@mac.com> Add a CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72627 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
fceb0a8adba9d25db99a4d73e9655c2831a96ecd 30-May-2009 Anders Carlsson <andersca@mac.com> Add a CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72627 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
29f365d254741434c8e9fa9855e4ae8f8985554a 30-May-2009 Anders Carlsson <andersca@mac.com> Add a CXXTemporary class. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72626 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
c1ce477119fed070299668aab24084b17ff5f14b 30-May-2009 Anders Carlsson <andersca@mac.com> Add a CXXTemporary class. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72626 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f2f8c97b6587288c9a6d5214b76092f44c6ac96c 30-May-2009 Mike Stump <mrs@apple.com> Cleqnup ideas from Chris, thanks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72621 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7462b39a9bccaf4392687831036713f09f9c0681 30-May-2009 Mike Stump <mrs@apple.com> Cleqnup ideas from Chris, thanks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72621 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6185ec05b060f2f02e2ca29e192e5544162344f9 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> AST printing for C++ base classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72617 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
59e63570359b8adb9eb257759fe766d7aac1995a 30-May-2009 Douglas Gregor <dgregor@apple.com> AST printing for C++ base classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72617 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
8d8ddcab753252ea999c37c2b585399bb8a7dfed 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> Pretty printing and improved representation for namespace alias declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72616 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
6c9c94053132e5ca0655124b70f1c386a332e71d 30-May-2009 Douglas Gregor <dgregor@apple.com> Pretty printing and improved representation for namespace alias declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72616 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
68ff468847b0550d53adbd25a296a8ada99c48df 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Add a hack to prevent us from printing out the __builtin_va_list
declaration in -ast-print mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72615 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
3d4a7c9bf856774fb43d724a3353c5a24297f866 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Add a hack to prevent us from printing out the __builtin_va_list
declaration in -ast-print mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72615 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
1d27d691cda32d632aea9b83f6a57d4caf6ba60b 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> Printing for using directives, e.g.,

using namespace std::debug;

Extended UsingDirectiveDecl to store the nested-name-specifier that
precedes the nominated namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72614 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
8419fa3af97208eb00f0cd6c62354ce4ff986677 30-May-2009 Douglas Gregor <dgregor@apple.com> Printing for using directives, e.g.,

using namespace std::debug;

Extended UsingDirectiveDecl to store the nested-name-specifier that
precedes the nominated namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72614 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclPrinter.cpp
2513331e92c91f06a13bf58ed83822d0fa1357ea 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> Never suppress specifiers when printing the parameters of a function
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72613 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
6620a628b0a02c78741b8f31790d4c1186aa4038 30-May-2009 Douglas Gregor <dgregor@apple.com> Never suppress specifiers when printing the parameters of a function
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72613 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
1fd09bb1579ec098f810c3176b59aab20fc3d545 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Pass an ASTContext into Stmt::printPretty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72612 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
6e1a345838c8feb500ba8887b3ba5a1c1d0b33dc 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Pass an ASTContext into Stmt::printPretty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72612 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
4bdae72abaf70019a9acddcb106d56fd33e813b9 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Add a Stmt::printPretty overload which takes an ASTContext; start
transitioning callers over to pass one in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72609 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
48d14a222276fad5279e994d1a062f36ae6fcbce 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Add a Stmt::printPretty overload which takes an ASTContext; start
transitioning callers over to pass one in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72609 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
d73364a1cba83527465133c5575dec4ac8ece3c4 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Expose an API to print a group of decls (like "int a,b;").
Make StmtPrinter use DeclPrinter to print all declarations. Merge
declarations in the limited case of an unnamed TagDecl followed by one
or more declarations using that TagDecl directly. Change
SuppressTypeSpecifiers to the more general SuppressSpecifiers, and
use it to suppress stuff like "typedef" and "extern". Replace
OwnedTag with SuppressTag, since it's more convenient to print
declarations from DeclPrinter at the moment.
improvements to declaration printing. Fix pretty-printing for K&R
function definitions and __builtin_va_arg.

We're now to the point where the pretty-printing output for non-trivial
programs can actually be piped back into clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72608 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
ype.cpp
42f42c0dd5cf71fbfc6fa282d03079a902f6e342 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Expose an API to print a group of decls (like "int a,b;").
Make StmtPrinter use DeclPrinter to print all declarations. Merge
declarations in the limited case of an unnamed TagDecl followed by one
or more declarations using that TagDecl directly. Change
SuppressTypeSpecifiers to the more general SuppressSpecifiers, and
use it to suppress stuff like "typedef" and "extern". Replace
OwnedTag with SuppressTag, since it's more convenient to print
declarations from DeclPrinter at the moment.
improvements to declaration printing. Fix pretty-printing for K&R
function definitions and __builtin_va_arg.

We're now to the point where the pretty-printing output for non-trivial
programs can actually be piped back into clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72608 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
ype.cpp
62571280ea10a310117817ddb8c06929a23def25 30-May-2009 Mike Stump <mrs@apple.com> Improve __builtin_nanf support; we now can deal with them as constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72607 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4572baba9d18c275968ac113fd73b0e3c77cccb8 30-May-2009 Mike Stump <mrs@apple.com> Improve __builtin_nanf support; we now can deal with them as constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72607 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
77ac216a4c5e320b255e690ba694a234759c2064 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix some test failures involving -ast-print.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72605 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ype.cpp
c8f2c61f4f667c2bc3e4e74b274fa397a4232393 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix some test failures involving -ast-print.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72605 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ype.cpp
1fa5d0d2f7042fa3a48e329f8879f7a85f26c944 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up printing for Objective-C, designated initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72602 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
64f650062fbe5e2bc6fb6d341c46a2ec0284694f 30-May-2009 Douglas Gregor <dgregor@apple.com> Clean up printing for Objective-C, designated initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72602 91177308-0d34-0410-b5e6-96231b3b80d8
eclPrinter.cpp
tmtPrinter.cpp
e66ecf54095d73aaac1d4bd7230cd9167bfd9562 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Some enhancements to DeclStmt printing. Some of this should
move to DeclPrinter.cpp, but I haven't quite worked out how best to do
that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72599 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
db23b154bb62e95e63c6412965835a510c7771d1 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Some enhancements to DeclStmt printing. Some of this should
move to DeclPrinter.cpp, but I haven't quite worked out how best to do
that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72599 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
84bca951282f362c439cc7993fcb4d145384e416 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Add support for PrintingPolicy::SuppressTypeSpecifiers to type printing.
(I have a work-in-progress patch which uses this.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72598 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
22b61e937dcd8ba2e14764c367f975a392ec7da0 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Add support for PrintingPolicy::SuppressTypeSpecifiers to type printing.
(I have a work-in-progress patch which uses this.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72598 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
996677cffa764e70e85f289a2edd88aa48b57c2d 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclPrinter.cpp
tmtPrinter.cpp
4fe0c8e9c76b96e7aff21696a40dacc09d0237bc 30-May-2009 Douglas Gregor <dgregor@apple.com> Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclPrinter.cpp
tmtPrinter.cpp
d3f6b1658df4f89167a2a6848c3a80c198d67844 29-May-2009 Anders Carlsson <andersca@mac.com> Add code for emitting C++ destructors. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72591 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7267c1693abe7875b0c57268be05005ae013c6c9 29-May-2009 Anders Carlsson <andersca@mac.com> Add code for emitting C++ destructors. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72591 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
3bf3bbcb3cf79cc5bc065a011f5ae195667d3a29 29-May-2009 Douglas Gregor <doug.gregor@gmail.com> Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72590 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
ecl.cpp
estedNameSpecifier.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
ype.cpp
d249e1d1f1498b81314459ceda19d6ff25c278ad 29-May-2009 Douglas Gregor <dgregor@apple.com> Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72590 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
ecl.cpp
estedNameSpecifier.cpp
tmtDumper.cpp
tmtPrinter.cpp
emplateName.cpp
ype.cpp
b4c71b389d72b0825f78cc4e68ed2b299dc49558 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Add an assertion so that we don't accidentally build constant arrays of
VLAs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72587 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
587cbdfd95f4b0aaccc14b31f5debe85d5daf7ed 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Add an assertion so that we don't accidentally build constant arrays of
VLAs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72587 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1a6b88e99f3c83f9404cccef65fb38230799a747 28-May-2009 Douglas Gregor <doug.gregor@gmail.com> Introduced DeclContext::isDependentContext, which determines whether a
given DeclContext is dependent on type parameters. Use this to
properly determine whether a TagDecl is dependent; previously, we were
missing the case where the TagDecl is a local class of a member
function of a class template (phew!).

Also, make sure that, when we instantiate declarations within a member
function of a class template (or a function template, eventually),
that we add those declarations to the "instantiated locals" map so
that they can be found when instantiating declaration references.

Unfortunately, I was not able to write a useful test for this change,
although the assert() that fires when uncommenting the FIXME'd line in
test/SemaTemplate/instantiate-declref.cpp tells the "experienced user"
that we're now doing the right thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
bc221637f5ed3538b8495dd13b831c11e821c712 28-May-2009 Douglas Gregor <dgregor@apple.com> Introduced DeclContext::isDependentContext, which determines whether a
given DeclContext is dependent on type parameters. Use this to
properly determine whether a TagDecl is dependent; previously, we were
missing the case where the TagDecl is a local class of a member
function of a class template (phew!).

Also, make sure that, when we instantiate declarations within a member
function of a class template (or a function template, eventually),
that we add those declarations to the "instantiated locals" map so
that they can be found when instantiating declaration references.

Unfortunately, I was not able to write a useful test for this change,
although the assert() that fires when uncommenting the FIXME'd line in
test/SemaTemplate/instantiate-declref.cpp tells the "experienced user"
that we're now doing the right thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
2767d88f088ce07f489e6a64592950f9c0a91ebd 28-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72498 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
465226e23a3008bd68973513dda1f9e3cd27dbdd 28-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72498 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c4cce788eda845e01907c60e31f7d73ffbed4521 27-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add a big test case for I-C-Es in C++, and a fix to make it work. The fix might not be the right way to do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72490 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1590d9c0fec4c710c2962e4bb71f76979b5163d3 27-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add a big test case for I-C-Es in C++, and a fix to make it work. The fix might not be the right way to do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72490 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
83418529244038b34ae9990b4cf6ac0a92f8c741 27-May-2009 Steve Naroff <snaroff@apple.com> Convert ObjC qualified type clients over to using iterators.

This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
446ee4eb4fc4c705a59365252df7a5c253daafa1 27-May-2009 Steve Naroff <snaroff@apple.com> Convert ObjC qualified type clients over to using iterators.

This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c0a35bfe68a646414c3556a2b19b8d2a5b00ffaf 27-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix up constant expression handling to deal with the address
of a reference correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
50c39ea4858265f3f5f42a0c624557ce2281936b 27-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix up constant expression handling to deal with the address
of a reference correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4833ff0f4a21577e2b4d2c870adab24e5199ef7a 26-May-2009 Douglas Gregor <doug.gregor@gmail.com> When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
tmtIterator.cpp
78d1583d0b36b7d6d8d10234cdc19ab94adf765a 26-May-2009 Douglas Gregor <dgregor@apple.com> When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
tmtIterator.cpp
e660944302c55f78fc0e246a22146e2e3b165754 26-May-2009 Douglas Gregor <doug.gregor@gmail.com> Simplify printing of the statistics for types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72415 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmt.cpp
dbe833da54e1b6192991b64fc453cd50b5ee7909 26-May-2009 Douglas Gregor <dgregor@apple.com> Simplify printing of the statistics for types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72415 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmt.cpp
6607090cc24009592efb9bb0be861d7f5230cdc5 26-May-2009 Anders Carlsson <andersca@mac.com> Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72410 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6dde78f744382a5627a04f984a97049e0c4b5e73 26-May-2009 Anders Carlsson <andersca@mac.com> Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72410 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5edcc084e452707843c44b3c3f1b62da111d6a05 26-May-2009 Anders Carlsson <andersca@mac.com> A block that returns a reference is an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72409 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5e5783180acb42c9d9b1be2838370ea5930a2a8b 26-May-2009 Anders Carlsson <andersca@mac.com> A block that returns a reference is an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72409 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
66c9edf4cf8c46c73599f5ca7d15003c1a82077b 25-May-2009 Eli Friedman <eli.friedman@gmail.com> Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72401 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1eed60297ef4701b899c6a3b9680bf08f3403422 25-May-2009 Eli Friedman <eli.friedman@gmail.com> Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72401 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
93b8b0f10bd443028da8d3af67874de578737171 22-May-2009 Douglas Gregor <doug.gregor@gmail.com> Representation of and template instantiation for member
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.

Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72281 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
1c0ca59416999129d0439c2661d137ef38e86209 22-May-2009 Douglas Gregor <dgregor@apple.com> Representation of and template instantiation for member
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.

Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72281 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
c0672e4add6bd89aee2bb032b4f91bd1aff100e2 22-May-2009 Fariborz Jahanian <fjahanian@apple.com> (Next runtime only) check to see if class implements forwardInvocation method
and objects of this class are derived from 'NSProxy'.
Under such conditions, which means that every method possible is
implemented in the class, we should not issue "Method definition not found"
warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72267 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
cd1876207f5564beba74e4b2524b664bdba0ba9f 22-May-2009 Fariborz Jahanian <fjahanian@apple.com> (Next runtime only) check to see if class implements forwardInvocation method
and objects of this class are derived from 'NSProxy'.
Under such conditions, which means that every method possible is
implemented in the class, we should not issue "Method definition not found"
warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72267 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
53f0548addb46c238c6aee031c6aa0e632ed9123 22-May-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Parse typeof-specifier the same way as sizeof/alignof are parsed.

-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72255 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6409625011e4a11ff07956ff46a44d6ca4473992 22-May-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parse typeof-specifier the same way as sizeof/alignof are parsed.

-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72255 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
3a7a06edafb1c7474a7b41ee760101e433639273 22-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for C99 designated initializers, because we
can. Also, delay semantic analysis of initialization for
value-dependent as well as type-dependent expressions, since we can't
always properly type-check a value-dependent expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72233 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9ea62768fca25d829d80199cf4f8cf0f4dd39251 22-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C99 designated initializers, because we
can. Also, delay semantic analysis of initialization for
value-dependent as well as type-dependent expressions, since we can't
always properly type-check a value-dependent expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72233 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4061e9857da99d584fbbae7a12eb26531bfb53f3 21-May-2009 Douglas Gregor <doug.gregor@gmail.com> Fix CMake build for AST XML dumper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72228 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
100bb76aa972ec3baf7581f82680bef76f8e95c3 21-May-2009 Douglas Gregor <dgregor@apple.com> Fix CMake build for AST XML dumper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72228 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8987c0341afa395e09d29ae5439d2d814ca87121 21-May-2009 Douglas Gregor <doug.gregor@gmail.com> AST XML dump, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72224 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ee75c05c1a0218369cac26ab1c847d9a04e4db88 21-May-2009 Douglas Gregor <dgregor@apple.com> AST XML dump, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72224 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
9e6bef4fb5efb19c7286fa24d8aedab9c3d625fc 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
66c3cf00b06119ec4141d1e54d5e7cd7b03a2e6f 20-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for the various kinds of AST nodes that occur
due to C++ type construction of the form T(a1, a2, ..., aN).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72183 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
d94546a0a1deef7286c13e49b9584621ae81cc9a 20-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for the various kinds of AST nodes that occur
due to C++ type construction of the form T(a1, a2, ..., aN).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72183 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
f27b765e5a5e06ff637e0ef35fdc1bfead9040a4 20-May-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a new expression type, CXXUnresolvedConstructExpr, to
describe the construction of a value of a given type using function
syntax, e.g.,

T(a1, a2, ..., aN)

when the type or any of its arguments are type-dependent. In this
case, we don't know what kind of type-construction this will be: it
might construct a temporary of type 'T' (which might be a class or
non-class type) or might perform a conversion to type 'T'. Also,
implement printing of and template instantiation for this new
expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr,
our existing tests cover template instantiation of this new expression
node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72176 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
d81e6ca6e378c3996a139066a5c4b7fc1869630c 20-May-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression type, CXXUnresolvedConstructExpr, to
describe the construction of a value of a given type using function
syntax, e.g.,

T(a1, a2, ..., aN)

when the type or any of its arguments are type-dependent. In this
case, we don't know what kind of type-construction this will be: it
might construct a temporary of type 'T' (which might be a class or
non-class type) or might perform a conversion to type 'T'. Also,
implement printing of and template instantiation for this new
expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr,
our existing tests cover template instantiation of this new expression
node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72176 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
0816e827cf2c9c7b1bbc10c91a1060504e8ac6f4 19-May-2009 Douglas Gregor <doug.gregor@gmail.com> Fix handling of the GNU "t ? : f" extension to the conditional
operator in C++, and verify that template instantiation for the
condition operator does the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72127 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d5f3a0fde43bca9f3738aed931b0f13ca73a9f11 19-May-2009 Douglas Gregor <dgregor@apple.com> Fix handling of the GNU "t ? : f" extension to the conditional
operator in C++, and verify that template instantiation for the
condition operator does the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72127 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e1f8c0ab26edd816d905e766aefd7023ea4878cf 19-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for call expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72081 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4a2487aeacf9f35ce553318c2eb39c20ec23845e 19-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for call expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72081 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4a95134918f5492e363a44868e3473299e0562ce 19-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for imaginary literals, because they were next in Expr.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72058 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d8ac436c8c10c52c937ba323db582259ceb06197 19-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for imaginary literals, because they were next in Expr.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72058 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
57420b4ca8a98a4c81b7a55338ad0b6a8d993b4e 18-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for C++ try/catch statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72035 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d308e6201afd3a8a198c52ba034d35ed19d4bafe 18-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ try/catch statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72035 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
b12249d254535d4b156c9dc5bfa9f0b9a0ccc548 18-May-2009 Douglas Gregor <doug.gregor@gmail.com> When instantiating the definition of a member function of a class
template, introduce that member function into the template
instantiation stack. Also, add diagnostics showing the member function
within the instantiation stack and clean up the qualified-name
printing so that we get something like:

note: in instantiation of member function 'Switch1<int, 2, 2>::f'
requested here

in the template instantiation backtrace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72015 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f3e7ce4bd9837cdab6a096235922865f95467d3d 18-May-2009 Douglas Gregor <dgregor@apple.com> When instantiating the definition of a member function of a class
template, introduce that member function into the template
instantiation stack. Also, add diagnostics showing the member function
within the instantiation stack and clean up the qualified-name
printing so that we get something like:

note: in instantiation of member function 'Switch1<int, 2, 2>::f'
requested here

in the template instantiation backtrace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72015 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
18ca477e291542fcb9e1beb50cacf32e67498f13 17-May-2009 Anders Carlsson <andersca@mac.com> Make ActOnExprStmt take a FullExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71989 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6b1d283fe879fb11d7ce7a69feecf66e77b0eaf3 17-May-2009 Anders Carlsson <andersca@mac.com> Make ActOnExprStmt take a FullExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71989 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
86cf4ac4d2ff8d7010b2c2fe825bc9938efd98f9 17-May-2009 Anders Carlsson <andersca@mac.com> Use the Itanium ABI for member pointers. Add a missing 'break' statement and a test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71972 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1cca74ef3627a3a0ab14501d23e336548f6611b2 17-May-2009 Anders Carlsson <andersca@mac.com> Use the Itanium ABI for member pointers. Add a missing 'break' statement and a test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71972 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea6a262a52c1ef304d4dbcf566304155d39b35ae 17-May-2009 Eli Friedman <eli.friedman@gmail.com> A couple of tweaks to make -ast-print produce code that's closer to
valid C code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71971 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
b3e229694a5d1966fcf604073e82b0057eb3114a 17-May-2009 Eli Friedman <eli.friedman@gmail.com> A couple of tweaks to make -ast-print produce code that's closer to
valid C code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71971 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
7624471afa349dd73419a4ff5643a0e7c6664344 17-May-2009 Anders Carlsson <andersca@mac.com> Add setters/getters to CXXMethodDecl so it can keep track of which virtual member functions it overrides (if any)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71968 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
05eb24474218d70366b4d7d6b5b19dda2473a163 17-May-2009 Anders Carlsson <andersca@mac.com> Add setters/getters to CXXMethodDecl so it can keep track of which virtual member functions it overrides (if any)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71968 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f80e261d943ecbef3036c769e492dcda0012c67d 16-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement instantiation of a few boring, simple expressions. I don't think these are testable yet, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71953 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
8b0b475b3464b0f70b91ba7d679d23c424677d5e 16-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement instantiation of a few boring, simple expressions. I don't think these are testable yet, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71953 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
72d3c669ed7257bf3c169dabc2316d04c416a959 16-May-2009 Anders Carlsson <andersca@mac.com> Basic support for member exprs where the base expr type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71907 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ffce2df6ae280d354d51371282a579df1eb86876 16-May-2009 Anders Carlsson <andersca@mac.com> Basic support for member exprs where the base expr type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71907 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
777cc7a08e55e0b027ee4c7dd9caa6481b23b034 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for break and continue statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71903 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
861ce3178c70cfb0fa50baf685e1ad363538eaa9 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for break and continue statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71903 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
4850df6d9978b2d04d70b7f0f45576a93474403e 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that we use the canonical type for the names of instantiated
constructors and destructors. This is a requirement of
DeclarationNameTable::getCXXSpecialName that we weren't assert()'ing,
so it should have been caught much earlier :(

Big thanks to Anders for the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71895 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
49f25ecf7ff358039ce4c9254b867f32110e660e 15-May-2009 Douglas Gregor <dgregor@apple.com> Make sure that we use the canonical type for the names of instantiated
constructors and destructors. This is a requirement of
DeclarationNameTable::getCXXSpecialName that we weren't assert()'ing,
so it should have been caught much earlier :(

Big thanks to Anders for the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71895 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
12aed0be9db50a396a9163bea1ee466a8e2c2b5e 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that the type associated with a class template is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71878 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
aafc0ccfcf860d921a86423c6c9a738301987abf 15-May-2009 Douglas Gregor <dgregor@apple.com> Make sure that the type associated with a class template is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71878 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
328b9dfb017589eae55f21859ac3e0b373dcef1d 15-May-2009 Anders Carlsson <andersca@mac.com> Add NullStmt::Clone and use it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71823 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d19cd90b266181c4a8d186adfa20ccebe73336cc 15-May-2009 Anders Carlsson <andersca@mac.com> Add NullStmt::Clone and use it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71823 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d9d6d50992923eeb0c0ac0a2ec2d227867d35787 14-May-2009 Anders Carlsson <andersca@mac.com> Improvements to the FunctionDecl getters/setters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a75e8534f2b7c2480c48f31f301bd00b241c5499 14-May-2009 Anders Carlsson <andersca@mac.com> Improvements to the FunctionDecl getters/setters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
08bea470bc3d397d10e6cb19aaca7e827551798f 13-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6880874 - [sema] crash on array types with different index sizes



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
38aeec7299c48cb79523f7f89776fb258c84aeea 13-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6880874 - [sema] crash on array types with different index sizes



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
02ebfa86912fe41b011d5898881704f2e842cb91 12-May-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement ivar synthesis of properties declared in protocols
only and used in class imllementations (objc2 Nonfragile ABI specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71571 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9820074dd47d37681085e964cd3392ac0b3e67b9 12-May-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement ivar synthesis of properties declared in protocols
only and used in class imllementations (objc2 Nonfragile ABI specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71571 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f9e7d3d4e672391f649336eb425129dccc9a2fed 12-May-2009 Douglas Gregor <doug.gregor@gmail.com> Encapsulate template arguments lists in a new class,
TemplateArgumentList. This avoids the need to pass around
pointer/length pairs of template arguments lists, and will eventually
make it easier to introduce member templates and variadic templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71517 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
7e06390f8a60440d6fc5f0e633acdc2edd8ee924 12-May-2009 Douglas Gregor <dgregor@apple.com> Encapsulate template arguments lists in a new class,
TemplateArgumentList. This avoids the need to pass around
pointer/length pairs of template arguments lists, and will eventually
make it easier to introduce member templates and variadic templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71517 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
3eb207002be2bdffddc850aafd21a0a5710ca1c7 11-May-2009 Douglas Gregor <doug.gregor@gmail.com> Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:

template<typename T, typename U>
struct X {
typedef T type;

X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71471 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
42af25f865a82022a04bedeb483ac251c4412e29 11-May-2009 Douglas Gregor <dgregor@apple.com> Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:

template<typename T, typename U>
struct X {
typedef T type;

X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71471 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4dadcec817a4dbe4f829973c31df00d776aea82a 11-May-2009 Ted Kremenek <kremenek@apple.com> Add ParentMap:getParentIgnoreParens().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71469 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
b1b9f680f5fc65230de877baccae50820a969a94 11-May-2009 Ted Kremenek <kremenek@apple.com> Add ParentMap:getParentIgnoreParens().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71469 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
df3e957d37346dff9b8c6214f5ed827f85fe3ad4 11-May-2009 Douglas Gregor <doug.gregor@gmail.com> The canonical declaration of a NULL declaration is NULL

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71409 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c4ccf01c1223ea13efc5b6dd19ca4916af0daf6a 11-May-2009 Douglas Gregor <dgregor@apple.com> The canonical declaration of a NULL declaration is NULL

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71409 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9054f9878dbe2b1b8384c951ad07759d9de9dc8c 11-May-2009 Douglas Gregor <doug.gregor@gmail.com> Implement the semantics of the injected-class-name within a class
template. The injected-class-name is either a type or a template,
depending on whether a '<' follows it. As a type, the
injected-class-name's template argument list contains its template
parameters in declaration order.

As part of this, add logic for canonicalizing declarations, and be
sure to canonicalize declarations used in template names and template
arguments.

A TagType is dependent if the declaration it references is dependent.

I'm not happy about the rather complicated protocol needed to use
ASTContext::getTemplateSpecializationType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71408 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
ype.cpp
7da97d0f31e1ec16998d3de2cfd2e88fe3736673 11-May-2009 Douglas Gregor <dgregor@apple.com> Implement the semantics of the injected-class-name within a class
template. The injected-class-name is either a type or a template,
depending on whether a '<' follows it. As a type, the
injected-class-name's template argument list contains its template
parameters in declaration order.

As part of this, add logic for canonicalizing declarations, and be
sure to canonicalize declarations used in template names and template
arguments.

A TagType is dependent if the declaration it references is dependent.

I'm not happy about the rather complicated protocol needed to use
ASTContext::getTemplateSpecializationType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71408 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclTemplate.cpp
ype.cpp
5d0ead717d57405b4a3b34a55b77579ea8b2774e 10-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++0x nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
ype.cpp
6e8ed16ffef02b82995a90bdcf10ffff7d63839a 10-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++0x nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
ype.cpp
b5dc2946050484c5cd067bb4453fcfd4ab95b403 07-May-2009 Daniel Dunbar <daniel@zuster.org> Remove -fobjc-tight-layout, seems to work!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71184 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
913af35741b55fe854bc26c9dddc312cd991e24d 07-May-2009 Daniel Dunbar <daniel@zuster.org> Remove -fobjc-tight-layout, seems to work!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71184 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b88ba4173268f00ef39cfa6c6804d43ef510646d 07-May-2009 Douglas Gregor <doug.gregor@gmail.com> Start canonicalizing template names. This is not yet complete, but it
improves type identity with dependent types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71152 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
25a3ef7cc5fd55dc8cc67c6e6770c8595657e082 07-May-2009 Douglas Gregor <dgregor@apple.com> Start canonicalizing template names. This is not yet complete, but it
improves type identity with dependent types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71152 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
db8a02d6811f4f5db5d4e6a5eeb6c57e87e30b94 07-May-2009 Chris Lattner <sabre@nondot.org> Add support for LLLi -> int128 in builtins.def


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71148 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
4d3cbf0335dc43a281377052afa180af28f39e7f 07-May-2009 Chris Lattner <sabre@nondot.org> Add support for LLLi -> int128 in builtins.def


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71148 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
ba9a371cb3438f165ff6191c42732f699968eea2 07-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71125 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
bfa2fcba545fb270f31205d616846c2bfaf4e47e 07-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71125 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
2b6d9ed6dc0842bc0a26a51f811264ca84705842 06-May-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug for objc2's gc in the presense of type-casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71041 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
06b89124a9a5971a0528cc9da6817740bac43164 06-May-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug for objc2's gc in the presense of type-casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71041 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d23abcaf4d643a8493f1df127a4af749e717cac0 06-May-2009 Ted Kremenek <kremenek@apple.com> source-level CFG: have the body for the @synchronized start with its own basic
block. This makes it a little easier for diagnostics generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71037 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
da5348eda7bb45d715561249dec9833d51dfda67 06-May-2009 Ted Kremenek <kremenek@apple.com> source-level CFG: have the body for the @synchronized start with its own basic
block. This makes it a little easier for diagnostics generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71037 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ed3d82b918ab06f9d3c23f9ce11fe87660e7fa43 06-May-2009 Ted Kremenek <kremenek@apple.com> Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
are ParenExpr or CastExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71026 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
ade9ecaba935489840fa74aaf5b4c640d6589e33 06-May-2009 Ted Kremenek <kremenek@apple.com> Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
are ParenExpr or CastExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71026 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
c40d685d97b1aa9de62c3a99d0bd5ca7e6e3de9d 05-May-2009 Daniel Dunbar <daniel@zuster.org> Fix the field count in interface record layout (it was incorrectly
compensating for super classes). This was making the reported class
sizes for empty classes very, very wrong.
- Also, we now report the size info for an empty class like gcc (as
the offset of the start, not as 0, 0).

- Add a few more test cases we were mishandling before (padding bit
field at end of struct, for example).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70938 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6e8575b88bfb2634d7b28c0c4d5ed2a6acc8418a 05-May-2009 Daniel Dunbar <daniel@zuster.org> Fix the field count in interface record layout (it was incorrectly
compensating for super classes). This was making the reported class
sizes for empty classes very, very wrong.
- Also, we now report the size info for an empty class like gcc (as
the offset of the start, not as 0, 0).

- Add a few more test cases we were mishandling before (padding bit
field at end of struct, for example).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70938 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5523e86616bc17c9092af47012c9df4b962788a7 04-May-2009 Daniel Dunbar <daniel@zuster.org> Add -fobjc-tight-layout.
- This implements gcc style Objective-C interface layout (I
think). Currently it is always off, there is no functionality
change unless this is passed.

For the curious, the deal is that gcc lays out the fields of a
subclass as if they were part of the superclass. That is, the
subclass fields immediately follow the super class fields instead
of being padded to the alignment of the superclass structure.

- Currently gcc uses the tight layout in 32-bit and 64-bit modes, and
llvm-gcc uses it in 32-bit only, for reasons which aren't clear
yet. We probably want to switch to matching gcc, once this makes it
through testing... my hope is that we can also fix llvm-gcc in
order to maintain compatibility between the compilers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70827 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d6884a0b90091a063478ec7fa31f6d76c94e4917 04-May-2009 Daniel Dunbar <daniel@zuster.org> Add -fobjc-tight-layout.
- This implements gcc style Objective-C interface layout (I
think). Currently it is always off, there is no functionality
change unless this is passed.

For the curious, the deal is that gcc lays out the fields of a
subclass as if they were part of the superclass. That is, the
subclass fields immediately follow the super class fields instead
of being padded to the alignment of the superclass structure.

- Currently gcc uses the tight layout in 32-bit and 64-bit modes, and
llvm-gcc uses it in 32-bit only, for reasons which aren't clear
yet. We probably want to switch to matching gcc, once this makes it
through testing... my hope is that we can also fix llvm-gcc in
order to maintain compatibility between the compilers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70827 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3d091d69953f2c76d41882263dcdd5b7856f6c08 04-May-2009 Daniel Dunbar <daniel@zuster.org> Don't allow clients to traverse into superclass synthesized properties
via CollectObjCIvars.
- In places where we need them, we should have the implementation and
access the properties through it.

This is a fairly substantial functionality change:
1. @encode no longer encodes synthesized ivars, ever.

2. The ivar layout bitmap no longer encodes information for
synthesized ivars in superclasses. Well, actually I had already
broken that, but it is intentional now.

We are now differing substantially from llvm-gcc and gcc
here. However, in my opinion this fundamentally *must* work if
non-fragile classes are to work. Without this change, the result of
@encode and the ivar layout depend on the order that the
implementation is seen in a file (if it is in the same file with its
superclass). Since both scenarios should work the same, our behavior
is now consistent with gcc behavior as if an implementation is never
seen following an implementation of its superclass.

Note that #2 is only a functionality change when (A) an
implementation appears in the same translation unit with the
implementation of its superclass, and (B) the superclass has
synthesized ivars. My belief is that this situation does not occur in
practice.

I am not yet sure of the role/semantics of @encode when synthesized
ivars are present... it's use is fairly unsound in a non-fragile world.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70822 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3715328021f69ed55e7b4cd65465fc761a8b6457 04-May-2009 Daniel Dunbar <daniel@zuster.org> Don't allow clients to traverse into superclass synthesized properties
via CollectObjCIvars.
- In places where we need them, we should have the implementation and
access the properties through it.

This is a fairly substantial functionality change:
1. @encode no longer encodes synthesized ivars, ever.

2. The ivar layout bitmap no longer encodes information for
synthesized ivars in superclasses. Well, actually I had already
broken that, but it is intentional now.

We are now differing substantially from llvm-gcc and gcc
here. However, in my opinion this fundamentally *must* work if
non-fragile classes are to work. Without this change, the result of
@encode and the ivar layout depend on the order that the
implementation is seen in a file (if it is in the same file with its
superclass). Since both scenarios should work the same, our behavior
is now consistent with gcc behavior as if an implementation is never
seen following an implementation of its superclass.

Note that #2 is only a functionality change when (A) an
implementation appears in the same translation unit with the
implementation of its superclass, and (B) the superclass has
synthesized ivars. My belief is that this situation does not occur in
practice.

I am not yet sure of the role/semantics of @encode when synthesized
ivars are present... it's use is fairly unsound in a non-fragile world.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70822 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7e4dacd5a6e929e982867a02109ddaf608535cd 04-May-2009 Eli Friedman <eli.friedman@gmail.com> PR2524: downgrade taking address of expression of type 'void' to an
extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70805 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
53202857c60214d80950a975e6e52aebf30bd16a 04-May-2009 Eli Friedman <eli.friedman@gmail.com> PR2524: downgrade taking address of expression of type 'void' to an
extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70805 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6ff4f4b4636e13a68f7087f26b83c2c4ba816430 03-May-2009 Daniel Dunbar <daniel@zuster.org> Remove ASTContext::addRecordToClass.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70780 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ee1ec39f54a759a1c0858b608e02d70e0d7f54bc 03-May-2009 Daniel Dunbar <daniel@zuster.org> Remove ASTContext::addRecordToClass.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70780 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
94d2ede70eb6074b0c8f0e5ab31ac0fdbae71af8 03-May-2009 Daniel Dunbar <daniel@zuster.org> Use ASTRecordLayout for computing ivar offsets instead of shadow
struct.
- We still need to do more lookup than necessary because ivars don't
live in a reasonable DeclContext.

- The only remaining client of the interface shadow struct is the
ivar layout bitmap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70756 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
532d4daa038d972240138e2fd6e1122517340833 03-May-2009 Daniel Dunbar <daniel@zuster.org> Use ASTRecordLayout for computing ivar offsets instead of shadow
struct.
- We still need to do more lookup than necessary because ivars don't
live in a reasonable DeclContext.

- The only remaining client of the interface shadow struct is the
ivar layout bitmap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70756 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b3170af399538d3bd9eff44a180c5c8b48bd10c2 03-May-2009 Daniel Dunbar <daniel@zuster.org> Fix a possible memory error, the record layout entry could be
invalidated by layout out the super class, we cannot cache the map
entry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70693 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d8fd6ff0ea47ba63f836d0f4e6a1bee49863f64a 03-May-2009 Daniel Dunbar <daniel@zuster.org> Fix a possible memory error, the record layout entry could be
invalidated by layout out the super class, we cannot cache the map
entry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70693 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5b9332f4247c9f7f708baeeb8bb3d727e570d887 03-May-2009 Daniel Dunbar <daniel@zuster.org> Implement the interface/implementation layout distinction.
- These routines should now be independent of the Sema state.

- This is nearly zero functionality change, the distinction only
matters in the non-fragile ABI, and the consumers that care about
this distinction should be using getASTObjCImplementationLayout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70692 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
453addbaea98f9678e2f9858057722a028f1ae3c 03-May-2009 Daniel Dunbar <daniel@zuster.org> Implement the interface/implementation layout distinction.
- These routines should now be independent of the Sema state.

- This is nearly zero functionality change, the distinction only
matters in the non-fragile ABI, and the consumers that care about
this distinction should be using getASTObjCImplementationLayout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70692 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1fbaef1ce5cf60ffe766da428c1e25d546f8c252 03-May-2009 Daniel Dunbar <daniel@zuster.org> Split out getASTObjCImplementationLayout
- The difference from getASTObjCInterfaceLayout is that the computes
the layout including synthesized ivars.

- No functionality change, they currently both compute the same thing
-- whether that includes synthesized ivars or not depends on when
they get called!!!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70690 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b2dbbb99e12806eaaf53b7ccabc32f42b5719443 03-May-2009 Daniel Dunbar <daniel@zuster.org> Split out getASTObjCImplementationLayout
- The difference from getASTObjCInterfaceLayout is that the computes
the layout including synthesized ivars.

- No functionality change, they currently both compute the same thing
-- whether that includes synthesized ivars or not depends on when
they get called!!!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70690 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
37a56bbab0f70aa9268e37f26fbea59997009326 03-May-2009 Daniel Dunbar <daniel@zuster.org> Remove an unneeded special case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70689 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
24cbfb96f09318f59dc73eaaf4909a79788ec5ac 03-May-2009 Daniel Dunbar <daniel@zuster.org> Remove an unneeded special case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70689 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
531434b0b3e12757c57f776e42083b269bc72b3b 02-May-2009 Douglas Gregor <doug.gregor@gmail.com> When determining whether an expression refers to a bit-field, look
into the left-hand side of an assignment expression. This completes
most of PR3500; the only remaining part is to deal with the
GCC-specific implementation-defined behavior for "unsigned long" (and
other) bit-fields.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70623 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
33bbbc5ec8269bc2cde5b84f970fa49319a30267 02-May-2009 Douglas Gregor <dgregor@apple.com> When determining whether an expression refers to a bit-field, look
into the left-hand side of an assignment expression. This completes
most of PR3500; the only remaining part is to deal with the
GCC-specific implementation-defined behavior for "unsigned long" (and
other) bit-fields.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70623 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9b8c95243e4ed1d07d6cc62310f19a0e5189c58e 02-May-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for @synchronized. This fixes <rdar://problem/6848820>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70620 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b3b0b3624e462c2940f65b86e773bfc300005203 02-May-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for @synchronized. This fixes <rdar://problem/6848820>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70620 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2504e8bbe0842e1e2c137b7e891543a5f4833106 02-May-2009 Ted Kremenek <kremenek@apple.com> Fix crasher in CFG construction when not properly handling ASTs that contain
expressions not yet properly handled by the CFGBuilder. This failure resulted in
a null CFGBlock* being used in rare cases (causing a crash).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70612 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4e8df2eb7072db8f66572c3db31a2a08b12a752e 02-May-2009 Ted Kremenek <kremenek@apple.com> Fix crasher in CFG construction when not properly handling ASTs that contain
expressions not yet properly handled by the CFGBuilder. This failure resulted in
a null CFGBlock* being used in rare cases (causing a crash).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70612 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d79b70158ad775b9a6e642347b61f51b3ee57fe1 02-May-2009 Anders Carlsson <andersca@mac.com> Get rid of CXXDestroyExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70586 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
55674acc0331f96bf9e2074e9853c9a1fa96857b 02-May-2009 Anders Carlsson <andersca@mac.com> Get rid of CXXDestroyExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70586 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
9f4aef73b4f98d9ca8650575a5934f89c4fe44ec 02-May-2009 Anders Carlsson <andersca@mac.com> Rename CXXExprWithCleanup to CXXExprWithTemporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70584 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
2d44e8a41de8a33c0f04ac198714f71dc841bab0 02-May-2009 Anders Carlsson <andersca@mac.com> Rename CXXExprWithCleanup to CXXExprWithTemporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70584 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
74942cde3da623741b60c2524fc44ef0cb35724b 30-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make a home for exception specs in the AST. Now Sema can hook them up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70506 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
7b9a2ee5a4393001bdec7dec841eb7c811da492c 30-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make a home for exception specs in the AST. Now Sema can hook them up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70506 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ab38027a24729e25844239340c3cc7bfca17c05b 30-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Properly compute the alignment of typedefs that make use of the
"aligned" attribute. Previously, we were skipping over these
attributes when we jumped directly to the canonical type. Now,
ASTContext::getTypeInfo walks through typedefs and other
"non-canonical" types manually, looking for "aligned" attributes on
typedefs.

As part of this change, I moved the GNU-specific logic (such as
determining the alignment of void or of a function pointer) out of the
expression evaluator and into ASTContext::getTypeInfo.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70497 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
18857644059c45da6776f1a288eec7b4cf3a844a 30-Apr-2009 Douglas Gregor <dgregor@apple.com> Properly compute the alignment of typedefs that make use of the
"aligned" attribute. Previously, we were skipping over these
attributes when we jumped directly to the canonical type. Now,
ASTContext::getTypeInfo walks through typedefs and other
"non-canonical" types manually, looking for "aligned" attributes on
typedefs.

As part of this change, I moved the GNU-specific logic (such as
determining the alignment of void or of a function pointer) out of the
expression evaluator and into ASTContext::getTypeInfo.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70497 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
4b11cc20cd05a5418b04027a03fa4c311f5556bd 30-Apr-2009 Chris Lattner <sabre@nondot.org> int128_t is apparently 128-bit aligned on all 64-bit targets, and
not supported on 32-bit targets, so we can define it to be 128-bit
aligned there too :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70465 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ec16cb9b5a481d62a73ad47fa59034ced4d62022 30-Apr-2009 Chris Lattner <sabre@nondot.org> int128_t is apparently 128-bit aligned on all 64-bit targets, and
not supported on 32-bit targets, so we can define it to be 128-bit
aligned there too :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70465 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6cc7e415d42291bf01e0295d9d6344e106613c48 30-Apr-2009 Chris Lattner <sabre@nondot.org> initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
2df9ced9fd1e8c7d7b38443db07e0e811de22571 30-Apr-2009 Chris Lattner <sabre@nondot.org> initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
2297206cd33225cb497a1e3d0d65a803363ad8bd 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Minor simplification; also silences gcc warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70406 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
267c0ab1b9a15768f3f15abbfc40ce344751c78b 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Minor simplification; also silences gcc warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70406 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e2846cf3e7fb637b9d11482cc105e1bdf60d0da7 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4103: Silence bogus unused expression warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70384 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
852871abbff45f1c1d3787755a27fce08365b166 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4103: Silence bogus unused expression warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70384 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b028cad0ad5bffb5911652062b3da0fda30d80dc 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4097: add logic to Evaluate to handle pointer equality comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70317 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ad02d7debd03ff275ac8ea27891a4ecccdb78068 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4097: add logic to Evaluate to handle pointer equality comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70317 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
67e1144edd7fde23b60c1b9359ac6160b50b837f 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Improve compatibility with GCC regarding inline semantics in GNU89
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.

As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70292 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9f9bf258f8ebae30bfb70feb9d797d6eb67b0460 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Improve compatibility with GCC regarding inline semantics in GNU89
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.

As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70292 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1b697ca2a47643dc4020c7ed412cae315c24934e 28-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: Add "loop back" block for do...while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70284 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8f08c9d83fdabb6f27c44a4dbce78487519c89eb 28-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: Add "loop back" block for do...while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70284 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
64f918f8c72f6ee9a8591aa5e265fef63cbd2b75 28-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: 'WhileStmts' needs an extra block to indicate the "loop back" path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70280 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f6e8541dd884029b85483a319ce7d32f3e476dcc 28-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: 'WhileStmts' needs an extra block to indicate the "loop back" path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70280 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ca7cdcfd86e00775a907db955f78b6ff5e496a7d 28-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG:
- Add 'LoopTarget' pointer field to CFGBlock. This records if the block is used
as the 'loop back' path back to the head of a loop.
- For ForStmt, encode the loop back target as the increment code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70274 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3575f84e459033d6427b84b4b795b22c85c4d27d 28-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG:
- Add 'LoopTarget' pointer field to CFGBlock. This records if the block is used
as the 'loop back' path back to the head of a loop.
- For ForStmt, encode the loop back target as the increment code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70274 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
cdf5974cf74ba53f296cc1f51954d4a53cf1dc8d 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> A couple more small changes which are probably required for Cygwin
builds to work (PR4088).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70269 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
b0156ea412df1c2eb12d620054a404da71784cf5 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> A couple more small changes which are probably required for Cygwin
builds to work (PR4088).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70269 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
4203db84bf725b48a335c8008a60892b6b22953b 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add a bit more handling for declarations like "int a[*]".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70162 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f91f5c8a66ffd812f61819836529f8ad437f7e2b 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add a bit more handling for declarations like "int a[*]".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70162 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bc9ef257b887506228e86a7f4c933aecc8f554a9 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
d3a413d3b8eb39bcee5944bc545d9997c1abe492 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
5255e7ae5cde3039284ca49a4c03f7bd4869894f 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70145 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
9a901bb63990574ff0bcc12ff851d7a71cff8ddb 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70145 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
d37ce6170527fb7aba7cf60243ee3e214556b0e1 26-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure to pull in the target builtin records when initialize the AST context, even if we're not going to initialize the __builin_* identifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70111 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7a9cbedca55edd4a11330c2426298a3033a873b5 26-Apr-2009 Douglas Gregor <dgregor@apple.com> Make sure to pull in the target builtin records when initialize the AST context, even if we're not going to initialize the __builin_* identifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70111 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4a9e927b03ecc65ca47cc4e1cd7b8d5c1fae1cf9 26-Apr-2009 Chris Lattner <sabre@nondot.org> split ObjC and C++ Statements out into their own headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
16f0049415ec596504891259e2a83e19871c0d52 26-Apr-2009 Chris Lattner <sabre@nondot.org> split ObjC and C++ Statements out into their own headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
c0478bf9526f9b16badd70a153f86409ca8fd024 26-Apr-2009 Chris Lattner <sabre@nondot.org> implement PCH support for the rest of ExprObjC.h, including
the missing bits of ObjCMessageExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70100 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0389e6bd0159bfdd08f7c50a37543b6e3adf0c33 26-Apr-2009 Chris Lattner <sabre@nondot.org> implement PCH support for the rest of ExprObjC.h, including
the missing bits of ObjCMessageExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70100 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4b4e14ba4422e1fbe87d9782d75200db15d86d1b 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Change isNullPointerConstant to be strict; hopefully this won't cause
any issues now that we have our own tgmath.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70090 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
09de1767990d4828bcaf0dd22033a5dddeecbe08 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Change isNullPointerConstant to be strict; hopefully this won't cause
any issues now that we have our own tgmath.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70090 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e7f1624c59a8239da9c0224def6685d6e6978be1 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Silence gcc warnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70086 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
617bd458600c6d68ffbe1328806b58384bde848a 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Silence gcc warnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70086 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
c13d473829889a68549f2dee1ea0c7b294f900fa 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4049, a crash on invalid, by making sema install the right number of
parameters in a functiondecl, even if the decl is invalid and has a confusing
Declarator. On the testcase, we now emit one beautiful diagnostic:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*)
^

GCC 4.0 produces:

t.c:2: error: syntax error before ‘f’
t.c: In function ‘f’:
t.c:2: error: parameter name omitted

and GCC 4.2:

t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70016 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2dbd285f5033ca6dea25babfd1c43d9fec35e7e5 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4049, a crash on invalid, by making sema install the right number of
parameters in a functiondecl, even if the decl is invalid and has a confusing
Declarator. On the testcase, we now emit one beautiful diagnostic:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*)
^

GCC 4.0 produces:

t.c:2: error: syntax error before ‘f’
t.c: In function ‘f’:
t.c:2: error: parameter name omitted

and GCC 4.2:

t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70016 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d21120294f4fef96d2954897e1af6eaf6b2f34e7 25-Apr-2009 Chris Lattner <sabre@nondot.org> rename getNumParmVarDeclsFromType back to getNumParams(),
remove a special case that was apparently for typeof() and
generalize the code in SemaDecl that handles typedefs to
handle any sugar type (including typedef, typeof, etc).
Improve comment to make it more clear what is going on.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70015 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1ad9b28e3217c2349a04f3d3bf14f9c73a99afa7 25-Apr-2009 Chris Lattner <sabre@nondot.org> rename getNumParmVarDeclsFromType back to getNumParams(),
remove a special case that was apparently for typeof() and
generalize the code in SemaDecl that handles typedefs to
handle any sugar type (including typedef, typeof, etc).
Improve comment to make it more clear what is going on.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70015 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9d957cbf5b5488063e8279493a1367ef5ccff361 25-Apr-2009 Chris Lattner <sabre@nondot.org> add a new helper function to FunctionDecl instead of it being
static in Decl.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70014 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
11ddb7dc22bb398a6727318729680630bfcefaae 25-Apr-2009 Chris Lattner <sabre@nondot.org> add a new helper function to FunctionDecl instead of it being
static in Decl.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70014 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b5d9c47705901b475fd3e095f0779a336940f908 25-Apr-2009 Anders Carlsson <andersca@mac.com> Add CXXExprWithCleanup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70000 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
02bbfa33590dfe3107e801fb526b7ab0bdfd00ee 25-Apr-2009 Anders Carlsson <andersca@mac.com> Add CXXExprWithCleanup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70000 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
e1c08f72b214fb638cd4566cb572decaae4d204c 24-Apr-2009 Anders Carlsson <andersca@mac.com> Make CXXTemporaryObjectExpr inherit from CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69981 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
524fa13fd81e88533c7a1d4b1232c0de2c97dc7c 24-Apr-2009 Anders Carlsson <andersca@mac.com> Make CXXTemporaryObjectExpr inherit from CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69981 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
e9499b4f119c95892e27d4f0f885a0032834afce 24-Apr-2009 Anders Carlsson <andersca@mac.com> Fix assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69961 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f6274060c07f9678c2f3f5eac92b4ffa0fb1dbcf 24-Apr-2009 Anders Carlsson <andersca@mac.com> Fix assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69961 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
cf4dc9e450915946207039a0f0fe894b2ee18c56 24-Apr-2009 Anders Carlsson <andersca@mac.com> CXXTempVarDecls aren't looked up. Fixes tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69960 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9a55d3e1e52780977714e84e310831f22ec3faf0 24-Apr-2009 Anders Carlsson <andersca@mac.com> CXXTempVarDecls aren't looked up. Fixes tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69960 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
af443ed8faff337a131a2dbf527717f3fb2aaaa7 24-Apr-2009 Anders Carlsson <andersca@mac.com> Add an ASTContext parameter to CXXTemporaryObjectExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69959 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
09c4abb1057f0eb53a9c2b5c2f22b1472362156e 24-Apr-2009 Anders Carlsson <andersca@mac.com> Add an ASTContext parameter to CXXTemporaryObjectExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69959 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
ebbd7cd73877cc313f40e652958602ae290f6d78 24-Apr-2009 Anders Carlsson <andersca@mac.com> Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69957 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
26de54983e7977fad615c94012f2f67d0d1cf404 24-Apr-2009 Anders Carlsson <andersca@mac.com> Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69957 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
94c73aa16e151fec942ad3aa8605544b3ad86694 24-Apr-2009 Anders Carlsson <andersca@mac.com> Make the CXXConstructExpr public and add a StmtClass to it. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69954 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
bd6734e5f6432ce0cc07171c490ffaa094796198 24-Apr-2009 Anders Carlsson <andersca@mac.com> Make the CXXConstructExpr public and add a StmtClass to it. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69954 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
95933c17fa9f631b86cb17745a1642817378f5ad 24-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6821047 - clang crashes on subscript of interface in 64-bit mode

Several changes here:
1. We change Type::isIncompleteType to realize that forward declared
interfaces are incomplete. This eliminate special case code for this
from the sizeof path, and starts us rejecting P[4] when P is a pointer
to an incomplete interface.
2. Explicitly reject P[4] when P points to an interface in non-fragile ABI
mode.
3. Switch the sizeof(interface) diagnostic back to an error instead of a
warning in non-fragile abi mode.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69943 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1efaa9594a81709a17658fd80ae7e783e1026407 24-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6821047 - clang crashes on subscript of interface in 64-bit mode

Several changes here:
1. We change Type::isIncompleteType to realize that forward declared
interfaces are incomplete. This eliminate special case code for this
from the sizeof path, and starts us rejecting P[4] when P is a pointer
to an incomplete interface.
2. Explicitly reject P[4] when P points to an interface in non-fragile ABI
mode.
3. Switch the sizeof(interface) diagnostic back to an error instead of a
warning in non-fragile abi mode.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69943 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
afd5eb3af38dafa1ca646d8a12946d6b74e02404 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8fc463adf0116fdcbff86e9cca11955aad1649fe 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
bb21d4b846f28e38fd204faca328dccd74eb4fa5 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69932 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
319ac896a0fef7365d5589b8021db7e41207fe42 24-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69932 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
087dbf396b59df6b944ef48f1fe55d5c15b8deb2 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69857 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8f36aba016c2d236a90f9ecf0a66904209202202 23-Apr-2009 Douglas Gregor <dgregor@apple.com> The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69857 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
bd336c56bd4b95167487c8a74a385650c01f417c 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69855 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2c2d43c557beca1b4ba4bd743f33978aecb46a97 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69855 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
dbbab8c1204c94cf6bd6b232641547eddadde817 23-Apr-2009 Anders Carlsson <andersca@mac.com> Add a CXXConstructExpr that represents an implicit call to a C++ constructor. I think CXXTemporaryObjectExpr is going to become a subclass of CXXConstructExpr, since CXXTemporaryObjectExpr represents a syntactic temporary, for example T()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69854 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
e349bea668622ef31bd51a229960a73d69940709 23-Apr-2009 Anders Carlsson <andersca@mac.com> Add a CXXConstructExpr that represents an implicit call to a C++ constructor. I think CXXTemporaryObjectExpr is going to become a subclass of CXXConstructExpr, since CXXTemporaryObjectExpr represents a syntactic temporary, for example T()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69854 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
cd19b57e8c03a742954680830bc440b8b0e08965 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
653f1b1bf293a9bd96fd4dd6372e779cc7af1597 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
608ff6223083952584ba0ada6d70070bbc2f045f 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Remove the serialization code that predates precompiled
headers. Future approaches to (de-)serializing ASTs will be based on
the PCH infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69828 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
eclGroup.cpp
eclSerialization.cpp
eclarationName.cpp
tmtSerialization.cpp
ypeSerialization.cpp
370187c8a3e96517c943329f2511737a04b85450 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Remove the serialization code that predates precompiled
headers. Future approaches to (de-)serializing ASTs will be based on
the PCH infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69828 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
eclGroup.cpp
eclSerialization.cpp
eclarationName.cpp
tmtSerialization.cpp
ypeSerialization.cpp
dd5d9afa6ad1590b14ed6f1ef0df6b3741514d6e 22-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add handling for complex->int, int->complex float, and float->complex
int. Note that constant int->complex float and float->complex int casts
were being miscompiled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69821 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1725f683432715e5afe34d476024bd6f16eac3fc 22-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add handling for complex->int, int->complex float, and float->complex
int. Note that constant int->complex float and float->complex int casts
were being miscompiled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69821 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
da38c6ca35b4fb57a2638f0fa2bdf9226fa51ce9 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy loading of builtins for precompiled headers.

PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
286/20693 types read (1.382110%)
1630/59230 declarations read (2.751984%)
764/44914 identifiers read (1.701029%)
1/32954 statements read (0.003035%)
5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69815 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
2deaea37a637dd01221d0cced343702a39d8132c 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy loading of builtins for precompiled headers.

PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
286/20693 types read (1.382110%)
1630/59230 declarations read (2.751984%)
764/44914 identifiers read (1.701029%)
1/32954 statements read (0.003035%)
5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69815 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
1af336e2c61518f7adee56b0d901989fb1f8040f 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Reapply r69771, with updates & fixes:

Rework the shadow struct that is layed out for Objective-C classes.

- Superclasses are now always laid out in their shadow structure at
the first field.

- Prior to this, the entire class heirarchy was flattened into a
single structure which meant that alignment, padding, and bitfields
were incorrect (the ASTRecordLayout was correct however, which
meant our debug info didn't coincide with ivar offsets, for
example).

- This is still very suboptimal (for example, ivar are looked up
recursively, but I believe the ivar layout itself is now at least
close to correct.

- <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
backwards


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69811 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a80a0f6398df06c018af779a7ca82a29172c45d1 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Reapply r69771, with updates & fixes:

Rework the shadow struct that is layed out for Objective-C classes.

- Superclasses are now always laid out in their shadow structure at
the first field.

- Prior to this, the entire class heirarchy was flattened into a
single structure which meant that alignment, padding, and bitfields
were incorrect (the ASTRecordLayout was correct however, which
meant our debug info didn't coincide with ivar offsets, for
example).

- This is still very suboptimal (for example, ivar are looked up
recursively, but I believe the ivar layout itself is now at least
close to correct.

- <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
backwards


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69811 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fb65bfb53f9f9a9f00f129d0fb98f2b4c62a2318 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.
- This is only used by CGObjCRuntime now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69800 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a24357887dc2e6971fb84286be4484953565dc4d 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.
- This is only used by CGObjCRuntime now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69800 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
acdae26818348e4bfcc3b512298e8aadd6fdbe31 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Simplify addRecordToClass, it is not legal to call it on a forward
declaration now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69799 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
75da6744de692c60e824c02b096aa84dfd993364 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Simplify addRecordToClass, it is not legal to call it on a forward
declaration now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69799 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b64206c5f93e51a1857706eeab24cf945491ef42 22-Apr-2009 Chris Lattner <sabre@nondot.org> ObjCQualifiedClass is dead, remove it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69783 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
068360e16fa4504a6fb80affebae5c5713629a96 22-Apr-2009 Chris Lattner <sabre@nondot.org> ObjCQualifiedClass is dead, remove it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69783 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
37f477ebbb9755380e3d8849e6281d5239157431 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Reorganize built-in initialization to separate the creation of target builtins from marking IdentifierInfos as builtins. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69774 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
71dfdb9bc91b5d81b124e6091c903e4efd87149d 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Reorganize built-in initialization to separate the creation of target builtins from marking IdentifierInfos as builtins. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69774 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
e0edb2eea011810e42287fcddc1ac575f2ac26c8 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Revert r69771, I missed some (obvious) details. :/


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
d4ae6c038ea8dd2faaadd1f9da725ec37b4f7ef9 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Revert r69771, I missed some (obvious) details. :/


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
be1ff27081f5dda61e46171ccdcd46970a173fae 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Mark another TypeForDecl const and make getObjCInterfaceType's argument const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69772 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
3b3a45858c6b2a45114e91902c3bf3c4b7f5f302 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Mark another TypeForDecl const and make getObjCInterfaceType's argument const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69772 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
5573a5839eca4c84b22c36e3cbdbea0a2dd5086f 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Rework the shadow struct that is layed out for Objective-C classes.

- Superclasses are now always laid out their shadow structure at the
first field.

- Prior to this, the entire class heirarchy was flattened into a
single structure which meant that alignment, padding, and bitfields
weren't packed correctly (the ASTRecordLayout was correct however,
which meant our debug info didn't coincide with ivar offsets, for
example).

- This is still very suboptimal, but I believe the ivar layout itself
is now at least close to correct.

- <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
backwards


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
0c45793173ebdf15ba7345a1f71919c47abbeed0 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Rework the shadow struct that is layed out for Objective-C classes.

- Superclasses are now always laid out their shadow structure at the
first field.

- Prior to this, the entire class heirarchy was flattened into a
single structure which meant that alignment, padding, and bitfields
weren't packed correctly (the ASTRecordLayout was correct however,
which meant our debug info didn't coincide with ivar offsets, for
example).

- This is still very suboptimal, but I believe the ivar layout itself
is now at least close to correct.

- <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
backwards


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
dbc8af7f9499e1508b1db68dd79d77051d7ecdd1 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
- I don't know how to make a test case for this, but this strengthens
the invariants that hold internally. The functionality change here
is the edit to SemaDeclObjC.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69728 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
24c8991f4dd0ab86678b5ab11f05586687b55be9 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
- I don't know how to make a test case for this, but this strengthens
the invariants that hold internally. The functionality change here
is the edit to SemaDeclObjC.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69728 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
9cdb4a1f7769e97892b7b6ccb54b6f6914cd29ae 21-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit.

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69681 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b6c8c8bd8d362c8a6cdb767415b0d21e62b77eb2 21-Apr-2009 Douglas Gregor <dgregor@apple.com> Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit.

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69681 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3b72cce18ad651cbcb8b9a0f0923f4df59a243e4 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Use an ASTRecordLayout to compute the sizeof an interface, not
addRecordToClass.
- Among other things, this fixes a crash when applying sizeof to an
interface with synthesized ivars, although things still aren't
"correct" here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69675 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ff89666e8d143b52f2bb5d2c3a108125d523abb7 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Use an ASTRecordLayout to compute the sizeof an interface, not
addRecordToClass.
- Among other things, this fixes a crash when applying sizeof to an
interface with synthesized ivars, although things still aren't
"correct" here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69675 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3e0eaf80172a1b1fa973ced9a385f13af2218e7e 21-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones. Easy fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69661 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
81045d8dcd967def69d8e0945566214a9fe9ffcc 21-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones. Easy fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69661 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
350edcf8219cfcf5392522f795bfc190ade02f8d 21-Apr-2009 Anders Carlsson <andersca@mac.com> Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69654 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
19d28a650ca6d98f7907ad891557fccca7baaea8 21-Apr-2009 Anders Carlsson <andersca@mac.com> Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69654 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
9373ea65895ec7b047211ea999079a05dfed19b0 21-Apr-2009 Anders Carlsson <andersca@mac.com> Add the beginnings of a CXXTempVarDecl class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69652 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
86fa7502706b993ebbe5b5be147604c3bed0fcad 21-Apr-2009 Anders Carlsson <andersca@mac.com> Add the beginnings of a CXXTempVarDecl class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69652 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f5254bda2945bd427acad4a0f0f62026333b66ce 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
525c9b7baeeff022127cd1b167579f3bda73b3ed 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0ac5bbc5a99f5f3671a681c16436097cf2d876d2 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Assert on a few conditions that (I believe) should hold
w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to
EmitObjCValueForIvar).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69639 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9e6c20bae697c908b7d368c0f79f5510d1006a65 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Assert on a few conditions that (I believe) should hold
w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to
EmitObjCValueForIvar).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69639 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
79ea0e0d94f7bbe2f26ac0eaf995e420bb7298c9 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCMethodDecl.

Test will be enabled with ObjCInterfaceDecl is added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
53c9d8a4b8f0a76cb9dd2fdd8c433ccf110f2eec 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCMethodDecl.

Test will be enabled with ObjCInterfaceDecl is added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
701c850caafa406bf8217cbeb32ee8d6da34b2b3 20-Apr-2009 Daniel Dunbar <daniel@zuster.org> Make FieldDecl parameter to getObjCEncodingForType... const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69578 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
153bfe5795e2c1a5a738e73d3784964e082237fc 20-Apr-2009 Daniel Dunbar <daniel@zuster.org> Make FieldDecl parameter to getObjCEncodingForType... const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69578 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f0587c6ee2d465d64c0f64fda81cfb665f400a43 20-Apr-2009 Daniel Dunbar <daniel@zuster.org> Remove non-const form of lookupFieldDeclForIvar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69563 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
60952f94cf67ddb566600434857cad7a48264c3b 20-Apr-2009 Daniel Dunbar <daniel@zuster.org> Remove non-const form of lookupFieldDeclForIvar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69563 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9ef9c284e6791a48278b3b76cfa85b05cc0c5a20 19-Apr-2009 Chris Lattner <sabre@nondot.org> Add location info for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
ad56d684259f706b7c0ae5ad9c23adb4f2926817 19-Apr-2009 Chris Lattner <sabre@nondot.org> Add location info for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
3b9a7c8115604645e51bd272985603fa4f3c6d61 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
250fc9c859fdeed3f200ae911a7e7ea338f38436 18-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e3241e9ede65d127bd9e98fa29d8aa7546288434 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
xpr.cpp
7297134f128423fce2e88f92421ed135bded7d4e 18-Apr-2009 Douglas Gregor <dgregor@apple.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
xpr.cpp
b9f636426bb01df0ab7e2216d2bbcb6cf12b3f07 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Fix two embarrassing PCH bugs:
1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator
2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s.

403.gcc builds and links properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
88c9a46f0b84f1ee83e01917825346551ee540d0 17-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix two embarrassing PCH bugs:
1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator
2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s.

403.gcc builds and links properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3e1f9fb48943b37644188d83a59cc0bf4d666462 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for inline assembly statements.

This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69385 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
cd7d5a9dc558178ed7a66032f888781b3c592e4f 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for inline assembly statements.

This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69385 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d316913addcd81dcae78bef3296ae2e624ec2b33 17-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement lvalue test for conditional expressions.
Add a few commented lines to the test case that point out things that don't work yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69354 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
76458501a8963fa11b91c9337a487de6871169b4 17-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement lvalue test for conditional expressions.
Add a few commented lines to the test case that point out things that don't work yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69354 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
39a10dbbffb3f5f06c9412b24d32a6c6563d0af1 17-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for the __has_trivial_destructor type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69345 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
072abefcddea5fb65e435cea60921b3c21c1279d 17-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for the __has_trivial_destructor type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69345 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
9c4782a93e8963f9b180c851b00a5f3568a5918b 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for the first batch of statements, including null,
compound, case, default, if, switch, and break statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69329 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
025452fa0eda63e150cfaeebe64f0a19c96b3a06 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for the first batch of statements, including null,
compound, case, default, if, switch, and break statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69329 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
7ceff37a1596d9c5d7d9ef833c6d5500e8ac051a 16-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6765383> clang-6: clang does not appear to support declaring a static Block 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69306 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
3aaa482ea5b8d20b705f6ac8573b539be88d273a 16-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6765383> clang-6: clang does not appear to support declaring a static Block 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69306 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
6710a3cb6c5ecf9a10f118028aac70bffbc42a67 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69251 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d077d759d0c7fceee98f4e77b6423a3f11cfc849 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69251 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c636371070a906200e74097d5d940c9e29500d11 16-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for the __has_trivial_constructor type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69245 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
347ba89dec89091868982434154c3508085b727a 16-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for the __has_trivial_constructor type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69245 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
725e94b56fd3a575a687ef6aedcb28d8fb614904 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ShuffleVectorExpr and BlockDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69244 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
94cd5d1397bb1a8bcd109602aa38dd787b164c22 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ShuffleVectorExpr and BlockDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69244 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ec0b8294b6a1a71300f08b0485ba370d4952ee73 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ExtVectorElementExpr and VAArgExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69240 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d3c98a02c73417689deaaa6671ea6df7f2a8a73c 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ExtVectorElementExpr and VAArgExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69240 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0dc684ef252a00c6946a9f8becac9b9105ed58ae 15-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fix decl type merges when they have
__string/__weak attributes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69229 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c8d2e77288c07a69cabb755a4ab9feeb7b5a1287 15-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fix decl type merges when they have
__string/__weak attributes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69229 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7e2b1cd1ea97a4d2ff8096be01d92646715414c2 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for MemberExpr and CallExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69186 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1f0d0133b0e8d1f01f63951ee04927796b34740d 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for MemberExpr and CallExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69186 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
596e093e4eb79a78ceb02d8d3b78d3c6d3088cc0 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for string literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69172 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
673ecd6a4a9f7c12fb6f76f84f654dbdcdc89e76 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for string literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69172 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cc94ab72501999e1d61a538f9891523603f9236c 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement support for designated initializers that refer to members of
anonymous structs or unions. Fixes PR3778.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69153 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ffb4b6e299069139908540ce97be4462e16b53a4 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement support for designated initializers that refer to members of
anonymous structs or unions. Fixes PR3778.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69153 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f7fa9dcd32818f9ed2932c690b460724e2f5c9f2 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Improve "assignment to cast" diagnostic.
- Strip off extra parens when looking for casts.
- Change the location info to point at the cast (instead of the
assignment).

For example, on

int *b;
#define a ((void*) b)
void f0() {
a = 10;
}

we now emit:

/tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
a = 10;
^ ~
/tmp/t.c:2:12: note: instantiated from:
#define a ((void*) b)
~^~~~~~~~~~

instead of:

/tmp/t.c:4:5: error: expression is not assignable
a = 10;
~ ^


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69114 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
44e35f7b2b5da1eb338639e46bf0b5522e75c5f3 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Improve "assignment to cast" diagnostic.
- Strip off extra parens when looking for casts.
- Change the location info to point at the cast (instead of the
assignment).

For example, on

int *b;
#define a ((void*) b)
void f0() {
a = 10;
}

we now emit:

/tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
a = 10;
^ ~
/tmp/t.c:2:12: note: instantiated from:
#define a ((void*) b)
~^~~~~~~~~~

instead of:

/tmp/t.c:4:5: error: expression is not assignable
a = 10;
~ ^


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69114 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
930e124d0784ab23c0a49d070e35ccd88ae662dd 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Strip paren expressions when trying to diagnose "cast as lvalue"
extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69100 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5717daef564a1071c34549150e7333025ea46fa2 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Strip paren expressions when trying to diagnose "cast as lvalue"
extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69100 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0773c58913bc6994728ec25115c80d241dada919 14-Apr-2009 Steve Naroff <snaroff@apple.com> ASTContext::mergeTypes(): Loosen up the type checking for 'Class' (treating it like 'id').

This fixes <rdar://problem/6782722> XCDataTipsManager.m registers, observes notifications in class methods.

The radar above is the result of clang typing 'self' in a class method as 'Class', which results in some spurious warnings (GCC types 'self' in a class method as 'id').

I considered changing the type of 'self' to 'id' (to conform to GCC), however this resulted in *many* test cases breaking. In addition, I really prefer a more strongly typed 'self'.

All in all, this is the least obtrusive fix I could find for removing the spurious warnings (though we do loose some valid warnings).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69041 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d824c9c281c163ba86f3cc10c5572120234a2454 14-Apr-2009 Steve Naroff <snaroff@apple.com> ASTContext::mergeTypes(): Loosen up the type checking for 'Class' (treating it like 'id').

This fixes <rdar://problem/6782722> XCDataTipsManager.m registers, observes notifications in class methods.

The radar above is the result of clang typing 'self' in a class method as 'Class', which results in some spurious warnings (GCC types 'self' in a class method as 'id').

I considered changing the type of 'self' to 'id' (to conform to GCC), however this resulted in *many* test cases breaking. In addition, I really prefer a more strongly typed 'self'.

All in all, this is the least obtrusive fix I could find for removing the spurious warnings (though we do loose some valid warnings).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69041 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
644c15e1dab2d3c7db731143ead7831646c2f348 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Audit __private_extern__ handling.
- Exposed quite a few Sema issues and a CodeGen crash.

- See FIXMEs in test case, and in SemaDecl.cpp (PR3983).

I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
5466c7b0ca8ce662e2c0bc295cecba2b78d6957d 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Audit __private_extern__ handling.
- Exposed quite a few Sema issues and a CodeGen crash.

- See FIXMEs in test case, and in SemaDecl.cpp (PR3983).

I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
caf78fb050f4870758014c771009095ca71c9366 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add VarDecl::getStorageClassSpecifierString (StorageClass -> const char*).
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69019 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b286a78c8cce4592306dae6abc3656daf6379c77 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add VarDecl::getStorageClassSpecifierString (StorageClass -> const char*).
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69019 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6777bf314cacf53a399137d73b1d97f095e604de 14-Apr-2009 Steve Naroff <snaroff@apple.com> Change dyn_cast<> to isa<>. Pointed out by Anders (thanks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bb3fde337fb712c0e6da8790d431621be4793048 14-Apr-2009 Steve Naroff <snaroff@apple.com> Change dyn_cast<> to isa<>. Pointed out by Anders (thanks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
78380fb6eb5d71c04d56a19c67a322ca1281c705 14-Apr-2009 Steve Naroff <snaroff@apple.com> Fix crasher in ASTContext::getObjCEncodingForMethodDecl().

This was exposed as a result of something else that was recently fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ab76d45e023fc5ae966968344e180cd09fdcc746 14-Apr-2009 Steve Naroff <snaroff@apple.com> Fix crasher in ASTContext::getObjCEncodingForMethodDecl().

This was exposed as a result of something else that was recently fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a008d173f4752a162740febdb038c7bc331b89f2 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.
by making ASTContext::isObjCObjectPointerType accept typedefs of id.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68931 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
16ede0ec39bf72f5e696e8ed5f1533b29ac2f3d8 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.
by making ASTContext::isObjCObjectPointerType accept typedefs of id.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68931 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d7b019763fd17c41984d9beb8eaf8777abf077fe 11-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Non-pointer objects are none gc'able regardles of
the attribute set on them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68844 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c2112181b96349eb595dc5e8b7073b81ecdec0db 11-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Non-pointer objects are none gc'able regardles of
the attribute set on them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68844 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ac8f280704e948b8051e8e9bd7f557127d31624b 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8038d5182b72dcdef292f6fb8539ad77f338855a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0843ea5122791ef44801168d48646ba459141d23 10-Apr-2009 Anders Carlsson <andersca@mac.com> Use correct alignment and size for references in records as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68769 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2f1169f45b915c40c6f330af69e4e13dd18a5084 10-Apr-2009 Anders Carlsson <andersca@mac.com> Use correct alignment and size for references in records as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68769 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea2dce2eb97312b2ceb93ce1f8ff067cd60f7d7a 10-Apr-2009 Anders Carlsson <andersca@mac.com> Add Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr as an LValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68763 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
1b78276a75a5a0f496a82429c1ff9604d622a76d 10-Apr-2009 Anders Carlsson <andersca@mac.com> Add Expr::EvaluateAsLValue which will (believe it or not) try to evaluate an Expr as an LValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68763 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
eeaeda3958435838960fc27a7864dfaaa0ce6db1 10-Apr-2009 Anders Carlsson <andersca@mac.com> Fix thinko noticed by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f0930235ce58a91aa3b840bece9052f44d630536 10-Apr-2009 Anders Carlsson <andersca@mac.com> Fix thinko noticed by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa0783ba16a87edec7d4c8dd90388698e546b376 10-Apr-2009 Anders Carlsson <andersca@mac.com> Use the same alignment for reference declarations as for pointer declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68761 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4cc2cfd48d7c2d11141871cad590db7b52ce00a0 10-Apr-2009 Anders Carlsson <andersca@mac.com> Use the same alignment for reference declarations as for pointer declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68761 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c34897dac02ae4ac32e65601c9b175fa17edf1f6 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
2cf2634ffdb4f7c8d46cef3f8e60a55993f1c57a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
70e16dd263df6f4dbe0390ad2c91c903e1d49834 09-Apr-2009 Anders Carlsson <andersca@mac.com> Add @encode support for complex types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68729 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c612f7bc9a6379cd7e7c2dd306d05938e890051b 09-Apr-2009 Anders Carlsson <andersca@mac.com> Add @encode support for complex types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68729 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c55b0b035289cd7702034bad930c71302bc80836 09-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
xprConstant.cpp
tmtPrinter.cpp
6ab3524f72a6e64aa04973fa9433b5559abb3525 09-Apr-2009 Douglas Gregor <dgregor@apple.com> Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
xprConstant.cpp
tmtPrinter.cpp
13c27cd3b576157bd593b41a8fbb550d4ac569a0 09-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Simple DeclContext's internal representation by always storing a
StoredDeclsMap, instead of using the it's-an-array-or-its-a-map
trick. I'll verify that performance isn't impacted later; for now, I
need the common representation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68715 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
c36c540c5bfce941f3d892919394d092491211f2 09-Apr-2009 Douglas Gregor <dgregor@apple.com> Simple DeclContext's internal representation by always storing a
StoredDeclsMap, instead of using the it's-an-array-or-its-a-map
trick. I'll verify that performance isn't impacted later; for now, I
need the common representation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68715 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
869675da81250c2f6e42085cfb9bb2e775c96e02 09-Apr-2009 Ted Kremenek <kremenek@apple.com> Another ParentMap bug: only the right side of a comma expression is consumed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68680 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
24ae89a5a25f8971c7436bb3b7663e66ed99b987 09-Apr-2009 Ted Kremenek <kremenek@apple.com> Another ParentMap bug: only the right side of a comma expression is consumed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68680 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
ba50c33f107bb67796b1df251d5b07aba78cf053 08-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Added a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68646 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0c7ce5bcfae60d999d52b80f43bbe08436f3bbd1 08-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Added a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68646 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
998510f04ccd0d0db2b22df53de8204a2bf7cebe 08-Apr-2009 Daniel Dunbar <daniel@zuster.org> Fix buffer overrun when laying out synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4af44129dd99a233087b5cdd60bbf2fd0b9553d4 08-Apr-2009 Daniel Dunbar <daniel@zuster.org> Fix buffer overrun when laying out synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68634 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e69cc0deebcd41d87a5b394bcdac690803b56f4b 08-Apr-2009 Ted Kremenek <kremenek@apple.com> Fix bug in ParentMap::isConsumedExpr. A BinaryOperator always "consumes" the
value of its subexpressions unless it is a comma (in which case it doesn't
consume the left subexpression).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68628 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
e42ac98bc2d50506216b6ef258594bdaa59c47c1 08-Apr-2009 Ted Kremenek <kremenek@apple.com> Fix bug in ParentMap::isConsumedExpr. A BinaryOperator always "consumes" the
value of its subexpressions unless it is a comma (in which case it doesn't
consume the left subexpression).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68628 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
6a150e1c6ce14440d70edf69ecb4ddcf13130635 08-Apr-2009 Chris Lattner <sabre@nondot.org> improve compatibility with VC+, patch by John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68586 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a27e5feaab38b99a0e4473247dbd157f015ea4d1 08-Apr-2009 Chris Lattner <sabre@nondot.org> improve compatibility with VC+, patch by John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68586 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a470cea884015815b9f2943f2accc8f5d1c2bae8 07-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Allow us to ask for the access specifier of a translation unit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68548 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5c27f2bfd2e19429dd9206f9b019e11d4a570acf 07-Apr-2009 Douglas Gregor <dgregor@apple.com> Allow us to ask for the access specifier of a translation unit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68548 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
819b7c09027ce9f09aaa8cc9668b7163a484e8a4 07-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: when there is not continue or break target, mark the CFG as bad.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68533 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
235c5ed8bee5bbcb45de1707d6988635e49b10b8 07-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: when there is not continue or break target, mark the CFG as bad.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68533 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d2b6edce099c2f8888e358bbef10736002d1948a 07-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Move the internal DeclContext data structures into a separate header.

Simplify the addition of a case statement to a switch.

Fix -print-stats for attribute-qualified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68522 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
c2ee10d79f70036af652a395ac1f8273f3d04e12 07-Apr-2009 Douglas Gregor <dgregor@apple.com> Move the internal DeclContext data structures into a separate header.

Simplify the addition of a case statement to a switch.

Fix -print-stats for attribute-qualified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68522 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
417d4690fd6d5b8c5a56717882581b369f815f11 07-Apr-2009 Ted Kremenek <kremenek@apple.com> Remove hack support for @try...@finally in source-level CFGs. The current hack
had too many false positives in the analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68492 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
90658ec72542df44eb462c69056184d2946bdbce 07-Apr-2009 Ted Kremenek <kremenek@apple.com> Remove hack support for @try...@finally in source-level CFGs. The current hack
had too many false positives in the analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68492 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f2b0b885bf53c24448797f28937eb1876a56585a 03-Apr-2009 Anders Carlsson <andersca@mac.com> Ignore plus operands when looking up the operand number from a named operand. This matches llvm-gcc and fixes PR3908.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68371 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
ec91dab1977154f13621cfb63184364afee84ea1 03-Apr-2009 Anders Carlsson <andersca@mac.com> Ignore plus operands when looking up the operand number from a named operand. This matches llvm-gcc and fixes PR3908.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68371 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
df7b891cd0061de2ce84557c74c3fc3f73bd6566 03-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Resynchronize Decl/VarDecl serialization code with the structures

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68346 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
3050ed44aea059f1bb48d05b6dd64478bd8ed0aa 03-Apr-2009 Douglas Gregor <dgregor@apple.com> Resynchronize Decl/VarDecl serialization code with the structures

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68346 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
304f7c7625d09aeac371cc12f4fc66a46132deff 02-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fix up lookup rules for properties declared in
objc's continuation class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68339 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
d09a456e466597fe1667ea5e757bfe53be2cba7d 02-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fix up lookup rules for properties declared in
objc's continuation class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68339 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
00e935b0ffe95a769a5cede65a084aa76d528a04 02-Apr-2009 Chris Lattner <sabre@nondot.org> add TemplateName.cpp/h to the xcode project, minor tidying.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68301 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
c960ee31c7e22a157a8cd31c92d9a9aa945e1e96 02-Apr-2009 Chris Lattner <sabre@nondot.org> add TemplateName.cpp/h to the xcode project, minor tidying.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68301 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
89aa1e00c37171f12a4bc24e47b2a17cb0cbf79b 02-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a bug in declaration of property in continuation
class which was exposed by implementation of
objc2's nonfragile abi code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68259 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
22b6e0682d69173b4282853aded2f9253f3e2c15 02-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a bug in declaration of property in continuation
class which was exposed by implementation of
objc2's nonfragile abi code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68259 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
84c45699089f35feae9763d39a042d82cb459c85 01-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Nonfragile ivar synthesis with property is in a continuation
class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68234 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
99eee3675e830ff367ae1fe35ce19fb49e7e4114 01-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Nonfragile ivar synthesis with property is in a continuation
class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68234 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
eafb138c96101d63c5f673c8332c605b75319ec5 01-Apr-2009 Ted Kremenek <kremenek@apple.com> Update CMake file. Patch by Brian Diekelman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68232 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
4409a6d7b07a1b31f6822c28a6e02c7634153653 01-Apr-2009 Ted Kremenek <kremenek@apple.com> Update CMake file. Patch by Brian Diekelman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68232 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
da0c4d26ecb98b02a0f22bde39a1a45dbc2f6d3f 01-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Give Type::getDesugaredType a "for-display" mode that can apply more
heuristics to determine when it's useful to desugar a type for display
to the user. Introduce two C++-specific heuristics:

- For a qualified type (like "foo::bar"), only produce a new
desugred type if desugaring the qualified type ("bar", in this
case) produces something interesting. For example, if "foo::bar"
refers to a class named "bar", don't desugar. However, if
"foo::bar" refers to a typedef of something else, desugar to that
something else. This gives some useful desugaring such as
"foo::bar (aka 'int')".
- Don't desugar class template specialization types like
"basic_string<char>" down to their underlying "class
basic_string<char, char_traits<char>, allocator<char>>, etc.";
it's better just to leave such types alone.

Update diagnostics.html with some discussion and examples of type
preservation in C++, showing qualified names and class template
specialization types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68207 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
969c689d893a248eca4f049f5b89f747e66e4bff 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Give Type::getDesugaredType a "for-display" mode that can apply more
heuristics to determine when it's useful to desugar a type for display
to the user. Introduce two C++-specific heuristics:

- For a qualified type (like "foo::bar"), only produce a new
desugred type if desugaring the qualified type ("bar", in this
case) produces something interesting. For example, if "foo::bar"
refers to a class named "bar", don't desugar. However, if
"foo::bar" refers to a typedef of something else, desugar to that
something else. This gives some useful desugaring such as
"foo::bar (aka 'int')".
- Don't desugar class template specialization types like
"basic_string<char>" down to their underlying "class
basic_string<char, char_traits<char>, allocator<char>>, etc.";
it's better just to leave such types alone.

Update diagnostics.html with some discussion and examples of type
preservation in C++, showing qualified names and class template
specialization types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68207 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7573221654c5470c1a708beab7ef4338bfcaeee9 01-Apr-2009 Ted Kremenek <kremenek@apple.com> Fix: <rdar://problem/6740387>. Sending nil to an object that returns a struct
should only be an error if that value is consumed. This fix was largely
accomplished by moving 'isConsumedExpr' back to ParentMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68195 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
b930d7adb7cb7642c9c49b39df04ebd5cbfa713a 01-Apr-2009 Ted Kremenek <kremenek@apple.com> Fix: <rdar://problem/6740387>. Sending nil to an object that returns a struct
should only be an error if that value is consumed. This fix was largely
accomplished by moving 'isConsumedExpr' back to ParentMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68195 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
46ee0f3f00561293f0dd50eee67083227273113f 01-Apr-2009 Chris Lattner <sabre@nondot.org> remove ASTContext::buildObjCInterfaceType, which breaks canonical
types. It is no longer needed now that the code generator
re-lays-out interfaces if they are defines after being laid out
from a forward decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68194 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
03d9f34a96ea28eaa698cc779462a1ce1dc79105 01-Apr-2009 Chris Lattner <sabre@nondot.org> remove ASTContext::buildObjCInterfaceType, which breaks canonical
types. It is no longer needed now that the code generator
re-lays-out interfaces if they are defines after being laid out
from a forward decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68194 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e5a3c02710d65e770aa615a6f03769db81c73827 01-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: For 'if(...) {}' (empty body) construct an empty CFGBlock so that we can
distinguish between the true and false branches for path-sensitive analyses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68185 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
dbdf7949a7a50f5a65055a3e95f6432ecc541056 01-Apr-2009 Ted Kremenek <kremenek@apple.com> CFG: For 'if(...) {}' (empty body) construct an empty CFGBlock so that we can
distinguish between the true and false branches for path-sensitive analyses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68185 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
896ceed74e95f043ef74f74d86d80b9909a7ebab 01-Apr-2009 Mike Stump <mrs@apple.com> Fix block comparisons. Radar 6732116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68171 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aab0f7a749e939d1d485a436f57ae56d14ba3016 01-Apr-2009 Mike Stump <mrs@apple.com> Fix block comparisons. Radar 6732116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68171 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
77da58034d00866f3261d2c657a5823578f73028 01-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,

typename MetaFun::template apply<T1, T2>

Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,

typename T::type::type





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68166 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
estedNameSpecifier.cpp
emplateName.cpp
ype.cpp
1734317845d60307d474b5da8a8d33adbaf5e723 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,

typename MetaFun::template apply<T1, T2>

Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,

typename T::type::type





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68166 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
estedNameSpecifier.cpp
emplateName.cpp
ype.cpp
aed9804d13f675e5739e1139938bcc2cac8c6e3b 31-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Some cleanup and renaming. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68140 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
tmtPrinter.cpp
emplateName.cpp
ype.cpp
9bde77309fd2f9f7a53446e374472c48c81f5182 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Some cleanup and renaming. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68140 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.cpp
tmtPrinter.cpp
emplateName.cpp
ype.cpp
15a928580f936a76dc09f5f57c055122d32d763d 31-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for template names, including both
template template parameters and dependent template names. For
example, the oft-mentioned

typename MetaFun::template apply<T1, T2>::type

can now be instantiated, with the appropriate name lookup for "apply".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68128 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
de650ae96b53eb6109f29fdb5ee51c514259e6e4 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for template names, including both
template template parameters and dependent template names. For
example, the oft-mentioned

typename MetaFun::template apply<T1, T2>::type

can now be instantiated, with the appropriate name lookup for "apply".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68128 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.cpp
fbf446476fb9466876821f6e8e20b20c2361aa1f 31-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for nonfragile abi's synthesized ivars.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68122 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
18191886554407b4260c40165bc294c3ea732033 31-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for nonfragile abi's synthesized ivars.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68122 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cd7ac6f1cb1dfd52004718038c227ba5e4d28da4 31-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Implement -Wmissing-prototypes. Fixes PR3911.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68110 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8499f3f5ff8d5f95ece8047780030a3daad1b6fa 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement -Wmissing-prototypes. Fixes PR3911.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68110 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
608c1e3356e6510e979a1af7b22bde37be3eb019 31-Mar-2009 Chris Lattner <sabre@nondot.org> Fix a problem in ASTContext::addRecordToClass handling forward declarations.
In a case like:

@class foo;
foo *P;

addRecordToClass was making an empty shadow struct for the foo interface and
completing it. Later when an:

@interface foo
...
@endif

foo *Q;

was seen, ASTContext::addRecordToClass would think that foo was already laid
out and not lay out the definition. This fixes it to create a forward declared
struct the first time around, then complete it when the definition is seen.

Note that this causes two tests to regress, because something is trying to get
the size of the forward declared structs returned by this. Previously, this
would end up getting a size of zero but now it properly dies. I'm not sure
what the right solution is for this, so I xfailed the tests.

Fariborz, please take a look at this. The testcase in rdar://6676794 now gets
farther, but dies later because the objc ivar is not assigned a field number.

As an aside, I really don't like the fact that the objc front-end is creating
shadow C structs for ObjC types. This seems like an implementation detail of
the code generator that could be fixed by better factoring of the extant code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68106 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2349925b505564915f786583238266840801b689 31-Mar-2009 Chris Lattner <sabre@nondot.org> Fix a problem in ASTContext::addRecordToClass handling forward declarations.
In a case like:

@class foo;
foo *P;

addRecordToClass was making an empty shadow struct for the foo interface and
completing it. Later when an:

@interface foo
...
@endif

foo *Q;

was seen, ASTContext::addRecordToClass would think that foo was already laid
out and not lay out the definition. This fixes it to create a forward declared
struct the first time around, then complete it when the definition is seen.

Note that this causes two tests to regress, because something is trying to get
the size of the forward declared structs returned by this. Previously, this
would end up getting a size of zero but now it properly dies. I'm not sure
what the right solution is for this, so I xfailed the tests.

Fariborz, please take a look at this. The testcase in rdar://6676794 now gets
farther, but dies later because the objc ivar is not assigned a field number.

As an aside, I really don't like the fact that the objc front-end is creating
shadow C structs for ObjC types. This seems like an implementation detail of
the code generator that could be fixed by better factoring of the extant code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68106 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
41b780c6caa012115bfdcccff94b9965d4de71f0 31-Mar-2009 Chris Lattner <sabre@nondot.org> disable copying of Type objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68103 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
16ff705a594697f98b9473f9b7e7d378f331fe4b 31-Mar-2009 Chris Lattner <sabre@nondot.org> disable copying of Type objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68103 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9329cf566969b233c3ed0f85132fc718aa7ef812 31-Mar-2009 Chris Lattner <sabre@nondot.org> fill in temporary smallvectors instead of vectors for performance.
Fix BuildAggrIvarLayout to not access vectors out of range.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68101 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f1690858344968358131f8d5690d9ee458883000 31-Mar-2009 Chris Lattner <sabre@nondot.org> fill in temporary smallvectors instead of vectors for performance.
Fix BuildAggrIvarLayout to not access vectors out of range.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68101 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eff36eda99430b2bbd49536b1438a8d262f243e0 31-Mar-2009 Chris Lattner <sabre@nondot.org> simplify some casting


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68098 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d13d30258647e20c55a3910e4969f4a47bb2802c 31-Mar-2009 Chris Lattner <sabre@nondot.org> simplify some casting


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68098 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
04f4db7847a24ee7ff3074908df8b4bfebd446d9 31-Mar-2009 Chris Lattner <sabre@nondot.org> add a const version of the lookupFieldDeclForIvar method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68094 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
da04639a40e01d8d2ee891c075b271fd272d3d53 31-Mar-2009 Chris Lattner <sabre@nondot.org> add a const version of the lookupFieldDeclForIvar method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68094 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aabb850022fc6b16f63f4199e2f5496ccb49ac24 31-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Parsing and AST representation for dependent template names that occur
within nested-name-specifiers, e.g., for the "apply" in

typename MetaFun::template apply<T1, T2>::type

At present, we can't instantiate these nested-name-specifiers, so our
testing is sketchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68081 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c45c232440dfafedca1a3773b904fb42609b1b19 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST representation for dependent template names that occur
within nested-name-specifiers, e.g., for the "apply" in

typename MetaFun::template apply<T1, T2>::type

At present, we can't instantiate these nested-name-specifiers, so our
testing is sketchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68081 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c625fa9911a35cf67fa0c73b8d0446d2dcbb02fd 31-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> fe support for objc2's nonfragile-abi synthesized ivars.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68077 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
af3e72285238369c2ea4ebd40a1c9a87bd3eabb7 31-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> fe support for objc2's nonfragile-abi synthesized ivars.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68077 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
ffdc0393302122f521a930a08b4e54edc3c0c1b5 31-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Slight generalization for Evaluate with const variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68075 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e1646da3bb0fe97b372e5fe8cefc537b22048fc4 31-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Slight generalization for Evaluate with const variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68075 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
dd13e8468462e60971487bcd5915419762dab814 31-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").

One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as

std::(vector<int>)

we represent it as

(std::vector)<int>

which more closely follows the C++ grammar.

Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68074 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
ype.cpp
ypeSerialization.cpp
7532dc66648cfe7432c9fe66dec5225f0ab301c6 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").

One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as

std::(vector<int>)

we represent it as

(std::vector)<int>

which more closely follows the C++ grammar.

Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68074 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
emplateName.cpp
ype.cpp
ypeSerialization.cpp
72037962da603e7bbf6f45ba2cc01dc5cc2be16d 31-Mar-2009 Ted Kremenek <kremenek@apple.com> Add partial CFG support for Objective-C exception-handling blocks. We basically
assume that @catch blocks are never executed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68072 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e31c0d206b872b056dc42c3af21b11d5de4edfd9 31-Mar-2009 Ted Kremenek <kremenek@apple.com> Add partial CFG support for Objective-C exception-handling blocks. We basically
assume that @catch blocks are never executed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68072 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a17991fc70d5f5d774a4ea21feefcfc64b1f73a3 29-Mar-2009 Chris Lattner <sabre@nondot.org> Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc). These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68002 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
eclGroup.cpp
eclSerialization.cpp
tmtIterator.cpp
682bf92db408a6cbc3d37b5496a99b6ef85041ec 29-Mar-2009 Chris Lattner <sabre@nondot.org> Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc). These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68002 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
eclGroup.cpp
eclSerialization.cpp
tmtIterator.cpp
7ca9779e6ebedc00debf12eba2968cf3b2e413cc 29-Mar-2009 Chris Lattner <sabre@nondot.org> simplify


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68000 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
f279725f9772a8644957049971001f655b9041c9 29-Mar-2009 Chris Lattner <sabre@nondot.org> simplify


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68000 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
cbaf44d34d77c2facbf3740fceda6bc60dfd3231 29-Mar-2009 Chris Lattner <sabre@nondot.org> switch TemplateOrInstantiation to be a PointerUnion, which
simplifies some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67993 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
005f92f53c99ce8e701e44115c94216b108ea021 29-Mar-2009 Chris Lattner <sabre@nondot.org> switch TemplateOrInstantiation to be a PointerUnion, which
simplifies some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67993 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
655863f859077aff188fa4c2dc4eb7842cfdac62 29-Mar-2009 Chris Lattner <sabre@nondot.org> change another PointerIntPair into a PointerUnion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67991 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5648a8a700d2a0435373da4122d32f8e6fe95656 29-Mar-2009 Chris Lattner <sabre@nondot.org> change another PointerIntPair into a PointerUnion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67991 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5ce4f6ddd0a30e2cc65f78119473878943a9a04f 29-Mar-2009 Chris Lattner <sabre@nondot.org> switch DeclBase::DeclCtx to the new happy and type-safe
llvm::PointerUnion class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67988 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
ee219fd5f2776d8dd39d857f87304297b5ed743a 29-Mar-2009 Chris Lattner <sabre@nondot.org> switch DeclBase::DeclCtx to the new happy and type-safe
llvm::PointerUnion class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67988 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
e41419144a0a01456f5426efcd9b919f68284527 29-Mar-2009 Chris Lattner <sabre@nondot.org> adjust to llvm mainline changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67980 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
0eda3b31a672ea486fa92b9bc49a2c91be856b53 29-Mar-2009 Chris Lattner <sabre@nondot.org> adjust to llvm mainline changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67980 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
1bf91fba3f0b96a9c66e44bdffb5e10d0c99061b 29-Mar-2009 Anders Carlsson <andersca@mac.com> Let getIdentifierNamespaceForKind know about aliases and have it treat them just like namespace decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67963 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
faf0e872f3409ecafbc458eabb22be76f79cb050 29-Mar-2009 Anders Carlsson <andersca@mac.com> Let getIdentifierNamespaceForKind know about aliases and have it treat them just like namespace decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67963 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ddb1d8b3f23921c8e46127e9ffe065f1b3618a9b 28-Mar-2009 Anders Carlsson <andersca@mac.com> Create AST nodes for namespace aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67962 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
68771c73f4293620dc1a99154ec02111e6490e28 28-Mar-2009 Anders Carlsson <andersca@mac.com> Create AST nodes for namespace aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67962 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6fb0ae328cdfef4f6dcb64f0479efca116952afd 28-Mar-2009 Cédric Venet <cedric.venet@laposte.net> CMake: remove TranslationUnit.cpp from build (file has been removed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67944 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ec6986a8a8ede664fa3762f77bd40a383a954a76 28-Mar-2009 Cedric Venet <cedric.venet@laposte.net> CMake: remove TranslationUnit.cpp from build (file has been removed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67944 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ffae0dd2cfdc6d66f3e3b83d9104e8a18df0d8da 28-Mar-2009 Chris Lattner <sabre@nondot.org> some random cleanups


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67928 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e66a8cf9117e5fb95a05ff76ec06615e63dd5ade 28-Mar-2009 Chris Lattner <sabre@nondot.org> some random cleanups


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67928 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4a9a85e7edac3b86b7bddc70b193de210ae0517a 28-Mar-2009 Chris Lattner <sabre@nondot.org> rename some methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67923 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7e24e82a70a2c681f4291a3397bcd1e1005f251a 28-Mar-2009 Chris Lattner <sabre@nondot.org> rename some methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67923 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1a5b1dffdab1e9c0061a0e922af85dea86f82825 28-Mar-2009 Chris Lattner <sabre@nondot.org> Cleanups for DeclGroup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67922 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
fe95deaf66e4fbd82d44b5f6afa8162fa69cb85c 28-Mar-2009 Chris Lattner <sabre@nondot.org> Cleanups for DeclGroup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67922 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
fb8416a5431d2f959c7ac3a1659fde598a765370 28-Mar-2009 Chris Lattner <sabre@nondot.org> rename NextDeclInScope to NextDeclInContext, since the pointer
points within contexts not scopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67919 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
244a67d911d08c3757a18ad666e4a268cf3ee285 28-Mar-2009 Chris Lattner <sabre@nondot.org> rename NextDeclInScope to NextDeclInContext, since the pointer
points within contexts not scopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67919 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
fc318198d083d968069df85b4c972c000b12a4c9 28-Mar-2009 Chris Lattner <sabre@nondot.org> remove TranslationUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67914 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
1266eca868fa0ac799291ed04f349c9bbd7a9469 28-Mar-2009 Chris Lattner <sabre@nondot.org> remove TranslationUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67914 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
f4fbc448d069f2e72f90f3d94795480eb9f5dac9 28-Mar-2009 Chris Lattner <sabre@nondot.org> push more ASTContext goodness out through interfaces that use
TranslationUnit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67913 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
ranslationUnit.cpp
557c5b1717bc8919b1b40cf2064b51491ec53a44 28-Mar-2009 Chris Lattner <sabre@nondot.org> push more ASTContext goodness out through interfaces that use
TranslationUnit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67913 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
ranslationUnit.cpp
7bb39bc52a09b80c93d83e6decdaaad862a82df4 28-Mar-2009 Chris Lattner <sabre@nondot.org> simplify away some dead ownership stuff, TranslationUnit is now
just a wrapper around ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67906 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
3776d4cea4f15e04f32997742deb4b35b72c9b8c 28-Mar-2009 Chris Lattner <sabre@nondot.org> simplify away some dead ownership stuff, TranslationUnit is now
just a wrapper around ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67906 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
8c86cdfe9a2fd82488715fac4be04baafc1e1e8f 28-Mar-2009 Chris Lattner <sabre@nondot.org> hoist TranslationUnit some more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67905 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
d2fa67570b363843215f62395b795c1f70e6b85f 28-Mar-2009 Chris Lattner <sabre@nondot.org> hoist TranslationUnit some more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67905 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
78e3dd4b8f6006066ba845de5af0ccae5c729852 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate some wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67904 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
80a033358d8da09d1f62b0b3ba98cee0346c0a49 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate some wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67904 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
06459ae8fe140c4f6cc1a6de2ee2e63f02f5592f 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate ReadASTBitcodeFile


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67903 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
5f737ccd3854b55a3eb9ab3aa54f2b1c3212418f 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate ReadASTBitcodeFile


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67903 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
b09b31d1abab14413df5e744869200dd1095dc53 28-Mar-2009 Chris Lattner <sabre@nondot.org> move serialization logic from TranslationUnit to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67902 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ranslationUnit.cpp
a9376d470ccb0eac74fe09a6b2a18a890f1d17c4 28-Mar-2009 Chris Lattner <sabre@nondot.org> move serialization logic from TranslationUnit to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67902 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ranslationUnit.cpp
fb88a5f60c9366bcb62fa604e9a49021b6771c6a 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate ASTConsumer::InitializeTU, all clients are
happy with just ASTContext, they don't need a TU.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67894 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
7bb0da001fc579410035cec00b6bca499251a318 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate ASTConsumer::InitializeTU, all clients are
happy with just ASTContext, they don't need a TU.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67894 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
9c18fde756bfdfc5660cf1ebdb0b8d73f68bf2b7 28-Mar-2009 Chris Lattner <sabre@nondot.org> remove TranslationUnit::OwnsDecls, which is only set, never read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ranslationUnit.cpp
ed0e497efc23ac4b35481a60a80579d355335e07 28-Mar-2009 Chris Lattner <sabre@nondot.org> remove TranslationUnit::OwnsDecls, which is only set, never read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ranslationUnit.cpp
3cd92880b42cd67bcb631c769a7ab62068e9aac9 28-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into
the AST which is otherwise non-obvious. Fix Sema to always come up with the
right answer for both of these types. Fix IRGen and the analyzer to
account for these changes. This fixes PR2601. The approach is inspired
by PR2601 comment 2.

Note that this changes real *= complex in CodeGen from a silent
miscompilation to an explicit error.

I'm not really sure that the analyzer changes are correct, or how to
test them... someone more familiar with the analyzer should check those
changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67889 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtSerialization.cpp
ab3a852ae713189444dcbf75e70accf1e8c2b7f2 28-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into
the AST which is otherwise non-obvious. Fix Sema to always come up with the
right answer for both of these types. Fix IRGen and the analyzer to
account for these changes. This fixes PR2601. The approach is inspired
by PR2601 comment 2.

Note that this changes real *= complex in CodeGen from a silent
miscompilation to an explicit error.

I'm not really sure that the analyzer changes are correct, or how to
test them... someone more familiar with the analyzer should check those
changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67889 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtSerialization.cpp
5f34f0ee70302e8ce1fb6dd8ba4c03e873762476 28-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Make our diagnostics about the obsolete GNU designated-initializer
syntax into extension warnings, and provide code-modification hints
showing how to fix the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67885 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
eeae8f072748affce25ab4064982626361293390 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Make our diagnostics about the obsolete GNU designated-initializer
syntax into extension warnings, and provide code-modification hints
showing how to fix the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67885 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
3c4eae5eb9a801bb130240543d99b6c7599df9fa 28-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Better way to free NestedNameSpecifiers. Thanks, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67880 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1ae0afaf14b7ce9bed33c1fe51077d01a313434d 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Better way to free NestedNameSpecifiers. Thanks, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67880 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bccd97c30ba3f56697fea8365d923e311c0d05d5 28-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Perform a very, very ugly song-and-dance number to free the
NestedNameSpecifiers without causing problems for the FoldingSet that
contains them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67877 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7dcd782df0e1cc3a63e429a866098e69db39153 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Perform a very, very ugly song-and-dance number to free the
NestedNameSpecifiers without causing problems for the FoldingSet that
contains them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67877 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d30226003ea60119b19901b7813821c7ec3d7e55 28-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Initial implementation of parsing, semantic analysis, and template
instantiation for C++ typename-specifiers such as

typename T::type

The parsing of typename-specifiers is relatively easy thanks to
annotation tokens. When we see the "typename", we parse the
typename-specifier and produce a typename annotation token. There are
only a few places where we need to handle this. We currently parse the
typename-specifier form that terminates in an identifier, but not the
simple-template-id form, e.g.,

typename T::template apply<U, V>

Parsing of nested-name-specifiers has a similar problem, since at this
point we don't have any representation of a class template
specialization whose template-name is unknown.

Semantic analysis is only partially complete, with some support for
template instantiation that works for simple examples.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67875 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
estedNameSpecifier.cpp
ype.cpp
ypeSerialization.cpp
d57959af02b4af695276f4204443afe6e5d86bd8 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of parsing, semantic analysis, and template
instantiation for C++ typename-specifiers such as

typename T::type

The parsing of typename-specifiers is relatively easy thanks to
annotation tokens. When we see the "typename", we parse the
typename-specifier and produce a typename annotation token. There are
only a few places where we need to handle this. We currently parse the
typename-specifier form that terminates in an identifier, but not the
simple-template-id form, e.g.,

typename T::template apply<U, V>

Parsing of nested-name-specifiers has a similar problem, since at this
point we don't have any representation of a class template
specialization whose template-name is unknown.

Semantic analysis is only partially complete, with some support for
template instantiation that works for simple examples.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67875 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
estedNameSpecifier.cpp
ype.cpp
ypeSerialization.cpp
37eb4a4227c6be4420f6cfdc964315ba7d4f4698 27-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix test failures caused by reading memory after freeing it. My fix is
rather nasty, but I can't think of a better fix off the top of my head.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67867 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2993cdac4091a2748b839882eca0e672171b1d6a 27-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix test failures caused by reading memory after freeing it. My fix is
rather nasty, but I can't think of a better fix off the top of my head.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67867 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8752fe0e06d1386829890b23416e2be3c1144305 27-Mar-2009 Chris Lattner <sabre@nondot.org> minor cleanups: make getIdentifierNamespace() be a single load
instead of a load + large inlined switch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67864 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
769dbdf467681f6020ff248b969c2d41a4fdccd3 27-Mar-2009 Chris Lattner <sabre@nondot.org> minor cleanups: make getIdentifierNamespace() be a single load
instead of a load + large inlined switch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67864 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9a502bdc1e0a96b31a52aed1913744b00032fb94 27-Mar-2009 Chris Lattner <sabre@nondot.org> reduce # const_casts, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67861 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0cf2b1990c82121d03a004dafe498ba43bf4b42a 27-Mar-2009 Chris Lattner <sabre@nondot.org> reduce # const_casts, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67861 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f5151efd6813a6952094f9d020e9f733f70efc4b 27-Mar-2009 Chris Lattner <sabre@nondot.org> change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67858 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
10d8379676f32b493740a5509e2cd7f0d6433139 27-Mar-2009 Chris Lattner <sabre@nondot.org> change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67858 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
1e589cc31d339860b9df61870930961601d68120 27-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Revamp our representation of C++ nested-name-specifiers. We now have a
uniqued representation that should both save some memory and make it
far easier to properly build canonical types for types involving
dependent nested-name-specifiers, e.g., "typename T::Nested::type".

This approach will greatly simplify the representation of
CXXScopeSpec. That'll be next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67799 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
ype.cpp
ypeSerialization.cpp
ab452ba8323d1985e08bade2bced588cddf2cc28 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Revamp our representation of C++ nested-name-specifiers. We now have a
uniqued representation that should both save some memory and make it
far easier to properly build canonical types for types involving
dependent nested-name-specifiers, e.g., "typename T::Nested::type".

This approach will greatly simplify the representation of
CXXScopeSpec. That'll be next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67799 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprCXX.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
ype.cpp
ypeSerialization.cpp
e8dcd92a726d835d52374e818436a239868d9c19 27-Mar-2009 Anders Carlsson <andersca@mac.com> Add

const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
AccessSpecifier AS);

so we can easily add access specifiers to diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67795 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
05bf2c79770927c66ca725e9bb589048ed3f069e 27-Mar-2009 Anders Carlsson <andersca@mac.com> Add

const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
AccessSpecifier AS);

so we can easily add access specifiers to diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67795 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
8ea6a3293085bfc0d8bae39057dd918f839ab424 26-Mar-2009 Anders Carlsson <andersca@mac.com> Tighten the setAccess assert. We now allow AS_none if the decl contex is not a C++ record decl.

Also, fix fallout from the change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67717 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1329c274628cc8c4e8ad472b41d1a78c8123f611 26-Mar-2009 Anders Carlsson <andersca@mac.com> Tighten the setAccess assert. We now allow AS_none if the decl contex is not a C++ record decl.

Also, fix fallout from the change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67717 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
cc88797aac66319a370847d204aef5de70c43f65 25-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Instantiation for member classes of class templates. Note that only
the declarations of member classes are instantiated when the owning
class template is instantiated. The definitions of such member classes
are instantiated when a complete type is required.

This change also introduces the injected-class-name into a class
template specialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67707 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d475b8d9e6f5ff0e6ab8d15667ce8a64c7cb9a4d 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Instantiation for member classes of class templates. Note that only
the declarations of member classes are instantiated when the owning
class template is instantiated. The definitions of such member classes
are instantiated when a complete type is required.

This change also introduces the injected-class-name into a class
template specialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67707 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
43bfaafb142657ceee76b65396075a57e195d8d1 25-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Predicate to detect when a RecordDecl is really the injected-class-name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67687 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c9b5b4074bd73d4af76e69cccf8ecd365fdd1008 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Predicate to detect when a RecordDecl is really the injected-class-name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67687 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
26ea122d7b08fc76c2135ef2609af311d951dac3 24-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Type::isObjectType now implements the (more sensible) C++ definition
of "object type" rather than the C definition of "object type". The
difference is that C's "object type" excludes incomplete types such as

struct X;

However, C's definition also makes it far too easy to use isObjectType
as a means to detect incomplete types when in fact we should use other
means (e.g., Sema::RequireCompleteType) that cope with C++ semantics,
including template instantiation.

I've already audited every use of isObjectType and isIncompleteType to
ensure that they are doing the right thing for both C and C++, so this
is patch does not change any functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67648 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bad0e656c3732e3539a9cd6525de721d7e47408b 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Type::isObjectType now implements the (more sensible) C++ definition
of "object type" rather than the C definition of "object type". The
difference is that C's "object type" excludes incomplete types such as

struct X;

However, C's definition also makes it far too easy to use isObjectType
as a means to detect incomplete types when in fact we should use other
means (e.g., Sema::RequireCompleteType) that cope with C++ semantics,
including template instantiation.

I've already audited every use of isObjectType and isIncompleteType to
ensure that they are doing the right thing for both C and C++, so this
is patch does not change any functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67648 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
928d5d20e0000bc4ad85b351138b27f9f5337a1a 24-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix PR3868 by making Evaluate handle cases like "(long)&a + 4".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67593 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
42edd0d32a729d2735a6fb152ba6bf349bf0a169 24-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix PR3868 by making Evaluate handle cases like "(long)&a + 4".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67593 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fb52ebac319fbda854d2bd982f1e3ce8b119a993 23-Mar-2009 Chris Lattner <sabre@nondot.org> use isa<>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67543 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7fd0995e993438a3a1f5408d8549b3af0009ff30 23-Mar-2009 Chris Lattner <sabre@nondot.org> use isa<>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67543 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6c78690ff20aa3546011e788abd8b1a63a192dd3 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor Evaluate cleanup; add some boilerplate implementations to
Evaluate for __extension__ and __builtin_choose_expr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67506 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ba98d6bb414861965a1f22628494ea046785ecd4 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor Evaluate cleanup; add some boilerplate implementations to
Evaluate for __extension__ and __builtin_choose_expr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67506 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
103bbdd013aca16930f8dfafcb2c042a11b0d1dc 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor enhancements to Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67503 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a1f47c447a919c6a05c63801cb6a52c4c288e2cc 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor enhancements to Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67503 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
91571da0133f6ed975234782532f078aee13b254 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Adjust isModifiableLvalue to give a slightly more useful diagnostic for
attempting to illegally modify a BlockDeclRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67491 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
04831aa3271edc5f00a651bf7152c2902981d7c3 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Adjust isModifiableLvalue to give a slightly more useful diagnostic for
attempting to illegally modify a BlockDeclRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67491 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9c2b33f762fccde17b1d088fa352a0fe159d1096 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix code to mark block variables as const to actually work. Fix
isObjCObjectPointerType to work with qualified types. Adjust test for
changes.

If the SemaExpr changes are wrong or break existing code, feel free to
delete the "ExprTy.addConst();" line and revert my changes to
test/Sema/block-literal.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67489 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5fdeae17da443c50c62f602733d06193a71b170f 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix code to mark block variables as const to actually work. Fix
isObjCObjectPointerType to work with qualified types. Adjust test for
changes.

If the SemaExpr changes are wrong or break existing code, feel free to
delete the "ExprTy.addConst();" line and revert my changes to
test/Sema/block-literal.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67489 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1dae87f4b8750e107fde542377d457e462b6c9b1 22-Mar-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a class is abstract or not. This is currently only used for the __is_abstract type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67461 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
67e4dd2e9936d828d68b20e01922b6442c6ce31b 22-Mar-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a class is abstract or not. This is currently only used for the __is_abstract type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67461 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xprCXX.cpp
6eea6bb4b7326c60bbe00d408bea3a4638a1a44d 22-Mar-2009 Chris Lattner <sabre@nondot.org> fix some warnings in release-assert mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67456 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b7beee9f2b52f34a3b0800a5f0038f0e4295b260 22-Mar-2009 Chris Lattner <sabre@nondot.org> fix some warnings in release-assert mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67456 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
86913d435f38b466d301682e07798acdb46b7202 21-Mar-2009 Chris Lattner <sabre@nondot.org> add an assertion for unreachable code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67432 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ac8d75fe94f2aefde5179d53e230b99a1fe1201a 21-Mar-2009 Chris Lattner <sabre@nondot.org> add an assertion for unreachable code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67432 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
004a9bbb54964500d98c0a3d8d94a2cc35daf267 21-Mar-2009 Chris Lattner <sabre@nondot.org> partially inline getAttrs() to speed up PR3810 (and lots of
other code presumably) by 4.3%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67430 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
81abbdd848aa02c30242bd22dcc6ffe024ae2957 21-Mar-2009 Chris Lattner <sabre@nondot.org> partially inline getAttrs() to speed up PR3810 (and lots of
other code presumably) by 4.3%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67430 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ee0792c36716c6104957542be022949d99629d62 21-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> When building the structured initializer list, pre-allocate storage in
its vectors based on the subobject type we're initializing and the
(unstructured) initializer list. This eliminates some malloc thrashing
when parsing initializers (from 117 vector reallocations down to 0
when parsing Cocoa.h). We can't always pre-allocate the right amount
of storage, since designated initializers can cause us to initialize
in non-predictable patterns.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67421 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fa2192042f223b5122a9e17719930f77634fd31f 21-Mar-2009 Douglas Gregor <dgregor@apple.com> When building the structured initializer list, pre-allocate storage in
its vectors based on the subobject type we're initializing and the
(unstructured) initializer list. This eliminates some malloc thrashing
when parsing initializers (from 117 vector reallocations down to 0
when parsing Cocoa.h). We can't always pre-allocate the right amount
of storage, since designated initializers can cause us to initialize
in non-predictable patterns.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67421 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
78e9713f1732c2536cf6037c4720033a3b3fe19e 21-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Destroy expressions properly when resizing an initializer list

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67417 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
068636800594844c53fba0bc871c579745757d0e 21-Mar-2009 Douglas Gregor <dgregor@apple.com> Destroy expressions properly when resizing an initializer list

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67417 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
51787c77ed35d2d402efb8bc97c3dcf09aedda89 20-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix <rdar://problem/6704086> by allowing the format string checking in Sema to
allow non-literal format strings that are variables that (a) permanently bind to
a string constant and (b) whose string constants are resolvable within the same
translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67404 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
082d936a5b8323ac2c04558d8bca277a647831a3 20-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix <rdar://problem/6704086> by allowing the format string checking in Sema to
allow non-literal format strings that are variables that (a) permanently bind to
a string constant and (b) whose string constants are resolvable within the same
translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67404 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9233452bba8d1e8a0f37ac93b42e51c8a0b28e9a 20-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Some minor tweaks and additional tests for rvalue references

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67397 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
2ff44784d180bb96953c22de4a0b2efb5d50263a 20-Mar-2009 Douglas Gregor <dgregor@apple.com> Some minor tweaks and additional tests for rvalue references

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67397 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
47bde7c68e2935358db5cffa7d6a3986bb5bcec8 19-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a new expression type, UnresolvedDeclRefExpr, that describes
dependent qualified-ids such as

Fibonacci<N - 1>::value

where N is a template parameter. These references are "unresolved"
because the name is dependent and, therefore, cannot be resolved to a
declaration node (as we would do for a DeclRefExpr or
QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to
DeclRefExprs, QualifiedDeclRefExprs, etc.

Also, be a bit more careful about keeping only a single set of
specializations for a class template, and instantiating from the
definition of that template rather than a previous declaration. In
general, we need a better solution for this for all TagDecls, because
it's too easy to accidentally look at a declaration that isn't the
definition.

We can now process a simple Fibonacci computation described as a
template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67308 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
xprCXX.cpp
tmtPrinter.cpp
5953d8b37f92f0cf548941f617c9b0a7703df33b 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression type, UnresolvedDeclRefExpr, that describes
dependent qualified-ids such as

Fibonacci<N - 1>::value

where N is a template parameter. These references are "unresolved"
because the name is dependent and, therefore, cannot be resolved to a
declaration node (as we would do for a DeclRefExpr or
QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to
DeclRefExprs, QualifiedDeclRefExprs, etc.

Also, be a bit more careful about keeping only a single set of
specializations for a class template, and instantiating from the
definition of that template rather than a previous declaration. In
general, we need a better solution for this for all TagDecls, because
it's too easy to accidentally look at a declaration that isn't the
definition.

We can now process a simple Fibonacci computation described as a
template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67308 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
xprCXX.cpp
tmtPrinter.cpp
76485a9d630813a9320e494b7e5b9e67d9e025ca 19-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Print the context of tag types as part of pretty-printing, e.g.,

struct N::M::foo



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67284 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
24c46b3133b03e254877a680f92f035e56058a39 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Print the context of tag types as part of pretty-printing, e.g.,

struct N::M::foo



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67284 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7e50826d3559f284eee6659f0aa159c68f504b34 19-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Generalize printing of nested-name-specifier sequences for use in both
QualifiedNameType and QualifiedDeclRefExpr. We now keep track of the
exact nested-name-specifier spelling for a QualifiedDeclRefExpr, and
use that spelling when printing ASTs. This fixes PR3493.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67283 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ype.cpp
bad351822117eaf280081494e3dbe4a06c0dbfcf 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Generalize printing of nested-name-specifier sequences for use in both
QualifiedNameType and QualifiedDeclRefExpr. We now keep track of the
exact nested-name-specifier spelling for a QualifiedDeclRefExpr, and
use that spelling when printing ASTs. This fixes PR3493.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67283 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
estedNameSpecifier.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ype.cpp
734b4baa8e7677d03085a3d3716fa550fb40be63 19-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a representation for types that we referred to via a
qualified name, e.g.,

foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in

::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67265 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
estedNameSpecifier.cpp
ype.cpp
ypeSerialization.cpp
e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a representation for types that we referred to via a
qualified name, e.g.,

foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in

::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67265 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
estedNameSpecifier.cpp
ype.cpp
ypeSerialization.cpp
835327293da59eb16667ae5a2b7158131865a079 17-Mar-2009 Chris Lattner <sabre@nondot.org> Fix Type::getDesugaredType() to remove all direct sugar on
a type. For example, if we have a typedef of a typeof of
int, we strip all the say down to int. This allows us to
simplify the getAs* methods, and is the first step towards
fixing PR3817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67126 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2fa8c2598c2615da4639b4e42e9079647bd3aea4 17-Mar-2009 Chris Lattner <sabre@nondot.org> Fix Type::getDesugaredType() to remove all direct sugar on
a type. For example, if we have a typedef of a typeof of
int, we strip all the say down to int. This allows us to
simplify the getAs* methods, and is the first step towards
fixing PR3817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67126 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
ce6fff0486d0e15bc969fb0e3e4850c0784e997f 17-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Almost complete implementation of rvalue references. One bug, and a few unclear areas. Maybe Doug can shed some light on some of the fixmes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67059 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
eclCXX.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
ypeSerialization.cpp
7c80bd64032e610c0dbd74fc0ef6ea334447f2fd 17-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Almost complete implementation of rvalue references. One bug, and a few unclear areas. Maybe Doug can shed some light on some of the fixmes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67059 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
eclCXX.cpp
xpr.cpp
xprConstant.cpp
ype.cpp
ypeSerialization.cpp
026a2ef889178bbf6707465b73909aa38aaf7e6b 17-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

- We don't remove or use the current ".def" files. Instead, for now,
we just make sure that we're building the ".inc" files.
- Fixed CMake makefiles to run TableGen and build the ".inc" files
when needed. Tested with both the Xcode and Makefile generators
provided by CMake, so it should be solid.
- Fixed normal makefiles to handle out-of-source builds that involve
the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
akefile
a393e9eedcc28b25f521a4feceb3b56e3d0d360f 17-Mar-2009 Douglas Gregor <dgregor@apple.com> Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

- We don't remove or use the current ".def" files. Instead, for now,
we just make sure that we're building the ".inc" files.
- Fixed CMake makefiles to run TableGen and build the ".inc" files
when needed. Tested with both the Xcode and Makefile generators
provided by CMake, so it should be solid.
- Fixed normal makefiles to handle out-of-source builds that involve
the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
akefile
7f2e7440faa9260d23fcbc0a0368d10f9538b462 15-Mar-2009 Anders Carlsson <andersca@mac.com> Add the ability to clone integer and string literals. Use it when instantiating template expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67030 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a135fb43eb94524a6529768596a4533eed9aa70d 15-Mar-2009 Anders Carlsson <andersca@mac.com> Add the ability to clone integer and string literals. Use it when instantiating template expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67030 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8b842c59fa60cb49daa0bdf07b591b80ff32ad96 14-Mar-2009 Anders Carlsson <andersca@mac.com> Handle dependent types/exprs in static_assert expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66997 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c3082413e4207173b32c118e922d63149df6261f 14-Mar-2009 Anders Carlsson <andersca@mac.com> Handle dependent types/exprs in static_assert expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66997 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c5f6de063c95e74de9f6d52ce7332cc260320ad6 14-Mar-2009 Ted Kremenek <kremenek@apple.com> Remove dead DeclarationName constructors that involving knowing about the
internal implementation of Selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66996 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
3eb8dd78a622d257a7fed279714428c3de906f93 14-Mar-2009 Ted Kremenek <kremenek@apple.com> Remove dead DeclarationName constructors that involving knowing about the
internal implementation of Selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66996 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
ed69156f9911f1107f284a0b62bdc62295979867 14-Mar-2009 Anders Carlsson <andersca@mac.com> More static_assert work. Check that the assert expr is valid and show an error if it's false. Create the declaration and add it to the current context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66995 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fb311762bb52dc015c02cb257d2913f104b556f8 14-Mar-2009 Anders Carlsson <andersca@mac.com> More static_assert work. Check that the assert expr is valid and show an error if it's false. Create the declaration and add it to the current context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66995 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c78182dea4396fba411d2526a1386ca994eee6c0 14-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for the prefix unary operators. As
always, refactored the existing logic to tease apart the parser action
and the semantic analysis shared by the parser and template
instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66987 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bc736fceca6f0bca31d16003a7587857190408fb 14-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for the prefix unary operators. As
always, refactored the existing logic to tease apart the parser action
and the semantic analysis shared by the parser and template
instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66987 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4a71fb184b0c3d3e264952fa9b94141d0fb50a87 14-Mar-2009 Ted Kremenek <kremenek@apple.com> BlockDecl::Destroy now deallocates BlockDecl's array of ParmVarDecl*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66979 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
879d27ad4670716c7cea7f86274f6096f6868fe1 14-Mar-2009 Ted Kremenek <kremenek@apple.com> BlockDecl::Destroy now deallocates BlockDecl's array of ParmVarDecl*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66979 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
911b867858e37e8c5fcf105f75423cff911c0c09 13-Mar-2009 Chris Lattner <sabre@nondot.org> wire up a new -fno-builtin option, make it control things like simplifylibcalls,
etc and make freestanding imply it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66972 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
7644f0726c310ec4224085eaea5f9aff8b957d90 13-Mar-2009 Chris Lattner <sabre@nondot.org> wire up a new -fno-builtin option, make it control things like simplifylibcalls,
etc and make freestanding imply it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66972 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
396f114b5e704ed6d0ca7f89caf377322f287ead 13-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for several more kinds of expressions:
- C++ function casts, e.g., T(foo)
- sizeof(), alignof()

More importantly, this allows us to verify that we're performing
overload resolution during template instantiation, with
argument-dependent lookup and the "cached" results of name lookup from
the template definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtSerialization.cpp
ype.cpp
ba49817c5b9f502602672861cf369fd0e53966e8 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for several more kinds of expressions:
- C++ function casts, e.g., T(foo)
- sizeof(), alignof()

More importantly, this allows us to verify that we're performing
overload resolution during template instantiation, with
argument-dependent lookup and the "cached" results of name lookup from
the template definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtSerialization.cpp
ype.cpp
00fe3f63604d2be2fafbf42fe5df0795d7d29116 13-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor the way we handle operator overloading and template
instantiation for binary operators. This change moves most of the
operator-overloading code from the parser action ActOnBinOp to a new,
parser-independent semantic checking routine CreateOverloadedBinOp.

Of particular importance is the fact that CreateOverloadedBinOp does
*not* perform any name lookup based on the current parsing context (it
doesn't take a Scope*), since it has to be usable during template
instantiation, when there is no scope information. Rather, it takes a
pre-computed set of functions that are visible from the context or via
argument-dependent lookup, and adds to that set any member operators
and built-in operator candidates. The set of functions is computed in
the parser action ActOnBinOp based on the current context (both
operator name lookup and argument-dependent lookup). Within a
template, the set computed by ActOnBinOp is saved within the
type-dependent AST node and is augmented with the results of
argument-dependent name lookup at instantiation time (see
TemplateExprInstantiator::VisitCXXOperatorCallExpr).

Sadly, we can't fully test this yet. I'll follow up with template
instantiation for sizeof so that the real fun can begin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66923 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
063daf6e196c51f162e0485478355d8e280eef5c 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Refactor the way we handle operator overloading and template
instantiation for binary operators. This change moves most of the
operator-overloading code from the parser action ActOnBinOp to a new,
parser-independent semantic checking routine CreateOverloadedBinOp.

Of particular importance is the fact that CreateOverloadedBinOp does
*not* perform any name lookup based on the current parsing context (it
doesn't take a Scope*), since it has to be usable during template
instantiation, when there is no scope information. Rather, it takes a
pre-computed set of functions that are visible from the context or via
argument-dependent lookup, and adds to that set any member operators
and built-in operator candidates. The set of functions is computed in
the parser action ActOnBinOp based on the current context (both
operator name lookup and argument-dependent lookup). Within a
template, the set computed by ActOnBinOp is saved within the
type-dependent AST node and is augmented with the results of
argument-dependent name lookup at instantiation time (see
TemplateExprInstantiator::VisitCXXOperatorCallExpr).

Sadly, we can't fully test this yet. I'll follow up with template
instantiation for sizeof so that the real fun can begin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66923 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
ab0b8b17cf7b4eb4e367e8ed9ed23b7139b4be62 13-Mar-2009 Chris Lattner <sabre@nondot.org> add a helper function to strip noop casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66909 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ecdd84147c0765caa999ddc22dde25b42712bb4d 13-Mar-2009 Chris Lattner <sabre@nondot.org> add a helper function to strip noop casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66909 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
494cb0fa1fd613f3dff87a25ab47049f1d9201f9 13-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.

Also changed BlockDecl API to be more consistent (wrt FunctionDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66904 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e78b809bbcd92928a63da81f2cd843faad3e4dfd 13-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.

Also changed BlockDecl API to be more consistent (wrt FunctionDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66904 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
535f3128251761f07f24aec0cc21f1a6d0240a51 12-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate some unused default cases in switches on the binary operator kind

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66837 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
baf534875ed0a55c6342636ff3f4602b8ac22b69 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate some unused default cases in switches on the binary operator kind

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66837 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
309160771eaf06afd1159cc299a2d462924bd040 12-Mar-2009 Ted Kremenek <kremenek@apple.com> API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed to
be CompoundStmts. I think this is a valid assumption, and felt that the API
should reflect it. Others please validate this assumption to make sure I didn't
break anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66814 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eaab20669b6a9910a5deb0110fdd8f7581d86a36 12-Mar-2009 Ted Kremenek <kremenek@apple.com> API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed to
be CompoundStmts. I think this is a valid assumption, and felt that the API
should reflect it. Others please validate this assumption to make sure I didn't
break anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66814 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9e09e960264846fa0455a63999cbca0bd714e228 12-Mar-2009 Chris Lattner <sabre@nondot.org> add some spaces :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66738 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
32a47ed1f58c88dbc99fbe6ed76e07cafed6479a 12-Mar-2009 Chris Lattner <sabre@nondot.org> add some spaces :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66738 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
3f402202c75d1cd3713edde1ffb32924833d228d 11-Mar-2009 Chris Lattner <sabre@nondot.org> don't use strtoul on a non-null-terminated string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66732 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
cafc222b2a411d4c1680a9be66ae922deb7799d2 11-Mar-2009 Chris Lattner <sabre@nondot.org> don't use strtoul on a non-null-terminated string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66732 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
006605882f997a37ee104cd5f30d0b523ef32d44 11-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate CXXClassVarDecl. It doesn't add anything

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66696 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
2d2e9cfdc1dbb6e4a22f8c0b1abcd30437e3795d 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXClassVarDecl. It doesn't add anything

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66696 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
580a6d5ada817087b8d3070208dccb3949c776ec 11-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix StmtIterator bug reported in PR 3780 where a VLA within a DeclGroup would
not be consulted for its size expression when operator* was called in the
StmtIterator (this resulted in an assertion failure).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66679 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
344d4c8726e5fb7dfac42eeaef2c0df02d2059b0 11-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix StmtIterator bug reported in PR 3780 where a VLA within a DeclGroup would
not be consulted for its size expression when operator* was called in the
StmtIterator (this resulted in an assertion failure).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66679 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
5b13243f6374ef628e5bfec63ffcfcf6bdeed5fa 11-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR3258 by rejecting invalid numeric operands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66618 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
85759278332404e96d4bb89d0e976e46158cd026 11-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR3258 by rejecting invalid numeric operands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66618 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a7f227075d47ea681488d3713bdf8a54db021a5e 11-Mar-2009 Chris Lattner <sabre@nondot.org> checking for symbolic operands as well as % at end of string.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66614 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
eab8cfbf4b2e85b66cea6e0fea3b7f8fd2685722 11-Mar-2009 Chris Lattner <sabre@nondot.org> checking for symbolic operands as well as % at end of string.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66614 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
c0da38d31b153df641a2f8aab21c49777a9273a2 11-Mar-2009 Chris Lattner <sabre@nondot.org> position the caret properly on asm string diagnostics, e.g.:

Sema/asm.c:64:9: error: invalid % escape in inline assembly string
asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}}
~~^~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66606 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
2ff0f42a962fec5a6300b5986297b417db173e6a 11-Mar-2009 Chris Lattner <sabre@nondot.org> position the caret properly on asm string diagnostics, e.g.:

Sema/asm.c:64:9: error: invalid % escape in inline assembly string
asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}}
~~^~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66606 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
d4dd42cf8a6b5ed3b295663d9e548eddb9b0eee9 11-Mar-2009 Chris Lattner <sabre@nondot.org> reject invalid escape characters in extended-asm strings with a nice diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66605 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
3182db1c8e456c4cd2180fac9d77d331b2c0621f 11-Mar-2009 Chris Lattner <sabre@nondot.org> reject invalid escape characters in extended-asm strings with a nice diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66605 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
2f728b2144bb3e5cfc3b954a95b17f8da81d1448 11-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Add type checking for tentative definitions at the end of the
translation unit.

Thread the various declarations of variables via
VarDecl::getPreviousDeclaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66601 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
275a369f003f25bd22c00c1c0fc0251c7208caf4 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Add type checking for tentative definitions at the end of the
translation unit.

Thread the various declarations of variables via
VarDecl::getPreviousDeclaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66601 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c516473346d49d9613d2931fc3caa64e52a5d17c 11-Mar-2009 Chris Lattner <sabre@nondot.org> add plumbing to report diagnostics back through sema for malformed asmstrings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66598 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
fb5058ef67c054296c88db18ab1b3717845cb71d 11-Mar-2009 Chris Lattner <sabre@nondot.org> add plumbing to report diagnostics back through sema for malformed asmstrings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66598 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
5c6a6c5f5756bb9b4902b4db4dbc023c73197f52 11-Mar-2009 Chris Lattner <sabre@nondot.org> move the asm string analysis code out of codegen into common
code where Sema can get to it. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66596 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
458cd9c8a79b25b87dcea43c9d97a4c59f194799 11-Mar-2009 Chris Lattner <sabre@nondot.org> move the asm string analysis code out of codegen into common
code where Sema can get to it. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66596 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
56d25a726f0bdb4db08021b9e98782ada5241eaf 10-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.

In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
df667e71b1daadeacb230cf94fc717843f1a138a 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.

In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
043857897d48206826fd57f10060d7e9eee0657c 10-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Add pretty-printing for class template specializations, e.g.,

'struct A<double, int>'

In the "template instantiation depth exceeded" message, print
"-ftemplate-depth-N" rather than "-ftemplate-depth=N".

An unnamed tag type that is declared with a typedef, e.g.,

typedef struct { int x, y; } Point;

can be used as a template argument. Allow this, and check that we get
sensible pretty-printing for such things.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66560 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
98137534e612c274ba270af99d73429043957e53 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Add pretty-printing for class template specializations, e.g.,

'struct A<double, int>'

In the "template instantiation depth exceeded" message, print
"-ftemplate-depth-N" rather than "-ftemplate-depth=N".

An unnamed tag type that is declared with a typedef, e.g.,

typedef struct { int x, y; } Point;

can be used as a template argument. Allow this, and check that we get
sensible pretty-printing for such things.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66560 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6a546b0cf37ddc89745c580b56b3a744a6f1c426 10-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> When pretty-printing an anonymous tag type that is associated with a typedef, use the name of the typedef rather than <anonymous>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66559 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4e16d0478407b556c819b5836a3564a9fdee8d5f 10-Mar-2009 Douglas Gregor <dgregor@apple.com> When pretty-printing an anonymous tag type that is associated with a typedef, use the name of the typedef rather than <anonymous>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66559 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
24c169debdbe1f6779664296f1b831eeb00bc051 10-Mar-2009 Daniel Dunbar <daniel@zuster.org> Remove some now-unneeded calls to llvm::errs().flush().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66555 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
tmtPrinter.cpp
4a77edb3f0fabc8e214a3d5636c4d0aff031645c 10-Mar-2009 Daniel Dunbar <daniel@zuster.org> Remove some now-unneeded calls to llvm::errs().flush().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66555 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
tmtPrinter.cpp
20ac04cc4d10990aa85513d44ba748302f6c1f5a 10-Mar-2009 Chris Lattner <sabre@nondot.org> move matching of named operands into AsmStmt class. At the same
time handle + operands in operand counting, fixing asm.c:t7 to
expand into $2 instead of $1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66531 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
10ca96ae9aed6906c3302403ef1a146a8d4c6b74 10-Mar-2009 Chris Lattner <sabre@nondot.org> move matching of named operands into AsmStmt class. At the same
time handle + operands in operand counting, fixing asm.c:t7 to
expand into $2 instead of $1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66531 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
e8625110518534a980a44226f0f7c249604b22f4 10-Mar-2009 Chris Lattner <sabre@nondot.org> add some helper methods to AsmStmt and add some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66521 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
b327793860737d1c103a73aeda8057dd628a101d 10-Mar-2009 Chris Lattner <sabre@nondot.org> add some helper methods to AsmStmt and add some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66521 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
f9ff4b14cfc4ee2c4e43dbb71242aa85446ecc2a 10-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for ClassTemplateSpecializationTypes,
such as replacing 'T' in vector<T>. There are a few aspects to this:

- Extend TemplateArgument to allow arbitrary expressions (an
Expr*), and switch ClassTemplateSpecializationType to store
TemplateArguments rather than it's own type-or-expression
representation.

- ClassTemplateSpecializationType can now store dependent types. In
that case, the canonical type is another
ClassTemplateSpecializationType (with default template arguments
expanded) rather than a declaration (we don't build Decls for
dependent types).

- Split ActOnClassTemplateId into ActOnClassTemplateId (called from
the parser) and CheckClassTemplateId (called from
ActOnClassTemplateId and InstantiateType). They're smart enough to
handle dependent types, now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66509 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
ype.cpp
ypeSerialization.cpp
40808ce6ac04b102c3b56244a635d6b98eed6d97 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for ClassTemplateSpecializationTypes,
such as replacing 'T' in vector<T>. There are a few aspects to this:

- Extend TemplateArgument to allow arbitrary expressions (an
Expr*), and switch ClassTemplateSpecializationType to store
TemplateArguments rather than it's own type-or-expression
representation.

- ClassTemplateSpecializationType can now store dependent types. In
that case, the canonical type is another
ClassTemplateSpecializationType (with default template arguments
expanded) rather than a declaration (we don't build Decls for
dependent types).

- Split ActOnClassTemplateId into ActOnClassTemplateId (called from
the parser) and CheckClassTemplateId (called from
ActOnClassTemplateId and InstantiateType). They're smart enough to
handle dependent types, now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66509 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
ype.cpp
ypeSerialization.cpp
a2c97df8ac195681e0a0976138daa63fd1df9c91 05-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Moved CollectObjCIvars to more commonly available place
for future use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66184 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
88e469cf4240d4b898eacc0ad092019b022e0e50 05-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Moved CollectObjCIvars to more commonly available place
for future use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66184 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c309adee68d2bf896d62a62257a9e1c73f2da041 05-Mar-2009 Chris Lattner <sabre@nondot.org> rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.
Introduce a new PrettyStackTraceDecl.
Use it to add the top level LLVM IR generation stuff in
Backend.cpp to stack traces. We now get crashes like:

Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
Abort

for IR generation crashes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66153 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
49f28ca787d8db7cac3c8898334f70ea55374c98 05-Mar-2009 Chris Lattner <sabre@nondot.org> rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.
Introduce a new PrettyStackTraceDecl.
Use it to add the top level LLVM IR generation stuff in
Backend.cpp to stack traces. We now get crashes like:

Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
Abort

for IR generation crashes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66153 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
16ded577897389958dd317b6c743b046ecad77fd 04-Mar-2009 Chris Lattner <sabre@nondot.org> Switch attributes to be allocated from the declcontext bump pointer just like
decls. This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66023 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0b2b6e1cb1573bb295c0a65813dc4df8d57f305b 04-Mar-2009 Chris Lattner <sabre@nondot.org> Switch attributes to be allocated from the declcontext bump pointer just like
decls. This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66023 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0fc6d64bb2d40359557cf2ba7dc1c19aeb39ca02 04-Mar-2009 Chris Lattner <sabre@nondot.org> add an a Attr::Destroy method and force clients to go through it. As part of
this, make DeclBase::Destroy destroy attributes instead of the DeclBase dtor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66020 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
cc5814732edc0c382d0136ab57ec6149566043e2 04-Mar-2009 Chris Lattner <sabre@nondot.org> add an a Attr::Destroy method and force clients to go through it. As part of
this, make DeclBase::Destroy destroy attributes instead of the DeclBase dtor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66020 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
d540c115b24af3e5bd17f1b49b0b8bd9af2c6b33 04-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor cleanup for choose expressions: add a helper that returns the
chosen sub-expression, rather than just evaluating the condition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66018 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
7976932a1c256d447316ffac58e9821417725e34 04-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor cleanup for choose expressions: add a helper that returns the
chosen sub-expression, rather than just evaluating the condition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66018 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
daac694b37c04664d2626d708c1faf3458cf4fce 04-Mar-2009 Chris Lattner <sabre@nondot.org> Change Parser::ParseCaseStatement to use an iterative approach to parsing
multiple sequential case statements instead of doing it with recursion. This
fixes a problem where we run out of stack space parsing 100K directly nested
cases.

There are a couple other problems that prevent this from being useful in
practice (right now the example only parses correctly with -disable-free and
doesn't work with -emit-llvm), but this is a start.

I'm not including a testcase because it is large and uninteresting for
regtesting.

Sebastian, I would appreciate it if you could scrutinize the smart pointer
gymnastics I do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66011 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtSerialization.cpp
24e1e707b4c362f18e371e2bbf054a8345b57bfa 04-Mar-2009 Chris Lattner <sabre@nondot.org> Change Parser::ParseCaseStatement to use an iterative approach to parsing
multiple sequential case statements instead of doing it with recursion. This
fixes a problem where we run out of stack space parsing 100K directly nested
cases.

There are a couple other problems that prevent this from being useful in
practice (right now the example only parses correctly with -disable-free and
doesn't work with -emit-llvm), but this is a start.

I'm not including a testcase because it is large and uninteresting for
regtesting.

Sebastian, I would appreciate it if you could scrutinize the smart pointer
gymnastics I do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66011 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtSerialization.cpp
0e8b96abd2515a746cefe47cbc92feacc8c5b841 03-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6640991> Exception handling executes wrong clause (Daniel, please verify).

Also necessary to fix:

<rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements
<rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65964 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
7ba138abd329e591a8f6d5001f60dd7082f71b3b 03-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6640991> Exception handling executes wrong clause (Daniel, please verify).

Also necessary to fix:

<rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements
<rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65964 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
ed3a398adc9a7745c2acc3fa0ad4a906149ef2de 03-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Implement the basics of implicit instantiation of class templates, in
response to attempts to diagnose an "incomplete" type. This will force
us to use DiagnoseIncompleteType more regularly (rather than looking at
isIncompleteType), but that's also a good thing.

Implicit instantiation is still very simplistic, and will create a new
definition for the class template specialization (as it should) but it
only actually instantiates the base classes and attaches
those. Actually instantiating class members will follow.

Also, instantiate the types of non-type template parameters before
checking them, allowing, e.g.,

template<typename T, T Value> struct Constant;

to work properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65924 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
2943aed177b33ae3f14273b11a7b398e5276ec62 03-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement the basics of implicit instantiation of class templates, in
response to attempts to diagnose an "incomplete" type. This will force
us to use DiagnoseIncompleteType more regularly (rather than looking at
isIncompleteType), but that's also a good thing.

Implicit instantiation is still very simplistic, and will create a new
definition for the class template specialization (as it should) but it
only actually instantiates the base classes and attaches
those. Actually instantiating class members will follow.

Also, instantiate the types of non-type template parameters before
checking them, allowing, e.g.,

template<typename T, T Value> struct Constant;

to work properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65924 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7d6220ca4a53b38673473fd461ff8e983d22225e 02-Mar-2009 Chris Lattner <sabre@nondot.org> improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3daed52a57d03765223021f5f921bdc280c8f3cc 02-Mar-2009 Chris Lattner <sabre@nondot.org> improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
e6b5d1d42712aaf3652b84e433c0488abe2cc193 02-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65792 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6393519272ce727f4d26e71bbefb5de712274d0e 02-Mar-2009 Douglas Gregor <dgregor@apple.com> Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65792 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
98e71b8a4d881646713af99a63c610544ae0b517 01-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6619539> incompatible pointer types sending 'XCElementSpacer *', expected 'XCElement *' (not handling protocol signatures correctly?).

- Reworked ASTContext::canAssignObjCInterfaces().
- Added ObjCProtocolDecl::lookupProtocolNamed().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
91b0b0cf6b537cbcbca0038c7032f87161a41d31 01-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6619539> incompatible pointer types sending 'XCElementSpacer *', expected 'XCElement *' (not handling protocol signatures correctly?).

- Reworked ASTContext::canAssignObjCInterfaces().
- Added ObjCProtocolDecl::lookupProtocolNamed().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
d23d9922e00dd86aab5349208a00c8ea52b556a7 01-Mar-2009 Daniel Dunbar <daniel@zuster.org> ObjCAtCatchStmt's ParamStmt is always a DeclStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65759 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
93b2bdb866d49e3dab4623a822db281042e87382 01-Mar-2009 Daniel Dunbar <daniel@zuster.org> ObjCAtCatchStmt's ParamStmt is always a DeclStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65759 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
649b3da43473314f383e8dc091905f287e54c59f 28-Feb-2009 Chris Lattner <sabre@nondot.org> "This patch addresses two FIXME on ObjCCategoryImplDecl:

/// FIXME: Like ObjCImplementationDecl, this should not be a NamedDecl!
/// FIXME: Introduce a new common base class for ObjCImplementationDecl and ObjCCategoryImplDecl

It adds an IndentifierInfo ivar to the ObjCCategoryImplDecl, so it can inherits from Decl and not NamedDecl (I'm not sure about the memory management of this ivar).

And now that both ObjCImplementationDecl and ObjCCategoryImplDecl have the same super classes, it allow creation of a common base class: ObjCImplDecl"

Patch by Jean-Daniel Dupas!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65703 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3aa1861bd8b5121e53379b1a00f9d6ad8dead4f6 28-Feb-2009 Chris Lattner <sabre@nondot.org> "This patch addresses two FIXME on ObjCCategoryImplDecl:

/// FIXME: Like ObjCImplementationDecl, this should not be a NamedDecl!
/// FIXME: Introduce a new common base class for ObjCImplementationDecl and ObjCCategoryImplDecl

It adds an IndentifierInfo ivar to the ObjCCategoryImplDecl, so it can inherits from Decl and not NamedDecl (I'm not sure about the memory management of this ivar).

And now that both ObjCImplementationDecl and ObjCCategoryImplDecl have the same super classes, it allow creation of a common base class: ObjCImplDecl"

Patch by Jean-Daniel Dupas!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65703 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c8ea931cafa03cb30aef5782ceadc9033f040fb2 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix obvious shortcoming in the implementations of Evaluate for
integer __real__ and __imag__. Not sure how I missed this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65677 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
722c717cd833e410ca6e7976d78baea16995e0c4 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix obvious shortcoming in the implementations of Evaluate for
integer __real__ and __imag__. Not sure how I missed this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65677 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2e0475984442f3da3e8359ca453d430ba7b2b2d1 28-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate CXXRecordType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65671 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeSerialization.cpp
c1efaecf0373f1a55c5ef4c234357cf726fc0600 28-Feb-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXRecordType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65671 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeSerialization.cpp
94fcc9a2997d8ae6d7781c46117f67e10e548f27 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix enumeration in switch warnings, plus misc comment changes. No
behavior change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65658 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix enumeration in switch warnings, plus misc comment changes. No
behavior change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65658 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
44d1f40f4fbd4475b0b1ac4f1b2bc49c5f6b1d8f 27-Feb-2009 Mike Stump <mrs@apple.com> Silence warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65644 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5e301007e31e14c8ff647288e1b8bd8dbf8a5fe4 27-Feb-2009 Mike Stump <mrs@apple.com> Silence warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65644 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
342d943fa54d78948ac52237dafdba3629618f42 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Change the AST generated for offsetof a bit so that it looks like a
normal expression, and change Evaluate and IRGen to evaluate it like a
normal expression. This simplifies the code significantly, and fixes
PR3396.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65622 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
35183aca180a2b9b2c637cd625a40a7e147d6a32 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Change the AST generated for offsetof a bit so that it looks like a
normal expression, and change Evaluate and IRGen to evaluate it like a
normal expression. This simplifies the code significantly, and fixes
PR3396.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65622 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
25cb1b60eba5d3496f64cdb61802cd397da407de 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Some minor improvements to Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65613 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
664a104ba0b8f47b8908ec6af694d9646adba1fc 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Some minor improvements to Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65613 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d65bbbc62de1245df180bbea4ed810e940a88c64 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Make isICE assert when Evaluate can't evaluate an ICE, as suggested by
Daniel. Some minor fixes/cleanup. Allow __builtin_choose_expr,
__real__, and __imag__ in ICEs, following gcc's example.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65610 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
60ce9635b969d17ff1bbe269deff5ec3c6b1bc06 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Make isICE assert when Evaluate can't evaluate an ICE, as suggested by
Daniel. Some minor fixes/cleanup. Allow __builtin_choose_expr,
__real__, and __imag__ in ICEs, following gcc's example.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65610 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
399ad18ab33ae2ed66eb190d5c7b86539af64a5c 27-Feb-2009 Mike Stump <mrs@apple.com> The middle operand in ?: is optional, really.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65609 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
befbcf4e02756f252d1263774ef2249f0921c1c9 27-Feb-2009 Mike Stump <mrs@apple.com> The middle operand in ?: is optional, really.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65609 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4fa58905062efa6a12137b1983a1367220182a20 27-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.

Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.

As part of this, some types have been renamed:

TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
ecl.cpp
eclCXX.cpp
tmtPrinter.cpp
ype.cpp
ypeSerialization.cpp
72564e73277e29f6db3305d1f27ba408abb7ed88 27-Feb-2009 Douglas Gregor <dgregor@apple.com> Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.

Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.

As part of this, some types have been renamed:

TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
ecl.cpp
eclCXX.cpp
tmtPrinter.cpp
ype.cpp
ypeSerialization.cpp
e1dafe76b68e5bf05446411b7edb71b0ccb6f126 27-Feb-2009 Chris Lattner <sabre@nondot.org> make ASTContext::WCharTy a bit more sensical. In C++, it is a disctint type,
but in C99 it is just another int type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65590 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3a2503227c3db04a3619735127483263c1075ef7 27-Feb-2009 Chris Lattner <sabre@nondot.org> make ASTContext::WCharTy a bit more sensical. In C++, it is a disctint type,
but in C99 it is just another int type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65590 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b1fe04714a3f2088fadcdfb7fbd451c487946cfa 27-Feb-2009 Chris Lattner <sabre@nondot.org> ok, not as broken as I thought, just confusing. This allows
initialization of wchar_t arrays with wide strings, and generalizes
wchar_size.c to work on all targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65586 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
19753cfa6059b237880a91f21ef58f2d8984845f 27-Feb-2009 Chris Lattner <sabre@nondot.org> ok, not as broken as I thought, just confusing. This allows
initialization of wchar_t arrays with wide strings, and generalizes
wchar_size.c to work on all targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65586 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f321228d3d67a629a79cc2665b4de86b3990ba58 27-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Do not issue bogus error on __weak/__strong ivar access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65583 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
fb41ca86eeede2fce02933034cf8b6e5aea84b79 27-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Do not issue bogus error on __weak/__strong ivar access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65583 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
9c7825b737617339724d43bd04960852271f08e2 26-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Make the type associated with a ClassTemplateSpecializationDecl be a
nicely sugared type that shows how the user wrote the actual
specialization. This sugared type won't actually show up until we
start doing instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65577 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclTemplate.cpp
ype.cpp
fc705b84347e6fb4746a1a7e26949f64c2f2f358 26-Feb-2009 Douglas Gregor <dgregor@apple.com> Make the type associated with a ClassTemplateSpecializationDecl be a
nicely sugared type that shows how the user wrote the actual
specialization. This sugared type won't actually show up until we
start doing instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65577 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclTemplate.cpp
ype.cpp
fc096bf9d87834466e82482f99b1f6fe7e02bf2a 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::hasPointerRepresentation predicate.
- For types whose native representation is a pointer.

- Use to replace ExprConstant.cpp:HasPointerEvalType,
CodeGenFunction::isObjCPointerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65569 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8958891f5fa1e593c4519a36b3df427ee019d70b 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::hasPointerRepresentation predicate.
- For types whose native representation is a pointer.

- Use to replace ExprConstant.cpp:HasPointerEvalType,
CodeGenFunction::isObjCPointerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65569 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
554af94c53e3a182233fc4fb0f374a9eb3ae6bf6 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Remove PointerLikeType.
- Having pointers and references share a base was not a useful
notion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65567 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
68694ada8f4d8f6c4b00ea5b900df96428b28fc8 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Remove PointerLikeType.
- Having pointers and references share a base was not a useful
notion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65567 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6fdb28daa0eec6739149b82c275c5720009d628f 26-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make more AST nodes and semantic checkers dependent-expression-aware.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65529 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
2850784bda09416fc7e9d57f5baa36c9351c757c 26-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make more AST nodes and semantic checkers dependent-expression-aware.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65529 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
0ba24847de48e340185fbf8a3da84bde905fbc9a 26-Feb-2009 Steve Naroff <snaroff@apple.com> Fix ObjCInterfaceDecl::lookupInstanceMethod()/lookupClassMethod() to search in inherited protocols.

Also changed ObjCInterfaceDecl::lookupClassMethod() to look through a categories protocols.

Test/patch submitted by Jean-Daniel Dupas (thanks!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65526 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b558422a49dbf97d560e493fb1573d44f0abe221 26-Feb-2009 Steve Naroff <snaroff@apple.com> Fix ObjCInterfaceDecl::lookupInstanceMethod()/lookupClassMethod() to search in inherited protocols.

Also changed ObjCInterfaceDecl::lookupClassMethod() to look through a categories protocols.

Test/patch submitted by Jean-Daniel Dupas (thanks!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65526 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c092e034fba242320b91392f8ce5f8a625462c02 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Remove short-circuit evaluation and the extension warnings. I'm
pretty sure we want to keep constant expression verification outside of
Evaluate. Because of that, the short-circuit evaluation doesn't
generally make sense, and the comma warning doesn't make sense in its
current form.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65525 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
33ef1456a19779fb15c51aea362bd9c7cb4087f3 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Remove short-circuit evaluation and the extension warnings. I'm
pretty sure we want to keep constant expression verification outside of
Evaluate. Because of that, the short-circuit evaluation doesn't
generally make sense, and the comma warning doesn't make sense in its
current form.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65525 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7beeda668f26e78f4d194319958fbf042bb1697a 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Rewrite of isIntegerConstantExpr to be centered around Evaluate. This
is a rather big change, but I think this is the direction we want to go;
the code is significantly shorter now, and it doesn't duplicate Evaluate
code. There shouldn't be any visible changes as far as I know.

There has been some movement towards putting ICE handling into
Evaluate (for example, VerifyIntegerConstantExpression uses Evaluate
instead of isICE). This patch is sort of the opposite of the approach,
making ICE handling work without Evaluate being aware of it. I think
this approach is better because it separates the code that does the
constant evaluation from code that's calculating a rather
arbitrary predicate.

The one thing I don't really like about this patch is that
the handling of commas in C99 complicates it signficantly. (Seriously,
what was the standards committee thinking when they wrote that
part?) I think I've come up with a decent approach, but it doesn't feel
ideal. I might add some way to check for evaluated commas from Evaluate
in a subsequent patch; that said, it might not be worth bothering.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65524 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e28d7195aad595154130ac8d03cc6c6513ece1bf 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Rewrite of isIntegerConstantExpr to be centered around Evaluate. This
is a rather big change, but I think this is the direction we want to go;
the code is significantly shorter now, and it doesn't duplicate Evaluate
code. There shouldn't be any visible changes as far as I know.

There has been some movement towards putting ICE handling into
Evaluate (for example, VerifyIntegerConstantExpression uses Evaluate
instead of isICE). This patch is sort of the opposite of the approach,
making ICE handling work without Evaluate being aware of it. I think
this approach is better because it separates the code that does the
constant evaluation from code that's calculating a rather
arbitrary predicate.

The one thing I don't really like about this patch is that
the handling of commas in C99 complicates it signficantly. (Seriously,
what was the standards committee thinking when they wrote that
part?) I think I've come up with a decent approach, but it doesn't feel
ideal. I might add some way to check for evaluated commas from Evaluate
in a subsequent patch; that said, it might not be worth bothering.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65524 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d8472f22f74c9000293ee31856bdec3e3ff92188 26-Feb-2009 Mike Stump <mrs@apple.com> Fixup spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65519 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
54cc43fd6687a0e7db06b6e0ae6602d86fe09e37 26-Feb-2009 Mike Stump <mrs@apple.com> Fixup spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65519 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1db12931d4f1d1815e80ced651c5ca6a86c1d990 26-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Use RecordFirst/RecordLast range checks in DeclContext

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65489 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
65100792a69a16895bd80f1d639b99e7ad903386 26-Feb-2009 Douglas Gregor <dgregor@apple.com> Use RecordFirst/RecordLast range checks in DeclContext

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65489 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0d93f69b8f742e1172f65b5843c15c51216d89f0 25-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Perform additional semantic checking of class template
specializations. In particular:

- Make sure class template specializations have a "template<>"
header, and complain if they don't.
- Make sure class template specializations are declared/defined
within a valid context. (e.g., you can't declare a specialization
std::vector<MyType> in the global namespace).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65476 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
88b7094185b9d4fe9820c731b6936d8d37f6143e 25-Feb-2009 Douglas Gregor <dgregor@apple.com> Perform additional semantic checking of class template
specializations. In particular:

- Make sure class template specializations have a "template<>"
header, and complain if they don't.
- Make sure class template specializations are declared/defined
within a valid context. (e.g., you can't declare a specialization
std::vector<MyType> in the global namespace).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65476 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0c281a89b43f1e71e906d8b9733c2eb0303e87dc 25-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Implement parsing of nested-name-specifiers that involve template-ids, e.g.,

std::vector<int>::allocator_type

When we parse a template-id that names a type, it will become either a
template-id annotation (which is a parsed representation of a
template-id that has not yet been through semantic analysis) or a
typename annotation (where semantic analysis has resolved the
template-id to an actual type), depending on the context. We only
produce a type in contexts where we know that we only need type
information, e.g., in a type specifier. Otherwise, we create a
template-id annotation that can later be "upgraded" by transforming it
into a typename annotation when the parser needs a type. This occurs,
for example, when we've parsed "std::vector<int>" above and then see
the '::' after it. However, it means that when writing something like
this:

template<> class Outer::Inner<int> { ... };

We have two tokens to represent Outer::Inner<int>: one token for the
nested name specifier Outer::, and one template-id annotation token
for Inner<int>, which will be passed to semantic analysis to define
the class template specialization.

Most of the churn in the template tests in this patch come from an
improvement in our error recovery from ill-formed template-ids.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65467 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
39a8de10c18365bde7062d8959b7ed525449c561 25-Feb-2009 Douglas Gregor <dgregor@apple.com> Implement parsing of nested-name-specifiers that involve template-ids, e.g.,

std::vector<int>::allocator_type

When we parse a template-id that names a type, it will become either a
template-id annotation (which is a parsed representation of a
template-id that has not yet been through semantic analysis) or a
typename annotation (where semantic analysis has resolved the
template-id to an actual type), depending on the context. We only
produce a type in contexts where we know that we only need type
information, e.g., in a type specifier. Otherwise, we create a
template-id annotation that can later be "upgraded" by transforming it
into a typename annotation when the parser needs a type. This occurs,
for example, when we've parsed "std::vector<int>" above and then see
the '::' after it. However, it means that when writing something like
this:

template<> class Outer::Inner<int> { ... };

We have two tokens to represent Outer::Inner<int>: one token for the
nested name specifier Outer::, and one template-id annotation token
for Inner<int>, which will be passed to semantic analysis to define
the class template specialization.

Most of the churn in the template tests in this patch come from an
improvement in our error recovery from ill-formed template-ids.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65467 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
1f88aa7eb94035348cc67f3071d5882ae4853a3f 25-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65460 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2224f84658fb9b3725a31f2680edb64ae73bf705 25-Feb-2009 Douglas Gregor <dgregor@apple.com> C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65460 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c5d3263682ab5aa9d7f0b7cb3a46200f6ea23287 24-Feb-2009 Chris Lattner <sabre@nondot.org> first wave of fixes for @encode sema support. This is part of PR3648.

The big difference here is that (like string literal) @encode has
array type, not pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
eaf2bb89eb2aad3b80673de30febe52df43c10ec 24-Feb-2009 Chris Lattner <sabre@nondot.org> first wave of fixes for @encode sema support. This is part of PR3648.

The big difference here is that (like string literal) @encode has
array type, not pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
1c52c63c8a4d5e809b76299d201f8bd4dda392d4 24-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d6f7e9dccd0fa8a5a15d7478324c0ae229fc5e1e 24-Feb-2009 Douglas Gregor <dgregor@apple.com> When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
af6820210f1dcee448b3a0edfdd3d5717d0f5953 24-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Improve merging of function declarations. Specifically:

- When we are declaring a function in local scope, we can merge with
a visible declaration from an outer scope if that declaration
refers to an entity with linkage. This behavior now works in C++
and properly ignores entities without linkage.
- Diagnose the use of "static" on a function declaration in local
scope.
- Diagnose the declaration of a static function after a non-static
declaration of the same function.
- Propagate the storage specifier to a function declaration from a
prior declaration (PR3425)
- Don't name-mangle "main"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
04495c859f81e440748a9b86baa2913461652bb0 24-Feb-2009 Douglas Gregor <dgregor@apple.com> Improve merging of function declarations. Specifically:

- When we are declaring a function in local scope, we can merge with
a visible declaration from an outer scope if that declaration
refers to an entity with linkage. This behavior now works in C++
and properly ignores entities without linkage.
- Diagnose the use of "static" on a function declaration in local
scope.
- Diagnose the declaration of a static function after a non-static
declaration of the same function.
- Propagate the storage specifier to a function declaration from a
prior declaration (PR3425)
- Don't name-mangle "main"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2224fb2a5e9f13c36ef1ccbaece050af6900bc22 23-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> We should not generate __weak write barrier on indirect reference
of a pointer to object; This patch does this odd behavior according to
gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65334 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
207c5210eb0ac7b632609f0c006eb97ef2738948 23-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> We should not generate __weak write barrier on indirect reference
of a pointer to object; This patch does this odd behavior according to
gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65334 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6805fc44a1b5179f6390a160c807dfb4480d7138 23-Feb-2009 Steve Naroff <snaroff@apple.com> Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.

Remove support for "Class<P>". Will be making this an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65332 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
ype.cpp
d461777e23204fe8c480302d8ff76f5847605da6 23-Feb-2009 Steve Naroff <snaroff@apple.com> Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.

Remove support for "Class<P>". Will be making this an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65332 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
ype.cpp
51e57e62680fd0bb25a579dac7e5ba7c5c9d0a39 23-Feb-2009 Chris Lattner <sabre@nondot.org> Add copy assignment operator, caught by doug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65331 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
01011d4e4d6d5146f58233a508509757382d62c3 23-Feb-2009 Chris Lattner <sabre@nondot.org> Add copy assignment operator, caught by doug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65331 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a63aaeb32fc8e76142f68fad1b343965725765fd 23-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A few small improvements to Evaluate for stuff I noted in FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65305 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
91110ee24e3475e0a3a38938c7b98439b5cf0b0e 23-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A few small improvements to Evaluate for stuff I noted in FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65305 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d85ba92f4127367a1d025f50089ae8e1d464dcc0 22-Feb-2009 Steve Naroff <snaroff@apple.com> Contains the following (related to problems found while investigting <rdar://problem/6497631> Message lookup is sometimes different than gcc's).

- Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default).
- Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol).
- Changed several test cases to jive with the above changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65292 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
0de21fd85d79bccd32f04256f5b3328ab5ed7c95 22-Feb-2009 Steve Naroff <snaroff@apple.com> Contains the following (related to problems found while investigting <rdar://problem/6497631> Message lookup is sometimes different than gcc's).

- Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default).
- Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol).
- Changed several test cases to jive with the above changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65292 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
0c195b98f48e29dd5bc19747d9736769b9585e43 22-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> More objc gc work. Match gcc's treatment of ivar access
true a local pointer to objective-c object in generating
write barriers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65290 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
44baa8abba2a1552b6b50bf750a8750ab9da9f76 22-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> More objc gc work. Match gcc's treatment of ivar access
true a local pointer to objective-c object in generating
write barriers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65290 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2207decdf6cbf15f9056fd39d5d2cfbeebbe276e 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A bit of Evaluate cleanup. Also, a full audit of what's missing that
someone would reasonably expect Evaluate to handle for C/ObjC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65284 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2217c87bdc5ab357046a5453bdb06f469c41024e 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A bit of Evaluate cleanup. Also, a full audit of what's missing that
someone would reasonably expect Evaluate to handle for C/ObjC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65284 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2f6d70d4cd843423f27af0df5a58d751ae80f36a 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Enhance Evaluate to handle ObjC qualified id and class types; as far as
I know, these follow the exact same rules as pointers, so I just made
them use the same codepath. Someone more familiar with ObjC should
double-check this, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65261 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
4bdf08770e75a068de2430e21a43b381aeb13b95 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Enhance Evaluate to handle ObjC qualified id and class types; as far as
I know, these follow the exact same rules as pointers, so I just made
them use the same codepath. Someone more familiar with ObjC should
double-check this, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65261 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
b1c0b54de78296f723c77d46f61d25576d4a30d0 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3433: map __alignof__ to preferred alignment. (This was
partially done in r65258.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65260 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c508203a278f6a9238fff46ae1f025b4b402b233 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3433: map __alignof__ to preferred alignment. (This was
partially done in r65258.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65260 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0ee57327d817db68d680849b1dcb3f27142eaa93 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Improvements to ASTContext::getDeclAlignInBytes; fixes the testcase in
PR3254 and part of PR3433.

The isICE changes are necessary to keep the computed results
consistent with Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65258 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
dcdafb6a701aa9d81edcb088915f58933315dc05 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Improvements to ASTContext::getDeclAlignInBytes; fixes the testcase in
PR3254 and part of PR3433.

The isICE changes are necessary to keep the computed results
consistent with Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65258 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
858c64de654cb0c6bb3610b9938d0d4d714ed05d 22-Feb-2009 Anders Carlsson <andersca@mac.com> Correctly encode incomplete and variable length arrays. Fixes PR3639.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65255 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
559a83330416affb0e341a2c53800cbf924a5178 22-Feb-2009 Anders Carlsson <andersca@mac.com> Correctly encode incomplete and variable length arrays. Fixes PR3639.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65255 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d305a86f087fd359cf0f033eba0c968e55a61ff4 21-Feb-2009 Steve Naroff <snaroff@apple.com> More work to integrate newly added ObjCQualifiedClassType into the type system.

This is necessary 'plumbing' to fix <rdar://problem/6497631> Message lookup is sometimes different than gcc's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65248 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f7f52e7bf5a4dc36d45b98531e0b21e343fc19de 21-Feb-2009 Steve Naroff <snaroff@apple.com> More work to integrate newly added ObjCQualifiedClassType into the type system.

This is necessary 'plumbing' to fix <rdar://problem/6497631> Message lookup is sometimes different than gcc's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65248 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
262a5dd7735667460dc4fcf0bef0b5df0ef5335e 21-Feb-2009 Steve Naroff <snaroff@apple.com> Add support for GCC ObjC extension "Class<protocol>". Sigh.

Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's.

Will never be seen in user code. Needed to pass dejagnu testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65244 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
15509f4fe73f0e11a8cec602bce4d99d9454b7f6 21-Feb-2009 Steve Naroff <snaroff@apple.com> Add support for GCC ObjC extension "Class<protocol>". Sigh.

Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's.

Will never be seen in user code. Needed to pass dejagnu testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65244 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c69da2796596a2c22bd2ebe573338c13924e24dc 21-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed an ICE in meta-data generation of __weak/__strong ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65235 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
86f938b3d4a79fb9c337d351c8f3e5f1ff18f1b6 21-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed an ICE in meta-data generation of __weak/__strong ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65235 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b5c66dbc585d26603ceb9893828807f702802195 21-Feb-2009 Daniel Dunbar <daniel@zuster.org> Evaluation of unary deref could call integer evaluator on non-integral
expr; hilarity ensued.
- PR3640.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4fff4819a913c65ae23cfd389bc47c61919e4e1f 21-Feb-2009 Daniel Dunbar <daniel@zuster.org> Evaluation of unary deref could call integer evaluator on non-integral
expr; hilarity ensued.
- PR3640.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2353613c34bdf4bf1052e29049317f9ea774ebd8 21-Feb-2009 Cédric Venet <cedric.venet@laposte.net> Fix build on windows.

Should clang have a config.h or should we use the config.h of llvm or using the preprocessor is OK? I did a quick fix here, but having a guideline on how to handle non portable function would be great (or ask ted to stop breaking the windows build :)).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65233 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
61490e9a965cfee8a78c12c6802138844f04250d 21-Feb-2009 Cedric Venet <cedric.venet@laposte.net> Fix build on windows.

Should clang have a config.h or should we use the config.h of llvm or using the preprocessor is OK? I did a quick fix here, but having a guideline on how to handle non portable function would be great (or ask ted to stop breaking the windows build :)).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65233 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0bbc135a8d04570e8709ebd6b672eaa8e6fc9269 21-Feb-2009 Steve Naroff <snaroff@apple.com> This fixes <rdar://problem/6497650> More type mismatches issues with clang.

Move two key ObjC typechecks from Sema::CheckPointerTypesForAssignment() to ASTContext::mergeTypes().

This allows us to take advantage of the recursion in ASTContext::mergeTypes(), removing some bogus warnings.

This test case I've added includes an example where we still warn (and GCC doesn't). Need to talk with folks and decide what to do. At this point, the major bogosities should be fixed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65231 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5fd659db11922fc12a58e478f7b745f9656b15a7 21-Feb-2009 Steve Naroff <snaroff@apple.com> This fixes <rdar://problem/6497650> More type mismatches issues with clang.

Move two key ObjC typechecks from Sema::CheckPointerTypesForAssignment() to ASTContext::mergeTypes().

This allows us to take advantage of the recursion in ASTContext::mergeTypes(), removing some bogus warnings.

This test case I've added includes an example where we still warn (and GCC doesn't). Need to talk with folks and decide what to do. At this point, the major bogosities should be fixed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65231 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cf6c8288d8e8cf38ee0229b9bcedd8a4ec6f47b3 20-Feb-2009 Chris Lattner <sabre@nondot.org> allocate and dellocate objc decl list through AST Context instead of
with new/delete. With disable-free, this reduces the number of 4/8 byte
mallocs from 4793/1541 to 865/456 and also drops other sizes as well.

This is a very small perf win, nothing major.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65171 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4ee413ba81c8030c195a9166847928054ed01ca4 20-Feb-2009 Chris Lattner <sabre@nondot.org> allocate and dellocate objc decl list through AST Context instead of
with new/delete. With disable-free, this reduces the number of 4/8 byte
mallocs from 4793/1541 to 865/456 and also drops other sizes as well.

This is a very small perf win, nothing major.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65171 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
df6133ba4bc02ffe030dc3941c67514aa837b773 20-Feb-2009 Chris Lattner <sabre@nondot.org> add plumbing to get ASTContext& down to allocation/deallocation points in ObjCList,
but don't start using it yet. Renamed some methods to be more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65168 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
38af2deb27cdfa1a95bde96e30dab15dce53fcef 20-Feb-2009 Chris Lattner <sabre@nondot.org> add plumbing to get ASTContext& down to allocation/deallocation points in ObjCList,
but don't start using it yet. Renamed some methods to be more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65168 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
217eb8c5fedfc5d09f1bae91231beae4751d75cd 20-Feb-2009 Chris Lattner <sabre@nondot.org> newly factored, we can now move the set and destroy methods out of line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65166 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
11e1e1af2641affb378080a4f3d1a30da1cad082 20-Feb-2009 Chris Lattner <sabre@nondot.org> newly factored, we can now move the set and destroy methods out of line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65166 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c3e7268152d8ca4380bda809e0b833b6c5f82138 20-Feb-2009 Chris Lattner <sabre@nondot.org> rename ObjCList::clear() -> ObjCList::Destroy(). Require that destroy is called
before the dtor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65156 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
88cf7a16902a9189d16653e1061cfda333187b58 20-Feb-2009 Chris Lattner <sabre@nondot.org> rename ObjCList::clear() -> ObjCList::Destroy(). Require that destroy is called
before the dtor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65156 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
13f63609691b1ee6c92488b9ac7b26dbb570fc8f 20-Feb-2009 Chris Lattner <sabre@nondot.org> rearrange the contents of DeclObjC to be by-class. Fix some 80 column issues
and other non-semantic changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65155 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ab35163a5b80bf1bd49f0eebb708970f2b0e04e9 20-Feb-2009 Chris Lattner <sabre@nondot.org> rearrange the contents of DeclObjC to be by-class. Fix some 80 column issues
and other non-semantic changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65155 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e0275ff15d4a4f4c4b995e9d2159ffcbc34b87b2 20-Feb-2009 Chris Lattner <sabre@nondot.org> destroy should forward to base class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65151 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
077e0f09d12a4bd61908863df35528de1cd80c53 20-Feb-2009 Chris Lattner <sabre@nondot.org> destroy should forward to base class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65151 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
97e84d6d5c44ee7fbe193b3b2d514e8c0375dfa8 20-Feb-2009 Chris Lattner <sabre@nondot.org> move the @implementation ivar list to being an ObjCList, which prevents
it from being leaked, among other things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65150 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7a21bd046fe57629ab074980cf8193f5e0c15735 20-Feb-2009 Chris Lattner <sabre@nondot.org> move the @implementation ivar list to being an ObjCList, which prevents
it from being leaked, among other things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65150 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
5c6b2c638375da5002f93373e5e0f890d300aeb9 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove some more methods from objc decls, using the iterator
interfaces more consistently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65138 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
89951a86b594513c2a013532ed45d197413b1087 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove some more methods from objc decls, using the iterator
interfaces more consistently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65138 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5661100a651be23e7e53b19e396e8bad4bf066ed 20-Feb-2009 Daniel Dunbar <daniel@zuster.org> Handle constant int -> ptr casts of lvalue results.
- PR3463 (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65133 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
69ab26a8623141f35e86817cfc6e0fbe7639a40f 20-Feb-2009 Daniel Dunbar <daniel@zuster.org> Handle constant int -> ptr casts of lvalue results.
- PR3463 (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65133 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
179fd52ebca8c731636da35184ab2dc7954b1aeb 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove some slow O(n) methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65132 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
cafeb35117578585dbbfef0bc79d8aa27712bc0e 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove some slow O(n) methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65132 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ad446cf86babeb52874440c55bb76cdce97d6259 20-Feb-2009 Chris Lattner <sabre@nondot.org> Change ObjCForwardProtocolDecl to use an ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65131 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
07fa7749da805969f2ed467a4eb5b405a4ff9a23 20-Feb-2009 Chris Lattner <sabre@nondot.org> Change ObjCForwardProtocolDecl to use an ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65131 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6a02874b20e4b3e5a23f4550a5fa782ffab357b5 20-Feb-2009 Chris Lattner <sabre@nondot.org> move the interace list of @class to use ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65129 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
67956052ea5fb0cd7f443de96a11f9a0176dc681 20-Feb-2009 Chris Lattner <sabre@nondot.org> move the interace list of @class to use ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65129 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
38d2ff2bf79635fefb284bf95ab93dd249786b2a 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove a dead list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65127 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4a323d94e50c8f570cbfaf0392e68215b8ca87bf 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove a dead list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65127 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9408eb1b33ae4bef17163a644df6fad8624de469 20-Feb-2009 Chris Lattner <sabre@nondot.org> switch ObjCMethodDecl's parameter list from being explicitly managed to an ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65114 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2073216a1075767b5d25c23d1462b7034686d94d 20-Feb-2009 Chris Lattner <sabre@nondot.org> switch ObjCMethodDecl's parameter list from being explicitly managed to an ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65114 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
922132e4500f7bc481ea95a00de8355074b30621 20-Feb-2009 Chris Lattner <sabre@nondot.org> switch the interface ivar list from being explicitly managed to using ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65113 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e881483a3bc22ffad62367501aa09ad8508fe363 20-Feb-2009 Chris Lattner <sabre@nondot.org> switch the interface ivar list from being explicitly managed to using ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65113 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3e27e63d1253ab116c7ef19e0191c1d8af5b8231 20-Feb-2009 Chris Lattner <sabre@nondot.org> move more objc destruction out of dtors into Destroy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65112 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0b7ebb3dba0df0a6cbf221e5edbc6a4b8848478c 20-Feb-2009 Chris Lattner <sabre@nondot.org> move more objc destruction out of dtors into Destroy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65112 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ae53888f057b48a4a51bf1f496bdcc05ebf461cf 20-Feb-2009 Chris Lattner <sabre@nondot.org> move some objc decl destruction out of dtors into Destroy method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65111 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
411280e5b25ba7dcd7c8a82a5c23880fe7632a3c 20-Feb-2009 Chris Lattner <sabre@nondot.org> move some objc decl destruction out of dtors into Destroy method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65111 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3dc50edaad4e0c154f6f17f39f68ab31ab65c9bb 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A few small tweaks to isConstantInitializer. (No test because this
isn't getting used by Sema or CodeGen at the moment...)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65107 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1f4a6db271f389d6ab3cb1bc28cb5c23a7828602 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A few small tweaks to isConstantInitializer. (No test because this
isn't getting used by Sema or CodeGen at the moment...)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65107 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
dbd0a9bb30fa5776530256b12ca82f88a528d53c 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Add support for * (unary dereference) operator to ExprConstant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65105 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e8761c8fe2ee6b628104a0885f49fd3c21c08a4f 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Add support for * (unary dereference) operator to ExprConstant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65105 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
77820d5775ba6c7b3050b77b6b1a71dde4da592b 20-Feb-2009 Chris Lattner <sabre@nondot.org> optimize the 'StoredDeclsMap' for the common case where there is
exactly one decl with a specific name in a specific context. This
avoids a bunch of malloc traffic and shrinks StoredDeclsMap to hold
one pointer instead of 3 words (for a std::vector).

This speeds up -fsyntax-only on cocoa.h with PTH by ~7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65103 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
67762a35dca6202d2272db02d0b8740728e3aa8f 20-Feb-2009 Chris Lattner <sabre@nondot.org> optimize the 'StoredDeclsMap' for the common case where there is
exactly one decl with a specific name in a specific context. This
avoids a bunch of malloc traffic and shrinks StoredDeclsMap to hold
one pointer instead of 3 words (for a std::vector).

This speeds up -fsyntax-only on cocoa.h with PTH by ~7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65103 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0366a817efb45bc3b3f0c2cee07d436c3f1a4ef4 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> ExprConstant handling for a couple more cases of pointer-to-int casts
from the testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65098 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
be26570e3faa009bdcefedfaf04473e518940520 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> ExprConstant handling for a couple more cases of pointer-to-int casts
from the testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65098 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ba589d42bcc085fa72844f3fc36a9868583fe813 20-Feb-2009 Chris Lattner <sabre@nondot.org> make the redeclaration case faster for the common instance of a redeclaration
where there is exactly one existing declaration. This is common.

this speeds up clang about 3% on cocoa.h for me 0.165 -> 0.160s


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65096 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
bdc3d0034d5b637b211abd01a936267df27118cc 20-Feb-2009 Chris Lattner <sabre@nondot.org> make the redeclaration case faster for the common instance of a redeclaration
where there is exactly one existing declaration. This is common.

this speeds up clang about 3% on cocoa.h for me 0.165 -> 0.160s


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65096 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
5360207688a1da76fdf4c166c5bbb820bd9d247c 20-Feb-2009 Chris Lattner <sabre@nondot.org> 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65095 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
7f0be13b435ad110f99af83a24a50f43225f3083 20-Feb-2009 Chris Lattner <sabre@nondot.org> 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65095 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
265f01d8260270e9ad24c5e7ba3228e402af63f9 20-Feb-2009 Chris Lattner <sabre@nondot.org> slight code simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65094 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
91942501b6f71a41d3a09bedec19be479832c718 20-Feb-2009 Chris Lattner <sabre@nondot.org> slight code simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65094 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
07e928edf4504d3f325b1498bdc4a03732e826a9 20-Feb-2009 Chris Lattner <sabre@nondot.org> pretty printing vector types should print the element type, not just the attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65078 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
08eddd946628718e1832d98fc292610252c78a62 20-Feb-2009 Chris Lattner <sabre@nondot.org> pretty printing vector types should print the element type, not just the attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65078 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
bbd4ca9a66275d821312cea898ce05d2d80c57f4 20-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> More objc's gc ir-gen stuff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65077 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a223cca7751637f8ec1a860010c4148757fb4752 20-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> More objc's gc ir-gen stuff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65077 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c9967f911cd3080bd10cb65a36c9dcf268c82406 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Extend Evaluate() to fold (int) <pointer type>.
- PR3463, PR3398, <rdar://problem/6553401> crash on relocatable
symbol addresses as constants in static locals.

- There are many more scenarious we could handle (like arithmetic on
such an int) but this is the main use case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65074 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
dd2116462ae311043986ae8b7fba27e68c1b2e66 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Extend Evaluate() to fold (int) <pointer type>.
- PR3463, PR3398, <rdar://problem/6553401> crash on relocatable
symbol addresses as constants in static locals.

- There are many more scenarious we could handle (like arithmetic on
such an int) but this is the main use case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65074 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6dda4ba874f7a10ea7bfcd5e23fa90b883b839cb 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Simplify, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65073 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b92dac8bc2f6f73919825f9af693a8a7e89ae1d4 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Simplify, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65073 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ae93d65fa7478040fffc73e3fa11181b527c7aa2 19-Feb-2009 Mike Stump <mrs@apple.com> Add enough checking to ensure that non-constant block literals don't
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtSerialization.cpp
b83d287bc7f47d36fb0751a481e2ef9308b37252 19-Feb-2009 Mike Stump <mrs@apple.com> Add enough checking to ensure that non-constant block literals don't
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
tmtSerialization.cpp
f2dc6757798df93e9dee3ed11560596cb8596661 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Change IntExprEvaluator to operate on an APValue not an APSInt.
- Prep for handling lvalues, no intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65063 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
30c37f4d2ee5811e85f692c22fb67d74ddc88079 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Change IntExprEvaluator to operate on an APValue not an APSInt.
- Prep for handling lvalues, no intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65063 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
470c0b2bfe2303cadb7298c9b5c6f85cdecea294 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add another IntExprEvaluator::Success overload to suck up remained of
manual setting of the Result.

- Idiom now enforces that result will always have correct width and
type; this exposed three new bugs:

o Enum constant decl value can have different width than type
(PR3173).

o EvaluateInteger should not run an IntExprEvaluator over
non-integral expressions.

o FloatExprEvaluate was not handling casts correctly (it was
evaluating the cast in the IntExprEvaluator!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65053 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3f7d995390009fede92b333a040da80e1ce90997 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add another IntExprEvaluator::Success overload to suck up remained of
manual setting of the Result.

- Idiom now enforces that result will always have correct width and
type; this exposed three new bugs:

o Enum constant decl value can have different width than type
(PR3173).

o EvaluateInteger should not run an IntExprEvaluator over
non-integral expressions.

o FloatExprEvaluate was not handling casts correctly (it was
evaluating the cast in the IntExprEvaluator!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65053 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3f7a8f19e231b74ff3d94754b420ea4eb2107afd 19-Feb-2009 Chris Lattner <sabre@nondot.org> Fix PR3619 by properly considering size modifiers and type quals when
uniquing array types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65046 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0be2ef2321b1283ead38ebeb83b451335d90e0fe 19-Feb-2009 Chris Lattner <sabre@nondot.org> Fix PR3619 by properly considering size modifiers and type quals when
uniquing array types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65046 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f91896e82012c14258c7943e3c4fa0919895304b 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add IntExprEvaluator::Success method.
- Handles assignment to Result with appropriate type.

- Simplifies & encapsulates most direct handling of the Result value;
prep for allowing IntExprEvaluator to deal with LValue APValues.

- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65038 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
131eb438d8c216b2e2a4f8fa8158ea88b787dc14 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add IntExprEvaluator::Success method.
- Handles assignment to Result with appropriate type.

- Simplifies & encapsulates most direct handling of the Result value;
prep for allowing IntExprEvaluator to deal with LValue APValues.

- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65038 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
11a31c902ba609eec9991a48eb7a86b13e65d77f 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::getAsFunctionNoProto


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65031 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
afa74448a07a16c3146accbe0ff03e9c8b0995e5 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::getAsFunctionNoProto


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65031 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
33837c5b4937dce888cde378908eec4311c1f518 19-Feb-2009 Chris Lattner <sabre@nondot.org> only do one DenseMap lookup instead of two (one to find out if there is
already an entry and one to insert).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65030 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f82328852c80a51b36a146de6ef5fd5b15e72c37 19-Feb-2009 Chris Lattner <sabre@nondot.org> only do one DenseMap lookup instead of two (one to find out if there is
already an entry and one to insert).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65030 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a15ff6d8f40a1f9187ecc5bf5507ea0f1501b0e1 19-Feb-2009 Chris Lattner <sabre@nondot.org> minor simplification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65029 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ba1bd5c54d941d682ac7e946a51604f05cf470e7 19-Feb-2009 Chris Lattner <sabre@nondot.org> minor simplification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65029 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
6719b1f85ab5f2927cd6664845ce1e8336d5c6df 19-Feb-2009 Chris Lattner <sabre@nondot.org> use early exit to reduce indentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65028 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
bd6c80037626a37ce3936a36d9ae287f475845b7 19-Feb-2009 Chris Lattner <sabre@nondot.org> use early exit to reduce indentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65028 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ca8de5d93ceda29bfa8a50b9665ac4f47bea8610 19-Feb-2009 Chris Lattner <sabre@nondot.org> fix warning in no-assert mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65024 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
8a778d6c95b1f937e3158c638793ad06c14e6a37 19-Feb-2009 Chris Lattner <sabre@nondot.org> fix warning in no-assert mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65024 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
4fbb52cc2183a8f4a7a91a07fe1aebf9e979b132 19-Feb-2009 Anders Carlsson <andersca@mac.com> Handle the GNU void* and function pointer arithmetic extensions for constant expressions as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65013 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4d4c50dd8b4db191c38782414665fb7608315a36 19-Feb-2009 Anders Carlsson <andersca@mac.com> Handle the GNU void* and function pointer arithmetic extensions for constant expressions as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65013 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d55240e3f5beb7a9f08b4cbdebb6811530f7c286 19-Feb-2009 Mike Stump <mrs@apple.com> More codegen for blocks. The type of block literals should be better.
The size calculation is improved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64994 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bd65cac8de63d108a681035782a71d42954b03ab 19-Feb-2009 Mike Stump <mrs@apple.com> More codegen for blocks. The type of block literals should be better.
The size calculation is improved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64994 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d9b85c3422d18737d8ff36f95edeafa1a99004c4 18-Feb-2009 Chris Lattner <sabre@nondot.org> minor name changes, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64972 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
3b6b83b8311ecdfa43cbb37ccc38c107d3b8d88b 18-Feb-2009 Chris Lattner <sabre@nondot.org> minor name changes, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64972 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
18b5a9a3396fa4bb6630c5bea19399b101aa3043 18-Feb-2009 Chris Lattner <sabre@nondot.org> fix some subtle bugs handling the mix of cvr qualifiers, addr spaces,
and gc attrs. Add an assert to check that we never
get ExtQualType(ExtQualType(T)).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64970 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b7d2553edd2532d29b98b9e76bcf6a62bc48b417 18-Feb-2009 Chris Lattner <sabre@nondot.org> fix some subtle bugs handling the mix of cvr qualifiers, addr spaces,
and gc attrs. Add an assert to check that we never
get ExtQualType(ExtQualType(T)).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64970 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1fc4791c3be994d661401a4ce134831ba442ebc2 18-Feb-2009 Chris Lattner <sabre@nondot.org> rip out __builtin_overload


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64961 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
1e4db7c468c002c58f07e059ff7925384f053e85 18-Feb-2009 Chris Lattner <sabre@nondot.org> rip out __builtin_overload


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64961 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
b8ca6ff810e0131a6d6c5cc9875ec10c416e9970 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Some refactoring and simplificaiotn of objc's gc
ir gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64954 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4fd83ea566f4a0c083001c84b75da6cc8c99c1d6 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Some refactoring and simplificaiotn of objc's gc
ir gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64954 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5b601ff13049ad6ba07d62b89c1e864dd43e7db7 18-Feb-2009 Mike Stump <mrs@apple.com> Codegen for int (^bp)(int) = 0;


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64951 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ca2f3fdeedc4e4beea4f7572d6d975188d0bb5ef 18-Feb-2009 Mike Stump <mrs@apple.com> Codegen for int (^bp)(int) = 0;


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64951 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c61a8003b2c69add9fca0ec5064b47251f47c90c 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::isSpecificBuiltinType as a shortcut.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64946 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e00d5c00f35163308a18ec1d3d2b9dfa1ecaf234 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::isSpecificBuiltinType as a shortcut.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64946 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2c49963298fba3836a81bfa77b348e67e340a4ee 18-Feb-2009 Chris Lattner <sabre@nondot.org> teach child iterators to walk into the child string of an ObjCStringLiteral,
so it shows up in -ast-dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64901 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c6c16af963eddc3e9b75b5d2614d069e1162fe27 18-Feb-2009 Chris Lattner <sabre@nondot.org> teach child iterators to walk into the child string of an ObjCStringLiteral,
so it shows up in -ast-dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64901 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
aa491196c84d3707be32ad06f19c18bfcfbef21a 18-Feb-2009 Chris Lattner <sabre@nondot.org> privatize all of the string literal memory allocation/creation
stuff behind a private static function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64898 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
2085fd6cd22ec5c268175251db10d7c60caf7aaa 18-Feb-2009 Chris Lattner <sabre@nondot.org> privatize all of the string literal memory allocation/creation
stuff behind a private static function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64898 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
c314474f0e1eb9b9e3c541dbc068b6cc95c74e2c 18-Feb-2009 Chris Lattner <sabre@nondot.org> change the StringLiteral AST node to track all of the SourceLocations of
the various PPTokens that are pasted together to make it. In the course
of working on this, I discovered ParseObjCStringLiteral which needs some
work. I'll tackle it next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64892 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
726e168dc09fb23f53c7b004f8e919421ee91806 18-Feb-2009 Chris Lattner <sabre@nondot.org> change the StringLiteral AST node to track all of the SourceLocations of
the various PPTokens that are pasted together to make it. In the course
of working on this, I discovered ParseObjCStringLiteral which needs some
work. I'll tackle it next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64892 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
af23809cb5b961cd4624785e94f339e0a0f5f49e 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Representation of objc gc's attribute using ExtQualType.
Note that one test attr-objc-gc.m fails. I will fix this
after removing these attributes from the Decl nodes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64889 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Representation of objc gc's attribute using ExtQualType.
Note that one test attr-objc-gc.m fails. I will fix this
after removing these attributes from the Decl nodes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64889 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
168b20c6e43a58ef05e68201766d293ea9d1af95 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.

Add assert to isICE that, on success, result must be the same as
EvaluateAsInt()... this enforces a minimum level of sanity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64865 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2d6744ff04c1690a1485178d550d2fab84a0270b 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.

Add assert to isICE that, on success, result must be the same as
EvaluateAsInt()... this enforces a minimum level of sanity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64865 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7458f4aee446f752337b6832ec9f52d87c173d30 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Convert isIntegerConstantExpr to use ASTContext::MakeIntValue.
- This idiom ensures that the result will have the right width and
type.

- Tested on most of x86_64/llvm-test to satisfy my paranoia.

- This fixes at least the following bugs:
o UnaryTypeTraitExpr wasn't setting the width correctly.
o Arithmetic on _Bool wasn't setting the width correctly.

And probably a number more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64864 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a135975d4257ccc83f13b607b29d882bb00c80b6 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Convert isIntegerConstantExpr to use ASTContext::MakeIntValue.
- This idiom ensures that the result will have the right width and
type.

- Tested on most of x86_64/llvm-test to satisfy my paranoia.

- This fixes at least the following bugs:
o UnaryTypeTraitExpr wasn't setting the width correctly.
o Arithmetic on _Bool wasn't setting the width correctly.

And probably a number more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64864 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8360a9cbcf4054a8fb43bde1e50951e1e4b48f73 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
with Expr::Evaluate().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64850 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprConstant.cpp
c87a282e7b80c055088fc51bdbe8fc73da64d4f8 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collide
with Expr::Evaluate().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64850 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
xprConstant.cpp
a08b6c79bf6fc9efef2ae2db8b747bac60ee0fae 18-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Implement basic parsing and semantic analysis for explicit
specialization of class templates, e.g.,

template<typename T> class X;

template<> class X<int> { /* blah */ };

Each specialization is a different *Decl node (naturally), and can
have different members. We keep track of forward declarations and
definitions as for other class/struct/union types.

This is only the basic framework: we still have to deal with checking
the template headers properly, improving recovery when there are
failures, handling nested name specifiers, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64848 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
cc636688c4fd10b1732ce3e33b2b106024d545ca 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Implement basic parsing and semantic analysis for explicit
specialization of class templates, e.g.,

template<typename T> class X;

template<> class X<int> { /* blah */ };

Each specialization is a different *Decl node (naturally), and can
have different members. We keep track of forward declarations and
definitions as for other class/struct/union types.

This is only the basic framework: we still have to deal with checking
the template headers properly, improving recovery when there are
failures, handling nested name specifiers, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64848 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclTemplate.cpp
96d1f1b90da45ccb875227429c26f85728c7e4c6 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> Eek! getDeclAlign sometimes returned alignment in bits.
- Renamed to getDeclAlignInBytes since most other query functions
work in bits.

- Fun to track down as isIntegerConstantExpr was getting it right,
but Evaluate() was getting it wrong. Maybe we should assert they
compute the same thing when they succeed?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64828 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
b7d0844c887a72064b624dc6df12cbe1441f69d0 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> Eek! getDeclAlign sometimes returned alignment in bits.
- Renamed to getDeclAlignInBytes since most other query functions
work in bits.

- Fun to track down as isIntegerConstantExpr was getting it right,
but Evaluate() was getting it wrong. Maybe we should assert they
compute the same thing when they succeed?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64828 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
1e124fe3e31ab37c45b6fbe6a8075e987fc04408 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Simplified ExtQualType per Chris's feedback.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64820 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
4886a4204ff2b20bc226ce70d837de5fcd4a79ab 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Simplified ExtQualType per Chris's feedback.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64820 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
bc1f2a636fb123de01a3b158f0c74d416ef681cf 17-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move DeclContext::getParent and getLexicalParent in-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64806 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
305ec42f971a2b3e114eb35256c23e955c497a1c 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move DeclContext::getParent and getLexicalParent in-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64806 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a7ff77e157d703df3530dd57e9cbbac3a6a57a9d 17-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64805 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8c7250b7badebbf143d6372b6b4ab8ad2867cecc 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Currently all DeclContexts are Decls as well; use cast<Decl> instead of dyn_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64805 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
96e79bfae502212f22148a4ae4fae85244373245 17-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> All Decls have a DeclContext now, hooray! Fans of consistency rejoice.

Pass the DeclContext to ObjCIvarDecls as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64801 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0c00aac5d618f39afc406c5b2e07642930af1d56 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> All Decls have a DeclContext now, hooray! Fans of consistency rejoice.

Pass the DeclContext to ObjCIvarDecls as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64801 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
dae66edc49dc2ebbb32377e33012fc3a168c5a4e 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Added support for objc's gc attribute in ExtQualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64800 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
59d16d1402d76a298ab7fc5f362e9d3dfd744aa5 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Added support for objc's gc attribute in ExtQualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64800 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
b60352aa80d17026f445267940db558ab9cfb92e 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ASQualType to ExtQualType to reflect its more
general use; as for, objc2's gc type attributes. No
change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64778 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
ype.cpp
ypeSerialization.cpp
f11284ac87daa613bc7b30db9f54bd716d123222 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ASQualType to ExtQualType to reflect its more
general use; as for, objc2's gc type attributes. No
change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64778 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
ype.cpp
ypeSerialization.cpp
4d6b10281bd79f4e45894923b85e0d37f63da82a 17-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Static variables and functions won't collide with standard library
functions, so if we're declaring a static we should implicitly declare
a library function by the same name (e.g., malloc, strdup). Fixes PR3592.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64736 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9add31798f621f843233dbff8bba103fca64447b 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Static variables and functions won't collide with standard library
functions, so if we're declaring a static we should implicitly declare
a library function by the same name (e.g., malloc, strdup). Fixes PR3592.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64736 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ad964b3c41f4fc5fb7e19a0ce28b200e137bab84 17-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Added ClassTemplateSpecializationDecl, which is a subclass of
CXXRecordDecl that is used to represent class template
specializations. These are canonical declarations that can refer to
either an actual class template specialization in the code, e.g.,

template<> class vector<bool> { };

or to a template instantiation. However, neither of these features is
actually implemented yet, so really we're just using (and uniqing) the
declarations to make sure that, e.g., A<int> is a different type from
A<float>. Note that we carefully distinguish between what the user
wrote in the source code (e.g., "A<FLOAT>") and the semantic entity it
represents (e.g., "A<float, int>"); the former is in the sugared Type,
the latter is an actual Decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64716 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclTemplate.cpp
3e00bad490f1bae8a2c60f934e7eb5dbb9752c5d 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Added ClassTemplateSpecializationDecl, which is a subclass of
CXXRecordDecl that is used to represent class template
specializations. These are canonical declarations that can refer to
either an actual class template specialization in the code, e.g.,

template<> class vector<bool> { };

or to a template instantiation. However, neither of these features is
actually implemented yet, so really we're just using (and uniqing) the
declarations to make sure that, e.g., A<int> is a different type from
A<float>. Note that we carefully distinguish between what the user
wrote in the source code (e.g., "A<FLOAT>") and the semantic entity it
represents (e.g., "A<float, int>"); the former is in the sugared Type,
the latter is an actual Decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64716 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclTemplate.cpp
20d4c8879df261120e39aba5f2845d0300a1890a 16-Feb-2009 Daniel Dunbar <daniel@zuster.org> Unbreak clang.

Doug: please verify that it is expected that LastIdx can be less that
NumInits. And perhaps add a comment so that Chris doesn't break your
code. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64688 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f592c929bd1f083abcc8199b24bb825fdd28df1c 16-Feb-2009 Daniel Dunbar <daniel@zuster.org> Unbreak clang.

Doug: please verify that it is expected that LastIdx can be less that
NumInits. And perhaps add a comment so that Chris doesn't break your
code. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64688 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b6eccdcc9a28643083e634de4af7b70f048d9cd4 16-Feb-2009 Chris Lattner <sabre@nondot.org> fix long lines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64684 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
xpr.cpp
ranslationUnit.cpp
d603eaa682cecac2c10771a700cb83aa301653b4 16-Feb-2009 Chris Lattner <sabre@nondot.org> fix long lines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64684 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
xpr.cpp
ranslationUnit.cpp
98e7fcc0d68043d6f132afcdf4783682b30e42f2 16-Feb-2009 Chris Lattner <sabre@nondot.org> introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64681 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2140e904dbe53657339cb5b1cc13de563ca0d1fc 16-Feb-2009 Chris Lattner <sabre@nondot.org> introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64681 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6bc0f2d51006967e675e4eabeba55f8ec57ab6a8 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Use isa<...> instead of dyn_cast<...> where result is not needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64680 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
225dfd7d6b0ed14e6b7ad8dc121161b9f34ecfce 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Use isa<...> instead of dyn_cast<...> where result is not needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64680 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2e8a7aa7c15274813f876f4b2ca6ce38382c56c4 16-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
b1152d842c6599e41581302a85a0f53928253add 16-Feb-2009 Douglas Gregor <dgregor@apple.com> Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
9467504efa145d1ad5d0f5bb5ef3660322a4fa7b 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in property type encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64672 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bb99bdec7d3e704485baffae85938d24d35f0e0f 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in property type encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64672 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
beae78eb8dac8bc954e89d17f9c7fe55faba8981 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionally
the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64657 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a5afdd0ef9ff4a7a3f26145b6536a84dd340c897 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionally
the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64657 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
715e8481aaefa26594ce6b1f613e7e9c8a66c5c6 16-Feb-2009 Chris Lattner <sabre@nondot.org> wrap long lines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64650 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d6eed1cb06016d2e41f9dba4b794f52696415eec 16-Feb-2009 Chris Lattner <sabre@nondot.org> wrap long lines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64650 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
981aa13b401965bcfa5c0d052d07d15e379fd90d 16-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> DeclContext had its "casting machinery" inside the class definition so that if a new declaration context Decl appeared, the necessary changes
would be in one place. Since, now, only DeclNodes.def needs to be modified, move things out-of-line and simplify the DeclContext class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64630 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3d7641e090cf113dec64306a1597d3e4523e2a55 16-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> DeclContext had its "casting machinery" inside the class definition so that if a new declaration context Decl appeared, the necessary changes
would be in one place. Since, now, only DeclNodes.def needs to be modified, move things out-of-line and simplify the DeclContext class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64630 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
2d9b76174a00679c24428d95893c993b445bb067 16-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Make DeclContexts maintenance a bit easier.

-In DeclNodes.def, only mark as DeclContexts the top classes that directly derive from DeclContext. If the Decl has subclasses,
it should be marked with DECL_CONTEXT_BASE.

-Use DeclNodes.def to automate the DeclContext::classof and DeclContext::CastTo definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64629 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1ad4dd78ec53c24ea9e752b216035d7aa666fe49 16-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make DeclContexts maintenance a bit easier.

-In DeclNodes.def, only mark as DeclContexts the top classes that directly derive from DeclContext. If the Decl has subclasses,
it should be marked with DECL_CONTEXT_BASE.

-Use DeclNodes.def to automate the DeclContext::classof and DeclContext::CastTo definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64629 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
e917498ae544653beaf03ebe678116e277ad4452 15-Feb-2009 Chris Lattner <sabre@nondot.org> fix build on systems where uint64_t != unsigned long long


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64605 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
736166b38235cf6d0ffb67638960d95fb2afcbd6 15-Feb-2009 Chris Lattner <sabre@nondot.org> fix build on systems where uint64_t != unsigned long long


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64605 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bff577a72da26402e401298a8531f1965d2ec568 15-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fix pasto noticed by Anders Johnsen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64595 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
e86999055974002cf213bae1a1a9f734773a6d8e 15-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fix pasto noticed by Anders Johnsen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64595 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
23d232614940858972080d808959f0645318f74e 14-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64566 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
3573c0c0b44a1ac8f76a00af1bc75e94ca03d704 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64566 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
27ecc6736fbd9a91a710a40719d68934370a700f 14-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64563 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f3710babc1ba40779c0fc64e6657cfc84dee7545 14-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64563 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b5af738b7338a799a7885b1fe2eebdba858b96cb 14-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
3c385e5f8d9008fff18597ca302be19fa86e51f6 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprConstant.cpp
c47ed4ab909515b4ba1d3630b8327e8d98743b4a 14-Feb-2009 Cédric Venet <cedric.venet@laposte.net> Fix the build on win32.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64556 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
ea684e699ea84e61711e279f5fa7a1b9f3d46bc2 14-Feb-2009 Cedric Venet <cedric.venet@laposte.net> Fix the build on win32.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64556 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
d2c6655c7ca33f6985a6b73db0ad7c65d1cf5fae 14-Feb-2009 Chris Lattner <sabre@nondot.org> Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
of its result.
3) extend isUnusedResultAWarning to directly return the loc and range
info that should be reported to the user. Make it substantially more
precise in some cases than what was previously reported.
4) teach isUnusedResultAWarning about CallExpr to decls that are
pure/const/warnunusedresult, fixing a fixme.
5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
pass in integers and use %select.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64543 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
026dc96ac6ece60da5e1b98e2a71bd0ff0939fd8 14-Feb-2009 Chris Lattner <sabre@nondot.org> Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
of its result.
3) extend isUnusedResultAWarning to directly return the loc and range
info that should be reported to the user. Make it substantially more
precise in some cases than what was previously reported.
4) teach isUnusedResultAWarning about CallExpr to decls that are
pure/const/warnunusedresult, fixing a fixme.
5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
pass in integers and use %select.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64543 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1fa246d43b7a24a18ac4f37e83b962277e6ebbb3 14-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
370ab3f1373841d70582feac9e35c3c6b3489f63 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
17429039570353adb36354bd873240d037f09343 14-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

- fprintf and vfprintf: the builtins mechanism cannot (yet)
express FILE* arguments, so these can't be encoded.
- NSLog: the builtins mechanism cannot (yet) express NSString*
arguments, so this (and NSLogv) can't be encoded.
- asprintf and vasprintf: these aren't part of the C99 standard
library, so we really shouldn't be defining them as builtins in
the general case (and we don't seem to have the machinery to make
them builtins only on certain targets and depending on whether
extensions are enabled).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64512 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
a316e7b735b12ce6b34961a9dcfaae34f4b08d29 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

- fprintf and vfprintf: the builtins mechanism cannot (yet)
express FILE* arguments, so these can't be encoded.
- NSLog: the builtins mechanism cannot (yet) express NSString*
arguments, so this (and NSLogv) can't be encoded.
- asprintf and vasprintf: these aren't part of the C99 standard
library, so we really shouldn't be defining them as builtins in
the general case (and we don't seem to have the machinery to make
them builtins only on certain targets and depending on whether
extensions are enabled).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64512 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
411889e15e0335f6951d2410c5bd67839c4fff66 14-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
3e41d60eb627dc227c770f1c1c87d06909cf05fd 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
fb0cac21679fcc724c2c0c1f67fe4deed77e3639 13-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Remove DeclGroupOwningRef, since we intend for declarations to be owned
by DeclContexts (always) rather than by statements.

DeclContext currently goes out of its way to avoid destroying any
Decls that might be owned by a DeclGroupOwningRef. However, in an
error-recovery situation, a failure in a declaration statement can
cause all of the decls in a DeclGroupOwningRef to be destroyed after
they've already be added into the DeclContext. Hence, DeclContext is
left with already-destroyed declarations, and bad things happen. This
problem was causing failures that showed up as assertions on x86 Linux
in test/Parser/objc-forcollection-neg-2.m.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64474 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eclGroup.cpp
tmt.cpp
tmtSerialization.cpp
9653db7bd0e3665b955a0445859285f2e1e7dacd 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Remove DeclGroupOwningRef, since we intend for declarations to be owned
by DeclContexts (always) rather than by statements.

DeclContext currently goes out of its way to avoid destroying any
Decls that might be owned by a DeclGroupOwningRef. However, in an
error-recovery situation, a failure in a declaration statement can
cause all of the decls in a DeclGroupOwningRef to be destroyed after
they've already be added into the DeclContext. Hence, DeclContext is
left with already-destroyed declarations, and bad things happen. This
problem was causing failures that showed up as assertions on x86 Linux
in test/Parser/objc-forcollection-neg-2.m.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64474 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eclGroup.cpp
tmt.cpp
tmtSerialization.cpp
ff3fcdf47370a4577d971a2adefd259807152078 13-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Initial implementation of arbitrary fixed-width integer types.
Currently only used for 128-bit integers.

Note that we can't use the fixed-width integer types for other integer
modes without other changes because glibc headers redefines (u)int*_t
and friends using the mode attribute. For example, this means that uint64_t
has to be compatible with unsigned __attribute((mode(DI))), and
uint64_t is currently defined to long long. And I have a feeling we'll
run into issues if we try to define uint64_t as something which isn't
either long or long long.

This doesn't get the alignment right in most cases, including
the 128-bit integer case; I'll file a PR shortly. The gist of the issue
is that the targets don't really expose the information necessary to
figure out the alignment outside of the target description, so there's a
non-trivial amount of work involved in getting it working right. That
said, the alignment used is conservative, so the only issue with the
current implementation is ABI compatibility.

This makes it trivial to add some sort of "bitwidth" attribute to make
arbitrary-width integers; I'll do that in a followup.

We could also use this for stuff like the following for compatibility
with gcc, but I have a feeling it would be a better idea for clang to be
consistent between C and C++ modes rather than follow gcc's example for
C mode.
struct {unsigned long long x : 33;} x;
unsigned long long a(void) {return x.x+1;}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64434 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
f98aba35e6c3da5aae61843fc01334939e4e12ec 13-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Initial implementation of arbitrary fixed-width integer types.
Currently only used for 128-bit integers.

Note that we can't use the fixed-width integer types for other integer
modes without other changes because glibc headers redefines (u)int*_t
and friends using the mode attribute. For example, this means that uint64_t
has to be compatible with unsigned __attribute((mode(DI))), and
uint64_t is currently defined to long long. And I have a feeling we'll
run into issues if we try to define uint64_t as something which isn't
either long or long long.

This doesn't get the alignment right in most cases, including
the 128-bit integer case; I'll file a PR shortly. The gist of the issue
is that the targets don't really expose the information necessary to
figure out the alignment outside of the target description, so there's a
non-trivial amount of work involved in getting it working right. That
said, the alignment used is conservative, so the only issue with the
current implementation is ABI compatibility.

This makes it trivial to add some sort of "bitwidth" attribute to make
arbitrary-width integers; I'll do that in a followup.

We could also use this for stuff like the following for compatibility
with gcc, but I have a feeling it would be a better idea for clang to be
consistent between C and C++ modes rather than follow gcc's example for
C mode.
struct {unsigned long long x : 33;} x;
unsigned long long a(void) {return x.x+1;}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64434 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
17c0382b4b42417de088ae2ce467aa74b16fca65 12-Feb-2009 Steve Naroff <snaroff@apple.com> Several cleanups:
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64385 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
389bf46ae41241a656ed71b00ac2177d7f385651 12-Feb-2009 Steve Naroff <snaroff@apple.com> Several cleanups:
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64385 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
09a82e333929cf008567a8dc1ebd499d91efe4e0 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fix va_arg bug noticed by Eli, __builtin_va_arg is not an l-value
designating an object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64371 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
adadd8db2aba32f689e7057d8b7ce004be30685b 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fix va_arg bug noticed by Eli, __builtin_va_arg is not an l-value
designating an object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64371 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e819cafc0493bbdeda9e6af897aaaf9db02ceef3 12-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce _Complex conversions into the function overloading
system. Since C99 doesn't have overloading and C++ doesn't have
_Complex, there is no specification for this. Here's what I think
makes sense.

Complex conversions come in several flavors:

- Complex promotions: a complex -> complex conversion where the
underlying real-type conversion is a floating-point promotion. GCC
seems to call this a promotion, EDG does something else. This is
given "promotion" rank for determining the best viable function.
- Complex conversions: a complex -> complex conversion that is
not a complex promotion. This is given "conversion" rank for
determining the best viable function.
- Complex-real conversions: a real -> complex or complex -> real
conversion. This is given "conversion" rank for determining the
best viable function.

These rules are the same for C99 (when using the "overloadable"
attribute) and C++. However, there is one difference in the handling
of floating-point promotions: in C99, float -> long double and double
-> long double are considered promotions (so we give them "promotion"
rank), while C++ considers these conversions ("conversion" rank).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64343 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
5cdf82164dd7c2b2320d6735c63ace4331e0716d 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Introduce _Complex conversions into the function overloading
system. Since C99 doesn't have overloading and C++ doesn't have
_Complex, there is no specification for this. Here's what I think
makes sense.

Complex conversions come in several flavors:

- Complex promotions: a complex -> complex conversion where the
underlying real-type conversion is a floating-point promotion. GCC
seems to call this a promotion, EDG does something else. This is
given "promotion" rank for determining the best viable function.
- Complex conversions: a complex -> complex conversion that is
not a complex promotion. This is given "conversion" rank for
determining the best viable function.
- Complex-real conversions: a real -> complex or complex -> real
conversion. This is given "conversion" rank for determining the
best viable function.

These rules are the same for C99 (when using the "overloadable"
attribute) and C++. However, there is one difference in the handling
of floating-point promotions: in C99, float -> long double and double
-> long double are considered promotions (so we give them "promotion"
rank), while C++ considers these conversions ("conversion" rank).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64343 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
891559517dab41ea63fffb2402ca6a57fb7e3425 12-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Last @encode'ing fix for objc2's nonfragile abi.
All relevant dejagnu enocding tests pass in this mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64341 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c657eba43f0159bd81227fa0812b92a0b03f00d0 12-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Last @encode'ing fix for objc2's nonfragile abi.
All relevant dejagnu enocding tests pass in this mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64341 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ebd9575dc6bedece5c1ac7d60d7bd0941677f2e7 11-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix encoding in 64bit abi. With this patch
all but one dejagnu encoding tests for darwin
pass in nonfragile abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64334 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
72696e17f90d399448d360cb43aebe5eb2007d4f 11-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix encoding in 64bit abi. With this patch
all but one dejagnu encoding tests for darwin
pass in nonfragile abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64334 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c347d8e05699f9d50ce23c16487c99f9a049fd41 11-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Allow the use of default template arguments when forming a class
template specialization (e.g., std::vector<int> would now be
well-formed, since it relies on a default argument for the Allocator
template parameter).

This is much less interesting than one might expect, since (1) we're
not actually using the default arguments for anything important, such
as naming an actual Decl, and (2) we'll often need to instantiate the
default arguments to check their well-formedness. The real fun will
come later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64310 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
62cb18dd11472965e03374d40bc27d650bc331b6 11-Feb-2009 Douglas Gregor <dgregor@apple.com> Allow the use of default template arguments when forming a class
template specialization (e.g., std::vector<int> would now be
well-formed, since it relies on a default argument for the Allocator
template parameter).

This is much less interesting than one might expect, since (1) we're
not actually using the default arguments for anything important, such
as naming an actual Decl, and (2) we'll often need to instantiate the
default arguments to check their well-formedness. The real fun will
come later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64310 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
e3c19c3cce2d8bdbbb174eff1f887e80b964a18e 11-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> CHAR_BIT == 8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
dedb84afce2cf2e52a6360e200c2c40822022235 11-Feb-2009 Douglas Gregor <dgregor@apple.com> CHAR_BIT == 8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64286 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
b42ab33d86f9b88d2a449b09a8f5458626be4ae1 11-Feb-2009 Mike Stump <mrs@apple.com> Add private extern to pretty printer(s).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64258 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c5840c0e6443085bfc5bb78e01afc1d420c72f44 11-Feb-2009 Mike Stump <mrs@apple.com> Add private extern to pretty printer(s).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64258 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c43f4fc3f18e9ca88ae6a7ea15cfabd110dc2146 10-Feb-2009 Mike Stump <mrs@apple.com> Fixup -ast-print so that:

We handle indentation of decls better.
We Indent extern "C" { } stuff better.
We print out structure contents more often.
We handle pass indentation information into the statement printer, so that
nested things come out more indented.
We print out FieldDecls.
We print out Vars.
We print out namespaces.
We indent functions better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64232 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
071e4da10b07ca5278a7ce9dcabd853e0d57e5a4 10-Feb-2009 Mike Stump <mrs@apple.com> Fixup -ast-print so that:

We handle indentation of decls better.
We Indent extern "C" { } stuff better.
We print out structure contents more often.
We handle pass indentation information into the statement printer, so that
nested things come out more indented.
We print out FieldDecls.
We print out Vars.
We print out namespaces.
We indent functions better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64232 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
fc7dad4a92de30d1b9035761391c58e9f735aa01 10-Feb-2009 Mike Stump <mrs@apple.com> Refactor FieldDecls to be ValueDecls instead of NamedDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64231 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
080cc35364d5bc03885ab0920528e9880f6b439d 10-Feb-2009 Mike Stump <mrs@apple.com> Refactor FieldDecls to be ValueDecls instead of NamedDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64231 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
9225a7e7e87fc7cb22260ae16d5f42ed82f08314 10-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Implement parsing, semantic analysis and ASTs for default template
arguments. This commit covers checking and merging default template
arguments from previous declarations, but it does not cover the actual
use of default template arguments when naming class template
specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64229 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
d684b0027e16163c4bdba3e2f8bfadda7d62a0d3 10-Feb-2009 Douglas Gregor <dgregor@apple.com> Implement parsing, semantic analysis and ASTs for default template
arguments. This commit covers checking and merging default template
arguments from previous declarations, but it does not cover the actual
use of default template arguments when naming class template
specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64229 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
35d81bb3324970c340d63aa9e17c39694dfe2891 10-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Rudimentary checking of template arguments against their corresponding
template parameters when performing semantic analysis of a template-id
naming a class template specialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64185 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
c15cb38a4ff717097b32532fbf761c71b1376a02 10-Feb-2009 Douglas Gregor <dgregor@apple.com> Rudimentary checking of template arguments against their corresponding
template parameters when performing semantic analysis of a template-id
naming a class template specialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64185 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
25cff8326d639b480a59e931fa7b5ea47877f035 09-Feb-2009 Anders Carlsson <andersca@mac.com> id<Foo> is a POD type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64175 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
672c91db00d28187600dd18ef6c524ff45e95ef2 09-Feb-2009 Anders Carlsson <andersca@mac.com> id<Foo> is a POD type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64175 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
362abcd61aeb05a1decfedd6b10f77cfe42034ae 09-Feb-2009 Ted Kremenek <kremenek@apple.com> CallExpr now uses ASTContext's allocate to allocate/delete its array of subexpressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64162 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
668bf91d31265b6ea8c3eb854ba450857701f269 09-Feb-2009 Ted Kremenek <kremenek@apple.com> CallExpr now uses ASTContext's allocate to allocate/delete its array of subexpressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64162 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
6f37b58716e89420c13ac067fe605c3b6d5821d0 09-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate TemplateArg so that we only have a single kind of
representation for template arguments. Also simplifies the interface
for ActOnClassTemplateSpecialization and eliminates some annoying
allocations of TemplateArgs.

My attempt at smart pointers for template arguments lists is
relatively lame. We can improve it once we're sure that we have the
right representation for template arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64154 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
5908e9f25bc9a334c99c095e0b1e6a515445be2d 09-Feb-2009 Douglas Gregor <dgregor@apple.com> Eliminate TemplateArg so that we only have a single kind of
representation for template arguments. Also simplifies the interface
for ActOnClassTemplateSpecialization and eliminates some annoying
allocations of TemplateArgs.

My attempt at smart pointers for template arguments lists is
relatively lame. We can improve it once we're sure that we have the
right representation for template arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64154 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ype.cpp
8e458f48f07276fe279a3d02e709e7ce15b2f9c3 09-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Start processing template-ids as types when the template-name refers
to a class template. For example, the template-id 'vector<int>' now
has a nice, sugary type in the type system. What we can do now:

- Parse template-ids like 'vector<int>' (where 'vector' names a
class template) and form proper types for them in the type system.
- Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,
using (sadly) a bool in the parser to tell it whether '>' should
be treated as an operator or not.

This is a baby-step, with major problems and limitations:
- There are currently two ways that we handle template arguments
(whether they are types or expressions). These will be merged, and,
most likely, TemplateArg will disappear.
- We don't have any notion of the declaration of class template
specializations or of template instantiations, so all template-ids
are fancy names for 'int' :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64153 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
ype.cpp
ypeSerialization.cpp
55f6b14230c94272efbbcdd89a92224c8db9f225 09-Feb-2009 Douglas Gregor <dgregor@apple.com> Start processing template-ids as types when the template-name refers
to a class template. For example, the template-id 'vector<int>' now
has a nice, sugary type in the type system. What we can do now:

- Parse template-ids like 'vector<int>' (where 'vector' names a
class template) and form proper types for them in the type system.
- Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,
using (sadly) a bool in the parser to tell it whether '>' should
be treated as an operator or not.

This is a baby-step, with major problems and limitations:
- There are currently two ways that we handle template arguments
(whether they are types or expressions). These will be merged, and,
most likely, TemplateArg will disappear.
- We don't have any notion of the declaration of class template
specializations or of template instantiations, so all template-ids
are fancy names for 'int' :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64153 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclTemplate.cpp
ype.cpp
ypeSerialization.cpp
3b7ec4be3ab6a5f2c13fb22622456d13b43a1751 09-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Update new expression to make use of Declarator::getSourceRange().
References are not objects; implement this in Type::isObjectType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64152 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
00e68e2cc5ce37cb95beb801cae73c0d1e9dda37 09-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Update new expression to make use of Declarator::getSourceRange().
References are not objects; implement this in Type::isObjectType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64152 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
32d760b509a393c093800d4a2e20fd75ce8aab48 09-Feb-2009 Ted Kremenek <kremenek@apple.com> Deallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the string data before running StringLiteral's destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64146 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
353ffceafc6bcebd5592cb9d93ea3f9242e5370a 09-Feb-2009 Ted Kremenek <kremenek@apple.com> Deallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the string data before running StringLiteral's destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64146 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f1a6712a280fcb40f12117717f58a4ded5fc8649 09-Feb-2009 Ted Kremenek <kremenek@apple.com> Allocate the subexpression array for OberloadExpr from ASTContext's allocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64145 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
fb7413f12636cefa9ebec9abf95804f82c305b11 09-Feb-2009 Ted Kremenek <kremenek@apple.com> Allocate the subexpression array for OberloadExpr from ASTContext's allocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64145 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
410dd8759cb18329806f53ea0a4c1da722cea89d 08-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Teach the constant evaluator about C++ const integral variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64086 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b2bc62bd35129f09d0746ef6a5ef4dc392b6d6e1 08-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Teach the constant evaluator about C++ const integral variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64086 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fd835a2b3701552f49358af9c6d203fafcb1044e 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix pretty-printing of if conditions. Patch by Ben Lickly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64027 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
bfee9b2d909b80ef56b49980665016b9eecacf12 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix pretty-printing of if conditions. Patch by Ben Lickly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64027 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
57ef46ac7d6524e89f4f5e2f20139e3745877a58 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make const-initialized const integral variables I-C-Es in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64015 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4a4251b9e719415f30db0f5170abf31296a62225 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make const-initialized const integral variables I-C-Es in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64015 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0c97e0460148daf132d6623af5b6ff1bc41db649 07-Feb-2009 Ted Kremenek <kremenek@apple.com> Overhaul of Stmt allocation:
- Made allocation of Stmt objects using vanilla new/delete a *compiler
error* by making this new/delete "protected" within class Stmt.
- Now the only way to allocate Stmt objects is by using the new
operator that takes ASTContext& as an argument. This ensures that
all Stmt nodes are allocated from the same (pool) allocator.
- Naturally, these two changes required that *all* creation sites for
AST nodes use new (ASTContext&). This is a large patch, but the
majority of the changes are just this mechanical adjustment.
- The above changes also mean that AST nodes can no longer be
deallocated using 'delete'. Instead, one most do
StmtObject->Destroy(ASTContext&) or do
ASTContextObject.Deallocate(StmtObject) (the latter not running the
'Destroy' method).

Along the way I also...
- Made CompoundStmt allocate its array of Stmt* using the allocator in
ASTContext (previously it used std::vector). There are a whole
bunch of other Stmt classes that need to be similarly changed to
ensure that all memory allocated for ASTs comes from the allocator
in ASTContext.
- Added a new smart pointer ExprOwningPtr to Sema.h. This replaces
the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
'delete' to free memory instead of a Stmt's 'Destroy' method.

Big thanks to Doug Gregor for helping with the acrobatics of making
'new/delete' private and the new smart pointer ExprOwningPtr!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63997 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
tmtSerialization.cpp
8189cde56b4f6f938cd65f53c932fe1860d0204c 07-Feb-2009 Ted Kremenek <kremenek@apple.com> Overhaul of Stmt allocation:
- Made allocation of Stmt objects using vanilla new/delete a *compiler
error* by making this new/delete "protected" within class Stmt.
- Now the only way to allocate Stmt objects is by using the new
operator that takes ASTContext& as an argument. This ensures that
all Stmt nodes are allocated from the same (pool) allocator.
- Naturally, these two changes required that *all* creation sites for
AST nodes use new (ASTContext&). This is a large patch, but the
majority of the changes are just this mechanical adjustment.
- The above changes also mean that AST nodes can no longer be
deallocated using 'delete'. Instead, one most do
StmtObject->Destroy(ASTContext&) or do
ASTContextObject.Deallocate(StmtObject) (the latter not running the
'Destroy' method).

Along the way I also...
- Made CompoundStmt allocate its array of Stmt* using the allocator in
ASTContext (previously it used std::vector). There are a whole
bunch of other Stmt classes that need to be similarly changed to
ensure that all memory allocated for ASTs comes from the allocator
in ASTContext.
- Added a new smart pointer ExprOwningPtr to Sema.h. This replaces
the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
'delete' to free memory instead of a Stmt's 'Destroy' method.

Big thanks to Doug Gregor for helping with the acrobatics of making
'new/delete' private and the new smart pointer ExprOwningPtr!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63997 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmt.cpp
tmtSerialization.cpp
95216a67cc6db599f50a8617f882396396ab07c9 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement dereferencing of pointers-to-member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63983 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
224605064a4ef87d1c3d35ad1cb363f8b534012b 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement dereferencing of pointers-to-member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63983 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d406b034f9f50836d756e3f977845fdb8beaebee 06-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Semantic checking for class template declarations and
redeclarations. For example, checks that a class template
redeclaration has the same template parameters as previous
declarations.

Detangled class-template checking from ActOnTag, whose logic was
getting rather convoluted because it tried to handle C, C++, and C++
template semantics in one shot.

Made some inroads toward eliminating extraneous "declaration does not
declare anything" errors by adding an "error" type specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63973 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
ddc29e116db3c3f4144355e67a0137b38b6bb6d1 06-Feb-2009 Douglas Gregor <dgregor@apple.com> Semantic checking for class template declarations and
redeclarations. For example, checks that a class template
redeclaration has the same template parameters as previous
declarations.

Detangled class-template checking from ActOnTag, whose logic was
getting rather convoluted because it tried to handle C, C++, and C++
template semantics in one shot.

Made some inroads toward eliminating extraneous "declaration does not
declare anything" errors by adding an "error" type specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63973 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.cpp
4f530a9d984c94de4fa6ccf330885f6d05b564a2 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Move StringLiteral to allocate its internal string data using the allocator in
ASTContext. This required changing all clients to pass in the ASTContext& to the
constructor of StringLiteral. I also changed all allocations of StringLiteral to
use new(ASTContext&).

Along the way, I updated a bunch of new()'s in StmtSerialization.cpp to use the
allocator from ASTContext& (not complete).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63958 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
6e94ef5696cfb005d3fc7bbac8dcf7690b64f0a5 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Move StringLiteral to allocate its internal string data using the allocator in
ASTContext. This required changing all clients to pass in the ASTContext& to the
constructor of StringLiteral. I also changed all allocations of StringLiteral to
use new(ASTContext&).

Along the way, I updated a bunch of new()'s in StmtSerialization.cpp to use the
allocator from ASTContext& (not complete).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63958 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
39dc20a0c6a9bf408f706e7273bdb191af8c25c2 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Use ASTContext's allocator to deallocate Stmt objects instead of using 'delete'. This fixes <rdar://problem/6561143>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63905 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
11e5a7f626ddbc67b6e936ed5184fcdfc7ff274b 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Use ASTContext's allocator to deallocate Stmt objects instead of using 'delete'. This fixes <rdar://problem/6561143>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63905 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a491877807202cfb1812f6dcdbb7b992c41ca634 06-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Improve the representation of template type parameters. We now
canonicalize by template parameter depth, index, and name, and the
unnamed version of a template parameter serves as the canonical.

TemplateTypeParmDecl no longer needs to inherit from
TemplateParmPosition, since depth and index information is present
within the type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63899 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclSerialization.cpp
eclTemplate.cpp
ype.cpp
ypeSerialization.cpp
fab9d67cebb87be968e7ae31a3b549a5279b5d51 06-Feb-2009 Douglas Gregor <dgregor@apple.com> Improve the representation of template type parameters. We now
canonicalize by template parameter depth, index, and name, and the
unnamed version of a template parameter serves as the canonical.

TemplateTypeParmDecl no longer needs to inherit from
TemplateParmPosition, since depth and index information is present
within the type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63899 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclSerialization.cpp
eclTemplate.cpp
ype.cpp
ypeSerialization.cpp
2ee5561c01da9cebdc985a003651701b5040c577 05-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix the symptom of the regression, by having the CXXConditionDeclExpr not destroy its Decl.
However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63868 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprCXX.cpp
df2d3cf2be8b91e1e21234ff5a3aa4f820e7001a 05-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix the symptom of the regression, by having the CXXConditionDeclExpr not destroy its Decl.
However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63868 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xprCXX.cpp
279272e63b321f89c8fa0bb198acd3a834459aeb 04-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
eclTemplate.cpp
xpr.cpp
ype.cpp
aaba5e346dffdbad5d1c42765a89e4a7afb0da67 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
eclTemplate.cpp
xpr.cpp
ype.cpp
09be81b04e4e5f8c4c57f952fb6d82dcdbb56b85 04-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Some name-lookup-related fixes, from Piotr Rak!

- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63739 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
47b9a1ca55e61e37f5a368740e29de190345acc6 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Some name-lookup-related fixes, from Piotr Rak!

- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63739 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4646f9c5bcd9e45228412daa99c9fcee58db9676 04-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Fix our semantic analysis of

unqualified-id '('

in C++. The unqualified-id might not refer to any declaration in our
current scope, but declarations by that name might be found via
argument-dependent lookup. We now do so properly.

As part of this change, CXXDependentNameExpr, which was previously
designed to express the unqualified-id in the above constructor within
templates, has become UnresolvedFunctionNameExpr, which does
effectively the same thing but will work for both templates and
non-templates.

Additionally, we cope with all unqualified-ids, since ADL also applies
in cases like

operator+(x, y)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63733 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
17330019f05966762bc952840ef1926b9becb145 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Fix our semantic analysis of

unqualified-id '('

in C++. The unqualified-id might not refer to any declaration in our
current scope, but declarations by that name might be found via
argument-dependent lookup. We now do so properly.

As part of this change, CXXDependentNameExpr, which was previously
designed to express the unqualified-id in the above constructor within
templates, has become UnresolvedFunctionNameExpr, which does
effectively the same thing but will work for both templates and
non-templates.

Additionally, we cope with all unqualified-ids, since ADL also applies
in cases like

operator+(x, y)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63733 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
7a7be65a7801addae8205fd68323cecd70df1635 03-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Semantic analysis, ASTs, and unqualified name lookup support for C++
using directives, from Piotr Rak!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63646 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
eclarationName.cpp
tmtDumper.cpp
2a3009a432bdcec59e6383d7b2b17494d6f91649 03-Feb-2009 Douglas Gregor <dgregor@apple.com> Semantic analysis, ASTs, and unqualified name lookup support for C++
using directives, from Piotr Rak!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63646 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
eclarationName.cpp
tmtDumper.cpp
469fc9a3a0e2278cec1d6ad67f690498ea189475 03-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Add a macro-based enumeration of all of the Decl nodes (like we do
with Stmt/Expr nodes), and convert some of the more mundane
switch-on-all-decl-kinds uses over to use this new file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63570 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclSerialization.cpp
64650af7cc4352c6c67b9bd1bf8ef3ce7471b910 03-Feb-2009 Douglas Gregor <dgregor@apple.com> Add a macro-based enumeration of all of the Decl nodes (like we do
with Stmt/Expr nodes), and convert some of the more mundane
switch-on-all-decl-kinds uses over to use this new file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63570 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclSerialization.cpp
725e0666c214e877959b211339618ffa8d497168 02-Feb-2009 Steve Naroff <snaroff@apple.com> Change the ObjC type encoding for block pointer types to "@?" (for consistency with GCC).
This fixes <rdar://problem/6538564> clang ObjC rewriter: Wrong encoding emitted for methods with Block parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63534 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
21a98b188857d690aa4510c52ac4317ffa0908a8 02-Feb-2009 Steve Naroff <snaroff@apple.com> Change the ObjC type encoding for block pointer types to "@?" (for consistency with GCC).
This fixes <rdar://problem/6538564> clang ObjC rewriter: Wrong encoding emitted for methods with Block parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63534 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7ef500151147ba851db502fc4d36319f863db80 30-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Switch Type::isAggregateType to use the C++ definition of "aggregate
type" rather than the C definition. We do this because both C99 and
Clang always use "aggregate type" as "aggregate or union type", and
the C++ definition includes union types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63395 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d7eb846aaf5ee4a8d22c3cd0796d1e7229d46013 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Switch Type::isAggregateType to use the C++ definition of "aggregate
type" rather than the C definition. We do this because both C99 and
Clang always use "aggregate type" as "aggregate or union type", and
the C++ definition includes union types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63395 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
9fdddeddf7db0becc807298410fa5da31063e525 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63327 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a9c878086036de36482cc21e35a33cabe9699b0a 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63327 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c9e012a1d1737f355ff5cf65d691ee58c4143d5a 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
3498bdb9e9cb300de74c7b51c92608e2902b2348 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
82462767a344858f1ec4913cc5a1b974bbd92af0 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63315 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0bb76897bedb8b747efc6523efb432fc24966118 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63315 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f6060d61f0244a410e35e7aa31e167214b196159 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> Evaluate ==,!= for complex types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63280 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4087e24f73d05d96ac2d259679751d054d3ddfbc 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> Evaluate ==,!= for complex types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63280 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
affa0e38c577ae9e4cb5d8f494d5433fae2206e5 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> Evaluate casts to complex.
- Lift (int,float) -> (int,float) conversion into separate routines.

- Fix handling of, e.g., char -> _Complex int, which was producing a
_Complex char value instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63278 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a2cfd34952204c9a160fe1a5da5ba2f231df891d 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> Evaluate casts to complex.
- Lift (int,float) -> (int,float) conversion into separate routines.

- Fix handling of, e.g., char -> _Complex int, which was producing a
_Complex char value instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63278 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
545f39ee63c227cadd091f8ee163ef80aaee0700 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
500d3297d2a21edeac4d46cbcbe21bc2352c2a28 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
00a9aad9650b2377a1ab6db8a03312c0b93fe5e8 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> Add folding for complex mul and fix some major bugs in complex float
evaluation (alternate part of real/imag init was being set to 3 not 0
because the wrong APFloat constructor was being called).
- Test cases coming once some more support is in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63264 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3f2798757c9ee353e207e18115e2e966432a4bee 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> Add folding for complex mul and fix some major bugs in complex float
evaluation (alternate part of real/imag init was being set to 3 not 0
because the wrong APFloat constructor was being called).
- Test cases coming once some more support is in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63264 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
756283be81be486a58ecde773b0c7e876358c58e 29-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Remove Expr::hasSideEffects. It doesn't work anyway

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63254 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
54f0728c2ab0f967e976300478b2f5cdfed78415 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove Expr::hasSideEffects. It doesn't work anyway

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63254 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
af781bbd294189a4120125dcbc80dc9fd10143d4 28-Jan-2009 Daniel Dunbar <daniel@zuster.org> Implement basic _Complex integer constant folding.
- Merged into single ComplexEvaluator, these share too much logic to
be worth splitting for float/int (IMHO). Will split on request.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63248 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a5fd07bbc5e4bae542c06643da3fbfe4967a9379 28-Jan-2009 Daniel Dunbar <daniel@zuster.org> Implement basic _Complex integer constant folding.
- Merged into single ComplexEvaluator, these share too much logic to
be worth splitting for float/int (IMHO). Will split on request.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63248 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f603b47aec06841368ddb1a36925c57976794c24 28-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
4c67834407ca6ab344dcf44fc599ad4938cfa96d 28-Jan-2009 Douglas Gregor <dgregor@apple.com> Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
457f33da23acf45166b7fa7bbf72e3d8dccaaaca 28-Jan-2009 Daniel Dunbar <daniel@zuster.org> Handle complex types in ASTContext::mergeTypes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63238 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
64cfdb7da3cb744642fe8a99ad5c851ad3c930b2 28-Jan-2009 Daniel Dunbar <daniel@zuster.org> Handle complex types in ASTContext::mergeTypes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63238 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
207b9ecb6031b79bd9cbacc2f6108d49dd941679 28-Jan-2009 Steve Naroff <snaroff@apple.com> Finish making AST BumpPtrAllocation runtime configurable (based on -disable-free).

snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m
0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w
snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free
0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63153 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclGroup.cpp
xpr.cpp
c0ac4923f08b25ae973a8ee7942cf3eb89da57b7 28-Jan-2009 Steve Naroff <snaroff@apple.com> Finish making AST BumpPtrAllocation runtime configurable (based on -disable-free).

snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m
0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w
snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free
0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63153 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclGroup.cpp
xpr.cpp
93fd21112c7f1b0b27697aeee47ed3e80dd1fdc9 27-Jan-2009 Steve Naroff <snaroff@apple.com> Convert types over to placement new() that takes an ASTContext.
Also changed FunctionTypeProto to be allocated with 8-byte alignment (noticed by Doug). I couldn't think of any reason to allocate on 16-byte boundaries. If anyone remembers why we were doing this, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f83820bd7a0dc4c253071b31c443a316a49ce5aa 27-Jan-2009 Steve Naroff <snaroff@apple.com> Convert types over to placement new() that takes an ASTContext.
Also changed FunctionTypeProto to be allocated with 8-byte alignment (noticed by Doug). I couldn't think of any reason to allocate on 16-byte boundaries. If anyone remembers why we were doing this, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5abb028e7b9be23c921207c097dcdc237cbf0f26 27-Jan-2009 Steve Naroff <snaroff@apple.com> Remove many references to ASTContext::getAllocator(), replacing them with calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate().

This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63135 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclGroup.cpp
eclObjC.cpp
eclSerialization.cpp
ype.cpp
3e9704981d7691fdd44913bf1786e8d760d8a627 27-Jan-2009 Steve Naroff <snaroff@apple.com> Remove many references to ASTContext::getAllocator(), replacing them with calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate().

This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63135 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclGroup.cpp
eclObjC.cpp
eclSerialization.cpp
ype.cpp
baeeb7570f7ecd62a8d236cb8bbfa400766de0a3 27-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a typo in getPreferredTypeAlign method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63116 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
32b978c1e2da0555df367897840330e514168aec 27-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a typo in getPreferredTypeAlign method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63116 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
52a425b852e4641d46073a697a48a457c8f655e2 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
20c6b3b85e186cd52d5d99489132d71d498159eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
83165b59c3bfc492b23bfcf65c24156b20f3f77f 27-Jan-2009 Chris Lattner <sabre@nondot.org> add a new "getPreferredTypeAlign" method to return the preferred alignment
of a type. The implementation is currently something of a hack, but is
sufficient for now and allows clients to be built on it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63108 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
34ebde404dc17d89487b07e6daaf1b47d5dfee39 27-Jan-2009 Chris Lattner <sabre@nondot.org> add a new "getPreferredTypeAlign" method to return the preferred alignment
of a type. The implementation is currently something of a hack, but is
sufficient for now and allows clients to be built on it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63108 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
836774b81b2a48a2cde1e08abb1f5f5e0b21ae97 27-Jan-2009 Chris Lattner <sabre@nondot.org> Introduce a new PresumedLoc class to represent the concept of a location
as reported to the user and as manipulated by #line. This is what __FILE__,
__INCLUDE_LEVEL__, diagnostics and other things should follow (but not
dependency generation!).

This patch also includes several cleanups along the way:

- SourceLocation now has a dump method, and several other places
that did similar things now use it.
- I cleaned up some code in AnalysisConsumer, but it should probably be
simplified further now that NamedDecl is better.
- TextDiagnosticPrinter is now simplified and cleaned up a bit.

This patch is a prerequisite for #line, but does not actually provide
any #line functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63098 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
b9c3f966b103f7cfe8e5e60007c4c8b38f7298eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Introduce a new PresumedLoc class to represent the concept of a location
as reported to the user and as manipulated by #line. This is what __FILE__,
__INCLUDE_LEVEL__, diagnostics and other things should follow (but not
dependency generation!).

This patch also includes several cleanups along the way:

- SourceLocation now has a dump method, and several other places
that did similar things now use it.
- I cleaned up some code in AnalysisConsumer, but it should probably be
simplified further now that NamedDecl is better.
- TextDiagnosticPrinter is now simplified and cleaned up a bit.

This patch is a prerequisite for #line, but does not actually provide
any #line functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63098 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
9488962782679474cd85297ff2a1f41ed393822f 25-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix compile error from r62953.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62959 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4e716e07d90a18ac83dd94d157ec676530bc78f9 25-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix compile error from r62953.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62959 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c8a00140e0cdb690a22769bcf85a695ab561906e 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> One more case for Expr::isConstantInitializer; I think this covers
everything that we aren't intending to implement in Expr::Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62953 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
32a311e276cd4bcafddd38db679aff9804e66bd4 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> One more case for Expr::isConstantInitializer; I think this covers
everything that we aren't intending to implement in Expr::Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62953 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2b0dec5ead27d487a87d8462a668441242911f0b 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Enhancements to Expr::isConstantInitializer to deal with a few
cases it couldn't deal with before.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62952 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c39dc9a25a9d74a5302e8567a4d3fc008212024c 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Enhancements to Expr::isConstantInitializer to deal with a few
cases it couldn't deal with before.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62952 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
dee41127decfb12910825d42a396b25eb25ac168 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
accurately states what the function is trying to do and how it is
different from Expr::isEvaluatable. Also get rid of a parameter that is both
unused and inaccurate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62951 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c9e8f606787b0bc0c3b08e566b87cc1751694168 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
accurately states what the function is trying to do and how it is
different from Expr::isEvaluatable. Also get rid of a parameter that is both
unused and inaccurate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62951 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
67f4ac50cb22a1fffeb6ac8e7fe4f6dacdf2d317 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Make the constant folder aware of
__builtin___CFStringMakeConstantString. (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62949 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3941b18b8e441c8c466efecd557de60b9a32d10b 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Make the constant folder aware of
__builtin___CFStringMakeConstantString. (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62949 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f194113f17e66a9867359bb323224e8eb7a62d2f 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix the address of a label to be properly considered and emitted as a
constant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62948 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f01158941ba4560c63150032073bb231ce38999e 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix the address of a label to be properly considered and emitted as a
constant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62948 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
18cffee2d132350beb7a451d2ed5b52a2e64296e 25-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make tentative parsing of pointer-to-member decls work, and fix other stuff pointed out by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62944 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
8edef7c31d27fc9d5d163660702a8a7730a0d19f 25-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make tentative parsing of pointer-to-member decls work, and fix other stuff pointed out by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62944 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
5a2c38f1bd4c65233fef1ecf1b34fa67a34b868e 24-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Refactor sizeof handling to use constant folding logic for constant
sizeof expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62941 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f2da9dfef96dc11b7b5effb1d02cb427b2d71599 24-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Refactor sizeof handling to use constant folding logic for constant
sizeof expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62941 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
bd3153edf9096e49a03c782d9768232213a41733 24-Jan-2009 Chris Lattner <sabre@nondot.org> add initial support for the gcc "alignof(decl) is the alignment of the decl
not the type" semantics. This can definitely be improved, but is better than
what we had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62939 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
af707ab8fbb9451e8febb8d766f6c043628125c4 24-Jan-2009 Chris Lattner <sabre@nondot.org> add initial support for the gcc "alignof(decl) is the alignment of the decl
not the type" semantics. This can definitely be improved, but is better than
what we had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62939 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xprConstant.cpp
7555503bb5f08651638f269c44c15bb425d10c5e 24-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add support for declaring pointers to members.
Add serialization support for ReferenceType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62934 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeSerialization.cpp
f30208ad5b334e93582e846a2a0c92f38a607b8a 24-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add support for declaring pointers to members.
Add serialization support for ReferenceType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62934 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeSerialization.cpp
e3f61e1e2fbeb2e6a28679555aa821d093f6a25c 24-Jan-2009 Chris Lattner <sabre@nondot.org> Improve handling of alignof. alignof(VLA) now works properly for example.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62932 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e9feb475d72ba50dc29cec62a8c47cae721065eb 24-Jan-2009 Chris Lattner <sabre@nondot.org> Improve handling of alignof. alignof(VLA) now works properly for example.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62932 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f8abb94c2c5b0f3bc8d2d5199fa21f93310f761f 24-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix invalid evaluation of _Complex float (real & imaginary parts had
mismatched semantics).
- Enforce this in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62924 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8f826f0e0c90b05ab04e84c29157d2e965713288 24-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix invalid evaluation of _Complex float (real & imaginary parts had
mismatched semantics).
- Enforce this in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62924 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c5a6bdc2f783e75a434e1e230dac17b946822976 22-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Initial implementation of semantic analysis and ASTs for C99
designated initializers. This implementation should cover all of the
constraints in C99 6.7.8, including long, complex designations and
computing the size of incomplete array types initialized with a
designated initializer. Please see the new test-case and holler if you
find cases where this doesn't work.

There are still some wrinkles with GNU's anonymous structs and
anonymous unions (it isn't clear how these should work; we'll just
follow GCC's lead) and with designated initializers for the members of a
union. I'll tackle those very soon.

CodeGen is still nonexistent, and there's some leftover code in the
parser's representation of designators that I'll also need to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62737 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
05c13a3411782108d65aab3c77b1a231a4963bc0 22-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of semantic analysis and ASTs for C99
designated initializers. This implementation should cover all of the
constraints in C99 6.7.8, including long, complex designations and
computing the size of incomplete array types initialized with a
designated initializer. Please see the new test-case and holler if you
find cases where this doesn't work.

There are still some wrinkles with GNU's anonymous structs and
anonymous unions (it isn't clear how these should work; we'll just
follow GCC's lead) and with designated initializers for the members of a
union. I'll tackle those very soon.

CodeGen is still nonexistent, and there's some leftover code in the
parser's representation of designators that I'll also need to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62737 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
2f1dbf972239cacd388461ad3c673efb46a5de84 21-Jan-2009 Ted Kremenek <kremenek@apple.com> Static Analyzer: When generating plists for errors reports, generate one plist file per translation unit that contains all of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62647 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
ddf32dabe71f00aa0943449f67201f587f0a04d6 21-Jan-2009 Ted Kremenek <kremenek@apple.com> Static Analyzer: When generating plists for errors reports, generate one plist file per translation unit that contains all of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62647 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
5c56121b6f6f18e3808b3c61bd413e3c4fcb029c 20-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62611 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b17e3b04fa50ca542ccbbf69847f62e5f043df03 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62611 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
501ef5c3822c2d583f1f129512019cd7a1e144b4 20-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Detailed documentation for encoding of properties and a test
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62607 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
83bccb85ff4b9981c4250c45494b439df8cbf983 20-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Detailed documentation for encoding of properties and a test
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62607 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e5f128a410e2779c528616a76e7cd4559ecd1249 20-Jan-2009 Steve Naroff <snaroff@apple.com> Allocate expresssions through ASTContext (still more work to do).
Add debug hook to DeclContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62605 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0a4739305a984ef9b821cedad5f4fe235eb6ef7d 20-Jan-2009 Steve Naroff <snaroff@apple.com> Allocate expresssions through ASTContext (still more work to do).
Add debug hook to DeclContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62605 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
892d5db7ee1e942aa7fcdf441b7e0e23ff996cf2 20-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Improving on encoding of objective-c's property types. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62601 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
090b3f71702c5626d8520f9608d77c6f26dcfa15 20-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Improving on encoding of objective-c's property types. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62601 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
9ac66d25bcaeb7594368dfe20def4174032d1c49 20-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Rename DeclContext::insert to DeclContext::makeDeclVisibleInContext and document both it and DeclContext::addDecl properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62581 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
40f4e69002af9623a1f959bd57b99afda186a6a7 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Rename DeclContext::insert to DeclContext::makeDeclVisibleInContext and document both it and DeclContext::addDecl properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62581 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1d411123bee0cc2e08394f32a24c986a93424e65 20-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3350: add special-casing for "references" to va_lists in
builtins.

Also, a minor tweak to va_copy for consistency.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62574 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
6597f985156b3a24c0a9db1e01eeec85714c4a8d 20-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3350: add special-casing for "references" to va_lists in
builtins.

Also, a minor tweak to va_copy for consistency.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62574 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
f4006be67e6e90617340c7317831a803d006e443 20-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Remove the TopLevelDecls from TranslationUnit, since all of those decls are owned by the ASTContext's TranslationUnitDecl. There are definitely some leaking Decls now that I'll tackle tomorrow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62568 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
ranslationUnit.cpp
00ad0ef8369ee65337ff29c8db3c1841a01102c4 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove the TopLevelDecls from TranslationUnit, since all of those decls are owned by the ASTContext's TranslationUnitDecl. There are definitely some leaking Decls now that I'll tackle tomorrow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62568 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
ranslationUnit.cpp
af8ad2b4dcc1d03fec720ab2c20d9eaf4754e496 20-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclSerialization.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtSerialization.cpp
4afa39deaa245592977136d367251ee2c173dd8d 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclSerialization.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtSerialization.cpp
f8e62a683f3ca1c571cb8a4c6b35b8e246fd0d16 20-Jan-2009 Ted Kremenek <kremenek@apple.com> Dead stores checker: Fix <rdar://problem/6506065> by being more selective when say that a store is dead even though the computed value is used in the enclosing expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62552 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
7f5fce7200fdbf03f7d70134a57271e584fcb766 20-Jan-2009 Ted Kremenek <kremenek@apple.com> Dead stores checker: Fix <rdar://problem/6506065> by being more selective when say that a store is dead even though the computed value is used in the enclosing expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62552 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
bd9375afd95b69239fc08982cc0aa1a1a98541bc 19-Jan-2009 Steve Naroff <snaroff@apple.com> Make sure all types are allocated with 8-byte alignment.
The QualType smart pointer assumes we have 3 flag bits available.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62540 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
506010b2b6ea0e8f25bc0638a9aaca963eff3940 19-Jan-2009 Steve Naroff <snaroff@apple.com> Make sure all types are allocated with 8-byte alignment.
The QualType smart pointer assumes we have 3 flag bits available.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62540 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c70e7d095b3944cb38f2e522c352e9f6a46faff3 19-Jan-2009 Ted Kremenek <kremenek@apple.com> Allocate Types using ASTContext's 'Allocator' object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62530 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
566c2ba743065ec090f5154d5c30cf593aa12a6e 19-Jan-2009 Ted Kremenek <kremenek@apple.com> Allocate Types using ASTContext's 'Allocator' object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62530 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
6b0ed6f1764a15c0458fb6e58986b2dbcb27e444 19-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allow @dynamic synthesis of property in a category,
with @synthesize being illegal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62515 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f034e9cc4dad81d8fe6eb88a84da55b2909a9cdd 19-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allow @dynamic synthesis of property in a category,
with @synthesize being illegal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62515 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
cb8cc5b95fed5f810fe5e6a8e7ee31781ec81ddd 18-Jan-2009 Nuno Lopes <nunoplopes@sapo.pt> fix deallocation of FunctionDecl::ParamInfo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
460b0ac80382fa73337d21dd052c1f18b27435d8 18-Jan-2009 Nuno Lopes <nunoplopes@sapo.pt> fix deallocation of FunctionDecl::ParamInfo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
7903d050d7f22e2a75cc950f30d0cc3df0c6b101 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Vector codegen improvements


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62458 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6fe7c8aa8c7546743ecd0ac0138c2cf5d8155386 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Vector codegen improvements


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62458 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d6d2f776f8cc39ea85c952fb2e8bde386bcca802 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Support evaluation of vector constant expressions, and codegen of same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62455 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xpr.cpp
xprConstant.cpp
59b5da6d853b4368b984700315adf7b37de05764 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Support evaluation of vector constant expressions, and codegen of same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62455 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
xpr.cpp
xprConstant.cpp
a8e117c31a760528c77d97e8d5425f61e3a95e8f 18-Jan-2009 Nate Begeman <natebegeman@mac.com> A couple more vector component access fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62443 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
190d6a25393995b42e32086949a68285ee423fb9 18-Jan-2009 Nate Begeman <natebegeman@mac.com> A couple more vector component access fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62443 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1486b507eb8b13d3cc77b42a32395a811c5c962e 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Update support for vector component access on ExtVectors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62440 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
353417af9d254d4fd0eb7d0a3ff71c4d8594ac58 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Update support for vector component access on ExtVectors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62440 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c45d4e8bd9e99916f106b901a74f3c56c71b6c50 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Add support for vectors to APValue. Vector constant evaluator and tests coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62438 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
3d309f9d62a6f9f634b869937139d533ccd7265b 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Add support for vectors to APValue. Vector constant evaluator and tests coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62438 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
98b275417eab0af35ba0bf0d7dbd89253c710f3c 17-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that
qualified name lookup of a class name within its definition works (see
the new bits in test/SemaCXX/qualified-id-lookup.cpp).

As part of this, move the nested redefinition checking code into
ActOnTag. This gives us diagnostics earlier (when we try to perform
the nested redefinition, rather than when we try to complete the 2nd
definition) and removes some code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
ypeSerialization.cpp
0b7a158d120ac8d78c114a823e17eedfec6b6658 17-Jan-2009 Douglas Gregor <dgregor@apple.com> Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that
qualified name lookup of a class name within its definition works (see
the new bits in test/SemaCXX/qualified-id-lookup.cpp).

As part of this, move the nested redefinition checking code into
ActOnTag. This gives us diagnostics earlier (when we try to perform
the nested redefinition, rather than when we try to complete the 2nd
definition) and removes some code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
ypeSerialization.cpp
de93967e1b89a5191335a7a95d39c3e090bfa0bf 16-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Don't ICE on user redeclaration of objc's built-in types.
Issue diagnostics instead if types do not match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62349 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c55a24095c3488fa6e99b537be64e57a2905477b 16-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Don't ICE on user redeclaration of objc's built-in types.
Issue diagnostics instead if types do not match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62349 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5919a85c2d28132c5361b7001c9b4c598e8a7cea 16-Jan-2009 Chris Lattner <sabre@nondot.org> make ast-print handle random non-printable characters correctly with octal escapes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62337 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
9a81c87503c7a36a4468a081cadb461833a360a8 16-Jan-2009 Chris Lattner <sabre@nondot.org> make ast-print handle random non-printable characters correctly with octal escapes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62337 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
861e79049d4d463c4c5d04a422a7eaf50243ea7d 16-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Part one of handling C++ functional casts. This handles semantic
analysis and AST-building for the cases where we have N != 1
arguments. For N == 1 arguments, we need to finish the C++
implementation of explicit type casts (C++ [expr.cast]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62329 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
506ae418eb171d072f2fb4f6bc46d258b52cbf97 16-Jan-2009 Douglas Gregor <dgregor@apple.com> Part one of handling C++ functional casts. This handles semantic
analysis and AST-building for the cases where we have N != 1
arguments. For N == 1 arguments, we need to finish the C++
implementation of explicit type casts (C++ [expr.cast]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62329 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
74f6701b77493fb60c98ac036e8a24eddaa6219b 16-Jan-2009 Chris Lattner <sabre@nondot.org> rename "virtual location" of a macro to "instantiation location".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62315 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
88054dee0402e4d3c1f64e6b697acc47195c0d72 16-Jan-2009 Chris Lattner <sabre@nondot.org> rename "virtual location" of a macro to "instantiation location".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62315 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
cdf600ee2c48a0299a0bc15da479b6a818c997ed 16-Jan-2009 Chris Lattner <sabre@nondot.org> Change some terminology in SourceLocation: instead of referring to
the "physical" location of tokens, refer to the "spelling" location.
This is more concrete and useful, tokens aren't really physical objects!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62309 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
df7c17a8d02fe09a3466786bae3e40fc3252687a 16-Jan-2009 Chris Lattner <sabre@nondot.org> Change some terminology in SourceLocation: instead of referring to
the "physical" location of tokens, refer to the "spelling" location.
This is more concrete and useful, tokens aren't really physical objects!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62309 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
0e7e7f4b17b58ee7e46c422feadc0b18f4c34521 16-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Don't advance the statement iterator after we've deallocated the statement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62306 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
860f6d4af5f37a151d5e5ea3538dc4708cab5d68 16-Jan-2009 Douglas Gregor <dgregor@apple.com> Don't advance the statement iterator after we've deallocated the statement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62306 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
2a032ec57b98d6bfa4502b9555736e20ba1aa730 16-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> postpone sizeof objc-class computatin to the clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62292 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
67303c1c78345c53abbf19516170f5bd79b0534d 16-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> postpone sizeof objc-class computatin to the clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62292 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ddebecaa80b74dfd595f99627a45259cf54d6769 15-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix some unused variable, control reaches end of non-void function,
and uninitialized use options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62270 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f185319f25efd6094870f287030270fad26085ba 15-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix some unused variable, control reaches end of non-void function,
and uninitialized use options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62270 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b72e197adf05af0e825c32340a053638f34da240 14-Jan-2009 Steve Naroff <snaroff@apple.com> Fix a subtle bug in DeclContext::DestroyDecls().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62205 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
4c92fea0c838e0df95f7aa53c0c592b659ea1b10 14-Jan-2009 Steve Naroff <snaroff@apple.com> Fix a subtle bug in DeclContext::DestroyDecls().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62205 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
8494c967ba170c792681ba6b64ffe8ad61a8b6ff 14-Jan-2009 Ted Kremenek <kremenek@apple.com> FunctionDecl::setParams() now uses the allocator associated with ASTContext to allocate the array of ParmVarDecl*'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62203 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
fc767615bc67d3a7587b1fb2e0494c32c9dbd7a5 14-Jan-2009 Ted Kremenek <kremenek@apple.com> FunctionDecl::setParams() now uses the allocator associated with ASTContext to allocate the array of ParmVarDecl*'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62203 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
82f549690d7edcdffe624a166bea4357df78dfe4 14-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Implemenent objective-c's NSObject attribute as a way of ddeclaraing c-type
objects as an objective-c object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62197 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fa23c1d9adc99c662c1c0e192817185809d95614 14-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Implemenent objective-c's NSObject attribute as a way of ddeclaraing c-type
objects as an objective-c object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62197 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8314d74e40e05951773469ebcce360beed79e650 13-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Turn off some Destroy calls that are currenly causing double-destruction of ScopedDecls. We will re-enable this later, when we have time to fully solve the ownership issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62175 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
a0fc55f3e9d7d7aa8761d0a9726033947d0d6bc0 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Turn off some Destroy calls that are currenly causing double-destruction of ScopedDecls. We will re-enable this later, when we have time to fully solve the ownership issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62175 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
d13619567feccf7d00c38369623165651a9235b1 13-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix encoding of Enum bitfields in ObjC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62135 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875 13-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to fix encoding of Enum bitfields in ObjC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62135 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
036b5a0b6b0dc7d4c1e70984c848079848227d57 13-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure we don't name a constructor or destructor with a qualified
type. It leads to very weird errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62124 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
e63ef48b76b84e7ffb0a38fbf475ddea5c48adb4 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure we don't name a constructor or destructor with a qualified
type. It leads to very weird errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62124 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
03b2ad28d67ed14e2203eb1e92ce042f63182bcd 13-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62122 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
482b77d1cb4ca08391d1f749436f092a4cc24427 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62122 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
0d64d359d6024259a8703990ac6c0e1afa53e7e3 12-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix crasher due to use-after-release: DeclContext now owns all ObjCMethodDecls, and shouldn't be released elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62113 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ee49d0496bb8ff2bbf479bb7fbcfbdc71eed7461 12-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix crasher due to use-after-release: DeclContext now owns all ObjCMethodDecls, and shouldn't be released elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62113 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f96ee9e9b146493eb2fcc55ba45dfeebe8241ac7 12-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to supprt case of readonly property being
assigned to when it has user declared setter method
defined in the class implementation (but no declaration in
the class itself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62098 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
xpr.cpp
d1fa6449e9dbdd667466e9e1e971aa17c9793e8a 12-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to supprt case of readonly property being
assigned to when it has user declared setter method
defined in the class implementation (but no declaration in
the class itself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62098 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
xpr.cpp
0f29fa138a7c1c520f633e6880b942c66cd1d312 12-Jan-2009 Chris Lattner <sabre@nondot.org> some more minor asqualtype bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62064 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2a18dfe292cf3c406a769c3672080970ac586345 12-Jan-2009 Chris Lattner <sabre@nondot.org> some more minor asqualtype bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62064 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
976692aceb25a89c1c3c19f0a70b7a02d8043c0f 12-Jan-2009 Chris Lattner <sabre@nondot.org> improve some more is*Type predicates to look through asqualtypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62063 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4bbce9901f7296ab030c58f0877be0b042bd70d3 12-Jan-2009 Chris Lattner <sabre@nondot.org> improve some more is*Type predicates to look through asqualtypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62063 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
25de19e825ca9116a25c188749bcab54aa316706 12-Jan-2009 Chris Lattner <sabre@nondot.org> simplify these predicates a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62061 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f728a4a05df2455e1c6e62173ab720a92cd4a074 12-Jan-2009 Chris Lattner <sabre@nondot.org> simplify these predicates a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62061 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
dcf1e8426517ad33f1f849708ae5c95d4040e4a7 11-Jan-2009 Steve Naroff <snaroff@apple.com> Convert property implementation to DeclContext::addDecl().
This completes the ObjCContainerDecl AST cleanup (for now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62037 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
93983f8fa120330bf212bfde7e65da2709fb3be8 11-Jan-2009 Steve Naroff <snaroff@apple.com> Convert property implementation to DeclContext::addDecl().
This completes the ObjCContainerDecl AST cleanup (for now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62037 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
56af200f216eac5e1e4ac579fa3321c4b20f404f 11-Jan-2009 Steve Naroff <snaroff@apple.com> A few property related cleanups to ObjCContainerDecl AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62034 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6327e0d55c590b3c2766fa76ef1db241a0467df2 11-Jan-2009 Steve Naroff <snaroff@apple.com> A few property related cleanups to ObjCContainerDecl AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62034 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e008c142f9ae905c8eea71adb5900f4fb8951fba 10-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Explicit declaration of property setters over-ride
prohibition of 'readonly' properties in an assignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62028 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
212921261b9904d5b21c85c68a57c2b0d3f72b14 10-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Explicit declaration of property setters over-ride
prohibition of 'readonly' properties in an assignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62028 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
faca5e2c497659869be8a0647ea589e209a06931 09-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> This patch removes mergeProperties and does the property lookup
in designated protocols lazily.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62007 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a66793ee8d2589ead81739d9b8a968650db3d452 09-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> This patch removes mergeProperties and does the property lookup
in designated protocols lazily.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62007 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d16753817a047f96670d084d3146c0e495604586 09-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Replace DeclContext's vector of ScopedDecl pointers with a linked list
of ScopedDecls (using the new ScopedDecl::NextDeclInScope
pointer). Performance-wise:

- It's a net win in memory utilization, since DeclContext is now one
pointer smaller than it used to be (std::vectors are typically 3
pointers; we now use 2 pointers) and
- Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang)
is about 1.9% faster than before, most likely because we no longer
have the memory allocations and copying associated with the
std::vector.

I'll re-enable serialization of DeclContexts once I've sorted out the
NextDeclarator/NextDeclInScope question.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62001 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
6037fcba3431b47de1a994c9b286feac17894eff 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Replace DeclContext's vector of ScopedDecl pointers with a linked list
of ScopedDecls (using the new ScopedDecl::NextDeclInScope
pointer). Performance-wise:

- It's a net win in memory utilization, since DeclContext is now one
pointer smaller than it used to be (std::vectors are typically 3
pointers; we now use 2 pointers) and
- Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang)
is about 1.9% faster than before, most likely because we no longer
have the memory allocations and copying associated with the
std::vector.

I'll re-enable serialization of DeclContexts once I've sorted out the
NextDeclarator/NextDeclInScope question.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62001 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclSerialization.cpp
d394a2793850cf65f2f7a99f089603cf34405dec 09-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that ScopedDecls passed to DeclContext::addDecl are added into their lexical context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61998 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
a8cc8ce044e5d2589128f0c1a84e586cce743b27 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure that ScopedDecls passed to DeclContext::addDecl are added into their lexical context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61998 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
5d7648449392dccee2deb7920c2e5facbe1a63f5 09-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Provide a new kind of iterator, the specific_decl_iterator, that
filters the decls seen by decl_iterator with two criteria: the dynamic
type of the declaration and a run-time predicate described by a member
function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl
considerably. It has no measurable performance impact.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61994 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
f8d49f64ef6ab7e632717a31631fc289aab69428 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Provide a new kind of iterator, the specific_decl_iterator, that
filters the decls seen by decl_iterator with two criteria: the dynamic
type of the declaration and a run-time predicate described by a member
function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl
considerably. It has no measurable performance impact.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61994 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
451f83c3d689753abb1d7393816951b96d39bbb1 09-Jan-2009 Steve Naroff <snaroff@apple.com> Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).
Add isa/cast/dyncast support for ObjCContainerDecl.
Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing).
More simplifications to Sema::ActOnAtEnd()...
Added/changed some FIXME's as a result of the above work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61988 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
ranslationUnit.cpp
09c4719788a5cea09897525e528fa00420f1677b 09-Jan-2009 Steve Naroff <snaroff@apple.com> Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).
Add isa/cast/dyncast support for ObjCContainerDecl.
Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing).
More simplifications to Sema::ActOnAtEnd()...
Added/changed some FIXME's as a result of the above work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61988 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
ranslationUnit.cpp
0a576d5c9ee5f2dfdf0edbf96f3dee6614bd1f9c 09-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix crash on null deference when searching for readwrite properties in
categories.
- Also, simplify nesting via early return.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61968 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
84efc04f41b9760f339717834373db19a74c14fe 09-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix crash on null deference when searching for readwrite properties in
categories.
- Also, simplify nesting via early return.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61968 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6e4fa2c890cc4f81ac227b3f6d1b49a49dcf0566 09-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Addressed the issue in <rdar://problem/6479085>, where we failed to
rewrite @class declarations that showed up within linkage
specifications because those @class declarations never made it any
place where the rewriter could find them.

Moved all of the ObjC*Decl nodes over to ScopedDecls, so that they can
live in the appropriate top-level or transparent DeclContext near the
top level, e.g., TranslationUnitDecl or LinkageSpecDecl. Objective-C
declarations now show up in a traversal of the declarations in a
DeclContext (they didn't before!). This way, the rewriter finds all
Objective-C declarations within linkage specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61966 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d04341000d35c8808a72838b057eed7bf13b7661 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Addressed the issue in <rdar://problem/6479085>, where we failed to
rewrite @class declarations that showed up within linkage
specifications because those @class declarations never made it any
place where the rewriter could find them.

Moved all of the ObjC*Decl nodes over to ScopedDecls, so that they can
live in the appropriate top-level or transparent DeclContext near the
top level, e.g., TranslationUnitDecl or LinkageSpecDecl. Objective-C
declarations now show up in a traversal of the declarations in a
DeclContext (they didn't before!). This way, the rewriter finds all
Objective-C declarations within linkage specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61966 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
bdbbc2dd11e8e5645fa6a61b9f24cb12625a830f 08-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Revert my previous, failed attempt to pretty-print anonymous struct/union accesses well. Added a FIXME so we know to revisit this later

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61951 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
b3eef68111ffc220e449be96da1747998c057790 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Revert my previous, failed attempt to pretty-print anonymous struct/union accesses well. Added a FIXME so we know to revisit this later

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61951 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
788ef0a71a61d8c0e3a5f428fe2b1c17cad47aee 08-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and destroy all contained ObjCMethodDecls in one sweep. This fixes a use-after-free error found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61943 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6321c0aaa3523f3d569d5fbe5820b3fa250e2585 08-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and destroy all contained ObjCMethodDecls in one sweep. This fixes a use-after-free error found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61943 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
db568cfb21332e84a163afdaab0d13e88a56f712 08-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Unify the code for defining tags in C and C++, so that we always
introduce a Scope for the body of a tag. This reduces the number of
semantic differences between C and C++ structs and unions, and will
help with other features (e.g., anonymous unions) in C. Some important
points:

- Fields are now in the "member" namespace (IDNS_Member), to keep
them separate from tags and ordinary names in C. See the new test
in Sema/member-reference.c for an example of why this matters. In
C++, ordinary and member name lookup will find members in both the
ordinary and member namespace, so the difference between
IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
only in C++!).
- We always introduce a Scope and push a DeclContext when we're
defining a tag, in both C and C++. Previously, we had different
actions and different Scope/CurContext behavior for enums, C
structs/unions, and C++ structs/unions/classes. Now, it's one pair
of actions. (Yay!)

There's still some fuzziness in the handling of struct/union/enum
definitions within other struct/union/enum definitions in C. We'll
need to do some more cleanup to eliminate some reliance on CurContext
before we can solve this issue for real. What we want is for something
like this:

struct X {
struct T { int x; } t;
};

to introduce T into translation unit scope (placing it at the
appropriate point in the IdentifierResolver chain, too), but it should
still have struct X as its lexical declaration
context. PushOnScopeChains isn't smart enough to do that yet, though,
so there's a FIXME test in nested-redef.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61940 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
72de6676bd30f9081ee4166bbe07b4c270258ce6 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Unify the code for defining tags in C and C++, so that we always
introduce a Scope for the body of a tag. This reduces the number of
semantic differences between C and C++ structs and unions, and will
help with other features (e.g., anonymous unions) in C. Some important
points:

- Fields are now in the "member" namespace (IDNS_Member), to keep
them separate from tags and ordinary names in C. See the new test
in Sema/member-reference.c for an example of why this matters. In
C++, ordinary and member name lookup will find members in both the
ordinary and member namespace, so the difference between
IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
only in C++!).
- We always introduce a Scope and push a DeclContext when we're
defining a tag, in both C and C++. Previously, we had different
actions and different Scope/CurContext behavior for enums, C
structs/unions, and C++ structs/unions/classes. Now, it's one pair
of actions. (Yay!)

There's still some fuzziness in the handling of struct/union/enum
definitions within other struct/union/enum definitions in C. We'll
need to do some more cleanup to eliminate some reliance on CurContext
before we can solve this issue for real. What we want is for something
like this:

struct X {
struct T { int x; } t;
};

to introduce T into translation unit scope (placing it at the
appropriate point in the IdentifierResolver chain, too), but it should
still have struct X as its lexical declaration
context. PushOnScopeChains isn't smart enough to do that yet, though,
so there's a FIXME test in nested-redef.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61940 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
5492c1beecd117ab9ac0c0e03331b3573faaf5ff 08-Jan-2009 Steve Naroff <snaroff@apple.com> Removed ObjCContainerDecl::getPropertyMethods()...doesn't belong in the AST.
Moved logic to Sema::ProcessPropertyDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61936 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
92f863bffa9d5efe5cc63992e06b268231bc2cc0 08-Jan-2009 Steve Naroff <snaroff@apple.com> Removed ObjCContainerDecl::getPropertyMethods()...doesn't belong in the AST.
Moved logic to Sema::ProcessPropertyDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61936 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
438be771a8e7336d5e143d91debb419764cde8ef 08-Jan-2009 Steve Naroff <snaroff@apple.com> Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl).
Convert clients to use the standard getDeclContext() API.

Doug, thanks for the review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61935 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3e0a540b6d846178857289ec0eb8470a278d11a3 08-Jan-2009 Steve Naroff <snaroff@apple.com> Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl).
Convert clients to use the standard getDeclContext() API.

Doug, thanks for the review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61935 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ab63fd6f3dccb110f78f132fa81321bbd4a61b70 08-Jan-2009 Steve Naroff <snaroff@apple.com> This is a large/messy diff that unifies the ObjC AST's with DeclContext.

- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.

This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61929 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
0701bbb228dfd87e1fe82a0a4b7b9facfecb43da 08-Jan-2009 Steve Naroff <snaroff@apple.com> This is a large/messy diff that unifies the ObjC AST's with DeclContext.

- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.

This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61929 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
cc74331b39f125521e8c1fa66d3c3171ce119114 07-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Fix printing of member references to avoid displaying implicitly-generated member references, e.g., for anonymous struct/unions or implicit 'this' in member functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61885 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
83233a4b7c2bc7b531ffa3b33fdd1cd8138373b6 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix printing of member references to avoid displaying implicitly-generated member references, e.g., for anonymous struct/unions or implicit 'this' in member functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61885 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c7f0161766b7b551e21882add1e6e9599b820251 07-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Finished semantic analysis of anonymous unions in C++.

Duplicate-member checking within classes is still a little messy, and
anonymous unions are still completely broken in C. We'll need to unify
the handling of fields in C and C++ to make this code applicable in
both languages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61878 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
6b3945f4bc757bdadd3e443180cf32c2cccb52a0 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Finished semantic analysis of anonymous unions in C++.

Duplicate-member checking within classes is still a little messy, and
anonymous unions are still completely broken in C. We'll need to unify
the handling of fields in C and C++ to make this code applicable in
both languages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61878 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
d9d4d50943e78c4405b89444fca99230584acacb 07-Jan-2009 Steve Naroff <snaroff@apple.com> ObjC AST cleanups/simplifications (phase 1).
Add ObjCContainerDecl class and have ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl inherit from it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61866 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e4f039e01e797a38bc97bf22aff9832ecd18ff5f 07-Jan-2009 Steve Naroff <snaroff@apple.com> ObjC AST cleanups/simplifications (phase 1).
Add ObjCContainerDecl class and have ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl inherit from it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61866 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
38d38a08d869c4a6efa3233eac48fafb8bf8d945 07-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> When determining whether a variable is a file-scoped variable, check
out its lookup context (to see through linkage
specifications). Addresses <rdar://problem/6477142>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61848 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
17a9b9e3ee75f5dbb4819cc8ebf40eec8015f84a 07-Jan-2009 Douglas Gregor <dgregor@apple.com> When determining whether a variable is a file-scoped variable, check
out its lookup context (to see through linkage
specifications). Addresses <rdar://problem/6477142>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61848 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
723d3339200af4a2f1861b7f4cc6d9788e0d7386 07-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Initial implementation of anonymous unions (and, as a GNU extension,
structures and classes) in C++. Covers name lookup and the synthesis
and member access for the unnamed objects/fields associated with
anonymous unions.

Some C++ semantic checks are still missing (anonymous unions can't
have function members, static data members, etc.), and there is no
support for anonymous structs or unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61840 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclSerialization.cpp
bcbffc46f1ad3796c4582fa1e3a9113b5aa26061 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of anonymous unions (and, as a GNU extension,
structures and classes) in C++. Covers name lookup and the synthesis
and member access for the unnamed objects/fields associated with
anonymous unions.

Some C++ semantic checks are still missing (anonymous unions can't
have function members, static data members, etc.), and there is no
support for anonymous structs or unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61840 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclSerialization.cpp
69e781fb54d6a9592899a96d2a85f3f39a4142a9 07-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Allow Objective-C entities to be declared within a transparent context
nested in the translation unit. This fixes <rdar://problem/6476070>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61832 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ce35607c282c845b3285d0f6e106489d8bbeba13 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Allow Objective-C entities to be declared within a transparent context
nested in the translation unit. This fixes <rdar://problem/6476070>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61832 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
f0464ec81688de6a1fcc9979ae7245aa87e451aa 06-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Minor tweaks to the transparent declcontext patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61798 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
4f3b8f8ac2f8c89028a2f8793df0a7887df809d4 06-Jan-2009 Douglas Gregor <dgregor@apple.com> Minor tweaks to the transparent declcontext patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61798 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
566782aea6d9805c4f703f8101f2dc452cf7286a 06-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
1) The use of a qualified-id instead of an unqualified-id suppresses
argument-dependent lookup
2) If the name refers to a virtual function, the qualified-id
version will call the function determined statically while the
unqualified-id version will call the function determined dynamically
(by looking up the appropriate function in the vtable).

Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
1a49af9681c350fef58e677f85ccb9a77e8e9d0a 06-Jan-2009 Douglas Gregor <dgregor@apple.com> Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
1) The use of a qualified-id instead of an unqualified-id suppresses
argument-dependent lookup
2) If the name refers to a virtual function, the qualified-id
version will call the function determined statically while the
unqualified-id version will call the function determined dynamically
(by looking up the appropriate function in the vtable).

Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
b65f94d03bb26fd844d07529bf5b79205e231e5c 05-Jan-2009 Daniel Dunbar <daniel@zuster.org> Back out code for handling VectorType's in getFloatingRank.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61764 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8141b755d3ebd9cb489827b781e1ceb350e9278a 05-Jan-2009 Daniel Dunbar <daniel@zuster.org> Back out code for handling VectorType's in getFloatingRank.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61764 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4a0b75ca2adf0ad7daef3c0f649ebaf48ed8a916 05-Jan-2009 Daniel Dunbar <daniel@zuster.org> Implement getFloatingRank() for extended vectors.
- I'm not sure this is appropriate, but it seems reasonable to be
able to call getFloatingRank on anything which isFloatingType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61758 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d786f6a6b791b5901fa9fd39a2bbf924afbc1252 05-Jan-2009 Daniel Dunbar <daniel@zuster.org> Implement getFloatingRank() for extended vectors.
- I'm not sure this is appropriate, but it seems reasonable to be
able to call getFloatingRank on anything which isFloatingType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61758 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
39c0f6f69727c07a1b87605c54f14b86f8189194 05-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> PODness and Type Traits

Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61746 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ype.cpp
64b45f7e0d3167f040841ac2920aead7f080730d 05-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> PODness and Type Traits

Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61746 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
xpr.cpp
xprCXX.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ype.cpp
d802838e493df9217cf3d71087de523fff486a97 05-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.

Only enumerations and linkage specifications currently use transparent
DeclContexts.

Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
074149e11baf5f7db12f84efd5c34ba6e35d5cdf 05-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.

Only enumerations and linkage specifications currently use transparent
DeclContexts.

Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
ac73695a57e46cb74d41ce9eb6cd75e313949967 05-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Fix an uninitialized-variable warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61700 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
6b54bd160bc7524e9bfbd64bb7692e7cace5772d 05-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix an uninitialized-variable warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61700 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
1af6e4fdd13dd43dbb5de5d627467e88c869e46b 24-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix try statement deserialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61421 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
7a897224381564826c2894572df92fb5ddd9ea37 24-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix try statement deserialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61421 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
0da0273153e4526863ce8d1e06f94c8957bd4341 24-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Add serialization support for TypeOfType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61417 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
501c7252bd4752bc542630446494eb15b27f1f88 24-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Add serialization support for TypeOfType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61417 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
71af02f1cea2bcedacbff2a20d883bf2b8042eb0 24-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Add serialization support for TypeOfExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61416 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
8fbc5274c416967de5338778f685b7830464ad13 24-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Add serialization support for TypeOfExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61416 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
524734351dd3a2c625d8a7fb131ee8a424b3a00b 24-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
c4b4e7b8f6ca9b036824e048af49cd2a52b57cdf 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
62ae25ad1ecf45a8ecfefba3b14b159a91847657 24-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Correct the order in which we cope with end-of-class-definition
semantics and improve our handling of default arguments. Specifically,
we follow this order:

- As soon as the see the '}' in the class definition, the class is
complete and we add any implicit declarations (default constructor,
copy constructor, etc.) to the class.
- If there are any default function arguments, parse them
- If there were any inline member function definitions, parse them

As part of this change, we now keep track of the the fact that we've
seen unparsed default function arguments within the AST. See the new
ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly
cope with calls inside default function arguments to other functions
where we're making use of the default arguments.

Made some C++ error messages regarding failed initializations more
specific.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61406 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
ype.cpp
61366e9cd41a6dbde4e66416dac21269c8ac1d94 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Correct the order in which we cope with end-of-class-definition
semantics and improve our handling of default arguments. Specifically,
we follow this order:

- As soon as the see the '}' in the class definition, the class is
complete and we add any implicit declarations (default constructor,
copy constructor, etc.) to the class.
- If there are any default function arguments, parse them
- If there were any inline member function definitions, parse them

As part of this change, we now keep track of the the fact that we've
seen unparsed default function arguments within the AST. See the new
ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly
cope with calls inside default function arguments to other functions
where we're making use of the default arguments.

Made some C++ error messages regarding failed initializations more
specific.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61406 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
ype.cpp
6a202014533c408b653e215ecb4b108b039caa5b 23-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> When determining whether a class type has a const copy constructor, be
sure to look at all of the results returned by name lookup. Fixes
<rdar://problem/6465262>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61388 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fdfab6b5ee678cd4b6a1c6d01c46ea5d0e3153ed 23-Dec-2008 Douglas Gregor <dgregor@apple.com> When determining whether a class type has a const copy constructor, be
sure to look at all of the results returned by name lookup. Fixes
<rdar://problem/6465262>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61388 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
d3498aa664f8d39d58ee5803e46b7948f54476e8 23-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Last patch, for now, to privde ObjC's encoding of types.
We now pass all gcc's encoding compatibility tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61387 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3e1b16c2e5b2c02d76e60ff28d609eeb21a2eb71 23-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Last patch, for now, to privde ObjC's encoding of types.
We now pass all gcc's encoding compatibility tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61387 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6e71edcf013acb364885695ab4831a8403a2c4cd 23-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Don't push OverloadedFunctionDecls onto the chain of declarations
attached to an identifier. Instead, all overloaded functions will be
pushed into scope, and we'll synthesize an OverloadedFunctionDecl on
the fly when we need it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
6ed40e351a7c1fb3084434f1db19216b79623cf0 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't push OverloadedFunctionDecls onto the chain of declarations
attached to an identifier. Instead, all overloaded functions will be
pushed into scope, and we'll synthesize an OverloadedFunctionDecl on
the fly when we need it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61386 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
e07d9eceab544ec31478daadcc7d53fffdbf9898 23-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Lot more encoding work. We are closing the gap to
gcc compatibilty in all aspects of encoding now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61383 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a1c033e9514865f3a7b0d8b3b20e6de926cfec6c 23-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Lot more encoding work. We are closing the gap to
gcc compatibilty in all aspects of encoding now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61383 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ddfd9d5d81715686bf47f8bf577ead557d5f3c83 23-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Don't explicitly represent OverloadedFunctionDecls within
DeclContext. Instead, just keep the list of currently-active
declarations and only build the OverloadedFunctionDecl when we
absolutely need it.

This is a half-step toward eliminating the need to explicitly build
OverloadedFunctionDecls that store sets of overloaded
functions. This was suggested by Argiris a while back, and it's a good
thing for several reasons: first, it eliminates the messy logic that
currently tries to keep the OverloadedFunctionDecl in sync with the
declarations that are being added. Second, it will (eventually)
eliminate the need to allocate memory for overload sets, which could
help performance. Finally, it helps set us up for when name lookup can
return multiple (possibly ambiguous) results, as can happen with
lookup of class members in C++.

Next steps: make the IdentifierResolver store overloads as separate
entries in its list rather than replacing them with an
OverloadedFunctionDecl now, then see how far we can go toward
eliminating OverloadedFunctionDecl entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61357 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3fc749d899dfc194162128c1a88933148a39b68d 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't explicitly represent OverloadedFunctionDecls within
DeclContext. Instead, just keep the list of currently-active
declarations and only build the OverloadedFunctionDecl when we
absolutely need it.

This is a half-step toward eliminating the need to explicitly build
OverloadedFunctionDecls that store sets of overloaded
functions. This was suggested by Argiris a while back, and it's a good
thing for several reasons: first, it eliminates the messy logic that
currently tries to keep the OverloadedFunctionDecl in sync with the
declarations that are being added. Second, it will (eventually)
eliminate the need to allocate memory for overload sets, which could
help performance. Finally, it helps set us up for when name lookup can
return multiple (possibly ambiguous) results, as can happen with
lookup of class members in C++.

Next steps: make the IdentifierResolver store overloads as separate
entries in its list rather than replacing them with an
OverloadedFunctionDecl now, then see how far we can go toward
eliminating OverloadedFunctionDecl entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61357 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
89ed86b24a37ad07dab38cb70b55378ebf87a581 23-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> More encoding support; in this case, encoding of
outer-most const of pointer types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61355 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5b8c7d9fb620ba3a71e996d61e7b9bdf763b5c09 23-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> More encoding support; in this case, encoding of
outer-most const of pointer types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61355 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
237116b372f05f0c504c86f99d945b8f783368bc 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Full AST support and better Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61346 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtSerialization.cpp
8351da06ca3082dfd49dd8e3c1785a986920f57c 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Full AST support and better Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61346 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtSerialization.cpp
2255ed3b273cb34e0605dc2ab51becc9474b1e9e 22-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug showed up the meta-data for protocol
instance methods by building print-class-info.m,
whose output is now identical to what gcc puts out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61339 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
669e8d3c6a89c1ff45500d36dde7011b3cf7af7c 22-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug showed up the meta-data for protocol
instance methods by building print-class-info.m,
whose output is now identical to what gcc puts out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61339 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
743c81609db46cce8a881fac6d295774687ff035 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Partial AST and Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61337 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtSerialization.cpp
4b07b2968f87f3cd5a3d8c76145f1cbfd718d42d 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Partial AST and Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61337 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
tmtSerialization.cpp
3257fb58ef6583ce20036c77a8c5af95f158f2d3 22-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Add support for calls to overloaded member functions. Things to note:
- Overloading has to cope with having both static and non-static
member functions in the overload set.
- The call may or may not have an implicit object argument,
depending on the syntax (x.f() vs. f()) and the context (static
vs. non-static member function).
- We now generate MemberExprs for implicit member access expression.
- We now cope with mutable whenever we're building MemberExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61329 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
88a3514f36de96b19cdf50141c640df1a5f13f6c 22-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for calls to overloaded member functions. Things to note:
- Overloading has to cope with having both static and non-static
member functions in the overload set.
- The call may or may not have an implicit object argument,
depending on the syntax (x.f() vs. f()) and the context (static
vs. non-static member function).
- We now generate MemberExprs for implicit member access expression.
- We now cope with mutable whenever we're building MemberExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61329 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
774f9c7765d2c33aa662e1c9691357dc8b4e4006 21-Dec-2008 Anders Carlsson <andersca@mac.com> Add codegen support for __null

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61314 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3f70456b8adb0405ef2a47d51f9fc2d5937ae8ae 21-Dec-2008 Anders Carlsson <andersca@mac.com> Add codegen support for __null

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61314 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
80da19af36def1479ad6af798447cc09b68fcf2d 21-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Correct comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61311 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
c994bb2b800d4aef4c42b5a58f33cb7816dbf7f0 21-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> Correct comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61311 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
605ad512e8fd47fdd7ccd90743ff95ebb7fa549c 21-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> fix 80-col violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61306 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
8ce66662130b09c6cf525eb160a9a4c0a544ca0c 21-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> fix 80-col violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61306 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
76d19c8cce8b1b664a6e95bbf33e328227945fff 21-Dec-2008 Anders Carlsson <andersca@mac.com> Add ASTContext::getBaseElementType and use it in CodeGenFunction::EmitArraySubscriptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61303 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6183a99b064b397d98297904fbd6cf00fe1f453d 21-Dec-2008 Anders Carlsson <andersca@mac.com> Add ASTContext::getBaseElementType and use it in CodeGenFunction::EmitArraySubscriptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61303 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0dd0e37f7f54bc710c7f656e28ca4ab63ff9284c 21-Dec-2008 Anders Carlsson <andersca@mac.com> Did not mean to commit this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61296 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
97e0179f1ae545e07d9f5e7c1d2ef5c5bab06676 21-Dec-2008 Anders Carlsson <andersca@mac.com> Did not mean to commit this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61296 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
3bb57e845cf801eec463777d796d1a3d0d75e266 21-Dec-2008 Anders Carlsson <andersca@mac.com> Handle VLA indexing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61295 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
8b33c087fc6d97064b6620c96c732ebc5c003fb2 21-Dec-2008 Anders Carlsson <andersca@mac.com> Handle VLA indexing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61295 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
82d44776fc817d80b1985d9d8e86453d4f15995c 21-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtSerialization.cpp
86f194083504938df72135b5b66bf0c5cafd9498 21-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtSerialization.cpp
e26cb43f48421366ffc0d3c28b8e703a010f1089 21-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Finish up saving original parameter type and
using it in ObjC's method parameter encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61293 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclSerialization.cpp
4306d3cb9116605728252e2738df24b9f6ab53c3 21-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Finish up saving original parameter type and
using it in ObjC's method parameter encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61293 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclSerialization.cpp
a7babab8e48caf9e02dcee78ef5a81625f64ac6d 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Add case for the new AST node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61287 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
4f5420d623831cceb567392067aa31ed2d3c37f6 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Add case for the new AST node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61287 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
160e8819e15a531dadfc6cffb45eaebdb41e3f89 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> introducing ParmVarWithOriginalTypeDecl class to
keep track of the original parameter decl. types.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61286 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
73da9e462576faedc2cdf96b37a1c072b404b73d 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> introducing ParmVarWithOriginalTypeDecl class to
keep track of the original parameter decl. types.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61286 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
320ac42c8940dd08aec9712e6081314661973649 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Strangely enough, name of ObjC class is not encoded into the
full encoding of the class which has an ivar of pointer to this
class. Its name is encoded in the type for the ivar in the
ivar-list metadata. This patch conforms to the above rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61282 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
adcaf544a9d863a4afb29cc5420095320fccafd8 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Strangely enough, name of ObjC class is not encoded into the
full encoding of the class which has an ivar of pointer to this
class. Its name is encoded in the type for the ivar in the
ivar-list metadata. This patch conforms to the above rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61282 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0cd547f8f4ee15e03c4b8ef47895e319437b27b2 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> More encoding support. This time for
@encode of classes and bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61268 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
43822eaeddeaa419b90f23c68af6b23c46788a58 20-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> More encoding support. This time for
@encode of classes and bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61268 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8c3de809dc733ca29f1d07c73684be65b3f10785 19-Dec-2008 Anders Carlsson <andersca@mac.com> Get rid of the old Expr::Evaluate variant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61260 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
1c0cfd4599e816cfd7a8f348286bf0ad79652ffc 19-Dec-2008 Anders Carlsson <andersca@mac.com> Get rid of the old Expr::Evaluate variant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61260 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
c867947662a5a7e8d02d9fb32069879a259d218b 19-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Several@encode bug fixes for ObjC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61231 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c166d7390c300e84a0001c016b83f8aa6de9cf53 19-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Several@encode bug fixes for ObjC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61231 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ea944844821d8e07b87937a8e9cb02a5a611cc11 18-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Removed a slot in ObjCMemRegExpr used in
code gen which did not belong there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61203 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtSerialization.cpp
efc4c4bdbd8fee90b93deb3b5cfaeb044ae22557 18-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Removed a slot in ObjCMemRegExpr used in
code gen which did not belong there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61203 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
tmtSerialization.cpp
30fb1dadba2e4a675759c3b26dd43510eabed0ef 18-Dec-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=3189.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61202 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d8df6823420c22329a2a9aacd2a440368d38d86c 18-Dec-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=3189.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61202 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c98406ebcb31b1616f77e27ba30de8a7f6b0c6a1 18-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix leakage of var's initializers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61171 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
99f06ba988922ea721035a89e6d3c66ba100ba8a 18-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix leakage of var's initializers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61171 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
355a8681f2f285a8bbe0711df5ef4464b3b90b0c 17-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix a few more memory leaks: clean the ASTRecordLayouts, ASTObjCInterfaces and ASTRecordForInterface maps

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61163 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b74668edbc119880eb0a7e563432314432cb775d 17-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix a few more memory leaks: clean the ASTRecordLayouts, ASTObjCInterfaces and ASTRecordForInterface maps

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61163 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0556b1563848eb53ac71b24d0ab6411bace87214 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This patch will build the Records lazily per Steve's comments.
Note that one test duplicate-ivar-check.m will fail because I
need to re-implement duplicate ivar checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61154 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
a769c004a2874504c17ea8afccbc4ad35fc33c9f 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This patch will build the Records lazily per Steve's comments.
Note that one test duplicate-ivar-check.m will fail because I
need to re-implement duplicate ivar checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61154 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
f7bae35a736f2623441bba90686b7e76824a6c9a 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Added comment to Steve's patch to clarify the case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61144 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c9ca4a23b1d2a2d923b283e7022a39c7aa5e87b2 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Added comment to Steve's patch to clarify the case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61144 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f188f2f6e311d5c45359f2aefd3d6b0e7dd8f7a4 17-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6450964> clang on xcode: Assertion failed: (RecordForDecl && "lookupFieldDeclForIvar no storage for class").

This was a recent regression caused by r61043 (related to code gen. for ivar references).

Fariborz, please review. I have some other concerns related to code generation for ivars that we can discuss later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61134 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7d1117d93cb6cc57db6157478f02ebc0f0a1060c 17-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6450964> clang on xcode: Assertion failed: (RecordForDecl && "lookupFieldDeclForIvar no storage for class").

This was a recent regression caused by r61043 (related to code gen. for ivar references).

Fariborz, please review. I have some other concerns related to code generation for ivars that we can discuss later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61134 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0c3ab04bbbef9718dc1578efcff573dd47dca3ab 17-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Make sure that enumerators show up within the enumeration declaration. Fixes. PR clang/3220

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61116 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
45579f5e2904590ff9a4f48c7fbf2e60dccb0426 17-Dec-2008 Douglas Gregor <dgregor@apple.com> Make sure that enumerators show up within the enumeration declaration. Fixes. PR clang/3220

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61116 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ad17e37ac2ad69b67ae6a1559658d46617a44eac 16-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Make linkage-specifications hold on to all of their declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61110 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclSerialization.cpp
f44515a49b549171dc3ee9faa6281b72609da563 16-Dec-2008 Douglas Gregor <dgregor@apple.com> Make linkage-specifications hold on to all of their declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61110 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
eclSerialization.cpp
60f7df803ca227871aded4273a86689fc1bfc327 16-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Warning fixes to operator precedence warnings.

Someone should double-check that I didn't somehow break ObjC
serialization; I think the change there actually changes the semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61098 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
tmtSerialization.cpp
e8e3205b22e388588396ef41fd4bbe437d325a57 16-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Warning fixes to operator precedence warnings.

Someone should double-check that I didn't somehow break ObjC
serialization; I think the change there actually changes the semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61098 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
tmtSerialization.cpp
519648829f41da741c871c0ff8122dd956259a59 16-Dec-2008 Nate Begeman <natebegeman@mac.com> Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61097 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
fea8685bf3036b199c573e70b03affde2583fc44 16-Dec-2008 Nate Begeman <natebegeman@mac.com> Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61097 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
0c06709cc33705527581f9aa3c9769843fedf130 16-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Diagnose that ivars in current and super class may not
be duplicates and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61068 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3281eff4c1fbf7e2e59cc5381d5270deaf06839e 16-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Diagnose that ivars in current and super class may not
be duplicates and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61068 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
cb8e803696224e723e294d7e3ef79e5e393493eb 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Name of addLayoutToClass is confusing as no layout calculation
is done. Layout is calculated lazily at code gen type.
This patch changes the name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61054 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9ee92e84ecf085ccbe6f877d1c6e1500961bbbce 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Name of addLayoutToClass is confusing as no layout calculation
is done. Layout is calculated lazily at code gen type.
This patch changes the name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61054 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b9213832bca8e9a31450604e56a1da067fea4b7c 15-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Place constructors and destructors into the DeclContext of the class,
just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.

Diagnose the redeclaration of member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61048 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9e7d9de3ef538c1473248238b76a6d7b16f5f684 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Place constructors and destructors into the DeclContext of the class,
just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.

Diagnose the redeclaration of member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61048 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
86008c06acdaccb4308c514a4d5c56e3023e72fb 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Code gen. for ivar references; including bitfield
ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61043 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
fd64bb635dc221baa19f81d5d2a084f7eb269f7f 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Code gen. for ivar references; including bitfield
ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61043 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
138f7bb17b4a984747449ec1521546b28a5bffc2 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Removed setRecordForDecl. Added a FIXME.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61038 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9fbb609b90c1b41e147cf3e6afac40ff4b4137da 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Removed setRecordForDecl. Added a FIXME.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61038 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
789e17157be71cccb25b2443a4623bd7b91613c9 15-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Don't double-destroy constructors defined out-of-line. This is a
half-solution; the real solution is coming when constructors and
destructors are treated like all other functions by ActOnDeclarator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61037 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
0874bd31984529b71aa4ffaac73be948e2402222 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't double-destroy constructors defined out-of-line. This is a
half-solution; the real solution is coming when constructors and
destructors are treated like all other functions by ActOnDeclarator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61037 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
ae644896ecccf05b5497a311a8a55112023a0b83 15-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Create new EnumDecl nodes for redeclarations of enums, linking them
together in the same way that we link RecordDecl/CXXRecordDecl nodes.

Unify ActOnTag and ActOnTagStruct.

Fixes PR clang/2753.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61034 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
7df7b6bb800e1987951285ea192e4f347e1b603a 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Create new EnumDecl nodes for redeclarations of enums, linking them
together in the same way that we link RecordDecl/CXXRecordDecl nodes.

Unify ActOnTag and ActOnTagStruct.

Fixes PR clang/2753.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61034 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
1640bf272e7282e9d3fe366403e7cee2317f33e7 14-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> dont call iterator::end() on every cycle and dont read already-deleted memory

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61015 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
f9d1e4bc60690386e0b2c658d707b75a77717a9c 14-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> dont call iterator::end() on every cycle and dont read already-deleted memory

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61015 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
8a030479f0dda4f8e49a32245b5d004b787ff5ed 14-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> minor WS fix for the previous commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61008 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
640b3199143eca2077436b970a5630ae25e437eb 14-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> minor WS fix for the previous commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61008 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
8f3bb2ad8633ee731e36c5f486f2f72920d503b8 14-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix leakage of CXXSpecialName objects in DeclarationNameTable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61007 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
6d34ae5370a41268cc7c39b05e287cab1786fa8e 14-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix leakage of CXXSpecialName objects in DeclarationNameTable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61007 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
09772396cb7b6c47b05858ae74e78b113adf3821 13-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Patch for ObjCIvarRefExpr containing the field
matching the storage layout for this ivar


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60996 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
tmtSerialization.cpp
aaa63a761c6671a08e3f4f463435b72739fa194b 13-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Patch for ObjCIvarRefExpr containing the field
matching the storage layout for this ivar


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60996 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
tmtSerialization.cpp
624921a9c7054a2613a5ac57e44320cc6b9adcc6 13-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Add storage layout to ObjC classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60993 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
60f8c868ffb346b78451a3eccaecd0461d2ae498 13-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Add storage layout to ObjC classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60993 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2a6a5b3420dca8980d7a71b3f8c71fed8505159e 12-Dec-2008 Chris Lattner <sabre@nondot.org> Implement the final (hopefully) wrinkle to i-c-e + builtin_constant_p
processing: it allows arbitrary foldable constants as the operand of ?: when
builtin_constant_p is the condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60954 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
42b83dde7c700b34f9435ad746984169888ae705 12-Dec-2008 Chris Lattner <sabre@nondot.org> Implement the final (hopefully) wrinkle to i-c-e + builtin_constant_p
processing: it allows arbitrary foldable constants as the operand of ?: when
builtin_constant_p is the condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60954 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1d0214b031046fa7b7d28b0131db17258f26e3d8 12-Dec-2008 Chris Lattner <sabre@nondot.org> add a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60935 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1f64805512decc6106cd7dc28f5af5a4d9c81781 12-Dec-2008 Chris Lattner <sabre@nondot.org> add a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60935 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
45e71bf22932eac0a8ce0d0fed8eb7d75d1ea296 12-Dec-2008 Chris Lattner <sabre@nondot.org> implement rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60934 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
28daa53db73341b7ee7f269924ccfca1c6d179ac 12-Dec-2008 Chris Lattner <sabre@nondot.org> implement rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60934 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a5f779dcfbc19b7387936032c6fccc39dc6ff690 12-Dec-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60924 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
670a62cd1d51042ea076cda5e93f26a1d8327fb3 12-Dec-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60924 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3967762597e4c1f410a83493df22f38432557a61 11-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Address some comments on the name lookup/DeclContext patch from Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60897 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
e267ff35b2f4e9d2b0d8bf24109d41cc7398b61b 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Address some comments on the name lookup/DeclContext patch from Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60897 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
640a04ba33ae3fb9de6bed628cd70ee679f8d808 11-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Actually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60883 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a4c46df1cd63e06af2a094b68b902a3eb232f056 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Actually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60883 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8acb72795794649013477457cd06a0d3871a2374 11-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).

* Implement C++ qualified name lookup in terms of lookup into
DeclContext.

* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)

* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.

* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).

* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclSerialization.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
44b4321feab46299d3f5cfd404680884752a0fcf 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).

* Implement C++ qualified name lookup in terms of lookup into
DeclContext.

* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)

* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.

* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).

* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclObjC.cpp
eclSerialization.cpp
eclarationName.cpp
xpr.cpp
xprConstant.cpp
28ceff7ac40945e5aaa19d9797c728dbbea4d635 10-Dec-2008 Steve Naroff <snaroff@apple.com> The "real" fix for <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,

Commit r60845 was premature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60852 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bc76dd06eb881c70c9775b74bab8b88cd747f173 10-Dec-2008 Steve Naroff <snaroff@apple.com> The "real" fix for <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,

Commit r60845 was premature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60852 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a5d84611d43742b51455d181bdeda14039dcf694 10-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Some cleanups to the dependent-types commit, as suggested by Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60848 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
83f96f668d0bcc957ead2032fe6e6c475dc156e5 10-Dec-2008 Douglas Gregor <dgregor@apple.com> Some cleanups to the dependent-types commit, as suggested by Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60848 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
da32905351bf68b36efea937c96b9253a9825e78 10-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60845 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4e78fd0a960eaa7e97467f2e8f390f3a57da279b 10-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60845 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
09e1b9ef48a1e84be742749ad627c994544d0e3f 10-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6418623> Bogus block type compatibility warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60842 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c0febd58f5cbf4a93fd12f461863564dba0af76d 10-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6418623> Bogus block type compatibility warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60842 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0b7716c97e779a2a99ab782e7f2493cb153c5465 09-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Prevent bogus warning on unimplemented setter/getter when user
has added declaration of these methods in its @interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60803 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
91b51a92f2e9fc8025b6a9df88442840eb62823a 09-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Prevent bogus warning on unimplemented setter/getter when user
has added declaration of these methods in its @interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60803 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
91dd9d3cabbe94e48dd24bfe318a9ee5a9b21617 09-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60792 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
fef30b55230064d334a669a065a1c9acdb87cdfe 09-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60792 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c74ac3ef6cc236ddb15e6fa96a273a79ae9e073b 09-Dec-2008 Ted Kremenek <kremenek@apple.com> Add preliminary CFG support for @throw. We basically treat it like a return statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60790 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2fda504dccd79f91ac9a7d82acecfbab3eaa1719 09-Dec-2008 Ted Kremenek <kremenek@apple.com> Add preliminary CFG support for @throw. We basically treat it like a return statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60790 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
af15180f3bd423cf6e7c6c3968d2c948eb7916d7 08-Dec-2008 Steve Naroff <snaroff@apple.com> ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories protocols.

Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize'



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60716 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b79c01ea321687d8b9e82968395f30c5c261a6b0 08-Dec-2008 Steve Naroff <snaroff@apple.com> ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories protocols.

Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize'



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60716 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8b10a236807d63770af83143f30efaa99982ea2a 08-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Workaround for PR3173. The fix is correct in the sense that if the enum
code were working correctly, it would be a no-op, but it's not really a
proper fix. That said, I don't really want to touch the enum code at
the moment because I don't understand it very well, and this seems to
be a relatively visible regression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60680 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e9a0f43927041e2bcc89140c338dfae207ad3c3b 08-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Workaround for PR3173. The fix is correct in the sense that if the enum
code were working correctly, it would be a no-op, but it's not really a
proper fix. That said, I don't really want to touch the enum code at
the moment because I don't understand it very well, and this seems to
be a relatively visible regression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60680 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
acad6d1ae92bf3150fce97137889e1ec19fa7316 07-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Use of properties declared in protocols in the category
via the category's protocol list1s, with appropriate
diagnsostics and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60634 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1ac2bc44781ec8451f880dcf586768a71824d3a6 07-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Use of properties declared in protocols in the category
via the category's protocol list1s, with appropriate
diagnsostics and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60634 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a133e26a86b181df1188a7af7671db790b5e56b2 06-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Add support for calls to dependent names within templates, e.g.,

template<typename T> void f(T x) {
g(x); // g is a dependent name, so don't even bother to look it up
g(); // error: g is not a dependent name
}

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60618 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
5c37de788529cd9180f22069970737a7208bd625 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for calls to dependent names within templates, e.g.,

template<typename T> void f(T x) {
g(x); // g is a dependent name, so don't even bother to look it up
g(); // error: g is not a dependent name
}

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60618 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
1b21c7ffe5fac1711fea35e4830159004a835c1a 06-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
xpr.cpp
tmtIterator.cpp
ype.cpp
ypeSerialization.cpp
898574e7496ba8fd76290079d3a9d06954992734 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
xpr.cpp
tmtIterator.cpp
ype.cpp
ypeSerialization.cpp
17eb888fd0f167ea9cd91ed7e0c03e1ffb6d7f84 05-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60611 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9482a4f0feca4bc9eb7c6ad36e21cbf7365f5359 05-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60611 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6834228be513a9bf574db13b214cc31b3312d936 05-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This test checks for duplicate implementation of the same
property. It also checks for duplicate use of the same ivar
in two different iproperty implementations. It also caught
an error for a test case used in CodeGen :).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60610 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ae6f6fd1527a1da84679a6f0439dec3bbbd6ca7b 05-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This test checks for duplicate implementation of the same
property. It also checks for duplicate use of the same ivar
in two different iproperty implementations. It also caught
an error for a test case used in CodeGen :).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60610 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
dd861060e2e1f1e41f7b023d025fcd8eb183686d 05-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Representation of template type parameters and non-type template
parameters, with some semantic analysis:
- Template parameters are introduced into template parameter scope
- Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
xpr.cpp
ype.cpp
ypeSerialization.cpp
72c3f314d92d65c050ee1c07b7753623c044d6c7 05-Dec-2008 Douglas Gregor <dgregor@apple.com> Representation of template type parameters and non-type template
parameters, with some semantic analysis:
- Template parameters are introduced into template parameter scope
- Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
xpr.cpp
ype.cpp
ypeSerialization.cpp
4ab88daaf9b697c652d94e7ae0fdfc34cfb18afb 05-Dec-2008 Anders Carlsson <andersca@mac.com> This wasn't such a good idea after all as it broke some tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60582 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d407a7619904c81d38b41a9ee850de413105084b 05-Dec-2008 Anders Carlsson <andersca@mac.com> This wasn't such a good idea after all as it broke some tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60582 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8f92cddb6bb9a01870f817d38499df494c2845b2 05-Dec-2008 Anders Carlsson <andersca@mac.com> Handle __builtin___CFStringMakeConstantString in Expr::Evaluate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60581 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b3fee0f06422074f5c62144b727434562815c691 05-Dec-2008 Anders Carlsson <andersca@mac.com> Handle __builtin___CFStringMakeConstantString in Expr::Evaluate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60581 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0e94841a989c315c43036c17c752d7136dcf9db2 04-Dec-2008 Steve Naroff <snaroff@apple.com> Several things...

- Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter().

- Implement FIXME: for pretty printing ObjCPropertyRefExpr's.

- Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the ".").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60540 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtSerialization.cpp
c77a636688e188af7e7a9a05829e542adb48e880 04-Dec-2008 Steve Naroff <snaroff@apple.com> Several things...

- Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter().

- Implement FIXME: for pretty printing ObjCPropertyRefExpr's.

- Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the ".").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60540 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtSerialization.cpp
9f81c3f85fd1094083ecd8d30a5a8f6774196eae 04-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This should satisfy compilers and language lawyers alike.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60511 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtSerialization.cpp
d457589fc69dc7a9c80cd74d317c0b81a35a27c9 04-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This should satisfy compilers and language lawyers alike.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60511 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtSerialization.cpp
516432a1564507ec796b108746a107df8879fc9d 02-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Correct pretty printing of array new expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60444 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
6fec64874f282f7084d5c626e42241cdcbafac9d 02-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Correct pretty printing of array new expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60444 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
66df3efdf5d6a2d2b0a1e2f8764150f9af931d40 02-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Handle new by passing the Declaration to the Action, not a processed type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
cee63fbf0e64ac526582312bf8cf33263fc5c16e 02-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Handle new by passing the Declaration to the Action, not a processed type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ecfbb49cc91d777ddddb2c94950560771bb91661 02-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This patch corrects problem in searching for a setter/getter method for
a property. Previous scheme of seaching in interface's list of methods
would not work because this list is not yet constructed. This is in preparation
for doing semantic check on viability of setter/getter method declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60386 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b85cce6498c8c1c20f701571d85a3b2fe53338eb 02-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This patch corrects problem in searching for a setter/getter method for
a property. Previous scheme of seaching in interface's list of methods
would not work because this list is not yet constructed. This is in preparation
for doing semantic check on viability of setter/getter method declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60386 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
110be847fd1ea643907239b3794fa60a19276244 01-Dec-2008 Steve Naroff <snaroff@apple.com> -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
-Start adding support for rewriting @synthesize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60368 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
d40910b581b09c937a8c1fdcde9b8ec724398fb9 01-Dec-2008 Steve Naroff <snaroff@apple.com> -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
-Start adding support for rewriting @synthesize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60368 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
fa6040167317bb95f67c32d0752c47746c21b7b0 01-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Use EmitInt, not Emit, to emit unsigned values

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60364 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
19ac6ff24ed0434ad9e00db74926195fc4ba0f3e 01-Dec-2008 Douglas Gregor <dgregor@apple.com> Use EmitInt, not Emit, to emit unsigned values

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60364 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
197f6f760a7afb425ede1171e0aeaf0adad09e39 01-Dec-2008 Anders Carlsson <andersca@mac.com> Generate the correct results for the comma expression. Fixes PR3123.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60334 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4fdfb0965b396f2778091f7e6c051d17ff9791ba 01-Dec-2008 Anders Carlsson <andersca@mac.com> Generate the correct results for the comma expression. Fixes PR3123.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60334 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f8aa870bd0b800f52f4944c885f41b7ba3e7cfd2 01-Dec-2008 Anders Carlsson <andersca@mac.com> Revert change that made isNullPointerConstant start emitting warnings. We don't want that :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60333 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d26527708b2b2f3b1d747f570efd10149d48364e 01-Dec-2008 Anders Carlsson <andersca@mac.com> Revert change that made isNullPointerConstant start emitting warnings. We don't want that :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60333 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
fbdd2e60ba2abb92091b6eb0fd868643f05e74d6 01-Dec-2008 Anders Carlsson <andersca@mac.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60320 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
07b5cc0f4047761acb32550c4463a68a2ceca6d7 01-Dec-2008 Anders Carlsson <andersca@mac.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60320 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2ce7c3d4f4da502d629ddeeab31f4513568fffe6 01-Dec-2008 Anders Carlsson <andersca@mac.com> Add a new variant of isNullConstantExpr that returns an EvalResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60318 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
efa9b3877ef298bcb792600ac33521827e1f7faf 01-Dec-2008 Anders Carlsson <andersca@mac.com> Add a new variant of isNullConstantExpr that returns an EvalResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60318 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b1112adb72a8588d187c22e17ce950f707373a14 01-Dec-2008 Anders Carlsson <andersca@mac.com> Emit the correct diagnostic when a comma is in an ICE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60316 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
027f62ec1860f4ab0c91bd863b238938880b8102 01-Dec-2008 Anders Carlsson <andersca@mac.com> Emit the correct diagnostic when a comma is in an ICE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60316 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
38bb18c93c6b66f86259ee485b76c762f7cd8f54 30-Nov-2008 Anders Carlsson <andersca@mac.com> Change the diagnostics that the evaluator reports to be of type NOTE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60301 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0e8acbbba71ec6acd5dceb4fcbce63e463e1b755 30-Nov-2008 Anders Carlsson <andersca@mac.com> Change the diagnostics that the evaluator reports to be of type NOTE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60301 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6c1a9e212ff75e8edd00461325459244ab5db8ac 30-Nov-2008 Anders Carlsson <andersca@mac.com> Replace the isEvaluated bool with a ShortCircuit int, making it easier to handle recursion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60300 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f0c1e4b679e15c26bffb5892e35985bf3c52f77a 30-Nov-2008 Anders Carlsson <andersca@mac.com> Replace the isEvaluated bool with a ShortCircuit int, making it easier to handle recursion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60300 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fa76d82a762e63ec42b490f72ca10a2e5184e94a 30-Nov-2008 Anders Carlsson <andersca@mac.com> Pass the expression to the Error and Extension methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60299 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
82206e267ce6cc709797127616f64672d255b310 30-Nov-2008 Anders Carlsson <andersca@mac.com> Pass the expression to the Error and Extension methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60299 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7f5a96e2826091bf0be09b23574d04fa6cffa05e 30-Nov-2008 Anders Carlsson <andersca@mac.com> Add a new variant of Evaluate and reimplement the old Evaluate in terms of the new.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60298 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5b45d4ef1ea3f04ec863daf8aa29be6c6e021750 30-Nov-2008 Anders Carlsson <andersca@mac.com> Add a new variant of Evaluate and reimplement the old Evaluate in terms of the new.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60298 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
501da1f9a5567920d45b515e6c138d4aea2ed1c9 30-Nov-2008 Anders Carlsson <andersca@mac.com> General cleanup, evaluate the RHS of a logical op even if the LHS will give us the result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60297 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fcb4d09531abbf2a5cf398c2f946fb3bc2875f64 30-Nov-2008 Anders Carlsson <andersca@mac.com> General cleanup, evaluate the RHS of a logical op even if the LHS will give us the result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60297 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
dd8d41fbf1e88ae0654338f6250542874668a8e8 30-Nov-2008 Anders Carlsson <andersca@mac.com> EvalInfo now holds a reference to an EvalResult struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60296 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
54da0496616cb898596cfd5fae1f824098bd8435 30-Nov-2008 Anders Carlsson <andersca@mac.com> EvalInfo now holds a reference to an EvalResult struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60296 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ad4b379662af0511244a62578cda472bef00a7e2 29-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Implement the GNU __null extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60235 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
2d8b273470684a9cd47f0ce24743cc1f71ef7cbc 29-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement the GNU __null extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60235 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
48a3432a72fd17868c0bf4d864ddb60420c63d68 29-Nov-2008 Chris Lattner <sabre@nondot.org> Switch QualType to use llvm::PointerIntPair internally to do the pointer
bitmangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60226 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
5cf243a883872441d73ca49cea7e20de5802629b 29-Nov-2008 Chris Lattner <sabre@nondot.org> Switch QualType to use llvm::PointerIntPair internally to do the pointer
bitmangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60226 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
74bf70113be81b2a9554cb602156af9c7d5bd144 26-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> remove debug-only assertion in the complex float evaluator as it makes some real apps crash

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60069 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cfe257198c3ace5dfa79365be8cfc55c3e400d4e 26-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> remove debug-only assertion in the complex float evaluator as it makes some real apps crash

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60069 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4739da15300381a2b2f65460b3937de2e380d06a 25-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Refactored checking on readonly property into a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60050 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
xpr.cpp
31afbf02a381ae9c77d225aa54f972d152838b3a 25-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Refactored checking on readonly property into a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60050 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
xpr.cpp
48b1a131cf4d32d34f206881a655e16fabfb8338 25-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to allow over-riding of readonly property to
a writable property in one of its category.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60035 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6669db9d80d77d10f101aa9f8e488bbd2d98f76c 25-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to allow over-riding of readonly property to
a writable property in one of its category.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60035 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3addf9d3e1adc84f34cc4ec7f9507377d4a4c86c 25-Nov-2008 Anders Carlsson <andersca@mac.com> Remove more #ifdeffed code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60033 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c9ad94e12aaf667e02c7297a663fc93090e1d2cb 25-Nov-2008 Anders Carlsson <andersca@mac.com> Remove more #ifdeffed code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60033 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d19e99e521f419b2c8902631224a6abe298657f8 24-Nov-2008 Ted Kremenek <kremenek@apple.com> Fix CFG bug where the 'increment' block for a 'for' statement would not be
properly reversed once constructed.

This fixes PR 3125:

http://llvm.org/bugs/show_bug.cgi?id=3125


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59982 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d0172439194b28bae62a94a0a25d58e6d21e7a14 24-Nov-2008 Ted Kremenek <kremenek@apple.com> Fix CFG bug where the 'increment' block for a 'for' statement would not be
properly reversed once constructed.

This fixes PR 3125:

http://llvm.org/bugs/show_bug.cgi?id=3125


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59982 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a7fa2aa49c075fe5fc82f37fc4ff447be0a492bb 24-Nov-2008 Anders Carlsson <andersca@mac.com> Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59946 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e8a32b855ce4e8580a191f8d29d2f3f459834302 24-Nov-2008 Anders Carlsson <andersca@mac.com> Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59946 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e284ebe0ab22be5dfc3e9c4a90a48d4f3a624712 24-Nov-2008 Anders Carlsson <andersca@mac.com> The address of a variable is only constant if the variable has global storage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59939 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
35873c49adad211ff466e34342a52665742794f5 24-Nov-2008 Anders Carlsson <andersca@mac.com> The address of a variable is only constant if the variable has global storage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59939 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8bce31a8e2d8483e61b080a5824f5f758cbf3154 24-Nov-2008 Anders Carlsson <andersca@mac.com> Fix bug in the constant evaluator. Fixes PR3115.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59938 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4bbc0e05a714d4ee4918a92a4a7049dd6ef33ad0 24-Nov-2008 Anders Carlsson <andersca@mac.com> Fix bug in the constant evaluator. Fixes PR3115.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59938 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6c5ec6227d93a03794ee5b4435567c4b6a0cdbd3 24-Nov-2008 Chris Lattner <sabre@nondot.org> Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59937 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
tmtDumper.cpp
tmtPrinter.cpp
ype.cpp
39f34e97d6a468f0a7dfa5664c61217cffc65b74 24-Nov-2008 Chris Lattner <sabre@nondot.org> Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59937 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclarationName.cpp
tmtDumper.cpp
tmtPrinter.cpp
ype.cpp
d120b9ed1f54a3d2b284a6c683c3f6e646a31d26 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier. Update callers to do the right
thing and avoid this method in unsafe cases. This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
tmtDumper.cpp
8ec03f58c33c33a917f54bb7f2cd61b6d7ffe0ca 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier. Update callers to do the right
thing and avoid this method in unsafe cases. This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
tmtDumper.cpp
85fb38430aa9dc807e623f369352987d1de7827b 24-Nov-2008 Chris Lattner <sabre@nondot.org> simplify this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59935 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bb49c3ee5d270485f4b273691fd14bc97403fa5d 24-Nov-2008 Chris Lattner <sabre@nondot.org> simplify this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59935 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3a8f294d0c43fe0a3e1fc1612bc1a42d55172cae 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
eclarationName.cpp
tmtDumper.cpp
tmtPrinter.cpp
077bf5e2f48acfa9e7d69429b6e4ba86ea14896d 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclObjC.cpp
eclarationName.cpp
tmtDumper.cpp
tmtPrinter.cpp
cb6a2e8c3c63ed4c79467eb4d41eb19427ef8cf4 22-Nov-2008 Anders Carlsson <andersca@mac.com> Return false if we encounter a type we can't handle.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59889 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9d4c157baaada8945671dc98363a40ed00cbd824 22-Nov-2008 Anders Carlsson <andersca@mac.com> Return false if we encounter a type we can't handle.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59889 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b96c206f56a403cbc8ef650b887a3fae9dc2156b 22-Nov-2008 Anders Carlsson <andersca@mac.com> Case values must be evaluated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6dde0d5dc09f45f4d9508c964703e36fef1a0198 22-Nov-2008 Anders Carlsson <andersca@mac.com> Case values must be evaluated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e8bd9f2ddf3eee09c36f1d5d8a61fbf5993612f2 22-Nov-2008 Anders Carlsson <andersca@mac.com> Use Expr::Evaluate for case statements. Fixes PR2525

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
51fe996231b1d7199f76e4005ff4c943d5deeecd 22-Nov-2008 Anders Carlsson <andersca@mac.com> Use Expr::Evaluate for case statements. Fixes PR2525

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c05da428caaf67c3b23acf7000fb7e8238d604e9 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implicit property assignment. Error assigning to
'implicit' property with no 'setter'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59878 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
ba8d2d684e74a20bef03828c21c991d222c7e9e5 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implicit property assignment. Error assigning to
'implicit' property with no 'setter'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59878 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
f18d4c8326553440fb01bfeb368b2bc60996cfc2 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
5daf570d0ce027e18ed5f9d66e6b2a14a40b720d 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
19fec9de1274b385dcf711040020945aff5cdb6d 21-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59835 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
4c5d320a7581f4b80b151630c91cea5727fa9923 21-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59835 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
cf4a88942e52689c88d64cfe811cd6a4e15f21f8 21-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Enable some more operator overloading tests, and don't look into an identifier for functions that might not have one

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59818 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4fcd399a52ae45ed8ebfdd3a25e01cfb76fa366d 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Enable some more operator overloading tests, and don't look into an identifier for functions that might not have one

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59818 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
05fb7c8668938447ffdd36d5e15ea697e88db0ba 20-Nov-2008 Chris Lattner <sabre@nondot.org> Rename IdentifierInfo::isName to ::isStr. Use a nifty trick
from Sebastian to enforce that a literal string is passed in,
and use this to avoid having to call strlen on it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59706 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
92e62b02226410bcad8584541b8f1ff4d35ebab9 20-Nov-2008 Chris Lattner <sabre@nondot.org> Rename IdentifierInfo::isName to ::isStr. Use a nifty trick
from Sebastian to enforce that a literal string is passed in,
and use this to avoid having to call strlen on it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59706 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ea7646aa91ef70daf840bf5cbc2e48d23a1c559c 19-Nov-2008 Oscar Fuentes <ofv@wanadoo.es> CMake: Added some source files.

Patch contributed by Jay Foad!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59656 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
148f061354873ce5b0221bcbfa43fa07ec4e5de6 19-Nov-2008 Oscar Fuentes <ofv@wanadoo.es> CMake: Added some source files.

Patch contributed by Jay Foad!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59656 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bc470289a126cf5b24e205ce21ffb8b4a15a980d 19-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Make DeclContext::getLexicalParent reuse DeclContext::getParent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59651 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
051c13a4a99c651e404b4a3160e1173b427eee17 19-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make DeclContext::getLexicalParent reuse DeclContext::getParent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59651 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
9cd599b261c4d48135c43a0a73cd2c188051d669 19-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Take care another assert:

struct A {
struct B;
};

struct A::B {
void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."
};

Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g:

namespace A {
struct S;
}
struct A::S {}; // getParent() == namespace 'A'
// getLexicalParent() == translation unit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59650 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
77407b802130b1c44b1f63b855722a5376f57bca 19-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Take care another assert:

struct A {
struct B;
};

struct A::B {
void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."
};

Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g:

namespace A {
struct S;
}
struct A::S {}; // getParent() == namespace 'A'
// getLexicalParent() == translation unit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59650 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1cea4f4d26bf76872fc42439f1d1b177d400c54b 19-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> fix folding of '*doubleArray'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59647 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a468d34bed16861f25aff6c8354f4e75d3358c1a 19-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> fix folding of '*doubleArray'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59647 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5703f445bef3af2fed61b60a291530670d2b64c0 19-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Make the non-const DeclContext::getParent call the const version, instead of the other way around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59646 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
20bc6762282d192bd19be03094d4f311710e020c 19-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make the non-const DeclContext::getParent call the const version, instead of the other way around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59646 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
80723c56092e182aea4c28cdcdc92b1b8e0c41d3 19-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Support overloading of the subscript operator[], including support for
built-in operator candidates. Test overloading of '&' and ','.

In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59643 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
337c6b9f5d502dc1c5acea628bf7bf9e828efc0e 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Support overloading of the subscript operator[], including support for
built-in operator candidates. Test overloading of '&' and ','.

In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59643 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4f6904d8d02ccd71e23d18e5cd36c1f1c52d9ef7 19-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Added operator overloading for unary operators, post-increment, and
post-decrement, including support for generating all of the built-in
operator candidates for these operators.

C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.

In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59638 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
74253736184c0717a0649922551bf9d8b6815651 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Added operator overloading for unary operators, post-increment, and
post-decrement, including support for generating all of the built-in
operator candidates for these operators.

C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.

In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59638 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
58d3fa50e8d12b07cd2255fe743932c20583cc76 19-Nov-2008 Chris Lattner <sabre@nondot.org> simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59608 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7e3e9b152e06edf329ceb32190d3255f248d4d5f 19-Nov-2008 Chris Lattner <sabre@nondot.org> simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59608 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ae430295aee1b7edf50e4b33d95fe80e21f0b607 19-Nov-2008 Chris Lattner <sabre@nondot.org> formatting


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59599 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e6db3b09a79d4affaa5c7becbfb6bba3c08430c1 19-Nov-2008 Chris Lattner <sabre@nondot.org> formatting


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59599 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
96a32ddc1349db9772d01530425bca2af481f0a2 18-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names.
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator.

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
eclarationName.cpp
xprCXX.cpp
e94ca9e4371c022329270436b3dd77adc4ddfa8f 18-Nov-2008 Douglas Gregor <dgregor@apple.com> Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names.
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator.

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
eclarationName.cpp
xprCXX.cpp
6a2b7fd0027d190eb934a68b04991a12f8892a1c 18-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement effects of 'mutable', and a few comments from Chris on its parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59470 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a11f42f4bca694b9be91350d0a74815f119e3fbf 18-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement effects of 'mutable', and a few comments from Chris on its parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59470 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6704b319467ad5bb8fa89aa800a7e47aba46f5cf 17-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclarationName.cpp
10bd36882406cdf4805e35add1ce2f11ab9ae152 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
eclarationName.cpp
b0212bdede2abd0ca5e893d90464f5b0f3ce9943 17-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59462 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
2def48394f6d48bde0dec2b514193c2b533265b5 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59462 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.cpp
37fb940de30f294356022f3cb9eced40f0933e70 17-Nov-2008 Chris Lattner <sabre@nondot.org> Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension. We don't and
will hopefully never support this.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59460 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ca354faa7e9b99af17070c82b9662a5fca76422c 17-Nov-2008 Chris Lattner <sabre@nondot.org> Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension. We don't and
will hopefully never support this.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59460 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
24afd4accaf5499312f05f1252463c6e0febf16d 17-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclSerialization.cpp
eclarationName.cpp
tmtDumper.cpp
2e1cd4264d363ca869bf37ef160902f211d21b8c 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
MakeLists.txt
ecl.cpp
eclCXX.cpp
eclObjC.cpp
eclSerialization.cpp
eclarationName.cpp
tmtDumper.cpp
02bb9c32056313e00be5117263b07a4fc1ba1322 16-Nov-2008 Anders Carlsson <andersca@mac.com> Address some comments Eli had.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59430 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
529569e68d10b0fd3750fd2124faf742249b846b 16-Nov-2008 Anders Carlsson <andersca@mac.com> Address some comments Eli had.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59430 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
308de750b4f8cd8175c94fd69f04a4a18c926de3 16-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> use HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59429 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a25bd55e63b9ab26ca69390533356aaae7f1a40e 16-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> use HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59429 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ad2794c09816d6b575973be77b03998c2b6c08b8 16-Nov-2008 Anders Carlsson <andersca@mac.com> More complex float evaluator support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59428 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ccc3fce5697e33f005990f9795e1c7cb8b4559ec 16-Nov-2008 Anders Carlsson <andersca@mac.com> More complex float evaluator support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59428 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ef0696643975b7f5db9c9b333cffae2c6a469a5c 16-Nov-2008 Chris Lattner <sabre@nondot.org> rename Expr::tryEvaluate to Expr::Evaluate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
6ee7aa154e8bbb21a21254293410b944f78b0bfe 16-Nov-2008 Chris Lattner <sabre@nondot.org> rename Expr::tryEvaluate to Expr::Evaluate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
f1bb296a9659174314d65b9dceee7f118c8b655c 16-Nov-2008 Anders Carlsson <andersca@mac.com> Add very limited support for evaluating complex floats.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59425 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9ad16aebc0e840a5e7d425da72eb6cbe25e4b58c 16-Nov-2008 Anders Carlsson <andersca@mac.com> Add very limited support for evaluating complex floats.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59425 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d88cb9c91932a55c6ae002bbee9b34647d1e7373 16-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> fix folding of comma if given a non-constant operand.
Eli please take a look, as I'm not sure if this gets the extension warning in the right place

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59422 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f9ef0c675b12ab53fdd6c4e3e7226d066d293e99 16-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> fix folding of comma if given a non-constant operand.
Eli please take a look, as I'm not sure if this gets the extension warning in the right place

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59422 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
eb35c0e46b1ec69aef4ca4ce8e5805a3a3968479 16-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> make IntExprEvaluator fold the ?: operator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59421 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ca7c2eaca35edac066ab7cec15f7ecebbb3731d8 16-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> make IntExprEvaluator fold the ?: operator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59421 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
027f288ffc443017503d3167c419d4b6fbc4834b 16-Nov-2008 Anders Carlsson <andersca@mac.com> More work on the constant evaluator. Eli, it would be great if you could have a look at this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59420 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
3068d117951a8df54bae9db039b56201ab10962b 16-Nov-2008 Anders Carlsson <andersca@mac.com> More work on the constant evaluator. Eli, it would be great if you could have a look at this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59420 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5e0cc7057c9b5fb40a6b1a150045f4b4b5ed875f 16-Nov-2008 Chris Lattner <sabre@nondot.org> add dump and print methods, add operator<< for APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59411 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
64c34f1c6f613eef02a7b488f8edadbe7a8650a8 16-Nov-2008 Chris Lattner <sabre@nondot.org> add dump and print methods, add operator<< for APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59411 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.cpp
ebfa6edc1a7e17d8c569bd85d176c77bba870f02 16-Nov-2008 Anders Carlsson <andersca@mac.com> Add the ability to evaluate comparison operators with floating point numbers as operands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59408 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
286f85e791dda3634fee7f6c67f0ed92296c028f 16-Nov-2008 Anders Carlsson <andersca@mac.com> Add the ability to evaluate comparison operators with floating point numbers as operands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59408 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
23777c2a2c2c8b6a2c33a657d46c09cc1985535b 15-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Use ReadPtr, not ReadUIntPtr through a reinterpret_cast.
Thanks to Sebastian for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59330 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
b0b847e8399898ce41116a32a76790caa4c3c19d 15-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use ReadPtr, not ReadUIntPtr through a reinterpret_cast.
Thanks to Sebastian for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59330 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
65fedaf9bd026cf8863e24eeecade7b2a65e0030 14-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Add a new expression node, CXXOperatorCallExpr, which expresses a
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)

I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59306 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
b4609806e9232593ece09ce08b630836e825865c 14-Nov-2008 Douglas Gregor <dgregor@apple.com> Add a new expression node, CXXOperatorCallExpr, which expresses a
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)

I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59306 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
19330151f7883e8b1271c18b1f237102219a19f4 14-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Don't require us to manually number the statements and expressions in StmtNodes.def. We don't need stable numbers yet, renumbering is a pain, and LAST_STMT had the wrong value anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59300 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
f2cad8633e46cce12fc3d77c0bd451ffd7264baf 14-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't require us to manually number the statements and expressions in StmtNodes.def. We don't need stable numbers yet, renumbering is a pain, and LAST_STMT had the wrong value anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59300 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
tmtPrinter.cpp
65514847a2cbe4b8e46becd496e8ecb832e60a7a 14-Nov-2008 Ted Kremenek <kremenek@apple.com> Fix CFG construction for ObjCForCollectionStmt: 'element' expression can be anything that evaluates to an lvalue


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59289 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4cb3a855df3b3f8d551565cae9f43939a301ea89 14-Nov-2008 Ted Kremenek <kremenek@apple.com> Fix CFG construction for ObjCForCollectionStmt: 'element' expression can be anything that evaluates to an lvalue


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59289 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3d4492e262e9ae7c20fefe1ad886f5382316f358 13-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59260 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bf3af056289893f58d37b05a2c80970708781d61 13-Nov-2008 Douglas Gregor <dgregor@apple.com> Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59260 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5db1ab544a70991372ad530ba653f1ff03209f22 13-Nov-2008 Ted Kremenek <kremenek@apple.com> Hook up "BodyBlock", not "Block".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59227 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ea817281b3a7c16f96a89ccd89699b22603a6811 13-Nov-2008 Ted Kremenek <kremenek@apple.com> Hook up "BodyBlock", not "Block".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59227 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f53830756312b18e52def1a5153795259455fdfc 13-Nov-2008 Ted Kremenek <kremenek@apple.com> Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration for blocks to the appropriate basic blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59226 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fc335523052a55f21750c4b111f1c8d85b418e5a 13-Nov-2008 Ted Kremenek <kremenek@apple.com> Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration for blocks to the appropriate basic blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59226 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
14cc7544f585345a7d16586041c2c525c38ea591 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Fix for crash issues with comma operators with a void first operand, and
some more bullet-proofing/enhancements for tryEvaluate. This shouldn't
cause any behavior changes except for handling cases where we were
crashing before and being able to evaluate a few more cases in tryEvaluate.

This should settle the minor mess surrounding r59196.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59224 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
a6afa768aa7bd3102a2807aa720917e4a1771e4e 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Fix for crash issues with comma operators with a void first operand, and
some more bullet-proofing/enhancements for tryEvaluate. This shouldn't
cause any behavior changes except for handling cases where we were
crashing before and being able to evaluate a few more cases in tryEvaluate.

This should settle the minor mess surrounding r59196.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59224 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
8fc9ba6fcf52993f49d92ef61f34506032b51aa8 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that
the Backend output should be done in binary mode.
- I'd appreciate it if someone who has a Windows build could verify
this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59221 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
26fb272713809af97e6f58ca61b8b9dcba37afc7 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that
the Backend output should be done in binary mode.
- I'd appreciate it if someone who has a Windows build could verify
this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59221 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
b2935abf87ab18f6f2b91ed5f327b3f6cc4ba7ea 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Backout of r59196, plus a new ICE test. Sorry if this is a
little rude; I figure it's cleaner to just back this out now so
it doesn't get forgotten or mixed up with other checkins.

The modification to isICE is simply wrong; I've added a test that the
change to isICE breaks.

I'm pretty sure the modification to tryEvaluate is also wrong.
At the very least, there's some serious miscommunication going on here,
as this is going in exactly the opposite direction of r59105. My
understanding is that tryEvaluate is not supposed to care about side
effects. That said, a lot of the clients to tryEvaluate are
expecting it to enforce a no-side-effects policy, so we probably need
another method that provides that guarantee.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59212 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
b11e77836dd0867955c5abf32baf1c3e6c7f81e1 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Backout of r59196, plus a new ICE test. Sorry if this is a
little rude; I figure it's cleaner to just back this out now so
it doesn't get forgotten or mixed up with other checkins.

The modification to isICE is simply wrong; I've added a test that the
change to isICE breaks.

I'm pretty sure the modification to tryEvaluate is also wrong.
At the very least, there's some serious miscommunication going on here,
as this is going in exactly the opposite direction of r59105. My
understanding is that tryEvaluate is not supposed to care about side
effects. That said, a lot of the clients to tryEvaluate are
expecting it to enforce a no-side-effects policy, so we probably need
another method that provides that guarantee.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59212 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
7097985aeed697d21ac868f46b881ce67aacebca 13-Nov-2008 Ted Kremenek <kremenek@apple.com> Fix bug where the body block of an ObjCForCollectionStmt would not properly get expanded as a series of basic blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59197 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
006dd8a2bd3723d4b6f3526be8f1a4dc0e9cfac3 13-Nov-2008 Ted Kremenek <kremenek@apple.com> Fix bug where the body block of an ObjCForCollectionStmt would not properly get expanded as a series of basic blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59197 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
750c01b7a1c1eafb546618047defb75b6709ca9c 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix bug in constant evaluation exposed by 176.gcc.
- Evaluation of , operator used bogus assumption that LHS could be
evaluated as an integral expression even though its type is
unspecified.

This change is making isICE very permissive of the LHS in non-evaluated
contexts because it is not clear what predicate we would use to reject
code here. The standard didn't offer me any guidance; opinions?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59196 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
dd2b12a0329fee69ac2c26c2a3a355fb722e1e54 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix bug in constant evaluation exposed by 176.gcc.
- Evaluation of , operator used bogus assumption that LHS could be
evaluated as an integral expression even though its type is
unspecified.

This change is making isICE very permissive of the LHS in non-evaluated
contexts because it is not clear what predicate we would use to reject
code here. The standard didn't offer me any guidance; opinions?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59196 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
cbcb4c2ba81d6b1c0dea9d8a362755607175873c 13-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Don't build identifiers for C++ constructors, destructors, or
conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.

This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59193 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7d7e6727a5de032c86dcb58ae734e7c1603c26e6 13-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't build identifiers for C++ constructors, destructors, or
conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.

This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59193 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
ff59ed842b894db36779c0ea325b07edf79aadaa 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Disable some debug prints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59174 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8a7b7c6d4c96ace3667204bed4a48bad91b7c0f0 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Disable some debug prints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59174 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
16516e274f96647fee00ed69cb6cada1ca24ab20 12-Nov-2008 Ted Kremenek <kremenek@apple.com> ObjCForCollectionStmts are block-level expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59160 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
390e48b15ad93f85bfd1e33b9992c198fa0db475 12-Nov-2008 Ted Kremenek <kremenek@apple.com> ObjCForCollectionStmts are block-level expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59160 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
70d2612fd956d4d3aeac8b3abed8ef5e29c4b7a5 12-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

struct X {
operator int const*();
} x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59148 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
eb8f3063257a392f15aea48d42fb73ec51afc548 12-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

struct X {
operator int const*();
} x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59148 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
7888b936c1ae134c7172013338b18ecf2a669830 12-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Some additions to tryEvaluate I've had sitting around for a while.
This pushes it a lot closer to being able to deal with most of the stuff
CodeGen's constant expression evaluator knows how to deal with. This
also fixes PR3003.

The test could possibly use some improvement, but this'll work for now.
Test 6 is inspired by PR3003; the other tests are mostly just designed
to exercise the new code. The reason for the funny structure of the
tests is that type fixing for arrays inside of structs is the only place
in Sema that calls tryEvaluate, at least for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59125 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4efaa276bc0ce8f7baf6138ead11915f3e3e58d9 12-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Some additions to tryEvaluate I've had sitting around for a while.
This pushes it a lot closer to being able to deal with most of the stuff
CodeGen's constant expression evaluator knows how to deal with. This
also fixes PR3003.

The test could possibly use some improvement, but this'll work for now.
Test 6 is inspired by PR3003; the other tests are mostly just designed
to exercise the new code. The reason for the funny structure of the
tests is that type fixing for arrays inside of structs is the only place
in Sema that calls tryEvaluate, at least for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59125 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
438f3b1c53e00d0a60ae268da01cf89dfc6d672a 12-Nov-2008 Chris Lattner <sabre@nondot.org> fix a crash analyzing constants in 176.gcc/expr.c with my next patch. It was
crashing because we errors are ignored in subexpressions that are not evaluated,
but we still evaluate the result of parents. This would cause an assertion
because the erroneous subexpr didn't have its result value set to the right type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59110 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
32fea9d18cc3658a1b01df5ca6f2ac302625c61d 12-Nov-2008 Chris Lattner <sabre@nondot.org> fix a crash analyzing constants in 176.gcc/expr.c with my next patch. It was
crashing because we errors are ignored in subexpressions that are not evaluated,
but we still evaluate the result of parents. This would cause an assertion
because the erroneous subexpr didn't have its result value set to the right type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59110 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
40d2ae8dbefa5abd8d94bd68bffcbf3a6dfff31c 12-Nov-2008 Chris Lattner <sabre@nondot.org> Teach the aggressive constant folder to fold X && 0 -> 0 and X || 1 -> 1


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59105 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c8cc9ccc7b87a7ed1749b074f6b670bcec49abc1 12-Nov-2008 Chris Lattner <sabre@nondot.org> Teach the aggressive constant folder to fold X && 0 -> 0 and X || 1 -> 1


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59105 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0cb7c87eb879a2a3f79426d34c678b07c04c1d8c 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
xpr.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
0518999d3adcc289997bd974dce90cc97f5c1c44 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
xpr.cpp
xprConstant.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
053351681978faaa311b18e92dfc60c13b78f466 11-Nov-2008 Ted Kremenek <kremenek@apple.com> Add CFG support for Objective-C 2.0 fast enumeration 'for' statement:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_2.html#//apple_ref/doc/uid/TP30001163-CH18-SW3

Need to modify GRExprEngine, LiveVariables, and UninitializedValues to understand this construct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59049 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
514de5a21645900c92cf4f4f7313d6f66945d134 11-Nov-2008 Ted Kremenek <kremenek@apple.com> Add CFG support for Objective-C 2.0 fast enumeration 'for' statement:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_2.html#//apple_ref/doc/uid/TP30001163-CH18-SW3

Need to modify GRExprEngine, LiveVariables, and UninitializedValues to understand this construct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59049 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b93b49c760fcb5dda81f42e80d84e2fb1e88e54b 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ 'typeid' parsing and sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
c42e1183846228a7fa5143ad76507d6d60f5c6f3 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ 'typeid' parsing and sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
7b0dcc2ba12e778b554bd39a88d72f576dbe6055 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix Release-Asserts warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59013 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b3ac5434ab936f092b8cc48349cb01db3a1e1c76 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix Release-Asserts warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59013 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
881964bc7876c335a821293d9a05e21e360ac320 10-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names.
e.g.:
namespace A {
void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A'
}
void A::f(); // SemanticDC == namespace 'A'
// LexicalDC == global namespace


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
5239304ff761b8b03eefb772bd5d830a9b9f1aea 10-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names.
e.g.:
namespace A {
void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A'
}
void A::f(); // SemanticDC == namespace 'A'
// LexicalDC == global namespace


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
67deed2c9de76a72ee4158d0a48bbd0f1ed105d7 08-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Use only one constructor for CXXMethodDecl. Keep initialization stuff into one place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58902 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
5540a72fe407f77d4155511b508f21a237254092 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use only one constructor for CXXMethodDecl. Keep initialization stuff into one place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58902 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7d6a5d29f13eee9b808a71534edd4cac7d60f2e3 08-Nov-2008 Daniel Dunbar <daniel@zuster.org> Support getTypeInfo, getTypeAlign, getTypeSize on const Type*s.
- Size/align are not effected by CVR qualifiers.

Support getCanonicalType: const Type* -> const Type*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1d75118af76cae2bfc06389cde410e14bd0a19fc 08-Nov-2008 Daniel Dunbar <daniel@zuster.org> Support getTypeInfo, getTypeAlign, getTypeSize on const Type*s.
- Size/align are not effected by CVR qualifiers.

Support getCanonicalType: const Type* -> const Type*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58891 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3ef6c9794a79271d00bfcd941974602fcd2f9c48 07-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Parsing, ASTs, and semantic analysis for the declaration of conversion
functions in C++, e.g.,

struct X {
operator bool() const;
};

Note that these conversions don't actually do anything, since we don't
yet have the ability to use them for implicit or explicit conversions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58860 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
2f1bc5285ccd40f411af5f5993f013e27e74ab78 07-Nov-2008 Douglas Gregor <dgregor@apple.com> Parsing, ASTs, and semantic analysis for the declaration of conversion
functions in C++, e.g.,

struct X {
operator bool() const;
};

Note that these conversions don't actually do anything, since we don't
yet have the ability to use them for implicit or explicit conversions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58860 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
66191ca4137f0cf124085185f6baf7326dd0ada3 07-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Properly deserialize ParamInfo of FunctionDecl.

When allocating an array for ParamInfo, the "decl->getNumParams()" call was used, but this will return 0 since it checks ParamInfo (which isn't yet defined and is null).
The result was that ParamInfo got an array of zero length to hold the ParmVarDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58850 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
dc5ddbf7de0862ebc4aef9c60be953ca80a62ff2 07-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Properly deserialize ParamInfo of FunctionDecl.

When allocating an array for ParamInfo, the "decl->getNumParams()" call was used, but this will return 0 since it checks ParamInfo (which isn't yet defined and is null).
The result was that ParamInfo got an array of zero length to hold the ParmVarDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58850 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
e60e5d3eb3d09bde80882f60abc69e28ced874c6 06-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Parsing, ASTs, and semantic analysis for the declaration of overloaded
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58817 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1cd1b1e987f5e2f060d7972b13d83239b36d77d6 06-Nov-2008 Douglas Gregor <dgregor@apple.com> Parsing, ASTs, and semantic analysis for the declaration of overloaded
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58817 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8210a8e4f46bc955ed717609aba309b68c5924ab 05-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Parsing, representation, and preliminary semantic analysis of destructors.

Implicit declaration of destructors (when necessary).

Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58767 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
42a552f8200ba5948661aee0106fce0c04e39818 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Parsing, representation, and preliminary semantic analysis of destructors.

Implicit declaration of destructors (when necessary).

Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58767 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
15e0462675c2725515466bb423157e652c135784 05-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Keep track of whether a C++ class is an aggregate. Don't allow initialization of non-aggregates with initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58757 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
64bffa9a6f40e5a3d5556f994f09f7bf45eecd4c 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Keep track of whether a C++ class is an aggregate. Don't allow initialization of non-aggregates with initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58757 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
6428e76498e3f45d62934fe679df803b0cc1eaa5 05-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Implement C++ copy-initialization for declarations. There is now some
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58756 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f03d7c7af2ca8555c513ba7667acffb667445ecd 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement C++ copy-initialization for declarations. There is now some
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58756 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a65e8ddc1a3a8878ddce4b74f2fe276134602410 05-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58749 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
7ad8390f7992ab7f19b1460c5f0b9d96f165c4e9 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58749 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
825f6ea730de198743bbefdfa270bf65834ced27 04-Nov-2008 Chris Lattner <sabre@nondot.org> LinkageSpecDecl is c++ specific, move it to DeclCXX


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58704 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
21ef7ae45c8b91f23cf5eab2263421bb398a644b 04-Nov-2008 Chris Lattner <sabre@nondot.org> LinkageSpecDecl is c++ specific, move it to DeclCXX


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58704 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
d860663a58f234b3936571178855e52f41377ba0 04-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Add a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove ObjCThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58698 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
cd9b46e5442a3ef17f83f75177d8545cb5b3e2b9 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Add a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove ObjCThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58698 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
a5b022ad90e26b786f0c3096e3312db2f6ee317b 04-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Create a new expression class, CXXThisExpr, to handle the C++ 'this' primary expression. Remove CXXThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58695 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
796da18402f286b897782a298ae3b20c459c102e 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Create a new expression class, CXXThisExpr, to handle the C++ 'this' primary expression. Remove CXXThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58695 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
3768d27d837f4b9514714aad0577cd5b8f51b14f 04-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Trivial style fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58689 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6215dee86c0e715b9f2b0d401ab2a5fcf629f1af 04-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Trivial style fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58689 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7f1412d98bd91fb090784f112d822bf7b9f367c3 04-Nov-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6339636> clang ObjC rewriter: Assertion failed: FileID-1 < FileIDs.size() && "Invalid FileID!", file c:\cygwin\home\Administrator\llvm\tools\clang\include\clang/Basic/SourceManager.h, line 513



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58654 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
b2f9e516327310d95840d442416084508f80c183 04-Nov-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6339636> clang ObjC rewriter: Assertion failed: FileID-1 < FileIDs.size() && "Invalid FileID!", file c:\cygwin\home\Administrator\llvm\tools\clang\include\clang/Basic/SourceManager.h, line 513



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58654 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
e640ab64c642d17ed4eb13261d9455d7ae6a511e 03-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Add implicitly-declared default and copy constructors to C++ classes,
when appropriate.

Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58622 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
396b7cd9f6b35d87d17ae03e9448b5c1f2184598 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Add implicitly-declared default and copy constructors to C++ classes,
when appropriate.

Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58622 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
bb66b419d356821f61f9a49494266ff5393308c2 03-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Eliminate header dependency ASTContext -> TargetInfo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58613 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d934112e6170b0fd940d8e40db6936cea2cdcf62 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Eliminate header dependency ASTContext -> TargetInfo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58613 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c6507e454072488f432bd2aae2ec8bd52f8fe883 03-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Connect ASTContext to TargetInfo when determining the size_t, ptrdiff_t, and wchar_t types. Fixes recent breakage on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58609 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b4e66d5259f90e9aae4d40fc5de801e046c7df94 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Connect ASTContext to TargetInfo when determining the size_t, ptrdiff_t, and wchar_t types. Fixes recent breakage on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58609 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ccabf0868d9cb81bbc3037a8b3b400737401841d 31-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Semantic checking of constructor declarations and classification of default/copy constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58538 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
030ff0cdad79b9e0602e143e0669364d2bad8bd2 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Semantic checking of constructor declarations and classification of default/copy constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58538 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b72e9da529fca5693b46ec2888a241f706d7dbcb 31-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Implement basic support for converting constructors in user-defined
conversions.

Notes:
- Overload resolution for converting constructors need to prohibit
user-defined conversions (hence, the test isn't -verify safe yet).
- We still use hacks for conversions from a class type to itself.
This will be the case until we start implicitly declaring the appropriate
special member functions. (That's next on my list)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58513 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
60d62c29d260596454aaf4cb50cbc756ac08875e 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement basic support for converting constructors in user-defined
conversions.

Notes:
- Overload resolution for converting constructors need to prohibit
user-defined conversions (hence, the test isn't -verify safe yet).
- We still use hacks for conversions from a class type to itself.
This will be the case until we start implicitly declaring the appropriate
special member functions. (That's next on my list)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58513 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9ac68aa262c6c829f6b4b82209172e4a8bf239b3 31-Oct-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement semantic checking of static_cast and dynamic_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58509 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0777972d38a3125efed962b045704c30ae6965cf 31-Oct-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement semantic checking of static_cast and dynamic_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58509 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
f15ac4bc132d609f1df92308612f3d2629bbd480 31-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Add support for parsing and representing C++ constructor declarations.

Notes:
- Constructors are never found by name lookup, so they'll never get
pushed into any scope. Instead, they are stored as an
OverloadedFunctionDecl in CXXRecordDecl for easy overloading.
- There's a new action isCurrentClassName that determines whether an
identifier is the name of the innermost class currently being defined;
we use this to identify the declarator-id grammar rule that refers to
a type-name.
- MinimalAction does *not* support parsing constructors.
- We now handle virtual and explicit function specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58499 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
b48fe3812047e84164925c8938ce82be0624c40c 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Add support for parsing and representing C++ constructor declarations.

Notes:
- Constructors are never found by name lookup, so they'll never get
pushed into any scope. Instead, they are stored as an
OverloadedFunctionDecl in CXXRecordDecl for easy overloading.
- There's a new action isCurrentClassName that determines whether an
identifier is the name of the innermost class currently being defined;
we use this to identify the declarator-id grammar rule that refers to
a type-name.
- MinimalAction does *not* support parsing constructors.
- We now handle virtual and explicit function specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58499 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
ea5bd34838d2b4f944b50f315973c3242a219f91 30-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Fix arithmetic type check

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58429 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
a7fbf7282eadebaf1293d9f970b01fb57f4b0ae4 30-Oct-2008 Douglas Gregor <dgregor@apple.com> Fix arithmetic type check

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58429 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
a6ded3570d52f1a853a659350cca837c3c023e11 29-Oct-2008 Ted Kremenek <kremenek@apple.com> Fix crash reported in PR2923 where a function declared using typeof(another_function) would have FunctionDecl::getNumParams() return the number of parameters in the original function type and not the number of parameters in the actual FunctionDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58392 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
4f03fd61ee45245dd3a1552a023e730d56c2e697 29-Oct-2008 Ted Kremenek <kremenek@apple.com> Fix crash reported in PR2923 where a function declared using typeof(another_function) would have FunctionDecl::getNumParams() return the number of parameters in the original function type and not the number of parameters in the actual FunctionDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58392 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
81c29157dcb112ce5f1ccb9df4a431d3070a99a8 29-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
27c8dc06f65d7abcf6a7e7f64a7960c9a150ca01 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
035d088fb41d691b08924635995c66d09a126f81 28-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Rename ExplicitCCastExpr to CStyleCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58331 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
6eec8e883de118b431e3ead5b1e604a6ac68ff6b 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Rename ExplicitCCastExpr to CStyleCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58331 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
1a97618f521108eab958a0622dc28ae188bf4ec8 28-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Replace a dyn_cast with a cast when we know the exact type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58330 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3c3281742da8eef5027b9614c6f3802a05ec4244 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Replace a dyn_cast with a cast when we know the exact type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58330 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
0d5d89d173f87b74a7f539c51f417de0f5435fb3 28-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Improve our handling of (C++) references within Clang. Specifically:
- Do not allow expressions to ever have reference type
- Extend Expr::isLvalue to handle more cases where having written a
reference into the source implies that the expression is an lvalue
(e.g., function calls, C++ casts).
- Make GRExprEngine::VisitCall treat the call arguments as lvalues when
they are being bound to a reference parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58306 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9d293dfc0ad7c44ae0b5eb9517f1ed8c8d8b7ff7 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Improve our handling of (C++) references within Clang. Specifically:
- Do not allow expressions to ever have reference type
- Extend Expr::isLvalue to handle more cases where having written a
reference into the source implies that the expression is an lvalue
(e.g., function calls, C++ casts).
- Make GRExprEngine::VisitCall treat the call arguments as lvalues when
they are being bound to a reference parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58306 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
21a04f33b3e9024aadbebbef24eadf49ed0cbaf1 27-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Refactor the expression class hierarchy for casts. Most importantly:
- CastExpr is the root of all casts
- ImplicitCastExpr is (still) used for all explicit casts
- ExplicitCastExpr is now the root of all *explicit* casts
- ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
- CXXFunctionalCastExpr inherits from ExplicitCastExpr
- CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
- Added classes CXXStaticCastExpr, CXXDynamicCastExpr,
CXXReinterpretCastExpr, and CXXConstCastExpr to

Also, fixed returned-stack-addr.cpp, which broke once when we fixed
reinterpret_cast to diagnose double->int* conversions and again when
we eliminated implicit conversions to reference types. The fix is in
both testcase and SemaChecking.cpp.

Most of this patch is simply support for the renaming. There's very
little actual change in semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58264 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
49badde06e066d058d6c7fcf4e628a72999b65a9 27-Oct-2008 Douglas Gregor <dgregor@apple.com> Refactor the expression class hierarchy for casts. Most importantly:
- CastExpr is the root of all casts
- ImplicitCastExpr is (still) used for all explicit casts
- ExplicitCastExpr is now the root of all *explicit* casts
- ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
- CXXFunctionalCastExpr inherits from ExplicitCastExpr
- CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
- Added classes CXXStaticCastExpr, CXXDynamicCastExpr,
CXXReinterpretCastExpr, and CXXConstCastExpr to

Also, fixed returned-stack-addr.cpp, which broke once when we fixed
reinterpret_cast to diagnose double->int* conversions and again when
we eliminated implicit conversions to reference types. The fix is in
both testcase and SemaChecking.cpp.

Most of this patch is simply support for the renaming. There's very
little actual change in semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58264 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
b30de271f6b6d2c9ae2a28dcb0caa6b2d9df0cd5 27-Oct-2008 Ted Kremenek <kremenek@apple.com> - Move ExprIterator to Stmt.h so that it can be used by classes defined in Stmt.h
- Implement child_begin() and child_end() for AsmStmt. Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement.
- Use ExprIterator for performing iteration over input/output operands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58261 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
ce2fc3a343ea6098a96d587071cee7299f11957a 27-Oct-2008 Ted Kremenek <kremenek@apple.com> - Move ExprIterator to Stmt.h so that it can be used by classes defined in Stmt.h
- Implement child_begin() and child_end() for AsmStmt. Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement.
- Use ExprIterator for performing iteration over input/output operands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58261 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmt.cpp
0cbb9ec64186b92a11090099734cb00ebbba427d 27-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> When destroying a translation unit, deallocate its owned declarations in reverse order, because there may be dependencies among the declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58244 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
3dda64ec0fad2fa60d882565d135ff598897fa9d 27-Oct-2008 Douglas Gregor <dgregor@apple.com> When destroying a translation unit, deallocate its owned declarations in reverse order, because there may be dependencies among the declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58244 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
71ca8c805be13bcbd3b95f2452f6a75fe442e2e4 27-Oct-2008 Chris Lattner <sabre@nondot.org> Remember whether an initlist had a designator in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58218 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
418f6c7d142e5ff4607f70cd8431d008442bafe9 27-Oct-2008 Chris Lattner <sabre@nondot.org> Remember whether an initlist had a designator in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58218 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
65b99647ba0ef8d52e01f14eb9a9e9e6ca2b0be6 26-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Don't give a default argument to ASTContext::getFunctionType for the TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call.
-Remove the default argument.
-Update all call sites of ASTContext::getFunctionType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58187 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
ypeSerialization.cpp
7fb5e4888221cd36652d078c6b171ac55e7f406d 26-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't give a default argument to ASTContext::getFunctionType for the TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call.
-Remove the default argument.
-Update all call sites of ASTContext::getFunctionType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58187 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
ypeSerialization.cpp
c03d2ca68a37b5a33fffd5d1a30c28337bfce31f 26-Oct-2008 Oscar Fuentes <ofv@wanadoo.es> CMake: Builds and installs clang binary and libs (no docs yet). It
must be under the `tools' subdirectory of the LLVM *source* tree.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58180 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
d2f4e5ea6e980e48c292f5ca250e99377e3ee111 26-Oct-2008 Oscar Fuentes <ofv@wanadoo.es> CMake: Builds and installs clang binary and libs (no docs yet). It
must be under the `tools' subdirectory of the LLVM *source* tree.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58180 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8e4d5d7a59bb328c845f1bd16685546feac96378 25-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add a quote from the standard about the type of 'this'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58124 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
b0d178d78fd9a67627b89a7e2dafde2c93fbcd1c 25-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a quote from the standard about the type of 'this'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58124 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4b269b4f8fe1509a5d9a92bc02b1b8b503fcd2fd 24-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> -Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58120 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
ype.cpp
971c4fae6092976338b755af1d47dac07c8f16e3 24-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58120 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclCXX.cpp
ype.cpp
5424cecfd5c51a88d721b3587a7fa3981ec1c34b 24-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Move viewInheritance to CXXRecordDecl, and make sure it builds in Release mode, too

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58105 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
1f81230ac57b9bda8bba9c8221652842ca786132 24-Oct-2008 Douglas Gregor <dgregor@apple.com> Move viewInheritance to CXXRecordDecl, and make sure it builds in Release mode, too

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58105 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
da8ebd2ff2d74a3803a9cba35c6c07096bd3962f 24-Oct-2008 Daniel Dunbar <daniel@zuster.org> PR2919: __builtin_types_compatible_p strips CRV qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58079 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
ac620decb68aad1a2cf6c0c191b56d78981d9aaa 24-Oct-2008 Daniel Dunbar <daniel@zuster.org> PR2919: __builtin_types_compatible_p strips CRV qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58079 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
789b4bb9d627ca3b7c92e89062840e2ad5045e93 24-Oct-2008 Ted Kremenek <kremenek@apple.com> Use llvm::errs() instead of cerr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58054 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
6ee9b0f0e67f15de7bc1b7e9aa919cbf6f558385 24-Oct-2008 Ted Kremenek <kremenek@apple.com> Use llvm::errs() instead of cerr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58054 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
90b82510f6d3591d4edba10bb69ff8b8a2d49f91 24-Oct-2008 Ted Kremenek <kremenek@apple.com> Convert InheritanceHierarchyWriter to use llvm::raw_ostream instead of std::ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58053 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
4ebd7f54ad9ed6fb64fa2cfbbbebc97dbd30fba6 24-Oct-2008 Ted Kremenek <kremenek@apple.com> Convert InheritanceHierarchyWriter to use llvm::raw_ostream instead of std::ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58053 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
4fd8590cbf5384f935b3e1bae8dfe1f97715dae9 23-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Clean up and document the representation of C++ base classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58040 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
nheritViz.cpp
57c856b96e6bbfc64c2d61b950b116b523dc3e46 23-Oct-2008 Douglas Gregor <dgregor@apple.com> Clean up and document the representation of C++ base classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58040 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
nheritViz.cpp
c127c0da121537163cc2c857cc82d960820abb20 23-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> If NDEBUG is set, don't include any of the code for visualizing inheritance hierarchies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58029 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
7a64a0329af04474f35b7e4a49629acbec28be15 23-Oct-2008 Douglas Gregor <dgregor@apple.com> If NDEBUG is set, don't include any of the code for visualizing inheritance hierarchies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58029 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
51bc8504630417dc1079e5446e8c49f2093eb3bf 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Remove the GraphWriter-based version of the C++ class inheritance visualization, since it isn't being used and can't handle virtual bases properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58002 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
5dea18948c88cb67acb2217cc86cab490d51aa76 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Remove the GraphWriter-based version of the C++ class inheritance visualization, since it isn't being used and can't handle virtual bases properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58002 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
0590402476a996b3c2081fd197b0e2055e387c23 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Added GraphViz visualization of C++ inheritance hierarchies.

Factored the QualTypeOrdering predicate into its own header
(TypeOrdering.h), now that it is used in two places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58001 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
0218936235b137bbdcd29a6c36d61d9215bb4edd 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Added GraphViz visualization of C++ inheritance hierarchies.

Factored the QualTypeOrdering predicate into its own header
(TypeOrdering.h), now that it is used in two places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58001 91177308-0d34-0410-b5e6-96231b3b80d8
nheritViz.cpp
b9b4beb41723ad1316662bfc9078f387c541f1f9 22-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Now that DeclRefExpr accepts a NamedDecl, use a DeclRefExpr for when a CXXFieldDecl is referenced inside a method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58000 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
90b7bc67518a408d397f2400ff6c40e5465b45e4 22-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Now that DeclRefExpr accepts a NamedDecl, use a DeclRefExpr for when a CXXFieldDecl is referenced inside a method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58000 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
abed217d6877aebfd733754adab35d83996b2135 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Add representation of base classes in the AST, and verify that we
don't have duplicated direct base classes.

Seriliazation of base class specifiers is not yet implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57991 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
f8268ae3196002bbab6adb830302e79b0f368f13 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Add representation of base classes in the AST, and verify that we
don't have duplicated direct base classes.

Seriliazation of base class specifiers is not yet implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57991 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
4459bbe1ad110c100d74af8c74fdc82d87317dfe 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> QualType::isMoreQualifiedThan and isAtLeastAsQualifiedAs assert that we
aren't trying to compare with address-space qualifiers (for now).

Clean up handing of DeclRefExprs in Expr::isLvalue and refactor part
of the check into a static DeclCanBeLvalue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57980 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ba7e210a999275695f58be03ef402758cfec3635 22-Oct-2008 Douglas Gregor <dgregor@apple.com> QualType::isMoreQualifiedThan and isAtLeastAsQualifiedAs assert that we
aren't trying to compare with address-space qualifiers (for now).

Clean up handing of DeclRefExprs in Expr::isLvalue and refactor part
of the check into a static DeclCanBeLvalue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57980 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
26a4c5fa75b7c2aeddd134382e6233e6285657d7 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Functions can be lvalues in C++, but not modifiable lvalues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57941 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ae8d467e75a4e72b19e1eca199bf93dfaab47acf 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Functions can be lvalues in C++, but not modifiable lvalues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57941 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6573cfd6fc32eab0b696cfc318bb21f4e3933f35 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Initial step toward supporting qualification conversions (C++ 4.4).

Changes:
- Sema::IsQualificationConversion determines whether we have a qualification
conversion.
- Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
performing an implicit conversion from the right-hand side to the type of
the left-hand side rather than checking based on the C notion of
"compatibility". We now rely on the implicit-conversion code to
determine whether the conversion can happen or
not. Sema::TryCopyInitialization has an ugly reference-related
hack to cope with the initialization of references, for now.
- When building DeclRefExprs, strip away the reference type, since
there are no expressions whose type is a reference. We'll need to
do this throughout Sema.
- Expr::isLvalue now permits functions to be lvalues in C++ (but not
in C).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57935 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
98cd599ee8a9b259ed7388ee2921a20d97658864 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Initial step toward supporting qualification conversions (C++ 4.4).

Changes:
- Sema::IsQualificationConversion determines whether we have a qualification
conversion.
- Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
performing an implicit conversion from the right-hand side to the type of
the left-hand side rather than checking based on the C notion of
"compatibility". We now rely on the implicit-conversion code to
determine whether the conversion can happen or
not. Sema::TryCopyInitialization has an ugly reference-related
hack to cope with the initialization of references, for now.
- When building DeclRefExprs, strip away the reference type, since
there are no expressions whose type is a reference. We'll need to
do this throughout Sema.
- Expr::isLvalue now permits functions to be lvalues in C++ (but not
in C).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57935 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d9e008076e6c08dcbc1c46a9247f9cde46def42f 21-Oct-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6257645> clang static analyzer crashes when encountering blocks as objects

ASTContext::isObjCObjectPointerType() needs to consider blocks as objects.

Note: My previous commit was done in the test directory...as a result, this commit was necessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57914 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6ae98506f93617b1eda486406b376c9b70cd2df3 21-Oct-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6257645> clang static analyzer crashes when encountering blocks as objects

ASTContext::isObjCObjectPointerType() needs to consider blocks as objects.

Note: My previous commit was done in the test directory...as a result, this commit was necessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57914 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d2baafd07bc5c7679a6f1f10e5587a95842ffa15 21-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
tmtSerialization.cpp
ype.cpp
8e9bebdea69c590dedfbf27374114cb76fe12fbd 21-Oct-2008 Douglas Gregor <dgregor@apple.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
tmtSerialization.cpp
ype.cpp
3b2ceeaf20c61c2442bbb77cc1da2e5d7a5967ef 20-Oct-2008 Steve Naroff <snaroff@apple.com> Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57841 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
87f3b93423062c343a35714517517a52cc9da4a5 20-Oct-2008 Steve Naroff <snaroff@apple.com> Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57841 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1ecf41581bb0978f769886b929bfb6b0b5528b05 18-Oct-2008 Ted Kremenek <kremenek@apple.com> Fix incorrect release of Decl* array referenced by DeclGroup.

Patch by Timo Sirainen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57772 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
990601b6e90c96630eb26d8b683f26b06105c322 18-Oct-2008 Ted Kremenek <kremenek@apple.com> Fix incorrect release of Decl* array referenced by DeclGroup.

Patch by Timo Sirainen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57772 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
651c8992e44a15660eb488bbc00286da7751b9c2 18-Oct-2008 Mon P Wang <wangmp@apple.com> Make llvm memory barrier available as an intrinsic


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57751 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
7ae48ee2fb80b0a3ac6ad912b465a077c7591a19 18-Oct-2008 Mon P Wang <wangmp@apple.com> Make llvm memory barrier available as an intrinsic


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57751 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
c9197cd41f5bf5a11f9346a8d7118d4267941e98 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57716 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0d504c1da852e58ff802545c823ecff3b6c654b8 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57716 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
aa913104830f5f2d384ca13dedcc81d76fd195d1 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> More Obj-C type encoding improvements.
- Encode unions and bit-fields correctly.
- Accept option to name record fields (used for NeXT runtime).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57685 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d96b35bc6becf8db00d140c11e3d0e53f27567a1 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> More Obj-C type encoding improvements.
- Encode unions and bit-fields correctly.
- Accept option to name record fields (used for NeXT runtime).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57685 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f8cfe56176a753fa2dc68a3c996fa3e70f87f89b 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix bug in Obj-C type encoding for structures.
- Mechanism for detecting if a structure should be expanded wasn't
reliable. Simplified by just keeping track of what we should be
expanding.

- This fixes a bug in using NSInvocation to invoke a method which
returned a structure, which in used by Key Value Observing, which
in the end, caused a miscompile in poor little Sketch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57675 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
82a6cfbc421cc99c5b7313271f399f7ef95056ec 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix bug in Obj-C type encoding for structures.
- Mechanism for detecting if a structure should be expanded wasn't
reliable. Simplified by just keeping track of what we should be
expanding.

- This fixes a bug in using NSInvocation to invoke a method which
returned a structure, which in used by Key Value Observing, which
in the end, caused a miscompile in poor little Sketch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57675 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
146b2d0ca1784335991f65c8e4f502da067772f5 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Anonymous structures print as '?=' in Obj-C type encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57674 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
502a4a1ce4c34cf78c8182d9798da0a51d9b7302 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Anonymous structures print as '?=' in Obj-C type encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57674 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eeec54822203beb9f53caf26fc53250c9ed5a1b2 16-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Using dyn_cast_or_null here is redundant, use dyn_cast instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57642 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1e6759e9e33dcaa73ce14c8a908ac9f87ac16463 16-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Using dyn_cast_or_null here is redundant, use dyn_cast instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57642 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
804ead0dd1713c3c8a02853fc0a5d898a46889a9 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Teach tryEvaluate that fabs, copysign, and unary +/- are constants for
floats.
- With testcase, which also has some other things GCC folds but we
don't commented out in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57624 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
5db4b3f3ed9f769d5b02c1d1ccc52bfd71fb9afb 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Teach tryEvaluate that fabs, copysign, and unary +/- are constants for
floats.
- With testcase, which also has some other things GCC folds but we
don't commented out in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57624 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2cb762f6d2cfb32f10a6f58261071287b8ee2145 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Implement #pragma pack use in structure packing. The general approach
is to encode the state of the #pragma pack stack as an attribute when
the structure is declared.

- Extend PackedAttr to take an alignment (in bits), and reuse for
both __attribute__((packed)) (which takes no argument, instead
packing tightly (to "minimize the memory required") and for #pragma
pack (which allows specification of the maximum alignment in
bytes). __attribute__((packed)) is just encoded as Alignment=1.

This conflates two related but different mechanisms, but it didn't
seem worth another attribute.

- I have attempted to follow the MSVC semantics as opposed to the gcc
ones, since if I understand correctly #pragma pack originated with
MSVC. The semantics are generally equivalent except when the stack
is altered during the definition of a structure; its not clear if
anyone does this in practice. See testcase if curious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57623 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3b0db908ebd07eaa26bc90deba5e826de00fe515 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Implement #pragma pack use in structure packing. The general approach
is to encode the state of the #pragma pack stack as an attribute when
the structure is declared.

- Extend PackedAttr to take an alignment (in bits), and reuse for
both __attribute__((packed)) (which takes no argument, instead
packing tightly (to "minimize the memory required") and for #pragma
pack (which allows specification of the maximum alignment in
bytes). __attribute__((packed)) is just encoded as Alignment=1.

This conflates two related but different mechanisms, but it didn't
seem worth another attribute.

- I have attempted to follow the MSVC semantics as opposed to the gcc
ones, since if I understand correctly #pragma pack originated with
MSVC. The semantics are generally equivalent except when the stack
is altered during the definition of a structure; its not clear if
anyone does this in practice. See testcase if curious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57623 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
90aac829afd73afcf4c4b5f856c30d354c3a6ee0 15-Oct-2008 Daniel Dunbar <daniel@zuster.org> Use BatchEmitOwnedPtrs for writing multiple child exprs, per review.

Also added serialization support to OverloadExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57588 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
20c77e995d5f1bad8fc59fe9e1883a563d94f535 15-Oct-2008 Daniel Dunbar <daniel@zuster.org> Use BatchEmitOwnedPtrs for writing multiple child exprs, per review.

Also added serialization support to OverloadExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57588 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
2538a8c428063cdaa8780040de96b93a68690528 15-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Simplify handling of struct/union/class tags.
Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl.
Cleans up the code a bit and better reflects that Decl class structure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57541 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
tmtDumper.cpp
35bc0821c4f80041724cd4c5c4889b2581546a41 15-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify handling of struct/union/class tags.
Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl.
Cleans up the code a bit and better reflects that Decl class structure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57541 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
tmtDumper.cpp
aad6364ca32ed23d8577789141c08198b43f8c94 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add serialization support in several missing places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57502 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
d17c24ff8597fe0dee4210639d225bc4f7c5ac04 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add serialization support in several missing places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57502 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
9c7fd1e1ad0ec0c483560c9a9daeda23c3772055 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Move Type::EmitImpl into header, add FIXME to make abstract.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57501 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
708ef456a182030de3cf20ad98e653d2741ecb13 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Move Type::EmitImpl into header, add FIXME to make abstract.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57501 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
0b3efb45ffbc8733df74be4d5ec1e3c2b6db58b9 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix test suite regression, getFloatTypeSemantics shouldn't be called
on non-float types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57477 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7cbed03c00e246682e5292785d01e1c120ce54bd 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix test suite regression, getFloatTypeSemantics shouldn't be called
on non-float types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57477 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
6bbe3d73033db1f0969e6ccfcd83af6c8cd9ccd1 12-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Improve the const-ness of a few methods.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57417 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
d2595ecce5f8350e485c83bfe767549a522b2802 12-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve the const-ness of a few methods.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57417 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclCXX.cpp
4b662ea886a86f0d8d7725fa3478918e74d42513 12-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Implement more efficient Decl <-> DeclContext conversions.
When the static type on the Decl side is a subclass of DeclContext the compiler will use a "inlinable" static_cast, instead of always using an out-of-line function call.

Note, though, that the isa<> check still uses an out-of-line function call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57415 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
42220c5432c141d47cc8ce786e472b49dc907378 12-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement more efficient Decl <-> DeclContext conversions.
When the static type on the Decl side is a subclass of DeclContext the compiler will use a "inlinable" static_cast, instead of always using an out-of-line function call.

Note, though, that the isa<> check still uses an out-of-line function call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57415 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
504c543de0e5aeeafe4e0ad0b267f4c0d9dfba6e 12-Oct-2008 Chris Lattner <sabre@nondot.org> silence some release-assert warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57391 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
33d34a6f7a65be1821ab31c7d08b8e9f36d8759c 12-Oct-2008 Chris Lattner <sabre@nondot.org> silence some release-assert warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57391 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
578a37e12ff04558b00333552856271497b40d18 12-Oct-2008 Chris Lattner <sabre@nondot.org> silence a bunch of warnings in a release-assert build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57390 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f6e764fe722440eaed18dad9eeff3d7e89a4d7af 12-Oct-2008 Chris Lattner <sabre@nondot.org> silence a bunch of warnings in a release-assert build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57390 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5205938085c9bb3123b20745be5719d8d3be4b60 10-Oct-2008 Steve Naroff <snaroff@apple.com> Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57337 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
090276f5e164d491a1bb3f541bafdb394f5e6f04 10-Oct-2008 Steve Naroff <snaroff@apple.com> Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57337 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
2461f619288c1f37a4cab7da6af0b75c6e0acd79 10-Oct-2008 Dale Johannesen <dalej@apple.com> Adjust calls to APFloat conversion for new interface.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57332 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
ee5a700af3fe9ae1a639c271f093f40677dddc04 10-Oct-2008 Dale Johannesen <dalej@apple.com> Adjust calls to APFloat conversion for new interface.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57332 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
95029d906b78b22b378693dbfca6c2b65af0b36f 08-Oct-2008 Steve Naroff <snaroff@apple.com> Instantiate the BlockDecl in ActOnBlockStart() so we can use it as a DeclContext.
This required changes to attach the compound statement later on (like we do for functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57304 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1c90bfcbd7ff5d09694acf50a32dbb716a968b61 08-Oct-2008 Steve Naroff <snaroff@apple.com> Instantiate the BlockDecl in ActOnBlockStart() so we can use it as a DeclContext.
This required changes to attach the compound statement later on (like we do for functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57304 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9ac456d597886216becc2efdd4efb494bf91af68 08-Oct-2008 Steve Naroff <snaroff@apple.com> - Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.

This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).

Still some follow-up work to finish this (forthcoming).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57298 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclSerialization.cpp
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
56ee6896f2efebffb4a2cce5a7610cdf1eddbbbe 08-Oct-2008 Steve Naroff <snaroff@apple.com> - Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.

This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).

Still some follow-up work to finish this (forthcoming).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57298 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclSerialization.cpp
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
c9e6d5c42d099570012ffcf93d57481aa3f7556b 08-Oct-2008 Ted Kremenek <kremenek@apple.com> A little more tweaking with StmtIterator and SizeOfAlignofExpr. A recent commit actually introduced a regression, not fixed a bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57282 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtIterator.cpp
8a213de1a86e5f347c6b591f52712c2fd6177cce 08-Oct-2008 Ted Kremenek <kremenek@apple.com> A little more tweaking with StmtIterator and SizeOfAlignofExpr. A recent commit actually introduced a regression, not fixed a bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57282 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtIterator.cpp
1bc18e6632185ea7b3436f020681b3c1aa33606f 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ScopedDecl*.
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57275 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
tmt.cpp
tmtSerialization.cpp
tmtViz.cpp
8ffb159441e923322bef6b5dee1aaf24c738d75e 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ScopedDecl*.
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57275 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
tmt.cpp
tmtSerialization.cpp
tmtViz.cpp
a362e3ef8238b1ba494923e307c20ebb9f37e61e 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Fixed a masked bug when iterating over the child expressions of SizeOfAlignOfTypeExpr. This bug was unmasked by recent changes to StmtIterator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57273 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b84887d99d97e332c11af4ca57b48a8976655183 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Fixed a masked bug when iterating over the child expressions of SizeOfAlignOfTypeExpr. This bug was unmasked by recent changes to StmtIterator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57273 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5f593aeed7820242df994a2b4b387337cdbddf97 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Add const_iterator to DeclGroup.
Serialization for OwningDeclGroupRefs now works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57272 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
401adfad4af45b083ad067f3ebec5cf23a1e91cf 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Add const_iterator to DeclGroup.
Serialization for OwningDeclGroupRefs now works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57272 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
6e3524ffe974f4eaa990c3037e2d6539966d197b 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Add StmtIterator support for DeclGroups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57271 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
3e6d1203b3346147cee51a8a6d374f1867f2cd23 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Add StmtIterator support for DeclGroups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57271 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
1742b05d988c47d35c612928a8ff1f6d9e0c4d73 07-Oct-2008 Ted Kremenek <kremenek@apple.com> Added prototype serialization code for DeclGroup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57222 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
c7b07c19daa861880ad4bbf257d0fb2c7961355f 07-Oct-2008 Ted Kremenek <kremenek@apple.com> Added prototype serialization code for DeclGroup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57222 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
80aeb41ddcd4be150410a1cfd0027c2af38cfa6c 07-Oct-2008 Ted Kremenek <kremenek@apple.com> Modified DeclGroupRef to always load/store the internal pointer value as Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57213 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
e285a9505c0be75d4b58e67aa32e82de55889235 07-Oct-2008 Ted Kremenek <kremenek@apple.com> Modified DeclGroupRef to always load/store the internal pointer value as Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57213 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
bcc375ad3060f6e7b2da53a00a30c50bb88a9ae7 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Use DeclStmt::decl_iterator to walk a group of Decl*'s instead of using the ScopedDecl chain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57206 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
53061c842d287b73500c47141f0059792631ed89 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Use DeclStmt::decl_iterator to walk a group of Decl*'s instead of using the ScopedDecl chain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57206 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c6353a8b16388c0364035f83e72453b8ec385253 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly.
This patch precedes removing getDecl() DeclStmt::entirely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57205 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
34a673850c80dfff9c701e449bc19c967b50663c 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly.
This patch precedes removing getDecl() DeclStmt::entirely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57205 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
62f23bbf2bced6d2869ed5d9f55236603dcee730 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57204 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
65aa3b9fda7b2114f708014e3d42176abc0e39ab 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57204 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
388b284e11061f1f8a63b6b096bf754abd20b3cf 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Added PrintRawDeclStmt; use this method to print out DeclStmt instead of using PrintRawDecl (which falsely assumes DeclStmts have only one Decl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57191 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ecd64c5e53012ab7b1fdc64094a24f83c9893581 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Added PrintRawDeclStmt; use this method to print out DeclStmt instead of using PrintRawDecl (which falsely assumes DeclStmts have only one Decl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57191 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
f3f8a494fb32f9015611796772263bd183c660dc 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Use Decl::decl_iterator instead of walking the ScopedDecl chain (which will soon be removed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57190 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
04a72b77da736734c925d673834888a081f5ebc5 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Use Decl::decl_iterator instead of walking the ScopedDecl chain (which will soon be removed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57190 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
4ae5f30bc778de2160b95ef9bb6a3ad66e2d12e0 06-Oct-2008 Chris Lattner <sabre@nondot.org> ExprConstant should not abort when it sees a pointer constant that isn't.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57162 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7cecee8da98e86cf7118d15a0f198b98956089a7 06-Oct-2008 Chris Lattner <sabre@nondot.org> ExprConstant should not abort when it sees a pointer constant that isn't.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57162 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2d9a3f6124b45c8b9c4094d06696293b64841a23 06-Oct-2008 Chris Lattner <sabre@nondot.org> Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr
which is checking for something that can be inconsistent with
what we can constant fold.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57159 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
45b6b9d080ac56917337d73d8f1cd6374b27b05d 06-Oct-2008 Chris Lattner <sabre@nondot.org> Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr
which is checking for something that can be inconsistent with
what we can constant fold.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57159 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
1eee9404f80332537cd2766c31cd05e024128717 06-Oct-2008 Chris Lattner <sabre@nondot.org> Move folding of __builtin_classify_type out of the CallExpr
interface into the constant folding interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57158 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
a4d55d89c8076b402bb168e3edeef0c2cd2a78c3 06-Oct-2008 Chris Lattner <sabre@nondot.org> Move folding of __builtin_classify_type out of the CallExpr
interface into the constant folding interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57158 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
667e1eebaa0c4c4bb1bd5fd75066025cfbce18b0 06-Oct-2008 Chris Lattner <sabre@nondot.org> Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57157 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
9e62171a25e3a08fb5c49fb370f83faf5ae786f5 06-Oct-2008 Chris Lattner <sabre@nondot.org> Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57157 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
27cde26ffc5fa28bf2ade7c5d27774f9b05ab55f 06-Oct-2008 Chris Lattner <sabre@nondot.org> Teach FloatExprEvaluator to evaluate __builtin_huge_val and inf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57154 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
34a74ab81600a40c6324fd76adb724b803dfaf91 06-Oct-2008 Chris Lattner <sabre@nondot.org> Teach FloatExprEvaluator to evaluate __builtin_huge_val and inf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57154 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
8729378a310a44366c655b171aaa41dc54efd487 06-Oct-2008 Chris Lattner <sabre@nondot.org> Add a comment that describes tryEvaluate. Make tryEvaluate fold
__builtin_constant_p properly, and add some scaffolding for
FloatExprEvaluator to eventually handle huge_val and inf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57152 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
019f4e858e78587f2241ff1a76c747d7bcd7578c 06-Oct-2008 Chris Lattner <sabre@nondot.org> Add a comment that describes tryEvaluate. Make tryEvaluate fold
__builtin_constant_p properly, and add some scaffolding for
FloatExprEvaluator to eventually handle huge_val and inf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57152 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
c24915f9b245ce31cce2265dc12b43a59667e730 06-Oct-2008 Chris Lattner <sabre@nondot.org> add a new CallExpr::isBuiltinCall() method, and use it to simplify some existing
code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57151 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
cb888967400a03504c88acedd5248d6778a82f46 06-Oct-2008 Chris Lattner <sabre@nondot.org> add a new CallExpr::isBuiltinCall() method, and use it to simplify some existing
code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57151 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3d6ff4c2da2cabb80e132c28202459274017f6f7 06-Oct-2008 Chris Lattner <sabre@nondot.org> a more efficient test for __builtin_classify_type



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57149 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a62a03b282dd996f6cc1ff498b7ff306ad3959f8 06-Oct-2008 Chris Lattner <sabre@nondot.org> a more efficient test for __builtin_classify_type



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57149 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2fda0eda3cec163d8d9a827cdc00c45b35eb354b 05-Oct-2008 Chris Lattner <sabre@nondot.org> Wrap long lines and other minor cleanups, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57119 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
61710854be2b098428aff5316e64bd34b30fbcb7 05-Oct-2008 Chris Lattner <sabre@nondot.org> Wrap long lines and other minor cleanups, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57119 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ce4a6796ffe6689d697b8ca091318bf27d464cca 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Make VectorType printing less broken.
- Print size as number of elements times "sizeof(elt type)", not
perfect but better than just printing the completely wrong type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57100 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
5620b50f8f81854b2a6fea16c69ff1853f8f4d9b 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Make VectorType printing less broken.
- Print size as number of elements times "sizeof(elt type)", not
perfect but better than just printing the completely wrong type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57100 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7636e9136bd260cb1d88b1a50ec2c18ee777e8fb 04-Oct-2008 Zhongxing Xu <xuzhongxing@gmail.com> Reverse the RHSBlock of LogicalOp && and ||

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57041 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
924d9a8cb989b5702dd07e1b1d7e8be9084f24f0 04-Oct-2008 Zhongxing Xu <xuzhongxing@gmail.com> Reverse the RHSBlock of LogicalOp && and ||

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57041 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f2c7cd0ec36b3b942ecdde2b09d2af25d6b3fa2b 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Pass postfix attributes to ActOnFields (mismarked a file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56993 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f7bb8b91bb2bc540f80f5ed1456a3dcef770abb6 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Pass postfix attributes to ActOnFields (mismarked a file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56993 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f394444eb11a4fb1b0cc0e50d5d466f3be4ad52a 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Pass postfix attributes to ActOnFields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56992 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1bfe1c2129771c06fb58ae5e8c079ae30e138309 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Pass postfix attributes to ActOnFields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56992 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
71cd7764258c22e00cacb0b41811b1039de93962 03-Oct-2008 Steve Naroff <snaroff@apple.com> Add getTypeSpecStartLoc() to VarDecls and FunctionDecls.

This is a temporary solution to help with the block rewriter (though it certainly has general utility).
Once DeclGroup's are implemented, this SourceLocation should be stored with it (since it applies to all the decls).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56985 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
0eb07bfde0deedcb35cf3d118b3488f5d8db32ec 03-Oct-2008 Steve Naroff <snaroff@apple.com> Add getTypeSpecStartLoc() to VarDecls and FunctionDecls.

This is a temporary solution to help with the block rewriter (though it certainly has general utility).
Once DeclGroup's are implemented, this SourceLocation should be stored with it (since it applies to all the decls).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56985 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
07253c7f77aca1857ba0226903c47cfb3a3b0543 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Builtins.def attribute for "can be a constant expression".
- Enabled for builtins which are always constant expressions
(__builtin_huge_val*, __builtin_inf*, __builtin_constant_p,
__builtin_classify_type, __builtin___CFStringMakeConstantString).

Added Builtin::Context::isConstantExpr.
- Currently overly simply interface which only works for builtins
whose constantexprness does not depend on their arguments.

CallExpr::isBuiltinConstantExpr now takes an ASTContext argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56983 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ae3f4919e4805f59c554d39cb9cd3a601809b2cb 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Builtins.def attribute for "can be a constant expression".
- Enabled for builtins which are always constant expressions
(__builtin_huge_val*, __builtin_inf*, __builtin_constant_p,
__builtin_classify_type, __builtin___CFStringMakeConstantString).

Added Builtin::Context::isConstantExpr.
- Currently overly simply interface which only works for builtins
whose constantexprness does not depend on their arguments.

CallExpr::isBuiltinConstantExpr now takes an ASTContext argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56983 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
27882f42a1b57373edd3a0d20dd84696d265b8a3 30-Sep-2008 Chris Lattner <sabre@nondot.org> Fix va_arg handling to do argument decaying at the correct place. This
fixes problems handling references of va_list, which happens on x86_64.
This fixes PR2841 and rdar://6252231


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56809 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
f77d545fe923d4c465fb07476254798135a8ed25 30-Sep-2008 Chris Lattner <sabre@nondot.org> Fix va_arg handling to do argument decaying at the correct place. This
fixes problems handling references of va_list, which happens on x86_64.
This fixes PR2841 and rdar://6252231


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56809 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
70b56707b0111f86abf2b33fea6d1868c2bd6e4f 28-Sep-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6252231 - cannot call vsnprintf with va_list on x86_64,
by decaying __builtin_va_list's type when forming builtins. On
x86-64 (and other targets) __builtin_va_list is a typedef for
an array.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56768 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
891ed9aa87e14ce4c13155a77c09cde4555f7dd1 28-Sep-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6252231 - cannot call vsnprintf with va_list on x86_64,
by decaying __builtin_va_list's type when forming builtins. On
x86-64 (and other targets) __builtin_va_list is a typedef for
an array.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56768 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.cpp
61b56914209138a0c537045ddf7978932ae16226 27-Sep-2008 Zhongxing Xu <xuzhongxing@gmail.com> Delete trailing white space. It's over 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56749 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
c61255f630a968c453856f356842ac23a6422599 27-Sep-2008 Zhongxing Xu <xuzhongxing@gmail.com> Delete trailing white space. It's over 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56749 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
4a1f5de64cc20e009fb6a555ee21fa939a2ab04e 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Internally store the body of a BlockExpr using a Stmt* instead of a CompoundStmt*, and use the getBody() method to do the appropriate checking. This both removes the type-punning warnings in Expr.cpp and also makes BlockExpr have more consistency checks against modifications to its body (via StmtIterator).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56710 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9da13f9ddb2567e36f4bbee7b3c32f54aeb76d5b 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Internally store the body of a BlockExpr using a Stmt* instead of a CompoundStmt*, and use the getBody() method to do the appropriate checking. This both removes the type-punning warnings in Expr.cpp and also makes BlockExpr have more consistency checks against modifications to its body (via StmtIterator).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56710 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6b03451c08f54e55b84215526ec2d9c88a0bc2b1 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Use a union instead of a bunch of magic casts to implement a variant. This removes the type-punning errors for DeclGroup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56708 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
1377e541eacaafa3e2c4ffa86f6540e6863beadb 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Use a union instead of a bunch of magic casts to implement a variant. This removes the type-punning errors for DeclGroup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56708 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
0953567a24be1787251e838a9cb0554fe9984a54 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Add CFG support for implicit-control flow for VLA size expressions within an SizeOfAlignOfTypeExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56706 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
610a09e409bea151a42dd907768f1e0c4b103f1f 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Add CFG support for implicit-control flow for VLA size expressions within an SizeOfAlignOfTypeExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56706 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d68a8d39b39a03060180c013393b56367ef65f61 26-Sep-2008 Ted Kremenek <kremenek@apple.com> Do not create CFGs for functions/methods using blocks (need to add control-flow).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56672 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
00c0a30acd5a5c6a1ef837b9bdd2c4c086b70204 26-Sep-2008 Ted Kremenek <kremenek@apple.com> Do not create CFGs for functions/methods using blocks (need to add control-flow).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56672 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
df8c7d76bf13b4880baa6b30187028625fef731c 26-Sep-2008 Ted Kremenek <kremenek@apple.com> Move VLA processing logic from LiveVariables to CFG construction. This way all dataflow analyses "see" the VLA size expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56655 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fcd06f77beadf0642bd008fdf596378f8570b55c 26-Sep-2008 Ted Kremenek <kremenek@apple.com> Move VLA processing logic from LiveVariables to CFG construction. This way all dataflow analyses "see" the VLA size expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56655 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
076d6cb185520f54e36dd4d2dc994ac9b1f20319 26-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak Expr::isModifiableLvalue() and Expr::isLvalue() to better deal with BlockDeclRef exprs.

This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4f6a7d7ead09b439216c32f2de806a998aeb222a 26-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak Expr::isModifiableLvalue() and Expr::isLvalue() to better deal with BlockDeclRef exprs.

This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
476773428978da25286a7ee21ec68c20b3e69e3e 26-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add # of block pointer types to -print-stats.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
248e1c01d3c9de4b62bdd291e0b99a91552cc487 26-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add # of block pointer types to -print-stats.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56638 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a59d56146842eff8cc265af39d37139baa561ddb 25-Sep-2008 Ted Kremenek <kremenek@apple.com> Added prototype implementation of the DeclGroup, DeclGroupRef, and DeclGroupOwningRef classes.
Documentation and testing are pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56611 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
d17062cc23df2137378eb808545e24be484c321a 25-Sep-2008 Ted Kremenek <kremenek@apple.com> Added prototype implementation of the DeclGroup, DeclGroupRef, and DeclGroupOwningRef classes.
Documentation and testing are pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56611 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.cpp
62f09f5335768571a422c8d8b9d01e08623f1b31 24-Sep-2008 Steve Naroff <snaroff@apple.com> Extend ASTContext::getTypeInfo() and ASTContext::getObjCEncodingForType() for BlockTypes.

This fixes <rdar://problem/6240616> clang: Assertion failed when using typedef and Blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56554 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
485eeff9ba73376c8e01179bf1a501b1723446cb 24-Sep-2008 Steve Naroff <snaroff@apple.com> Extend ASTContext::getTypeInfo() and ASTContext::getObjCEncodingForType() for BlockTypes.

This fixes <rdar://problem/6240616> clang: Assertion failed when using typedef and Blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56554 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f173b2c7f7dfe3b8697b0a14d960bb0ceb0d6342 23-Sep-2008 Daniel Dunbar <daniel@zuster.org> Bug fix, result of isIntegerConstantExpr could be of incorrect width
for type.
- PR2817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56482 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e1226d24d23510e422160eb2413d9bb90de9b144 23-Sep-2008 Daniel Dunbar <daniel@zuster.org> Bug fix, result of isIntegerConstantExpr could be of incorrect width
for type.
- PR2817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56482 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bb7a3d95821857c9d94fe3198c55467e3fbcfb93 19-Sep-2008 Ted Kremenek <kremenek@apple.com> Implement second part of PR 2600: NSError** parameter may be null, and should be checked before being dereferenced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56318 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
7360fda1efd88fd28ca2882579676dbd8569c181 19-Sep-2008 Ted Kremenek <kremenek@apple.com> Implement second part of PR 2600: NSError** parameter may be null, and should be checked before being dereferenced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56318 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
b31e2b3876406efbd90bbca99b2dbd72063f170e 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove BlockStmtExpr.
Block literals are now represented by the concrete BlockExpr class.
This is cleanup (removes a FIXME).
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56288 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
9c3c902835ef7d37300463ad47176ec21a67dc8b 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove BlockStmtExpr.
Block literals are now represented by the concrete BlockExpr class.
This is cleanup (removes a FIXME).
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56288 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
a095a75de7e3b14f431bb8ee4d6ae39a78d34624 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove support for BlockExprExpr. For example...
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56257 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
17dab4f616db7be6800c1f0505f4888d2e8ad7a2 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove support for BlockExprExpr. For example...
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56257 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
ad7c407fa1dc566d5320a002a79935b46098b28b 16-Sep-2008 Ted Kremenek <kremenek@apple.com> ProgramPoint now takes the space of two pointers instead of one. This change was
motivated because it became clear that the number of subclasses of ProgramPoint
would expand and we ran out of bits to represent a pointer variant. As a plus of
this change, BlockEdge program points can now be represented explicitly without
using a cache of CFGBlock* pairs in CFG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56245 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d452758bb6b59340528a26def9ecc24b329d4ecf 16-Sep-2008 Ted Kremenek <kremenek@apple.com> ProgramPoint now takes the space of two pointers instead of one. This change was
motivated because it became clear that the number of subclasses of ProgramPoint
would expand and we ran out of bits to represent a pointer variant. As a plus of
this change, BlockEdge program points can now be represented explicitly without
using a cache of CFGBlock* pairs in CFG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56245 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7b6f67b456bad51f53c955700bb5067fdfb2da7a 13-Sep-2008 Ted Kremenek <kremenek@apple.com> Patch by Csaba Hruska!

"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch
covers the AST library, but ignores Analysis lib."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56185 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
tmtPrinter.cpp
tmtViz.cpp
ype.cpp
a95d3750441ac8ad03e36af8e6e74039c9a3109d 13-Sep-2008 Ted Kremenek <kremenek@apple.com> Patch by Csaba Hruska!

"Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch
covers the AST library, but ignores Analysis lib."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56185 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
tmtPrinter.cpp
tmtViz.cpp
ype.cpp
1815b3bfc1382c88bee771bd158755b2426f0780 12-Sep-2008 Douglas Gregor <doug.gregor@gmail.com> Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56137 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
77a52233f7c0f162672652051bfe78b65ad4f789 12-Sep-2008 Douglas Gregor <dgregor@apple.com> Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56137 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
c821c862d85f8258529a0a32a9f35e394d7a430e 11-Sep-2008 Argiris Kirtzidis <akyrtzi@gmail.com> CXXConditionDeclExpr expression node is an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56093 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
24b41fa8239c63b9eb570d3e83c4a82840656a65 11-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> CXXConditionDeclExpr expression node is an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56093 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
080b9cc1b8cefeca3ea10b11b123be24e5b7717d 10-Sep-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Change line endings: CRLF -> LF

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56043 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
4189a76f55a9d5bb6fb3e63a491724b4dc2a7c45 10-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change line endings: CRLF -> LF

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56043 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
dbce6c11df75b223f22fbfcab76a9d4352257931 10-Sep-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add new 'CXXConditionDeclExpr' expression node used for a 'condition' declaration, e.g: "if (int x=0) {...}".
It is a subclass of DeclRefExpr and the main difference is that CXXConditionDeclExpr owns the declaration that it references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56033 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
9e922b1663ecb95dc7eee03002fd66ed18fb3192 10-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add new 'CXXConditionDeclExpr' expression node used for a 'condition' declaration, e.g: "if (int x=0) {...}".
It is a subclass of DeclRefExpr and the main difference is that CXXConditionDeclExpr owns the declaration that it references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56033 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmtPrinter.cpp
453a87884fa64e4449ffbdc66065e2484b478241 09-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak implementation for allowing ObjC builtin type redefinitions.

- Replace string comparisons with pre-defined idents.
- Avoid calling isBuiltinObjCType() to avoid two checks.
- Remove isBuiltinObjCType(), since it was only used in Sema::MergeTypeDefDecl().
- Have Sema::MergeTypeDefDecl() set the new type.

This is a moidified version of an patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55990 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2b255c4dabe6a04314e3659a0f8b61e1382ec287 09-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak implementation for allowing ObjC builtin type redefinitions.

- Replace string comparisons with pre-defined idents.
- Avoid calling isBuiltinObjCType() to avoid two checks.
- Remove isBuiltinObjCType(), since it was only used in Sema::MergeTypeDefDecl().
- Have Sema::MergeTypeDefDecl() set the new type.

This is a moidified version of an patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55990 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f5e7eff56ceb6cf133a191a405fdd8cd0c8c0953 09-Sep-2008 Steve Naroff <snaroff@apple.com> Simplify typesAreBlockCompatible().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55989 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3c1b91223908f1848622c3da21beced6d42371d4 09-Sep-2008 Steve Naroff <snaroff@apple.com> Simplify typesAreBlockCompatible().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55989 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d6163f3cfe7df430c3857d0552d5f5cb7ae86986 06-Sep-2008 Steve Naroff <snaroff@apple.com> More type checking for blocks. Still incomplete (will hopefully finish up this weekend).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55862 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
dd972f20dc2bd3609d833893e5c6544ac09b59a9 06-Sep-2008 Steve Naroff <snaroff@apple.com> More type checking for blocks. Still incomplete (will hopefully finish up this weekend).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55862 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
46a837c7ced306c55d1686cea5f77cb7a2f3b908 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.

This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).

The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.

- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
addition of DeclGroups.

Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
referenced by the AST. For example:

typedef struct { ... } x;

The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
refer to it. This will be solved with DeclGroups.

- This patch also (temporarily) breaks CodeGen. More below.

High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it. When
a struct/union/class is first referenced, a RecordType and RecordDecl are
created for it, and the RecordType refers to that RecordDecl. Later, if
a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
updated to point to the RecordDecl that defines the struct/union/class.

- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
enum/struct/class/union. This is useful from going from a RecordDecl* that
defines a forward declaration to the RecordDecl* that provides the actual
definition. Note that this also works for EnumDecls, except that in this case
there is no distinction between forward declarations and definitions (yet).

- Clients should no longer assume that 'isDefinition()' returns true from a
RecordDecl if the corresponding struct/union/class has been defined.
isDefinition() only returns true if a particular RecordDecl is the defining
Decl. Use 'getDefinition()' instead to determine if a struct has been defined.

- The main changes to Sema happen in ActOnTag. To make the changes more
incremental, I split off the processing of enums and structs et al into two
code paths. Enums use the original code path (which is in ActOnTag) and
structs use the ActOnTagStruct. Eventually the two code paths will be merged,
but the idea was to preserve the original logic both for comparison and not to
change the logic for both enums and structs all at once.

- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
that correspond to the same type simply have a pointer to that type. If we
need to figure out what are all the RecordDecls for a given type we can build
a backmap.

- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
changes to RecordDecl. For some reason 'svn' marks the entire file as changed.

Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
RecordType*. This was true before because we only created one RecordDecl* for
a given RecordType*, but it is no longer true. I believe this shouldn't be too
hard to change, but the patch was big enough as it is.

I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55839 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
4b7c98378ae0c1a3635f0b7756848b4a9923f8bc 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.

This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).

The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.

- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
addition of DeclGroups.

Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
referenced by the AST. For example:

typedef struct { ... } x;

The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
refer to it. This will be solved with DeclGroups.

- This patch also (temporarily) breaks CodeGen. More below.

High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it. When
a struct/union/class is first referenced, a RecordType and RecordDecl are
created for it, and the RecordType refers to that RecordDecl. Later, if
a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
updated to point to the RecordDecl that defines the struct/union/class.

- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
enum/struct/class/union. This is useful from going from a RecordDecl* that
defines a forward declaration to the RecordDecl* that provides the actual
definition. Note that this also works for EnumDecls, except that in this case
there is no distinction between forward declarations and definitions (yet).

- Clients should no longer assume that 'isDefinition()' returns true from a
RecordDecl if the corresponding struct/union/class has been defined.
isDefinition() only returns true if a particular RecordDecl is the defining
Decl. Use 'getDefinition()' instead to determine if a struct has been defined.

- The main changes to Sema happen in ActOnTag. To make the changes more
incremental, I split off the processing of enums and structs et al into two
code paths. Enums use the original code path (which is in ActOnTag) and
structs use the ActOnTagStruct. Eventually the two code paths will be merged,
but the idea was to preserve the original logic both for comparison and not to
change the logic for both enums and structs all at once.

- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
that correspond to the same type simply have a pointer to that type. If we
need to figure out what are all the RecordDecls for a given type we can build
a backmap.

- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
changes to RecordDecl. For some reason 'svn' marks the entire file as changed.

Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
RecordType*. This was true before because we only created one RecordDecl* for
a given RecordType*, but it is no longer true. I believe this shouldn't be too
hard to change, but the patch was big enough as it is.

I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55839 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
2c9840470bd025cc60b88fa86dff1122d48b6a3a 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Remove "NextDecl" from RecordDecl. This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.

The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55821 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclSerialization.cpp
df042e6c2bf06b2d9ed53c52469599ac1bd93a3f 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Remove "NextDecl" from RecordDecl. This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.

The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55821 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
eclSerialization.cpp
77f9337c6e62460303c433b5c139a223f39dccb8 04-Sep-2008 Ted Kremenek <kremenek@apple.com> Fix CFG construction bug:
- Within for loops, 'continue' should jump to a basic block containing the
increment code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55800 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e933450535ab077b95e59f929a4ccb25b6f360e6 04-Sep-2008 Ted Kremenek <kremenek@apple.com> Fix CFG construction bug:
- Within for loops, 'continue' should jump to a basic block containing the
increment code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55800 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6f37333d6a97b64d4b80c4bbd8ce65a4b7e50abb 04-Sep-2008 Steve Naroff <snaroff@apple.com> Fix a handful of typos (closure->block) to avoid confusion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
bfdcae678d44906293e21c0cddc6537f3ee8b5a4 04-Sep-2008 Steve Naroff <snaroff@apple.com> Fix a handful of typos (closure->block) to avoid confusion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55768 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
3454b6cd8d58c98e2a867fb1104af11e1c183f68 04-Sep-2008 Steve Naroff <snaroff@apple.com> Add type checking for blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55767 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1c7d067550c2d9bca8997d0e67ee6b280d493202 04-Sep-2008 Steve Naroff <snaroff@apple.com> Add type checking for blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55767 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
52a81c04a25001409f8b0c9b296248fd7cf80e13 03-Sep-2008 Steve Naroff <snaroff@apple.com> Add semantic analysis for "blocks".

Highlights...

- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().

Next steps...

- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55710 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
4eb206bebcdab28ababe8df55c6185cec2cdc071 03-Sep-2008 Steve Naroff <snaroff@apple.com> Add semantic analysis for "blocks".

Highlights...

- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().

Next steps...

- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55710 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
cc37ac5424171a333153f8c480a562072132b948 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Fix ObjCPropertRefExpr to be able to encode all the information for
uses which refer to methods not properties.
- Not yet wired in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55681 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtSerialization.cpp
e66f4e3e3ae9d7d11b0c302211066fad69228aba 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Fix ObjCPropertRefExpr to be able to encode all the information for
uses which refer to methods not properties.
- Not yet wired in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55681 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtSerialization.cpp
6f0a241910c5a64854d80b177d501e727c91dbaf 02-Sep-2008 Ted Kremenek <kremenek@apple.com> RecordDecl:
- Remove method 'isForwardDecl'; this functionality is already provided by
'isDefinition()'
- Move method definitions to be co-located with other RecordDecl methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55649 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
6359792ca92e7ca2f416cb804c6604358174e994 02-Sep-2008 Ted Kremenek <kremenek@apple.com> RecordDecl:
- Remove method 'isForwardDecl'; this functionality is already provided by
'isDefinition()'
- Move method definitions to be co-located with other RecordDecl methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55649 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bae6bbed44a92a9c9c6e0de02e7485c62ca4f300 02-Sep-2008 Ted Kremenek <kremenek@apple.com> RecordDecl serialization:
- Don't serialize out the NextDeclarator field. It is unused and deprecated.
- Serialize out the NextDecl pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55644 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
6812a7308d521522e6888ae981b6f9cf31d110ac 02-Sep-2008 Ted Kremenek <kremenek@apple.com> RecordDecl serialization:
- Don't serialize out the NextDeclarator field. It is unused and deprecated.
- Serialize out the NextDecl pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55644 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
10a6fb834bef82daafe90ecee593ffb31d25d284 02-Sep-2008 Ted Kremenek <kremenek@apple.com> RecordDecl:
- Added method 'isForwardDeclaration', a predicate method that returns true
if a RecordDecl represents a forward declaration.
- Added method 'getDefinitionDecl', a query method that returns a pointer to
the RecordDecl that provides the actual definition of a struct/union.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55642 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a39da065766bdfeee3421a2e71f60ae579170fef 02-Sep-2008 Ted Kremenek <kremenek@apple.com> RecordDecl:
- Added method 'isForwardDeclaration', a predicate method that returns true
if a RecordDecl represents a forward declaration.
- Added method 'getDefinitionDecl', a query method that returns a pointer to
the RecordDecl that provides the actual definition of a struct/union.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55642 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
25d8be16495d3952b6b50d6e8ed2ff6d58c02185 02-Sep-2008 Ted Kremenek <kremenek@apple.com> CXXRecordDecl and RecordDecl:
- Change constructor and create methods to accept a CXXRecordDecl* (RecordDecl*)
instead of a ScopedDecl* for PrevDecl. This causes the type checking
to be more tight and doesn't break any code.

RecordDecl:

- Don't use the NextDeclarator field in ScopedDecl to represent the previous
declaration. This is a conflated use of the NextDeclarator field, which will
be removed anyway when DeclGroups are fully implemented.

- Instead, represent (a soon to be implemented) chain of RecordDecls using a
NextDecl field. The last RecordDecl in the chain is always the 'defining'
RecordDecl that owns the FieldDecls. The other RecordDecls in the chain
are forward declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55640 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
df91eca19bd9738abd9a3b84791f39750e27ad36 02-Sep-2008 Ted Kremenek <kremenek@apple.com> CXXRecordDecl and RecordDecl:
- Change constructor and create methods to accept a CXXRecordDecl* (RecordDecl*)
instead of a ScopedDecl* for PrevDecl. This causes the type checking
to be more tight and doesn't break any code.

RecordDecl:

- Don't use the NextDeclarator field in ScopedDecl to represent the previous
declaration. This is a conflated use of the NextDeclarator field, which will
be removed anyway when DeclGroups are fully implemented.

- Instead, represent (a soon to be implemented) chain of RecordDecls using a
NextDecl field. The last RecordDecl in the chain is always the 'defining'
RecordDecl that owns the FieldDecls. The other RecordDecls in the chain
are forward declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55640 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclCXX.cpp
a7bbf567dac9dfd58f12c9ff14584d64104694f3 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> codegen constant data as such. add QualType::isConstant()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55603 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
b381aac9bae6d608c72267dd0ed08ec6369e94e4 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> codegen constant data as such. add QualType::isConstant()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55603 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
f58cac7442d6aca9e95a32e9ae90f92fbf7d9af8 30-Aug-2008 Anders Carlsson <andersca@mac.com> Add code to create the fast enumeration state type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55572 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bd4c1ada2e8668f43a865dc2c662085cf61940c4 30-Aug-2008 Anders Carlsson <andersca@mac.com> Add code to create the fast enumeration state type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55572 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
dd85128cf057a296b3704141d250f8bc0ce421d6 30-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
favor of just result type and selector. Necessary so it can be
reused in situations where we don't want to cons up an
ObjCMessageExpr.
- Update aggregate binary assignment to know about special property
ref lvalues.
- Add CodeGenFunction::EmitCallArg overload which takes an already
emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
7f8ea5c5b3a6a4332a841eefdd86b0726722ea7b 30-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
favor of just result type and selector. Necessary so it can be
reused in situations where we don't want to cons up an
ObjCMessageExpr.
- Update aggregate binary assignment to know about special property
ref lvalues.
- Add CodeGenFunction::EmitCallArg overload which takes an already
emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
fd5b19da83002f37a74c2631dd07e742ed36221a 28-Aug-2008 Steve Naroff <snaroff@apple.com> Add parser/action support for block literal expressions.
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55495 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
296e8d5fdcf9946f51e866adc8d281379e51efe9 28-Aug-2008 Steve Naroff <snaroff@apple.com> Add parser/action support for block literal expressions.
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55495 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
461d08c36cb3d72a1fa041bc2fd63b789dcffb49 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix isIntegerConstantExpr eval of __builtin_offsetof to return result
with correct width.
- PR2728.

Also, fix PR2727 test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55493 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
aa1f9f1d50adf294674b74510b62e863b68572bc 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix isIntegerConstantExpr eval of __builtin_offsetof to return result
with correct width.
- PR2728.

Also, fix PR2727 test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55493 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7cfb85b8d1b17cd6e162f74762c58f95562db1e5 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix double-free error with sizeof applied to VLA types.
- PR2727.

Also, fix warning in CodeGenTypes for new BlockPointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55479 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9048891ff983d0681c116c6e8f1073aa31bdd6e8 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix double-free error with sizeof applied to VLA types.
- PR2727.

Also, fix warning in CodeGenTypes for new BlockPointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55479 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
698d6f390d47eff6d4317c9d8423009bb816f3fb 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> NeXT: Emit mostly-correct property type encoding.
- Added ASTContext::getObjCEncodingForPropertyDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55461 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c56f34a1c1779de15330bdb3eec39b3418802d47 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> NeXT: Emit mostly-correct property type encoding.
- Added ASTContext::getObjCEncodingForPropertyDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55461 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7aa5475ca2f62df5ba3f3b647ee141a40bf48fd3 27-Aug-2008 Steve Naroff <snaroff@apple.com> First wave of changes to support "blocks" (an extension to C).
This commit adds the declaration syntax (and associated type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55417 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeSerialization.cpp
5618bd4a52c45fbbb605e3ba885663b2164db8a3 27-Aug-2008 Steve Naroff <snaroff@apple.com> First wave of changes to support "blocks" (an extension to C).
This commit adds the declaration syntax (and associated type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55417 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ypeSerialization.cpp
e7abcc4f26e429885acac5b97e8ab21be8682594 27-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix "possibly uninitialized" warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55406 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e86d923f18be15ff8367f180c1d2722eed2e9716 27-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix "possibly uninitialized" warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55406 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d01a70258cb228ad8d1739cfec5cbb2507ced3f5 27-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add addPropertyMethods implementations for
ObjC{Category,Protocol}Decl.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55404 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7b4732296b5c7e1a53021a8dbb97f39dedbd961f 27-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add addPropertyMethods implementations for
ObjC{Category,Protocol}Decl.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55404 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
db3b4491329dd898e6b133be2e193f13fa3123a3 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add ObjCPropertyDecl::isReadOnly.

Respect isReadOnly when generating synthesized method decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55364 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
394d33f1f602f7681032a659dff5bb09061ee510 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add ObjCPropertyDecl::isReadOnly.

Respect isReadOnly when generating synthesized method decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55364 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
dd24b9ac61e21a196e6c2222b97ad60d0aaa377e 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> constify ObjC*::getClassMethod,getInstanceMethod

No (intended) functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55362 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3216dcdebb8ae0f2993ac5f5249caa217444bacf 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> constify ObjC*::getClassMethod,getInstanceMethod

No (intended) functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55362 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8811637718129dbab7c12b49157f2fdf7e04511e 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Missed a file; part of:

Move implicit Obj-C param creation into ObjCMethodDecl.
- Add ObjCMethodDecl::createImplicitParams.
- Remove ObjCMethodDecl::set{Self,Cmd}Decl
- Remove Sema::CreateImplicitParameter

No (intended) functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55357 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
08a356cc2b98cff990ef6969e819a214443d7f8f 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Missed a file; part of:

Move implicit Obj-C param creation into ObjCMethodDecl.
- Add ObjCMethodDecl::createImplicitParams.
- Remove ObjCMethodDecl::set{Self,Cmd}Decl
- Remove Sema::CreateImplicitParameter

No (intended) functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55357 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
14117fc5e21d0994bcbc2cfe9c7baff629f24e62 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)
- Change enum name to Kind.
- Change enum constants to English strings.

Also, fix getPropertyImplementation (which probably should be renamed)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55354 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
9f0afd4e79601d9982072ff9318e6f9a982c770e 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)
- Change enum name to Kind.
- Change enum constants to English strings.

Also, fix getPropertyImplementation (which probably should be renamed)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55354 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4b8babe06fcbe594663113ae74f1cf698e6aa960 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix return type for setter method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55353 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
5fa63312cfc9a6cd2ea688eaea90ca534aeb8c0e 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix return type for setter method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55353 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
70cdeaa39766128b61b71fe4035624f9c3443b85 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Synthesize property setter method as we do for getter.
- Also, fix Parser to construct proper SetterName selector (should be
lifted out of parser though).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55352 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4d7da2f4a39adcc2ea211fb30600fabde4f3a0b1 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Synthesize property setter method as we do for getter.
- Also, fix Parser to construct proper SetterName selector (should be
lifted out of parser though).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55352 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
40b9077d04b8dc18a1c5f1ab92aabc44fbeba785 25-Aug-2008 Anders Carlsson <andersca@mac.com> Handle emitting __builtin_huge_valf as a constant expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55299 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2ea2b5e2b044739f4f5840bc1271abfa15a3101d 25-Aug-2008 Anders Carlsson <andersca@mac.com> Handle emitting __builtin_huge_valf as a constant expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55299 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ed6c2140bcf507dd0aec6a44af101af6f098d9c3 23-Aug-2008 Anders Carlsson <andersca@mac.com> treat bool literals as constatnt expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55255 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b88d45ea7eb835d36c4a4b3ea84b1260b120dd0a 23-Aug-2008 Anders Carlsson <andersca@mac.com> treat bool literals as constatnt expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55255 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
750eb97ec57043f4ee2ee652bf6f6ae282c1487b 23-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add CodeGen support for CXXZeroInitValueExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55249 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7267f7832e5f0c7f951765e201c5a2650eb1637b 23-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add CodeGen support for CXXZeroInitValueExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55249 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
458deb71c045e63a4648af34670adc4519ccb1c7 23-Aug-2008 Anders Carlsson <andersca@mac.com> Handle AddrLabelExprs in Expr::isConstantExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55245 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
15425f9d2d92e2a5f99b09b8e2fc00025631e593 23-Aug-2008 Anders Carlsson <andersca@mac.com> Handle AddrLabelExprs in Expr::isConstantExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55245 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7a1e74100c4f7e3f0e85775861cdf4851df616bd 22-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add support for C++'s "type-specifier ( expression-list )" expression:

-The Parser calls a new "ActOnCXXTypeConstructExpr" action.
-Sema, depending on the type and expressions number:
-If the type is a class, it will treat it as a class constructor. [TODO]
-If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node
-If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55177 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
987a14bf5883ef6e5d07f1c83eb6d41a8212a78c 22-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add support for C++'s "type-specifier ( expression-list )" expression:

-The Parser calls a new "ActOnCXXTypeConstructExpr" action.
-Sema, depending on the type and expressions number:
-If the type is a class, it will treat it as a class constructor. [TODO]
-If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node
-If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55177 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
c91a3f36cd2853eadfbf0c553a16cd514a15aff1 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix some issues with array type merging. (No visible difference,
because nothing uses the merged types yet.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55161 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3bc0f45a5e65814f42b22dcdf7249d1120d16f36 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix some issues with array type merging. (No visible difference,
because nothing uses the merged types yet.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55161 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
36104c1a2a18f1f78eba031e3a7a76d40416c4a7 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Minor const cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55160 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
86da77fdaf4c0237eafb9670f54eee20b08635bf 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Minor const cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55160 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0d9549ba8a0dfae3cc59532884a050c098bc9418 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Rewrite type compatibility testing to do type merging rather than just
testing compatibility. This is necessary for some constructs, like merging
redeclarations.

Also, there are some ObjC changes to make sure that
typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any
ObjC code beyond the testsuite, so please tell me if there are any cases
where this doesn't behave as expected.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55158 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3d815e7eb56c25d7ed812eced32e41df43039f9a 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Rewrite type compatibility testing to do type merging rather than just
testing compatibility. This is necessary for some constructs, like merging
redeclarations.

Also, there are some ObjC changes to make sure that
typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any
ObjC code beyond the testsuite, so please tell me if there are any cases
where this doesn't behave as expected.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55158 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2f44549310f637e85eb615b6e614815080b76a3d 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Initial implementation of floats in Expr::tryEvaluate; this doesn't
implement some things, like unary operators and casts, but it's enough
to fix PR2703 as filed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55155 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d8bfe7f25a695ca947effbccdf9ecbe3e018e221 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Initial implementation of floats in Expr::tryEvaluate; this doesn't
implement some things, like unary operators and casts, but it's enough
to fix PR2703 as filed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55155 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d8bd6822067df6da893ecbc112839258fcc08715 20-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix attributes on Obj-C interfaces & methods.
- Drop MethodAttrs parameter to ObjCMethodDecl
- Call ProcessDeclAttributeList for interface & method decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55068 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f6414927e67e27d9324d8d179c5f7ea620443924 20-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix attributes on Obj-C interfaces & methods.
- Drop MethodAttrs parameter to ObjCMethodDecl
- Call ProcessDeclAttributeList for interface & method decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55068 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e5bedfe77babdf1060c875b3f303d8d331e4598b 20-Aug-2008 Ted Kremenek <kremenek@apple.com> Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55037 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
01e6779faca1e3a3164c697d6e2dfee0881a6981 20-Aug-2008 Ted Kremenek <kremenek@apple.com> Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55037 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
eclObjC.cpp
c45e2fb32e93cda8c423c721fae52b7321e2ee04 19-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):

Expr
-> CastExpr
-> ExplicitCastExpr
-> ImplicitCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54955 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtSerialization.cpp
0835a3cdeefe714b4959d31127ea155e56393125 19-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):

Expr
-> CastExpr
-> ExplicitCastExpr
-> ImplicitCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54955 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
tmtPrinter.cpp
tmtSerialization.cpp
0338529b900cfc74c5e23b2fcd662a8b2c89c701 14-Aug-2008 Steve Naroff <snaroff@apple.com> Fix ASTContext::getObjCEncodingForType() to limit the type info for structure bodies (mimics gcc's adhoc rules).
This fixes <rdar://problem/6140902> clang ObjC rewriter: If a class contains a struct ivar with a lot of members, ...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54777 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
faf37e7d3646c4f473e7a565a9a2f8baed62dbe6 14-Aug-2008 Steve Naroff <snaroff@apple.com> Fix ASTContext::getObjCEncodingForType() to limit the type info for structure bodies (mimics gcc's adhoc rules).
This fixes <rdar://problem/6140902> clang ObjC rewriter: If a class contains a struct ivar with a lot of members, ...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54777 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7cbcbf42f86982eb686e00bbe28432a51f683102 14-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update some isIntegerConstantExpr uses to use
getIntegerConstantExprValue where appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
32442bbc98bafa512fa42d46fedf60ed7d79f574 14-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update some isIntegerConstantExpr uses to use
getIntegerConstantExprValue where appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54771 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
e0ad215b709fba79b3a1ead9af31a6f8bd3ee77a 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
xpr.cpp
xprConstant.cpp
arentMap.cpp
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
ype.cpp
ypeSerialization.cpp
acc5f3e42334525bf28c86471551f83dfce222d5 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
FG.cpp
xpr.cpp
xprConstant.cpp
arentMap.cpp
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
ype.cpp
ypeSerialization.cpp
64789f8496d9bd3ff5ba3686feca0de1a25d5a32 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c4a1dea2dc56bd1357ec91b829a0b9e68229a13e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
de30073d24ef186212a70e2a21f488767e45b7fb 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
SourceLocation.h)
- Move ASTContext constructor into implementation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
ecl.cpp
eclBase.cpp
eclObjC.cpp
xpr.cpp
e91593ef084479340582b2ba177b44be50a717b7 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
SourceLocation.h)
- Move ASTContext constructor into implementation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
uiltins.cpp
ecl.cpp
eclBase.cpp
eclObjC.cpp
xpr.cpp
0ccfaa48d37ba626d1e6f1322d03e74110be4215 10-Aug-2008 Steve Naroff <snaroff@apple.com> Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54617 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
76de9d7a32b16246e2acd0d1ecd7355faceb4901 10-Aug-2008 Steve Naroff <snaroff@apple.com> Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54617 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
47968a9f859948e69716104b0fec3e48d6deb232 10-Aug-2008 Anders Carlsson <andersca@mac.com> Remove the old evaluator code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54615 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
165a70fd0b75a4f23456531824e1b76a9f1c4f9c 10-Aug-2008 Anders Carlsson <andersca@mac.com> Remove the old evaluator code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54615 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
69909293d4d0bdffef36121651906f7d2e767d85 10-Aug-2008 Chris Lattner <sabre@nondot.org> rename PreDefinedExpr -> PredefinedExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
d9f6910f4ef37c0e8eeee2a01287d9572c3176ef 10-Aug-2008 Chris Lattner <sabre@nondot.org> rename PreDefinedExpr -> PredefinedExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
tmtSerialization.cpp
aefcabd153212f2dfc2ae1bd3978d84e376a4e73 10-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add some C++ Decl statistics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54604 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
55d71f9f4cf5f123db5d6dcfd20f3a8d5699c226 10-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add some C++ Decl statistics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54604 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
3d3b18f0116e6414364aa3431009e2838238fd9d 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Remove the ICE pointer cast hack; the issue this was working around is
now fixed in an alternate way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54598 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
355aba8d7ca0a27a2870f5bdeacc9dcf873eef77 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Remove the ICE pointer cast hack; the issue this was working around is
now fixed in an alternate way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54598 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b198791a4c155b7be3f728ccceee84e1a0242894 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Turn on the new constant expression evaluator; it isn't
anywhere near complete, but I don't know of any issues, and it can
handle enough to allow removing the I-C-E pointer cast hack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54597 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2eb0ddc1baaee173ea0dccf2a4edef48638b902d 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Turn on the new constant expression evaluator; it isn't
anywhere near complete, but I don't know of any issues, and it can
handle enough to allow removing the I-C-E pointer cast hack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54597 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fd799697e69f58c784c776dbf66b97669260cf01 09-Aug-2008 Chris Lattner <sabre@nondot.org> Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl. Thanks to Martin Doucha for the
isIncompleteArrayType part of this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54592 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8389eab190afef3462f6418b8d8fb70fb01c4005 09-Aug-2008 Chris Lattner <sabre@nondot.org> Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl. Thanks to Martin Doucha for the
isIncompleteArrayType part of this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54592 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2a4e1161b2d5450e0e91d00993a4d2e04df1731f 09-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54588 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
55f4b02bc71e7347986c6a5249bef635aac1901a 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54588 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1f9e2107f56c29ad39fbb04fe8733875e08d1435 09-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Handle WChar inside BuiltinType::getName().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54587 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
46713efe13c89f4ec9cd9546c7b598fe7186089b 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle WChar inside BuiltinType::getName().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54587 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1ed03e75c3a03edea7234a3021f76e808d283f2f 09-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Implement support for the 'wchar_t' C++ type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
64c438a4be2a871fa43c78264663ba1e9788b94d 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for the 'wchar_t' C++ type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d64c1112f5503360deb70cacead9ec11d56304d1 08-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Destroy and delete the FieldDecl members of a RecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54527 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
997b6c6d73541f010afc81e28191c8eae7b24f77 08-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Destroy and delete the FieldDecl members of a RecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54527 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ea29d1ec6b76c3722d7c0fb6a3d35c2d8cc74a79 07-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add CXXRecordType class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
49aa7ff1245abd03e6e998e01302df31e4c6f8f6 07-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add CXXRecordType class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54488 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
0865a99d1c67a479736cb0b552e2f346444e88ec 07-Aug-2008 Ted Kremenek <kremenek@apple.com> Cleanup some processing with DeclStmt, and gradually start using the internal BumpPtrAllocator to allocator more of CFG's data structures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54433 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c7eb9031159f30a63db960fad4640d779f1617c8 07-Aug-2008 Ted Kremenek <kremenek@apple.com> Cleanup some processing with DeclStmt, and gradually start using the internal BumpPtrAllocator to allocator more of CFG's data structures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54433 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1f62aa8e0d797a06895cd6044501d2fa6039a124 07-Aug-2008 Ted Kremenek <kremenek@apple.com> Always construct the BumpPtrAllocator used by CFG as an instance variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54429 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ce1eb34bbea1e0408f1952776d7d52ccde1bd275 07-Aug-2008 Ted Kremenek <kremenek@apple.com> Always construct the BumpPtrAllocator used by CFG as an instance variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54429 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4c734c4116cb81e10551ede1716909b0768f7370 07-Aug-2008 Ted Kremenek <kremenek@apple.com> Fix serialization of DeclStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54428 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
4958e5b3da3752a66fd515901136ad0fa0a67a31 07-Aug-2008 Ted Kremenek <kremenek@apple.com> Fix serialization of DeclStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54428 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
c50a5a3e7edb7ef11e1b8b3879abefbca90e5225 06-Aug-2008 Ted Kremenek <kremenek@apple.com> Reorder serialization methods.
When serializing DeclStmt, encode a bit indicating whether or not the DeclStmt owns the Decl. This is an interim solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54410 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
a1a78246b1be7e64232af18941333eeb0731a1b9 06-Aug-2008 Ted Kremenek <kremenek@apple.com> Reorder serialization methods.
When serializing DeclStmt, encode a bit indicating whether or not the DeclStmt owns the Decl. This is an interim solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54410 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
7340a2f6b84480429d385897e3f3e1ac99680db2 06-Aug-2008 Nico Weber <nicolasweber@gmx.de> remove spaces at eol to test commit access

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54381 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
608b17f792691c9e3dcdd2dfbe95b593aece0b40 06-Aug-2008 Nico Weber <nicolasweber@gmx.de> remove spaces at eol to test commit access

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54381 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
b59f9cf0be6e619d471d880384a304bb940821b4 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead. Will update other clients after additional testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
14f8b4ff660bcaa763974b8d0fae81857c594495 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead. Will update other clients after additional testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
a3195a3b5b0302b8d715f271d0c99c675fb91cbe 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Nico Weber:

"the attached patch fixes some typos, 80 cols violations, etc. in comments."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54328 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a34ea072371154c9042ce86321d17fbb4df1f84d 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Nico Weber:

"the attached patch fixes some typos, 80 cols violations, etc. in comments."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54328 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a1923f6d95601582f4a5c3924b8e1c5ac3f658b3 04-Aug-2008 Chris Lattner <sabre@nondot.org> Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
ype.cpp
c63a1f276f7b324fd9a4be82098b1c8f7bf30733 04-Aug-2008 Chris Lattner <sabre@nondot.org> Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
ype.cpp
3e64dd7612f3619c6cffbf92bb5acf10c01e011b 27-Jul-2008 Eli Friedman <eli.friedman@gmail.com> Minor tweak plus a couple of FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54119 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d9f4bcda18bfbf79341edd9d381d4b6a3cffe655 27-Jul-2008 Eli Friedman <eli.friedman@gmail.com> Minor tweak plus a couple of FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54119 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
809da269fb57f4cee4dd9fd786b22fb9961f89c7 27-Jul-2008 Ted Kremenek <kremenek@apple.com> Fix serialization for TypedefType by allowing TypedefType to access the internal CanonicalType stored in Type.
The test case Serialization/stmt_exprs.c now passes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54117 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
d90700108cfb45f2dda6c5a7adc11ce5ac68aa0d 27-Jul-2008 Ted Kremenek <kremenek@apple.com> Fix serialization for TypedefType by allowing TypedefType to access the internal CanonicalType stored in Type.
The test case Serialization/stmt_exprs.c now passes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54117 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
a55e321bd645398b514e246981c04a4889ee2472 27-Jul-2008 Chris Lattner <sabre@nondot.org> make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54116 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
c36d405a02fab41f6c45cb2bc750d64949742903 27-Jul-2008 Chris Lattner <sabre@nondot.org> make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54116 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
128b440db747d974c6b9fa0dd8904244cced8213 27-Jul-2008 Chris Lattner <sabre@nondot.org> Comment out the last call to QualType::getCanonicalType. This *breaks*
Serialization/stmt_exprs.c, but I don't know the right solution. Will fix
when I get a chance to talk to Ted about it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54109 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
a210573f75e28687f66560a6de8e5c4d32902c49 27-Jul-2008 Chris Lattner <sabre@nondot.org> Comment out the last call to QualType::getCanonicalType. This *breaks*
Serialization/stmt_exprs.c, but I don't know the right solution. Will fix
when I get a chance to talk to Ted about it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54109 91177308-0d34-0410-b5e6-96231b3b80d8
ypeSerialization.cpp
d5a56aae166344e13f1f8c845530beee0868db49 27-Jul-2008 Chris Lattner <sabre@nondot.org> change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54105 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ype.cpp
b77792eabf5882cf9af8cc810599b20432fda6c2 27-Jul-2008 Chris Lattner <sabre@nondot.org> change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54105 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
ype.cpp
25168a59a231071fb6c8d5bfd8f80612d58f9fb1 26-Jul-2008 Chris Lattner <sabre@nondot.org> convert more code to use ASTContext to get canonical types instead
of doing it directly. This is required for PR2189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54102 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
28be73f74c9e241a23ea24fe5756623de6bf1084 26-Jul-2008 Chris Lattner <sabre@nondot.org> convert more code to use ASTContext to get canonical types instead
of doing it directly. This is required for PR2189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54102 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
200964f0c96d58eb1fee877f5a48459d91e3128a 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix some problems handling stmtexprs with labels (PR2374), and
improve 'expression unused' diagnostics for stmtexprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54098 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
611b2eccaf3869f32de51ecc02985426d1c0aaef 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix some problems handling stmtexprs with labels (PR2374), and
improve 'expression unused' diagnostics for stmtexprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54098 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b8a17eb7e8123fc595b26806c709ef8cb03f0a88 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix an extraneous blank line in -ast-dump output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54097 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
3cb640bad3e6d8a40897f0a02c5ed6dcb14d1418 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix an extraneous blank line in -ast-dump output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54097 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
4a68fe04deb7ab89ac7566dc55b3b623129c72e5 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix several problems with the protocol qualified id handling where id was implicit.

First, fix canonical type handling of these, since protocol qualified id's are always
canonical. Next, enhance SemaType to actually make these when used (instead of int)
allowing them to actually be used when appropriate. Finally remove a bunch of logic
relating to the mishandling of canonical types with protocol-qual id's. This fixes
rdar://5986251


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54083 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
62f5f7ffad57e0c2af2b308af3735351505937cb 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix several problems with the protocol qualified id handling where id was implicit.

First, fix canonical type handling of these, since protocol qualified id's are always
canonical. Next, enhance SemaType to actually make these when used (instead of int)
allowing them to actually be used when appropriate. Finally remove a bunch of logic
relating to the mishandling of canonical types with protocol-qual id's. This fixes
rdar://5986251


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54083 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
c21abaf2940aba7aa03757d559f4f58f840b4c13 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix 80 col violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54075 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7c4a191d8be7eac565a64369de072b2a52bf6749 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix 80 col violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54075 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e02e440a32375a1635d634f21b535032043504d3 26-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095136, various crashes with incomplete enum types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54074 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
834a72ac74cf4ff07ba6215545dba3db578f8a07 26-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095136, various crashes with incomplete enum types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54074 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4b639c0cb0a4a02b680145e1b42a37bf588196f3 26-Jul-2008 Chris Lattner <sabre@nondot.org> minor cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54073 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
e8e4f928e51091c1f9c7f5b4595941e33dc0bfec 26-Jul-2008 Chris Lattner <sabre@nondot.org> minor cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54073 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
4c77156d6fbed59c03415f67b10d17418ab228cf 26-Jul-2008 Daniel Dunbar <daniel@zuster.org> Remove unused ASTConsumer::HandleTopLevelDeclaration


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54071 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
fb754b6db2c74b71e20042f84a95cdb93fc33870 26-Jul-2008 Daniel Dunbar <daniel@zuster.org> Remove unused ASTConsumer::HandleTopLevelDeclaration


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54071 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
1b843a2a4e57696ec95820213ae21669742e0e0b 25-Jul-2008 Chris Lattner <sabre@nondot.org> Add support for __extension__ as an lvalue. rdar://6097308



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54033 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
baf0d6678418e0dd9309438c3e50274253cfc7b2 25-Jul-2008 Chris Lattner <sabre@nondot.org> Add support for __extension__ as an lvalue. rdar://6097308



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54033 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
118930edc07e9a91098f48031740d57c0f89114e 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Move isObjCObjectPointerType() from Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53998 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b6ccaac65ca72f72954eb3893bbd940bedd23f00 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Move isObjCObjectPointerType() from Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53998 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
97318dd4ed019ecfb67932ad8919d751877c1941 24-Jul-2008 Ted Kremenek <kremenek@apple.com> Added UnaryOperator::isPrefix().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53963 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5a56ac30d04e8f0431a08980885662a47a6308aa 24-Jul-2008 Ted Kremenek <kremenek@apple.com> Added UnaryOperator::isPrefix().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53963 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
173dd3184b3e0f7b19a96b054303c87be3afb89f 23-Jul-2008 Ted Kremenek <kremenek@apple.com> When constructing an ObjCIvarDecl object in Sema, provide its visibility up front instead of setting it afterwards.
This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53955 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b8db21d4df5fbb6ce1ace6411b82d3d623d789de 23-Jul-2008 Ted Kremenek <kremenek@apple.com> When constructing an ObjCIvarDecl object in Sema, provide its visibility up front instead of setting it afterwards.
This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53955 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0be088230e4bce150cbad1d49423efb5d7ab124d 21-Jul-2008 Chris Lattner <sabre@nondot.org> move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
simplifying code along the way and fixing a problem and memory leak or two.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53876 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
780f329cb011bff0da5763e2e9744eec093d0509 21-Jul-2008 Chris Lattner <sabre@nondot.org> move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
simplifying code along the way and fixing a problem and memory leak or two.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53876 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8bcb52573fad79e8cff88fad9112484b125942ea 21-Jul-2008 Chris Lattner <sabre@nondot.org> introduce a new ObjCList templated class and start moving
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3db6cae19c236fe2cef343c90105ce7cca7de965 21-Jul-2008 Chris Lattner <sabre@nondot.org> introduce a new ObjCList templated class and start moving
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c72eaaf2967cd77a6b8acd4fac777ad6bfb0e831 21-Jul-2008 Chris Lattner <sabre@nondot.org> rename setReferencedProtocolList -> addReferencedProtocols to
be consistent with ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53852 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f7b2c98c16dfb2261ea57d40a1d5bc4738e73175 21-Jul-2008 Chris Lattner <sabre@nondot.org> rename setReferencedProtocolList -> addReferencedProtocols to
be consistent with ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53852 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
5cece4687962ea79bba6565983924365f243144e 21-Jul-2008 Chris Lattner <sabre@nondot.org> Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't. Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~ ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53846 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b752f289026ad8e5f44851b20e009a27ed61eefc 21-Jul-2008 Chris Lattner <sabre@nondot.org> Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't. Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~ ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53846 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
a006ffc690cfe1aebc9a472dbf990e8328b8b5cf 21-Jul-2008 Chris Lattner <sabre@nondot.org> use iterators instead of direct access to protocol list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53831 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
cdce6d17be572ae49417022357906ce04b54137d 21-Jul-2008 Chris Lattner <sabre@nondot.org> use iterators instead of direct access to protocol list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53831 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
d3354225f8298b304d3e145121f33e67642b55d1 16-Jul-2008 Steve Naroff <snaroff@apple.com> Two fixes:
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53694 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8f3b2654a9ff6912862f366102f5c46f7757260a 16-Jul-2008 Steve Naroff <snaroff@apple.com> Two fixes:
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53694 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ff579ffb48ad51799bbdefde303d7dffe16ccbd2 12-Jul-2008 Chris Lattner <sabre@nondot.org> expand casts to handle what isIntegerConstantExpr handles.
Casts from pointers remain a problem. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53501 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
732b2236ae4a4f11e7642677cebbd169c07ea877 12-Jul-2008 Chris Lattner <sabre@nondot.org> expand casts to handle what isIntegerConstantExpr handles.
Casts from pointers remain a problem. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53501 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
15e5911fca102486cf209fcfd52a214c920b8bf4 12-Jul-2008 Chris Lattner <sabre@nondot.org> Add support for __builtin_type_compatible_p, enums, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53500 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
4c4867e140327fa3b56306fa03c64c8e6a7c95ef 12-Jul-2008 Chris Lattner <sabre@nondot.org> Add support for __builtin_type_compatible_p, enums, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53500 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
82437da70be7f7ec57d949110baa4383979201db 12-Jul-2008 Chris Lattner <sabre@nondot.org> start remembering diagnostics for various cases, add some missing
code. Switch to Eli's getIntWidth method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53499 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
54176fdb044312b4b77c3da6682d3575b3728d30 12-Jul-2008 Chris Lattner <sabre@nondot.org> start remembering diagnostics for various cases, add some missing
code. Switch to Eli's getIntWidth method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53499 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
422373cd05315754957bff904729d675189146b3 12-Jul-2008 Chris Lattner <sabre@nondot.org> Provide a structure for passing down 'is evaluated' and passing up
diagnosic+loc info for i-c-e evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53490 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
87eae5ecf94e38baa20d9a327b8f73f8bdc72436 12-Jul-2008 Chris Lattner <sabre@nondot.org> Provide a structure for passing down 'is evaluated' and passing up
diagnosic+loc info for i-c-e evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53490 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
400d7403de5712bea8cb456302cb27aa3479943f 12-Jul-2008 Chris Lattner <sabre@nondot.org> simplify some code a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53477 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
75a4881047deeb3a300ff9293dc6ba8570048bb5 12-Jul-2008 Chris Lattner <sabre@nondot.org> simplify some code a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53477 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
265a089f5136bc1d374928ae99b4781184dcb7a8 11-Jul-2008 Chris Lattner <sabre@nondot.org> share code between sizeof(expr) and sizeof(type)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53475 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
fcee0019b76f9f368f2b3d6d4048a98232593f29 11-Jul-2008 Chris Lattner <sabre@nondot.org> share code between sizeof(expr) and sizeof(type)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53475 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
045502c83d59a3a48b8ecb7a070c7a0fcd654f59 11-Jul-2008 Chris Lattner <sabre@nondot.org> implement support for __extension__, make sure the result of a
comparison has the right width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53469 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
ac7cb603979a0e5a6a216ccbd20eee7647c96b54 11-Jul-2008 Chris Lattner <sabre@nondot.org> implement support for __extension__, make sure the result of a
comparison has the right width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53469 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2c99c71dc7e4ae3e2baf7d98f84d2e5661a03a6e 11-Jul-2008 Chris Lattner <sabre@nondot.org> add a new getIntTypeSizeInBits method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53468 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
7a76778e218da57a3b10c80066a0a938f28987b6 11-Jul-2008 Chris Lattner <sabre@nondot.org> add a new getIntTypeSizeInBits method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53468 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
334b19494f86dd977120e3f7ed632a3843d4acd5 11-Jul-2008 Chris Lattner <sabre@nondot.org> rename "SInt" methods to "Int" in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53467 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cf0f51d10f01065bd7bc3ffe77e18c30dcbdbea3 11-Jul-2008 Chris Lattner <sabre@nondot.org> rename "SInt" methods to "Int" in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53467 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a42f09a1b2e2bf2ade0290e25bf1faa52e1d4ae2 11-Jul-2008 Chris Lattner <sabre@nondot.org> make the new evaluator avoid conversions APValue<->APSInt in some cases.
Add some accessors to APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53465 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
b542afe02d317411d53b3541946f9f2a8f509a11 11-Jul-2008 Chris Lattner <sabre@nondot.org> make the new evaluator avoid conversions APValue<->APSInt in some cases.
Add some accessors to APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53465 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a823ccf1794754a2fbadfcf5f48de0768c8d337d 11-Jul-2008 Chris Lattner <sabre@nondot.org> rearrange some code, no functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
f5eeb055ecbadbc25c83df0867cdada2c2559dcf 11-Jul-2008 Chris Lattner <sabre@nondot.org> rearrange some code, no functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53463 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
438a8f0415d3cc8c167f0d934751fb26ea176541 11-Jul-2008 Ted Kremenek <kremenek@apple.com> Patch by Csaba Hruska and Peter Neumark:

"adds support (de)serialization (from)to (in memory) buffer."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53425 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
0ce902bb293dfefd0610e59f7441339d803979cf 11-Jul-2008 Ted Kremenek <kremenek@apple.com> Patch by Csaba Hruska and Peter Neumark:

"adds support (de)serialization (from)to (in memory) buffer."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53425 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
e1b10a12a754f176c88def4e99c429da320dbd31 08-Jul-2008 Nuno Lopes <nunoplopes@sapo.pt> revert my bogus attempt to fix the comment. sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53248 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5f6b632391e24b08ead3e62ba2e2765e770382ed 08-Jul-2008 Nuno Lopes <nunoplopes@sapo.pt> revert my bogus attempt to fix the comment. sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53248 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8ab15c8651bf01160563a828442ef47554b52ae1 08-Jul-2008 Anders Carlsson <andersca@mac.com> Fix small bug. The evaluator now works well enough to pass all tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53238 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
559e56b3a201316ae0b7e7389879a8054f6a3a82 08-Jul-2008 Anders Carlsson <andersca@mac.com> Fix small bug. The evaluator now works well enough to pass all tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53238 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c43f44b080d3908d02072a4233ecc490e7d072ba 08-Jul-2008 Anders Carlsson <andersca@mac.com> More constant expression work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53235 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
650c92fdcc27a950a8a848ecab6a74e6f5e80788 08-Jul-2008 Anders Carlsson <andersca@mac.com> More constant expression work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53235 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
d1aa5811e87d50ced55eb1891bb7773bf31d7cb7 08-Jul-2008 Anders Carlsson <andersca@mac.com> Move out some methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
a25ae3d68d84d2b89907f998df6a396549589da5 08-Jul-2008 Anders Carlsson <andersca@mac.com> Move out some methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53234 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
02a34c341ca0adfd272ca05b907dc71c9f4a1dfc 08-Jul-2008 Anders Carlsson <andersca@mac.com> More work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53233 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
2bad1687fe6f00e10767a691a33b070b151902b6 08-Jul-2008 Anders Carlsson <andersca@mac.com> More work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53233 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
efddb9c55bef204d011bfabb865ca79cfcd891f6 08-Jul-2008 Seo Sanghyeon <sanxiyn@gmail.com> Compilation fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53222 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
0fe52e1bcaa69ba127f1bda036f057fec1f478de 08-Jul-2008 Seo Sanghyeon <sanxiyn@gmail.com> Compilation fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53222 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c0328011b1b89f12b66dd29e8dcbe775bfeb10a5 08-Jul-2008 Anders Carlsson <andersca@mac.com> Port more of Eli's evaluator over. This makes the int evaluator handle binary and unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53221 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
06a3675627e3b3c47b49c689c8e404a33144194a 08-Jul-2008 Anders Carlsson <andersca@mac.com> Port more of Eli's evaluator over. This makes the int evaluator handle binary and unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53221 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
cad17b54e10e68fc3c511f5d050f0b5bcee809e0 08-Jul-2008 Anders Carlsson <andersca@mac.com> Commit beginnings of int evaluator. Currently not used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53219 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
c754aa62643e66ab967ca32ae8b0b3fc419bba25 08-Jul-2008 Anders Carlsson <andersca@mac.com> Commit beginnings of int evaluator. Currently not used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53219 91177308-0d34-0410-b5e6-96231b3b80d8
xprConstant.cpp
e72804582ecdc0cd9cabe061af808cba54c8af5f 07-Jul-2008 Nuno Lopes <nunoplopes@sapo.pt> fix CheckForConstantInitializer() for Compound Literals
also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53174 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
9a979c327c442597c6a9cee961336530460fed04 07-Jul-2008 Nuno Lopes <nunoplopes@sapo.pt> fix CheckForConstantInitializer() for Compound Literals
also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53174 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c7436af079c74b24e071f32a8fd2e356577e3bcc 03-Jul-2008 Anders Carlsson <andersca@mac.com> Shuffle things around in preparation for integrating Eli's constant evaluator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53074 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
c44eec6dd29ee9415cbd38a35deff4c8b67abb6a 03-Jul-2008 Anders Carlsson <andersca@mac.com> Shuffle things around in preparation for integrating Eli's constant evaluator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53074 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
xprConstant.cpp
38f16717fc72b2c9dcde319ae04bccc4b79a94e3 01-Jul-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add Sema support for C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
07952324dda0e758c17f8bc3015793c65c51c48c 01-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add Sema support for C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
2a674dca3ed88e58c536026c51a4ed9cbc32d4a8 30-Jun-2008 Chris Lattner <sabre@nondot.org> Make a few related changes:

1) add a new ASTContext::getFloatTypeSemantics method.
2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places.
3) Change the TargetInfo.h get*Format methods to return their
fltSemantics byref instead of by pointer.
4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which
sometimes expand specially and othertimes fall back to libm.
5) Add support for __builtin_nan("") to codegen, cases that don't pass
in an empty string are currently lowered to libm calls.
6) Fix codegen of __builtin_infl.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52914 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b7cfe88e88cb4f46308de89cf3f0c81bfe624128 30-Jun-2008 Chris Lattner <sabre@nondot.org> Make a few related changes:

1) add a new ASTContext::getFloatTypeSemantics method.
2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places.
3) Change the TargetInfo.h get*Format methods to return their
fltSemantics byref instead of by pointer.
4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which
sometimes expand specially and othertimes fall back to libm.
5) Add support for __builtin_nan("") to codegen, cases that don't pass
in an empty string are currently lowered to libm calls.
6) Fix codegen of __builtin_infl.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52914 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0832dbca0e11ee020bbed181c515b3835158436e 28-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work
correctly. (The testcase in PR2501 uses a comparison between long and
unsigned int).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52853 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
ad74a758189180b8ab8faea648e4766c3bfd7fcb 28-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work
correctly. (The testcase in PR2501 uses a comparison between long and
unsigned int).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52853 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
1f843bc6d8ea3c9ac550a64b37e37968b98580d2 24-Jun-2008 Ted Kremenek <kremenek@apple.com> Update serialization for ObjCMessageExpr to handle additional bit-swizziling of receiver information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52679 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
be78424edfbc6095c4acb83c7ae7f53a42f0c870 24-Jun-2008 Ted Kremenek <kremenek@apple.com> Update serialization for ObjCMessageExpr to handle additional bit-swizziling of receiver information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52679 91177308-0d34-0410-b5e6-96231b3b80d8
tmtSerialization.cpp
ee2c9fdd5260852b8835dbb187a8e26101924e69 24-Jun-2008 Ted Kremenek <kremenek@apple.com> ObjCMessageExpr objects that represent messages to class methods now can contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52676 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4df728e368fa1f65ffc57572fed613dcca5b4fe8 24-Jun-2008 Ted Kremenek <kremenek@apple.com> ObjCMessageExpr objects that represent messages to class methods now can contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52676 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ffc58c83c5d94cb90c3cc23fe632fda66a6ef3b1 21-Jun-2008 Chris Lattner <sabre@nondot.org> remove dead enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52581 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
63e9d5673791096589c601528e857e00a13050ff 21-Jun-2008 Chris Lattner <sabre@nondot.org> remove dead enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52581 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
4423d37a36311b4e68a8715c4b60d4548c7588b0 21-Jun-2008 Chris Lattner <sabre@nondot.org> Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52580 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
0d17f6f7b1882850fa56ad38cca0ee518869255b 21-Jun-2008 Chris Lattner <sabre@nondot.org> Switch 'super' from being a weird cast thing to being a predefined expr node.
Patch by David Chisnall with objc rewriter and stmtdumper updates from me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52580 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
0cac82a6bb098d713f3516ef0d743a71023cb4de 20-Jun-2008 Ted Kremenek <kremenek@apple.com> Added ParentMap, a class to represent a lazily constructed mapping from child to parents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52553 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
f8e32cf062f39fff1a00aff748cb6b5dc0abc2fe 20-Jun-2008 Ted Kremenek <kremenek@apple.com> Added ParentMap, a class to represent a lazily constructed mapping from child to parents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52553 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.cpp
8c7c6a18ccb1d4a9e6b4673eccf2ed7a77e5dba4 17-Jun-2008 Chris Lattner <sabre@nondot.org> Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52422 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
xpr.cpp
4111024be81e7c0525e42dadcc126d27e5bf2425 17-Jun-2008 Chris Lattner <sabre@nondot.org> Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52422 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
xpr.cpp
156714e64d20160e0e57bd34adcd422fa82819dc 17-Jun-2008 Ted Kremenek <kremenek@apple.com> Fix more strict-aliasing warnings.
Fix indentation of class declarations in ExprCXX.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52380 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmt.cpp
1060aff23f72135f8b50034a1e80f16725ebc56c 17-Jun-2008 Ted Kremenek <kremenek@apple.com> Fix more strict-aliasing warnings.
Fix indentation of class declarations in ExprCXX.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52380 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.cpp
tmt.cpp
2719e9894e3e62bdfb9ee8ac2a520549dc4d5360 17-Jun-2008 Ted Kremenek <kremenek@apple.com> This patch is motivated by numerous strict-aliasing warnings when compiling
clang as a Release build.

The big change is that all AST nodes (subclasses of Stmt) whose children are
Expr* store their children as Stmt* or arrays of Stmt*. This is to remove
strict-aliasing warnings when using StmtIterator. None of the interfaces of any
of the classes have changed (except those with arg_iterators, see below), as the
accessor methods introduce the needed casts (via cast<>). While this extra
casting may seem cumbersome, it actually adds some important sanity checks
throughout the codebase, as clients using StmtIterator can potentially overwrite
children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts
provide extra sanity checks that are operational in debug builds to catch
invariant violations such as these.

For classes that have arg_iterators (e.g., CallExpr), the definition of
arg_iterator has been replaced. Instead of it being Expr**, it is an actual
class (called ExprIterator) that wraps a Stmt**, and provides the necessary
operators for iteration. The nice thing about this class is that it also uses
cast<> to type-checking, which introduces extra sanity checks throughout the
codebase that are useful for debugging.

A few of the CodeGen functions that use arg_iterator (especially from
OverloadExpr) have been modified to take begin and end iterators instead of a
base Expr** and the number of arguments. This matches more with the abstraction
of iteration. This still needs to be cleaned up a little bit, as clients expect
that ExprIterator is a RandomAccessIterator (which we may or may not wish to
allow for efficiency of representation).

This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c,
which was already broken) on both a Debug and Release build, but it should
obviously be reviewed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52378 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
5549976193e34417d4474a5f4a514268ef6666c7 17-Jun-2008 Ted Kremenek <kremenek@apple.com> This patch is motivated by numerous strict-aliasing warnings when compiling
clang as a Release build.

The big change is that all AST nodes (subclasses of Stmt) whose children are
Expr* store their children as Stmt* or arrays of Stmt*. This is to remove
strict-aliasing warnings when using StmtIterator. None of the interfaces of any
of the classes have changed (except those with arg_iterators, see below), as the
accessor methods introduce the needed casts (via cast<>). While this extra
casting may seem cumbersome, it actually adds some important sanity checks
throughout the codebase, as clients using StmtIterator can potentially overwrite
children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts
provide extra sanity checks that are operational in debug builds to catch
invariant violations such as these.

For classes that have arg_iterators (e.g., CallExpr), the definition of
arg_iterator has been replaced. Instead of it being Expr**, it is an actual
class (called ExprIterator) that wraps a Stmt**, and provides the necessary
operators for iteration. The nice thing about this class is that it also uses
cast<> to type-checking, which introduces extra sanity checks throughout the
codebase that are useful for debugging.

A few of the CodeGen functions that use arg_iterator (especially from
OverloadExpr) have been modified to take begin and end iterators instead of a
base Expr** and the number of arguments. This matches more with the abstraction
of iteration. This still needs to be cleaned up a little bit, as clients expect
that ExprIterator is a RandomAccessIterator (which we may or may not wish to
allow for efficiency of representation).

This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c,
which was already broken) on both a Debug and Release build, but it should
obviously be reviewed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52378 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
56d56b594afa8e4b643c857c9e01a9dac9a1dc0c 17-Jun-2008 Ted Kremenek <kremenek@apple.com> Silence uninitialized value warning in Release build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52376 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
94cbb3e8942baeacf2265c0b80674ed810817f56 17-Jun-2008 Ted Kremenek <kremenek@apple.com> Silence uninitialized value warning in Release build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52376 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
9ddb74e55b3eb93d1cf76656603637cd4a396a16 17-Jun-2008 Ted Kremenek <kremenek@apple.com> Silence uninitialized value warning during Release build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52375 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9bcf44aeef91e4cf2615efdebd9d541ba567b635 17-Jun-2008 Ted Kremenek <kremenek@apple.com> Silence uninitialized value warning during Release build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52375 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
fc6e3290e81d96e963359e4857176e19918bc2b8 12-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Fix "copy & paste" error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52227 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
68617fd6b322c6335dc0d72d828b7a2338b52fad 12-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix "copy & paste" error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52227 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.cpp
a5c14b2e73e1674e639478142adf0ab71d00c367 10-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> -Add DeclChain member to DeclContext.
-ScopedDecls get chained to their DeclContext.
-DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52164 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
7643536c36b0449256d5ee2efc03a7e4a784a0b3 10-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Add DeclChain member to DeclContext.
-ScopedDecls get chained to their DeclContext.
-DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52164 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
6d8dd98ee6dc1409a22c450067ffc8b48f4c3b36 10-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Dump the name of CXXStruct/CXXUnion/CXXClass Decl subclasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52161 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
4515ff4af46fe661b70658fd8242dbdca83f0692 10-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Dump the name of CXXStruct/CXXUnion/CXXClass Decl subclasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52161 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
c6cc7d5a60b59381f1c9880ed8fdb9b2316c3a85 10-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> -Changes to TagDecl:
Added TagKind enum.
Added getTagKind() method.
Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52160 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
ype.cpp
39ba4aeca296b1c9f04bde7d9d3cbbf129f1abd3 10-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Changes to TagDecl:
Added TagKind enum.
Added getTagKind() method.
Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52160 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclCXX.cpp
ype.cpp
6df1fc024820b27e7f4a6bee6e15052bbec8eea0 09-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Added new C++ AST Decl subclasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52155 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
d3bb44f0f1a83cb208d3e61ee80afe6a4d20d2d8 09-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Added new C++ AST Decl subclasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52155 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
eclCXX.cpp
eclSerialization.cpp
1aaf71cae87511d0e93c4384de8bad267992310a 08-Jun-2008 Chris Lattner <sabre@nondot.org> capture whether a CharacterLiteral was wide or not in the AST.
Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52081 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtSerialization.cpp
c250aae4f645833aed3a6321bc8598f7330dce8d 08-Jun-2008 Chris Lattner <sabre@nondot.org> capture whether a CharacterLiteral was wide or not in the AST.
Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52081 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
tmtSerialization.cpp
e0391b21fd15dcc6a3800b6a81794b5d790d2e20 08-Jun-2008 Chris Lattner <sabre@nondot.org> Fix ast dumping to work with long double literals, e.g. we dump:

long double X() { return 1.0L; }

as:

long double X()
(CompoundStmt 0xb06a00 <t.c:2:17, col:32>
(ReturnStmt 0xb068d0 <col:19, col:26>
(FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000)))




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52080 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
da8249e57f3badecf925571881fe57243935c6c1 08-Jun-2008 Chris Lattner <sabre@nondot.org> Fix ast dumping to work with long double literals, e.g. we dump:

long double X() { return 1.0L; }

as:

long double X()
(CompoundStmt 0xb06a00 <t.c:2:17, col:32>
(ReturnStmt 0xb068d0 <col:19, col:26>
(FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000)))




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52080 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
a8a09ac3d60371aace9cf1fdad8dddec606d0cdd 07-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix the line endings in the newly added DeclBase.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52075 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
56d29376459f88dcdbcbf6c9a83c2f77e433f1e2 07-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix the line endings in the newly added DeclBase.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52075 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.cpp
1e5e0bfd13493c9442af346f4756e2a4e3803be8 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Reclaim memory owned by ObjCForwardProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52063 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
05ac3ef08f9d06e0a4439073c9edabf7f912f946 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Reclaim memory owned by ObjCForwardProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52063 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
ff29162389e64413aafc9e6d92faa2c2b9cf5591 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim its memory and the memory of the Decls it owns.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52059 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
400d95fb7bb9fac609f8613862b84f3a2a7d510f 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim its memory and the memory of the Decls it owns.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52059 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
c906e5e396834868d595dbec5035906abefeceef 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to reclaim its memory and the memory of the Decls it owns.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52055 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
1c8a413c1e00636c77666ddf1e3b0311f3fa8c81 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to reclaim its memory and the memory of the Decls it owns.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52055 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
22db160e76a2ab93fda9b3710a5f8baebc9f1ed8 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Because of a lack of a clear ownership role between ObjCInterfaceDecls and
ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a
horrible hack, and must be removed eventually.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52051 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
1a726d7cbf62ab13949743e9ef8c0670dd862e46 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Because of a lack of a clear ownership role between ObjCInterfaceDecls and
ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a
horrible hack, and must be removed eventually.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52051 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ranslationUnit.cpp
8c945b1ec3dd1a9cf740f11dcc3799e0bff5d6f4 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Initial work on additional memory collection for ObjC AST objects. We now
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively
destroy their owned Decls and Stmts. There are a few cases where it is not
clear what to do (FIXMEs included in the patch).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52050 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8a779314870760848e61da2c428a78971fe3f1c3 06-Jun-2008 Ted Kremenek <kremenek@apple.com> Initial work on additional memory collection for ObjC AST objects. We now
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively
destroy their owned Decls and Stmts. There are a few cases where it is not
clear what to do (FIXMEs included in the patch).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52050 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
8682d88fcd4ed14b139661303eb3d6232ca1bbd4 06-Jun-2008 Devang Patel <dpatel@apple.com> During interface layout, don't forget super class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52035 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6a5a34c0e5587263df719c62030761cf59d27fe4 06-Jun-2008 Devang Patel <dpatel@apple.com> During interface layout, don't forget super class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52035 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
96bbf808c93b5f6d796f0302c250ad966bd71345 06-Jun-2008 Devang Patel <dpatel@apple.com> Undo previous check-in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52034 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
80d310c6310084fb2bd9d37ecf3a32dac1148533 06-Jun-2008 Devang Patel <dpatel@apple.com> Undo previous check-in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52034 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fa6f94876cdaf7ef2f07777900aa9b58ece154d0 06-Jun-2008 Devang Patel <dpatel@apple.com> During interface layout, don't forget super class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52033 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0e8eda7a4da933b04eac89d2856abf728188bf13 06-Jun-2008 Devang Patel <dpatel@apple.com> During interface layout, don't forget super class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52033 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d1f0eb4423554ae71b014a90c386a2b1d67e6d7b 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5987482> clang on xcode: null dereference in Sema::ActOnMemberReferenceExpr.

In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>").


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52001 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3d2c22b1d334fa74d26a5f21841cb55df5dfdd1a 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5987482> clang on xcode: null dereference in Sema::ActOnMemberReferenceExpr.

In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>").


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52001 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4b6bf7037bfd27f8f07e72322a84a3c1202d7627 04-Jun-2008 Devang Patel <dpatel@apple.com> Add ObjCInterface layout support.
Reuse RecordLayout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51968 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
44a3dded8080c5c9cfdad208ade8f8f7850d9a4f 04-Jun-2008 Devang Patel <dpatel@apple.com> Add ObjCInterface layout support.
Reuse RecordLayout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51968 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
bfe323c208a547e55c9c68f3df04adcac4321e2c 04-Jun-2008 Devang Patel <dpatel@apple.com> Refactoring.
Move field layout code in a ASTRecordLayout member fn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51966 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8b27704d61be128bbff6352e6ef417efc0d6bf4f 04-Jun-2008 Devang Patel <dpatel@apple.com> Refactoring.
Move field layout code in a ASTRecordLayout member fn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51966 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
842126ec695852dbf8803d7570799c00b69b61cb 04-Jun-2008 Ted Kremenek <kremenek@apple.com> Moved LangOptions from TranslationUnit to ASTContext. This induced a variety of cleanups in some ASTConsumers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51943 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ranslationUnit.cpp
e7d07d113677a39026ff5119b8b67f6fe8ca9793 04-Jun-2008 Ted Kremenek <kremenek@apple.com> Moved LangOptions from TranslationUnit to ASTContext. This induced a variety of cleanups in some ASTConsumers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51943 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ranslationUnit.cpp
445497747a51388f7d022316550e2cd1c51dd908 04-Jun-2008 Steve Naroff <snaroff@apple.com> ASTContext::typesAreCompatible(): id is compatible with all qualified id types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51939 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
97341620065b89f5197b846be94c4cfad5df2af4 04-Jun-2008 Steve Naroff <snaroff@apple.com> ASTContext::typesAreCompatible(): id is compatible with all qualified id types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51939 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7dfca16ebafb24c3284c0eeea13edf5cbdfd5e1 04-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Move Decl and DeclContext implementations into a new DeclBase.cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51936 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
e184baeaa112ceac32420f8ca127b8d4d152d109 04-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move Decl and DeclContext implementations into a new DeclBase.cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51936 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclBase.cpp
30faf47743df1022ee5c208bf1e7c1b604a40cb4 04-Jun-2008 Steve Naroff <snaroff@apple.com> Make sure we look through categories when searching for a classes property.

Fixes <rdar://problem/5984338> clang on xcode: property implementation must have its declaration in interface 'PBXOpenQuicklyModule'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51925 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6c930f2ac0af05a120a39cb780b50d4a293abdfc 04-Jun-2008 Steve Naroff <snaroff@apple.com> Make sure we look through categories when searching for a classes property.

Fixes <rdar://problem/5984338> clang on xcode: property implementation must have its declaration in interface 'PBXOpenQuicklyModule'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51925 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6e7c3b7b1ea50b46393d569b760991ce4e3a0f25 04-Jun-2008 Steve Naroff <snaroff@apple.com> Put back my temporary hack until Eli addresses this in a more complete fashion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51920 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
c793808539b2ed6ec3324ff9ba0f57aa54e027ca 04-Jun-2008 Steve Naroff <snaroff@apple.com> Put back my temporary hack until Eli addresses this in a more complete fashion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51920 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
48fb3eeb6f7e1b50cbd3709263be0baa20a3c86e 03-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Re-fix r51907 in a way which doesn't affect valid code. This essentially
moves the check for the invalid construct to a point where it doesn't
affect other uses of isIntegerConstantExpr, and we can warn properly
when the extension is used. This makes it a bit more complicated, but
it's a lot cleaner.

Steve, please tell me if this check is sufficient to handle the
relevant system header. I know it's enough to handle the testcase, but
I don't know what exactly the original looks like.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51918 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1b76ada683bcec33799fd0eb114aaad3e1d04ca9 03-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Re-fix r51907 in a way which doesn't affect valid code. This essentially
moves the check for the invalid construct to a point where it doesn't
affect other uses of isIntegerConstantExpr, and we can warn properly
when the extension is used. This makes it a bit more complicated, but
it's a lot cleaner.

Steve, please tell me if this check is sufficient to handle the
relevant system header. I know it's enough to handle the testcase, but
I don't know what exactly the original looks like.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51918 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
7c5db20259e4f591bac902f6a32926e4377120fa 03-Jun-2008 Steve Naroff <snaroff@apple.com> Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC compatibility). Note FIXME.

Fix <rdar://problem/5977870> clang on xcode: error: arrays with static storage duration must have constant integer length


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51907 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
a2ac06e9647bbac5e910201a570ed623e61b00e2 03-Jun-2008 Steve Naroff <snaroff@apple.com> Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC compatibility). Note FIXME.

Fix <rdar://problem/5977870> clang on xcode: error: arrays with static storage duration must have constant integer length


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51907 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
6f78625be42e0cc4d962a80d05aa71e37f59011d 03-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared identifier 'super'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51888 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
e3e9add4fd788927df6f545570e7838db59c01d7 03-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared identifier 'super'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51888 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
7765434b52a807b234d8567baea6718c509ae79b 02-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> fix decl attributes cleaning
this plugs the leak of attributes and also fixes a crash in the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51862 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9141bee299a05349924a34a7153d7064c9e0a107 02-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> fix decl attributes cleaning
this plugs the leak of attributes and also fixes a crash in the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51862 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
79b50cb1dc1d0ea23c45d05d77878fc0fc265559 31-May-2008 Ted Kremenek <kremenek@apple.com> Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass a
TranslationUnit object instead of an ASTContext. By default it calls
Initialize(ASTConstext& Context) (to match with the current interface used by
most ASTConsumers).

Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit
to not free its Decls. This is a workaround for: <rdar://problem/5966749>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51825 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
e3a6198400453c0d9623207718e4942f7c111f87 31-May-2008 Ted Kremenek <kremenek@apple.com> Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass a
TranslationUnit object instead of an ASTContext. By default it calls
Initialize(ASTConstext& Context) (to match with the current interface used by
most ASTConsumers).

Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit
to not free its Decls. This is a workaround for: <rdar://problem/5966749>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51825 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
8fff8cef550672c14c1369aa7375d7c0248664a5 31-May-2008 Steve Naroff <snaroff@apple.com> Teach Expr::isLvalue() about ObjC properties. For now, all properties are writable. Added a FIXME for another day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51800 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
799a6a6850af625946bb8d88ca960bb6604e3858 31-May-2008 Steve Naroff <snaroff@apple.com> Teach Expr::isLvalue() about ObjC properties. For now, all properties are writable. Added a FIXME for another day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51800 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
718b6638e0d259d1b8371ef30e475e9c2e981ffc 30-May-2008 Ted Kremenek <kremenek@apple.com> Fix some strict-aliasing warnings by using Stmt* instead of Expr* in VariableArrayType, EnumConstantDecl, and VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51772 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
b3064041583eb134fbf56906728bf752bc65b572 30-May-2008 Ted Kremenek <kremenek@apple.com> Fix some strict-aliasing warnings by using Stmt* instead of Expr* in VariableArrayType, EnumConstantDecl, and VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51772 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
5949a02d1183280d7483496bdd3620b2a925be6d 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Cleanup/refactoring of Sema struct layout. This patch unifies the struct
and union codepaths and fixes some minor bugs.

I'm reasonably confident this is accurate, at least for X86. I'll
correct any bugs as I find them; I haven't found any for a while,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4bd998bbc228915d2b9cae5b67879de48940d05e 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Cleanup/refactoring of Sema struct layout. This patch unifies the struct
and union codepaths and fixes some minor bugs.

I'm reasonably confident this is accurate, at least for X86. I'll
correct any bugs as I find them; I haven't found any for a while,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51762 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
05391d26ab56348a43ea4f8059d67f2ce7fc3d77 30-May-2008 Steve Naroff <snaroff@apple.com> Add basic support for properties references (a missing feature).

While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51719 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ae7840776d6cd31b4d7a4a345b61bcbb3744df6c 30-May-2008 Steve Naroff <snaroff@apple.com> Add basic support for properties references (a missing feature).

While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51719 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
tmtSerialization.cpp
ce668af145a09233e4b2b06711fd0a13639ccd8a 29-May-2008 Ted Kremenek <kremenek@apple.com> Fix one strict-aliasing warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51707 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
54eec4c00d25cbb30a3e589f1b3a4ebaa72c81a0 29-May-2008 Ted Kremenek <kremenek@apple.com> Fix one strict-aliasing warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51707 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9ed3e7794b4c45ba3856f5997191d16e234df958 29-May-2008 Steve Naroff <snaroff@apple.com> - Move ObjC Expresssion AST's from Expr.h => ExprObjC.h
- #include ExprObjC.h in many places


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51703 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtSerialization.cpp
f494b579b22f9950f5af021f0bf9879a91bb8b41 29-May-2008 Steve Naroff <snaroff@apple.com> - Move ObjC Expresssion AST's from Expr.h => ExprObjC.h
- #include ExprObjC.h in many places


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51703 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
xpr.cpp
tmt.cpp
tmtPrinter.cpp
tmtSerialization.cpp
21fd0290a440dbbf67b34235a5ce78dfdbb9c2ef 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Assume statement expressions have side effects; this gets rid of a lot
of extra warnings in the Python source.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51594 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
211f6adf1301a1461015fb6cb08a05f0a35b65f3 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Assume statement expressions have side effects; this gets rid of a lot
of extra warnings in the Python source.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51594 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d270181f22e9ec56708f65c1f41e85cd34a3f6db 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Don't swap function decls, and add them to the scope as they are
encountered. Mixing up the decls is unintuitive, and confuses the AST
destruction code. Fixes PR2360.

Note that there is a need to look up the characteristics and
declarations of a function associated with a particular name or decl,
but the original swapping code doesn't solve it properly.
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one
suggestion for how to fix that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51584 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
2742496d75ecb733c07c65c9a35cbfaa88ca81e4 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Don't swap function decls, and add them to the scope as they are
encountered. Mixing up the decls is unintuitive, and confuses the AST
destruction code. Fixes PR2360.

Note that there is a need to look up the characteristics and
declarations of a function associated with a particular name or decl,
but the original swapping code doesn't solve it properly.
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one
suggestion for how to fix that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51584 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
65489b7157db3f179527d065908d7fef722f37bd 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Stop leaking the TUDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51575 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b26153c2b06934b6d39886cae2a379988d9c3e2b 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Stop leaking the TUDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51575 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f3e02edcdd78f664f160f3c9c86245c52ec34a59 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Always initialize NEXT_CATCH; fixes a Valgrind uninitialized read error
(originally reported in PR1682).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51551 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
0613c37d7914672585e67bedd18d9a1588104360 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Always initialize NEXT_CATCH; fixes a Valgrind uninitialized read error
(originally reported in PR1682).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51551 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
0f433840423ea2860b3e301456d7bf3c4d07968d 24-May-2008 Ted Kremenek <kremenek@apple.com> Call the correct destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51544 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ebf27b1831e6c4d7f4bc30e111a4d6340ff690d1 24-May-2008 Ted Kremenek <kremenek@apple.com> Call the correct destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51544 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
fc96eea07e47ec55bea3c9dd5910ee58100f7e86 24-May-2008 Steve Naroff <snaroff@apple.com> Minor tweak to -ast-dump for ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51508 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
218543b10e81ea2269ef6ae34d2d8ddbdec54dbe 24-May-2008 Steve Naroff <snaroff@apple.com> Minor tweak to -ast-dump for ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51508 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
c38f4355490401da74c72ead46be6380d5a7643d 23-May-2008 Steve Naroff <snaroff@apple.com> Tweak AST dumper for ObjC ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51463 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmtDumper.cpp
466c2e3af049964f3a573917bd04d6b6ce1d121d 23-May-2008 Steve Naroff <snaroff@apple.com> Tweak AST dumper for ObjC ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51463 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmtDumper.cpp
4751a3add4986e6d68423d084289c70cb67e094a 22-May-2008 Dan Gohman <gohman@apple.com> Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51398 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4f8d123e3e2c260de3377208106ddba87cee28b4 22-May-2008 Dan Gohman <gohman@apple.com> Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51398 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
ce1b4685565a0658bd8bd3266d725914bff4c47c 21-May-2008 Dan Gohman <gohman@apple.com> Remove the unneeded #include of VMCore header "llvm/DerivedTypes.h".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51392 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
e1b6d5084ecf8c81c315dece1d203acdb6eb8fb5 21-May-2008 Dan Gohman <gohman@apple.com> Remove the unneeded #include of VMCore header "llvm/DerivedTypes.h".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51392 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
db4d5970d9243fb699f250f74eab6b7cce901a40 21-May-2008 Ted Kremenek <kremenek@apple.com> Add Destroy method to Types, making there destruction more harmonious with
the destruction of Decls and Stmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51385 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
4b05b1dee6cc65ae61d93dab7edff72710f24589 21-May-2008 Ted Kremenek <kremenek@apple.com> Add Destroy method to Types, making there destruction more harmonious with
the destruction of Decls and Stmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51385 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
9ecf716de7c342f1f1575efd375d4cadd8290a92 21-May-2008 Ted Kremenek <kremenek@apple.com> Fix potential double-free.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51381 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
936ff132a9aba1f1bb5d72a5744da1e10ce269d2 21-May-2008 Ted Kremenek <kremenek@apple.com> Fix potential double-free.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51381 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
e04306314ffbfb7e184dd0ff984b5b9a71a2fa4a 21-May-2008 Steve Naroff <snaroff@apple.com> Fixup ASTContext::PrintStats()...it was causing several test failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51380 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6cc189648ade1d1c838f6bf22ffa0016d56393d3 21-May-2008 Steve Naroff <snaroff@apple.com> Fixup ASTContext::PrintStats()...it was causing several test failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51380 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a1e7770b1b1605e17b43144d6b6d85cdb0bfbda2 21-May-2008 Ted Kremenek <kremenek@apple.com> When destroying DeclStmts, also destroy the associated Decl (reclaim its memory).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51379 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
8e355f296a3ba45b94de49dbb18ae6a6e67df04c 21-May-2008 Ted Kremenek <kremenek@apple.com> When destroying DeclStmts, also destroy the associated Decl (reclaim its memory).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51379 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
01a8b6cf3e456145801f89b7af5414d8b21d4dd0 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix the destruction "properly" in the sense that we actually destroy the
ASTs. This is a hack, but I haven't considered how we really
want to do this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51364 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
5f1adf8fb4b41988a8715492cc97c62873d25969 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix the destruction "properly" in the sense that we actually destroy the
ASTs. This is a hack, but I haven't considered how we really
want to do this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51364 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
19bf5c6e4be72f66907f92b9c62050851834fc72 21-May-2008 Eli Friedman <eli.friedman@gmail.com> PR2347: Fix crash iterating over VLAs; this started triggering because
we now iterate over the whole AST when we destroy it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51363 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
b0c0554bd62689f48a1c42fc46c78c531cdb3cbf 21-May-2008 Eli Friedman <eli.friedman@gmail.com> PR2347: Fix crash iterating over VLAs; this started triggering because
we now iterate over the whole AST when we destroy it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51363 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.cpp
f8346c41a1bbcabb84e7c8938d2dced4ed9ff230 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Don't kill the declarations if the translation unit doesn't own them
(specifically, for TranslationUnits created from SerializationTest.cpp).
Fixes a double-free bug in the serialization tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51362 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
1108e7dec6d998b3945a93cb6f549e349cabf258 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Don't kill the declarations if the translation unit doesn't own them
(specifically, for TranslationUnits created from SerializationTest.cpp).
Fixes a double-free bug in the serialization tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51362 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
f8382541e7c3e9bc65f094a243b21ebaece14d6f 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Remove hacks from ASTContext now that alignment gets reported correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51322 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
4210802b1e07ecf5c0d3a63622e49e0533ef329a 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Remove hacks from ASTContext now that alignment gets reported correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51322 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5be49244bfb829b2b5108c39728a0b635fe94f74 20-May-2008 Ted Kremenek <kremenek@apple.com> Reclaim memory from chains of ScopedDecls, and reclaim memory for the initializers of EnumConstantDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51299 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d1ac17ae7d61a9244ee5e658d6f63b8fa3da3127 20-May-2008 Ted Kremenek <kremenek@apple.com> Reclaim memory from chains of ScopedDecls, and reclaim memory for the initializers of EnumConstantDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51299 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
bde41096b6f9ea59cd2a9c7de9a5c1bf1cfb02a3 20-May-2008 Ted Kremenek <kremenek@apple.com> Delete AST nodes, not just Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51298 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
f809e3bd0c3d063f22ba34981072dae306ca9272 20-May-2008 Ted Kremenek <kremenek@apple.com> Delete AST nodes, not just Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51298 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
345b93db8abc199f0c51f2b3bed2e80fde023a18 20-May-2008 Ted Kremenek <kremenek@apple.com> Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.

Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no
ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments
(can happen with typedefs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51297 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b65cf41707d190d5ce3d48b9e5bd2dc9d7b4a4c0 20-May-2008 Ted Kremenek <kremenek@apple.com> Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.

Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no
ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments
(can happen with typedefs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51297 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a695adb85514ff294267c24c9fab420b317369aa 20-May-2008 Ted Kremenek <kremenek@apple.com> When serializing FunctionDecl, serialize out a reference to the previous declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51294 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
3bbc1989a38cada2f3ae92a43eb311bf341eeddf 20-May-2008 Ted Kremenek <kremenek@apple.com> When serializing FunctionDecl, serialize out a reference to the previous declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51294 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
e27d5ea490d5596a5e5bed3b3ed145d9974fcfb1 20-May-2008 Ted Kremenek <kremenek@apple.com> Remove unnecessary #include (introduced by a recent patch of mine).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51288 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
75a13a50ce1d7d4bf3c859d65ae4659d6e6e4b9a 20-May-2008 Ted Kremenek <kremenek@apple.com> Remove unnecessary #include (introduced by a recent patch of mine).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51288 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
afdf811b2494ca0d29fa47d848f63ac958455219 20-May-2008 Ted Kremenek <kremenek@apple.com> Try to plug some memory leaks...

1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST.

2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl.

3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind.

3) FunctionDecl::Destroy now releases its Body using its Destroy method.

4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors. We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes.

5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51286 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmt.cpp
ranslationUnit.cpp
27f8a28bee33bb0e857cfe1a61c281bbc234b338 20-May-2008 Ted Kremenek <kremenek@apple.com> Try to plug some memory leaks...

1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST.

2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl.

3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind.

3) FunctionDecl::Destroy now releases its Body using its Destroy method.

4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors. We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes.

5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51286 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
tmt.cpp
ranslationUnit.cpp
1ed5dc67ac8b0473d675942e02efba550ffbd62a 20-May-2008 Ted Kremenek <kremenek@apple.com> Added Stmt::DestroyChildren, which will be used by the dstors of the subclasses of Stmt to recursively delete their child AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51278 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
9c1863ef36a74e8203f00289d19856ad956f48b9 20-May-2008 Ted Kremenek <kremenek@apple.com> Added Stmt::DestroyChildren, which will be used by the dstors of the subclasses of Stmt to recursively delete their child AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51278 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.cpp
b924c7fac7f2fbec894b12e097052df6df910878 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Make the unused expression warning a bit less aggressive (found in PHP
code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51276 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4be1f47de20525ad90f02ba8682a7e2cbd3205d1 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Make the unused expression warning a bit less aggressive (found in PHP
code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51276 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bdbd1b596e4b98698dfbd98738370f5e2aef0ca8 16-May-2008 Ted Kremenek <kremenek@apple.com> Added CFGBlock::hasBinaryBranchTerminator().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51190 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9c2535a35db35b3a821a0d0c36a01a16f52f1ad0 16-May-2008 Ted Kremenek <kremenek@apple.com> Added CFGBlock::hasBinaryBranchTerminator().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51190 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8845a81fc80b1e58e17c7324f225a3ab85d96869 16-May-2008 Eli Friedman <eli.friedman@gmail.com> Minor cleanup to isBuiltinConstantExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51188 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
861dc46e3c53d64d8685fd9a0f95faac710b61c6 16-May-2008 Eli Friedman <eli.friedman@gmail.com> Minor cleanup to isBuiltinConstantExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51188 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5638c6d503d18301b0110fb1288ffc517527e73b 15-May-2008 Ted Kremenek <kremenek@apple.com> Removed bogus "return true" in Expr::isConstantExpr that returned true for all
expressions. This appears to be a regression introduced in r51113 that caused
many test cases to fail (there is still a test case in the Analysis directory
that is failing):

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51164 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
774e4af13a0b7683563a22c6b99e4dda45334cc8 15-May-2008 Ted Kremenek <kremenek@apple.com> Removed bogus "return true" in Expr::isConstantExpr that returned true for all
expressions. This appears to be a regression introduced in r51113 that caused
many test cases to fail (there is still a test case in the Analysis directory
that is failing):

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080512/005706.html


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51164 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
d0e9d095335fb20806f25e41af789ffd46920ea9 14-May-2008 Eli Friedman <eli.friedman@gmail.com> Implementation of __builtin_shufflevector, a portable builtin capable of
expressing the full flexibility of the LLVM shufflevector instruction.
The expected immediate usage is in *mmintrin.h, so that they don't
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51113 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
d38617c8a50f9729c254ab76cd359af797c6739b 14-May-2008 Eli Friedman <eli.friedman@gmail.com> Implementation of __builtin_shufflevector, a portable builtin capable of
expressing the full flexibility of the LLVM shufflevector instruction.
The expected immediate usage is in *mmintrin.h, so that they don't
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51113 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtPrinter.cpp
a1ae7442826c90beb66d6f314db8065c6cb3bafc 13-May-2008 Nate Begeman <natebegeman@mac.com> Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51068 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
3b8d116703db8018f855cbb4733ace426422623b 13-May-2008 Nate Begeman <natebegeman@mac.com> Remove AST dependency on VMCore by switching ExtVectorElementExpr off Constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51068 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
117479ebc6d3ed32e241d5f7360f52cc863a4368 12-May-2008 Ted Kremenek <kremenek@apple.com> Unbreak build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50980 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
adbb619a14e82f53c00a91df3e29436c7d21c9f7 12-May-2008 Ted Kremenek <kremenek@apple.com> Unbreak build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50980 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
ee6e74747b21f54b5e172c07a5500fb2073cae8b 12-May-2008 Ted Kremenek <kremenek@apple.com> Grammar cleanup in comment.
Remove redundant assignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50978 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
81edea8a1aaafe0df69a8a8b3c908354acc85e9c 12-May-2008 Ted Kremenek <kremenek@apple.com> Grammar cleanup in comment.
Remove redundant assignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50978 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
1179dfebb25c5a0ef5bc321e5471043804931b1d 12-May-2008 Ted Kremenek <kremenek@apple.com> When reading in the DeclCtx during deserialization, register the DeclCtx of the
ScopedDecl with the backpatcher, and *not* a local variable on the stack. The
value of DeclCtx gets filled in *later* by the backpatcher.

This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50976 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
9f3e89ad02cc155c8f7902c81fa5a9cd6fce2b53 12-May-2008 Ted Kremenek <kremenek@apple.com> When reading in the DeclCtx during deserialization, register the DeclCtx of the
ScopedDecl with the backpatcher, and *not* a local variable on the stack. The
value of DeclCtx gets filled in *later* by the backpatcher.

This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50976 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
1ee780475d033f3ac347c2cede0ff52730655417 10-May-2008 Nuno Lopes <nunoplopes@sapo.pt> fix free/delete mismatch problem in add/mergeProperties (found by valgrind)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50945 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6b3502c5c3eba1d3da40c4c78b31f4d8cffec051 10-May-2008 Nuno Lopes <nunoplopes@sapo.pt> fix free/delete mismatch problem in add/mergeProperties (found by valgrind)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50945 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c8e51f89effc4003fc54aa4dc5a34127e793c7f4 09-May-2008 Nate Begeman <natebegeman@mac.com> Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.

Remove some unnecessary methods/types in the ExtVectorElementExpr class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
8a99764f9b778a54e7440b1ee06a1e48f25d76d8 09-May-2008 Nate Begeman <natebegeman@mac.com> Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.

Remove some unnecessary methods/types in the ExtVectorElementExpr class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
5f2e2248dcee4ca2dcb080982a7ab9d00cf06661 07-May-2008 Fariborz Jahanian <fjahanian@apple.com> Synthesized getter/setter method declarations need not have
an implementation. This fixes couple of failing prperty tests
caused by my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50830 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
4607034e621aa77378ec75249d1e9eaf5de49b6a 07-May-2008 Fariborz Jahanian <fjahanian@apple.com> Synthesized getter/setter method declarations need not have
an implementation. This fixes couple of failing prperty tests
caused by my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50830 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e4534e7c864452fd1f884668ea270d90bc586dcf 07-May-2008 Fariborz Jahanian <fjahanian@apple.com> This patch introduces declaration of getter methods for ObjC2's
properties. Couple of property tests will fail with this patch.
Will fix them next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50818 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
33de3f0333ca0b5274291b8d76c86758c0484691 07-May-2008 Fariborz Jahanian <fjahanian@apple.com> This patch introduces declaration of getter methods for ObjC2's
properties. Couple of property tests will fail with this patch.
Will fix them next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50818 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
84f75c2acac0eb96862961ed2738c9f98696ba69 07-May-2008 Steve Naroff <snaroff@apple.com> Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50816 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
1a42a2550a2db937ab3df863b771f13be34b66d6 07-May-2008 Steve Naroff <snaroff@apple.com> Fixup InitListExpr::child_begin/end. Thanks to Ted for catching the regression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50816 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
b04ba4a6e68ad113aa0e08ce9d284fb6ce0cbbfc 07-May-2008 Steve Naroff <snaroff@apple.com> Fix off-by-one error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50815 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
81e72e4c231a47633e36a6c2f3ded83630963b3f 07-May-2008 Steve Naroff <snaroff@apple.com> Fix off-by-one error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50815 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
4aa72a76d99c4c8b5c0f9264bfd98167afd4eea4 05-May-2008 Fariborz Jahanian <fjahanian@apple.com> percolate @optional/@required protocols down to ASTs for
properties declared in the protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50662 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
46b55e56d029aec699fc2701e43d70264da9ecd8 05-May-2008 Fariborz Jahanian <fjahanian@apple.com> percolate @optional/@required protocols down to ASTs for
properties declared in the protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50662 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
74bf555d259f60449b8f2f47d532d1a1ec3bca10 04-May-2008 Chris Lattner <sabre@nondot.org> Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
Fix 'swapping' of attributes to not insert null values into the
DeclAttrs map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50612 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
a212c56e9b7533bcc2d6be90efd52ad241bf894e 04-May-2008 Chris Lattner <sabre@nondot.org> Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
Fix 'swapping' of attributes to not insert null values into the
DeclAttrs map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50612 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
33973a2ce146d07ee6dba27d63028a7bf8939454 02-May-2008 Fariborz Jahanian <fjahanian@apple.com> This patch is about merging ObjC2's properties declared in class
protocols into class's property list and performing semantics
on them for while doing so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50587 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
aebf0cba02c014ac8b19d615c654248e0e93779f 02-May-2008 Fariborz Jahanian <fjahanian@apple.com> This patch is about merging ObjC2's properties declared in class
protocols into class's property list and performing semantics
on them for while doing so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50587 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
07af3dd089ce73f58a799910ef7de4b8e46e7243 02-May-2008 Ted Kremenek <kremenek@apple.com> Fixed bug in ObjCIVarExpr: the child iterator now iterates over the Base expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50585 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
92261971835f822e6bcee7baadf2c34b482dfe96 02-May-2008 Ted Kremenek <kremenek@apple.com> Fixed bug in ObjCIVarExpr: the child iterator now iterates over the Base expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50585 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
bfec9494e1ac638bfd8b04b55f7e021c6e084633 02-May-2008 Ted Kremenek <kremenek@apple.com> Bug fix in StmtPrinter to handle pretty-printing ObjCMessageExprs involving variadic methods (also did some cosmetic cleanups in the printing output).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50583 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
c29efd829a638fff380284f43c79355b98e2a2ab 02-May-2008 Ted Kremenek <kremenek@apple.com> Bug fix in StmtPrinter to handle pretty-printing ObjCMessageExprs involving variadic methods (also did some cosmetic cleanups in the printing output).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50583 91177308-0d34-0410-b5e6-96231b3b80d8
tmtPrinter.cpp
d029a6f8da922c13ffb7d1b8ffb27cc40ea71b2f 01-May-2008 Ted Kremenek <kremenek@apple.com> Use pointer swizziling to unify in ObjCMessageExpr the receiver and classname "fields". This saves us a pointer.
Implemented serialization for ObjCMessageExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50528 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtSerialization.cpp
ea958e57a370b641c5a69347b75e9f8e3b5a41a2 01-May-2008 Ted Kremenek <kremenek@apple.com> Use pointer swizziling to unify in ObjCMessageExpr the receiver and classname "fields". This saves us a pointer.
Implemented serialization for ObjCMessageExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50528 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtDumper.cpp
tmtSerialization.cpp
2e33547e94673a916ad9d54a63e00f5ed46f1c34 01-May-2008 Steve Naroff <snaroff@apple.com> Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of the initializer rewrite I am doing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50511 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
c5ae899b4bbf65488445316c63168079177db0ed 01-May-2008 Steve Naroff <snaroff@apple.com> Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of the initializer rewrite I am doing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50511 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
tmtSerialization.cpp
d058a9c63f621f101a94045bcc4f2030f4530a21 28-Apr-2008 Ted Kremenek <kremenek@apple.com> Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with
ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on
Windows would result in a 4-byte alignment, not an 8-byte alignment.

Fixes: <rdar://problem/5892265>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50364 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
274f4334f6dd35239e5c3d4b86198f7f5804b059 28-Apr-2008 Ted Kremenek <kremenek@apple.com> Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with
ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on
Windows would result in a 4-byte alignment, not an 8-byte alignment.

Fixes: <rdar://problem/5892265>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50364 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
03e6aaf5e2fd711a043ed74465a81d1b46535976 27-Apr-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Parsing of namespaces:

-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
2d1c5d313cd0c229cc614e74baa4c5756a4b46f4 27-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parsing of namespaces:

-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
863b01fd0008262475ff172bafa72e395dee0925 23-Apr-2008 Ted Kremenek <kremenek@apple.com> TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
when it is constructed via deserialization. This is done by recording a flag
indicating that this is the case, and it deletes these objects by getting
the references stored in the ASTContext object. This fixes some memory
leaks that occurs when we deserialize translation units from bitcode files.

The rationale between having TranslationUnit sometimes own these objects and
sometimes not is that a TranslationUnit object can be constructed from
state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus
in these cases won't own the IdentifierTable or Selectors, etc. During
deserialization, there is no Preprocessor, so somebody needs to own these
objects in order for them to be properly reclaimed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50149 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
c1e9dea3d974dcfcf2baa15810aa3511db688bda 23-Apr-2008 Ted Kremenek <kremenek@apple.com> TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
when it is constructed via deserialization. This is done by recording a flag
indicating that this is the case, and it deletes these objects by getting
the references stored in the ASTContext object. This fixes some memory
leaks that occurs when we deserialize translation units from bitcode files.

The rationale between having TranslationUnit sometimes own these objects and
sometimes not is that a TranslationUnit object can be constructed from
state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus
in these cases won't own the IdentifierTable or Selectors, etc. During
deserialization, there is no Preprocessor, so somebody needs to own these
objects in order for them to be properly reclaimed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50149 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
dc0569e863a6d89da3491d29ed6c56c3325aa5c6 23-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to build AST for property implementation declarations and
to print declaration from its AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50117 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
628b96f34e93b643b6e15e75eabb8d96079a7e27 23-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to build AST for property implementation declarations and
to print declaration from its AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50117 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ef87a206940eb4a5400af11b128d60b532e14708 22-Apr-2008 Chris Lattner <sabre@nondot.org> "This patch renames

DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC

It makes the code more consistent."

Patch by Zhongxing Xu!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50105 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
9fdf9c6d3530bb85f3166e6460d841e2ff8e1a2c 22-Apr-2008 Chris Lattner <sabre@nondot.org> "This patch renames

DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC

It makes the code more consistent."

Patch by Zhongxing Xu!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50105 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
8acf335fcf612f9bdde7f567d0053736c03771a3 22-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Allow property in base class to be implemented in a
derived class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50074 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c70bee863b6f800d7c88f409e89dc85ed867ef64 22-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Allow property in base class to be implemented in a
derived class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50074 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
ef8a3df17c1a04eeffc875bd7eea4d60ac839c9b 21-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Continuation of work on ObjC2's properties.
Added iterators, methods to find property and categories.
Use them in doing semantic analysis on property implementation
declarations. Fixed typos.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50050 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
559c0c4bbecc017aab0716d546c4fefbcc194687 21-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Continuation of work on ObjC2's properties.
Added iterators, methods to find property and categories.
Use them in doing semantic analysis on property implementation
declarations. Fixed typos.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50050 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
42214c5200fa3576659646c50c709d830db64077 21-Apr-2008 Douglas Gregor <doug.gregor@gmail.com> Clean up handling of function redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50021 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
f009795057dc8ca254f5618c80a0a90f07cd44b4 21-Apr-2008 Douglas Gregor <dgregor@apple.com> Clean up handling of function redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50021 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
af6ed504d90dc3b813c573bfbee8bc0e92e7fdc0 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
ype.cpp
213541a68a3e137d11d2cefb612c6cdb410d7e8e 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
xpr.cpp
tmtDumper.cpp
tmtPrinter.cpp
ype.cpp
8516e9aeca0e3b8b9d064eeef0a3a25c07c850ab 17-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Added property decl support for protocols.
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49862 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
3dd4ba4068e953125b95ce85c723322cdd0a3cb5 17-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Added property decl support for protocols.
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49862 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d358600db540bf90f686c91145cf422f122822f0 17-Apr-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Addition of TranslationUnitDecl to the AST:

-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49855 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclSerialization.cpp
ef177820100ab583b08fd3056e2a5a52ee4b1629 17-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Addition of TranslationUnitDecl to the AST:

-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49855 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclSerialization.cpp
65a81737d419e60adf77ab865570a6ac6f267ab1 17-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> New AST class for property implementation declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49821 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
61d46159af2a740207de8dc024211d531ae290d9 17-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> New AST class for property implementation declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49821 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
5742a0f49249daf425ba1d370d7efe434c8ea3e3 16-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49819 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d9a3c330b02c52630014dc26fc009236facf8227 16-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49819 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
79f0a63d595ce0ef9d6d72658703f934820081a6 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a block's terminator.
Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator().

Bug fix: CFG now computes Block-level expression numbers using information
from block terminators. This fixes <rdar://problem/5868189>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49818 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
411cdee0b490f79428c9eb977f25199eb7d21cd8 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a block's terminator.
Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator().

Bug fix: CFG now computes Block-level expression numbers using information
from block terminators. This fixes <rdar://problem/5868189>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49818 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
52ff8444b679c8e11e248e535a06fe11b0fe6503 16-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> This patch adds support for declaraing properties in categories,
just as they are declared in objc classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49817 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7e7e3872b584bc5e7de7a34c8b9c092032303b72 16-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> This patch adds support for declaraing properties in categories,
just as they are declared in objc classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49817 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2287cee1857a6aabb3daf1c79d0b703d1dee9640 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Remove uses of "Selector&" and "const Selector&", since Selector is just an
immutable smart pointer (we don't need to pass references, just pass Selector).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49773 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
97b7f26a92d87e514530a5b652460190ce48c974 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Remove uses of "Selector&" and "const Selector&", since Selector is just an
immutable smart pointer (we don't need to pass references, just pass Selector).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49773 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
tmtPrinter.cpp
72a6ebcd14aa787c516d683a0efa1550440ad346 16-Apr-2008 Steve Naroff <snaroff@apple.com> Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
tmtDumper.cpp
248a753f6b670692523c99afaeb8fe98f7ae3ca7 16-Apr-2008 Steve Naroff <snaroff@apple.com> Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
tmtDumper.cpp
0ceb4be0200f9f03f8ffe4c0986ef3cc09e15d36 15-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> New AST representation for each objc2's property declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49699 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1de1e74541c25c1a7b721f1c3991ea34c8403420 15-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> New AST representation for each objc2's property declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49699 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1d661556b9263f4d635372aecdea8c55dac84e83 13-Apr-2008 Douglas Gregor <doug.gregor@gmail.com> Introduce support for finding class and enum names via ordinary name lookup in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49621 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2ce52f3fb95bf544db6bd3d91a72bce7d9cceb6c 13-Apr-2008 Douglas Gregor <dgregor@apple.com> Introduce support for finding class and enum names via ordinary name lookup in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49621 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
2e78db3510b136b3f961af202e6a1a3df4839172 13-Apr-2008 Chris Lattner <sabre@nondot.org> This patch is just the easy part of the class names patch, which
allows the parsing of "class" in addition to "struct" and "union" to
declare a record. So this patch allows:

class C { };
class C c1;

But it does not contain the lookup bits, so this won't work yet:

C c2;

Patch by Doug Gregor!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49613 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
99dc91422144483c20d1c7381bc9ac634b646b04 13-Apr-2008 Chris Lattner <sabre@nondot.org> This patch is just the easy part of the class names patch, which
allows the parsing of "class" in addition to "struct" and "union" to
declare a record. So this patch allows:

class C { };
class C c1;

But it does not contain the lookup bits, so this won't work yet:

C c2;

Patch by Doug Gregor!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49613 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2ea14c53928dd5ac5d8be39d7ce010d393d3a772 13-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Use static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49603 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1b30cb27f894687c6021e7331265ae21aeb57d3f 13-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Use static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49603 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
b1856dbbd26d8386899c46712e182e54f9833de6 13-Apr-2008 Chris Lattner <sabre@nondot.org> Default argument cleanups and minor improvements, patch by
Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49598 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
9e979557eea3875c9e3d100c68188233dd7f46c0 13-Apr-2008 Chris Lattner <sabre@nondot.org> Default argument cleanups and minor improvements, patch by
Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49598 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e707172d121c4072834e59067eec77fd410b5764 12-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> AST generation for objc2's property declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49565 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
dae1a1a2aa4f245b1958dc8db6089f24c575ef13 12-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> AST generation for objc2's property declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49565 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7c371743821713cb9627af576fadc890185c75e2 11-Apr-2008 Steve Naroff <snaroff@apple.com> Add class and super class location info to ObjCInterfaceDecl...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49553 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
d6a07aaf62b40cdfbd96f6b874d02b06fc22d015 11-Apr-2008 Steve Naroff <snaroff@apple.com> Add class and super class location info to ObjCInterfaceDecl...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49553 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
21d4e81557e118167c0acd8030ec68ff5d9ffc1a 11-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Invoke destructors in Decl::Destroy().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49547 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
1bb19638f2ec0d63ed131b51ca8d9542d1a9afee 11-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Invoke destructors in Decl::Destroy().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49547 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
274366f8e637c55be456dfc7bb4ea54fe5e5af97 11-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Stub out and start using a Decl::Destroy() method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ranslationUnit.cpp
bb45c512e0dfbe96bfe377ac642e726c0ba0affa 11-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Stub out and start using a Decl::Destroy() method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
ranslationUnit.cpp
34e2500e6f302d76c9f3fc0d3de082572acf3630 11-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Use the ASTContext allocator when creating deserialized Decl objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49530 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
f3c63ae44e1d2ad04fd7c760fa07d150c3217c18 11-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Use the ASTContext allocator when creating deserialized Decl objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49530 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
97316c05084fc9a360b3d38af939c30cdd3c6034 10-Apr-2008 Chris Lattner <sabre@nondot.org> Several improvements from Doug Gregor related to default
argument handling. I'll fix up the c89 (void) thing next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprCXX.cpp
8123a95c33b792d35c2e4992ba6e27882748fb0d 10-Apr-2008 Chris Lattner <sabre@nondot.org> Several improvements from Doug Gregor related to default
argument handling. I'll fix up the c89 (void) thing next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
xpr.cpp
xprCXX.cpp
be9c27a46f4668b89388704afb1f5335bd423229 08-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Changed the Decl::Kind enum of the ObjCPropertyDecl class, so that it follows
the pattern of the other Decl classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49399 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
670aa9d7639278f507930e95dc89c12032ab7c7e 08-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Changed the Decl::Kind enum of the ObjCPropertyDecl class, so that it follows
the pattern of the other Decl classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49399 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
3e254fbafd851bc9d6872cf52ee5740c79b3e627 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
04421087832a031c90bd58f128c7c0e741db8dd2 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
xpr.cpp
xprCXX.cpp
tmtPrinter.cpp
tmtSerialization.cpp
e1bf35175aed2aa96da1bd73601ac2fd3e02c500 07-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Pass the ASTContext object around when deserializing Decl and Stmt objects, so
they can be created using the same allocator as in the "from source code" case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49353 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
tmtSerialization.cpp
ranslationUnit.cpp
ypeSerialization.cpp
e2563ca02a519c2ad6d64dfed87d6e86c5d3c072 07-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Pass the ASTContext object around when deserializing Decl and Stmt objects, so
they can be created using the same allocator as in the "from source code" case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49353 91177308-0d34-0410-b5e6-96231b3b80d8
eclSerialization.cpp
tmtSerialization.cpp
ranslationUnit.cpp
ypeSerialization.cpp
1d78a86869f68fbadfa1528ce4a964aff9d77e06 07-Apr-2008 Chris Lattner <sabre@nondot.org> random whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49328 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
5426bf6456a5aeac416a9150de157904d101c819 07-Apr-2008 Chris Lattner <sabre@nondot.org> random whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49328 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c8971d7853e1942a360621f8a829d552af60a767 07-Apr-2008 Chris Lattner <sabre@nondot.org> fix a bug I introduced in my previous checkin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49327 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8c7bbb5347a74f7f470231a149dd3455fbe0bcc6 07-Apr-2008 Chris Lattner <sabre@nondot.org> fix a bug I introduced in my previous checkin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49327 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f0d2ee0dfb27a0b6d08173822ebb7cf8d44b96b3 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify array compatibility testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49326 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
acc9972da24df89ea283d6f979ffbd0e4fa0e1a5 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify array compatibility testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49326 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e1577e2cbefa2156337ab75a950ad9ef0f9102fc 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify reference handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49325 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
8f8fc7bdb6f42ce31d46596d4c0660625773cbef 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify reference handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49325 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6ff358b2ff601272912be89813d3dd96c1da72a7 07-Apr-2008 Chris Lattner <sabre@nondot.org> move some code around, no other change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49324 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6ac46a4a521366d7ab36ebe2ce4e624ab96b06f9 07-Apr-2008 Chris Lattner <sabre@nondot.org> move some code around, no other change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49324 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
390564e2ad5e3582a67d76b3a611b375ae5c4b9a 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify compatibility testing for tag types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49323 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
78eca286b0898e98bb2cee943b4ecbea9cc07dd6 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify compatibility testing for tag types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49323 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7cdcb255b49d231eed78a6f94c765d251156868d 07-Apr-2008 Chris Lattner <sabre@nondot.org> merge compatibility testing of qualified/unqualified interfaces together
and fix a bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49322 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b0489814dcb3cb801eeb0784cc6b6fcf575ff71d 07-Apr-2008 Chris Lattner <sabre@nondot.org> merge compatibility testing of qualified/unqualified interfaces together
and fix a bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49322 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fd5690fe6b5ea1c553dfe20f99d3fef269a50bd1 07-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a really bad bug where type uniquing would merge a<x> with b<x> as the same
type, because it did not include a/b in the hash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49321 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1ee0700c7dbe3554df09b4558e0b35a53d487ff2 07-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a really bad bug where type uniquing would merge a<x> with b<x> as the same
type, because it did not include a/b in the hash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49321 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
309328ba9ea26aa0ae2454114ce40456d535d0ec 07-Apr-2008 Chris Lattner <sabre@nondot.org> MyOtherClass<MyProtocol>* is compatible with MyClass*
if MyClass is a superclass of MyOtherClass, there is no need for
an exact interface match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49320 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
42a997c93b2166facfd3c93ffd5027e4930545dd 07-Apr-2008 Chris Lattner <sabre@nondot.org> MyOtherClass<MyProtocol>* is compatible with MyClass*
if MyClass is a superclass of MyOtherClass, there is no need for
an exact interface match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49320 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d1240fac4ac3849087c8860c584f9b4581813b7b 07-Apr-2008 Chris Lattner <sabre@nondot.org> Remove a dead check for compatible builtin types


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49319 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3cc4c0c3058a788689b8fc73c0ac139544435c97 07-Apr-2008 Chris Lattner <sabre@nondot.org> Remove a dead check for compatible builtin types


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49319 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
0d3e6455188fc84c24b0635a0249398c6e9d3a47 07-Apr-2008 Chris Lattner <sabre@nondot.org> futher simplify compatibility testing of objc interface types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49318 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
6e26f5db807a75713dbf6e34cf93da6fffe18cc3 07-Apr-2008 Chris Lattner <sabre@nondot.org> futher simplify compatibility testing of objc interface types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49318 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b5709e2b99b49d75a3f907415c5c5b5565f4ad7d 07-Apr-2008 Chris Lattner <sabre@nondot.org> ocuvector and vector should be compatible. Fix ASQual compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49316 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a36a61f218b9f7a97f2c0f511e0b29eb42e8f78b 07-Apr-2008 Chris Lattner <sabre@nondot.org> ocuvector and vector should be compatible. Fix ASQual compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49316 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d47d604cb8538b84866292c1410ccc41c45c043f 07-Apr-2008 Chris Lattner <sabre@nondot.org> Fix comment typo, do reference eval at the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49315 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f3692dc4a47dc48d10cec0415c6e9e39b7a39707 07-Apr-2008 Chris Lattner <sabre@nondot.org> Fix comment typo, do reference eval at the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49315 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b8890206ac094c282c8a830c715029b9fe1c9852 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify vector type compatibility testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f62f9cd5a78e5445a02e37b277f7a2df9c19b7a3 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify vector type compatibility testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49314 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
fe1f40359ec02723629c0ddf5bf92c7a18221f84 07-Apr-2008 Chris Lattner <sabre@nondot.org> move ObjCQualifiedIdTypesAreCompatible out of ASTContext into Sema.
While it is similar to the other compatibility predicates in ASTContext,
it is not used by them and is different.

In addition, greatly simplify ObjCQualifiedIdTypesAreCompatible and
fix some canonical type bugs. Also, simplify my Type::getAsObjC* methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49313 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
eca7be6b7ebd93682eeaab2c71d59f2995dacdcc 07-Apr-2008 Chris Lattner <sabre@nondot.org> move ObjCQualifiedIdTypesAreCompatible out of ASTContext into Sema.
While it is similar to the other compatibility predicates in ASTContext,
it is not used by them and is different.

In addition, greatly simplify ObjCQualifiedIdTypesAreCompatible and
fix some canonical type bugs. Also, simplify my Type::getAsObjC* methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49313 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
6775d03bee48bf1ebafb192f870b0515195a35f9 07-Apr-2008 Chris Lattner <sabre@nondot.org> Replace an O(n^2) algorithm in areCompatObjCQualInterfaces with
an O(n) algorithm by taking advantage of the fact that the
protocol qualifier list is already guaranteed sorted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49312 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
821a01baa2968dd27720c631a6722ec60686ce27 07-Apr-2008 Chris Lattner <sabre@nondot.org> Replace an O(n^2) algorithm in areCompatObjCQualInterfaces with
an O(n) algorithm by taking advantage of the fact that the
protocol qualifier list is already guaranteed sorted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49312 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e135230ff39815b07f4156eed4dffdfd929c4681 07-Apr-2008 Chris Lattner <sabre@nondot.org> move sorting of qualifying protocols from the parser into
sema. This allows clients of the parser to have the unmolested
list if desired, and guarantees that noone can create an
ObjCQualifiedInterfaceType with an unsorted list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49310 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
88cb27a160adc305783a44f922ee4b216006ebf9 07-Apr-2008 Chris Lattner <sabre@nondot.org> move sorting of qualifying protocols from the parser into
sema. This allows clients of the parser to have the unmolested
list if desired, and guarantees that noone can create an
ObjCQualifiedInterfaceType with an unsorted list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49310 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b0c6a1fcc5d43696387d2870cc4722581f6db671 07-Apr-2008 Chris Lattner <sabre@nondot.org> eliminate getReferencedProtocols from
ObjCQualifiedIdType/ObjCQualifiedInterfaceType, adding an interator
interface instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49308 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
065f0d7b00c3cd2b3139ebd105f50462fc778859 07-Apr-2008 Chris Lattner <sabre@nondot.org> eliminate getReferencedProtocols from
ObjCQualifiedIdType/ObjCQualifiedInterfaceType, adding an interator
interface instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49308 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e7bf8df2a54184ee19ec217ff9ddafca47b21900 07-Apr-2008 Chris Lattner <sabre@nondot.org> make QualifiedInterfaceTypesAreCompatible a static function
and start simplifying it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49307 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3b27546b42bc3d5ec261f3228192350affb370be 07-Apr-2008 Chris Lattner <sabre@nondot.org> make QualifiedInterfaceTypesAreCompatible a static function
and start simplifying it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49307 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
40d6317c310092e4811dbc2b0f5ac81deb10bcae 07-Apr-2008 Chris Lattner <sabre@nondot.org> This predicate is just a generic "issuperclass" predicate, move it to the
ObjCInterfaceType as a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49306 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
53efc251792bf2c9c5f295bd3507facc51a1fe7e 07-Apr-2008 Chris Lattner <sabre@nondot.org> This predicate is just a generic "issuperclass" predicate, move it to the
ObjCInterfaceType as a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49306 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
855fed4a2b53d1fd6f8d9054967e39dd4ccc3f81 07-Apr-2008 Chris Lattner <sabre@nondot.org> Simplify some objc compatibility testing, make interfaceTypesAreCompatible
a static function named isCompatibleInterfaceAssign.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49305 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
c4e405996217f4be20f73186da53b23b5c4783dc 07-Apr-2008 Chris Lattner <sabre@nondot.org> Simplify some objc compatibility testing, make interfaceTypesAreCompatible
a static function named isCompatibleInterfaceAssign.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49305 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
972e3945bde8e175865655d6dd42dd06f9249e96 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify the logic in ASTContext::objcTypesAreCompatible



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49302 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
439dbadeada35a73e0b182270456ed76dda635d4 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify the logic in ASTContext::objcTypesAreCompatible



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49302 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b06cf30badcddfea862bc9a538447453bdd94598 07-Apr-2008 Chris Lattner <sabre@nondot.org> clean up some logic in objc type handling. Specifically, make it so that
there are QualType::getAsObjc* type methods, and make isa<ObjCInterfaceType>
return true for ObjCQualifiedInterfaceType's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49300 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
368eefa081d12f0a265ee90ee8ec61b54168d57d 07-Apr-2008 Chris Lattner <sabre@nondot.org> clean up some logic in objc type handling. Specifically, make it so that
there are QualType::getAsObjc* type methods, and make isa<ObjCInterfaceType>
return true for ObjCQualifiedInterfaceType's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49300 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
7794ae242f158d67b83345f468dc77fa9d10296a 07-Apr-2008 Chris Lattner <sabre@nondot.org> trivial changes to getFloatingTypeOfSizeWithinDomain, nothing significant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49298 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
1361b11066239ea15764a2a844405352d87296b3 07-Apr-2008 Chris Lattner <sabre@nondot.org> trivial changes to getFloatingTypeOfSizeWithinDomain, nothing significant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49298 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
51285d8efe73ba2c6d30145da33b3d05829ceaba 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify max type computation by making it return an integer (like
getFloatingTypeOrder) instead of a type. Fix a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49297 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7cfeb08f2466d6263ec6ff1402298f93f6d6991f 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify max type computation by making it return an integer (like
getFloatingTypeOrder) instead of a type. Fix a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49297 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d7135b47ba2583ad564ad347002eeb0ba17b9b07 07-Apr-2008 Chris Lattner <sabre@nondot.org> minor simplifications/cleanups to type comparisons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49296 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
a75cea3f6be0daa8054d36af81a6ffda1713f82d 07-Apr-2008 Chris Lattner <sabre@nondot.org> minor simplifications/cleanups to type comparisons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49296 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e8733595c9eb620eb435a1c0218932e3e1b6ceec 07-Apr-2008 Chris Lattner <sabre@nondot.org> remove a use of getCanonicalType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49294 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d8bdba5d3534b87cae606d559933bc62752e8828 07-Apr-2008 Chris Lattner <sabre@nondot.org> remove a use of getCanonicalType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49294 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
c1b68dbbf3d1d032957c50d9d5b96bba565073ca 07-Apr-2008 Chris Lattner <sabre@nondot.org> Start switching clients over from CT.getCanonicalType() to Context.getCanonicalType(CT) for PR2189.

While I'm at it, clean up a bit of maxIntegerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49292 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
f52ab250ff92bc51a9ac9a8e19bd43b63a5f844f 07-Apr-2008 Chris Lattner <sabre@nondot.org> Start switching clients over from CT.getCanonicalType() to Context.getCanonicalType(CT) for PR2189.

While I'm at it, clean up a bit of maxIntegerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49292 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
3dae6f4e34139e208fb0eccc35c0e43e4be24510 07-Apr-2008 Chris Lattner <sabre@nondot.org> introduce a new ASTContext::getCanonicalType method. This is the first
step towards fixing PR2189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49291 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
77c9647cae939104c6cb2b6a4dd8ca859d2e5770 07-Apr-2008 Chris Lattner <sabre@nondot.org> introduce a new ASTContext::getCanonicalType method. This is the first
step towards fixing PR2189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49291 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
b89a74c4610611e40a09cc3969585f7fd33282a3 07-Apr-2008 Chris Lattner <sabre@nondot.org> Use EnumType to simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49289 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
37c1b78a20a09b0456aa5caa15e159027010ca22 07-Apr-2008 Chris Lattner <sabre@nondot.org> Use EnumType to simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49289 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2bf1d6c70f39549f7ef4768721956d9f0754f296 07-Apr-2008 Chris Lattner <sabre@nondot.org> make use of EnumType to simplify some code, eliminate warnings
when assertions are disabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49288 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7176331b0f5cfaaa2b5aa487a6660e859e371119 07-Apr-2008 Chris Lattner <sabre@nondot.org> make use of EnumType to simplify some code, eliminate warnings
when assertions are disabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49288 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
eae0eaa09f163aa27d2eb0244ed2d3ebed8eed6f 07-Apr-2008 Chris Lattner <sabre@nondot.org> Make EnumType/RecordType classof predicates simpler and more efficient in
some cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49287 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
2daa5df1b53f7ef745d724771384409f6f5df5c1 07-Apr-2008 Chris Lattner <sabre@nondot.org> Make EnumType/RecordType classof predicates simpler and more efficient in
some cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49287 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
1baaf13ea33c7b60742bf772bca8df2ccc1a51a8 06-Apr-2008 Chris Lattner <sabre@nondot.org> add a helper EnumType object for asking about tagtypes for enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49286 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
5edb8bfe8472e7d7bf6a82386394ef27359eb846 06-Apr-2008 Chris Lattner <sabre@nondot.org> add a helper EnumType object for asking about tagtypes for enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49286 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
052fbcdab1bfcd795ebd5d1f2f9ccfc95671431b 06-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a bug I introduced in my const'ification patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49262 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
5619688510185081cbb4621d703daf7ee24cf39a 06-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a bug I introduced in my const'ification patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49262 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f3874bc89a4f4c4af2ea41900b782a8381d1fcba 06-Apr-2008 Chris Lattner <sabre@nondot.org> This patch contains these changes:

-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl

Patch by Argiris Kirtzidis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclObjC.cpp
eclSerialization.cpp
b048c9835969c4f7fe06264748be18ed4b442116 06-Apr-2008 Chris Lattner <sabre@nondot.org> This patch contains these changes:

-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl

Patch by Argiris Kirtzidis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclObjC.cpp
eclSerialization.cpp
546b68cfff587943414a19119add6bf9c06c2152 06-Apr-2008 Chris Lattner <sabre@nondot.org> fix a number of const qualification bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49257 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e0def7589a8afa8a6acef13476bb3f882c104b91 06-Apr-2008 Chris Lattner <sabre@nondot.org> fix a number of const qualification bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49257 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
328bdf212a0515875a0064832a02c9565be55280 04-Apr-2008 Steve Naroff <snaroff@apple.com> Rename ScopedDecl::getContext() -> getContextDecl(). Two motivations:

#1: To be consistent with FieldDecl::getContextDecl(), which serves the same purpose.
#2: From my perspective, getContext() is too general (and used by several other classes for different purposes).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49224 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
b6e64c57e45e52a46b63acc10d7f468cf1339746 04-Apr-2008 Steve Naroff <snaroff@apple.com> Rename ScopedDecl::getContext() -> getContextDecl(). Two motivations:

#1: To be consistent with FieldDecl::getContextDecl(), which serves the same purpose.
#2: From my perspective, getContext() is too general (and used by several other classes for different purposes).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49224 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclSerialization.cpp
e330ae7cfe01818e39c84108001cf6fbf5d5cff5 04-Apr-2008 Seo Sanghyeon <sanxiyn@gmail.com> PR1963: Address of function is a constant expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49212 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
63f067f5a75ae97b53dc7a6a6530e2c72c8bb7f8 04-Apr-2008 Seo Sanghyeon <sanxiyn@gmail.com> PR1963: Address of function is a constant expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49212 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.cpp
eee57c013158e34b6a472d9d07b73ba271523eff 04-Apr-2008 Chris Lattner <sabre@nondot.org> Introduce ContextDecl, patch by Argiris Kirtzidis!

-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49208 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclObjC.cpp
eclSerialization.cpp
0ed844b04ea4387caa4e1cf3dc375d269657536b 04-Apr-2008 Chris Lattner <sabre@nondot.org> Introduce ContextDecl, patch by Argiris Kirtzidis!

-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49208 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclObjC.cpp
eclSerialization.cpp
fc8584c0a2b8192a723208278f09346e67e36ec1 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> trivial whitespace fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49160 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
0f9c72f5054a69301b23434c9f58515d5ad2fc67 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> trivial whitespace fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49160 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
49492515b23e3b5f0f1319c87bd84fb6d57847ec 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Created a destructor so that the top-level decls can be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49142 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
71de20ef8bf50e83f60d4b191cc6797cf27853d3 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Created a destructor so that the top-level decls can be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49142 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
4d5670b692e8d3db8974da658b00c2956f8b840e 03-Apr-2008 Chris Lattner <sabre@nondot.org> qualifier comparisons should be done on canonical types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
988ee6ef540d1203cf4aa52971f3c135c796bdf7 03-Apr-2008 Chris Lattner <sabre@nondot.org> qualifier comparisons should be done on canonical types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49137 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
7a7445ea89c00e113df14e288c83b8e7e0dfb78f 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Call "delete" on the body of FunctionDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49135 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8266d7f62019c3366254461cec2275999e69999c 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Call "delete" on the body of FunctionDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49135 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
cfac88de7de7d970a2436af939ea87c0e5a9cf9f 02-Apr-2008 Chris Lattner <sabre@nondot.org> add a common base class "PointerLikeType" for PointerType and ReferenceType,
allowing them to be treated the same in some contexts. A suggestion for a
better name is welcome :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49100 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
bdcd637c29ec1540f912ea6860c88b910e78c329 02-Apr-2008 Chris Lattner <sabre@nondot.org> add a common base class "PointerLikeType" for PointerType and ReferenceType,
allowing them to be treated the same in some contexts. A suggestion for a
better name is welcome :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49100 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ype.cpp
da79b3f775fe88139912299b39f9f4ef1689f5af 02-Apr-2008 Chris Lattner <sabre@nondot.org> Add a citation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49080 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d9654557562e77564309f6b83b493a9a424e008a 02-Apr-2008 Chris Lattner <sabre@nondot.org> Add a citation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49080 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
19eb97ea0abbfde182bf4cd3120261ec224c20a9 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix several bugs in array -> pointer decomposition.

First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.

Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.

Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").

This adds an ASTContext::getArrayDecayedType member that handles the
non-trivial logic for this seemingly simple operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49078 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
e6327747b72bb687c948270f702ff53c30f411a6 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix several bugs in array -> pointer decomposition.

First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.

Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.

Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").

This adds an ASTContext::getArrayDecayedType member that handles the
non-trivial logic for this seemingly simple operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49078 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
d5e220fef4c6ddb0000d8f1dc0d5033a24dfc3ff 02-Apr-2008 Chris Lattner <sabre@nondot.org> remove blank line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49075 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
8527f82594d88002c036cd8833379670a0bce067 02-Apr-2008 Chris Lattner <sabre@nondot.org> remove blank line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49075 91177308-0d34-0410-b5e6-96231b3b80d8
ype.cpp
6c755cfc554f5ebe00a89a9c521745981cc8edcf 02-Apr-2008 Chris Lattner <sabre@nondot.org> print cvr qualifiers on simplified typedefs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49074 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
bad37858aef8910195a9c75f2892a09a032424b7 02-Apr-2008 Chris Lattner <sabre@nondot.org> print cvr qualifiers on simplified typedefs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49074 91177308-0d34-0410-b5e6-96231b3b80d8
tmtDumper.cpp
e57c21a9247ac0755b4464c522c8d9f1db39bb1f 02-Apr-2008 Steve Naroff <snaroff@apple.com> Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).

- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.

Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
e8043c39176e7f253fbd92982b077eca6bf2fd59 02-Apr-2008 Steve Naroff <snaroff@apple.com> Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).

- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.

Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
d960610330ac3824be0fa6b38713d46937934f0a 01-Apr-2008 Chris Lattner <sabre@nondot.org> Update to match simplified llvm MemoryBuffer interfaces for files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49042 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
35de512b9cb22a234a771b417507f71a2bbb5a94 01-Apr-2008 Chris Lattner <sabre@nondot.org> Update to match simplified llvm MemoryBuffer interfaces for files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49042 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.cpp
c72d22d716c178a40b37a40bfc2e1b046c15e541 31-Mar-2008 Chris Lattner <sabre@nondot.org> rename Decl::CompatibleAlias -> ObjCCompatibleAlias.

Fix objc ivar lookup. Ivar lookup should occur between lookup
of method-local values and lookup of globals. Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.

Two todo's left:
1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
in the AST. This is a hack.
2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
not correctly handle typedefs and enum constants yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48972 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
8a934233d1582b5bde9d270bc0705aa81e471a79 31-Mar-2008 Chris Lattner <sabre@nondot.org> rename Decl::CompatibleAlias -> ObjCCompatibleAlias.

Fix objc ivar lookup. Ivar lookup should occur between lookup
of method-local values and lookup of globals. Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.

Two todo's left:
1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
in the AST. This is a hack.
2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
not correctly handle typedefs and enum constants yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48972 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
92e3ff9ca6ba1acf490b89855f56c426dbaddc82 17-Mar-2008 Ted Kremenek <kremenek@apple.com> Bug fix in CFG construction: VisitCompoundStmt should return the last created block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48460 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a716d7a575c55805c4b90e07cccf61b9cc0960b8 17-Mar-2008 Ted Kremenek <kremenek@apple.com> Bug fix in CFG construction: VisitCompoundStmt should return the last created block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48460 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
44859618fbb881db1728da0bb6e82553f579d2ec 17-Mar-2008 Chris Lattner <sabre@nondot.org> clean up property memory allocation to move it into the ast classes
like the rest of the classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48434 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f4af5154571e0c5eadb19df10e65464766ef6683 17-Mar-2008 Chris Lattner <sabre@nondot.org> clean up property memory allocation to move it into the ast classes
like the rest of the classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48434 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
cffe36686142e06ce67fd4f0469ecc58e1286bdf 16-Mar-2008 Chris Lattner <sabre@nondot.org> make property addition work list all other "add" methods. Do
the allocation in the class, not in sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48433 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
55d13b4d5530a14d5baa72adab32ae78ba256caf 16-Mar-2008 Chris Lattner <sabre@nondot.org> make property addition work list all other "add" methods. Do
the allocation in the class, not in sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48433 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
2d1c43110a0f4ba4b9b6de2364959a238baf1c12 16-Mar-2008 Chris Lattner <sabre@nondot.org> add the last two Create methods for decls, woo!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48432 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f8d17a59167d9c2026506ed8813ea434d93b662a 16-Mar-2008 Chris Lattner <sabre@nondot.org> add the last two Create methods for decls, woo!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48432 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
1b6de3378e0af075b0254da7ba8c2e80f2753609 16-Mar-2008 Chris Lattner <sabre@nondot.org> add two more Create methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48428 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
75c9cae5f85c72cbb1649e93849e16ede3f07522 16-Mar-2008 Chris Lattner <sabre@nondot.org> add two more Create methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48428 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
321b5d12d1ed2c6b5a2faab712c3e3572c76eef6 16-Mar-2008 Chris Lattner <sabre@nondot.org> simplify the way ObjCCategoryDecl's get their referenced protocols list
specified. Previously, the ctor would allocate memory for the list and then
it would get filled in later. Move the allocation+filling in to be more
consistent with other stuff, e.g. the addMethods method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48427 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
68c82cf61228102aba1194efef222fa1478af2a8 16-Mar-2008 Chris Lattner <sabre@nondot.org> simplify the way ObjCCategoryDecl's get their referenced protocols list
specified. Previously, the ctor would allocate memory for the list and then
it would get filled in later. Move the allocation+filling in to be more
consistent with other stuff, e.g. the addMethods method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48427 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
e29dc839e5d2cb44824463a2968a3c04d28245f4 16-Mar-2008 Chris Lattner <sabre@nondot.org> Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48426 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
61f9d41036e30ff80130f99b31c0626e3ef057cc 16-Mar-2008 Chris Lattner <sabre@nondot.org> Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48426 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
7afba9ccb99d94be9dbd0a5d4a1d749e4880b864 16-Mar-2008 Chris Lattner <sabre@nondot.org> minor cleanups, make getNumInstanceMethods always return unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48423 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
c858105d41602a2dadb2efbc1af80a7b791ebac3 16-Mar-2008 Chris Lattner <sabre@nondot.org> minor cleanups, make getNumInstanceMethods always return unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48423 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
180f7e2b7bab938bc797f3ed459826720866655a 16-Mar-2008 Chris Lattner <sabre@nondot.org> Give ObjCProtocolDecl a Create method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48410 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
cca59d77c4b84fd2da268018dbaf9431a621e75b 16-Mar-2008 Chris Lattner <sabre@nondot.org> Give ObjCProtocolDecl a Create method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48410 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0db541b0fc07aaa800e7f687b2a39a931db8f3b1 16-Mar-2008 Chris Lattner <sabre@nondot.org> Add create methods for ObjCIvarDecl and ObjCInterfaceDecl


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48408 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
0e77ba0bf769e2e5a4a93c079f241b02aeb3ef93 16-Mar-2008 Chris Lattner <sabre@nondot.org> Add create methods for ObjCIvarDecl and ObjCInterfaceDecl


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48408 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
f735583ce92b5539bb607bfc57de9e90b1498429 16-Mar-2008 Chris Lattner <sabre@nondot.org> remove some dead arguments to ObjCMethodDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48406 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
b06fa3b86951b9f179c99c3768331536c32e902d 16-Mar-2008 Chris Lattner <sabre@nondot.org> remove some dead arguments to ObjCMethodDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48406 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
114add6e2b53b3b1953db4fb721db65f3b8dd173 16-Mar-2008 Chris Lattner <sabre@nondot.org> Give ObjCMethodDecl a Create method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48405 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
6c4ae5de0c356777446f823b573821fb95560d91 16-Mar-2008 Chris Lattner <sabre@nondot.org> Give ObjCMethodDecl a Create method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48405 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.cpp
10318b868be37ad2414f22c3463b25fcc52dc3db 16-Mar-2008 Chris Lattner <sabre@nondot.org> Split objc decl implementation out into DeclObjC.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48404 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
1e03a561f4bd96910cb31a8af53a6ad321a12b51 16-Mar-2008 Chris Lattner <sabre@nondot.org> Split objc decl implementation out into DeclObjC.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48404 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.cpp
eclObjC.cpp
81db64a7628f64f16a986a8e314d1d792a2259cb 16-Mar-2008 Chris Lattner <sabre@nondot.org> switch the rest of the C decl classes to do their
allocation through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclSerialization.cpp
8e25d8681822d8094bfeb97b2239363552548171 16-Mar-2008 Chris Lattner <sabre@nondot.org> switch the rest of the C decl classes to do their
allocation through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.cpp
ecl.cpp
eclSerialization.cpp
be1a7a0f1f78bf5f919ff1e4b4ae6e8649255f26 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
uiltins.cpp
FG.cpp
ecl.cpp
eclSerialization.cpp
xpr.cpp
xprCXX.cpp
akefile
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtSerialization.cpp
tmtViz.cpp
ranslationUnit.cpp
ype.cpp
ypeSerialization.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.cpp
STContext.cpp
uiltins.cpp
FG.cpp
ecl.cpp
eclSerialization.cpp
xpr.cpp
xprCXX.cpp
akefile
tmt.cpp
tmtDumper.cpp
tmtIterator.cpp
tmtPrinter.cpp
tmtSerialization.cpp
tmtViz.cpp
ranslationUnit.cpp
ype.cpp
ypeSerialization.cpp