• Home
  • History
  • Annotate
  • only in /external/clang/include/clang/AST/
History log of /external/clang/include/clang/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
STConsumer.h
STContext.h
STDiagnostic.h
ataRecursiveASTVisitor.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclOpenMP.h
eclTemplate.h
xpr.h
angle.h
penMPClause.h
ecursiveASTVisitor.h
tmt.h
tmtOpenMP.h
emplateBase.h
ype.h
nresolvedSet.h
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
PValue.h
STConsumer.h
STContext.h
STImporter.h
STTypeTraits.h
STUnresolvedSet.h
STVector.h
ttr.h
ttrIterator.h
XXInheritance.h
omment.h
ommentHTMLTags.td
ommentLexer.h
ommentSema.h
ataRecursiveASTVisitor.h
ecl.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclFriend.h
eclGroup.h
eclObjC.h
eclTemplate.h
eclarationName.h
ependentDiagnostic.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
ambdaCapture.h
angle.h
estedNameSpecifier.h
penMPClause.h
arentMap.h
ecursiveASTVisitor.h
edeclarable.h
tmt.h
tmtCXX.h
tmtIterator.h
tmtObjC.h
emplateBase.h
emplateName.h
ype.h
ypeLoc.h
TableBuilder.h
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
PValue.h
STConsumer.h
STContext.h
STLambda.h
STMutationListener.h
STTypeTraits.h
STVector.h
ttr.h
ttrIterator.h
MakeLists.txt
XXInheritance.h
anonicalType.h
harUnits.h
omment.h
ommentCommands.td
ommentLexer.h
ataRecursiveASTVisitor.h
ecl.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclFriend.h
eclLookups.h
eclObjC.h
eclOpenMP.h
eclTemplate.h
ependentDiagnostic.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
akefile
angle.h
angleNumberingContext.h
penMPClause.h
perationKinds.h
rettyPrinter.h
awCommentList.h
ecordLayout.h
ecursiveASTVisitor.h
edeclarable.h
tmt.h
tmtIterator.h
tmtOpenMP.h
emplateBase.h
ype.h
ypeLoc.h
ypeNodes.def
TableBuilder.h
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
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
angle.h
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
angle.h
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
angle.h
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
eclBase.h
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.h
f6785e3117c0ce447e4d70065e069a9dc031f14c 12-Nov-2013 Dmitri Gribenko <gribozavr@gmail.com> Documentation parsing: add support for \throws \throw \exception commands


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194521 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.h
ommentCommands.td
3347b497157d36cf280d1d9f52956faa6e702f34 12-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Rather than duplicating extension diagnostics to allow them to cause a
substitution failure, allow a flag to be set on the Diagnostic object,
to mark it as 'causes substitution failure'.

Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior
rather than a bunch of flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194444 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
ommentDiagnostic.h
c31fbe34c9cc9d7fcf4e5d6d79e27835cdefc716 09-Nov-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: recognize \def (but processing is a no-op, like the rest of
similar commands that duplicate the declaration name)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194312 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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.h
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.h
c00e4194296e994efab0e4bf64ca66737850bdf0 07-Nov-2013 Faisal Vali <faisalv@yahoo.com> This patch implements capturing of variables within generic lambdas.

Both Richard and I felt that the current wording in the working paper needed some tweaking - Please see http://llvm-reviews.chandlerc.com/D2035 for additional context and references to core-reflector messages that discuss wording tweaks.

What is implemented is what we had intended to specify in Bristol; but, recently felt that the specification might benefit from some tweaking and fleshing.

As a rough attempt to explain the semantics: If a nested lambda with a default-capture names a variable within its body, and if the enclosing full expression that contains the name of that variable is instantiation-dependent - then an enclosing lambda that is capture-ready (i.e. within a non-dependent context) must capture that variable, if all intervening nested lambdas can potentially capture that variable if they need to, and all intervening parent lambdas of the capture-ready lambda can and do capture the variable.

Of note, 'this' capturing is also currently underspecified in the working paper for generic lambdas. What is implemented here is if the set of candidate functions in a nested generic lambda includes both static and non-static member functions (regardless of viability checking - i.e. num and type of parameters/arguments) - and if all intervening nested-inner lambdas between the capture-ready lambda and the function-call containing nested lambda can capture 'this' and if all enclosing lambdas of the capture-ready lambda can capture 'this', then 'this' is speculatively captured by that capture-ready lambda.

Hopefully a paper for the C++ committee (that Richard and I had started some preliminary work on) is forthcoming.

This essentially makes generic lambdas feature complete, except for known bugs. The more prominent ones (and the ones I am currently aware of) being:
- generic lambdas and init-captures are broken - but a patch that fixes this is already in the works ...
- nested variadic expansions such as:
auto K = [](auto ... OuterArgs) {
vp([=](auto ... Is) {
decltype(OuterArgs) OA = OuterArgs;
return 0;
}(5)...);
return 0;
};
auto M = K('a', ' ', 1, " -- ", 3.14);
currently cause crashes. I think I know how to fix this (since I had done so in my initial implementation) - but it will probably take some work and back & forth with Doug and Richard.

A warm thanks to all who provided feedback - and especially to Doug Gregor and Richard Smith for their pivotal guidance: their insight and prestidigitation in such matters is boundless!

Now let's hope this commit doesn't upset the buildbot gods ;)

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194188 91177308-0d34-0410-b5e6-96231b3b80d8
STLambda.h
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
xpr.h
2dc57f42574c8b2cda72cae06c0220fd7fab8c0e 06-Nov-2013 Aaron Ballman <aaron@aaronballman.com> Work around an MSVC 2013 miscompile with the Redeclarable class. Fixes PR16606

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194176 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
eclTemplate.h
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.h
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
xpr.h
93b97a8737e867d3ea193ca46db0615f9ff73592 05-Nov-2013 James Dennett <jdennett@google.com> Documentation tweaks: Fix a typo in a reference to the C++ standard,
another typo in a comment, and update formatting of some comments to
use Doxygen \brief annotations instead of repeating the name of the
documented entity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194092 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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
eclCXX.h
ddc2a53584f91b1fdcc466f1ea1345d97c428802 31-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Store a TypeArgument on an attribute as a TypeSourceInfo*, rather than as a
QualType with a SourceLocation stashed alongside.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193803 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
eclObjC.h
e7bd89af8aa96a779c0031baf1a21e960a51d0f0 23-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> A decl never becomes unused. Make that explicit in the API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193248 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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.h
f06a2893bc9778857295c64ee32b4a899a338480 23-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules.

With this fixed, I no longer see any test regressions in the libc++ test suite
when enabling a single-module module.map for libc++ (other than issues with my
system headers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193219 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
063820655db8121f0022a7c51458463c7250324c 20-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Miscellaneous speling fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193046 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
xpr.h
tmt.h
daaabf72e77757d62bc9584927dee22968669514 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a missing getMostRecentDecl to ClassTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193040 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
eclCXX.h
eclTemplate.h
e6ddd7f610cf6caf3b5691b0f3d60e00e8c95741 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> This should use the possessive adjective.

Thanks to David Blaikie for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193037 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
edeclarable.h
eaa9035a782fe845ecef4f00029ec33baa2cb701 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Comment improvement.

Thanks to Sean Silva for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193036 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
edeclarable.h
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
ecl.h
eclBase.h
eclObjC.h
eclTemplate.h
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
ecl.h
eclCXX.h
eclObjC.h
eclTemplate.h
edeclarable.h
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
angle.h
d692a84e18fb48e6442bee83364f1d301f5b8404 16-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++ modules: merging for enumerations and enumerators with multiple definitions
(eg through template instantiations in multiple modules).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192740 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
STContext.h
ecordLayout.h
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.h
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
rettyPrinter.h
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.h
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
TableBuilder.h
877e6a6fb05660a3cc3fc24bcbef4df5e4702423 08-Oct-2013 Reid Kleckner <reid@kleckner.net> Explicitly request unsigned enum types when desired

This fixes repeated -Wmicrosoft warnings when self-hosting clang on
Windows, and gets us real unsigned enum types with MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192228 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
xpr.h
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
TableBuilder.h
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
TableBuilder.h
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.h
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
eclBase.h
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
STContext.h
ecl.h
edeclarable.h
4e49952712ff9b1b1696cb07580b2b24a3ca99e1 03-Oct-2013 Matthew Curtis <mcurtis@codeaurora.org> Gracefully (and correctly) handle init of multiple union members

We now emit warnings when doing so and code generation is consistent
with GCC. Note that the C99 spec is unclear as to the precise
behavior.

See also ...
Bug:
http://llvm.org/bugs/show_bug.cgi?id=16644 and

cfe-dev discussion:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191890 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
angle.h
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
ecursiveASTVisitor.h
tmtOpenMP.h
998c518eb1c3e4fd881a559c170cd408049721aa 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Remove an unnecessary overload from ASTLambda.h
As Richard pointed out to me, dyn_cast is very cheap - there is no real benefit from adding cluttery overloads to only avoid that cast.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191646 91177308-0d34-0410-b5e6-96231b3b80d8
STLambda.h
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
STLambda.h
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.h
3d9efecfb174a99ffd1f7a6156f7de3ca855993f 28-Sep-2013 James Dennett <jdennett@google.com> Documentation: minor fixes/improvements to documentation of DependentScopeDeclRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191622 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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
ecl.h
xprCXX.h
ecursiveASTVisitor.h
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
ecl.h
eclTemplate.h
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
angle.h
TableBuilder.h
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.h
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
STContext.h
STLambda.h
eclCXX.h
xprCXX.h
ype.h
92011d0a1bc6a77480c398f27b673be62744af4d 26-Sep-2013 Mark Lacey <mark.lacey@apple.com> Update NumTypeBits on Type to match the actual number of used bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191404 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ecursiveASTVisitor.h
tmtOpenMP.h
a41c97a5d1912ffd184381d269fd8e5a25ee5e59 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
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.h
ecursiveASTVisitor.h
60288600131c3f91bfc8ba512df9f2dd588e3308 18-Sep-2013 Hal Finkel <hfinkel@anl.gov> Remove unnecessary comment regarding AsTypeExpr base class

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190914 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
d7ae87068f1ecec5d22e197685fa7d1206afd3cf 14-Sep-2013 Michael Han <fragmentshaders@gmail.com> Fix a comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190728 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
a1ec2b0dbfd33cc3b4b7ac003a390995fc2305c6 13-Sep-2013 Jordan Rose <jordan_rose@apple.com> Fix two incorrect comments.

Patch by Jared Grubb!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4b6730d40e7c603bd0e223d3fa8b56a0c88a324a 11-Sep-2013 Michael Han <fragmentshaders@gmail.com> Teach RAV to visit parameter variable declarations of implicit functions. Fixes PR16182.

Normally RAV visits parameter variable declarations of a function by traversing the TypeLoc of
the parameter declarations. However, for implicit functions, their parameters don't have any
TypeLoc, because they are implicit.

So for implicit functions, we visit their parameter variable declarations by traversing them through
the function declaration, and visit them accordingly.

Reviewed by Richard Smith and Manuel Klimek.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190528 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
angle.h
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.h
angle.h
angleNumberingContext.h
b60fae50d38a0291e1c5731b2fb22849d26ca342 09-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++ modules: if a class is defined in multiple modules (for instance, because
it is an implicit instantiation of a class template specialization), pick the
first-loaded definition to be the canonical definition, and merge all other
definitions into it.

This is still rather incomplete -- we need to extend every form of declaration
that can appear within a CXXRecordDecl to be redeclarable if it came from an
AST file (this includes fields, enumerators, ...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190315 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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
eclContextInternals.h
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.h
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.h
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
ecursiveASTVisitor.h
tmtOpenMP.h
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.h
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
STMutationListener.h
eclBase.h
5013fcf1236980bd164ad070df298a0364e1e45f 04-Sep-2013 James Dennett <jdennett@google.com> Documentation fix: remove advice to use cast/dyn_cast on TypeLocs, updating
it to refer to castAs/getAs.

The original change to remove the (broken) cast/dyn_cast support from TypeLoc
was in r175462. (Thanks to David Blaikie for the reference.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189908 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
ecursiveASTVisitor.h
tmtOpenMP.h
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
ecursiveASTVisitor.h
tmtOpenMP.h
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
STUnresolvedSet.h
STVector.h
eclCXX.h
nresolvedSet.h
26c7dc32c7cc204b8255e4f5cbe48fbdb50ef5fa 30-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Simplify slightly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189645 91177308-0d34-0410-b5e6-96231b3b80d8
eclAccessPair.h
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
ype.h
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
STContext.h
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.h
ype.h
80434a334c92d2f24f38fbbd14acd6c3f6c72306 25-Aug-2013 Michael Han <fragmentshaders@gmail.com> Fix comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189185 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecursiveASTVisitor.h
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
STUnresolvedSet.h
ommentParser.h
nresolvedSet.h
d1282ec56231c967439c1eb67fe4afe792287911 23-Aug-2013 David Majnemer <david.majnemer@gmail.com> Sema: Properly support Microsoft-mode template arguments

Summary:
There were two things known to be wrong with our implementation of MSVC
mode template arguments:

- We didn't properly handle __uuidof/CXXUuidofExpr and skipped all type
checking completely.
- We didn't allow for MSVC's extension of allowing certain constant
"foldable" expressions from showing up in template arguments.
They allow various casts dereference and address-of operations.
We can make it more general as we find further peculiarities but this
is the known extent.

Reviewers: rsmith, doug.gregor, rjmccall

Reviewed By: doug.gregor

CC: cfe-commits, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189087 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
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.h
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.h
eclCXX.h
xprCXX.h
ype.h
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
xpr.h
xprCXX.h
ype.h
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.h
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.h
tmtCXX.h
tmtObjC.h
tmtOpenMP.h
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.h
xprObjC.h
ype.h
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.h
eclCXX.h
xprCXX.h
ype.h
567f917df048d42732997a479b2b257403fc88ef 22-Aug-2013 Larisse Voufo <lvoufo@google.com> Refactor for clarity and simplicity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188974 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
b1e588cab9200aadf56d0098e07c37bf84604e6c 21-Aug-2013 Craig Topper <craig.topper@gmail.com> Revert accidental commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188861 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtCXX.h
tmtObjC.h
tmtOpenMP.h
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.h
tmtCXX.h
tmtObjC.h
tmtOpenMP.h
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.h
tmtCXX.h
tmtObjC.h
tmtOpenMP.h
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.h
tmtCXX.h
tmtObjC.h
tmtOpenMP.h
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.h
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.h
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.h
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.h
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
STVector.h
xpr.h
tmt.h
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
xprCXX.h
dd9459f8869f66409f7ea429053b453e33f6499c 13-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

- Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
set of cases, and make it track whether it found a shadowed declaration.
- Track whether we found a declaration in the same scope (for C++) including
across serialization and template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188307 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
ecursiveASTVisitor.h
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.h
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
eclCXX.h
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.h
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
a7b879723d3989d85b9492fd8218e7d745367fe3 07-Aug-2013 Jordan Rose <jordan_rose@apple.com> Eliminate CXXConstructorDecl::IsImplicitlyDefined.

This field is just IsDefaulted && !IsDeleted; in all places it's used,
a simple check for isDefaulted() is superior anyway, and we were forgetting
to set it in a few cases.

Also eliminate CXXDestructorDecl::IsImplicitlyDefined, for the same reasons.

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187891 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
3151b7c6dd49947b0a91b3e22c31f4864629e355 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Fixing commit r187768: Moved diagnosis of forward declarations of variable templates from Parser to Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187770 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
06935f32645c8965e398bbd141f9800eacdfd439 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Moved diagnosis of forward declarations of variable templates from Parser to Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187768 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
70ed2db10ca6f5e5556e1ca09bb35aa116b26a7f 06-Aug-2013 NAKAMURA Takumi <geek4civic@gmail.com> AST/DeclTemplate.h: Possibly fix a warning. [-Wuninitialized]

FIXME: Would '0' be an appropriate value in SequenceNumber?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187766 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
STMutationListener.h
ecl.h
eclTemplate.h
ecursiveASTVisitor.h
6f4f8083931a92f9959168d4430da7ddf9183100 03-Aug-2013 Craig Topper <craig.topper@gmail.com> Add support for passing -1 to __builtin_shufflevector to signify an undefined element value to match IR capabilities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187694 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1888b910a5512262228e785cc9caf90296c06a45 02-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> When merging redeclaration chains across modules, if a declaration is visible
in one module but is only declared as a friend in another module, keep it
visible in the result of the merge.

This is incomplete on two axes:

1) Our handling of local extern declarations is basically broken (we put them
in the wrong decl context, and don't find them in redeclaration lookup, unless
they've previously been declared), and this results in them making friends
visible after a merge.

2) Eventually we'll need to mark that this has happened, and more carefully
check whether a declaration should be visible if it was only visible in some
of the modules in which it was declared. Fortunately it's rare for the
identifier namespace of a declaration to change along its redeclaration chain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187639 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
TableBuilder.h
1652ed1cd2cb63e0d0cb74c67a40d9dc5cab6b89 26-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Tighten type-checking for vector attributes.

Based on patch by Yunzhong Gao.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187176 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b775100fea6d8955149897dae1adca50ca471d17 26-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> When we perform dependent name lookup during template instantiation, it's not
sufficient to only consider names visible at the point of instantiation,
because that may not include names that were visible when the template was
defined. More generally, if the instantiation backtrace goes through a module
M, then every declaration visible within M should be available to the
instantiation. Any of those declarations might be part of the interface that M
intended to export to a template that it instantiates.

The fix here has two parts:

1) If we find a non-visible declaration during name lookup during template
instantiation, check whether the declaration was visible from the defining
module of all entities on the active template instantiation stack. The defining
module is not the owning module in all cases: we look at the module in which a
template was defined, not the module in which it was first instantiated.

2) Perform pending instantiations at the end of a module, not at the end of the
translation unit. This is general goodness, since it significantly cuts down
the amount of redundant work that is performed in every TU importing a module,
and also implicitly adds the module containing the point of instantiation to
the set of modules checked for declarations in a lookup within a template
instantiation.

There's a known issue here with template instantiations performed while
building a module, if additional imports are added later on. I'll fix that
in a subsequent commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187167 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
6e673f8f2412437b83b57a4abdb2c06974bad0bd 23-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Removed useless source loc field in UnresolvedUsingTypenameDecl node.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186974 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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
valuatedExprVisitor.h
xpr.h
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.h
5806bb59d2d19a9b32b739589865d8bb1e2627c5 19-Jul-2013 NAKAMURA Takumi <geek4civic@gmail.com> StmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [-Wdocumentation]

- /// \param Clauses A list of clauses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186665 91177308-0d34-0410-b5e6-96231b3b80d8
tmtOpenMP.h
7a8918fe69d419c41956a7245874b0196e03127b 19-Jul-2013 NAKAMURA Takumi <geek4civic@gmail.com> StmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186664 91177308-0d34-0410-b5e6-96231b3b80d8
tmtOpenMP.h
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
ecursiveASTVisitor.h
tmtOpenMP.h
tmtVisitor.h
22050f25e34ba0cd21ee2dc3d765951c48e27cde 18-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186546 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
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.h
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
STFwd.h
STTypeTraits.h
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.h
52c2575fc77a51f36129be89d1a0a90e31617a57 15-Jul-2013 Chandler Carruth <chandlerc@gmail.com> Re-revert r86040, which was un-reverted in r186199.

This breaks the build of basic patterns with repeated friend
declarations. See the added test case in SemaCXX/friend.cpp or the test
case reported to the original commit log.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186331 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
ace21ba7ba8a834a711154d8d1f29c12568dbc54 14-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> If an unimported submodule of an imported module contains a declaration of a
global allocation or deallocation function, that should not cause that global
allocation or deallocation function to become unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186270 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e33a0a84a128db0e063d9a0a7a4b899a8a2989de 14-Jul-2013 David Blaikie <dblaikie@gmail.com> Serialization support for TagDecl::IsCompleteDefinitionRequired

Requested by Richard Smith in post-commit review of r186262

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186266 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
45a0409e024334ccf2d326d3094a5d5c42dd2463 14-Jul-2013 David Blaikie <dblaikie@gmail.com> Initialize the "IsCompleteDefinitionRequired" field in the ASTContext ctor

Introduced in r186262 & found by the hexagon buildbots (but owing to
this being UB, that's random chance - so there's no additional test case
here)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186265 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
658cd2c287b1a0b419f51cd18e5a48d4560d1c56 13-Jul-2013 David Blaikie <dblaikie@gmail.com> PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to emit the full definition of a type in -flimit-debug-info

This simplifies the core benefit of -flimit-debug-info by taking a more
systematic approach to avoid emitting debug info definitions for types
that only require declarations. The previous ad-hoc approach (3 cases
removed in this patch) had many holes.

The general approach (adding a bit to TagDecl and callback through
ASTConsumer) has been discussed with Richard Smith - though always open
to revision.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186262 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
ecl.h
226399ce18cdcbb1e83af7c5e644bdabb9d4f2f8 13-Jul-2013 David Blaikie <dblaikie@gmail.com> Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT

Test coverage for non-dependent pack expansions doesn't demonstrate a
failure prior to this patch (a follow-up commit improving debug info
will cover this commit specifically) but covers a related hole in our
test coverage.

Reviewed by Richard Smith & Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186261 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ypeNodes.def
f475bf83a45435a211edb4e0ef6ac3481ce7b3fe 13-Jul-2013 David Blaikie <dblaikie@gmail.com> Revert "Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile""

This reverts commit b18b043a5a37f76803d89467e46bcac286c0ecae.

Reapply with fix for the configure+make build (missing include of
ASTContext.h).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186257 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
65732a200987cb4b007fbb3015a8bae175ddb832 13-Jul-2013 David Blaikie <dblaikie@gmail.com> Revert "PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile"

This reverts commit r186253.

This is failing to link under Configure+Make on the buildbots for
reasons I don't immediately understand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186255 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
a995630ca94ca2543678b201d90cf6f07d41a8df 13-Jul-2013 David Blaikie <dblaikie@gmail.com> PR16540: ASTVector::insert(Context, Iter, Element) doesn't compile

Fix some uninstantiable code in ASTVector::insert. I've added a
cheap-and-dirty compile test for this, because I don't have the time to
figure out a nice way to get a real ASTContext to implement executable
tests - but we probably should have them for this ADT.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186253 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
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.h
f9e65a274d4e5c5a45503efc81da43be76503983 12-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r186040, reverted in r186185, with fix for PR16597.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186199 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
1afa611e36e0ab23dd3cde4bbe5aa74ceb7d77c5 12-Jul-2013 Chandler Carruth <chandlerc@gmail.com> Revert r186040 to fix PR16597 while Richard investigates what the best
fix is.

Original commit log:
If we friend a declaration twice, that should not make it visible to
name lookup in the surrounding context. Slightly rework how we handle
friend declarations to inherit the visibility of the prior
declaration, rather than setting a friend declaration to be visible
whenever there was a prior declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186185 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
cf2901abf346c64792e3beb1e7dfeecff0b313f7 12-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make CXXBaseSpecifier::getType return unqual type.

Various pieces of code, like base initialization in Sema and RTTI IRGen,
don't properly ignore qualifiers on base classes. Instead of auditing the
whole codebase, just strip them off in the getter. (The type as written is
still available in the TypeSourceInfo for code that cares.)

Fixes PR16596.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186125 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
fd5c726ab3db60d3e1be8348f6f03bb3e04ffdde 11-Jul-2013 James Dennett <jdennett@google.com> Documentation fixes - the rest of DeclCXX.h:
* More \brief additions/fixes;
* Fix some misleading comments about C++11's explicit conversion operators;
* Mark up some \code examples;
* Add \file documentation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186059 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
2c4b9bd6c58118a40d4a80c0e2fe61038f5d9f5f 11-Jul-2013 James Dennett <jdennett@google.com> Documentation cleanup for DeclCXX.h:
* Fixing up \brief summaries (adding some, making some briefer);
* Standardizing on \commands, not @commands;
* Update C++0x references to C++11;
* Fix typos and Doxygen warnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186056 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
433a13d0cdb1c48b828fe5bfb6a835c58e1e758b 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> If we friend a declaration twice, that should not make it visible to name
lookup in the surrounding context. Slightly rework how we handle friend
declarations to inherit the visibility of the prior declaration, rather
than setting a friend declaration to be visible whenever there was a prior
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186040 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
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.h
49007d7561212c0ae168702c1af1404c01ef43ff 10-Jul-2013 James Dennett <jdennett@google.com> Add a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors to
use/maintain additional state from the LambdaExpr while visiting the body
of a LambdaExpr.

One use for this arises because Clang's AST currently holds lambda bodies
in a form prior to their adjustment to refer to captured copies of local
variables, and so some clients will need access to the lambda's closure
type in order to query how to map VarDecl*s to the FieldDecls of their
by-copy captures. This hook is sufficient for at least one such client;
to do this without such a hook would require the client to re-implement
the whole of TraverseLambdaExpr, which is non-trivial and would likely be
more brittle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186024 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
angleNumberingContext.h
80747a834cf8b0304b314ede9aba3d6ddb8e9520 08-Jul-2013 NAKAMURA Takumi <geek4civic@gmail.com> clang/include/clang/AST/ExprCXX.h:260:5: Fix a warning -- unknown command tag name 'cc'; did you mean 'c'? [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185810 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
010bfc253050626435f006386c0bee4b55329687 08-Jul-2013 James Dennett <jdennett@google.com> Documentation cleanup for include/clang/AST/ExprCXX.h.

This is mostly Doxygen formatting, but also updates some C++0x references
to C++11 and clarifies some wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185798 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
bd9cbd22b832ce65a085801259cf2d3df77830e4 07-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed source range for functional cast and unresolved construct expr nodes.
Added testcases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185773 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
251330d5ad22a5d7c813dfdd5bed54fafbdeebad 07-Jul-2013 James Dennett <jdennett@google.com> Documentation cleanup for include/clang/AST/DeclCXX.h, no substantive changes.
* Fix up \brief documentation;
* Update C++0x references to C++11;
* Doxygen formatting: bulleted lists start with a single hyphen, not two;
* Fix a typo, "assosiate" -> "associate".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185771 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
c65f03498f6c59b5ae5c14086f49ae6e7a173624 05-Jul-2013 James Dennett <jdennett@google.com> Add some more documentation on how to navigate from a LambdaExpr::Capture
to the associated FieldDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185674 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
xprCXX.h
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
XXInheritance.h
ddcd660efccd7dcbe42cf1a5759b37ee5619bf9b 02-Jul-2013 James Dennett <jdennett@google.com> Documentation: Update docs for C++ lambdas to more accurately reflect
C++1y init-capture support, and to improve some Doxygen markup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185469 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
ecl.h
ambdaMangleContext.h
angleNumberingContext.h
1f26342b5f51387aaa18ee703d7dfdf004871466 30-Jun-2013 James Dennett <jdennett@google.com> Documentation cleanup for TypeOrdering.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185293 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
1ec5750908039701b206fc32dd2b95c45cd5cce8 30-Jun-2013 James Dennett <jdennett@google.com> Documentation cleanup: Mostly formatting \brief documentation, also fix a
typo or two.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185288 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
TTBuilder.h
TableBuilder.h
89faf86c6e23ed62519dfe369f8ea408df1cb02e 30-Jun-2013 James Dennett <jdennett@google.com> Bug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr call
WalkUpFromLambdaExpr, so that the Visit* functions are called
on that AST node.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185277 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
eclBase.h
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.h
tmt.h
ype.h
TableBuilder.h
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.h
642038d7c5855b54afbca298631da93b7889d4a5 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185053 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7841abf94eb8653b26aa8d5bf67f4ad0ff074767 26-Jun-2013 David Majnemer <david.majnemer@gmail.com> AST: small cleanup to FriendObjectKind


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185021 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
de2541aec4b4440ee34af29eba622df7cab9ac12 26-Jun-2013 Aaron Ballman <aaron@aaronballman.com> Quieting an MSVC warning about converting negative integer constants to unsigned types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184941 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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.h
eclFriend.h
9db7f57c1e3db8a2d06a833a4e0341f0fe310640 25-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix deserializing of class template partial specializations. Assign sequence
numbers as we deserialize class template partial specializations. We can't
assume that the old sequence numbers will work.

The sequence numbers are still deterministic, but are now a lot less
predictable for class template partial specializations in modules/PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184811 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
cd9c2f247dd354d8bb5f549f986a9c4ccf08f1db 24-Jun-2013 Reid Kleckner <reid@kleckner.net> Fix "funciton" typo from r184763

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184779 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
ecl.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ommentSema.h
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
eclBase.h
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.h
6969e43b14a91124b98e4b0bd4d34a736123fe0b 24-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
so that -Wdocumentation-unknown-command does not warn on these commands.
Fixes PR16092.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184676 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
2946cebdf49d3a6eeba8df93be291a07b2d58cbc 23-Jun-2013 David Majnemer <david.majnemer@gmail.com> AST: Clean up FriendObjectKind related decls

Allow the comments in the FriendObjectKind enumerator-list show up in
doxygen. Also, some small readability improvements in related functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184657 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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
eclBase.h
eclLookups.h
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.h
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.h
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
ecl.h
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.h
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
STFwd.h
STTypeTraits.h
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.h
054d049174eb1ec8e93a4a0831c0d8caac00cb3a 19-Jun-2013 Manuel Klimek <klimek@google.com> Completely revamp node binding for AST matchers.

This is in preparation for the backwards references to bound
nodes, which will expose a lot more about how matches occur. Main
changes:
- instead of building the tree of bound nodes, we build a "set" of bound
nodes and explode all possible match combinations while running
through the matchers; this will allow us to also implement matchers
that filter down the current set of matches, like "equalsBoundNode"
- take the set of bound nodes at the start of the match into
consideration when doing memoization; as part of that, reevaluated
that memoization gives us benefits that are large enough (it still
does - the effect on common match patterns is up to an order of
magnitude)
- reset the bound nodes when a node does not match, thus never leaking
information from partial sub-matcher matches for failing matchers

Effects:
- we can now correctly "explode" combinatorial matches, for example:
allOf(forEachDescendant(...bind("a")),
forEachDescendant(...bind("b"))) will now trigger matches for all
combinations of matching "a" and "b"s.
- we now never expose bound nodes from partial matches in matchers that
did not match in the end - this fixes a long-standing issue

FIXMEs:
- rename BoundNodesTreeBuilder to BoundNodesBuilder or
BoundNodesSetBuilder, as we don't build a tree any more; this is out
of scope for this change, though
- we're seeing some performance regressions (around 10%), but I expect
some performance tuning will get that back, and it's easily worth
the increase in expressiveness for now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184313 91177308-0d34-0410-b5e6-96231b3b80d8
STTypeTraits.h
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
angle.h
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.h
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.h
6b96742ceedebb5eb8f1299ab67cb3ecd6d92aaf 17-Jun-2013 Reid Kleckner <reid@kleckner.net> Try to fix the bots with a forward decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184077 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
3bf68059002e67e393f3e89261f31506be223ca5 14-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix comments referring to non-existent types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184007 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a438e68ad7da48e7e4903785e5e96732abcdadfb 13-Jun-2013 Manuel Klimek <klimek@google.com> Make it clear in Decl::hasBody that it can return true on redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183896 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
xprCXX.h
ecursiveASTVisitor.h
tmt.h
2049840b0ffe8ee4bf39051cfa8ca08440c8f667 12-Jun-2013 Stephen Hines <srhines@google.com> Merge commit '1342a4ef62dd7b839c6f09348b246a4f00282f29' into merge_20130612
605c59a1d1a11112c643031770c616e2e441c349 11-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Make ASTContext::Allocate use size_t for the size argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183757 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
ecl.h
xprCXX.h
tmt.h
a7ff62f9443efa3b13a28a1e566d4625b15b8553 04-Jun-2013 Aaron Ballman <aaron@aaronballman.com> Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183178 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
16b0a310f5649d25849d84409841f401e7a9a0e5 03-Jun-2013 David Blaikie <dblaikie@gmail.com> UnresolvedMemberExpr should have an expr location of the member (not the base)

This matches the behavior of MemberExpr and makes diagnostics such as
"reference to non-static member function must be called" more legible in
the case that the base & member are split over multiple lines (prior to
this change the diagnostic would point to the base, not the member -
making it very unclear in chained multi-line builder-style calls)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183149 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
STContext.h
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.h
c1d73fe9f44d302951f81b06271647c227c2a3e8 30-May-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix typo in comment.

Found by -Wdocumentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182934 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
da8d379f1e58af98640c2df222ec0161ff913941 30-May-2013 Serge Pavlov <sepavloff@gmail.com> Fixed typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182927 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
34bd3bf4996cf0941e3cdfde07d97f6b3d54070d 30-May-2013 Serge Pavlov <sepavloff@gmail.com> Added documentation to TypeVisitor. No code changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182911 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
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.h
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.h
eclBase.h
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.h
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.h
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.h
eclBase.h
ype.h
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
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
xprCXX.h
ecursiveASTVisitor.h
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
anonicalType.h
eclFriend.h
eclObjC.h
eclarationName.h
xprCXX.h
xternalASTSource.h
estedNameSpecifier.h
tmtIterator.h
ype.h
ypeLoc.h
2a3c9664b826963a294b0e07141baad9517d402b 15-May-2013 Aaron Ballman <aaron@aaronballman.com> Unbreaking the MSVC build by adding an include. It broke with r181832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181853 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ecl.h
eclarationName.h
a3d813a8c292bee8349ef43065dab9b344650351 14-May-2013 Reid Kleckner <reid@kleckner.net> Fix copy-pasto in naming of LAST_MS_INHERITANCE[_ATTR]

Richard Smith pointed this out over a month ago.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181830 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
7e17fdc617ee9db8270f3f6fb4ecd392fed47d80 13-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix a wrong and confusing comment in CharUnits.h. Neither C nor C++ allows
bytes and character units to be different sizes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181730 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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.h
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
ecl.h
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
tmt.h
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
STMutationListener.h
9cbcab88d441761b5c5d7811c4d0c205250991bf 10-May-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Avoid patching storage class for block scope thread_local variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181627 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
rettyPrinter.h
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.h
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
lobalDecl.h
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.h
3190ca922d3743137e15fe0c525c04b177b9983b 08-May-2013 Reid Kleckner <reid@kleckner.net> Forward #pragma comment(lib/linker) through as flags metadata

Summary:
Most of this change is wiring the pragma all the way through from the
lexer, parser, and sema to codegen. I considered adding a Decl AST node
for this, but it seemed too heavyweight.

Mach-O already uses a metadata flag called "Linker Options" to do this
kind of auto-linking. This change follows that pattern.

LLVM knows how to forward the "Linker Options" metadata into the COFF
.drectve section where these flags belong. ELF support is not
implemented, but possible.

This is related to auto-linking, which is http://llvm.org/PR13016.

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181426 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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
xpr.h
xprObjC.h
1270673bf5208a140b397419c8c34e7bdcce2339 06-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Have the RecursiveASTVisitor traverse the type source info of an objc class message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181237 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
eclBase.h
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
eclFriend.h
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
rettyPrinter.h
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
ecl.h
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.h
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.h
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.h
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.h
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
eclObjC.h
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.h
tmt.h
0f2fc5ff49cb9abd6c6972ffd6db066295672867 03-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15906: The body of a lambda is not an evaluated subexpression; don't visit it when visiting such subexpressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181046 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
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.h
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
eclObjC.h
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
rettyPrinter.h
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.h
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.h
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
STContext.h
ype.h
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
ype.h
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.h
ype.h
ypeNodes.def
3a2f91280a49f4747063f983dc6a3296bd9359d2 29-Apr-2013 Ben Langmuir <ben.langmuir@intel.com> Small CapturedStmt improvements

Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get
to the CapturedRegionKind enum. This also allows codegen to access this enum
without including Sema/ScopeInfo.h.

Also removes some duplicated code for capturing 'this' between CapturedStmt and
Lambda.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180710 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
ype.h
4f1d1551ed48e2ac52f5614ba8f94e2931546b51 26-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Use bitfilds.

On a 32 bit build this moves LinkageSpecDecl from 52 to 48 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180601 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclCXX.h
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.h
a2338bc4c2887937478d302901fb41a53e14e6d6 25-Apr-2013 Anna Zaks <ganna@apple.com> Fix a possible null pointer dereference found by the analyzer.

When computing the other parameters, ‘op’ is checked for being null before it’s dereferenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180271 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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
ype.h
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.h
xprCXX.h
ecursiveASTVisitor.h
59d6a71d681adfdc7d976492eeb3deae84e8f2e2 19-Apr-2013 Adrian Prantl <aprantl@apple.com> Emit the underlying type in the debug info for all kinds of fixed enums
instead of only C++11-scoped-with-class-tag enums.

rdar://problem/13463793

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179879 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
fc7227e4c27aa8af33b5384b281d1eecfc74858a 19-Apr-2013 Adrian Prantl <aprantl@apple.com> s/C++0x/C++11/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179878 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
angle.h
4d6bc1884447a7e5b3c2def09bd307c96e44241e 18-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Adds a new doxygen tag needed. // rdar://12379053


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179770 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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.h
eclBase.h
ecursiveASTVisitor.h
tmt.h
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
ecursiveASTVisitor.h
tmt.h
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
eclCXX.h
xprCXX.h
ecursiveASTVisitor.h
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.h
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.h
d09615fcc03d177a59478d7d6e90a034a4d2a879 15-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment command table: use inheritance instead of duplicating code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179501 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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
ecl.h
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.h
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
eclCXX.h
ype.h
75dbdfa6f80bf6b35d858b6557e9fbb2854e2ba0 11-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing. Add couple more needed doxygen tags.
// rdar://12379053


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179238 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
0e7f2bb1810a4e5e62a8e247460cd26f981d0827 10-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> -fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179204 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.h
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
awCommentList.h
1bd077b84b46e0e6c0af02298ff184b850c0bb3c 08-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> fixes a typo in my last patch.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179042 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
cac9ee0b129b8d8d4088ecf5068202886850aa2c 08-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> doce parsing: adding few more headerdoc tags.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179039 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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
STUnresolvedSet.h
eclBase.h
5238e40f6ea6346b6bc1505e4975c2c4ab7fde09 05-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> doce parsing: adding few more headerdoc tags.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178903 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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.h
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.h
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.h
5b8d0af4234252b38229a5bae1d615ac9769f73f 04-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert accidental commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178707 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
4382867f04549f9bfcd33a08342f4f74ab13841c 04-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Pare back r164351 somewhat. The problem that change was addressing was that we
don't serialize a lookup map for the translation unit outside C++ mode, so we
can't tell when lookup within the TU needs to look within modules. Only apply
the fix outside C++ mode, and only to the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178706 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
d4582b8e6d056f5d991f1b8372e89a6aae58feae 03-Apr-2013 Jordan Rose <jordan_rose@apple.com> Escape more @ signs in Doxygen comments.

Doxygen treats "@command" the same as "\command" in a doc comment, so
whenever we talk about Objective-C things like "@interface" we have to
make sure to escape them.

Let's try to keep Clang -Wdocumentation-clean!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178603 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.h
eclBase.h
xprObjC.h
58b65d953e67251bfce28a5251bb3b496490f343 02-Apr-2013 Stefanus Du Toit <stefanus.du.toit@intel.com> Update assertion string to new name of ArithAssignBinaryOperator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178572 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0c70181854a95fca0e0d56dfa1203eb2216052ea 02-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit hints when warning
about 'isa' ivar being explicitely accessed
when base is a user class object reference.
// rdar://13503456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178562 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
ype.h
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
eclCXX.h
ype.h
9f8bd33a1c125fdf825681c61f8170c4424f6616 31-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove unused default values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178435 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ec8deba768e7ba93ad9974763dc3902896924a3c 28-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit suggestions when class object
is accessed via accessing 'isa' ivar to use
object_getClass/object_setClass apis.
// rdar://13503456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178282 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
94cf910ac2d1719c1dfc163bbec3953f12efdf6f 28-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> These are all simple pointer wrappers. Pass them by value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178247 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ype.h
e81fdb1fdde48d3fa18df56c5797f6b0bc5dfc4a 27-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Cleanup clang's specializations of simplify_type.

Now that the basic implementation in llvm has been fixed, simplify the
specializations in clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178173 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
eclCXX.h
ype.h
d560ce3b66325ff22cd3aca23c6de3143bd74d24 27-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Preprocessor] Remove PPMutationListener.

It's not used anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178106 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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
ttr.h
8569281fb7ce9b5ca164a0528b876acbb45eb989 23-Mar-2013 Jordan Rose <jordan_rose@apple.com> Add reverseComparisonOp and negateComparisonOp to BinaryOperator.

...and adopt them in the analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177802 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
eclOpenMP.h
eclVisitor.h
ecursiveASTVisitor.h
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.h
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
ommentCommands.td
07b0fdcee8d64222b274779d02851cc53d18e0db 18-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Bring inheriting constructor implementation up-to-date with current defect
reports, and implement implicit definition of inheriting constructors.
Remaining missing features: inheriting constructor templates, implicit
exception specifications for inheriting constructors, inheriting constructors
from dependent bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177320 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
74c8b794be93e73ffca42b1dcf70f26c92d9ccfd 18-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> ObjCDictionaryElements are pod-like.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177282 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
e462c60ac3365d3302b7d0a566c5cb7dbe0e5ae3 15-Mar-2013 Eric Christopher <echristo@gmail.com> Silence anonymous type in anonymous union warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177133 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
eclarationName.h
ependentDiagnostic.h
xpr.h
emplateBase.h
emplateName.h
8f0d1f053f3acadec28a2b1c0b6a714ad5a12aab 14-Mar-2013 Chandler Carruth <chandlerc@gmail.com> Fix an unused variable warning from Clang by sinking a dyn_cast into an
isa and a cast inside the assert. The efficiency concern isn't really
important here. The code should likely be cleaned up a bit more,
especially getting a message into the assert.

Please review Rafael.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177053 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ype.h
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.h
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
ommentCommandTraits.h
ommentCommands.td
ommentSema.h
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.h
ype.h
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
ommentCommandTraits.h
ommentCommands.td
ommentSema.h
372fe788f8ea815071d0ddffe46dd3abc397106e 07-Mar-2013 John McCall <rjmccall@apple.com> Add CharUnits::alignmentAtOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176655 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
cf048a80ed610262fd634d421ea65ff936901b36 07-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't duplicate function names. Thanks to Jordan Rose for pointing it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176609 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
531db82c6ecfb4772c6870731c06ad8718f1e0ce 07-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a hasExternalLinkage helper. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176607 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
58bd77f6132e56dbf7659b1c436ba20b973e6ef9 07-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176603 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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
ommentCommands.td
ommentSema.h
41f3f3a4792f46787632fdb94f952f6b3ce3f4ae 05-Mar-2013 Jordan Rose <jordan_rose@apple.com> Silence a number of static analyzer warnings with assertions and such.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176469 91177308-0d34-0410-b5e6-96231b3b80d8
ttrIterator.h
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
ommentCommandTraits.h
ommentCommands.td
ommentSema.h
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
omment.h
ommentLexer.h
ommentSema.h
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
omment.h
ommentLexer.h
ommentParser.h
ommentSema.h
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
omment.h
ommentLexer.h
8ddfb0b72d0e439d01759c1bc7a79ba73dd2830c 28-Feb-2013 Manuel Klimek <klimek@google.com> Fix a problem where 'clang' is ambiguous in MSVC builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176275 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
ff9a01000ff74a994aa3da26ea2ec732c97291b7 28-Feb-2013 Manuel Klimek <klimek@google.com> First step towards adding a parent map to the ASTContext.

This does not yet implement the LimitNode approach discussed.

The impact of this is an O(n) in the number of nodes in the AST
reduction of complexity for certain kinds of matchers (as otherwise the
parent map gets recreated for every new MatchFinder).

See FIXMEs in the comments for the direction of future work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176251 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
STTypeTraits.h
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.h
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.h
ype.h
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
ype.h
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.h
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.h
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.h
9db0fe97f533513f88e7141f0b2a405ebe86fa67 26-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> doxygen command. Add 'attention' command to list of similar
doxygen commands. // rdar://12379053


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176127 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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.h
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.h
c4cca7b2408bdfd99ea0f63fec1421c1327593b2 23-Feb-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Remove data member MSAsmStmt::AsmLoc, wrongly hiding AsmStmt::AsmLoc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175963 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
884f0a752baa5f2a4561dd73588476b8b84418b3 23-Feb-2013 NAKAMURA Takumi <geek4civic@gmail.com> clang/AST/Decl.h: Add "raw_ostream.h" to appease msvc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175952 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ype.h
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.h
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
ype.h
f512acee01617c9da8079ed88ded3bb9f2418349 22-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Replace some typically large vectors with SmallVector.

This may seem counter-intuitive but the POD-like optimization helps when the
vectors grow into multimegabyte buffers. SmallVector calls realloc which knows
how to twiddle virtual memory bits and avoids large copies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175906 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
ecursiveASTVisitor.h
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
ecl.h
eclTemplate.h
ype.h
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
ommentCommandTraits.h
f6565a9f7318b1ca6ea9510003dde7b89696daab 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Handle alignas(foo...) pack expansions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175875 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
eclCXX.h
eclTemplate.h
0adb17502365b56dca99bfa971c59514ece54877 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Avoid implicit conversions of Optional<T> to bool.

This is a precursor to making Optional<T>'s operator bool 'explicit' when
building Clang & LLVM as C++11.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175722 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
xprCXX.h
xprObjC.h
ype.h
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.h
e2e1fa27e2533410f744137b0db1bc9491543392 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Mark unimplemented function with LLVM_DELETED_FUNCTION

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175695 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
464011827c5f9047caaba7e245556d66a65a15b6 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Doxycomment SVal's getAs/castAs.

Also document TypeLoc's operations similarly, since it's a good idea.

Post-commit CR feedback from Anna Zaks regarding r175594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175694 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
ecl.h
xprCXX.h
xprObjC.h
SAPI.h
emplateBase.h
ype.h
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.h
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
ecursiveASTVisitor.h
ypeLoc.h
ypeLocVisitor.h
91d243b6011ed74f6d3a446b1b792f6c11475ee4 18-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add include guards for CommentVisitor.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175451 91177308-0d34-0410-b5e6-96231b3b80d8
ommentVisitor.h
0076ea62c2da91121bca6d402da67f0b611fc8bb 16-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove unused forward declarations

clang/AST/Decl.h is included to see the TypeSourceInfo definition anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175332 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
eclTemplate.h
emplateBase.h
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.h
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.h
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
eclTemplate.h
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.h
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.h
eclBase.h
63a9514a2330b144575a136e38875193760126f7 12-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove an assert which triggers when a decl context in a module hits the 'has
lexical storage but not visible storage' case in C++. It's unclear whether we
even need the special-case handling for C++, since it seems to be working
around our not serializing a lookup table for the TU in C. But in any case,
the assertion is incorrect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174931 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
223f0ff6a9a5d0eaf63b98b3aa92888b4c088868 09-Feb-2013 Jordan Rose <jordan_rose@apple.com> Remove some stray uses of <ctype.h> functions.

These are causing assertions on some MSVC builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174805 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
eclBase.h
eclObjC.h
xternalASTSource.h
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.h
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.h
uiltinTypes.def
ype.h
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.h
eclContextInternals.h
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
xternalASTSource.h
5846720f08a6b225484bfe663599c2b057a99bc8 05-Feb-2013 Ted Kremenek <kremenek@apple.com> Change subexpressions to be visited in the CFG from left-to-right.

This is a more natural order of evaluation, and it is very important
for visualization in the static analyzer. Within Xcode, the arrows
will not jump from right to left, which looks very visually jarring.
It also provides a more natural location for dataflow-based diagnostics.

Along the way, we found a case in the analyzer diagnostics where we
needed to indicate that a variable was "captured" by a block.

-fsyntax-only timings on sqlite3.c show no visible performance change,
although this is just one test case.

Fixes <rdar://problem/13016513>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174447 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
eclTemplate.h
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.h
54596b99c9ae43554284eb16a9ca7c23a666b261 01-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Unbreak Makefile build after r174216


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174217 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
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
ommentCommandTraits.h
ommentCommands.td
akefile
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
eclVisitor.h
xpr.h
e1ebedf46e2a08635d08da093c31100e95ea9875 01-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add more comments to CommentCommands.td

I hope the ASCII art delimiters are OK, since they group *groups* of commands --
that is really helpful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174114 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
17d15f3c3dad45f6df8034c9ea3e3c8ff466076c 01-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Escape backslash in the comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174112 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.h
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
ommentCommandTraits.h
ommentCommands.td
ommentSema.h
903ef044e5fe8efe5d06f63945f903ae81a262fd 31-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r174043 and tweak the comment wording so I'm (hopefully) not confused by it again!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174053 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
5917e2200106b6be70c2663824aec0ab6b1b1955 31-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove incorrect warning signs from QualType::getUnqualifiedType(). These
statements were only true for 65 CLs after they were introduced two years ago.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174043 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ommentHTMLNamedCharacterReferences.td
ommentLexer.h
akefile
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.h
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
eclCXX.h
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.h
7d9f07732b85f1b2989c640065512a6af9a0f49a 26-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Constify getOptionalExplicitTemplateArgs()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173575 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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
omment.h
eclBase.h
tmt.h
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.h
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.h
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.h
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.h
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
xpr.h
51d8c52ad36129760eaa586f85176037e2cd0d0e 24-Jan-2013 Michael Han <fragmentshaders@gmail.com> PR14922: when printing an attribute, use the real syntax of the attribute (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax.

Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td.
This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute.
When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and
name, then passed to Attr that will use the index to print itself.

Thanks to Richard Smith for the idea and review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173358 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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.h
tmt.h
15bb58edc9d053aa49c28167deb41ff0409ddabc 21-Jan-2013 Stephen Hines <srhines@google.com> Merge commit 'd130fd2e141f1fef412c2d58e7385370801bd718' into merge-llvm

Conflicts:
lib/Basic/Targets.cpp

Change-Id: I90a669a33ffe4de8b32c8459016fd0b2a55da0ad
6de6aab8248ef67d3a65018d4ad26f51ac35b3d3 21-Jan-2013 NAKAMURA Takumi <geek4civic@gmail.com> AST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173041 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.h
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.h
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.h
uiltinTypes.def
perationKinds.h
ype.h
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
valuatedExprVisitor.h
xpr.h
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.h
ype.h
6c3af3d0e3e65bcbca57bfd458d684941f6d0531 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn on
expressions which have undefined behavior due to multiple unsequenced
modifications or an unsequenced modification and use of a variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172690 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
1c2397539d1b105eacee2a69ece4775d0af45618 17-Jan-2013 Matt Beaumont-Gay <matthewbg@google.com> Fix a typo introduced in r172665.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172682 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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
eclObjC.h
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
ttr.h
omment.h
ecl.h
eclBase.h
eclTemplate.h
xpr.h
xprCXX.h
xprObjC.h
ambdaMangleContext.h
tmt.h
tmtCXX.h
9946fc735d7285f2195f89635370f534afd9877e 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Add missing includes and forward declarations so that headers don't depend on
other headers included before them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172320 91177308-0d34-0410-b5e6-96231b3b80d8
eclLookups.h
tmtCXX.h
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
ecl.h
eclBase.h
ype.h
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.h
xternalASTSource.h
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
xpr.h
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.h
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
MakeLists.txt
akefile
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.h
81cc2f1ecd31d8e3bca2c936fb9538a9d9c39695 04-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the common source locations of CastStmt & DefaultStmt into their base class, SwitchCase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171483 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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
tmtCXX.h
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.h
2464e96f0a73cd9757a6fdec4faf10d751d267fa 29-Dec-2012 Erik Verbruggen <erikjv@me.com> Removed duplicate logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171218 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
f42755ea9f0d8792e55dba28f1e013bc8223a676 27-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Simplify typeid 'potentially evaluated' check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171162 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
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.h
xprCXX.h
xprObjC.h
tmt.h
tmtCXX.h
tmtObjC.h
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
ype.h
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.h
eclBase.h
ype.h
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.h
eclBase.h
ype.h
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.h
eclBase.h
ype.h
2f82c783c95dc05cf1a54cdeab0249f0b217f9cc 24-Dec-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/AST/VTTBuilder.h: Prune one description in three methods, VTTBuilder::AddVTablePointer(), VTTBuilder::LayoutSecondaryVirtualPointers(), and VTTBuilder::LayoutSecondaryVirtualPointers(). [-Wdocumentation]

/// \param AddressPoints - If the vtable is a construction vtable, this has the address points for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171014 91177308-0d34-0410-b5e6-96231b3b80d8
TTBuilder.h
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.h
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
rettyPrinter.h
emplateName.h
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
rettyPrinter.h
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.h
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
eclBase.h
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.h
uiltinTypes.def
ype.h
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.h
uiltinTypes.def
ype.h
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.h
uiltinTypes.def
ype.h
6e48a2e2d677d9ba97b457e0af3494d6b6387380 17-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Just use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170365 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
6febf1265b5a5c3025752193caa9714ed523b12d 13-Dec-2012 Eli Friedman <eli.friedman@gmail.com> Using CanQualType::getAs<ArrayType> is unsafe; fix the code currently using it,
and make sure additional uses don't get introduced. <rdar://problem/12858424>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170081 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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
ecl.h
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
eclCXX.h
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.h
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.h
eclCXX.h
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
eclCXX.h
fb4f3a2591782f8643f06724703d2e5b03af36d2 06-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make sure to initialize the HasSkippedBody bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169540 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
35f3f36cb9451f347b83a6e7f01e3c702df4732d 06-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
that was skipped by the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169531 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
30a2e16f6c27f888dd11eba6bbbae1e980078fcb 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort #include lines for all files under include/...

This is a simpler sort, entirely automatic with the help of
llvm/utils/sort_includes.py -- no manual edits here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169238 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
ST.h
STContext.h
STUnresolvedSet.h
STVector.h
XXInheritance.h
omment.h
ommentCommandTraits.h
ommentLexer.h
ommentParser.h
ommentSema.h
eclCXX.h
eclContextInternals.h
eclVisitor.h
ependentDiagnostic.h
valuatedExprVisitor.h
xpr.h
xprCXX.h
xternalASTSource.h
angle.h
rettyPrinter.h
tmtGraphTraits.h
emplateBase.h
emplateName.h
ype.h
ypeLoc.h
ypeOrdering.h
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
tmt.h
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
ecl.h
eclBase.h
eclarationName.h
xpr.h
xternalASTSource.h
1bf43cae5d3175838242060cbbc08f6f4fce3536 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Make ASTVector.h standalone without including all of ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169093 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
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.h
STMutationListener.h
STVector.h
ttr.h
ttrIterator.h
ecl.h
eclAccessPair.h
eclBase.h
eclObjC.h
xprCXX.h
rettyPrinter.h
tmt.h
nresolvedSet.h
b087248e32a993a3441436cffd10a4c9112eda6f 01-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make these functions more clearly express the test they are performing. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169077 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
e5411b7c9af683dab6b035825b71c284bfec364d 01-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169075 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclCXX.h
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.h
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
eclCXX.h
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
STUnresolvedSet.h
STVector.h
eclCXX.h
xpr.h
nresolvedSet.h
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.h
d1bac8d46740eb00085ec816af0829fd75fb4d5c 27-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow an ASTConsumer to selectively skip function bodies while parsing. Patch
by Olivier Goffart!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168726 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
63b6ebe4e732f20fa24ea0666ed438dd5004cc20 23-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> Sema: Provide a valid source location when instantiating templates based on a CXXDefaultArgExpr.

Fixes PR13758.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168521 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
eclCXX.h
289994c1e7f965f2556b8b566738396659066669 21-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Don't walk a linked list twice in the same function. On my machine this takes
"clang -cc1" on a file with 10k repetitions of
extern int no_such_variable;
from 1.434s to 1.133s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168394 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
86256af6c8515077278d0a78f183fb6d322518ac 19-Nov-2012 NAKAMURA Takumi <geek4civic@gmail.com> RecursiveASTVisitor.h: Rework Doug's r160404, "Eliminating the GCC_CAST hack, take two."

With this, ARCMT tests would not crash on certain hosts with g++ -O2, eg. cygwin g++-4.5.3.

r160404 crashed mingw32-g++-4.4.0. I guess method's pointer in conditional expression could not be handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168295 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
d9ffa0c39ff9c71e2729eac4cdcf32b377c1d3b6 18-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix Doxygen comment start sequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168276 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
tmt.h
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.h
c4a77906c259cba58c147d8468c406a430ecdcbb 15-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Use empty parens for empty function parameter list instead of '(void)'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168041 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b6ad9b163d50827d4cd7eccadb20432cd3c089d5 14-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> In ExpressionEvaluationContextRecord manage LambdaMangle with a shared
pointer, otherwise we will double free it when ExpressionEvaluationContextRecord
gets copied.

Fixes crash in rdar://12645424 & http://llvm.org/PR14252

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167946 91177308-0d34-0410-b5e6-96231b3b80d8
ambdaMangleContext.h
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.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
d96d82e1e1eb1858c6bdf670d1717c2f3d04a427 09-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Don't use so many bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167624 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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
xprObjC.h
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.h
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.h
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.h
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.h
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.h
7ae5717de7a6a20df60b7b058eb04c2452e39906 18-Oct-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix more documentation comments in Comment.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166203 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
168425c9bdd8ed17df0ac76a19d6033f4808bd46 18-Oct-2012 Dmitri Gribenko <gribozavr@gmail.com> Expand the comment for DeclInfo::CurrentDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166202 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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.h
4a7c6eb2bbc9f7c00604d8d93ec66fd98cf4e404 18-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> Improve comment in couple of fields of DeclInfo.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166192 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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.h
rettyPrinter.h
b03527a9a395168762ad8e25e59a7a272dd74561 17-Oct-2012 John McCall <rjmccall@apple.com> Set a special flag in class metadata when an Objective-C class
has ivars that require destruction, but none that require anything
except zero-initialization. This is common in ARC and (when true
throughout a class hierarchy) permits the elimination of an
unnecessary message-send during allocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166088 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
ype.h
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.h
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.h
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.h
10be5bad483cfe66bb5eb5ff948c03c4628ce774 14-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165905 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
omment.h
b43d87b0646aa04951056c7e0d1ab9a58eb09f66 12-Oct-2012 Sean Silva <silvas@purdue.edu> Remove pointless classof()'s.

Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165770 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
ttr.h
omment.h
ecl.h
eclBase.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
xprObjC.h
tmt.h
tmtCXX.h
tmtObjC.h
ype.h
ypeLoc.h
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.h
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
omment.h
eclObjC.h
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.h
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
eclObjC.h
a8235d6c4093cd38dcf742909651f867de62e55b 10-Oct-2012 Douglas Gregor <dgregor@apple.com> Rework the (de-)serialization of macros, as stored in
MacroInfo*. Instead of simply dumping an offset into the current file,
give each macro definition a proper ID with all of the standard
modules-remapping facilities. Additionally, when a macro is modified
in a subsequent AST file (e.g., #undef'ing a macro loaded from another
module or from a precompiled header), provide a macro update record
rather than rewriting the entire macro definition. This gives us
greater consistency with the way we handle declarations, and ties
together macro definitions much more cleanly.

Note that we're still not actually deserializing macro history (we
never were), but it's far easy to do properly now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165560 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
STMutationListener.h
6c2fd0d71406c5f311ff00208448a63fa9071453 09-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Initialize the end loc in ObjCInterfaceTypeLoc.

Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165546 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
eclObjC.h
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.h
de7c0017d3f28a2e099244a154e89858bc34067b 09-Oct-2012 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CXXMethodDecl::isConst() and CXXMethodDecl::isVolatile() can be const methods

Patch by: Laszlo Nagy

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165486 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
03a400510fb8ba2e88e27c95ec797d944d944c4b 04-Oct-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Fixed friend decl source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165257 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
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.h
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.h
82bfa19fe3be324b13fdbcda46304b52c500f0d4 02-Oct-2012 Aaron Ballman <aaron@aaronballman.com> Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.

Fixes PR13782

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165015 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
xpr.h
xprCXX.h
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.h
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.h
ommentSema.h
awCommentList.h
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.h
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
STContext.h
ype.h
dc6c6d31d797300be4cbe899b4493c48900ffa65 27-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> Shrink LinkageInfo from 96 bits to 8 bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164771 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f3477c13eeaf11b32a41f181398fb5deffd0dd73 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164769 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
eclObjC.h
94ff8e1f57c6382d91d0de981a4f311509d83e37 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo 'iff' => 'if'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164766 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
eclObjC.h
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
ecursiveASTVisitor.h
emplateBase.h
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.h
e402e72273cde2a64fa6097c1fe93f500038675d 25-Sep-2012 John McCall <rjmccall@apple.com> Fix for r163013 regression and further __interface enhancement.
Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164590 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
ommentCommandTraits.h
ommentCommands.td
ommentSema.h
490dd9c70dc25bd7b1936a05d7878dc151f96c46 21-Sep-2012 Rafael Espindola <rafael.espindola@gmail.com> Use MapVectors to make the order we mark virtual functions used by a vtable
deterministic. Fixes pr13868.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164382 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
d6f80daa84164ceeb8900da07f43b6a150edf713 20-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Per C++11 [class.friend]p3, the 'friend' keyword must appear first in a
non-function friend declaration. Patch by Josh Magee!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164273 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
3bd762deaace1d62dab413d22c7430434e57a0d5 19-Sep-2012 Rafael Espindola <rafael.espindola@gmail.com> Add some typedefs for clarity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164223 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
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.h
be2fa7ebf01259b63dc52fe46c8d101c18e72269 18-Sep-2012 Craig Topper <craig.topper@gmail.com> Mark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_FUNCTION.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164102 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclTemplate.h
eclarationName.h
estedNameSpecifier.h
nresolvedSet.h
19ec962baba4bd332cb4dd83b3cfb67e33ea2b4c 15-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: support \namespace like other commands that contain just a
declaration for the entity being documented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163986 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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
STContext.h
eclObjC.h
xpr.h
ecordLayout.h
ype.h
388a594cd04aae78be452f6eacb9ca6be239c1f8 14-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: support the "\invariant" command.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163905 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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
ommentCommandTraits.h
ommentCommands.td
1824d54df85a462ada812dadda18130f951d40f3 13-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix Doxygen misuse: refer to parameter names in paragraphs correctly (\arg is
not what most people want -- it starts a new paragraph).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163793 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
harUnits.h
ecl.h
eclObjC.h
xternalASTSource.h
SAPI.h
electorLocationsKind.h
127ff2ea6440c3da4b47f9c8b3b190254a97e7b5 13-Sep-2012 Ted Kremenek <kremenek@apple.com> Conditionally parse documentation comments in system headers by
passing -fretain-comments-from-system-headers. By default, the
compiler no longer parses such documentation comments, as they
can result in a noticeable compile time/PCH slowdown.

Fixes <rdar://problem/11860820>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163778 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
e6f18c3e6a28229b5871007858b8c30882494b09 13-Sep-2012 Richard Trieu <rtrieu@google.com> Add two new functions to Qualifiers.

static Qualifiers removeCommonQualifiers(Qualifiers &L, Qualifiers &R)
Removes the common qualifiers from L and R and returns them in a new Qualifier.
This will be used in template diffing.

void removeQualifiers(Qualifiers Q)
Removes the qualifiers in Q from the current qualifier.
This replaces the current underlying implementation of operator- and
operator -= which only performed bit masking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163752 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0841a07498af164a9702f943ab2f517e23eecc77 12-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: recognize more Doxygen commands


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163723 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommands.td
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
xprCXX.h
ecursiveASTVisitor.h
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
ommentLexer.h
ommentSema.h
fb7669ee725ec699e2b49b8359c4652536949739 11-Sep-2012 Douglas Gregor <dgregor@apple.com> Fix typo in comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163597 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
9f0b1324a5352713337c75ef4a5acffd96609c6c 11-Sep-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-2012_09_10
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.h
MakeLists.txt
omment.h
ommentCommandTraits.h
ommentCommands.td
ommentLexer.h
ommentSema.h
akefile
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.h
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.h
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.h
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
ecursiveASTVisitor.h
tmt.h
ca0d10edcf1192ab8546a75e8be5bab7ef32e488 02-Sep-2012 James Dennett <jdennett@google.com> Documentation cleanup: Add \file comment for ASTContest.h, add \brief to many
items, remove redundant names from doc comments, fix various typos, and tidy
up some wording.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163085 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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
ecursiveASTVisitor.h
tmt.h
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.h
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
anonicalType.h
ecl.h
eclCXX.h
ype.h
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.h
da5922f4864b5da254c6676af8833c42adaa6d86 31-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Use LLVM_DELETED_FUNCTION instead of a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162985 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.h
ommentParser.h
ommentSema.h
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
ommentHTMLTags.td
ommentSema.h
akefile
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.h
uiltinTypes.def
perationKinds.h
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.h
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.h
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.h
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.h
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.h
2fd559f041d49863a7396d9e330bc9dae95ac8c4 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Hoist getNumClobbers into base class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162711 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
ecursiveASTVisitor.h
tmt.h
29760b452876548f59804e8c02c3276bc7281d5d 27-Aug-2012 Matt Beaumont-Gay <matthewbg@google.com> Appease -Wnon-virtual-dtor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162700 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
12b95e523c193bac4bdde0b23f2a9777ca956145 27-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a few comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162699 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
19c0134d465a1d9a1edc45ebac51652d8636c68e 27-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Hoist common Expr handling logic into AsmStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162698 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
bbdfe24a19833e4deabc73e50a5c639fefb60a07 27-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Base class AsmStmt implements these.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162693 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
7d2c5ca9c3dad400f66aca58eebef321c04cf57e 27-Aug-2012 Chad Rosier <mcrosier@apple.com> Update comment, per Jordan's suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162684 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8f7f3a65a5e81fbf5c9e184abd9250cc8e67b58c 27-Aug-2012 Chad Rosier <mcrosier@apple.com> Update comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162682 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
ecursiveASTVisitor.h
tmt.h
cd518a0ebc7c0a6aa41d717c360462540ef80a76 25-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Update the AST Reader/Writer for MS-style inline asms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162629 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
c831d8b977a09bf2907d03128b48b5c914a2fafd 25-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix integer unsigned behavior in clang due to signed left shift overflow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162626 91177308-0d34-0410-b5e6-96231b3b80d8
TableBuilder.h
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.h
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.h
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.h
xprCXX.h
8268fe7c4bdfa341975a687a8a5e236c2c5b88a4 24-Aug-2012 James Dennett <jdennett@google.com> Allow RecursiveASTVisitor to visit CXXCtorInitializer objects for which
isWritten() returns false, if shouldVisitImplicitCode() returns true.
Previously those CXXCtorInitializers were always skipped.

In order to make this change easier to test, this patch also extends the
test class template ExpectedLocationVisitor to support arbitrary numbers
of expected matches and disallowed matches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162544 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
2603fa6c0e0fff904317b525724170ba8ae5bfa8 23-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a few helper function to the MSAsmStmt class that are needed
by CodeGen.

In the long-term, much of the codegen logic will be shared between the GNU-style
and MS-style inline assembly, but for now I'm replicating this logic to avoid
regressions with the GNU-style.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162478 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d5a20c19416d7143771b4d503fa808ae01c4e7ad 23-Aug-2012 Sean Callanan <scallanan@apple.com> Added a method to DeclContext that marks the
lookup table as needing to be built.

This is required for LLDB, which provides the
contents of many DeclContexts through a custom
ExternalASTSource.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162471 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
70517ca5c07c4b41ff8662b94ee22047b0299f8c 23-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix a bunch of -Wdocumentation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
tmt.h
ypeLoc.h
88920d1a84dc63a3722b1f2b1fb5926c44bd81ab 23-Aug-2012 Roman Divacky <rdivacky@freebsd.org> Mark these const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162443 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
ad0fe03b897f9486191e75c8d90c3ffa9b4fd6a5 23-Aug-2012 Ted Kremenek <kremenek@apple.com> Fix an assortment of doxygen comment issues found by -Wdocumentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162412 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
xpr.h
xprObjC.h
59c91c8d0000af8f8a1022ee0f0eec46c397b347 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Update comment to match the reality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162316 91177308-0d34-0410-b5e6-96231b3b80d8
ommentBriefParser.h
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.h
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
rettyPrinter.h
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.h
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.h
eb8f2efb17c74620510a38cb437e792ea9c76021 21-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> DeclPrinter: describe what 'terse' output is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162251 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
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
rettyPrinter.h
99f074c34f76ca461cd22d20a3968383f727b735 21-Aug-2012 David Blaikie <dblaikie@gmail.com> Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162235 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
82b4550fb25ad578b6c8143b87a003fae7106cae 17-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Part of PR13618: visit the TypeLoc when RecursiveASTVisitor visits a CompoundLiteralExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162133 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
fb4306756208118d66f63abdd82cc10b19b5e4ba 17-Aug-2012 Douglas Gregor <dgregor@apple.com> When we need the complete set of visible declarations from a
declaration context, check whether the primary context---not the
current context---has any external visible declarations. Fixes
PR13616.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162083 91177308-0d34-0410-b5e6-96231b3b80d8
eclLookups.h
aeb288123e51cbf5855b06eb9d8c108fd6124286 17-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix misaligned DeclGroup allocation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162069 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
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.h
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.h
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
rettyPrinter.h
tmt.h
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
ttr.h
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.h
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.h
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.h
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.h
1e059da457ba65062448f24975db386efa0d51f8 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Mark getClobber() const.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161912 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
9fbf327cfdd27ddb5d845042c95f2299ac95b143 15-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove trailing return flag from FunctionTypeLoc, since we now carry that
information on FunctionProtoType. (This also fixes one of *many* misalignment
problems in the TypeLoc hierarchy...)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161901 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
awCommentList.h
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
eclBase.h
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
xprCXX.h
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.h
awCommentList.h
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.h
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.h
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.h
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
eclCXX.h
ype.h
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.h
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.h
d1db12540e572d6e3d998a4b770a6b2c7267d7fc 09-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment to HTML and XML conversion: use CommandTraits to classify commands.

This also fixes a bug in comment to XML conversion: \result was just an
ordinary paragraph, not an alias for \returns.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161596 91177308-0d34-0410-b5e6-96231b3b80d8
ommentCommandTraits.h
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
ommentBriefParser.h
ommentCommandTraits.h
ommentLexer.h
ommentParser.h
ommentSema.h
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.h
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
eclCXX.h
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.h
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.h
50d61c8ccfc633b13cdf594ea3cd3a217076debe 08-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement final piece of DR963 and also DR587:

A conditional operator between glvalues of types cv1 T and cv2 T produces a
glvalue if the expressions are of the same value kind and one of cv1 and cv2
is a subset of the other.

A conditional operator between two null pointer constants is permitted if one
of them is of type std::nullptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161476 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3189d8c8f2f26d49e129b68f708042da3703816b 07-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove obsolete comment. Obsoleted by r116524 when Type hierarhy bitfield
implementation was changed to a union of bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161447 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
16bec0630ef488af263d521b166b41ffa3c71743 07-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment.h: fix typo in comment


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161436 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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.h
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.h
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.h
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.h
ommentSema.h
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.h
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.h
ommentSema.h
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.h
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.h
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.h
ommentSema.h
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
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.h
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.h
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.h
ommentSema.h
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
omment.h
ommentParser.h
ommentSema.h
94be8ea90795d00fe2a97fea9a9a727911a70997 31-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove deprecated getNameAsCString methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161044 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
b740316a122b5ceaaa7cf50557b1b39af5fbbf5f 30-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Add an assert to ParamCommandComment::getParamIndex() -- it should not be
called unless index is valid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160970 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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
ommentLexer.h
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.h
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
ype.h
132283beb1b032e0acd09bdfb45dceadeea0026e 26-Jul-2012 Jordan Rose <jordan_rose@apple.com> Add a const version of Expr::IgnoreImplicit. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160801 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
559b928b05aeacc9c984a9d633ad586bbe858196 26-Jul-2012 Alexander Kornienko <alexfh@google.com> Put back dump() without a default argument, "because debuggers don't usually respect default arguments".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160788 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
eclBase.h
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.h
6f36366c85dc81d67d70efdeeea4cfc382053feb 25-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Make comments::Parser and comments::Sema noncopyable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160702 91177308-0d34-0410-b5e6-96231b3b80d8
ommentParser.h
ommentSema.h
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.h
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.h
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
ommentLexer.h
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.h
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.h
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
omment.h
ommentSema.h
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
ommentLexer.h
8986e108e04a4fbe9248f87708410bb073940d7b 21-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST nodes: add NumHTMLStartTagCommentBits member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160600 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
ae99b75fbbac1deaccdcc1b326b8fb6b07a1e72d 20-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Add libclang APIs to walk comments ASTs and an API to convert a comment to an
HTML fragment.

For testing, c-index-test now has even more output:
* HTML rendering of a comment
* comment AST tree dump in S-expressions like Comment::dump(), but implemented
* with libclang APIs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160577 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
ommentVisitor.h
fd8b43596478b779b6777cb3a595e69d7856c378 20-Jul-2012 Jordan Rose <jordan_rose@apple.com> Add a reverse iterator to DeclStmt, and use it when building a CFG.

The CFG creates dummy DeclStmts with one Decl per statement, and it has
to do so from last to first in order to build the graph correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160560 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
ce40e6f3dc3287348fb51a0eb7d4654b317435b8 19-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r160404, "Eliminating the GCC_CAST hack, take two.", for now.

It crashes mingw32-gcc-4.4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160486 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
8c77758b6546a61b7cc9b71d05049aa0fad3d841 18-Jul-2012 Douglas Gregor <dgregor@apple.com> Improve comment for TypeDecl::getTypeForDecl(), from Sean Silva!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160405 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d47bc514d49e3707063dc30b166d28e954b338f1 18-Jul-2012 Douglas Gregor <dgregor@apple.com> Eliminating the GCC_CAST hack, take two.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160404 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
befceba36bb91f05dd36b06fae93e2539c944622 18-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST nodes: rename Num*Bitfields to Num*Bits to be consistent with Stmt AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160402 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
8de0956c736428c6aa2d317a8bad0c0c494ad6c3 18-Jul-2012 Douglas Gregor <dgregor@apple.com> Reinstate the GCC_CAST hack; I apparently did not appease GCC with r160397.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160401 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
75c5754260b4a3a0ff7f6437c850be9f95cad836 17-Jul-2012 Douglas Gregor <dgregor@apple.com> Try to eliminate GCC_CAST hack in a manner that should work for both
GCC and MSVC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160397 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
beef1cb6ebfaea4542fb6d6686caae27787a75e0 17-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix BlockCommandComment::classof() to return true for objects of derived classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160323 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
177f1be7fe5b7d71a791901fb83d95e18c413513 16-Jul-2012 Aaron Ballman <aaron@aaronballman.com> Fixing an MSVC warning -- the compiler did not like the cast added to work around a g++ bug (it would claim to possibly emit incorrect code).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160281 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
a770a4daf77037b5526dba1c447d61acf0aba01a 16-Jul-2012 Daniel Jasper <djasper@google.com> Add correct parenthesis range to CXXConstructExprs inside
CXXFunctionalCastExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160252 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
aa488ea287c219565b5169d50142947d1b63a6ca 16-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> More for PR11848: a pack expansion type isn't necessarily type-dependent (its
pattern might be an alias template which doesn't use its arguments). It's always
instantiation-dependent, though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160246 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d64e2ee48a6dca4612dda56b785be571be391047 14-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment.h: reword comments


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160197 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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
omment.h
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
omment.h
ommentLexer.h
ommentParser.h
ommentSema.h
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.h
99b28e7e6b136acd8b294a807550e66f78c07f44 12-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Always initialize variable. If opening quote is the last character in comment, we will be using an uninitialized value. There is already a test for that in unittests/AST/CommentLexer.cpp, but it seems like we were lucky with the value that got loaded into the variable so the test passed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160133 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.h
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.h
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.h
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.h
omment.h
ommentDiagnostic.h
ommentLexer.h
ommentParser.h
ommentSema.h
awCommentList.h
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
ttr.h
tmt.h
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.h
awCommentList.h
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
ommentLexer.h
ommentParser.h
36cbfbfce889642057bd007eac3569ea9f58e1e8 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment.h: correct identation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159793 91177308-0d34-0410-b5e6-96231b3b80d8
omment.h
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.h
MakeLists.txt
omment.h
ommentLexer.h
ommentParser.h
ommentSema.h
ommentVisitor.h
akefile
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.h
eclTemplate.h
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
ecordLayout.h
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
STVector.h
eclCXX.h
eclFriend.h
eclTemplate.h
xpr.h
xprCXX.h
ecordLayout.h
tmt.h
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.h
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.h
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
perationKinds.h
awCommentList.h
15cdcbf14b899d0189a5284dda9bf1f043e48f7a 03-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> CommentLexer: remove Markdown tokens from the token list (they are not emitted by lexer).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159681 91177308-0d34-0410-b5e6-96231b3b80d8
ommentLexer.h
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.h
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.h
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.h
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.h
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.h
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.h
c2cda0284a3e80fa4b39b540f6c73782fa69fa6b 27-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Initialize RawCommentList::BriefTextValid when deserializing AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159246 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.h
7349cce2b303c8cc1e00c3aa7192513d6ca5004f 27-Jun-2012 Daniel Jasper <djasper@google.com> Always use getDerived().shouldVisitImplicitCode() so it can be altered
in subclasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159231 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ommentBriefParser.h
ommentLexer.h
awCommentList.h
7e0f1ee35fe98d6751b9e736410f8254795b5f68 26-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix comment: refer to documentation comments in general, not just Doxygen comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159214 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
xpr.h
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.h
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.h
ecursiveASTVisitor.h
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
xpr.h
27c0bb04bfdbf82b1d7e6670b8e806451e8ce2c3 22-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Correct include guard to reflect new directory name


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159007 91177308-0d34-0410-b5e6-96231b3b80d8
awCommentList.h
efce31f51d6e7e31e125f96c20f6cdab3ead0a47 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Primarily fixed \param commands with names not matching any actual
parameters of the documented functions. In many cases this consists
just of fixing up the parameter name in the \param to match the code,
in some it means deleting obsolete documentation and occasionally it
means documenting the parameter that has replaced the older one that
was documented, which sometimes means some simple reverse-engineering
of the docs from the implementation;
* Fixed \param ParamName [out] to the correct format with [out] before
the parameter name;
* Fixed some \brief summaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158980 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
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
awCommentList.h
1071ba9c324d831b437870a1fe63bf2ecdc4e9e4 21-Jun-2012 Daniel Jasper <djasper@google.com> Make the RecursiveASTVisitor visit the body of a range-based for loop
again. This was broken in r158395.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158907 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
STContext.h
awCommentList.h
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
STContext.h
awCommentList.h
d5e26b8933a377893c8043ff6a23aaf6b601d18f 20-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: adding/fixing Doxygen markup, particularly \brief,
\code...\endcode, \file commands and escaing for angle brackets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158779 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
222bc3c25b12fc0cf55175975dc4c25d7e1fac78 20-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Escape < characters in Doxygen comments as needed;
* Demote one Doxygen comment to a regular comment to fix a Doxygen warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158774 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
xternalASTSource.h
9c849b03a62fd1864d62c382c916cf9dc17be335 18-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Escaped "::" where needed to prevent Doxygen trying to make links;
* Updated one mention of C++0x to refer to C++11;
* Fixed a \brief summary to make it somewhat concise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158667 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
7553ad2b7513fce1acd85658279da204fa99426f 17-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Switch users of SmallMap to use SmallDenseMap instead.

The most important change here is that the destructor and copy
constructor for StoredDeclsList will now reliably be run. Previously,
the destructors at least were missed in some cases. See the LLVM commits
discussions for why SmallMap is broken and going away.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158642 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
eclContextInternals.h
f977848850a2f8785dc2b37c735afe0cd223b8bb 17-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* For Doxygen, escaped "::std" as "\::std";
* For humans, fixed "namespaecs" to "namespaces".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158634 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
86290333420dea36e41afb664884fc45ac7677a8 17-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escaped a < character in a Doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158631 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
75996d2bf191bd5d1e981b93b99f5b77add1266e 17-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escape "::" to eliminate a Doxygen warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158620 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
fe865f1f35d1b91f42f58f08a1399b961b71b3bc 15-Jun-2012 James Dennett <jdennett@google.com> Documentation fix (cleaning up my own breakage): close <tt> with </tt>,
not with another <tt>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158546 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
18483f583333f8d940393e64ce111c6979639665 15-Jun-2012 James Dennett <jdennett@google.com> Fix a documentation typo: \\brief -> \brief


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158507 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
0982205bade2fb4fc984c27b2ab401e683963b10 15-Jun-2012 James Dennett <jdennett@google.com> Ongoing documentation cleanup: fixed Doxygen markup errors, added \brief
annotations in many places where it involved little change, fixed some
examples and marked code examples with \code...\endcode, and changed a few
nearby mentions of C++0x to refer to C++11.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158486 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
eclCXX.h
eclObjC.h
valuatedExprVisitor.h
xpr.h
xprCXX.h
xprObjC.h
tmtObjC.h
809d1be9820039b4cf6efa48246a0d70ffa13394 14-Jun-2012 James Dennett <jdennett@google.com> More doxygen/documentation cleanups.

This reduces the number of warnings generated by Doxygen by about 100
(roughly 10%). Issues addressed:
(1) Primarily, backslash-escaped "@foo" and "#bah" in Doxygen comments
when they're not supposed to be Doxygen commands or links, and
similarly for "<baz>" when it's not intended as as HTML tag;
(2) Changed some \t commands (which don't exist) to \c ("to refer to a
word of code", as the Doxygen manual says);
(3) \precondition becomes \pre;
(4) When touching comments, deleted a couple of spurious spaces in them;
(5) Changed some \n and \r to \\n and \\r;
(6) Fixed one tiny typo: #pragms -> #pragma.

This patch touches documentation/comments only.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158422 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xprCXX.h
xprObjC.h
tmtObjC.h
ype.h
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.h
52ec0c0357ce970ca52a27c1086626450f0967e7 13-Jun-2012 Daniel Jasper <djasper@google.com> Rename shouldVisitImplicitDeclarations to shouldVisitImplicitCode.
Fix RecursiveASTVisitor to visit CXXForRangeStmts accordingly to visit
implicit or explicit code.

The key bug that inspired this was the Visitor not visiting the range
initializer of such a loop, which is explicit code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158395 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
c7d2e339f9a71a40db7b199082b42fe91e6fa2cb 12-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Correct comment. The return type was changed to const Type* in r123814. Patch by David Röthlisberger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158347 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ecursiveASTVisitor.h
tmt.h
17d26a6c1f2cb921d0000c337b4967699dc928fd 11-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup, fixing Doxygen markup. Mostly this avoids common terms
such as "protocol" and "expression" being implicitly turned into links to
mistakenly-generated Doxygen pages:
- Escaping @ symbols when Doxygen would otherwise incorrectly interpret them;
- Escaping # symbols when they're not intended as explicit Doxygen link
requests, such as when discussing preprocessor directives;
- In one odd case, unescaping @ in @__experimental_modules_import, because
Doxygen wrote '\@' to the output in that case, causing the example in the
description of ImportDecl to be wrong; and
- Fixing a typo: @breif -> @brief.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158299 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclCXX.h
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
ecl.h
eclObjC.h
801e60946bc879afeb37bcd3372e441e8f631c79 10-Jun-2012 James Dennett <jdennett@google.com> Fix the top-of-file comment in Attr.h to say that it's about attributes, not
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158285 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
135bf8ee69e2ae2daea4f713381995028c41e264 09-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When doing the cursor visitation make sure declarations
in the same line do not override getting a cursor for the previous declaration.

e.g:

int x, y;
@synthesize prop1, prop2;

pointing at 'x'/'prop1' would give 'y'/'prop2' because their source ranges overlap.

rdar://11361113

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158258 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
49fdccb4595862828aa5cadc1497d466a8031dda 09-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Convert comments to proper Doxygen comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158241 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
9f63a451b1b3e36c0c82fcfe78828182bb9a6fa0 08-Jun-2012 Jordan Rose <jordan_rose@apple.com> Disallow using ObjC literals in direct comparisons (== and friends).

Objective-C literals conceptually always create new objects, but may be
optimized by the compiler or runtime (constant folding, singletons, etc).
Comparing addresses of these objects is relying on this optimization
behavior, which is really an implementation detail.

In the case of == and !=, offer a fixit to a call to -isEqual:, if the
method is available. This fixit is directly on the error so that it is
automatically applied.

Most of the time, this is really a newbie mistake, hence the fixit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158230 91177308-0d34-0410-b5e6-96231b3b80d8
SAPI.h
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.h
eclCXX.h
41c2bcff88a23a046ee8d71451bc03717a4248f6 07-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Fix many doxygen formatting errors.

This patch affects docs only, and includes formatting changes only
(though those include some fixes for broken Doxygen markup that caused
some content to be missing from generated pages). It avoids generating
many spurious pages such as
http://clang.llvm.org/doxygen/classRepresents.html, but likely not all
yet.

Patch by James Dennett.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158155 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
ype.h
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.h
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
emplateBase.h
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
eclBase.h
c28a335184207a47f34eb9d1707dc8d7c6c7b8b6 05-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> RecursiveASTVisitor: add ability to visit implicit declarations. Patch by
James Dennett!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158002 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
xpr.h
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.h
6fada8e820f2fd1b4cd38e48c8986110e87c5915 31-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Only visit default arguments for template declarations when visiting the template declaration which introduced them. Patch by Yang Chen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157723 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
dec17760923a23c5a185944d14d7455df6b09d86 28-May-2012 David Blaikie <dblaikie@gmail.com> Address minor FIXME in RedeclLink to contain a PointerIntPair instead of derive from it.

Use actual factory functions rather than derived classes acting as named constructors/factories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157588 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
28b230723d5daf3c48c2e134f4b5626bd69392c8 27-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace some custom hash combines with the standard stuff from DenseMapInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157531 91177308-0d34-0410-b5e6-96231b3b80d8
aseSubobject.h
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.h
0e5e092228495c9524ba6fa9b49f116a0c1bbe55 22-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Truthify a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157232 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
93a8534090a6de23d655679205b974032d092a89 19-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify code, add an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157111 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
87014f33f123461a012995b2f7eb5e6ecf6dc461 16-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Properly handle @encode() in RecursiveASTVisitor and traverse
its type source info. Fixes indexing references inside @encode().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156936 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
7d24e289bea2accaaed79c6ca3e5cdd0c204ddc1 16-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang/AST] Index references of protocols in "@protocol(...)" syntax.

To do that, keep track of the location of the protocol id in the ObjCProtocolExpr
AST node.

rdar://11190837

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156890 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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.h
45246a7fc00f07bba9a34a3f13c0af72a05f95be 15-May-2012 Anna Zaks <ganna@apple.com> [analyzer] Fix a crash in templated code which uses blocks.

We should investigate why signature info is not set in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156784 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
ype.h
06cd51a83577019ea26661b7d570ae9aef06f674 10-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> RecursiveASTVisitor:

We don't create any declaration to mark the explicit instantiation of function
templates other than the instantiation itself, so visit that when traversing
the function template decl.

This is a temporary fix, pending the creation of a Decl node to represent the
explicit instantiation.

Patch by Daniel Jasper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156522 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
1de6a6cb485fb58b4fb100282bb3cf298eedacd9 09-May-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c. Fixes a 'fixit' where location of
'*' on objective-c class name was misplaced.
// rdar://11311333


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156517 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
e15db6f0d226a3bc88d244512d1004c7c1c07391 09-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [AST/libclang] Speed up clang_getOverriddenCursors() considerably by reserving a bit
in ObjCMethodDecl to indicate whether the method does not override any other method,
which is the majority of cases.

That way we can avoid unnecessary work doing lookups, especially when PCH is involved.

rdar://11360082

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156476 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0265555a0fec81102bfb3757cfc7f3d90dbbe409 07-May-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed UserDefinedLiteral source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156298 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
eclCXX.h
86b32fd702d794bb655c59a1238bf7422869f506 05-May-2012 Ted Kremenek <kremenek@apple.com> Revert r156141 (making RecursiveASTVisitor data recursive). It is causing clang to blow up in memory usage on -O2 when compiling itself,
which is leading to swapping in some cases when it didn't before. We need to see if we can make this change
without leading to a massive compile-time bloat.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156229 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
ype.h
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.h
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.h
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.h
4ed57820a2b14a979537ace3f03bde68baf386ee 04-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make RecursiveASTVisitor fully data recursive on Stmts, with
minimal disruption on its clients.

Unlike the previous data-recursive scheme, Traverse*Stmt methods are
always getting called. The base methods of RecursiveASTVisitor will enqueue
the sub-statements instead of calling TraverseStmt on them.

Clients that override a Traverse*Stmt method and call TraverseStmt will
still function as function-recursive traversal; if a client wants to
enqueue a sub-statement in its override method it can do it like this:

[inside the override method]
StmtQueueAction StmtQueue(*this);
StmtQueue.queue(Stmt->getSubStmt());

Should address rdar://11179167.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156141 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
eclarationName.h
d39d23e610c2a7815515d60c5a538d65d05e8bdc 03-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a couple of cases of (innocuous) unmarked fallthrough. At least one of these
was unintentional. Found by -Wimplicit-fallthrough, patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156082 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
a058fd4f0a944174295f77169b438510dad389f8 03-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Revert most of r154844, which was disabled in r155975. Keep around the
refactorings in that revision, and some of the subsequent bugfixes, which
seem to be relevant even without delayed exception specification parsing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156031 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c8c222830a1d8df8ed05bedfcac868fe6838fba8 02-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r155951, reverted in r155962, with two changes:
* Work around build failures due to gcc 4.2 bugs.
* Remove BodyIndexer::TraverseCXXOperatorCallExpr, which was not being called
prior to this change, and whose presence disables a RecursiveASTVisitor
stack space optimization after this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155969 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
b51c7f3fe619de753146ffd167f1c6b1df8bf443 02-May-2012 Andrew Trick <atrick@apple.com> Revert "Fix RecursiveASTVisitor's data recursion to call the Traverse* functions if they"

FAIL: Clang :: Index/index-many-call-ops.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155962 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
e3ba2987b9d55fdc976362ddccdb8c5a73d19fc9 01-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix RecursiveASTVisitor's data recursion to call the Traverse* functions if they
have been overridden in the derived class. Also, remove a non-functional
implementation of an incorrect optimization for ParenExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155951 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
8165605dfb926561bcbc64310bec4106a70dd1e1 01-May-2012 David Blaikie <dblaikie@gmail.com> Implement simplify_type traits for redecl_iterator.

Based on Chandler Carruth's feedback on r155869.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155929 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
9222cadd8dcc17d0a18b1b8e0e1b10bda8513993 01-May-2012 Douglas Gregor <dgregor@apple.com> Remove the unused DestroyAttrs, noticed by Michael Han.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155877 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
bd4fa45e7cf6a2f0adcb0ab66d5b3d338ec56c3c 01-May-2012 David Blaikie <dblaikie@gmail.com> Remove ref/value inconsistency in redecl_iterator.

Similar to r155808 - this mistake has been made in a few iterators.

Based on Chandler Carruth's feedback to r155808 I added an implicit conversion
to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the
dyn_cast (due to template argument deduction causing the conversion not to be
used) - there for future convenience, though. This idiom (op T* for iterators)
seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I
fix up the other iterators here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155869 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
0e22a9fd3a892985cd6277c174fd2157354476db 01-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> For RecursiveASTVisitor, do data recursion for CXXOperatorCallExpr.

rdar://11289247

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155849 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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
eclBase.h
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.h
a313b2fbba86c901e58dc58df036e731f24fdaee 26-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> RecursiveASTVisitor: When in 'shouldVisitTemplateInstantiations' mode, visit
all instantiations of a template when we visit the canonical declaration of the
primary template, rather than trying to match them up to the partial
specialization from which they are instantiated. This fixes a bug where we
failed to visit instantiations of partial specializations of member templates of
class templates, and naturally extends to allow us to visit instantiations where
we have instantiated only a declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155597 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
0d62709c6e9b33dce788e0c0fa3cd5c7f4d637d0 25-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Use a SmallMap for StoredDeclsMap, it's usually sparsely populated so we can avoid initializing memory for 64 buckets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155571 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
383fdf9b8359cf8192026e584da7143bb72301c1 25-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Convert a std::map that usually has between 0 and 10 elements to SmallMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155570 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
5482dc3a88fce51307b5e1e19bdf72dea1562040 24-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> RecursiveASTVisitor: Visit instantiations of member templates of class
templates. In an implicit instantiation of a member class, any member
templates don't get instantiated, so the existing check which only visited
the instantiations of a defined template skipped these templates'
instantiations.

Since there is only a single declaration of a member template of a class
template specialization, just use that to determine whether to visit the
instantiations. This introduces a slight inconsistency in that we will
visit the instantiations of such templates whether or not they are
defined, but we never visit a declared-but-not-defined instantiation, so
this turns out to not matter.

Patch by Daniel Jasper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155487 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
fa784da5b9039ead42323bfe9ae6d33ab3c5c6b3 24-Apr-2012 Shih-wei Liao <sliao@google.com> Merge with CLANG upstream r155088.

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Id80f069ae25e623967b705e9fa11cfd94dd2461c
9f99d06e0d22380b9d1f0609a083dbfbd8b37c10 23-Apr-2012 Manuel Klimek <klimek@google.com> Fix PR12608. Patch contributed by Yang Chen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155355 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
51183374a54448c54f1b53035cea5b8d885c1c82 22-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert 155102 but add a fixme while I debug what is wrong with chrome's
components build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155314 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
1c7eed7e6ea2b357aa94581a90018ddbdcb41cbf 19-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> In mergeVisibilityWithMin, let an implicit hidden symbol take precedence over
an explicit default one. This means that with -fvisibility hidden we
now produce a hidden symbol for

template <typename T>
class DEFAULT foo {
void bar() {}
};
class zed {};
template class foo<zed>;

This matches the behaviour of gcc 4.7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155102 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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
xprObjC.h
ecursiveASTVisitor.h
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
ype.h
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.h
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
xpr.h
ype.h
74e2fc332e07c76d4e69ccbd0e9e47a0bafd3908 16-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154844 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
48c2407861526291ea8aeb2083537fc0576b7a8e 16-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove unused method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154827 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclLookups.h
xternalASTSource.h
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.h
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.h
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
eclBase.h
ecursiveASTVisitor.h
tmt.h
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.h
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.h
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
emplateBase.h
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.h
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.h
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
eclCXX.h
xprCXX.h
173a37a57b79bd8f94b85c2273039e760b159922 03-Apr-2012 Nick Lewycky <nicholas@mxc.ca> Remove more redundant lookups. Add a new "all_lookups_iterator" which provides
a view over the contents of a DeclContext without exposing the implementation
details of the StoredDeclsMap. Use this in LookupVisibleDecls to find the
visible declarations. Fixes PR12339!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153970 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclLookups.h
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
xprObjC.h
165ce3c8a16542182adedae6475ed08ae4972e31 26-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify code, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153459 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
d316862f4fb281ec08a2e45cd3e5580574adb889 24-Mar-2012 Shih-wei Liao <sliao@google.com> Merge branch 'upstream' into sliao_d
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.h
7608a8080bad7ee87a9a50015e9ca63fb214aba2 23-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove unused bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153295 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
643586fe4fcd42b0978efd3566832ab4dce50367 22-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] When we are replacing a decl in a chained PCH that is also a DeclContext,
make sure to fully load its external lexical and visible declarations before
re-writing it.

rdar://10914192

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153254 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
ependentDiagnostic.h
0f5897bf5f919df28c76013d1efa17441f7241ff 15-Mar-2012 Douglas Gregor <dgregor@apple.com> Document RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152826 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
90226acd0b9be2964343cd63ae604bf0a656d33b 15-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make RecursiveASTVisitor to traverse certain statements using data recursion
to avoid a stack overflow with extreme cases.

Part of rdar://10941790.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152820 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
eclTemplate.h
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.h
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.h
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
xpr.h
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.h
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
xpr.h
ecursiveASTVisitor.h
tmt.h
a346efaaad5cd779cdfd5be73c2b258748ad1f06 10-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Sema] A tag decl that is marked as invalid and is used in a decl-spec,
should not impede creating a proper TypeLoc info for the decl-spec.

This improves our semantic error recovery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152481 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
8788b224aaa46ccb777e6a24550449dfbb9d195f 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> Revert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
LLVM_READONLY.", getTypeInfo() is totally not READONLY, which I should have
probably noticed given that I made it so mere hours ago. Oops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152434 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
feb1f4a0a71868a271fa284dadfda7a2beeaccff 09-Mar-2012 Matt Beaumont-Gay <matthewbg@google.com> Add a helper to get a CXXConstructExpr from a CXXNewExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152433 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
f9ff5876289d5228c299b57416a62c8c3b848287 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Mark Expr::Ignore*() functions as LLVM_READONLY.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152431 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
29c6c6ef2459195ed2031b97e65a0787e43c1585 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152430 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
4f311183be3d923da9fbe8702c453688b4c426a9 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Mark Expr::getExprLoc() as LLVM_READONLY.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152429 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprObjC.h
aa49a7d70e58dac2aeb40664ba16d2ea571b8c95 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
- The theory here is that we have these functions sprinkled in all over the
place. This should allow the optimizer to at least realize it can still do
load CSE across these calls.
- I blindly marked all instances as such, even though the optimizer can infer
this attribute in some instances (some of the inline ones) as that was easier
and also, when given the choice between thinking and not thinking, I prefer
the latter.

You might think this is mere frivolity, but actually this is good for a .7 -
1.1% speedup on 403.gcc/combine.c, JSC/Interpreter.cpp,
OGF/NSBezierPath-OAExtensions.m.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152426 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
estedNameSpecifier.h
tmt.h
tmtCXX.h
tmtObjC.h
emplateBase.h
ypeLoc.h
3d4144f32ea4c24aaf48cbff4f476c1446ba2641 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152418 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
ypeLoc.h
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
ecl.h
xpr.h
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
tmt.h
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.h
406dac0027de79d809366bcb070dc69c560903c3 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Add DeclaratioName::getLoc{Start,End} for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152409 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
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.h
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.h
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.h
xpr.h
e13edcb296522ab96c384c962c9eb1954962084c 08-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Clean up NamedDecl::getUnderlyingDecl() change a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152332 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
025039377d7247620750205dbd61ca1ba336f7e0 08-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152320 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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
ecl.h
ype.h
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.h
9ea396a886d46a9329817ad0a8c423510634d889 07-Mar-2012 Richard Trieu <rtrieu@google.com> Remove unnecessary include in ExprObjC.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152239 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
xprCXX.h
ecursiveASTVisitor.h
29293cddc682091a16a71f513e605995473f7f45 07-Mar-2012 Dylan Noblesmith <nobled@dreamwidth.org> AST: fix build since r152060

The declarations of the operators no longer matched.
The definitions in ASTContext.h had 'throw()' removed,
but it was still present in Attr.h.

Somehow the buildbots missed this. clang merely warns about
a missing 'throw()' specification and suggested a Fix-It adding
it back, but gcc 4.5 is not so forgiving and gives an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152167 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ttr.h
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.h
xprObjC.h
SAPI.h
ecursiveASTVisitor.h
tmt.h
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
ecl.h
ype.h
81e722e2c1195a90825ceaaa90f4a14b7df09b41 06-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> NamespaceDecl: Call non-virtual method inside virtual method, not the other way round.

Moves the virtual call out of a hot path during lookup, no other functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152124 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
faa7fac3f8627f53f2c5aa06f0ad8832098872f5 06-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use newly introduced const-goodness of TinyPtrVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152108 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
eclCXX.h
c112b9ce0aa54607c3bbad6db1c21da6bb786b58 06-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move clang/Basic/UsuallyTinyPtrVector.h to llvm/ADT/UsuallyTinyPtrVector.h.

Depends on llvm commit r152090.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152091 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
792777c9028e5fc583a83fb3620c2f9e4f7ed1f9 06-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move include/clang/AST/UsuallyTinyPtrVector.h -> include/clang/Basic/UsuallyTinyPtrVector.h
and add an erase method to it.

Patch by Andrew Craik!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152082 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
suallyTinyPtrVector.h
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.h
tmt.h
7034fb6c7be710883a970f82cb2da97bf1cf5cda 05-Mar-2012 Daniel Dunbar <daniel@zuster.org> ASTContext: Don't use nothrow specifications on the new operators for allocating
from the ASTContext.
- Doing so requires the compiler to generate null checks against the returned
result, but the BumpPtrAllocator never returns null pointers.
- The optimizer can usually eliminate such checks, but not always, so this
gives us tighter codegen in some places.
- It would be really nice if we could just use __builtin_unreachable or
something to tell the optimizer that the allocator never returns null, but
LLVM isn't currently that smart.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152060 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
234fe654a3dd2888be42ae5db34db96c5c2c4ba3 05-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a small difference in sema and codegen views of what needs to be output.

In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.

This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152024 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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
ecl.h
23f0267e2d56c0407f12e62df3561ecf75d74e6e 01-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Implement "optimization" for lambda-to-block conversion which inlines the generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap.

Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151797 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclObjC.h
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.h
441b3bb6eb3b43f5ad740d5cc6ad5c27823b6681 29-Feb-2012 Eric Christopher <echristo@apple.com> Add some iterators for grabbing lambda expression contexts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151701 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
361ae9a83e1e3098adabaaad34d0925b30358f38 27-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Just drop the bitfield from ExtProtoInfo, this struct isn't even heap allocated so it doesn't hurt.

MSVC < 10 still has the signed enum bitfield bug, making the top bit unusable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151545 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
1ebae62697cd634c4134e61bac3823584f8c403a 27-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Speculatively attempt to work around a hypothetical but unreproduced MSVC issue
in r151494.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151544 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
xprObjC.h
bb8a897f350f46475f36140480e82289f6baa020 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move CharacterLiteral, FloatingLiteral and UnaryExprOrTypeTraitExpr flags over into Stmt.

Apply the inheritance-padding trick to FloatingLiteral.
Shrinks CharacterLiteral from 32 to 24 bytes and the other two from 40 to 32 bytes (x86_64).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151500 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
91219326471798c7d3b02dc48691581580338969 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Make clever use of padding to shrink IntegerLiterals.

Inheritance allows us to use padding across classes.
40 -> 32 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151499 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0840f2378e9b5764755c5dffd27d7878c7606a0c 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Bit pack StringLiteral.

48 -> 40 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151498 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
bbf4b22b3166e5065f4475006d83678e3e1d00a3 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Reduce padding in MemberExpr.

56 -> 48 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151497 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
3654c6993697a30af0c5a472963fe8c03e622b98 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> CompoundLiteralExpr: Pair a bool with a pointer.

48 -> 40 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151496 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a72c352e4950cb487942427550777378b68dc078 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Shuffle members of DesignatedInitExpr to avoid padding.

40 -> 32 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151495 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0e2e13f4daa71edac982633120531333b45e77b5 26-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Bit pack ExtProtoInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151494 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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
eclCXX.h
ec79d877c1998366480d97a7a6c94e15c053edd8 24-Feb-2012 Douglas Gregor <dgregor@apple.com> Two minor, related fixes for template instantiation with blocks:
- Make sure that the block expression is instantiation-dependent if the
block is in a dependent context
- Make sure that the C++ 'this' expression gets captured even if we
don't rebuild the AST node during template instantiation. This would
also have manifested as a bug for lambdas.

Fixes <rdar://problem/10832617>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151372 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xprCXX.h
ecursiveASTVisitor.h
tmt.h
f64bc202a2bcdf7b10f418ad52aaa7366c8ffef9 23-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c++: Type of an objc string literal is NSString, not 'id'.
// rdar://10907410


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151296 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
97df54e0c075bc8d6a869597e771dad0c11a2180 23-Feb-2012 Douglas Gregor <dgregor@apple.com> Pull the OpaqueValueExpr's source expression into its constructor, so
that we can correctly compute value-dependence of the OVE.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151291 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
eclBase.h
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
STContext.h
eclCXX.h
perationKinds.h
76f3f69db1416425070177243e9f390122c553e0 22-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [expr.call]p11: If the operand to a decltype-specifier is a
function call (or a comma expression with a function call on its right-hand
side), possibly parenthesized, then the return type is not required to be
complete and a temporary is not bound. Other subexpressions inside a decltype
expression do not get this treatment.

This is implemented by deferring the relevant checks for all calls immediately
within a decltype expression, then, when the expression is fully-parsed,
checking the relevant constraints and stripping off any top-level temporary
binding.

Deferring the completion of the return type exposed a bug in overload
resolution where completion of the argument types was not attempted, which
is also fixed by this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151117 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
f775c7b0575446920d03366abd1f5b5188a7eade 22-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make sure Stmt::dump() is included in libclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151102 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
eclCXX.h
b5f2c419842d016892b9c976d4d6e91880e0e43a 21-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Also mark Type's dump() as 'used' to make it available in libclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151037 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0ee7d94ece918f22e67d0f09fcbc631c91091adc 21-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Mark a few 'dump' methods as 'used' to make sure they are included in libclang
and useable while debugging.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151033 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
STContext.h
eclCXX.h
xprCXX.h
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
eclObjC.h
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.h
eclCXX.h
xprCXX.h
ambdaMangleContext.h
c93dc7889644293e318e19d82830ea2acc45b678 20-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import IntrusiveRefCntPtr<> into clang namespace

The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150958 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
213d70b58b4f48050c3e545ce1bd4b0ec3af74be 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Diagnose uses of deleted destructors and inaccessible defaulted destructors.

We had two separate issues here: firstly, varions functions were assuming that
they did not need to perform semantic checks on trivial destructors (this is
not true in C++11, where a trivial destructor can nonetheless be private or
deleted), and a bunch of DiagnoseUseOfDecl calls were missing for uses of
destructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150866 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
tmt.h
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.h
84fa9cd13c2b260937625b6ad7445af7f7648565 17-Feb-2012 John McCall <rjmccall@apple.com> Add a castAs<U> accessor to CanQual<T>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150786 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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.h
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
xprCXX.h
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
xprCXX.h
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
xprCXX.h
c874ca1c7378d62aff008d74cf744636730f2db4 16-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the RecursiveASTVisitor to not traverse C++ default parameters twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150651 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
STContext.h
eclCXX.h
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.h
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
perationKinds.h
011d8b93b7cfa8492b8a9c909a850d6577e08dca 15-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement indexing support for lambdas in libclang (both kinds), as
well as improving the RecursiveASTVisitor's walk of lambda
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150549 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
0bdb5aa1a3384d194b0e14a9ecbe3309ff33daa3 14-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Refactor out new function EmitInitializerForField from EmitMemberInitializer. The new function will be used to initialize the fields of lambda expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150451 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
xprCXX.h
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.h
xprCXX.h
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
STContext.h
ecl.h
eclCXX.h
xprCXX.h
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.h
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.h
ype.h
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
ecl.h
xpr.h
xprCXX.h
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.h
6d968363877388f0a0268711d59367907b465ae1 10-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Indexing API: Fully index implict template instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150267 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
1da95dbf2a341faec43439802b23a4f847baa6ad 10-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Update MultiplexASTMutationListener with the missing methods from ASTMutationListener.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150265 91177308-0d34-0410-b5e6-96231b3b80d8
STMutationListener.h
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
ype.h
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
STContext.h
eclCXX.h
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.h
f94d392847fb183b3012dbcb2e372b586c80b9fb 09-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Kill the brief and full explanation fields from StaticDiagInfoRec. They were unused and wasted space for nothing.

- per PR11952.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150199 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
cdd1c2ec981a13cf9cfde7f5bc1f7c05af222bbf 09-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a typo in the LambdaExpr class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150139 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
76e3da57b0e8cf72d221f44d54566ef206341668 08-Feb-2012 Douglas Gregor <dgregor@apple.com> When completing a lambda expression, make sure to check and attach the
body of the lambda to the function call operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150087 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
46e75477bd24a703da11d354587c9bea69d6888f 08-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] For CXXOperatorCallExprs, give a valid source location to the DeclRefExpr
that is referencing the member function, so we can index the referenced function.

Fixes rdar://10762375&10324915 & http://llvm.org/PR11192

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150033 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
ype.h
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.h
anonicalType.h
ecl.h
eclarationName.h
angle.h
estedNameSpecifier.h
ype.h
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.h
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
xprCXX.h
ecursiveASTVisitor.h
ype.h
e91e0ae772004912285ccc3848b27208da8c045b 07-Feb-2012 Chris Lattner <sabre@nondot.org> tidy up code, make the common case (1-byte strings) come first


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149942 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e97c58d1f64fca38055deb6669b55f90ae8890ca 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Minor comment clarification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149931 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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
ypeLoc.h
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.h
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
anonicalType.h
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
angle.h
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.h
7af19b817ba964ac560b50c1ed6183235f699789 05-Feb-2012 NAKAMURA Takumi <geek4civic@gmail.com> Try to fix Benjamin's r149781 on MSVC.

MSVC has complained the definition of "inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, CanQualType T)" in clang/AST/CanonicalType.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149797 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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.h
ecl.h
eclarationName.h
angle.h
estedNameSpecifier.h
ype.h
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.h
282e7e66748cc6dd14d6f7f2cb52e5373c531e61 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> In C++11 mode, when an integral constant expression is desired and we have a
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.

Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.

In passing, fix static_assert to perform a contextual conversion to bool on its
argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149776 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
ype.h
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.h
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.h
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.h
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
xpr.h
xprCXX.h
tmt.h
emplateBase.h
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
xpr.h
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.h
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
STContext.h
xternalASTSource.h
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.h
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.h
23323e0253716ff03c95a00fb6903019daafe3aa 20-Jan-2012 DeLesley Hutchins <delesley@google.com> Delayed template instantiation of late-parsed attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148595 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ype.h
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
xpr.h
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.h
56ca8a9c0fabd65418e9b2fd85140f4ed7d3c187 17-Jan-2012 Douglas Gregor <dgregor@apple.com> Rework the way in which we (de-)serialize the declarations
corresponding to TagType and ObjCInterfaceType. Previously, we would
serialize the definition (if available) or the canonical declaration
(if no definition was available). However, this can end up forcing the
deserialization of the definition even through we might not want to
yet.

Instead, always serialize the canonical declaration reference in the
TagType/ObjCInterfaceType entry, and as part of loading a pending
definition, update the "decl" pointer within the type node to point at
the definition. This is more robust in hard-to-isolate cases
where the *Type gets built and filled in before we see the definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148323 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
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.h
eclObjC.h
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
eclVisitor.h
ecursiveASTVisitor.h
tmtVisitor.h
ypeVisitor.h
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.h
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.h
perationKinds.h
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
STMutationListener.h
a54fbf2499c7cc999e22abb9be484ce976ed9689 14-Jan-2012 Douglas Gregor <dgregor@apple.com> Replace a using declararion with a typedef in the hope of satisfying GCC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148188 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
eclTemplate.h
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
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
edeclarable.h
f785a7d611404cf4747287a2bbc59b4d0e6a5a8c 14-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce Decl::getPreviousDecl() and Decl::getMostRecentDecl(),
virtual functions that provide previous/most recent redeclaration
information for any declaration. Use this to eliminate the redundant,
less efficient getPreviousDecl() functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148184 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
eclTemplate.h
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.h
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
STContext.h
ecl.h
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.h
ype.h
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.h
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
eclObjC.h
xprObjC.h
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.h
15e17aed79163d0d40ed7914f7fe992c400d93dd 10-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Per John's comment, it makes sense to ask isLambda on any CXXRecordDecl; make sure that's safe. Get rid of a check which is now unnecessary in Sema::getFunctionLevelDeclContext().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147837 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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
ecl.h
eclBase.h
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.h
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
ecl.h
eclBase.h
f143ffc4a9af79ac1d822fea6995af4bf45d17dc 06-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce a "Hidden" bit into Decl, to track whether that declaration
is hidden from name lookup. The previous hack of tweaking the
ModulePrivate bit when loading a declaration from a hidden submodule
was brittle.

Note that we now have 34 bits in Decl. I'll fix that next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147658 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
71207fc0470e1eee40a2951cd5cc3ff47725b755 05-Jan-2012 Ted Kremenek <kremenek@apple.com> After further discussion, rename attribute 'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147622 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
eclBase.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
ec9ea7200718478e8a976529defbe21942a11c9c 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work. Tweak the Sema interface slightly. Start adding the pieces to build the lambda class and its call operator. Create an actual scope for the lambda body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147595 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
b6cc6d728e9b151defe9e6041aaeb000f6e20c24 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Change casting slightly to avoid warnings about casting away const.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147589 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
da611a74c408af0f9526acc690b85214bf180852 05-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: When issuing warning for missing synthesis for
properties in classes declared with objc_suppress_autosynthesis
attribute, pinpoint location of the said class in a note.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147562 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
e23dcf3524fe01208cc79e707412f0a5dd8eed7b 03-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: introduce objc_suppress_autosynthesis class
attributes for later use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147457 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
dcbe5f71dfffa4540a367d7f1effb5a717d6c4c3 02-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Small refactoring so that only one of the mergeVisibility/mergeLinkage functions
calls setVisibility/setLinkage.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147423 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a28cb3ee88946deeb8e58d41c1e75de2d93e9cbd 02-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ObjCProtocolDecl's end-of-definition location. It is not
used anywhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147422 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ec1a58b201b3276966aaade8ac3ac4705aba96c2 02-Jan-2012 Douglas Gregor <dgregor@apple.com> Move ObjCProtocolDecl::EndLoc into its DefinitionData, and give
ObjCProtocolDecl proper source-range information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147420 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
eclObjC.h
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
eclObjC.h
ecursiveASTVisitor.h
3937f87e53b3ee0c8da93536f48f6f96c006309d 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ASTMutationListener::UpdatedAttributeList, which is no
longer needed now that we aren't back-patching ObjCProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147413 91177308-0d34-0410-b5e6-96231b3b80d8
STMutationListener.h
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
eclObjC.h
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
eclObjC.h
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
eclObjC.h
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
eclObjC.h
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
xpr.h
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
eclObjC.h
ecursiveASTVisitor.h
ff91d240d431afbec18e25909caaf5c17f26e643 23-Dec-2011 Nico Weber <nicolasweber@gmx.de> Fix several issues related to specializations and explicit instantiations.

Explicit instantiations following specializations are no-ops and hence have
no PointOfInstantiation. That was done correctly in most cases, but for a
specialization -> instantiation decl -> instantiation definition chain, the
definition didn't realize that it was a no-op. Fix that.

Also, when printing diagnostics for these no-ops, get the diag location from
the decl name location.

Add many test cases, one of them not yet passing (but it failed the same way
before this change). Fixes http://llvm.org/pr11558 and more.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147225 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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
xpr.h
ype.h
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.h
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.h
97bbab2df74cbfe221fb20454738d607a41f3ca4 21-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> objc, objc rewriter. Fixes couple of bugs one
because of recent refactoring and one in the
rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147070 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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
ttr.h
ecl.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xprCXX.h
angle.h
fc529f7fcafe7da0b8a32621e13685891e8ce52a 19-Dec-2011 Douglas Gregor <dgregor@apple.com> Once we have fully deserialized a redeclaration chain for something
with a definition pointer (e.g., C++ and Objective-C classes), zip
through the redeclaration chain to make sure that all of the
declarations point to the definition data.

As part of this, realized again why the first redeclaration of an
entity in a file is important, and brought back that idea.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146886 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
ecl.h
xpr.h
672b3232f7b0cc5dc024a7702be1a26885fdea57 17-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a sanity check in the Redeclarable::redecl_iterator to avoid infinite loop
when we formed an invalid redeclaration chain due to a bug.

Thanks to Doug for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146816 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
37f953f021c67e3b97f1ef38e1ef3cb08bd9d146 16-Dec-2011 Douglas Gregor <dgregor@apple.com> Add missing header change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146764 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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
ype.h
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.h
eclObjC.h
05c272fed899b8d3142cf080e86a235fc6168862 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Move ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it only
applies to an actual definition. Plus, clarify the purpose of this
field and give the accessor a different name, since getLocEnd() is
supposed to be the same as getSourceRange().getEnd().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146694 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
eclObjC.h
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.h
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
eclObjC.h
dec1cc4ec73e96f315ab7dee51459700c0ad821d 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Two null Decl*'s don't refer to the same declaration, because they
don't refer to anything. Amusingly, we were relying on this in one
place. Thanks to Chandler for noticing the weirdness in
declaresSameEntity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146659 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
161794732195881c33305f701f6e58721998541f 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Provide a default constructor for ObjCInterfaceDecl::DefinitionData
that value-initializes all of its members for which
default-initialization does not suffice. This should clean up the
failures for compilers that do not implement C++ DR543:

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#543

and, therefore, implement very unfortunate semantics for
value-initialization of classes with implicitly-declared, non-trivial
default constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146658 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
eclObjC.h
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
eclObjC.h
eaa9511dd2bcb0c7f90f47a236a91c82048f484e 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Replace Decl::isSameEntityAs with a free function declaresSameEntity, which can cope with NULL pointer values

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146613 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
c896ad064fd6ee73a7e0536d94df77b2cc7313b6 14-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce Decl::isSameEntityAs(), to help compare declarations using
their canonical Decl nodes. Not used yet, but it will be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146591 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
eclObjC.h
e422e45a6a89d450b8eca10f671b49874e87617a 13-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Indexing API: Fix indexing of missed references.

rdar://10567864&10567916

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146497 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecl.h
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
xpr.h
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
xpr.h
2def77399ab3088106a2d61372344f5b7104e1a2 09-Dec-2011 David Blaikie <dblaikie@gmail.com> Add notes for suppressing and (if it's a zero-arg function returning bool) fixing the function-to-bool conversion warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146280 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
eclObjC.h
0e35b4ecee380c2b4c33d75da6bc2fb6f6bc7df3 07-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> DeadStoresChecker: when whitelisting dead initializations with constants, look
for a foldable constant rather than an IR-level constant. This is still far too
liberal, but is a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145990 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b92e5d0acbb21e57498fcc4157e108a50c82b857 06-Dec-2011 John McCall <rjmccall@apple.com> Fix an extremely stupid bug causing terrible miscompilations
of &= on pseudo-objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145904 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
ecl.h
42d6d0c91ab089cb252ab2f91c16d4557f458a2c 04-Dec-2011 David Blaikie <dblaikie@gmail.com> Support decltype in nested-name-specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145785 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
0586520acb2f368c874943353a222be7f00c3068 03-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> If block literal return type is not specified, return type of the block is
inferred from return types. All the return statements have to agree about the type.
// rdar://10466373


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145774 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ecl.h
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.h
ecursiveASTVisitor.h
ecc2c090e7146c029dd9ee9a5a2fd66b275c01c0 01-Dec-2011 Douglas Gregor <dgregor@apple.com> Implement name hiding for declarations deserialized from a non-visible
module. When that module becomes visible, so do those declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145640 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
c8d7f586180995ba33d03c0f6115b6a7bdefe326 29-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Revert r145244. It causes us to create broken ASTs with missing type information
for some cast expressions.

Original commit message:

Removed useless ImplicitCast nodes in explicit cstyle and static casts


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145447 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
56f5d36fd13c5e271ebd05192c25c88d28e77f8d 28-Nov-2011 Nicola Gigante <nicola.gigante@gmail.com> Removed useless ImplicitCast nodes in explicit cstyle and static casts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145244 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
2a710c84db1ebf0c16cba0ff121ca8e15f045a07 25-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r145117 (Nov 25th 2011)

Change-Id: Id4fde985342e3c81f13887e8728bd94b82523642
c14a03dffff69b5e1c55cc118fc52d8fd9f3a28d 23-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix operations (token annotation, getting cursor, etc.) with a file region
inside an objc container that "contains" other file-level declarations.

When getting the array of file-level declarations that overlap with a file region,
we failed to report that the region overlaps with an objc container, if
the container had other file-level declarations declared lexically inside it.

Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST
and handling them appropriately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145109 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
ttr.h
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.h
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.h
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.h
32509f1e60451d86e9fbc473b6e853ba10b5fd1e 15-Nov-2011 John McCall <rjmccall@apple.com> Resolve placeholder expressions before trying to deduce
'auto'. Introduce a convenience method to make this a bit
easier, and use it elsewhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144605 91177308-0d34-0410-b5e6-96231b3b80d8
uiltinTypes.def
ype.h
c80553efdc269dabd4ed0c3210555f45729ab5dd 14-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Do not crash if a class extension in a chained PCH introduces/redeclares a property.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144520 91177308-0d34-0410-b5e6-96231b3b80d8
STMutationListener.h
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.h
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.h
1a43415b28e60e0e421ef60e254126acec7ab462 12-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a method in ASTMutationListener for the last use of Decl's [is/set]ChangedSinceDeserialization
and remove them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144466 91177308-0d34-0410-b5e6-96231b3b80d8
STMutationListener.h
eclBase.h
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
STMutationListener.h
eclObjC.h
5bbe816cd08bd28a87e8dadedf2cafb19ebf3b0b 12-Nov-2011 David Blaikie <dblaikie@gmail.com> Remove unnecessary 'else's after 'return's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144464 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
1140f7908a8e4e634873e994ddbd1fb9cb078dbd 11-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a const version of ObjCClassDecl::getForwardDecl, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144342 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6581c0b60f22f7ad010c876836e94a82eb686615 10-Nov-2011 NAKAMURA Takumi <geek4civic@gmail.com> include/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144275 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
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.h
xpr.h
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.h
xprCXX.h
tmt.h
b5adc4636f653b37891792d2a279e889dab0935f 09-Nov-2011 David Blaikie <dblaikie@gmail.com> Fixing 80 col violations (& removing any trailing whitespace on files I was touching anyway)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144171 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
estedNameSpecifier.h
ecursiveASTVisitor.h
tmt.h
tmtCXX.h
ype.h
ypeLoc.h
TableBuilder.h
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.h
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
perationKinds.h
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.h
xpr.h
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.h
xpr.h
ecursiveASTVisitor.h
tmt.h
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
eclCXX.h
1102af7beef0c9efa95ec325a1bf8ee03557c554 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
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
rettyPrinter.h
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.h
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.h
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.h
ecursiveASTVisitor.h
5668e92a176ac6a77eb62c141a2a5ad78d25de26 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the source range for ObjCInterfaces that are forward decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143343 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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
xpr.h
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
xpr.h
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
STContext.h
xpr.h
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.h
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.h
uiltinTypes.def
xpr.h
xprObjC.h
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.h
uiltinTypes.def
xpr.h
xprObjC.h
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.h
uiltinTypes.def
xpr.h
xprObjC.h
6f03371d98408cbe50b6668b2a07995e225192b8 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142906 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecursiveASTVisitor.h
tmt.h
tmtCXX.h
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
xpr.h
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
xpr.h
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.h
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.h
371a4d9c12d23b22ea18cf0957d30e3708c523d6 21-Oct-2011 Sean Callanan <scallanan@apple.com> Added documentation for the recently-added
addDecl() and makeDeclVisibleInContextInternal()
functions, and made the latter private since it
does not and should not have external clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142655 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
eclBase.h
ba49103550281ff9c92c850487e83c7a6eb43825 11-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a const version of ObjCClassDecl::getForwardDecl, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144342 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3fe0aad1a6f692f691b8f953a7d079f49dfac314 10-Nov-2011 NAKAMURA Takumi <geek4civic@gmail.com> include/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144275 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
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.h
xpr.h
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.h
xprCXX.h
tmt.h
ba243b59a1074e0962f6abfa3bb9aa984eac1245 09-Nov-2011 David Blaikie <dblaikie@gmail.com> Fixing 80 col violations (& removing any trailing whitespace on files I was touching anyway)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144171 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
estedNameSpecifier.h
ecursiveASTVisitor.h
tmt.h
tmtCXX.h
ype.h
ypeLoc.h
TableBuilder.h
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.h
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
perationKinds.h
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.h
xpr.h
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.h
xpr.h
ecursiveASTVisitor.h
tmt.h
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
eclCXX.h
dfb332d0081c6641d1dbae6a2aeff757c99cc740 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
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
rettyPrinter.h
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.h
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.h
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.h
ecursiveASTVisitor.h
d1cf3ff6c7e34fce764293cd2900fce99a60ed69 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the source range for ObjCInterfaces that are forward decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143343 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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
xpr.h
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
xpr.h
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
STContext.h
xpr.h
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.h
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.h
uiltinTypes.def
xpr.h
xprObjC.h
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.h
uiltinTypes.def
xpr.h
xprObjC.h
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.h
uiltinTypes.def
xpr.h
xprObjC.h
65019acfc46ffb191fac4e781ac0c4b8d0c8434e 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142906 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecursiveASTVisitor.h
tmt.h
tmtCXX.h
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
xpr.h
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
xpr.h
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.h
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.h
381509ea9965ab6bde9b36b4131ad08bf851d9b4 21-Oct-2011 Sean Callanan <scallanan@apple.com> Added documentation for the recently-added
addDecl() and makeDeclVisibleInContextInternal()
functions, and made the latter private since it
does not and should not have external clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142655 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
eclBase.h
097f6b008254dc7b7f89ec3daafc163bf2a0e307 18-Oct-2011 Douglas Gregor <dgregor@apple.com> Remove unused data member

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142425 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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
uiltinTypes.def
ype.h
85def357129b6cdfd69a66ad0e6994506418a2a9 18-Oct-2011 John McCall <rjmccall@apple.com> In hasPlaceholderType(Kind) and isSpecificPlaceholderType(Kind), assert
that the parameter is actually a placeholder type kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142312 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
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.h
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
eclObjC.h
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.h
ype.h
4919dfd54e2296ca997e3d1c9dab85976bba8e95 17-Oct-2011 John McCall <rjmccall@apple.com> Add a helper function for determining whether an expression
has placeholder type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142203 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
6a2ccc51d9b8357e1433e0029d544d95c5877a5c 15-Oct-2011 Ted Kremenek <kremenek@apple.com> Convert stray doxygen comments to regular comments. They logically represent the fields in FunctionProtoType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142052 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b8706f95eae8f85af01a26eee899c5daf8d6fcde 15-Oct-2011 Ted Kremenek <kremenek@apple.com> Revert "Move doxygen comments to pair with the actual values."

John convinced me this wasn't the right thing to do. I'll follow up with a second
commit to make these non-doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142051 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
eclBase.h
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.h
ype.h
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.h
tmt.h
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.h
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
STContext.h
eclObjC.h
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.h
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
STContext.h
1f528a62258ee818e3df49016bff974a1459b5d1 14-Oct-2011 Ted Kremenek <kremenek@apple.com> Move doxygen comments to pair with the actual values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141942 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ecursiveASTVisitor.h
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
ecl.h
xpr.h
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
eclBase.h
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
ecl.h
ypeLoc.h
a180f04c091bf3ede4fe292ba6a29d61da09e936 07-Oct-2011 John McCall <rjmccall@apple.com> Move type-checking for C-style casts in C into the now-misnamed
SemaCXXCast.cpp. Should have no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141336 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ecl.h
f77c49681ab347f7602b21beda8be8b39386e0d2 06-Oct-2011 Ted Kremenek <kremenek@apple.com> Hoist truncation checking for ParmVarDeclBitfields::ParameterIndex into its own helper method. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141272 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6ee5b9384533d5b3f8c18b578fccd3935e1b892f 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Clang-side build system infrastructure for multiple tblgens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141267 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
9dd0065e61ea4b48b19eee550704ce964e64e946 05-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Document ObjCMethodDecl::setMethodParams.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141216 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
xpr.h
xprCXX.h
tmt.h
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
eclObjC.h
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
eclObjC.h
xprObjC.h
electorLocationsKind.h
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
xprObjC.h
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
xprObjC.h
electorLocationsKind.h
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
xprObjC.h
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
xprObjC.h
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
eclObjC.h
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
eclObjC.h
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
xprObjC.h
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
eclCXX.h
717a20b9cebb0d261b74995f8ebf3a1c814bbc08 01-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Mark a TagDecl when it is free standing (e.g. "struct foo;")

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140894 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
55dec868977ccb89cab0286122f9345f63bb5de7 30-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr functions are implicitly const. More tests to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140831 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4213df3b5da21ce25a4541ca5c447eeb28b515a3 29-Sep-2011 Daniel Dunbar <daniel@zuster.org> Basic/Diagnostics: Split out the default warning "no-Werror" and
"show-in-system-header" bits, which is part of teasing them apart from the
diagnostic mapping kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140742 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
fcc1e50ebcb441c6c610ccd539f57c57549bd66c 28-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce non-const Decl::getParentFunctionOrMethod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140707 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
rettyPrinter.h
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.h
rettyPrinter.h
ype.h
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.h
8f944492f21a2fb61d539d933add5b1fc7b00e94 26-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Add a small note to BaseSubobject about where it is actually used.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140543 91177308-0d34-0410-b5e6-96231b3b80d8
aseSubobject.h
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.h
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
TableBuilder.h
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
TTBuilder.h
33446f1a22a662335c76e2ef7511e48f61801a35 26-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Move BaseSubobject class to AST

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140500 91177308-0d34-0410-b5e6-96231b3b80d8
aseSubobject.h
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.h
STDiagnostic.h
STImporter.h
ecl.h
eclarationName.h
angle.h
estedNameSpecifier.h
ype.h
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
ttr.h
tmt.h
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
ttr.h
ype.h
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
ttr.h
eclTemplate.h
eclVisitor.h
angle.h
ecursiveASTVisitor.h
tmt.h
tmtVisitor.h
ype.h
ypeVisitor.h
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.h
eclTemplate.h
xpr.h
ecursiveASTVisitor.h
emplateBase.h
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.h
xprCXX.h
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
ecl.h
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.h
6dc6f008994472cf4da321855e8c51c39720f3ed 13-Sep-2011 John McCall <rjmccall@apple.com> A strong property of block type has "copy" setter semantics, not "retain".
This is consistent with the behavior of assigning into a __strong l-value,
and it's also necessary for ensuring that the ivar doesn't end up a dangling
reference. We decided not to change the behavior of "retain" properties, but
just to make them warnings/errors when of block type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139619 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
265941bc308d65cc270d5c4de5806f37ce405606 13-Sep-2011 John McCall <rjmccall@apple.com> Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
their semantic attributes and then to take advantage of that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139615 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
768d6cae40ad4ff3aed5483269d068ff7a45e229 13-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Keep the source range of attributes. Depends on a llvm tablegen commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139600 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ffcc3105d223899740e79f3f8199f3881df4d1de 13-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Record the full source range of an attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139599 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
c5d9a90b3a3c16324e0cceeccec3d2993888deb6 13-Sep-2011 John McCall <rjmccall@apple.com> Don't use native atomics on ivars whose size is not a power of two,
even on architectures that support unaligned access (which is the
only way this is otherwise legal, given that ivars apparently do
not honor alignment attributes).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139590 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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
perationKinds.h
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
perationKinds.h
08e0bc16b3312c27e87d33be7dcf3d4fe5bdd2e2 10-Sep-2011 Douglas Gregor <dgregor@apple.com> Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139438 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
919814def90acecd25a35445862f0c0ff72a9b05 10-Sep-2011 Douglas Gregor <dgregor@apple.com> Introduce a new predicate Decl::isFromASTFile() to determine whether a
declaration was deserialized from an AST file. Use this instead of
Decl::getPCHLevel() wherever possible. This is a simple step toward
killing off Decl::getPCHLevel().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139427 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
xternalASTSource.h
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.h
xprObjC.h
perationKinds.h
ype.h
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
ecl.h
eclBase.h
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.h
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.h
edc41e163c8f8d0cc69a3fc017beba14262af316 06-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139128 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
e2ca828119b8bff4a5c25c6db8ee4fec558451e7 01-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try keeping a 'LeadingEmptyMacroLoc' in NullStmt. This fails
in the face of buffering C++/ObjC method bodies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138972 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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
STMutationListener.h
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
ecl.h
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.h
ype.h
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
eclObjC.h
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
eclObjC.h
2ea054fbc59ed19b8e3304e7e7cbdd56a5a5120f 27-Aug-2011 Douglas Gregor <dgregor@apple.com> Teach the ASTReader how to avoid cycles when loading declarations that
are lexically within a particular DeclContext. Test forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138668 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
6f155de99c59af890817146ec8526bafb6560f1f 26-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix getting a cursor that points inside tag definition that is part
of a type specifier.

e.g. for:

typedef struct _MyS {
int foo;
} MyS;

pointing at field 'foo' would give a cursor for the typedef declaration 'MyS'
instead of the field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138593 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
xternalASTSource.h
8ed557991fe8d51eb27e6c439030ec6ef93a2b8f 24-Aug-2011 Ted Kremenek <kremenek@apple.com> Add 'const' version of CompoundStmt::children().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138407 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
80f775359357f90f34b6adb8104506f13a816a67 22-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objc- checking for objc decl context range is unreliable and
subject to change. Check for equality instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138238 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
a28948f34817476d02412fa204cae038e228c827 22-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Restore patch I reversed in r138040. Known buildbot
failures are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138234 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
ec5bc81fd55bfcc26fc4bde6d5e33113d94c2209 22-Aug-2011 Zhongxing Xu <xuzhongxing@foxmail.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138227 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e6f07f538fd0eddd6c087fcc01d4e4ff19129c71 19-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Revers r138040. Need to look at a few buildbot failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138049 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
3dbf2f5f00cfc8b25318c119c0d39f4a49d15ebe 19-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Bring objective-c handling of decl context
to modernity. Instead of passing down individual
context objects from parser to sema, establish decl
context in parser and have sema access current context
as needed. I still need to take of Doug's comment for
minor cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138040 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
1f89b4016505045d79b53ce1204fc2c46c7d01c9 18-Aug-2011 Manuel Klimek <klimek@google.com> Fixes traversal of class template nodes on template instantiations.
Also fixes a spelling error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137945 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
eclObjC.h
427964e15f1b9595659cea3fcb4dd808a00f37b5 16-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Require explicit cursor visitation for all TypeLocs (compilation will
fail if a TypeLoc kind is not handled) and handle DecltypeTypeLoc and InjectedClassNameTypeLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137670 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
ecl.h
eclCXX.h
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.h
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.h
ecl.h
eclTemplate.h
ecursiveASTVisitor.h
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
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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
ecl.h
eclCXX.h
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.h
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.h
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.h
8e68f1c8a2919ea83c2053731d6011074f1062e1 05-Aug-2011 Roman Divacky <rdivacky@freebsd.org> Let attribute((cdecl)) and company override -mrtd default calling convention.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136971 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
d16aa4139b8e6d08c0166945ab24ce340055465c 29-Jul-2011 Douglas Gregor <dgregor@apple.com> Add a missing \endcode for Doxygen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136469 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclBase.h
a2ee20aa9660851080135219cac5b31fbac08b78 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Switch Sema::UnusedFileScopedDecls over to a LazyVector.
- Added LazyVector::erase() to support this use case.
- Factored out the LazyDecl-of-Decls to RecordData translation in
the ASTWriter. There is still a pile of code duplication here to
eliminate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136270 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
a862320972e63349524dc9aa744dec1b95f54ba1 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce a new data structure, LazyVector, which is a vector whose
contents are lazily loaded on demand from an external source (e.g., an
ExternalASTSource or ExternalSemaSource). The "loaded" entities are
kept separate from the "local" entities, so that the two can grow
independently.

Switch Sema::TentativeDefinitions from a normal vector that is eagerly
populated by the ASTReader into one of these LazyVectors, making the
ASTReader a bit more like me (i.e., lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136262 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
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
xpr.h
ype.h
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.h
d47d3b0cfeb7e8564ff77f48130fe63282b6d127 23-Jul-2011 Chris Lattner <sabre@nondot.org> clean up forward declarations of raw_ostream to use the new LLVM.h
patch by Jon Mulder!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135851 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
7107d360db751aa974285ae2136aed76b6691b86 22-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Add a missing forward declaration and namespace qualifier to this
header. This showed up in client code that has a different include
ordering after Chris's shuffle of raw_ostream. All of the Clang code
ends up with a header included before this one that provides the needed
type and using declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135765 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
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.h
eclObjC.h
9d102547dc44d064b40473a5a5166a8bb0dec99a 20-Jul-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r135574 (Jul 20th 2011)

Change-Id: Ib6cc2ba08a63e4cf8febc05fb6e3f2ca58f1d71d
db999aad8a1b9dc265b2e627be334be6580a86a3 20-Jul-2011 Chris Lattner <sabre@nondot.org> remove some now-redundant forward declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135578 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xternalASTSource.h
estedNameSpecifier.h
rettyPrinter.h
emplateBase.h
8cc488fefb2fb04bc8d5398da29f0182f97934cf 20-Jul-2011 Chris Lattner <sabre@nondot.org> add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135577 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
STContext.h
ecl.h
eclBase.h
eclObjC.h
eclarationName.h
angle.h
estedNameSpecifier.h
rettyPrinter.h
tmt.h
emplateBase.h
emplateName.h
686775deca8b8685eb90801495880e3abdd844c2 20-Jul-2011 Chris Lattner <sabre@nondot.org> now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector. This cleans up the codebase
quite a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
STDiagnostic.h
STImporter.h
ttr.h
XXInheritance.h
ecl.h
eclBase.h
eclContextInternals.h
eclObjC.h
eclTemplate.h
xpr.h
xprObjC.h
xternalASTSource.h
angle.h
tmt.h
emplateBase.h
ype.h
nresolvedSet.h
9594675cc1eb52a054de13c4a21e466643847480 20-Jul-2011 Chris Lattner <sabre@nondot.org> introduce a centralized place to introduce and inject llvm types into the
clang namespace. There are a number of LLVM types that are used pervasively
and it doesn't make sense to keep qualifying them. Start with casting
operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135574 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
tmt.h
ype.h
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.h
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
ecl.h
174cba922331b896949d02d8b1a05f1998ed98e1 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135344 at Sat. 16th July 2011.
e2f854ddd365e6837cef3e1a1b7621b32200fc71 16-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135314 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
xternalASTSource.h
cea2e3d7ea9cdc763f7a98937c09769cd4d1f582 15-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135304 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
5b8968cc599eb6100bb73ae87be9d6cd2577ac9e 15-Jul-2011 Douglas Gregor <dgregor@apple.com> Store bracket locations for array subscript expressions, from Erik Verbruggen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135275 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7110fd6c32306b3feb97b9edb8064b1b68a54e6b 15-Jul-2011 John McCall <rjmccall@apple.com> Add serialization support for SubstNonTypeTemplateParmExpr.
Also add the missing serialization support for SEHTryStmt,
SEHFinallyStmt, and SEHExceptStmt, and fix and finish the
serialization support for AsTypeExpr. In addition, change
the code so that it will no longer link if a Stmt subclass
is missing serialization support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135258 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
tmt.h
379010addb0e84fd0fbc37c829baf658958521bd 15-Jul-2011 John McCall <rjmccall@apple.com> Fix the definition of AsTypeExpr. I'm still not sure this
is right --- shouldn't there be a TypeLoc in here somewhere? ---
but at least it doesn't have a redundant QualType and a broken
children() method.

Noticed this while doing things in serialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135257 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
xprCXX.h
ecursiveASTVisitor.h
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.h
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
ype.h
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.h
9f3480bab8fcb6547978f8ad9e2b8f468e3658ee 12-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move OBJC_PR_NumBits out of PropertyAttributeKind enum, to its own NumPropertyAttrsBits.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134965 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
0a68dc7f04be1542ce249ff4adb169453698ad91 12-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [ARC] Complain about property without storage attribute when @synthesizing it, not at its declaration.

For this sample:

@interface Foo
@property id x;
@end

we get:

t.m:2:1: error: ARC forbids properties of Objective-C objects with unspecified storage attribute
@property id x;
^
1 error generated.

The error should be imposed on the implementor of the interface, not the user. If the user uses
a header of a non-ARC library whose source code he does not have, we are basically asking him to
go change the header of the library (bad in general), possible overriding how the property is
implemented if he gets confused and says "Oh I'll just add 'copy' then" (even worse).

Second issue is that we don't emit any error for 'readonly' properties, e.g:

@interface Foo
@property (readonly) id x; // no error here
@end

@implementation Foo
@synthesize x; // no error here too
@end

We should give an error when the implementor is @synthesizing a property which doesn't have
any storage specifier; this is when the explicit specifier is important, because we are
going to create an ivar and we want its ownership to be explicit.

Related improvements:
-OBJC_PR_unsafe_unretained turned out to not fit in ObjCPropertyDecl's bitfields, fix it.
-For properties of extension classes don't drop PropertyAttributesAsWritten values.
-Have PropertyAttributesAsWritten actually only reflect what the user wrote

rdar://9756610.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134960 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
386b0075d02837cba066d299adb0bbc6c3ebd2ee 11-Jul-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added removeBitWidth method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134891 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ecl.h
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
ecl.h
c5f90c2250f20037e604e849044442d70573507e 07-Jul-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Undo r134587 as the bug was actually a deep and hideous one in the
client code.

My bad.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134631 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
perationKinds.h
tmt.h
e9a37e45e2832869e3814b9e3ddeae13e0f4386a 07-Jul-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Ensure that we actually visit function parameter declarations with
RecursiveASTVisitor.

This deficiency was discovered while working with the AST matcher
framework and likely impacts other users of RecursiveASTMatcher who
previously weren't seeing these Decls in their visitation.

Patch reviewed by Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134562 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
bca01b46850f867b2f4137f25c882022b58f8471 07-Jul-2011 Douglas Gregor <dgregor@apple.com> Properly implement the scope restriction on the NRVO for
throw-expressions, such that we don't consider the NRVO when the
non-volatile automatic object comes from outside the innermost try
scope (C++0x [class.copymove]p13). In C++98/03, our ASTs were
incorrect but it didn't matter because IR generation doesn't actually
apply the NRVO here. In C++0x, however, we were moving from an object
when in fact we should have copied from it. Fixes PR10142 /
<rdar://problem/9714312>.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134548 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
7263feeb367ab55af7e9a6fd701148b1b8264dba 06-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Some code cleanup of r134522


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134529 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9dc71d2fddcd283e07d45f3894c8559e2f7dd9a7 06-Jul-2011 John McCall <rjmccall@apple.com> Fixed enum types can be complete without actually being valid to use
as scope specifiers; diagnose the attempt, rather than letting it go
to an assert. The rest of PR10264.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134479 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
3c54415a4e1db09b210a466469c72d2582ce1d83 02-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r134305 at Sat. 2nd July 2011.
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.h
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
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
estedNameSpecifier.h
tmt.h
emplateBase.h
emplateName.h
ype.h
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.h
emplateName.h
ype.h
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.h
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
eclTemplate.h
7e47e1e7e6a2b83d903c97129f27e92f584c3dc2 27-Jun-2011 Douglas Gregor <dgregor@apple.com> Reduce the size of the ExtInfo bitfield in FunctionType from 9 bits
down to 8 by restricting the maximum allowed regparm value to 6
(previously it was 7). I need the extra bit in Type to handle
instantiation-dependence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133924 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ype.h
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.h
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.h
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.h
7062281f240ef9c4fb343614fb2406532307c4a5 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133678 at Thu. 23th Jun 2011.
2b1ad8b42bbbe00a1845e566f52f1941b8dbc725 23-Jun-2011 Douglas Gregor <dgregor@apple.com> Move all of Sema's member-access-related checking out of SemaExpr.cpp
and into a new file, SemaExprMember.cpp, bringing SemaExpr.cpp just
under 10,000 lines of code (ugh). No functionality change, although I
intend to do some refactoring of this code to address PR8368 at some
point in the "near" future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133674 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
b4b7b5034bb8304ed03416635bf64c75c39889fc 22-Jun-2011 Douglas Gregor <dgregor@apple.com> Give MaterializeTemporaryExpr the exact type of the lvalue it binds
to, including cv-qualifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133618 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
xprCXX.h
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.h
xprCXX.h
ecursiveASTVisitor.h
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.h
c04985647bbd54d53b1f1219287eddce8ff530b5 20-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Remove this poor "abstraction" from the AST. Sorry! =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133426 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
6af966266235cae3287d50f1a10072bc48759ba0 20-Jun-2011 Francois Pichet <pichet2000@gmail.com> Remove more unnecessary #include <llvm/ADT/SmallVector.h>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133418 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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
ecl.h
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.h
tmt.h
a07398ed98ea2b55ad7a505a3aab18aed93b149f 16-Jun-2011 John McCall <rjmccall@apple.com> Restore correct use of GC barriers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133144 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
anonicalType.h
eclObjC.h
xpr.h
xprObjC.h
perationKinds.h
arentMap.h
rettyPrinter.h
ecursiveASTVisitor.h
tmt.h
tmtObjC.h
ype.h
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.h
fd05ca03abdfb38f78b9535d996ecc9c39d3b0db 14-Jun-2011 Peter Collingbourne <peter@pcc.me.uk> Move GlobalDecl to AST

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132973 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDecl.h
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
ecl.h
eclCXX.h
eclObjC.h
ype.h
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
eclObjC.h
45937ae10a0f70f74508165aab4f2b63e18ea747 11-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Restore 'atomic' as an attribute of objc
properties.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132866 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
e5df885367b9e122ac11c89ddfbc62375695cdab 10-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132843 at Fri. 10th Jun 2011.
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.h
b92003b3d8d6128be3daa0b3f40a042a08545644 08-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Remove 'atomic' as a property attribute keyword.
It is not a sanctioned keyword and is assumed as default.
// rdar://8790791


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132753 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
308742c87e2311c3f349092e5b823c3821e61b10 04-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Reimplement r132572 on top of a FoldingSet, thus hopefully solving both
the self-host failures and Chandler's concerns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132622 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7b33c2b3908b178511ccaace8cacb5e5b14552a9 04-Jun-2011 Nick Lewycky <nicholas@mxc.ca> Remove extraneous "virtual" keyword and non-virtual destructor. Caught by
-Wnon-virtual-dtor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132619 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
ecursiveASTVisitor.h
c5c9b538de70124a57bee0adbfdd7853a582176e 03-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert r132572 to figure out why it broke selfhost and clean it up as
suggested by Chandler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132593 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
8fd7722fce4e4f9549897699ec3a4c752613b214 03-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Begin implementing a cache of special member lookups. Currently only
destructors are implemented but other special members are on the way,
which is where the real benefits of this will be visible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132572 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
eclCXX.h
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.h
anonicalType.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
848afb0c1ff4571ca7a21927ecc2699ea2e7429a 24-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131958 at Tue. 24th May 2011.
4d509341bd5db06a517daa311379f52bb540bc34 21-May-2011 Eli Friedman <eli.friedman@gmail.com> Fix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,
and stop abusing the multi-level dereference isa<> used to allow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131804 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
STContext.h
anonicalType.h
ype.h
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.h
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.h
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.h
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.h
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.h
d01d2b2de449d68e6c44d99a12c0c1fc53222113 14-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131335 at Sat. 14th May 2011.
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.h
xpr.h
7999991060b136db49eb9d6b34595383de56278c 13-May-2011 Peter Collingbourne <peter@pcc.me.uk> Add a ConstStmtVisitor class

ConstStmtVisitor is a constness-preserving variant of StmtVisitor.
ConstStmtVisitor and StmtVisitor share an implementation using a common
base class, StmtVisitorBase, which uses a template template parameter
to build pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131280 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
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.h
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
ype.h
5762c0bec6b73a7f6360a71b94b07b7ba0e4b5e8 13-May-2011 Nick Lewycky <nicholas@mxc.ca> Add a method to query whether or not a class has a default constructor declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131255 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
001cad932380419c6fbfecbeec63e0579f5ecbf3 10-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Further implement defaulting constructors.

Focus is on default constructors for the time being. Currently the
exception specification and prototype are processed correctly. Codegen
might work but in all likelihood doesn't.

Note that due to an error, out-of-line defaulting of member functions is
currently impossible. It will continue to that until I muster up the
courage to admit that I secretly pray to epimetheus and that I need to
rework the way default gets from Parse -> Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131115 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
ecl.h
eclCXX.h
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
eclCXX.h
377e1bd6853118c5b1718503569e5179c40f09b7 08-May-2011 Douglas Gregor <dgregor@apple.com> Relax the conversion rules for Objective-C GC qualifiers a
bit by allowing __weak and __strong to be added/dropped as part of
implicit conversions (qualification conversions in C++). A little
history: GCC lets one add/remove/change GC qualifiers just about
anywhere, implicitly. Clang did roughly the same before, but we
recently normalized the semantics of qualifiers across the board to
get a semantics that we could reason about (yay). Unfortunately, this
tightened the screws a bit too much for GC qualifiers, where it's
common to add/remove these qualifiers at will.

Overall, we're still in better shape than we were before: we don't
permit directly changing the GC qualifier (e.g., __weak -> __strong),
so type safety is improved. More importantly, we're internally
consistent in our handling of qualifiers, and the logic that allows
adding/removing GC qualifiers (but not adding/removing address
spaces!) only touches two obvious places.

Fixes <rdar://problem/9402499>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131065 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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
ecl.h
eclCXX.h
5f3827cabd526d0dd5f291d46c310103cebe7a44 06-May-2011 Eli Friedman <eli.friedman@gmail.com> Fix a couple of comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130994 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fe2695eec167b28578825576863228f86b392f24 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Do defaulted constructors properly.

Explictly defaultedness is correctly reflected on the AST, but there are
no changes to how that affects the definition of functions or much else
really.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130974 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
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
eclCXX.h
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
eclTemplate.h
ecursiveASTVisitor.h
ype.h
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
eclCXX.h
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.h
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.h
fe57eef44cc80e5bb51e4f484835be08b8d84256 04-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a better version of delegating constructor cycle detection.

This is more efficient as it's all done at once at the end of the TU.
This could still get expensive, so a flag is provided to disable it. As
an added bonus, the diagnostics will now print out a cycle.

The PCH test is XFAILed because we currently can't deal with a note
emitted in the header and I, being tired, see no other way to verify the
serialization of delegating constructors. We should probably address
this problem /somehow/ but no good solution comes to mind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130836 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
fa74c2344addf92826c938758fb4dc612a004eb9 04-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Ensure that delegating constructor loop detection uses canonical
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130821 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
1dd986dff9ddfbec687975700770bb377988e9ed 03-May-2011 Richard Trieu <rtrieu@google.com> Added an assert to IntegerLiteral to ensure that the integer type passed in has the same size as the APInt passed in. Also, updated the comments around IntegerLiteral.

Changed the integer type that range-based for-loops used. Switched to pointer difference type, which satisfies the new assert in IntegerLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130739 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
7079886ab5a9df450ed773419f0ae81f8404e2aa 02-May-2011 John McCall <rjmccall@apple.com> Revise the representation of parameter scope data so that the
scope depth overlaps with the ObjCDeclQualifier, dropping
memory usage back to previous levels.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130671 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
xpr.h
tmt.h
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
ecl.h
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.h
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.h
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.h
tmt.h
5d65e34b08b3e57a4da834195757d0d15baaffd0 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Switch getAs to castAs (didn't know about this before!) and simplify
some code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130665 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
960d13dde337a59dacc9dc3936c26d4aa8478986 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Based on the new information in the AST provided by r130628, write
3 lines of code and improve a bunch of information in the libclang view
of the code.

Updates the two tests that exercise this with the new data, checking
that each new source location actually points back to the declared
template parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130656 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
aaf147be3cc7403d8f7889d363421bb291ef23f2 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Move several more type traits' implementations into the AST. A few were
already present in the AST, and I added the ones that weren't.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130655 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
336f51e463340dc7b159bc38517ac4a68081302d 01-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve traversing of BlockExprs in RecursiveASTVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130650 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
059ce0d92eb5a7da900ae735dc0a2ea3d64f4b0b 01-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fully implement delegating constructors!

As far as I know, this implementation is complete but might be missing a
few optimizations. Exceptions and virtual bases are handled correctly.

Because I'm an optimist, the web page has appropriately been updated. If
I'm wrong, feel free to downgrade its support categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130642 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
xprCXX.h
09e2c524a18435211cfbc2fb355f91e1ac43ea89 01-May-2011 John McCall <rjmccall@apple.com> Improve the documentation for the two ObjCDeclQualifiers so that I
stop considering whether I can compress them. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130633 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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
anonicalType.h
ype.h
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.h
anonicalType.h
eclTemplate.h
ype.h
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.h
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.h
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.h
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.h
ype.h
654f6b2b53af2c950c62ef0161fa021648accbcb 30-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a couple of assertions to make sure the bitfields can fit the value assigned to them. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130573 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
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.h
f79a71908d6f28cb2bc0c081d9a801ed14d61d82 29-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Add a decl update when a static data member of a class template is instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130488 91177308-0d34-0410-b5e6-96231b3b80d8
STMutationListener.h
e9b5f3d4acfc2ad6e8b65a4072464e997dea9ed3 29-Apr-2011 Ted Kremenek <kremenek@apple.com> Enhance clang_getCXTUResourceUsage() to report the sizes of the memory buffers used by PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130460 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
25aaf28c5bec71d5d005df67ee78b908ba5940f4 28-Apr-2011 Manuel Klimek <klimek@google.com> Fixes ArrayTypeTraitExpr (-Wnon-virtual-dtor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130407 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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
ecursiveASTVisitor.h
tmt.h
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
ype.h
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
xprCXX.h
ecursiveASTVisitor.h
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.h
ype.h
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.h
b7d98d35ea723624345f06e5895ddce2e0388ef0 27-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> If a null statement was preceded by an empty macro keep its instantiation source location
in NullStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130289 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
xpr.h
ype.h
7a3a8148ab21dba3965622b03969bae721d561e2 26-Apr-2011 NAKAMURA Takumi <geek4civic@gmail.com> include/clang/AST/StmtIterator.h: std::pair should be provided by <utility>. libcxx needs it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130183 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
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
valuatedExprVisitor.h
xprCXX.h
ecursiveASTVisitor.h
74b485a2b36c0ba33a85ba9cb6e36e0e3a1fada1 24-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Set the correct anonymous namespace (must be last reopening), and behave correctly in the presence of the ever-annoying linkage specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130105 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
58a2cd8c0d52e710cbcc57a67eac7b51b0b831c4 24-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Synthesizing the definition of an implicit member is an AST modification, so notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130103 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
STMutationListener.h
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
ecl.h
eclCXX.h
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.h
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
xpr.h
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.h
ype.h
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.h
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.h
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.h
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.h
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
xpr.h
61e0b94838127601718c64b80940868d4b995e1f 19-Apr-2011 Ted Kremenek <kremenek@apple.com> Add ASTContext::getTotalMemory() to allow clients to query how much memory is bump allocated for declarations, statements, and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129729 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7d2b8c1fcc2b707be78b09930a7767477822462f 16-Apr-2011 Douglas Gregor <dgregor@apple.com> Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129614 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
ecl.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
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
XXInheritance.h
harUnits.h
ecl.h
eclObjC.h
xpr.h
xprObjC.h
ype.h
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.h
ecursiveASTVisitor.h
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.h
ecl.h
xprCXX.h
rettyPrinter.h
ecursiveASTVisitor.h
tmtCXX.h
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
ype.h
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
STMutationListener.h
eclTemplate.h
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.h
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
eclObjC.h
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.h
perationKinds.h
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.h
perationKinds.h
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.h
perationKinds.h
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.h
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.h
perationKinds.h
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
ype.h
ec7346077c1fb423c9279771675c098bc2dffc92 09-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Properly traverse a ObjCMethodDecl in RecursiveASTVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129169 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
eclObjC.h
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.h
xpr.h
perationKinds.h
ype.h
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.h
9a7319305fc25222b91d585dfa056c8cdbac8434 06-Apr-2011 Nowar Gu <nowar100@gmail.com> Merge upstream until 2011.04.05.
d40066b0fb883839a9100e5455e33190b9b8abac 05-Apr-2011 Ted Kremenek <kremenek@apple.com> Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
68af13f3ca39947e3f285f864fe3b76640fddf69 30-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Fix IRGen issues related to using property-dot syntax
for prperty reference types. // rdar://9208606.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128551 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
7f3ad231bed2184694e407772689e8903068bdca 28-Mar-2011 Eli Friedman <eli.friedman@gmail.com> Remove stray null from the middle of a comment. (Found because my editor
was refusing to open the file.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128402 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
xpr.h
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.h
2234873111009eb8655d63362cedc422eb9fc517 26-Mar-2011 John McCall <rjmccall@apple.com> Allow GC qualifiers to be added/removed by conversions from/to void*
without a warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128328 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3812999df1a50e0804985c8845fcfa3fd7ffe14c 26-Mar-2011 Craig Silverstein <csilvers2000@yahoo.com> TraverseNestedNameSpecifier -> TraverseNestedNameSpecifierLoc in a few
places where we can, now. OK-ed by dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128307 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
ttr.h
ecl.h
eclBase.h
97d2d2e368d3ead34d83c328383711c7dabab60a 22-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127980 (Mar 20th 2011)
4f32786ac45210143654390177105eb749b614e9 21-Mar-2011 Ted Kremenek <kremenek@apple.com> Improve crash recovery cleanup to recovery CompilerInstances during crash recovery. This was a huge resource "root" during crashes.

This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct
ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance
object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128011 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
8e02635c9c276720a1e6f926b33303a53cebe9c7 18-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127869 (Mar 18th 2011)
f899af662801ee6bb82be871eb0b8d19b61503ba 19-Mar-2011 Ken Dyck <kd@kendyck.com> Add pre- and post-increment/decrement operators to CharUnits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127937 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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.h
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.h
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
rettyPrinter.h
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.h
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.h
d05c2006f2fca763be9680ab673f7c66adbf90a1 13-Mar-2011 Anders Carlsson <andersca@mac.com> Change GetNullarySelector and GetUnarySelector to take a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127571 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
xprCXX.h
ype.h
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
ype.h
796aa443ab5ed036f42ef33fed629e1b4b34871b 12-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Forgotten part of previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127536 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
06dec892b5300b43263d25c5476b506c9d6cfbad 12-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Renamed OffsetOfNode::getRange to getSourceRange for uniformity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127534 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
valuatedExprVisitor.h
xpr.h
ecursiveASTVisitor.h
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
ecl.h
eclCXX.h
eclTemplate.h
27d70656d3ce7c9e030b6dea468cfc96687010d5 09-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream (Nov 6th 2011)
eecf5fa12d5426637c47d7072f0c193a8d7ff68b 09-Mar-2011 John McCall <rjmccall@apple.com> Add a bit to ParmVarDecl indicating whether the parameter undergoes
K&R-style default argument promotion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127313 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclCXX.h
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.h
eclCXX.h
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
ecl.h
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.h
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
ecl.h
eclCXX.h
eclObjC.h
eclTemplate.h
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.h
ype.h
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
ecl.h
eclCXX.h
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
ecl.h
eclTemplate.h
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
ype.h
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
ype.h
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
ype.h
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.h
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.h
b6ab6c1ca733fda2302a1c5066bdfc6218c89e41 05-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Improved MemberPointerType source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127085 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
eclTemplate.h
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.h
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.h
8fbb7628e9fc364bbfb65bdf2c2468b0d06a7e5b 04-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed end location of FriendDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126993 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
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.h
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.h
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.h
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.h
0a9beb52baa6c990d45d638a177d9456e650282a 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Force CaseStmt to store its child statements in source-code order,
which is important for libclang's token-annotation and
where's-my-cursor functionality. Fixes <rdar://problem/9004439>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126887 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
ype.h
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.h
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
ype.h
f1fe3759e6e8b1756c514f1181c86bd4b9d1666c 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Fix a thinko found by Craig Silverstein

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126850 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecursiveASTVisitor.h
emplateBase.h
46bb4f1a3ac9517406887939612eb8df4b7be006 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Eliminate some unused getQualifierRange() member functions. We deal in nested-name-specifier locations now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126842 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
xprCXX.h
ec9d42ee77dd46c7c3f33f256252a5eb3592615e 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Handle member initializer in C++ ctor. - Add a new Kind of ProgramPoint: PostInitializer. - Still use GRStmtNodeBuilder. But special handling PostInitializer in GRStmtNodeBuilder::GenerateAutoTransition(). - Someday we should clean up the interface of GRStmtNodeBuilder."
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."
30aaf442cd6161653c1bdd440a0fa87ea0378ab5 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Add an ExternalASTSource hook to complete a type on demand."
c0cf3da593547ff937874d393899bd08d66786ad 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Add another case to the whitelist of cast kinds that can convert to bool. Fixes PR8608."
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."
3c8dec3136c81c69094121b9890b7f443e4d5c56 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Increase VectorTypeBitfields::VecKind field from 2 to 3 bits. With the addition of 2 enum values for Neon vectors, this field must now hold 6 different values and so requires 3 bits. Make the NumElements field one bit smaller to compensate."
2c66aff116466318cc5959b55130cf54cc123578 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Add a separate NeonPolyVector kind to distinguish polynomial vector types. Add support for mangling those types according to ARM's ABI."
377e99a861ca177cf1202cb4cb4e0210f12f1ec6 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "API enhancements to TypeLocBuilder."
9bcfacde28f00ff228afdad16189325074b42897 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself. Now we explicitly memset all of its values."
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."
eca5d22c16eb784e5f35ca816fa22e0c0e060417 02-Mar-2011 John McCall <rjmccall@apple.com> Support a new InheritableAttr subclass, InheritableParamAttr, which is
used for attributes that are okay to inherit when written on a parameter.
Dependent on LLVM r126827.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126828 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
406f98f6a5a7bde5707085af8d66204e7e76af45 02-Mar-2011 Douglas Gregor <dgregor@apple.com> When we're substituting into a parameter-type-list nested inside the pattern
of an expansion, and we have a paramameter that is not a parameter
pack, don't suppress substitution of parameter packs within this
context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126819 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
xprObjC.h
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
ecursiveASTVisitor.h
ypeLoc.h
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
ecursiveASTVisitor.h
ypeLoc.h
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
ecursiveASTVisitor.h
ypeLoc.h
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
ecursiveASTVisitor.h
ypeLoc.h
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
ecursiveASTVisitor.h
ypeLoc.h
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
ecursiveASTVisitor.h
ypeLoc.h
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
ecursiveASTVisitor.h
ypeLoc.h
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.h
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
xpr.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
a07992bb4a2c1d21ed7e4376fa6e79342be0fd18 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Remove redundant friend declaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126665 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
xprCXX.h
ecursiveASTVisitor.h
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
xternalASTSource.h
702e5474f570d0b83db9f354619b8ac5bc8ed743 28-Feb-2011 Chris Lattner <sabre@nondot.org> add a const version of this accessor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126594 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
bfdfb5a4119e1c2b173be5d0ca8a91d8c246698f 25-Feb-2011 Matt Beaumont-Gay <matthewbg@google.com> ASTStmtReader is already a friend of DependentScopeDeclRefExpr, and GCC
doesn't like re-friending.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126524 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
5e24f2a4ad3a3623349f058e99c7c71e1c8d705f 25-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Sprinkle optional text of the "unavailable' attribute
where ever such attribute causes an error diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126509 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
estedNameSpecifier.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
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
eclCXX.h
ecursiveASTVisitor.h
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.h
ecl.h
estedNameSpecifier.h
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
eclCXX.h
estedNameSpecifier.h
ecursiveASTVisitor.h
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.h
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
estedNameSpecifier.h
ecursiveASTVisitor.h
b80f66847d103aee7988b791a380fc563bf89a19 23-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> DeclGroup's operator[] always returned the first Decl in the group.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126268 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
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.h
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.h
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.h
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.h
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.h
ecl.h
eclTemplate.h
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.h
xprCXX.h
c8da1ecaf58ff41b652dd53331aace948027039b 20-Feb-2011 Oscar Fuentes <ofv@wanadoo.es> New function for tablegenning: clang_tablegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126093 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
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.h
ecl.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
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.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
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.h
0656e5b9aa52f2a90fb38517e504b4eebbe53381 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Check for NULL child expressions before visiting them, as the first
thing the visit does is dyn_cast<>, which leads to a nasty segfault.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125993 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
16f744beaaa30bf3847740ca8e8beb6f0d3a0b93 18-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTContext::getLogicalOperationType() to return bool or int, depending on language.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125957 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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
ecl.h
8c99d88a6cfa14fc2edab819d5e4325c973b2809 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Replace a FIXME with a comment describing why we did what we did

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125757 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
eclCXX.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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.h
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.h
ecursiveASTVisitor.h
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
ecl.h
eclBase.h
eclObjC.h
eclTemplate.h
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
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
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
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
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.h
eclBase.h
xpr.h
ecursiveASTVisitor.h
tmt.h
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
ecl.h
eclBase.h
eclObjC.h
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.h
eclBase.h
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.h
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
ecordLayout.h
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
valuatedExprVisitor.h
ecursiveASTVisitor.h
tmtIterator.h
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.h
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.h
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
angle.h
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.h
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.h
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
angle.h
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
angle.h
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
xprCXX.h
ecursiveASTVisitor.h
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.h
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.h
xprCXX.h
xprObjC.h
ecursiveASTVisitor.h
tmt.h
tmtCXX.h
tmtIterator.h
tmtObjC.h
dec5b63c200b108851bb6486bb10060bce276414 09-Feb-2011 Ken Dyck <kd@kendyck.com> Correct units in comments describing Size and getSize().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125158 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
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
ecordLayout.h
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.h
ecursiveASTVisitor.h
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.h
xprCXX.h
tmt.h
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.h
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.h
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.h
ecl.h
xpr.h
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.h
8b789139167d721e3ef1e3d433eabeb351c36fad 05-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> -Wselector should warn on implemented selectors only
when selector metadata is generated, which is triggered
by at least on class implementation. This is to match gcc's
behavior. // rdar://8851684.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124909 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
xprCXX.h
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.h
xpr.h
2a7c12ccbecbf95840d073e3524e2d56e599913e 01-Feb-2011 Ken Dyck <kd@kendyck.com> Correct units in doxygen comment for NonVirtualSize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124647 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
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
ecordLayout.h
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
eclCXX.h
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.h
418df343bb50802586d20aae3b83e2eb44c6c828 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Separate the access-control diagnostics from other diagnostics that do not have SFINAE behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124441 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
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.h
d0370f59e79702ac908c81bf556519f91e9ca297 27-Jan-2011 John McCall <rjmccall@apple.com> Provide Type::castAs<>, which is to getAs<> what cast<> is to dyn_cast<>.
Also provide a method to grab the base element type of a type without
stressing out over qualifiers (but give it a nice scary name).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124367 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2c9a03f3b249e4d9d76eadf758a33142adc4d0a4 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this: implement the implicit conversion rules
for the implicit object argument to a non-static member function with
a ref-qualifier (C++0x [over.match.funcs]p4).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124311 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
192e7f7e7f0493f7cdfda1d752e6de340d4e3ffe 26-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Move InheritableAttr::isInherited to Attr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124299 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
fa75e614683e94ff2e0bd651b1722935a2507758 26-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Remove Attr::isMerged; it is not used any more and redundant with
InheritableAttr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124298 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
eclCXX.h
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.h
5aa74affa5d61d04c4b034b3722ca41aec0cba6e 25-Jan-2011 Nico Weber <nicolasweber@gmx.de> Add -add-plugin flag, which runs plugins in addition to codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124227 91177308-0d34-0410-b5e6-96231b3b80d8
STMutationListener.h
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
ypeLoc.h
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
ecl.h
eclCXX.h
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.h
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.h
a97d70b7ea9633e8cbf976510d7a9ea66f4ac96c 21-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Generalise support for non-inheritable attributes

Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time. By contrast, a non-inheritable attribute
will not be inherited by later redeclarations. Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.

Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable. This patch generalises the concept,
while removing a FIXME. Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).

The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive. Non-inheritable attributes
simply derive from Attr.

N.B. I did not review every attribute to determine whether it should
be marked non-inheritable. This can be done later on an incremental
basis, as this change does not affect default functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123959 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ecl.h
c0534b6cdc414aa86ef7e9ab37f7a81a79140f02 20-Jan-2011 Anders Carlsson <andersca@mac.com> Add IsMarkedOverride and IsMarkedFinal flags to FunctionDecl (to be used by CXXRecordDecl).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123885 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3dbdb58e2e920ad69fecbd56c25b58577ab693e8 20-Jan-2011 Ken Dyck <kd@kendyck.com> Add CharUnits::RoundUpToAlignment() to simplify rounding in character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123868 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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
tmt.h
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.h
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.h
eclTemplate.h
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.h
ype.h
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.h
STImporter.h
anonicalType.h
ecl.h
eclCXX.h
eclObjC.h
xprObjC.h
estedNameSpecifier.h
ecursiveASTVisitor.h
tmtIterator.h
ype.h
ypeLoc.h
ypeVisitor.h
69fc1b330090853ced40436805258fc9a0a70bdc 19-Jan-2011 Ken Dyck <kd@kendyck.com> Add a unary minus operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123804 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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.h
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
ype.h
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.h
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.h
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.h
emplateName.h
9c34ee65a61bbfb60ae76d4df674f49df1842e70 15-Jan-2011 Douglas Gregor <dgregor@apple.com> Tweak the storage mechanism for a set of overloaded template names in
the TemplateName class. Nothing actually changes, but I find this less
objectionable (and it will factor into an upcoming change).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123508 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.h
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.h
ecursiveASTVisitor.h
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
emplateBase.h
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
xprCXX.h
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.h
emplateBase.h
ype.h
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.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
angle.h
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.h
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.h
ttr.h
ecl.h
eclCXX.h
eclTemplate.h
eclarationName.h
xpr.h
estedNameSpecifier.h
ecordLayout.h
tmt.h
emplateBase.h
ype.h
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.h
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
emplateBase.h
10ffc00e2177f042808f507c8dd50b744ed6f738 11-Jan-2011 Douglas Gregor <dgregor@apple.com> Add testing for unexpanded parameter packs in all of the C++
expression kinds. This is (indirectly) a test verifying that the
recursive AST visitor is visiting the children of these expression
nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123198 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
66cf92a9670d57da61842adb69f9b038ce29dca5 11-Jan-2011 Matt Beaumont-Gay <matthewbg@google.com> Only traverse template argument locations if we actually have explicit
template arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123194 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
d3731198193eee92796ddeb493973b7a598b003e 10-Jan-2011 Douglas Gregor <dgregor@apple.com> Work-in-progress implementation of C++0x [temp.arg.explicit]p9, which
allows an argument pack determines via explicit specification of
function template arguments to be extended by further, deduced
arguments. For example:

template<class ... Types> void f(Types ... values);
void g() {
f<int*, float*>(0, 0, 0); // Types is deduced to the sequence int*, float*, int
}

There are a number of FIXMEs in here that indicate places where we
need to implement + test retained expansions, plus a number of other
places in deduction where we need to correctly cope with the
explicitly-specified arguments when deducing an argument
pack. Furthermore, it appears that the RecursiveASTVisitor needs to be
auditied; it's missing some traversals (especially w.r.t. template
arguments) that cause it not to find unexpanded parameter packs when
it should.

The good news, however, is that the tr1::tuple implementation now
works fully, and the tr1::bind example (both from N2080) is actually
working now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123163 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
emplateBase.h
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.h
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.h
eclObjC.h
ecursiveASTVisitor.h
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
ype.h
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
ype.h
a009b59fc2c550a229b9146aabda8e33fe3a7771 07-Jan-2011 Douglas Gregor <dgregor@apple.com> Factor out the template transformation of a sequence of function
parameters into parameter types, so that substitution of
explicitly-specified function template arguments uses the same
path. This enables the use of explicitly-specified function template
arguments with variadic templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122986 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
ype.h
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.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ypeLoc.h
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.h
eclBase.h
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
ecursiveASTVisitor.h
emplateBase.h
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
emplateBase.h
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
eclTemplate.h
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
ype.h
ypeLoc.h
2fdc5e8199e1e239620f2faae88997153703e16f 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Many of the built-in operator candidates introduced into overload
resolution require that the pointed-to type be an object type, but we
weren't filtering out non-object types. Do so, fixing PR7851.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122853 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ecursiveASTVisitor.h
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.h
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
eclCXX.h
af4bad23013532f4c94cdc27887623f45e6f7020 03-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove a couple of setters that have no callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122766 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
xprCXX.h
xprObjC.h
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.h
ecursiveASTVisitor.h
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.h
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
ype.h
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
eclTemplate.h
xpr.h
fd03843f0597de5eeced69ca9ae45c478fb2b153 23-Dec-2010 John McCall <rjmccall@apple.com> Kill RecordType::getAddressSpace() and its fixme; that's just not how
address spaces work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122511 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ype.h
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
eclTemplate.h
emplateBase.h
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.h
ecursiveASTVisitor.h
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.h
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.h
a40bc724849f9cdc6a7706bc5d230685c3bdf63c 21-Dec-2010 Douglas Gregor <dgregor@apple.com> Give the RecursiveASTVisitor a configuration function
shouldWalkTypesOfTypeLocs() that determines whether it should walk the
Types within TypeLocs. This walk is redundant, but perhaps required
for some clients. Disabling this redundant walk in the unexpanded
parameter pack finder produces better results, because we get
parameter packs with source location info *unless* such source
location information isn't available.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122287 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ype.h
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.h
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
emplateBase.h
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.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
403ba3522d1b1c97ae5fad81c1a2c4b3a754e1c1 19-Dec-2010 Nick Lewycky <nicholas@mxc.ca> Add missing standard includes. Patch by Joerg Sonnenberger!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122194 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
dd4430e596fac34e9ce44228a249f71e73effd4a 17-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Warn when synthesizing a property which is
implicitly atomic under -Wimplicit-atomic-properties
flag. // rdar://8774580


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122095 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
854fc56c95845660fccb1cb165fbf33fb9ae09a8 17-Dec-2010 Bill Wendling <isanbard@gmail.com> Initialize variables in the correct order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122084 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
2bde8273eb5730324f823945d0c2389badf325e6 17-Dec-2010 Douglas Gregor <dgregor@apple.com> Encapsulate TemplateArgument::Kind

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122083 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
c7b5ed6da7410849b51ba9a9ea04d2cc7b720f48 17-Dec-2010 Douglas Gregor <dgregor@apple.com> Swap the order of the condition and body of a do-while statement in
the AST, so that we visit them in source order. Fixes <rdar://problem/8779113>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122062 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
2e219b8d253dbb901206b14e5643cc9d0edd662b 17-Dec-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator returns a lvalue. Part 2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122030 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
c11e1d7f1eff113b8a4b2a6370975eb1dc7c9205 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Teach the RecursiveASTVisitor to traverse the type-location
information for all of the explicit casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121900 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
dda0c0dd63bb1ff4a057f1275497e844f99b7909 15-Dec-2010 Nico Weber <nicolasweber@gmx.de> Fix gcc warning: 'clang::ASTStmtReader' is already a friend of 'clang::OverloadExpr'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121852 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
bfdcdc8e26097c9dbb4c40d78296f6ccc3e6684c 15-Dec-2010 John McCall <rjmccall@apple.com> Set the "implicitly inline" bit on a method as soon as we see a definition
within the class. Teach IR gen to look for function definitions in record
lexical contexts when deciding whether to emit a function whose address
was taken. Fixes PR8789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121833 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
xpr.h
xprCXX.h
xprObjC.h
tmt.h
emplateBase.h
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
ype.h
ypeLoc.h
373920bd733b1d28fe7bf209945a62eb9248d948 14-Dec-2010 John McCall <rjmccall@apple.com> Improve some comments, shrink FunctionType::ExtInfo, and fix a bug found
by valgrind where we were doing the wrong thing in the presence of invalid
exception specs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121770 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
xprCXX.h
ype.h
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.h
xprCXX.h
ype.h
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.h
xprCXX.h
ype.h
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
eclTemplate.h
xpr.h
estedNameSpecifier.h
tmt.h
emplateBase.h
emplateName.h
ype.h
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.h
e7f85047d0dd5ebb03d851fab0afa9db07ec2925 13-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR8774 by restricting when hasInit returns true. Previously, it
would return true if the initializer pointer union had *any* non-null
pointer in it, even if the pointer wasn't one that would actually be
returned via getInit(). This makes it more accurately model the logic of
'getInit() != NULL'.

This still isn't completely satisfying. From a principled stance,
I suspect we should make hasInit() and getInit() *always* return false
and NULL (resp.) for ParmVarDecl. We shouldn't at the API level treat
initializers and default arguments as the same thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121692 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
xprObjC.h
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
xprObjC.h
5e362102f8bac7a46cf8ff4394ea29548a4c1ab0 10-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make RecursiveASTVisitor traverse a ObjCMethodDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121515 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
4472fc641ea3069463798fb56a04043c28ea2910 10-Dec-2010 Douglas Gregor <dgregor@apple.com> Replace two QualType::getTypePtrOrNull() calls with
QualType::getTypePtr(). It turns out that
cast_or_null/dyn_cast_or_null don't actually use simplify_type, so
they're guaranteed to operator on non-NULL QualType or CanQualType
objects.

Good for a 0.6% win on 403.gcc's combine.c with -emit-llvm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121495 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ype.h
1ab55e9bb87d98bff1d42c7a0ee502c64755d9f5 10-Dec-2010 Douglas Gregor <dgregor@apple.com> Eliminate the branching in QualType::getTypePtr() by providing a
common base for ExtQuals and Type that stores the underlying type
pointer. This results in a 2% performance win for -emit-llvm on a
typical C file, with 1% memory growth in the AST.

Note that there is an API change in this optimization:
QualType::getTypePtr() can no longer be invoked on a NULL
QualType. If the QualType might be NULL, use
QualType::getTypePtrOrNull(). I've audited all uses of getTypePtr() in
the code base and changed the appropriate uses over to
getTypePtrOrNull().

A future optimization opportunity would be to distinguish between
cast/dyn_cast and cast_or_null/dyn_cast_or_null; for the former, we
could use getTypePtr() rather than getTypePtrOrNull(), to take another
branch out of the cast/dyn_cast implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121489 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ecl.h
eclTemplate.h
ype.h
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.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeNodes.def
c3c0af36bac3d71f61dd758585ab307892545de4 10-Dec-2010 Douglas Gregor <dgregor@apple.com> Silence GCC warning about comparisons between enumerators of different types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121486 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ype.h
55270e4bde91bd30d16086ae71f0f65caf3b8a51 10-Dec-2010 Douglas Gregor <dgregor@apple.com> Update ExtQuals comment to reflect the expansion of the fast qualifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121477 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
34e80e94a21eb1ac2a9405d918e711e8b12256a9 10-Dec-2010 John McCall <rjmccall@apple.com> Optimize memory usage of FunctionProtoType on MSVC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121475 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ype.h
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.h
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.h
xprCXX.h
ecursiveASTVisitor.h
c46233d7775469c25af186c386fedfa6982a69d1 08-Dec-2010 Douglas Gregor <dgregor@apple.com> Fix BinaryOperator dispatch for RecursiveASTVisitor, from Benoit Perrot!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121266 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ullExpr.h
tmt.h
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.h
ecursiveASTVisitor.h
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.h
eclBase.h
edeclarable.h
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.h
eclBase.h
eclTemplate.h
edeclarable.h
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
xprCXX.h
ecursiveASTVisitor.h
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.h
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
eclTemplate.h
0e800c9c20d1a658a91096c756c4a4a9e90264fc 04-Dec-2010 John McCall <rjmccall@apple.com> Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
be required, and then fix up some missing loads on overloaded-operator
paths which that exposed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120896 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
perationKinds.h
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.h
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
ecl.h
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.h
eclBase.h
eclTemplate.h
edeclarable.h
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.h
6939fff69a3dfff2552261a1d7f1f609380fe6b0 02-Dec-2010 Douglas Gregor <dgregor@apple.com> Remove NDEBUG-controlled extra data from
TemplateArgumentLocInfo. Unfortunately, this means that we lose some
internal consistency checking when building a debug Clang. However,
having data structures change size/layout depending on NDEBUG causes
pain for clients of the Clang API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120706 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
ypeLoc.h
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
xprObjC.h
ecursiveASTVisitor.h
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.h
eclCXX.h
7e44e3fcd75147f229f42e6912898ce62d6b4d08 02-Dec-2010 Douglas Gregor <dgregor@apple.com> Make TypeLocBuilder an implementation detail of Sema. Nobody else should be using it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120628 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocBuilder.h
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.h
xternalASTSource.h
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.h
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.h
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.h
perationKinds.h
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.h
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.h
perationKinds.h
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.h
perationKinds.h
03013fa9a0bf1ef4b907f5fec006c8f4000fdd21 29-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Merge System into Support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120297 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
eclGroup.h
ecordLayout.h
tmtIterator.h
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.h
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.h
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
ecordLayout.h
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.h
eclCXX.h
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
eclBase.h
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
xpr.h
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
xprCXX.h
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.h
cc7bd10c0de9449b795bda3c5dcc6d83cc48436b 23-Nov-2010 Zhanyong Wan <wan@google.com> Fix a typo in a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120004 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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
ecl.h
ecursiveASTVisitor.h
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.h
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.h
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.h
9313aac61d425f14fa0b82c3dfe1eb2c3626d38c 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Copy the LangOptions in PrintingPolicy to avoid pointing to a LangOptions that is long gone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119729 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
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
xpr.h
xprCXX.h
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.h
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
xpr.h
xprCXX.h
xprObjC.h
tmt.h
cdba6595a61a7bd31f504260abf63c900a759d0f 18-Nov-2010 Ted Kremenek <kremenek@apple.com> CursorVisitor: switch remaining expressions over
to the data-recursion algorithm. CursorVisitor
now no longer subclasses StmtVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119596 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
e3c60a7ce9e0f42c7ca2344b33203266aceca1db 17-Nov-2010 Douglas Gregor <dgregor@apple.com> Fix source-range information for Objective-C properties. Previously,
we were just getting a range covering only the property name, which is
certainly not correct (and broke token annotation, among other
things).

Also, teach libclang about the relationship between
@synthesize/@dynamic and @property, so we get property name and
cursor-reference information for @synthesize and @dynamic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119409 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b7afb38c3b7aa5700f76817994066aaa379c2731 16-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Handle member initializer in C++ ctor.
- Add a new Kind of ProgramPoint: PostInitializer.
- Still use GRStmtNodeBuilder. But special handling PostInitializer in
GRStmtNodeBuilder::GenerateAutoTransition().
- Someday we should clean up the interface of GRStmtNodeBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119335 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9dc84c9455df2a77195147d0210c915dc1775a88 16-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Handle member initializer in C++ ctor.
- Add a new Kind of ProgramPoint: PostInitializer.
- Still use GRStmtNodeBuilder. But special handling PostInitializer in
GRStmtNodeBuilder::GenerateAutoTransition().
- Someday we should clean up the interface of GRStmtNodeBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119335 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
perationKinds.h
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.h
perationKinds.h
5599487add6698c95a8d9b53531045805c3c26b6 16-Nov-2010 John McCall <rjmccall@apple.com> Add an ExternalASTSource hook to complete a type on demand.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119316 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
916c870442978db40404d51348cdf5524e506faa 16-Nov-2010 John McCall <rjmccall@apple.com> Add an ExternalASTSource hook to complete a type on demand.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119316 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
f8d6c4b289bdf14d7206e8394f9ca1ef589804b0 16-Nov-2010 John McCall <rjmccall@apple.com> Add another case to the whitelist of cast kinds that can convert to bool.
Fixes PR8608.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119293 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5082d34e4107a44ac7f07b62f7a6c917e0e6e71e 16-Nov-2010 John McCall <rjmccall@apple.com> Add another case to the whitelist of cast kinds that can convert to bool.
Fixes PR8608.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119293 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
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.h
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.h
perationKinds.h
ype.h
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.h
perationKinds.h
ype.h
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.h
perationKinds.h
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.h
perationKinds.h
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.h
perationKinds.h
tmt.h
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.h
perationKinds.h
tmt.h
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.h
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.h
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.h
perationKinds.h
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.h
perationKinds.h
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.h
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.h
87fa7564c1e8b7894c1a9f646cb1294c8c2a7f9d 12-Nov-2010 Bob Wilson <bob.wilson@apple.com> Increase VectorTypeBitfields::VecKind field from 2 to 3 bits.
With the addition of 2 enum values for Neon vectors, this field must now
hold 6 different values and so requires 3 bits. Make the NumElements field
one bit smaller to compensate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118900 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
cc3b946c35c4372272034e6f0663089477a9a5bd 12-Nov-2010 Bob Wilson <bob.wilson@apple.com> Increase VectorTypeBitfields::VecKind field from 2 to 3 bits.
With the addition of 2 enum values for Neon vectors, this field must now
hold 6 different values and so requires 3 bits. Make the NumElements field
one bit smaller to compensate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118900 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
1ab6481f698c0995cb294ac1a29d21bfb970c41c 12-Nov-2010 Bob Wilson <bob.wilson@apple.com> Add a separate NeonPolyVector kind to distinguish polynomial vector types.
Add support for mangling those types according to ARM's ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118898 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
491328c90c00ecad6ad27fa0ab3cdf9195a4a820 12-Nov-2010 Bob Wilson <bob.wilson@apple.com> Add a separate NeonPolyVector kind to distinguish polynomial vector types.
Add support for mangling those types according to ARM's ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118898 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b0390a66dec06795d64924b4410753cc97ce0659 12-Nov-2010 John McCall <rjmccall@apple.com> API enhancements to TypeLocBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118886 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocBuilder.h
41bafb1b62dfb2577c5aa7ba7fbd6ba5bebdbfee 12-Nov-2010 John McCall <rjmccall@apple.com> API enhancements to TypeLocBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118886 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocBuilder.h
1aec9552fd13c5a289c41e217e849e29ed2e56b5 12-Nov-2010 Ted Kremenek <kremenek@apple.com> Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself.
Now we explicitly memset all of its values.

This bug was uncovered by the 'Index/recursive-cxx-member-calls.cpp', which exhibited an assertion
on an i386 darwin build of clang. Adding this test case back since the assertion is now resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118881 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
8f0889ce457db51d3af1eb1245bceee272d4dc7d 12-Nov-2010 Ted Kremenek <kremenek@apple.com> Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself.
Now we explicitly memset all of its values.

This bug was uncovered by the 'Index/recursive-cxx-member-calls.cpp', which exhibited an assertion
on an i386 darwin build of clang. Adding this test case back since the assertion is now resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118881 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
f640c64c62d3883121b8da0502ce75aecc6ba524 08-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> 1) Fix a typo in PPCallbacks: It's elif, not elfif. :-) This is
contentful, since the typo was in the method-name...

2) Clarify some comments in RecursiveASTVisitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118448 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
b5b38adbe29cd82711595bd184d6123125bd9a9b 08-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> 1) Fix a typo in PPCallbacks: It's elif, not elfif. :-) This is
contentful, since the typo was in the method-name...

2) Clarify some comments in RecursiveASTVisitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118448 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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
eclTemplate.h
emplateBase.h
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
eclTemplate.h
emplateBase.h
dcdac090356c2408cae49942db7e71bf97149bca 07-Nov-2010 Anders Carlsson <andersca@mac.com> A union cannot contain static data members or data members of reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118381 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
dfdfc584f2a8d9f1eebd6e6eaa9b1bbff519d8f9 07-Nov-2010 Anders Carlsson <andersca@mac.com> A union cannot contain static data members or data members of reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118381 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
f44cc6d7d3cf92c195a4fa306b22042d66530395 06-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix a bug where we were recursing on friend decls for friend
functions, but not for friend types.

Reviewed by wan


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118323 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
bb6afcb7f5f9c2e9121a548726d6d03283cb52bc 06-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix a bug where we were recursing on friend decls for friend
functions, but not for friend types.

Reviewed by wan


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118323 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ecordLayout.h
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
ecordLayout.h
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.h
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.h
70d7531c1bcf9740dc2a19dd722eae3860ad5fcc 31-Oct-2010 Anders Carlsson <andersca@mac.com> Add a DenseMapInfo specializaiton for CharUnits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117872 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
94ac122610ec875760c4b41e7376b79223a0de20 31-Oct-2010 Anders Carlsson <andersca@mac.com> Add a DenseMapInfo specializaiton for CharUnits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117872 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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.h
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.h
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.h
xternalASTSource.h
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.h
xternalASTSource.h
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.h
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.h
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.h
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.h
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
STMutationListener.h
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
STMutationListener.h
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
STMutationListener.h
eclTemplate.h
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
STMutationListener.h
eclTemplate.h
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.h
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.h
45ecd0d8067ed9723d5ad996da74641026fd15de 27-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily load the next friend in the chain of FriendDecls, to eliminate
some excessive recursion and deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117480 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
69aecc6252bf4a5ee59f9b51c3728ea07b6342bf 27-Oct-2010 Douglas Gregor <dgregor@apple.com> Lazily load the next friend in the chain of FriendDecls, to eliminate
some excessive recursion and deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117480 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
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.h
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.h
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.h
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.h
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.h
tmt.h
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.h
tmt.h
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
xpr.h
tmt.h
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
xpr.h
tmt.h
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
eclBase.h
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
eclBase.h
626161ecc7e10b432e2b293fe806ba314c1f4aa7 26-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Patch for mis-compile of statement expressions with
non-trivial copy constructors. // rdar: //8540501.
A test will be added to llvm nightly tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117324 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e946fc833d8592aa2890bfd9839f1ad839b3d284 26-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Patch for mis-compile of statement expressions with
non-trivial copy constructors. // rdar: //8540501.
A test will be added to llvm nightly tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117324 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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.h
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.h
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
STMutationListener.h
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
STMutationListener.h
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
STMutationListener.h
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
STMutationListener.h
66038abe0b53d93378f014e0306f1b3c2af07177 24-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactoring.
- Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used.
- Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117236 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
89eaf3af92c72c0c1aae807644e39cabc461d685 24-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactoring.
- Pass around RecordDataImpl instead of the concrete RecordData so that any SmallVector can be used.
- Move ASTDeclWriter::WriteCXXDefinitionData to ASTWriter::AddCXXDefinitionData.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117236 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
STConsumer.h
STContext.h
STMutationListener.h
eclBase.h
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
STConsumer.h
STContext.h
STMutationListener.h
eclBase.h
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.h
ype.h
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.h
ype.h
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
eclCXX.h
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
eclCXX.h
f88466fb54e64d00906b04ab603c29ab02330551 20-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Get FunctionDecl to recurse on FunctionTypeLoc rather than
FunctionType! I didn't realize it was available, until rjmccall
pointed out that DeclaratorDecl made the typeloc available. This
makes FunctionDecl recursion *much* easier, because the typeloc can
take care of default parameters, so we no longer have to do that
separately, which means we can just do a normal type traversal instead
of this special-case WalkUp stuff we did before.

The only downside -- and it's minor -- is that because the TypeLoc
handles both the return type and the argument types, we can't recurse
on the explicit template args in the right place (which would be
between them). I do it beforehand instead. So for
int MyFunc<float>(char x);
we get callbacks in the order: float, int, char.

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116945 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
536bab452fa38692834233187ed3d49b83722cb3 20-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Get FunctionDecl to recurse on FunctionTypeLoc rather than
FunctionType! I didn't realize it was available, until rjmccall
pointed out that DeclaratorDecl made the typeloc available. This
makes FunctionDecl recursion *much* easier, because the typeloc can
take care of default parameters, so we no longer have to do that
separately, which means we can just do a normal type traversal instead
of this special-case WalkUp stuff we did before.

The only downside -- and it's minor -- is that because the TypeLoc
handles both the return type and the argument types, we can't recurse
on the explicit template args in the right place (which would be
between them). I do it beforehand instead. So for
int MyFunc<float>(char x);
we get callbacks in the order: float, int, char.

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116945 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
87546e52faba58df3b4cf9f206ba7087371f4a9f 19-Oct-2010 John McCall <rjmccall@apple.com> MSVC space optimization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116797 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
35043e56150dc4eda882acd5ddfe0f8e3c0a8cb1 19-Oct-2010 John McCall <rjmccall@apple.com> MSVC space optimization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116797 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
1e75edda2f03c9416845f86c8f69dfaff6eb262b 19-Oct-2010 John McCall <rjmccall@apple.com> Petty space optimizations in ElaboratedType and DependentNameType.
Petty time optimization in TemplateTypeParmType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116796 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
77be2b485f65ad134b3804a6930d5df9d0d974ce 19-Oct-2010 John McCall <rjmccall@apple.com> Petty space optimizations in ElaboratedType and DependentNameType.
Petty time optimization in TemplateTypeParmType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116796 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0a3d65c147e28d6d96bd64d454f8f0cfaf20c9c6 16-Oct-2010 John McCall <rjmccall@apple.com> White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't. Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116661 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
6102ca1d490836096678d7d934f0b2b78f9293ec 16-Oct-2010 John McCall <rjmccall@apple.com> White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't. Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116661 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
b366986ba90b62e13a9562822179f488c1febcc5 15-Oct-2010 Francois Pichet <pichet2000@gmail.com> bool bit fields are causing problems with MSVC. Replace them with unsigned bit fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116623 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
bdb5b0e8ad8ed297ad01eb2ccd0d6d5ed6058033 15-Oct-2010 Francois Pichet <pichet2000@gmail.com> bool bit fields are causing problems with MSVC. Replace them with unsigned bit fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116623 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c5507c6d7ca95f7668c8fedaa405b7a51693335a 15-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
AST node. (finishing off radar 8525788).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116603 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
c44d91c446f6d59722da53dba9d686560e81b762 15-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
AST node. (finishing off radar 8525788).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116603 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
7c7c1621dac8ca1e33a61e34084718f7bba146d9 15-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116598 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
xpr.h
xprCXX.h
4045107b7384fd68eed5e3e2f06fc2a47e7be0a6 15-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116598 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
xpr.h
xprCXX.h
c0b7e94662d5aa0a2628940f9c43fbac84f7b008 15-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Recurse on a TypeLoc rather than a Type for TypedefDecl, now that the
typloc information is available (I don't think it was, originally).
Submitted as a 'trivial' change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116568 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
84a8e0a846d658d784090c4f378cc1c6c6b0ef3f 15-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Recurse on a TypeLoc rather than a Type for TypedefDecl, now that the
typloc information is available (I don't think it was, originally).
Submitted as a 'trivial' change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116568 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
68790944c3bb21baf8d3d28c9d4da5027f1bd229 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b6bbcc9995186799a60ce17d0c1acff31601653a 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
2d0ea41b33bb439ce5abcb1fcf7f217558b03644 14-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix compiler error that clang didn't report (probably same problem as rdar://8552377).

It's more stress-free without access checking though..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116521 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0f96abb17e21846fcd309a8002c6c91f95762b48 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix compiler error that clang didn't report (probably same problem as rdar://8552377).

It's more stress-free without access checking though..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116521 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
STContext.h
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
STContext.h
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.h
eclBase.h
xternalASTSource.h
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.h
eclBase.h
xternalASTSource.h
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
xprObjC.h
ecursiveASTVisitor.h
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
xprObjC.h
ecursiveASTVisitor.h
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.h
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.h
435c73e3d72449bd1d8c791f14550caf38a393aa 13-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Update Type::BitsRemainingInType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116423 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
43c0a4cae05cf78225d5996cf7d62d7a133d665c 13-Oct-2010 Douglas Gregor <dgregor@apple.com> Update Type::BitsRemainingInType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116423 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
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.h
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.h
ype.h
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.h
ype.h
f6d9c70dad1e3e2f68bc39a496ff18c5fa82229d 10-Oct-2010 Chris Lattner <sabre@nondot.org> fix PR8217, a silent miscompilation of invalid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116166 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
16c5dea6c2d3e4cf529de9d9b37f6a40441acb2c 10-Oct-2010 Chris Lattner <sabre@nondot.org> fix PR8217, a silent miscompilation of invalid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116166 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
ecl.h
ype.h
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
ecl.h
ype.h
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.h
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.h
883e084ba4d2e295b8ee514da32de0b6fc214599 02-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> When we insert a category (or class extension) into an interface, mark
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115421 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
5e9888c2786bfffa6879a08ff40f5a11545eec23 02-Oct-2010 Douglas Gregor <dgregor@apple.com> When we insert a category (or class extension) into an interface, mark
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115421 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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
ypeLoc.h
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
ypeLoc.h
6629b7e6af6beb90d8838d8af24cccb02f67aa56 30-Sep-2010 Gabor Greif <ggreif@gmail.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115148 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
138d6a6890c171068ac60430431eaadb3fcef9ab 30-Sep-2010 Gabor Greif <ggreif@gmail.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115148 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
11945cdd26880b4a5d32137f1e1deda568583414 30-Sep-2010 Devang Patel <dpatel@apple.com> ImplicitParamDecl is always implicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115103 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
638bb114199590534d684585155807f0a4cfcd3d 30-Sep-2010 Devang Patel <dpatel@apple.com> ImplicitParamDecl is always implicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115103 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
423636009aa13579999ea436e48e0f04ec77338b 29-Sep-2010 Craig Silverstein <csilvers2000@yahoo.com> Visit the type information for CXXUnresolvedConstructExpr, just like
we do for the similar CXXTemporaryObjectExpr. OKed by chandlerc and
wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115025 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
ac45ad57f0641b0d556ca27d19a59930925d6add 29-Sep-2010 Craig Silverstein <csilvers2000@yahoo.com> Visit the type information for CXXUnresolvedConstructExpr, just like
we do for the similar CXXTemporaryObjectExpr. OKed by chandlerc and
wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115025 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
8cfc0311e19291b2d33a434fb1ce78ce7e69974c 28-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114954 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
1a18600b85aaa691122983dd8dcf4225cfc9ef68 28-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114954 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
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.h
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.h
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
ecl.h
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
ecl.h
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
eclCXX.h
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
eclCXX.h
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
eclCXX.h
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
eclCXX.h
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.h
ype.h
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.h
ype.h
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.h
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.h
ede2675976fd9f70a9a7ccd4b9114281d795d24a 19-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Implement -Wunused-label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
355a9fe26a6dec89680ddf713dd5bc7a671b298a 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -Wunused-label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
95ba42ce79fd65004de5aabe5e49f885c2a44190 17-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add IRgen support for Gnu's conditional operator
extension when missing LHS. This patch covers scalar
conditionals only. Others are wip.
(pr7726, radar 8353567).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114182 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
af9b96828f9126d993c3e155b8453be62013b735 17-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add IRgen support for Gnu's conditional operator
extension when missing LHS. This patch covers scalar
conditionals only. Others are wip.
(pr7726, radar 8353567).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114182 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
3049ec9961d1a1f0570a24dc601e6a362129b35d 10-Sep-2010 Shih-wei Liao <sliao@google.com> Merge changes from upstream repository (r112367)

Change-Id: Ib88c8fd890e7c8c5597ea2b86cfa934438965c08
2decc92fcbbae70a752537940f9c784f1b885a02 14-Sep-2010 Ted Kremenek <kremenek@apple.com> Add reverse iterator for initializers in constructor. Patch by Marcin Świderski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113800 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
dacd24775d9654c3fe5dc2a01640c2b2aab2bead 14-Sep-2010 Ted Kremenek <kremenek@apple.com> Add reverse iterator for initializers in constructor. Patch by Marcin Świderski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113800 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
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.h
a03c2a265003f10407486c516fe20807910860ce 13-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
4076dacf1497fb95cb298b9d964fbdbdaf9bde6c 13-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
ff3e8ae562ae6eab487393a19affa08d103ba7c7 13-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the trivial setters from CXXDeleteExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113777 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
f1b8911d35bb2830a13267581d3cbde4b6b85db6 13-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the trivial setters from CXXDeleteExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113777 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
c28b0ec7176b5acd9eb8cd771aec751d58ba9bc0 13-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Avoid setters in ASTDeclReader::VisitClassTemplateSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113742 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
586c7156d51039290f100c80d2d8bd263c99addc 13-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Avoid setters in ASTDeclReader::VisitClassTemplateSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113742 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
88481cf45755ee5d34b66fcfee6143e0e0674f4b 12-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Teach the EvaluatedExprVisitor and its client, which marks
declarations in potentially-evaluated subexpressions, about
recursion. Fixes the release-mode self-host failure I introduced in
r113700.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113708 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
4fcf5b2f816347ba7a3f16557d5e2b293634d4d6 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Teach the EvaluatedExprVisitor and its client, which marks
declarations in potentially-evaluated subexpressions, about
recursion. Fixes the release-mode self-host failure I introduced in
r113700.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113708 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
583205c985b5d7a5c69c74f48d1f91429a642816 11-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Add a completely unnecessary "template" keyword to appease GCC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113703 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
d9a8bbcf8db776de126aa6dc15d66e2ce666d70d 11-Sep-2010 Douglas Gregor <dgregor@apple.com> Add a completely unnecessary "template" keyword to appease GCC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113703 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
1c1f0344bbef6a0abc0f203def5639554f465407 11-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> When parsing default function arguments, do not mark any declarations
used in the default function argument as "used". Instead, when we
actually use the default argument, make another pass over the
expression to mark any used declarations as "used" at that point. This
addresses two kinds of related problems:

1) We were marking some declarations "used" that shouldn't be,
because we were marking them too eagerly.
2) We were failing to mark some declarations as "used" when we
should, if the first time it was instantiated happened to be an
unevaluated context, we wouldn't mark them again at a later point.

I've also added a potentially-handy visitor class template
EvaluatedExprVisitor, which only visits the potentially-evaluated
subexpressions of an expression. I bet this would have been useful for
noexcept...

Fixes PR5810 and PR8127.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113700 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
be0f7bd61c7b2879d02ae75aad7a91d92f819d94 11-Sep-2010 Douglas Gregor <dgregor@apple.com> When parsing default function arguments, do not mark any declarations
used in the default function argument as "used". Instead, when we
actually use the default argument, make another pass over the
expression to mark any used declarations as "used" at that point. This
addresses two kinds of related problems:

1) We were marking some declarations "used" that shouldn't be,
because we were marking them too eagerly.
2) We were failing to mark some declarations as "used" when we
should, if the first time it was instantiated happened to be an
unevaluated context, we wouldn't mark them again at a later point.

I've also added a potentially-handy visitor class template
EvaluatedExprVisitor, which only visits the potentially-evaluated
subexpressions of an expression. I bet this would have been useful for
noexcept...

Fixes PR5810 and PR8127.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113700 91177308-0d34-0410-b5e6-96231b3b80d8
valuatedExprVisitor.h
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
xprCXX.h
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
xprCXX.h
b26365af5989ecc04c5c93dc70b6f8154dae02c2 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Follow Ted's example and hide CXXNoexceptExpr's setters from all but serialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113634 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
c8aecc2dfb2e393d9eeaedeca22ff8cd7149af81 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Follow Ted's example and hide CXXNoexceptExpr's setters from all but serialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113634 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
255d1b0f3801c698f592ae716669603b5443ce2c 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Serialization support for CXXNoexceptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113627 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
6b219d082434394c1ac401390ec1d1967727815a 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Serialization support for CXXNoexceptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113627 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
bacc1e1354313633349786b2b5837cd69cd22286 10-Sep-2010 Ted Kremenek <kremenek@apple.com> Make 'setProperty()', 'setBase()', and 'setLocation()' private in ObjCPropertyRefExpr, and friend ASTStmtReader so that it is the only class that can use them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113626 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
f8730d7c313c421d5d7a2b9d97541fc89d5a52d4 10-Sep-2010 Ted Kremenek <kremenek@apple.com> Make 'setProperty()', 'setBase()', and 'setLocation()' private in ObjCPropertyRefExpr, and friend ASTStmtReader so that it is the only class that can use them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113626 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
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.h
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.h
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.h
7be3c849b2a0dd1201767f4d0097157608eb45da 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113619 91177308-0d34-0410-b5e6-96231b3b80d8
perationKinds.h
68d114dc3e1d9ef0c0b073edcb824d4d7f37d416 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113619 91177308-0d34-0410-b5e6-96231b3b80d8
perationKinds.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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
eclTemplate.h
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
eclTemplate.h
dd5ca81b3ab667707101647c80ca500e2ac0cc5c 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Static analyzer fix: <rdar://problem/5880430> Switch on enum should not consider default case live if all enum values are covered

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113457 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4d3175c1e5a44251ea97b0c81e80f060629d9c08 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Static analyzer fix: <rdar://problem/5880430> Switch on enum should not consider default case live if all enum values are covered

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113457 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
aa90dfae5914fb934c315fae3ff8a9bab9e64a95 09-Sep-2010 Ted Kremenek <kremenek@apple.com> When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where
covered by individual case statements. Flow-based analyses may wish to consult this information,
and recording this in the AST allows us to obviate reconstructing this information later when
we build the CFG.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113447 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
28bda05d7764746b6d1957871d8dac580ab1b4fb 08-Sep-2010 Gabor Greif <ggreif@gmail.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113295 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
489f7131d0f7746525de3b26204c8eb523d84505 08-Sep-2010 Gabor Greif <ggreif@gmail.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113295 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
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.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
48ce58bba7d612551685c7ebdfa9884354e29462 02-Sep-2010 John McCall <rjmccall@apple.com> Teach RecursiveASTVisitor to optionally visit bodies of instantiations.
Based on a patch by Francois Pichet!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112848 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
760c8af273d9871d063250ae626fb6df94c121f2 02-Sep-2010 John McCall <rjmccall@apple.com> Teach RecursiveASTVisitor to optionally visit bodies of instantiations.
Based on a patch by Francois Pichet!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112848 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
e019df2d54944bf55f4b8916fb9dbed0e7656368 02-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new libclang function,
clang_getSpecializedCursorTemplate(), which determines the template
(or member thereof) that the given cursor specializes or from which it
was instantiated. This routine can be used to establish a link between
templates and their instantiations/specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112780 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
e0329acf5c9437e2086a2fb2bf7a95ae2ac96505 02-Sep-2010 Douglas Gregor <dgregor@apple.com> Introduce a new libclang function,
clang_getSpecializedCursorTemplate(), which determines the template
(or member thereof) that the given cursor specializes or from which it
was instantiated. This routine can be used to establish a link between
templates and their instantiations/specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112780 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
047c86597b922afa6dd16dcc086002bd7a91ffab 02-Sep-2010 Zhanyong Wan <wan@google.com> Make RecursiveASTVisitor not crash when a TemplateArgumentLoc object has a NULL TypeSourceInfo*. This fixes the symptom of http://llvm.org/PR8043. Reviewed by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112777 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
fcf431609769a9600c24618d1a33135caec4fef2 02-Sep-2010 Zhanyong Wan <wan@google.com> Make RecursiveASTVisitor not crash when a TemplateArgumentLoc object has a NULL TypeSourceInfo*. This fixes the symptom of http://llvm.org/PR8043. Reviewed by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112777 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
c1e532a79c0d206e79645d96dc01f8a2f2f26ed8 02-Sep-2010 Craig Silverstein <csilvers2000@yahoo.com> Update the docstring to say FriendTemplateDecl is not actually used.
Based on discussion with rjmccall and dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112762 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
c6a518a7271bbd6d0f606ba5c1b1b9c668bbdcb0 02-Sep-2010 Craig Silverstein <csilvers2000@yahoo.com> Update the docstring to say FriendTemplateDecl is not actually used.
Based on discussion with rjmccall and dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112762 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
9c4aae941a9efd293d591f1fd4ead53ee326fd4d 02-Sep-2010 Craig Silverstein <csilvers2000@yahoo.com> Make some docstring clarifications, after discussion with dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112759 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
710672485039d3dd355748876299fff88e8ad84c 02-Sep-2010 Craig Silverstein <csilvers2000@yahoo.com> Make some docstring clarifications, after discussion with dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112759 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
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.h
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.h
e4456a335ff2190b23bf1463249d288f962c1f22 01-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Implement libclang support for using declarations. Clang actually uses
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112730 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
7e24256c95afb64b4d5abf201a0f9f0527cb4cf3 01-Sep-2010 Douglas Gregor <dgregor@apple.com> Implement libclang support for using declarations. Clang actually uses
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112730 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
aa04570cabaf59669d8eafc0bedb357722d9fbc5 01-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Improve location information in the representation of namespace
aliases. Previously, the location of the alias was at the "namespace"
keyword. Now, it's on the identifier being declared (as is the custom
for Clang), and we keep a separate source location for the "namespace"
keyword.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112681 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
8ea5b9d832455247a15925398fb663d299d33238 01-Sep-2010 Douglas Gregor <dgregor@apple.com> Improve location information in the representation of namespace
aliases. Previously, the location of the alias was at the "namespace"
keyword. Now, it's on the identifier being declared (as is the custom
for Clang), and we keep a separate source location for the "namespace"
keyword.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112681 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
47798f2285bca17e2c8f85030e5df7884c862f10 01-Sep-2010 John McCall <rjmccall@apple.com> Add convenience accessors for determining whether template declarations are definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112656 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclTemplate.h
13fda8afe2ddd06c12bfb93a054e6b0d6d0d99f1 01-Sep-2010 John McCall <rjmccall@apple.com> Add convenience accessors for determining whether template declarations are definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112656 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclTemplate.h
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.h
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.h
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
xpr.h
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
xpr.h
b88eafd94faee5cebd0b8bb27803e61cd92d7d56 31-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic support for indexing function templates in
libclang. This includes:
- Cursor kind for function templates, with visitation logic
- Cursor kinds for template parameters, with visitation logic
- Visitation logic for template specialization types, qualified type
locations
- USR generation for function templates, template specialization
types, template parameter types.

Also happens to fix PR7804, which I tripped across while testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112604 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
fe72e9ceeae6cc8669cd8bb722425300190638ea 31-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for indexing function templates in
libclang. This includes:
- Cursor kind for function templates, with visitation logic
- Cursor kinds for template parameters, with visitation logic
- Visitation logic for template specialization types, qualified type
locations
- USR generation for function templates, template specialization
types, template parameter types.

Also happens to fix PR7804, which I tripped across while testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112604 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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
ecl.h
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
ecl.h
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.h
eclBase.h
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.h
eclBase.h
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
xprCXX.h
ecursiveASTVisitor.h
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
xprCXX.h
ecursiveASTVisitor.h
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.h
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.h
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
xprCXX.h
ecursiveASTVisitor.h
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
xprCXX.h
ecursiveASTVisitor.h
11dd7550044ec6b3ca84842acaae2eb69f5f1d3f 28-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Fix copy+paste error in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112370 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ae2777cfe7d21f73e5a4155082fe20197cec62bd 28-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Fix copy+paste error in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112370 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
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
xpr.h
f83845030dfc2499d1e92ceebef3c82151c1a45c 28-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Miscellaneous found by inspection with John and Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112315 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
757c600d696f016fea6b086d0349bcd7a4d06bd1 28-Aug-2010 Douglas Gregor <dgregor@apple.com> Miscellaneous found by inspection with John and Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112315 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
xprCXX.h
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
xprCXX.h
6b5f410f4ef7d4e2300df3cec8ef30810e10dfc7 26-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When code-completing a potential call to a C++ non-static member
function, take into account the qualifiers on the object argument
(e.g., what will become "this"), filtering around uncallable member
functions and giving a slight priority boost to those with
exactly-matching qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112193 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
3cdee121daa13403335094ce0e181b9911c2124c 26-Aug-2010 Douglas Gregor <dgregor@apple.com> When code-completing a potential call to a C++ non-static member
function, take into account the qualifiers on the object argument
(e.g., what will become "this"), filtering around uncallable member
functions and giving a slight priority boost to those with
exactly-matching qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112193 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
0723ac686c322d77cd0e7e514e620fca5b2fd8f0 26-Aug-2010 John McCall <rjmccall@apple.com> Missed a couple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112179 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
f29815affe5d28c499d21c0be9bb078c52025ae6 26-Aug-2010 John McCall <rjmccall@apple.com> Missed a couple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112179 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
f3e302acf4259cf4cd9bc62b58fd2d517e817ab4 26-Aug-2010 John McCall <rjmccall@apple.com> Apparently gcc doesn't always get injected class names right.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112178 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
6d9496d2d22817aeb286dd7007923e14f10fa8a6 26-Aug-2010 John McCall <rjmccall@apple.com> Apparently gcc doesn't always get injected class names right.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112178 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
0942e31e6c3725b57c5093ab339dd86031454cfc 26-Aug-2010 John McCall <rjmccall@apple.com> Move things around so that Sema.h no longer depends on even DeclBase.h.
It still depends on Type because DeclarationName.h does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112177 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
xternalASTSource.h
ea318642072d3d94b5c3cff0fa6f4b33d2db0768 26-Aug-2010 John McCall <rjmccall@apple.com> Move things around so that Sema.h no longer depends on even DeclBase.h.
It still depends on Type because DeclarationName.h does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112177 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
xternalASTSource.h
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.h
eclCXX.h
eclTemplate.h
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.h
eclCXX.h
eclTemplate.h
84e75263e69fc67b68abfd3ef13d12b4533e6fd0 25-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence a GCC warning saying that unsigned >= UO_PostInc is always true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112048 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
993cdca0fed7deb646e4654dfb2607227a497faa 25-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence a GCC warning saying that unsigned >= UO_PostInc is always true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112048 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
ecursiveASTVisitor.h
tmtVisitor.h
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.h
ecursiveASTVisitor.h
tmtVisitor.h
cacf30de20eac454cdea8b536b30272be476dcb9 25-Aug-2010 John McCall <rjmccall@apple.com> Random space optimization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112046 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0799c53fc2bb7acf937c8a8e165033dba1a5aba3 25-Aug-2010 John McCall <rjmccall@apple.com> Random space optimization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112046 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
perationKinds.h
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
xpr.h
perationKinds.h
03e1de283b5dc6b97ae8adec530e81568850587b 25-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Make sure CXXABI is destroyed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ff75dfde6a351c57f41366d309c0bd11aba69bce 25-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make sure CXXABI is destroyed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f808bbd31f1ae2d81d7f0a2a69a6e60d1833f024 24-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Teach InheritingConcreteTypeLoc to play nicely with dyn_cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111916 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
713da40fb093cb6ab50ddc57e1697fddf9802104 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Teach InheritingConcreteTypeLoc to play nicely with dyn_cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111916 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
89ee65fb6f6218b45c46537690ae4691b489cf05 24-Aug-2010 John McCall <rjmccall@apple.com> Struggle mightily against header inclusion in Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
xternalASTSource.h
7cd088e519d7e6caa4c4c12db52e0e4ae35d25c2 24-Aug-2010 John McCall <rjmccall@apple.com> Struggle mightily against header inclusion in Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
xternalASTSource.h
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
STContext.h
eclObjC.h
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
STContext.h
eclObjC.h
6ae2325ec3b27aae178267de58fe35acf2027b91 23-Aug-2010 John McCall <rjmccall@apple.com> Abstract out everything having to do with member pointers into the ABI
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.

Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111789 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0bab0cdab751248ca389a5592bcb70eac5d39260 23-Aug-2010 John McCall <rjmccall@apple.com> Abstract out everything having to do with member pointers into the ABI
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.

Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111789 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d401c08eaebd14b9fa6440513c764a7342d0adea 22-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate a stale assertion. Fixes Clang self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111782 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
db68e28c05a67735211e688009890cf834c22e75 22-Aug-2010 Douglas Gregor <dgregor@apple.com> Eliminate a stale assertion. Fixes Clang self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111782 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
xternalASTSource.h
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.h
xternalASTSource.h
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.h
eclObjC.h
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.h
eclObjC.h
161f47b721242aa98301da22da5c7274b5644112 20-Aug-2010 Dan Gohman <gohman@apple.com> Add a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111674 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fa78c91c54dd99ec61a9e27e6b74a549f5c9fa9c 20-Aug-2010 Dan Gohman <gohman@apple.com> Add a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111674 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
eclContextInternals.h
xternalASTSource.h
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
eclContextInternals.h
xternalASTSource.h
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.h
xprCXX.h
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.h
xprCXX.h
8cf107ec3f8ebb84287d07beb91881924f978e6a 19-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Remove default argument from operator delete; per report on cfe-dev, fixes
compilation with MSVC. Note that on other platforms, the operator delete in
question is never used because we compile with -fno-exceptions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111514 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
a87cdc03f4014545a8440110c1f4f68701100576 19-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Remove default argument from operator delete; per report on cfe-dev, fixes
compilation with MSVC. Note that on other platforms, the operator delete in
question is never used because we compile with -fno-exceptions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111514 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
4732d4f526b6fde3646d615a52c9ee40e627d117 19-Aug-2010 Sean Hunt <rideau3@gmail.com> Add a missing initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111510 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
1bf8d6f3a9dc636c3d1217d6fff11acf358e44be 19-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Add a missing initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111510 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
461310d47dfb77ed4b176cfa19358bddeb732a35 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More PCH -> AST renaming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
eclBase.h
ype.h
3c7f4134603d04b44f997b43c0a9def270f25386 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More PCH -> AST renaming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
eclBase.h
ype.h
6bdcfea8ff12cd4079b3653e5cd7d638c7d74ed1 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename various classes from PCH to AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111471 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
571db7f0cb31789737be92fce1c1b738e6dbe795 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename various classes from PCH to AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111471 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
b3be32d54baecf077e7813b25c9f37e103a44d3b 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHStmtReader -> ASTStmtReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111470 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
tmtCXX.h
60adf4acf40b72227740bf966fb87eebddff3f37 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHStmtReader -> ASTStmtReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111470 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
tmtCXX.h
d114374d2e6a4cc7a93091f0475f7a133dc1f499 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHDeclReader -> ASTDeclReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
edeclarable.h
d527cc06d78fe5afa5f20105b51697637eb02c56 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHDeclReader -> ASTDeclReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111469 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
edeclarable.h
7b39a2cadf9d62647f3aa572c52b77ea4114a599 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHReader to ASTReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111467 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c43b54cbc10654ed59de797898042e1a05265246 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHReader to ASTReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111467 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c582b76f225a52634fedfe774896439876263c15 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Do the PCH->AST rename for ASTWriter's implementation parts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111464 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
edeclarable.h
3397c5570369f19b2d6c52e898f708d75ceede1f 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Do the PCH->AST rename for ASTWriter's implementation parts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111464 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
edeclarable.h
c9b42df920d69f0a2e4779bfbea6234cf355539d 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHWriter to ASTWriter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111463 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a4232eb646d89e7d52424bb42eb87d9061f39e63 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHWriter to ASTWriter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111463 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ttr.h
MakeLists.txt
eclBase.h
eclObjC.h
akefile
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.h
ttr.h
MakeLists.txt
eclBase.h
eclObjC.h
akefile
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.h
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.h
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.h
ecl.h
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.h
ecl.h
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
ttr.h
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
ttr.h
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
xpr.h
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
xpr.h
51bc53eb6a607d6da76ab71891ee2060929e2411 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111165 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ypeOrdering.h
f5586f6b311c98e1022a8fe0609053849b70d323 16-Aug-2010 Douglas Gregor <dgregor@apple.com> When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111165 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ypeOrdering.h
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.h
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.h
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.h
ecursiveASTVisitor.h
tmtVisitor.h
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.h
ecursiveASTVisitor.h
tmtVisitor.h
735b542c2c94910a3d522283864f85c27ff602cf 13-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110989 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
0b17c61e8f143901ce11b4a6e5129ac63aaeee04 13-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110989 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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
ttr.h
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
ttr.h
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.h
ecl.h
eclCXX.h
eclarationName.h
xpr.h
xprCXX.h
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.h
ecl.h
eclCXX.h
eclarationName.h
xpr.h
xprCXX.h
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.h
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.h
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.h
STContext.h
eclObjC.h
ype.h
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.h
STContext.h
eclObjC.h
ype.h
53b1f07486423ff3b40eae2530ab805fae553e82 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to VAArgExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110666 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ecursiveASTVisitor.h
2cad900202561cdda18ea6cc51ddbf3e20e3c23a 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to VAArgExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110666 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ecursiveASTVisitor.h
8b2ab3d4c434dcd30cb229b0dfdbe35a0679d5d5 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to TypesCompatibleExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110663 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ecursiveASTVisitor.h
3fcb73dae91be42b071cf0dde9222b7ec362146d 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to TypesCompatibleExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110663 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ecursiveASTVisitor.h
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.h
STContext.h
eclObjC.h
ype.h
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.h
STContext.h
eclObjC.h
ype.h
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
tmt.h
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
tmt.h
b38704938e9fea65d2754b16fb8af4642e9b010f 09-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support ObjC implementation decls for PCH.

Strictly speaking, implementations don't go in headers but there's no law against it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110567 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9d50c0635fb213b2a1857e3f8488580f0dab2f98 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support ObjC implementation decls for PCH.

Strictly speaking, implementations don't go in headers but there's no law against it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110567 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
50ed01d948df5b72a80feefa99499ea770f57a3e 09-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110566 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
8e706f4b8da141612861e127610141b8d17a9667 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110566 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
xpr.h
ype.h
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.h
xpr.h
ype.h
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
xpr.h
xprCXX.h
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
xpr.h
xprCXX.h
2f987862673a11de5d8dce726ceef66f82b6bf32 06-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix leaks of ExplicitSpecializationInfo objects by allocating them with 'new (ASTContext)' instead of 'new'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110474 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
db1423008b6185fc570558cff77d92f94e55b386 06-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix leaks of ExplicitSpecializationInfo objects by allocating them with 'new (ASTContext)' instead of 'new'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110474 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
794c6eb2e42c58ba28b94e413956d60371789345 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the DeclaredInCondition bit now that it's no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a834888ecc3ea36ea78a585209f422c7730d437a 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the DeclaredInCondition bit now that it's no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e96911b46b92e26170d9186ae780f0bb98a322fc 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Collect namespaces that need updating in a PCH chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110378 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a7be5065edc93ab52a25b2588a23a41a4beba21e 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Collect namespaces that need updating in a PCH chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110378 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ttr.h
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
ttr.h
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
ype.h
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
ype.h
8562f1694038d5e0cc63fe2b2a7254ae1c1e7d1f 03-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Apart from storing/retrieving the previous redeclaration from PCH, also store/retrieve the most recent
redeclaration. That way we are sure that the full redeclarations chain is loaded.

When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH.
To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need
to point to a most recent redeclaration in another PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110125 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
a865005c74019184e04f7fcdd4d61c31c095a4ff 03-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Apart from storing/retrieving the previous redeclaration from PCH, also store/retrieve the most recent
redeclaration. That way we are sure that the full redeclarations chain is loaded.

When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH.
To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need
to point to a most recent redeclaration in another PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110125 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
12dbccb155e8caff5a983f7eb05f98a56214fecb 03-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110124 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
ba5ff8ccf3f2a4d8fa3e91b58733707fb1caed6b 03-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce getMostRecentDeclaration() and getFirstDeclaration() for RedeclarableTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110124 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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.h
ype.h
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.h
ype.h
738e778a32a604d13a3c9decbe36f7015bd41763 02-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
76c38d385447b7acdff2d7e6b13fa8580e7174a7 02-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
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.h
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.h
9861c3f20000ae518b9befc9e1ec7f3d1b89285e 01-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Iterate typeloc's for class bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109961 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
64a15230a9e0e030bd761c6848a5876354653ded 01-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Iterate typeloc's for class bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109961 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ttr.h
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
ttr.h
336780662f91ad9972776de6cd89775ecb0cabd9 30-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Add specialisation iterators for {Class,Function}TemplateDecl

This patch introduces the ClassTemplateDecl::spec_{begin,end}()
and FunctionTemplateDecl::{,partial_}spec_{begin,end}() member
functions as a public interface for iterating over the declarations'
specialisation sets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109870 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
9f339ba5b00256588d0d78786fff6d48ef073015 30-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Add specialisation iterators for {Class,Function}TemplateDecl

This patch introduces the ClassTemplateDecl::spec_{begin,end}()
and FunctionTemplateDecl::{,partial_}spec_{begin,end}() member
functions as a public interface for iterating over the declarations'
specialisation sets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109870 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
7fe3b516da063390ee7004ee6dbeeb553d519f5f 30-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Introduce RedeclarableTemplateDecl::SpecEntryTraits

SpecEntryTraits describes how to obtain the most recent declaration
of a specialisation from an entry in a specialisation FoldingSet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109868 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
44dd0b440efdb37ff4c6e49f243faa3b0580b120 30-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Introduce RedeclarableTemplateDecl::SpecEntryTraits

SpecEntryTraits describes how to obtain the most recent declaration
of a specialisation from an entry in a specialisation FoldingSet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109868 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
e836e2ffc74196e0bd61526cb2959092c291e3a2 30-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor the way PCHReader tracks whether we are in recursive loading.

-Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
to ExternalASTSource.

These are preparation for the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109856 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
29ee3a273f58e16df7f2c524ab62a869e44fc9b1 30-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor the way PCHReader tracks whether we are in recursive loading.

-Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
to ExternalASTSource.

These are preparation for the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109856 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
6227b1e56f35a4dae53d631d392a83ab8a75feef 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make macro weirdness in chained PCH work. This required changing the way PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109823 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
ffaab3e2bb13991bb3357e80f14bcae3745b2347 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make macro weirdness in chained PCH work. This required changing the way PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109823 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
aee48ed6b70faff5891bd004601e274ac5b1947b 29-Jul-2010 Eli Friedman <eli.friedman@gmail.com> PR7736: Make sure to mark &Class::Member correctly as being type-dependent
inside a template class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109697 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e8a126ba9a8a2f53098d388d04ec555b758f0c67 29-Jul-2010 Eli Friedman <eli.friedman@gmail.com> PR7736: Make sure to mark &Class::Member correctly as being type-dependent
inside a template class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109697 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e6e0ce5777de47a854d2723056c735dd00e32902 28-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Add proper callbacks for DeclStmt -- we weren't recursing on
the decls. This was just an oversight before; one we didn't
catch because lots of information in a DeclStmt was also being
traversed (redundantly) elsewhere.

Once DeclStmt was cleaned up, I could clean up some of the
redundant traversals found elswhere as well -- in particular,
traversing the declarations inside a function as part of the
function callback (instead of as part of the CompoundExpr
callback that constitutes the body of the function). The old
way was really weird, and led to some parts of local variable
declarations (but not all) being visited twice. That is now
resolved. I also was able to simplify the traversers for
IfStmt/WhileStmt/etc, which used to have redundant calls to
work around the fact DeclStmt wasn't working properly.

While in the area, I fixed up a few more recursion-ordering
issues. I try to hold to the principle that
RecursiveASTVisitor visits objects in the source code in the
same order they're typed. So the return-type of a variable
comes before the variable-name. This still isn't perfect, but
we're closer to that.

Reviewed by chandlerc and wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109590 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
be9aa9614f0f15f2182c9ac5c571a868263131ad 28-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Add proper callbacks for DeclStmt -- we weren't recursing on
the decls. This was just an oversight before; one we didn't
catch because lots of information in a DeclStmt was also being
traversed (redundantly) elsewhere.

Once DeclStmt was cleaned up, I could clean up some of the
redundant traversals found elswhere as well -- in particular,
traversing the declarations inside a function as part of the
function callback (instead of as part of the CompoundExpr
callback that constitutes the body of the function). The old
way was really weird, and led to some parts of local variable
declarations (but not all) being visited twice. That is now
resolved. I also was able to simplify the traversers for
IfStmt/WhileStmt/etc, which used to have redundant calls to
work around the fact DeclStmt wasn't working properly.

While in the area, I fixed up a few more recursion-ordering
issues. I try to hold to the principle that
RecursiveASTVisitor visits objects in the source code in the
same order they're typed. So the return-type of a variable
comes before the variable-name. This still isn't perfect, but
we're closer to that.

Reviewed by chandlerc and wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109590 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
3d3c84c1b7784df717859fd1b9524ab75de69b28 27-Jul-2010 Ted Kremenek <kremenek@apple.com> Add non-static version of BinaryOperator::getOpcodeStr().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109526 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a84c02d0f4d63975a1c52b9bb8308d88e9d79352 27-Jul-2010 Ted Kremenek <kremenek@apple.com> Add non-static version of BinaryOperator::getOpcodeStr().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109526 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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
eclCXX.h
ecursiveASTVisitor.h
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
eclCXX.h
ecursiveASTVisitor.h
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
xpr.h
xprCXX.h
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
xpr.h
xprCXX.h
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.h
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.h
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.h
eclCXX.h
eclObjC.h
eclTemplate.h
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.h
eclCXX.h
eclObjC.h
eclTemplate.h
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
ttr.h
eclGroup.h
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
ttr.h
eclGroup.h
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.h
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.h
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.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
ullExpr.h
tmt.h
tmtCXX.h
ype.h
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.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
ullExpr.h
tmt.h
tmtCXX.h
ype.h
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.h
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.h
ea9ab1c07f4256c8e7d6934edccb837070a3b61b 24-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Fix sort order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109319 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.h
5818f2280c145696cdb87afe7754c4ac9e4fb821 24-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Fix sort order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109319 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.h
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
anonicalType.h
ype.h
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
anonicalType.h
ype.h
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
eclObjC.h
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
eclObjC.h
42eeeafedb7d13065b65773730813a81629e3e40 22-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Don't crash when an explicit template instantiation has no user-written
arguments. This happens in clang itself where template:

template <typename T> T const *getAs();

gets specialized with:

template<> inline clang::TypedefType const *getAs() { ... }

and there's no TemplateArgumentList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109127 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
44db3251aec7c0e6edaf1c70d7d53a272686791a 22-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Don't crash when an explicit template instantiation has no user-written
arguments. This happens in clang itself where template:

template <typename T> T const *getAs();

gets specialized with:

template<> inline clang::TypedefType const *getAs() { ... }

and there's no TemplateArgumentList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109127 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
fe518bd1efb8e68767c0d55220996f6b325ee42f 22-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write C++0x static_assert for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109123 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
0d396896998685809bda7444d772bbeb5bbe9b46 22-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write C++0x static_assert for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109123 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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
tmtCXX.h
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
tmtCXX.h
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
eclTemplate.h
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
eclTemplate.h
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.h
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.h
0ef2f3e3224799d511aa896b329e4aba2c528bf8 20-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add const iterator to InitListExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108810 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8111a6150cb68a238d55a31f9f4f90869a43f988 20-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add const iterator to InitListExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108810 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
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
xpr.h
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.h
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.h
0791d5ddfa5092cfaca6abe0f58d0b8ad50c4de9 19-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix http://llvm.org/PR7660

A ParmVarDecl instantiated from a FunctionProtoType may have Record as DeclContext,
in which case isStaticDataMember() will erroneously return true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108692 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e3041be307d4c133605544a74f40c42c7531b5bb 19-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix http://llvm.org/PR7660

A ParmVarDecl instantiated from a FunctionProtoType may have Record as DeclContext,
in which case isStaticDataMember() will erroneously return true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108692 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
cce0a02c5880fe916df1e05883bef2deee5e4f03 16-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix typeid the same way I fixed sizeof. Sad I had missed it before.

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108557 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
27de0f2cb3e8c26c37f31e61929b0e442c809ca5 16-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix typeid the same way I fixed sizeof. Sad I had missed it before.

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108557 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
3c0adc6f057f341a2ec784f63487dcf5bb324347 16-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix up some of the visiting for array types -- we weren't good about
getting array indices before -- and for some of the builtin operators:
sizeof, offsetof, unaryops like __is_enum.

Also fix the function visitor to visit exception types in function
parameters.

Reviewed by wan and chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108533 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
cf4679e60a5c5fa13e4bfe69f8186658c828af49 16-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix up some of the visiting for array types -- we weren't good about
getting array indices before -- and for some of the builtin operators:
sizeof, offsetof, unaryops like __is_enum.

Also fix the function visitor to visit exception types in function
parameters.

Reviewed by wan and chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108533 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
11b4daa8a1511ec6bc209a56de19750d2b316ce0 16-Jul-2010 John McCall <rjmccall@apple.com> Initialize a couple of fields inherited for our private use.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
31eb18c11d9dacdc0a500a35b269a81134207b84 16-Jul-2010 John McCall <rjmccall@apple.com> Initialize a couple of fields inherited for our private use.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108532 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
11594551693b1db92840bf1640d087ce1062609f 14-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108354 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
ype.h
07a353c2af3a3c557205466d4f4ed2513462ebfe 14-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108354 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
ype.h
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.h
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.h
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
eclObjC.h
ype.h
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
eclObjC.h
ype.h
8439ceb39ea07e65ea1156c3a2e674d402c1cbed 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Properly add to 32

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108243 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
e4b8f1171d699c56ba2b39aabf1d7cb4c38ce4f8 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Properly add to 32

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108243 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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
ecl.h
eclObjC.h
ype.h
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
ecl.h
eclObjC.h
ype.h
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.h
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.h
74cacf47b46752b0f40460d164a7c43f33b04ed7 13-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> We should not be recursing over the shadow definitions in UsingDecl --
they're not something the user typed (at least, not here).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108212 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
cdbcad09c806aba04fab15c91a9ff537fa38a2f5 13-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> We should not be recursing over the shadow definitions in UsingDecl --
they're not something the user typed (at least, not here).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108212 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
24e6b6992a0b022e02aa2510703c2a94184e3c7d 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Compute Type dependent-ness of BlockDeclRefExpr
on the fly when constructing it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108166 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
84ca008a462b515f63871253f494d53c9190363c 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Compute Type dependent-ness of BlockDeclRefExpr
on the fly when constructing it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108166 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cfff00f10ba49c4fdb902824378f72ab62fcd759 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Move setting of Dependent Type to BlockDeclRefExpr's
constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108157 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
52bc56a296b11b4fc6bf5ddf4ded5262f6484bdb 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Move setting of Dependent Type to BlockDeclRefExpr's
constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108157 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
53834c8d44a55123c3df40422d018171538e7376 09-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Move traverseunqualifiedtypeloc over to the 'main' typeloc tree.
Note that this is a move -- we pretend that we were really looking
at the unqualified typeloc all along -- rather than a recursion, so
we don't follow the normal CRTP plan of going through
getDerived().TraverseTypeLoc. If we did, we'd be traversing twice
for the same type (once as a QualifiedTypeLoc version of the type,
once as an UnqualifiedTypeLoc version of the type), which in effect
means we'd call VisitTypeLoc twice with the 'same' type. This
solves that problem, at the cost of never seeing the qualified
version of the type (unless the client subclasses
TraverseQualifiedTypeLoc themselves). It's not a perfect solution.
A perfect solution probably requires making QualifiedTypeLoc a
wrapper around TypeLoc -- like QualType is a wrapper around Type*
-- rather than being its own class in the type hierarchy.

Reviewed by wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107973 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
6b3f1ebce775499aff03845193de78128671262f 09-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Move traverseunqualifiedtypeloc over to the 'main' typeloc tree.
Note that this is a move -- we pretend that we were really looking
at the unqualified typeloc all along -- rather than a recursion, so
we don't follow the normal CRTP plan of going through
getDerived().TraverseTypeLoc. If we did, we'd be traversing twice
for the same type (once as a QualifiedTypeLoc version of the type,
once as an UnqualifiedTypeLoc version of the type), which in effect
means we'd call VisitTypeLoc twice with the 'same' type. This
solves that problem, at the cost of never seeing the qualified
version of the type (unless the client subclasses
TraverseQualifiedTypeLoc themselves). It's not a perfect solution.
A perfect solution probably requires making QualifiedTypeLoc a
wrapper around TypeLoc -- like QualType is a wrapper around Type*
-- rather than being its own class in the type hierarchy.

Reviewed by wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107973 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
b9ef1aefe3fbeda4c939c9c954ec18390b2864da 08-Jul-2010 Zhanyong Wan <wan@google.com> Makes RecursiveASTVisitor traverse the type of a temporary object
created via T() where T is a class type. Reviewed by chandlerc and
csilvers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107911 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
80db8cbff5afc047a23dbfe11f7ef787d891feec 08-Jul-2010 Zhanyong Wan <wan@google.com> Makes RecursiveASTVisitor traverse the type of a temporary object
created via T() where T is a class type. Reviewed by chandlerc and
csilvers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107911 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
a17bffb76acc003b51a88f817a23071877f7c539 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support TemplateTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107884 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
bfcc92c3476ada55ceeea49e43e6d2e083252830 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support TemplateTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107884 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
b69c35fbf8635a267215a83b4e9fd980019f003a 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107873 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
be191100e034b23a3e13053757a57b7f5068c24a 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107873 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
e8f2e77a0856219a9a733aaba4b7ec1edcdeab0b 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix reading of UsingDecl from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107871 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
82f8e796d6ffce1d63729a2df87c1060edf6593a 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix reading of UsingDecl from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107871 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
8cdb61460293fafb23170b5734cec6cb30f55c6a 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Remove unused protected constructor of DeclRefExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107870 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9705752be3a52d72e9ad1c7c8d8e59082e40a4f1 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove unused protected constructor of DeclRefExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107870 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xprCXX.h
ecursiveASTVisitor.h
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
xprCXX.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
9448d6386902e18259ccbf440e0d3787fc340b0f 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107827 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
63ef464c3fad1e8b9f9360baa6c81f974b712e90 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107827 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
d15e19a1379672150a83eaf7f90c9330ed9da339 07-Jul-2010 Zhanyong Wan <wan@google.com> Changes how the TypeLoc traverser invokes the Type traverser: before,
VisitFooTypeLoc() calls VisitFooType(); now, TraverseFooTypeLoc()
calls WalkUpFromFooType(). This allows clients that override
WalkUpFromFooType() to continue to work. It also preserves the
property that Visit*() in the base visitor class is a no-op (s.t. a
subclass doesn't have to call Base::Visit*() when overriding
Visit*()).

Also fixes some typos in comments.

Also added a missing getDerived() inside
TraverseQualifiedTypeLoc(). The call is needed in case a subclass
overrides TraverseTypeLoc().

Reviewed by nlewycky and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107816 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
717cc00c16eabf0eefd3cc69394e97f7229af0c8 07-Jul-2010 Zhanyong Wan <wan@google.com> Changes how the TypeLoc traverser invokes the Type traverser: before,
VisitFooTypeLoc() calls VisitFooType(); now, TraverseFooTypeLoc()
calls WalkUpFromFooType(). This allows clients that override
WalkUpFromFooType() to continue to work. It also preserves the
property that Visit*() in the base visitor class is a no-op (s.t. a
subclass doesn't have to call Base::Visit*() when overriding
Visit*()).

Also fixes some typos in comments.

Also added a missing getDerived() inside
TraverseQualifiedTypeLoc(). The call is needed in case a subclass
overrides TraverseTypeLoc().

Reviewed by nlewycky and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107816 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
eclBase.h
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.h
eclBase.h
767c192122581041b3ff579ddefbb2dd389445c5 07-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Avoid double-traversing for QualifiedTypeLoc -- we were calling
VisitTypeLoc twice for qualified types, once for the qualified form
and once for the unqualified (though they looked the same by the time
we got to visittypeloc). Now only visit once, which matches previous
behavior.

Reviewed by nlewycky


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107754 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
c34c2116346a29869b47b190f6dea589823d6947 07-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Avoid double-traversing for QualifiedTypeLoc -- we were calling
VisitTypeLoc twice for qualified types, once for the qualified form
and once for the unqualified (though they looked the same by the time
we got to visittypeloc). Now only visit once, which matches previous
behavior.

Reviewed by nlewycky


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107754 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
076f4df01e0467fac58fcfb5d9425dc854d6d56e 07-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Add a const version of a method, to be consistent with other methods
of the same type. I think this was just an oversight before.

Reviewed by chandlerc. Submitted as an "obvious" fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107737 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
dd5faf05dfe0163bdde939937d4fb0270086178a 07-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Add a const version of a method, to be consistent with other methods
of the same type. I think this was just an oversight before.

Reviewed by chandlerc. Submitted as an "obvious" fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107737 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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.h
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.h
9af53812d5977e79d0330e7c38c2ce9eb0791eda 05-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write the identifier namespace in PCH for decls that may modify it.

We can now use a PCH'ed <map>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107617 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclTemplate.h
c8f9af2943699ff623ca08f2e5ed4d72e0351189 05-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write the identifier namespace in PCH for decls that may modify it.

We can now use a PCH'ed <map>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107617 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclTemplate.h
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.h
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.h
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.h
ecl.h
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.h
ecl.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
54c532eca864cecdf41cd22250d29c587d9e00e1 04-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add TypeLoc traversal to the RecursiveASTVisitor! Because the TypeLocs don't
contain all the same information that their Types do, we will fall back to
traversing the Types instead. The default TypeLoc visitor calls the matching
Type visitor so that existing clients should continue to work with no change.

Also adds element traversal to the ExtVectorType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107592 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
4d2229c7a9514ee2b960aa9e59f7259cebbaa421 04-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add TypeLoc traversal to the RecursiveASTVisitor! Because the TypeLocs don't
contain all the same information that their Types do, we will fall back to
traversing the Types instead. The default TypeLoc visitor calls the matching
Type visitor so that existing clients should continue to work with no change.

Also adds element traversal to the ExtVectorType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107592 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
7ea909b3620ae1e6f52907c7b47ea6f2ba63a87d 04-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Fix ObjCInterfaceTypeLoc to inherit from ObjCObjectTypeLoc so as to match the
Type hierarchy. Without this, TypeLocNodes.def will give you wrong type
hierarchy information (claiming that ObjCObjectTypeLoc is the base of
ObjCInterfaceTypeLoc, which it wasn't).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107578 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
a8bef693d8761e31845a26e136f8d3a0983d2f46 04-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Fix ObjCInterfaceTypeLoc to inherit from ObjCObjectTypeLoc so as to match the
Type hierarchy. Without this, TypeLocNodes.def will give you wrong type
hierarchy information (claiming that ObjCObjectTypeLoc is the base of
ObjCInterfaceTypeLoc, which it wasn't).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107578 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
bb7bf9bbd7e455154fd2d481f3c3c5446b871135 03-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When setting the anonymous namespace at PCH reading, it may still be initializing so avoid
the invariant checks at NamespaceDecl::setAnonymousNamespace().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107566 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a038c1dcface5a404d540a0d0688962cbe656af9 03-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When setting the anonymous namespace at PCH reading, it may still be initializing so avoid
the invariant checks at NamespaceDecl::setAnonymousNamespace().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107566 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
eclCXX.h
040dd7f2bf53b5ad1e95f385bfe2201f73ebf7c4 03-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write CastExpr's CXXBaseSpecifierArray for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107542 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
suallyTinyPtrVector.h
0745d0a648b75bd304045309276c70a755adaafb 03-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write CastExpr's CXXBaseSpecifierArray for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107542 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
suallyTinyPtrVector.h
644868591f60eec090c00a4fe6a92fcb9b4abf8b 03-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix broken PCH support for CXXDefaultArgExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107541 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
8a50733034edd6a349b34e2b9f0c8d0a874846d3 03-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix broken PCH support for CXXDefaultArgExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107541 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
eclCXX.h
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.h
eclCXX.h
dc651872990269d88f4160a991e7db3439aaf82e 02-Jul-2010 Zhanyong Wan <wan@google.com> Make RecursiveASTVisitor traverse function parameter types in a function
prototype declaration. Reviewed by chandlerc and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107511 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
234faa72224a038e3259ad82d4214174850b8b75 02-Jul-2010 Zhanyong Wan <wan@google.com> Make RecursiveASTVisitor traverse function parameter types in a function
prototype declaration. Reviewed by chandlerc and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107511 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
eclCXX.h
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.h
eclCXX.h
449e309c09db77d8be2280cd12c8b3bda1276efe 02-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Don't visit implicitly defined functions (default constructors and the
like). Our goal with this visitor is to visit exactly what people type.

Reviewed by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107497 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
d0b982ca5cf685af08d5015e8c2dfae3ecab1a0b 02-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Don't visit implicitly defined functions (default constructors and the
like). Our goal with this visitor is to visit exactly what people type.

Reviewed by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107497 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
fae7b154d0b498ac5775692a2b37bfb3deb1ab9e 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Handle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.

<vector> header can be used correctly through PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107483 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
91468328268f8be076c399e8482ec3cf98fe90cc 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.

<vector> header can be used correctly through PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107483 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclCXX.h
edeclarable.h
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
eclCXX.h
edeclarable.h
f2606db18b5d64f241d74dc4e967347ad3da4792 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107473 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
43921b53b582145f0d1b7c48223bd4d9f0a9d1be 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107473 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
eclCXX.h
eclTemplate.h
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.h
eclCXX.h
eclTemplate.h
29d82da2bf4304927c5302adc7c55fa209a1239f 02-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Handle typedef function declarations correctly, such as
typedef int (*Myfunc)(int);
Myfunc func;

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107450 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
f650a624f7219be057d8f4e1a3174092297816f5 02-Jul-2010 Craig Silverstein <csilvers2000@yahoo.com> Handle typedef function declarations correctly, such as
typedef int (*Myfunc)(int);
Myfunc func;

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107450 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
ff79c3ba4e23a829b68e2f242db785573fecadf9 30-Jun-2010 Zhanyong Wan <wan@google.com> Fix RecursiveASTVisitor to traverse the ctor initializer list before
traversing the ctor body when traversing a CXXConstructorDecl.
Reviewed by chandlerc and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107304 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
6beaf938c0a2587ac4b2b60a51fbb9a80f72b766 30-Jun-2010 Zhanyong Wan <wan@google.com> Fix RecursiveASTVisitor to traverse the ctor initializer list before
traversing the ctor body when traversing a CXXConstructorDecl.
Reviewed by chandlerc and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107304 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
3924a168ffe6ebbe459db98208b195266f0ae147 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support ParenListExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107266 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
37bdfe284ad365f753741d1d89c078c148b3f4af 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support ParenListExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107266 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c90cb427494ddb34dad06f18497ee136e688b5f2 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Make the constructor explicit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107265 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
0ab5de16a47d64ba7cc8ca2e31b679daeae963fe 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make the constructor explicit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107265 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
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
eclBase.h
eclCXX.h
eclFriend.h
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
eclBase.h
eclCXX.h
eclFriend.h
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
STContext.h
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
STContext.h
bf3b1a277831b6e1869efdd9ab531ac604687d6e 29-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> A few prettifications. Also renamed TraverseInitializer to
TraverseConstructorInitializer, to be a bit clearer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107102 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
4d072932287eb074a4168804cac1acb18a51d5e8 29-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> A few prettifications. Also renamed TraverseInitializer to
TraverseConstructorInitializer, to be a bit clearer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107102 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
594cb37993facf069cc0fd16f674c8fb46b1578a 29-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix up ClassTemplateSpecializationDecl: For implicit instantiations
("set<int> x;"), we don't want to recurse at all, since the
instatiated class isn't written in the source code anywhere. (Note
the instatiated *type* -- set<int> -- is written, and will still get a
callback of TemplateSpecializationType). For explicit instantiations
("template set<int>;"), we do need a callback, since this is the only
callback that's made for this instantiation. We use
getTypeAsWritten() to distinguish.

We will still need to figure out how to handle template
specializations, which probably are still not quite correct.

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107098 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
bc55618eb97c519b8c186c350cb419f89021b073 29-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Fix up ClassTemplateSpecializationDecl: For implicit instantiations
("set<int> x;"), we don't want to recurse at all, since the
instatiated class isn't written in the source code anywhere. (Note
the instatiated *type* -- set<int> -- is written, and will still get a
callback of TemplateSpecializationType). For explicit instantiations
("template set<int>;"), we do need a callback, since this is the only
callback that's made for this instantiation. We use
getTypeAsWritten() to distinguish.

We will still need to figure out how to handle template
specializations, which probably are still not quite correct.

Reviewed by chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107098 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
61203ea721a4ef67b7c157d172605486f60c8670 28-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Add support for traversing initializer lists (in constructors), which
we ignoring before. To give access to the names on the initializer,
which aren't a type or an expr or a decl, I've introduced a new
TraverseInitializer. By default, it just traverses on the expr that
the name is being initialized to.

Reviewed by chandlerc. Tested via clang's 'make test'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107008 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
0f8c08843fc6c8abe03654f609e1e03fcc557855 28-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Add support for traversing initializer lists (in constructors), which
we ignoring before. To give access to the names on the initializer,
which aren't a type or an expr or a decl, I've introduced a new
TraverseInitializer. By default, it just traverses on the expr that
the name is being initialized to.

Reviewed by chandlerc. Tested via clang's 'make test'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107008 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
xpr.h
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
xpr.h
1dafad294043b0c3960a1515e7fcc675930a3e31 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support CXXPseudoDestructorExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106999 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
de4bd18bb45a1db68996cfb949db3015fc25d10d 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support CXXPseudoDestructorExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106999 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
b616e6b9e75231db0a1859cb27db96186c789b94 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor PCH reading/writing of template arguments passed to expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106997 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
36c76f0bea0d3595a25a5362225c642019cc3176 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor PCH reading/writing of template arguments passed to expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106997 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
a31bec64c1fc6fcd43f7e93085022a97cb1f43b9 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support NonTypeTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106860 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
b24e199fbd17af780ab000c5862d191e4daffc0f 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support NonTypeTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106860 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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.h
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.h
39683dcf7e2465bdab8bd33c8b39f096be7dcf38 25-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Implement dependent alignment attribute support. This is a bit gross given the
current attribute system, but it is enough to handle class templates which
specify parts of their alignment in terms of their template parameters.

This also replaces the attributes test in SemaTemplate with one that actually
tests working attributes instead of broken ones. I plan to add more tests here
for non-dependent attributes in a subsequent patch.

Thanks to John for walking me through some of this. =D


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106818 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
4ced79f0971592e6e7122037de69ee9ae534ce72 25-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Implement dependent alignment attribute support. This is a bit gross given the
current attribute system, but it is enough to handle class templates which
specify parts of their alignment in terms of their template parameters.

This also replaces the attributes test in SemaTemplate with one that actually
tests working attributes instead of broken ones. I plan to add more tests here
for non-dependent attributes in a subsequent patch.

Thanks to John for walking me through some of this. =D


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106818 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
xprCXX.h
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.h
xprCXX.h
f19e9c4a68ff60c399edbdba8051fd5dc7f6d17e 23-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add isArrayType() to CanProxy's forwarders.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106629 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
f4c46193637631fc993d926ff31c7cb18c090d21 23-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add isArrayType() to CanProxy's forwarders.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106629 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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
eclTemplate.h
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
eclTemplate.h
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.h
ype.h
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.h
ype.h
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
eclObjC.h
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
eclObjC.h
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
anonicalType.h
ype.h
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
anonicalType.h
ype.h
93ee72fccf528c96e49532cc03b120a715477488 22-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write CXXDeleteExpr from/to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106552 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
95fc98ce95d4faa4f1bb2783384150530404ea6f 22-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write CXXDeleteExpr from/to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106552 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
35ebf7648592408db2ae6fde66038239f79351ac 22-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> When we ask for the enumerators of an EnumDecl, make sure we get them even if we have a EnumDecl that is not the definition of the enumeration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106541 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0e5abbe065ab7fb9e3b03b4d25fac3f2dd4b2389 22-Jun-2010 Douglas Gregor <dgregor@apple.com> When we ask for the enumerators of an EnumDecl, make sure we get them even if we have a EnumDecl that is not the definition of the enumeration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106541 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
eclTemplate.h
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.h
eclTemplate.h
ec29bc0265b0a67e7e47947fd5e0707f46c15d4a 22-Jun-2010 Victor Hsieh <victorhsieh@google.com> Support foo.{r,g,b,a}, where foo is a float4.

Change-Id: I68e9c36406db77bd0025c33cdbfc55324fa40568
ype.h
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
ttr.h
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
ttr.h
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.h
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.h
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.h
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.h
c347f6656222239271e001ee9cb969b5bea560a5 20-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support PCH emitting/reading of using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106404 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
b01a552d7bafb889305affe83018563620aab326 20-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support PCH emitting/reading of using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106404 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
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.h
d7bdd8d477e70fc3424777c5fed590d2ea6f38bd 19-Jun-2010 Jordy Rose <jediknil@belkadan.com> Fold additive constants, and support comparsions of the form $sym+const1 <> const2


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106339 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ba0f61cf5363f80e3241dc754235dfb246afe320 19-Jun-2010 Jordy Rose <jediknil@belkadan.com> Fold additive constants, and support comparsions of the form $sym+const1 <> const2


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106339 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
ttr.h
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
ttr.h
0ed75c0ee848bb8e27f97672f2522607288b26a6 18-Jun-2010 Gabor Greif <ggreif@gmail.com> John called for a less surprising cast

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106277 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
4ab92891a53adda8c52c1947351371da58e33f64 18-Jun-2010 Gabor Greif <ggreif@gmail.com> John called for a less surprising cast

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106277 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
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.h
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.h
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.h
b8e13e65f4d92ca1487167a88bd56b7f17558df7 17-Jun-2010 Zhanyong Wan <wan@google.com> Improves RecursiveASTVisitor:

* refactors code in DEF_TRAVERSE_DECL() into
TraverseDeclContextHelper() to reduce code bloat and facilitate
reuse.
* makes the order of traversing a FunctionDecl (including its
subclasses)'s children more natural: before the function parameters
are visited after the function body; now they are visited after the
function type and before the function body.
* fixes a double count for function return type and arguments.

Reviewed by chandlerc and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106236 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
0c05a1bae9e8a57f56663991d0442a69df34a003 17-Jun-2010 Zhanyong Wan <wan@google.com> Improves RecursiveASTVisitor:

* refactors code in DEF_TRAVERSE_DECL() into
TraverseDeclContextHelper() to reduce code bloat and facilitate
reuse.
* makes the order of traversing a FunctionDecl (including its
subclasses)'s children more natural: before the function parameters
are visited after the function body; now they are visited after the
function type and before the function body.
* fixes a double count for function return type and arguments.

Reviewed by chandlerc and csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106236 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
05b090c139038551a2d34c572242eefa9aa0ee46 17-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Some fixes to type-visiting -- a few places where the type-name was
explicitly typed in the source, but we weren't recursing on it. One
is new <type>, the other is <type>() (eg int()).

I also fixed the initializer parsing to parse on the syntactic
initializer list, not the semantic. Usually they'll be identical, so
this won't affect much in practice, but keeps the AST as a syntax-tree
visitor.

Reviewed by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106218 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
ea245e0ba48caf7e7acf870880c030d7ddc76667 17-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Some fixes to type-visiting -- a few places where the type-name was
explicitly typed in the source, but we weren't recursing on it. One
is new <type>, the other is <type>() (eg int()).

I also fixed the initializer parsing to parse on the syntactic
initializer list, not the semantic. Usually they'll be identical, so
this won't affect much in practice, but keeps the AST as a syntax-tree
visitor.

Reviewed by chandlerc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106218 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
18b01bd5d2e05de5e6789f153d160dbb86f465c9 17-Jun-2010 Gabor Greif <ggreif@gmail.com> fix some more gcc3.4 constness warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106216 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
170e5080011acc60e33ec9b53f96c569a1078aa9 17-Jun-2010 Gabor Greif <ggreif@gmail.com> fix some more gcc3.4 constness warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106216 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
ttr.h
akefile
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
ttr.h
akefile
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.h
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.h
5f4a5f69d7a81187c9219254bbfd5685e4bd23cb 16-Jun-2010 Zhanyong Wan <wan@google.com> Test commit by adding a blank comment line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106114 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
2ac54ec0a8ad305fdd76847c2fd6631cfb7baa82 16-Jun-2010 Zhanyong Wan <wan@google.com> Test commit by adding a blank comment line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106114 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
anonicalType.h
eclTemplate.h
ype.h
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.h
anonicalType.h
eclTemplate.h
ype.h
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.h
anonicalType.h
eclTemplate.h
ype.h
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.h
anonicalType.h
eclTemplate.h
ype.h
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
ype.h
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
ype.h
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
anonicalType.h
ype.h
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
anonicalType.h
ype.h
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.h
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.h
310bbc1dc656701f812a5eaa9f5ef52efe7dc769 15-Jun-2010 Daniel Dunbar <daniel@zuster.org> Add <cstddef> include to get ptrdiff_t, for gcc-4.6; patch by Dimitry Andric.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105995 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
ea3fe7c72b73ae09070ced4dc12ddbfbd29c0b1a 15-Jun-2010 Daniel Dunbar <daniel@zuster.org> Add <cstddef> include to get ptrdiff_t, for gcc-4.6; patch by Dimitry Andric.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105995 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
53da3a4c313c1e716170cc0be6612d733daad2a5 14-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Teach TemplateDecl::getSourceRange() to cover the entire declaration,
from Peter Collingbourne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105951 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
80484d0de0dccee66d9f1760127c3e6e218987da 14-Jun-2010 Douglas Gregor <dgregor@apple.com> Teach TemplateDecl::getSourceRange() to cover the entire declaration,
from Peter Collingbourne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105951 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
08652dede341124aa0bd6a1045321277f3ee09d2 11-Jun-2010 Chris Lattner <sabre@nondot.org> preprocessor directives in macro arguments aren't standard,
hopefully this unbreaks msvc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105826 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
ae6de57e6c823471f04a15dbfbbb39449d4d1e56 11-Jun-2010 Chris Lattner <sabre@nondot.org> preprocessor directives in macro arguments aren't standard,
hopefully this unbreaks msvc


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105826 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
7b44111a5cc88212fa9111c6fabdbfc5bc1989fc 11-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Add a few FIXMEs: recursing over shadow decls, and semantics vs
syntactic iterating over initializer exprs. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105825 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
40498cdfe09f6dfa939ca98cb9507aebaae3436f 11-Jun-2010 Craig Silverstein <csilvers2000@yahoo.com> Add a few FIXMEs: recursing over shadow decls, and semantics vs
syntactic iterating over initializer exprs. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105825 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
ype.h
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.h
ype.h
08fa3b16948564b664aeefb40002acf8811f67c0 11-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Improve readability with TRY_TO, remove a redundant comment, and fix one aspect
of the recursion on VarDecls. Patch by Craig Silverstein.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105803 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
6c321e35008f2c99eeb1409b43859a04c48e5ce5 11-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Improve readability with TRY_TO, remove a redundant comment, and fix one aspect
of the recursion on VarDecls. Patch by Craig Silverstein.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105803 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
ecursiveASTVisitor.h
emplateBase.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ecursiveASTVisitor.h
emplateBase.h
ype.h
ypeLoc.h
ypeNodes.def
444706b435979b277818610a1367d1e550a1680c 11-Jun-2010 John McCall <rjmccall@apple.com> Provide a method to clear the current state of a TypeLocBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105800 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocBuilder.h
480076c3defdcaf07e8a87c81930da467a702425 11-Jun-2010 John McCall <rjmccall@apple.com> Provide a method to clear the current state of a TypeLocBuilder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105800 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocBuilder.h
da473eaa999f79b7ca5b1ec431e091b3cc81294a 11-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Avoid repeating the list of operators twice in RecursiveASTVisitor through
a set of preprocessor macros. Patch by Zhanyong Wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105796 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
7d66f8cafd807e551efb4739cdb37fc272cf5345 11-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Avoid repeating the list of operators twice in RecursiveASTVisitor through
a set of preprocessor macros. Patch by Zhanyong Wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105796 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
7681f51e310d4c27eece9ee710e69d7eabda984e 11-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Tweak a comment on the visitor to clarify one order of visit issue. Patch from
Zhanyong Wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105795 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
b5c202f9e4f6d0f230d5cb8848779259ebf95b7f 11-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Tweak a comment on the visitor to clarify one order of visit issue. Patch from
Zhanyong Wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105795 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
a91bdaf5ba082ab564e6833ce3c0bff95bcc0d3c 10-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105787 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
e3e210c3aa3c1b289eee669a1d235fc16df384a0 10-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105787 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
8b88f6aaa408a4b026615a2fb474e5fe6032c0f7 09-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.

Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
dfc35e33177a433b56454f1d2b5e53734f65b288 09-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.

Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
522fb671290dd5462bfd819401768686fa53e925 09-Jun-2010 Tom Care <tcare@apple.com> Added helper function to Type class to determine if a type is a builtin type. This complements the existing function that determines if a type is a specific builtin type.

Modified:
include/clang/AST/Type.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105664 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
9b065ddabf572772991a4aadad5bf4921fac5069 09-Jun-2010 Tom Care <tcare@apple.com> Added helper function to Type class to determine if a type is a builtin type. This complements the existing function that determines if a type is a specific builtin type.

Modified:
include/clang/AST/Type.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105664 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
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
eclCXX.h
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
eclCXX.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
ea285162342df160e7860e26528bc7110bc6c0cd 04-Jun-2010 Shih-wei Liao <sliao@google.com> Initial slang.

Change-Id: I4f84a741e5fbc440cd4c251406d2b611a237f713
PValue.h
ST.h
STConsumer.h
STContext.h
STDiagnostic.h
STImporter.h
STVector.h
ttr.h
XXInheritance.h
anonicalType.h
harUnits.h
ecl.h
eclAccessPair.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclFriend.h
eclGroup.h
eclNodes.def
eclObjC.h
eclTemplate.h
eclVisitor.h
eclarationName.h
ependentDiagnostic.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
ullExpr.h
estedNameSpecifier.h
arentMap.h
rettyPrinter.h
ecordLayout.h
edeclarable.h
tmt.h
tmtCXX.h
tmtGraphTraits.h
tmtIterator.h
tmtNodes.def
tmtObjC.h
tmtVisitor.h
emplateBase.h
emplateName.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeLocNodes.def
ypeLocVisitor.h
ypeNodes.def
ypeOrdering.h
ypeVisitor.h
nresolvedSet.h
suallyTinyPtrVector.h
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
xpr.h
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
xpr.h
a43dea209d7c936286e7f1099fde4e9dae27f1a1 04-Jun-2010 John McCall <rjmccall@apple.com> Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef. Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
82dc00948fe7116edd31bfa07a728fda98648be1 04-Jun-2010 John McCall <rjmccall@apple.com> Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef. Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
xternalASTSource.h
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.h
xternalASTSource.h
69fbbc295019f5760c3a7c6d7da3927e97c5d560 31-May-2010 Sean Hunt <rideau3@gmail.com> Move .td files from AST to Basic.

Parse will need to see these files because it needs to know how to parse
attributes. The generated files are still placed in the appropriate directory so
as to preserve layering. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105179 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclNodes.td
akefile
tmtNodes.td
8b9b742ec13a210f5df7d0c9be37f185c1615a41 31-May-2010 Sean Hunt <rideau3@gmail.com> Move .td files from AST to Basic.

Parse will need to see these files because it needs to know how to parse
attributes. The generated files are still placed in the appropriate directory so
as to preserve layering. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105179 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclNodes.td
akefile
tmtNodes.td
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
ecl.h
eclBase.h
eclCXX.h
eclNodes.def
eclNodes.td
eclObjC.h
eclTemplate.h
eclVisitor.h
akefile
ecursiveASTVisitor.h
tmt.h
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
ecl.h
eclBase.h
eclCXX.h
eclNodes.def
eclNodes.td
eclObjC.h
eclTemplate.h
eclVisitor.h
akefile
ecursiveASTVisitor.h
tmt.h
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.h
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.h
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.h
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.h
883cbd144b0009b90d242bd3029714a71b34bf72 27-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed missing initialization of member. Should we enable unused argument warning?.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104829 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
25a0fe2a99aaf2d1bf5bdfdae7ab11e2a5e7622f 27-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed missing initialization of member. Should we enable unused argument warning?.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104829 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
ttr.h
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
ttr.h
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
ttr.h
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
ttr.h
061dc86f5a198f4fe456c44d4108f15726c74f11 26-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104714 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
e935fdb06d60398bef724fd50bba84c1b921b40e 26-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104714 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
bd052e4fcb9d924fe5d2532039a84a1ae17a1282 26-May-2010 Anders Carlsson <andersca@mac.com> ASTRecordLayoutBuilder is no longer a friend of ASTRecordLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104685 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
1a972998db7768bbdf59e283897c5b6446f58653 26-May-2010 Anders Carlsson <andersca@mac.com> ASTRecordLayoutBuilder is no longer a friend of ASTRecordLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104685 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
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.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.h
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.h
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.h
446527d739618c599d4b1308ab3fc391c3c655eb 25-May-2010 Douglas Gregor <doug.gregor@gmail.com> Add Redeclarable boilerplate to TypedefDecl, from Peter Collingbourne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104631 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ff3dc395ba08b3a3cadc8d3121a4cb086ab287d6 25-May-2010 Douglas Gregor <dgregor@apple.com> Add Redeclarable boilerplate to TypedefDecl, from Peter Collingbourne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104631 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
nresolvedSet.h
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.h
nresolvedSet.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
15135984ec91bb94ba742f5cba85b61d4fb41910 22-May-2010 Nick Lewycky <nicholas@mxc.ca> Outdent this file by 2 spaces per the coding standards, and also clean up
whitespace at the end of lines since I'm already touching the whole file
anyways.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104403 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
db3f847cb883fdb19d79c7223fa032e7266c0ee5 22-May-2010 Nick Lewycky <nicholas@mxc.ca> Outdent this file by 2 spaces per the coding standards, and also clean up
whitespace at the end of lines since I'm already touching the whole file
anyways.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104403 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
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.h
d72e7d2c73e5fce898efecafafb0a02c2eded3ce 21-May-2010 Nick Lewycky <nicholas@mxc.ca> TypeVisitor doesn't visit Stmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104332 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
74d4031b9a7dbb6204c4f97062d44bd26e21b014 21-May-2010 Nick Lewycky <nicholas@mxc.ca> TypeVisitor doesn't visit Stmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104332 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
9a5ba2e5d2637ed234e1ec0bf6ef9f4fdc3b3395 21-May-2010 Chandler Carruth <chandlerc@gmail.com> Teach the RecursiveASTVisitor to enter parts of the AST previously missed.
Factor its implementation to ease the addition of these custom edges to
traverse. With this patch we get initializer expressions, block bodies, type
source info, and function argument, result, and exception types. There are
probably still some more missed edges.

While we're here, clean up and flesh out a bunch of comments.

Patch by Zhanyong Wan; I've done a cursory review, but further review
appreciated. This is fast becoming one of the most important public APIs to the
AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104315 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
facfc77487a890bfb7b5eee7e21cd2b395a9faaf 21-May-2010 Chandler Carruth <chandlerc@gmail.com> Teach the RecursiveASTVisitor to enter parts of the AST previously missed.
Factor its implementation to ease the addition of these custom edges to
traverse. With this patch we get initializer expressions, block bodies, type
source info, and function argument, result, and exception types. There are
probably still some more missed edges.

While we're here, clean up and flesh out a bunch of comments.

Patch by Zhanyong Wan; I've done a cursory review, but further review
appreciated. This is fast becoming one of the most important public APIs to the
AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104315 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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
ypeLoc.h
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
ypeLoc.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
50be5101831a8e3679e18775b41816c9ddfc39ca 19-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
e4da7a034a2fcf4b14d0bcc28d05de0878159061 19-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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
ttr.h
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
ttr.h
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
ttr.h
ype.h
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
ttr.h
ype.h
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
ecursiveASTVisitor.h
tmt.h
tmtVisitor.h
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
ecursiveASTVisitor.h
tmt.h
tmtVisitor.h
1e94f8cb4678256a3438a69879b9e346038108d8 18-May-2010 Nick Lewycky <nicholas@mxc.ca> Add a 'Base' type to RecursiveASTVisitor to make recursing easier and document
how you're supposed to use it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103993 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
2fe0025a1300689b2d2517bb89ecadbab8b62ac5 18-May-2010 Nick Lewycky <nicholas@mxc.ca> Add a 'Base' type to RecursiveASTVisitor to make recursing easier and document
how you're supposed to use it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103993 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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.h
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.h
a0e80100a3079c3c2410fb48f3b14ef621c2a42d 16-May-2010 John McCall <rjmccall@apple.com> Be sure to initialize the "has base type as written" field of an
ObjCObjectTypeLoc. This should clear up some valgrind errors we've
been seeing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103894 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
ca6773808f8e75ffa86847e9d12885c69e9de53e 16-May-2010 John McCall <rjmccall@apple.com> Be sure to initialize the "has base type as written" field of an
ObjCObjectTypeLoc. This should clear up some valgrind errors we've
been seeing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103894 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
anonicalType.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeNodes.def
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.h
anonicalType.h
ecursiveASTVisitor.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeNodes.def
8b9ae4311f89abe3c417577a4e6e23a504f5d33f 15-May-2010 Douglas Gregor <doug.gregor@gmail.com> Implement semantic analysis and an AST representation for the named
return value optimization. Sema marks return statements with their
NRVO candidates (which may or may not end up using the NRVO), then, at
the end of a function body, computes and marks those variables that
can be allocated into the return slot.

I've checked this locally with some debugging statements (not
committed), but there won't be any tests until CodeGen comes along.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103865 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmt.h
5077c3876beeaed32280af88244e8050078619a8 15-May-2010 Douglas Gregor <dgregor@apple.com> Implement semantic analysis and an AST representation for the named
return value optimization. Sema marks return statements with their
NRVO candidates (which may or may not end up using the NRVO), then, at
the end of a function body, computes and marks those variables that
can be allocated into the return slot.

I've checked this locally with some debugging statements (not
committed), but there won't be any tests until CodeGen comes along.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103865 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmt.h
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
xpr.h
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
xpr.h
4d7353a63e9957701befb8527d7d59de89d000e0 14-May-2010 Daniel Dunbar <daniel@zuster.org> Revert r103770, "Added basic source locations to Elaborated and DependentName
types.", it is breaking Clang bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103775 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
a63db84b164d3f1c987a3ea6251e3092db4f317b 14-May-2010 Daniel Dunbar <daniel@zuster.org> Revert r103770, "Added basic source locations to Elaborated and DependentName
types.", it is breaking Clang bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103775 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
ef012445d431eb51de6ce033e117106624a1dc73 14-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103770 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
5431299f6e1e1d14b39b924fe24bf04035f4ae42 14-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103770 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
a78927d6476067d6c7a68d6bc21c93d66f265594 13-May-2010 Douglas Gregor <doug.gregor@gmail.com> Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
- For every use of a vtable, Sema calls MarkVTableUsed() to indicate
the use. For example, this occurs when calling a virtual member
function of the class, defining a constructor of that class type,
dynamic_cast'ing from that type to a derived class, casting
to/through a virtual base class, etc.
- For every definition of a vtable, Sema calls MarkVTableUsed() to
indicate the definition. This happens at the end of the translation
unit for classes whose key function has been defined (so we can
delay computation of the key function; see PR6564), and will also
occur with explicit template instantiation definitions.
- For every vtable defined/used, we mark all of the virtual member
functions of that vtable as defined/used, unless we know that the key
function is in another translation unit. This instantiates virtual
member functions when needed.
- At the end of the translation unit, Sema tells CodeGen (via the
ASTConsumer) which vtables must be defined (CodeGen will define
them) and which may be used (for which CodeGen will define the
vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
(1) There's a ton of churn in the tests, because the order in which
vtables get emitted to IR has changed. I've tried to isolate some of
the larger tests from these issues.
(2) Some diagnostics related to
implicitly-instantiated/implicitly-defined virtual member functions
have moved to the point of first use/definition. It's better this
way.
(3) I could use a review of the places where we MarkVTableUsed, to
see if I missed any place where the language effectively requires a
vtable.

Fixes PR7114 and PR6564.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103718 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
6fb745bdf1ff1e32caf07e42093a7920726892c1 13-May-2010 Douglas Gregor <dgregor@apple.com> Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
- For every use of a vtable, Sema calls MarkVTableUsed() to indicate
the use. For example, this occurs when calling a virtual member
function of the class, defining a constructor of that class type,
dynamic_cast'ing from that type to a derived class, casting
to/through a virtual base class, etc.
- For every definition of a vtable, Sema calls MarkVTableUsed() to
indicate the definition. This happens at the end of the translation
unit for classes whose key function has been defined (so we can
delay computation of the key function; see PR6564), and will also
occur with explicit template instantiation definitions.
- For every vtable defined/used, we mark all of the virtual member
functions of that vtable as defined/used, unless we know that the key
function is in another translation unit. This instantiates virtual
member functions when needed.
- At the end of the translation unit, Sema tells CodeGen (via the
ASTConsumer) which vtables must be defined (CodeGen will define
them) and which may be used (for which CodeGen will define the
vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
(1) There's a ton of churn in the tests, because the order in which
vtables get emitted to IR has changed. I've tried to isolate some of
the larger tests from these issues.
(2) Some diagnostics related to
implicitly-instantiated/implicitly-defined virtual member functions
have moved to the point of first use/definition. It's better this
way.
(3) I could use a review of the places where we MarkVTableUsed, to
see if I missed any place where the language effectively requires a
vtable.

Fixes PR7114 and PR6564.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103718 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
ype.h
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.h
ype.h
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.h
ecl.h
ecursiveASTVisitor.h
emplateName.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ecl.h
ecursiveASTVisitor.h
emplateName.h
ype.h
ypeLoc.h
ypeNodes.def
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
eclContextInternals.h
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
eclContextInternals.h
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
xpr.h
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
xpr.h
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
eclarationName.h
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
eclarationName.h
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.h
eclarationName.h
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.h
eclarationName.h
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.h
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.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.h
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.h
8ac9cd508f6f74b94749b4e96163e863e842086c 10-May-2010 Chandler Carruth <chandlerc@gmail.com> Doxygen-ify a comment and add an example of when this AST node is required.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103389 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
ddfe960d252a93525692b547945236d361d1929f 10-May-2010 Chandler Carruth <chandlerc@gmail.com> Doxygen-ify a comment and add an example of when this AST node is required.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103389 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
31a064dad51d5659cd05a6ab87843e5cf00238b5 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify default argument definitions and uses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103376 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
030854b95f7bfd86aaa8afd9ae1aff9768a37e9a 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify default argument definitions and uses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103376 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
d5f99d18d76cc4f105361876e34c2a0f703efeb3 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify 'this' and 'throw'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103375 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
2fbdfcdf3bbf7b941853d38b123930755e837437 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify 'this' and 'throw'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103375 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
b6538bba80f90fb335518f7cc1f06b441db35702 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify typeid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103374 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
14ab24f01e36d495fce183aa67b41e45cdd54f39 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify typeid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103374 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
f7557522cd45846f3c017490748ed7b2b97bdd83 09-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXMemberCallExpr correctly. Before it would serialize
and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103371 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
1817bd483b538fd3f4530649f5cb900bad9e8a76 09-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXMemberCallExpr correctly. Before it would serialize
and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103371 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
ecordLayout.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
ecordLayout.h
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.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.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.h
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.h
15d6c2fb6d490811b41792b7d90331fb9c16694e 08-May-2010 Douglas Gregor <doug.gregor@gmail.com> When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
b4eeaff1595b7d0a8fbc2b3c8bec7dc63f48b7fd 08-May-2010 Douglas Gregor <dgregor@apple.com> When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
34554d5a66067c6aec5d0aa846c1ce041156c76d 08-May-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a recursive AST visitor that makes it trivial to recursively
walk an entire AST, including all of the types, declarations,
statements, and expressions, and allowing one to easily override the
behavior of the walk at any particular node kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103308 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
d30bf2eb6d6bbebd41236bf205d3a6dfc51a3659 08-May-2010 Douglas Gregor <dgregor@apple.com> Introduce a recursive AST visitor that makes it trivial to recursively
walk an entire AST, including all of the types, declarations,
statements, and expressions, and allowing one to easily override the
behavior of the walk at any particular node kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103308 91177308-0d34-0410-b5e6-96231b3b80d8
ecursiveASTVisitor.h
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
ecl.h
eclBase.h
eclCXX.h
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
ecl.h
eclBase.h
eclCXX.h
11198d21ca469374ead88920b60b5bbbe89808f8 07-May-2010 Ted Kremenek <kremenek@apple.com> Add NamedDecl::printName() for clients that to use getNameAsString() but are already using a raw_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103284 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0b2227e1ca4eb7b2deaec3da963b7777f0bd7f7b 07-May-2010 Ted Kremenek <kremenek@apple.com> Add NamedDecl::printName() for clients that to use getNameAsString() but are already using a raw_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103284 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ypeLoc.h
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.h
ypeLoc.h
d32e9f2752bcd182a1c3ced3039139a5b0dcee18 06-May-2010 John McCall <rjmccall@apple.com> Kill a never-defined, never-used member function. Thanks, Enea.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103175 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
04a025e9980a5d9ce4bebbeff53e76ffb8377fe0 06-May-2010 John McCall <rjmccall@apple.com> Kill a never-defined, never-used member function. Thanks, Enea.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103175 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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
ecl.h
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
ecl.h
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.h
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.h
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.h
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.h
10250b5323c9c3d19a405b6ff110092038e9a6f6 05-May-2010 Fariborz Jahanian <fjahanian@apple.com> This patch deals with Sema Part of Setter/Getter synthesis
of properties which are of C++ objects. Code Gen to follow
(Radar 7468090).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103123 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
17cb326cb62a59f53d92236394af40eaae4eddbd 05-May-2010 Fariborz Jahanian <fjahanian@apple.com> This patch deals with Sema Part of Setter/Getter synthesis
of properties which are of C++ objects. Code Gen to follow
(Radar 7468090).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103123 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
akefile
tmt.h
tmtNodes.def
tmtNodes.td
tmtVisitor.h
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.h
akefile
tmt.h
tmtNodes.def
tmtNodes.td
tmtVisitor.h
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.h
akefile
tmt.h
tmtNodes.def
tmtNodes.td
tmtVisitor.h
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.h
akefile
tmt.h
tmtNodes.def
tmtNodes.td
tmtVisitor.h
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.h
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.h
94e4b0ce66c64b61aa1a11a686f32e383c166219 05-May-2010 Sean Hunt <rideau3@gmail.com> Add forgotten CMakeFiles.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103074 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
391c40cdfbffa85f2404ba96b5faffdd9c9de3f2 05-May-2010 Sean Hunt <rideau3@gmail.com> Add forgotten CMakeFiles.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103074 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.h
akefile
tmt.h
tmtNodes.def
tmtNodes.td
tmtVisitor.h
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.h
akefile
tmt.h
tmtNodes.def
tmtNodes.td
tmtVisitor.h
38d0f2ffd306c187fd862aabb22e01311b78468d 04-May-2010 Chris Lattner <sabre@nondot.org> add the ability to associate 'category' names with diagnostics
and diagnostic groups. This allows the compiler to group
diagnostics together (e.g. "Logic Warning",
"Format String Warning", etc) like the static analyzer does.
This is not exposed through anything in the compiler yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103051 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
27b0f510d1d4f9ed5668eec1195f04b4a74a4426 04-May-2010 Chris Lattner <sabre@nondot.org> add the ability to associate 'category' names with diagnostics
and diagnostic groups. This allows the compiler to group
diagnostics together (e.g. "Logic Warning",
"Format String Warning", etc) like the static analyzer does.
This is not exposed through anything in the compiler yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103051 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
34381083e2621df53741e829d718f898cebb9fed 04-May-2010 Douglas Gregor <doug.gregor@gmail.com> When creating a call to a base subobject's operator= in an
implicitly-defined copy assignment operator, suppress the protected
access check. This eliminates the remaining failure in the
Boost.SmartPtr library (that was a product of the copy-assignment
generation rewrite) and, presumably, the Boost.TR1 library as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103010 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
6cdc161527a513f28dfc6f6ec27eb287f8268024 04-May-2010 Douglas Gregor <dgregor@apple.com> When creating a call to a base subobject's operator= in an
implicitly-defined copy assignment operator, suppress the protected
access check. This eliminates the remaining failure in the
Boost.SmartPtr library (that was a product of the copy-assignment
generation rewrite) and, presumably, the Boost.TR1 library as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103010 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
736558e2d2981e16f7d75a1000cf52d76090ed91 03-May-2010 Douglas Gregor <doug.gregor@gmail.com> Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102931 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
324b54d3f60d92a82815512119791ce1c285b63e 03-May-2010 Douglas Gregor <dgregor@apple.com> Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102931 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
f7b163b082977c92c96e8c584fd50b4c4054e2d6 03-May-2010 Anders Carlsson <andersca@mac.com> Pass the construction kind down to EmitCXXConstructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102880 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
24eb78e38aba55c507bc3c05c37035a9ab2defa7 03-May-2010 Anders Carlsson <andersca@mac.com> Pass the construction kind down to EmitCXXConstructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102880 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ype.h
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
ype.h
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.h
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.h
f9898e8c59239c9737a57c6b1a3d1a007347d2fa 29-Apr-2010 Ted Kremenek <kremenek@apple.com> Rename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casing
for similar methods. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102634 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
db9a0aec04cfd95830d3745b17b0bab5b87b16d1 29-Apr-2010 Ted Kremenek <kremenek@apple.com> Rename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casing
for similar methods. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102634 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
xpr.h
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
xpr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
b539d102e1ea422fd034283578a5bbae9aaccfaa 28-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More of Sema to implement initialization of
ivar of c++ object types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102500 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
e4498c6d66a8f472cba29b6158a2e86dfc60d0ef 28-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More of Sema to implement initialization of
ivar of c++ object types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102500 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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
ype.h
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
ype.h
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.h
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.h
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.h
eclTemplate.h
ype.h
ypeNodes.def
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.h
eclTemplate.h
ype.h
ypeNodes.def
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.h
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.h
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.h
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.h
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
anonicalType.h
ype.h
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
anonicalType.h
ype.h
6dfe98fad7326c5c22bb83f6135c37eda3aa24f9 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for implicit property references in
Objective-C++. This is the last bit of (non-blocks-related) template
instantiation logic for Objective-C++. Yay!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102382 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
9cbfdd212ee0167f2487363d6fac7faaf7c65b64 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement template instantiation for implicit property references in
Objective-C++. This is the last bit of (non-blocks-related) template
instantiation logic for Objective-C++. Yay!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102382 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
4a1d3d039af0d74537ecb4ff8f55bb881319b2af 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for ObjCPropertyRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102379 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
e330354c6bfbb0d7856432fa9055d5236f1b2fa4 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement template instantiation for ObjCPropertyRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102379 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
0033ad86713a3f6024fbc2111fa3c207d2ce8373 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Implement template instantiation for value-dependent Objective-C ivar
references and isa expressions. Also, test template instantiation of
unresolved member references to Objective-C ivar references and isa
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102374 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
f9b9eab747e911ded499924b2616d8712d65efce 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement template instantiation for value-dependent Objective-C ivar
references and isa expressions. Also, test template instantiation of
unresolved member references to Objective-C ivar references and isa
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102374 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
tmtObjC.h
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
tmtObjC.h
3e93ab1a7228f50b8051c167af25cafcffed2852 25-Apr-2010 Anders Carlsson <andersca@mac.com> Add an explicit UsuallyTinyPtrVector that takes a single element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102283 91177308-0d34-0410-b5e6-96231b3b80d8
suallyTinyPtrVector.h
8f2abbc791bad003f5d190e70b01d7eafa2a7be1 25-Apr-2010 Anders Carlsson <andersca@mac.com> Add an explicit UsuallyTinyPtrVector that takes a single element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102283 91177308-0d34-0410-b5e6-96231b3b80d8
suallyTinyPtrVector.h
701a98167bae2eacad9b04a829a52dc9f5140e8b 24-Apr-2010 Anders Carlsson <andersca@mac.com> Convert more call sites over to the new GetAddressOfBaseClass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102272 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
fc89c31a329eb6b36c6dbd8b7cb945d1a831650e 24-Apr-2010 Anders Carlsson <andersca@mac.com> Convert more call sites over to the new GetAddressOfBaseClass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102272 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
302137f2ccb3843246d7a3dbb0a045e61e7012db 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add base paths for CK_BaseToDerived and CK_BaseToDerivedMemberPointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102261 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
f9d68e1dd015972318b2448f75115ff4fc3d5008 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add base paths for CK_BaseToDerived and CK_BaseToDerivedMemberPointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102261 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
edb8f575c58dd3d2b3624d64fc0d5d44f4aa11b8 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add base paths to CK_UncheckedDerivedToBase and CK_DerivedToBaseMemberPointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102260 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cee22421929c91b481f4d1bb85cd48c0f6b7510b 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add base paths to CK_UncheckedDerivedToBase and CK_DerivedToBaseMemberPointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102260 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
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
xpr.h
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
xpr.h
xprCXX.h
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
xpr.h
xprCXX.h
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
xpr.h
suallyTinyPtrVector.h
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
xpr.h
suallyTinyPtrVector.h
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.h
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.h
1a7697cc5fa364c548f50fd8931d22e84cecc74d 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
76d326448d7e4c10b2896edc2ee855d1e68d1b88 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
6742ed0fae1d786bcc2e6c9b4cca19f35fd13bd6 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
f0bf4d554f2513cbb4bec952c81ced59279ad91e 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
tmtObjC.h
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
tmtObjC.h
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
xpr.h
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
xpr.h
e5b8fd3a48d3c993d29d3a262ff21a36b8a6521d 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
f88b0d6c99e6473e78331271935986535dc4603c 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
650d862f7ddfc6215a15da62645cc5e47f93124f 23-Apr-2010 Anders Carlsson <andersca@mac.com> Add an inheritance path member variable to CastExpr. For now it's always null but for derived-to-base and base-to-derived cast expressions it will contain the full base path. This is needed to avoid ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102210 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
409c99edb8b623403fade6f3a9e9c86acda74455 23-Apr-2010 Anders Carlsson <andersca@mac.com> Add an inheritance path member variable to CastExpr. For now it's always null but for derived-to-base and base-to-derived cast expressions it will contain the full base path. This is needed to avoid ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102210 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
suallyTinyPtrVector.h
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.h
suallyTinyPtrVector.h
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
eclBase.h
eclContextInternals.h
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
eclBase.h
eclContextInternals.h
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.h
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.h
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
eclBase.h
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
eclBase.h
174c1d45482c22b589fb3a5e456088f0f3210965 23-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Strip cv-qualifiers when building C++ constructor and destructor
names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102171 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
20b3c9dda95e6808865110a21bfec25f95ebcaa7 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Strip cv-qualifiers when building C++ constructor and destructor
names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102171 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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
eclBase.h
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
eclBase.h
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
eclNodes.def
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
eclNodes.def
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.h
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.h
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.h
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.h
cc1ec854fa9a150a195bf004926aeb3736b2b218 21-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Rework the Parser-Sema interaction for Objective-C message
sends. Major changes include:

- Expanded the interface from two actions (ActOnInstanceMessage,
ActOnClassMessage), where ActOnClassMessage also handled sends to
"super" by checking whether the identifier was "super", to three
actions (ActOnInstanceMessage, ActOnClassMessage,
ActOnSuperMessage). Code completion has the same changes.
- The parser now resolves the type to which we are sending a class
message, so ActOnClassMessage now accepts a TypeTy* (rather than
an IdentifierInfo *). This opens the door to more interesting
types (for Objective-C++ support).
- Split ActOnInstanceMessage and ActOnClassMessage into parser
action functions (with their original names) and semantic
functions (BuildInstanceMessage and BuildClassMessage,
respectively). At present, this split is onyl used by
ActOnSuperMessage, which decides which kind of super message it
has and forwards to the appropriate Build*Message. In the future,
Build*Message will be used by template instantiation.
- Use getObjCMessageKind() within the disambiguation of Objective-C
message sends vs. array designators.

Two notes about substandard bits in this patch:
- There is some redundancy in the code in ParseObjCMessageExpr and
ParseInitializerWithPotentialDesignator; this will be addressed
shortly by centralizing the mapping from identifiers to type names
for the message receiver.
- There is some #if 0'd code that won't likely ever be used---it
handles the use of 'super' in methods whose class does not have a
superclass---but could be used to model GCC's behavior more
closely. This code will die in my next check-in, but I want it in
Subversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102021 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
2725ca8eb3354975ca77ed4b88ede7b60b216b9a 21-Apr-2010 Douglas Gregor <dgregor@apple.com> Rework the Parser-Sema interaction for Objective-C message
sends. Major changes include:

- Expanded the interface from two actions (ActOnInstanceMessage,
ActOnClassMessage), where ActOnClassMessage also handled sends to
"super" by checking whether the identifier was "super", to three
actions (ActOnInstanceMessage, ActOnClassMessage,
ActOnSuperMessage). Code completion has the same changes.
- The parser now resolves the type to which we are sending a class
message, so ActOnClassMessage now accepts a TypeTy* (rather than
an IdentifierInfo *). This opens the door to more interesting
types (for Objective-C++ support).
- Split ActOnInstanceMessage and ActOnClassMessage into parser
action functions (with their original names) and semantic
functions (BuildInstanceMessage and BuildClassMessage,
respectively). At present, this split is onyl used by
ActOnSuperMessage, which decides which kind of super message it
has and forwards to the appropriate Build*Message. In the future,
Build*Message will be used by template instantiation.
- Use getObjCMessageKind() within the disambiguation of Objective-C
message sends vs. array designators.

Two notes about substandard bits in this patch:
- There is some redundancy in the code in ParseObjCMessageExpr and
ParseInitializerWithPotentialDesignator; this will be addressed
shortly by centralizing the mapping from identifiers to type names
for the message receiver.
- There is some #if 0'd code that won't likely ever be used---it
handles the use of 'super' in methods whose class does not have a
superclass---but could be used to model GCC's behavior more
closely. This code will die in my next check-in, but I want it in
Subversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102021 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
e8741c165985f3c310b77e21a04eaac970d7f3e5 21-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102005 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
d2ec7268da536871ae05769d776c4f7caf88dbd7 21-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102005 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
80f35bd41307b833ba0e89c0463485aba029789e 21-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add more const to ConstExprIterator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101999 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
tmt.h
1705fe9ec0efb65f77a46e669e48302923204fe8 21-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add more const to ConstExprIterator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101999 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
tmt.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
5497b5ef7da4e0a570e2ce2c9c9e0d84e8b803b6 21-Apr-2010 John McCall <rjmccall@apple.com> Use const_cast instead of a C cast. Safer, plus it suppresses a gcc warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101982 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
5fae1d67ac199755dd26a102e1bddc881edab19c 21-Apr-2010 John McCall <rjmccall@apple.com> Use const_cast instead of a C cast. Safer, plus it suppresses a gcc warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101982 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
xprObjC.h
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
xprObjC.h
eb599b04d8f1d7b71e04caf2b6de3b3360662c0c 21-Apr-2010 Anders Carlsson <andersca@mac.com> Remove an unused parameter from isImplicitlyDefined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101962 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
10dc0f8c355c6a726f206aefcb249cb2fafbce17 21-Apr-2010 Anders Carlsson <andersca@mac.com> Remove an unused parameter from isImplicitlyDefined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101962 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
91330e6d7da91efa05ff0ff63b3f8f47f48fa8c4 20-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Keep proper source location information for the type in an Objective-C
@encode expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101907 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
81d3466d037dc5844234c7a93dab21a6ad986e7d 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep proper source location information for the type in an Objective-C
@encode expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101907 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
ecl.h
eclCXX.h
eclTemplate.h
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
ecl.h
eclCXX.h
eclTemplate.h
7c5d9538c7621a5b4eb922bf14360fdd6e1d4c6a 19-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Some renaming of methods, fixes typo
(related to PR6769).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101794 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
63326a53418b4853a83b360ce1dbdb10c5739fc7 19-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Some renaming of methods, fixes typo
(related to PR6769).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101794 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
f573eaf3c7ff85ebd18b6f2861097e1a8b3d1d3f 18-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Local static variables must be available module-wise
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101756 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
65ad5a42cca954e070428dcc499b62393aa7a6d3 18-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Local static variables must be available module-wise
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101756 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
eclarationName.h
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.h
eclarationName.h
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.h
eclObjC.h
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.h
eclObjC.h
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.h
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.h
ff27fa606ff2dc40b115523b42ed44a6081ef1d9 15-Apr-2010 Ted Kremenek <kremenek@apple.com> Teach ASTVector::append() about the case where 'NumInputs' is 0. This hopefully fixes
a crash in InitListExpr's ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101328 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
b13c170a280673f4cf4d7d11ec818392407254d4 15-Apr-2010 Ted Kremenek <kremenek@apple.com> Teach ASTVector::append() about the case where 'NumInputs' is 0. This hopefully fixes
a crash in InitListExpr's ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101328 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
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.h
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.h
210af35577729de05120c0e86547dfbeeacd8204 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Introduce ASTVector, which is a std::vector-like class that allocates all memory
using the allocator associated with an ASTContext. This is largely copy-and-paste
from SmallVector, and should be refactored one day.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101194 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
9c9bd84383f742513b3cfd656948bab16d752937 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Introduce ASTVector, which is a std::vector-like class that allocates all memory
using the allocator associated with an ASTContext. This is largely copy-and-paste
from SmallVector, and should be refactored one day.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101194 91177308-0d34-0410-b5e6-96231b3b80d8
STVector.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
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
eclObjC.h
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
eclObjC.h
ad36d2fbfc683dfd22a2bef574320df5ab8e2747 08-Apr-2010 John McCall <rjmccall@apple.com> Maybe we should store template arguments in the position we allocated for them
instead of scribbling over random memory. Maybe.

Hopefully this fixes the -vg buildbot.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100784 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
33cab704d9b3b5b0218d578a20593bdfb0b1eb23 08-Apr-2010 John McCall <rjmccall@apple.com> Maybe we should store template arguments in the position we allocated for them
instead of scribbling over random memory. Maybe.

Hopefully this fixes the -vg buildbot.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100784 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
eclFriend.h
eclTemplate.h
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.h
eclFriend.h
eclTemplate.h
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
STContext.h
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
STContext.h
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.h
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.h
e6c39d3a3e77c17bb9aa97be6e2e1ae2dbd654db 07-Apr-2010 Shih-wei Liao <sliao@google.com> libbcc

Change-Id: Ieaa3ebd5a38f370752495549f8870b534eeedfc5
PValue.h
ST.h
STConsumer.h
STContext.h
STDiagnostic.h
STImporter.h
ttr.h
XXInheritance.h
anonicalType.h
harUnits.h
ecl.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclGroup.h
eclNodes.def
eclObjC.h
eclTemplate.h
eclVisitor.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
ullExpr.h
estedNameSpecifier.h
arentMap.h
rettyPrinter.h
ecordLayout.h
edeclarable.h
tmt.h
tmtCXX.h
tmtGraphTraits.h
tmtIterator.h
tmtNodes.def
tmtObjC.h
tmtVisitor.h
emplateBase.h
emplateName.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeLocNodes.def
ypeLocVisitor.h
ypeNodes.def
ypeOrdering.h
ypeVisitor.h
nresolvedSet.h
7049bdd68f79ec4be2b00e4a8a5ce091839ddcee 07-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100604 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
74626d6ef2e194fcc911e071556660ff331eb4a8 07-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100604 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
eclAccessPair.h
eclCXX.h
ependentDiagnostic.h
xpr.h
nresolvedSet.h
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.h
eclAccessPair.h
eclCXX.h
ependentDiagnostic.h
xpr.h
nresolvedSet.h
a48848339a02b2830dfd40d5684e3084046d4b79 06-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100535 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
719770dcfcb3987e8a2377dcca97955301445eb5 06-Apr-2010 Douglas Gregor <dgregor@apple.com> Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100535 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
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
rettyPrinter.h
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
rettyPrinter.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
8edbcc8c7084a7311da0ba56df59c758bed0db87 02-Apr-2010 Chandler Carruth <chandlerc@gmail.com> Resolve a layering violation by making AddTaggedVal public for
PartialDiagnostic objects, and hoisting the stream operator for QualType into
Type.h with the operator for the normal DiagnosticBuilder. Also remove the no
longer needed friend declaration for the DeclarationName stream operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100169 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
ype.h
47c24b1d94f446c43e3a64732867eabed7d9c961 02-Apr-2010 Chandler Carruth <chandlerc@gmail.com> Resolve a layering violation by making AddTaggedVal public for
PartialDiagnostic objects, and hoisting the stream operator for QualType into
Type.h with the operator for the normal DiagnosticBuilder. Also remove the no
longer needed friend declaration for the DeclarationName stream operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100169 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
ype.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
xprObjC.h
tatistics.h
tmt.h
tmtCXX.h
tmtObjC.h
ype.h
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.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
xprObjC.h
tatistics.h
tmt.h
tmtCXX.h
tmtObjC.h
ype.h
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.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ype.h
ypeLoc.h
ypeNodes.def
100fdef5f9490615be95cc921c88cdba11c36d85 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
tatistics.h
275313cbb0847f1f117f60d144d113804d4fa42d 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
tatistics.h
e885f84e7a6e363a54b9100afd1c63364808d959 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
tatistics.h
d0ebe080eee7c37e73754068b47fd90cc506e128 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
tatistics.h
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.h
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.h
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.h
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.h
b7862e44093d09c495b8656269152c5c5d4a1148 31-Mar-2010 Daniel Dunbar <daniel@zuster.org> Formatting tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99947 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
69d66b28dc953ae7c2c0b877c78ccd9c691b44f1 31-Mar-2010 Daniel Dunbar <daniel@zuster.org> Formatting tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99947 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
anonicalType.h
xprCXX.h
ype.h
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.h
anonicalType.h
xprCXX.h
ype.h
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.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
xprObjC.h
tatistics.h
tmt.h
tmtCXX.h
tmtObjC.h
ype.h
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.h
eclCXX.h
eclFriend.h
eclObjC.h
eclTemplate.h
xpr.h
xprCXX.h
xprObjC.h
tatistics.h
tmt.h
tmtCXX.h
tmtObjC.h
ype.h
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
eclContextInternals.h
ependentDiagnostic.h
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
eclContextInternals.h
ependentDiagnostic.h
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
STContext.h
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
STContext.h
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
ype.h
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
ype.h
5f97216a4559c9219095ffe4849ce4b8e363961b 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Make default arguments to getFunctionNoProtoType an all or nothing option (as they already are in practise).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99785 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
6a6aa53ec6c89ae0881309b0a0dd84b6868b576b 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Make default arguments to getFunctionNoProtoType an all or nothing option (as they already are in practise).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99785 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
99643944ad6b889d382f7ea56d6f8e3cdc3b25b3 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Drop default arguments no one is using.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99783 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
1279deea7981fc66adeb941aa08f2753c096684c 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Drop default arguments no one is using.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99783 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
8b8e3a0b7b60524a996f116ff60a2915f92e12db 27-Mar-2010 John McCall <rjmccall@apple.com> Implement method friends in class templates and fix a few related problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99708 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
b0cb022daec8671406ab25f4b5d5a6d48d823bc4 27-Mar-2010 John McCall <rjmccall@apple.com> Implement method friends in class templates and fix a few related problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99708 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
65996191d65b20494b4015b62642b0eff5675617 25-Mar-2010 John McCall <rjmccall@apple.com> Preserve type-source information in friend declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99525 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
eclTemplate.h
32f2fb53d9d7c28c94d8569fd0fcf06cccee0c3d 25-Mar-2010 John McCall <rjmccall@apple.com> Preserve type-source information in friend declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99525 91177308-0d34-0410-b5e6-96231b3b80d8
eclFriend.h
eclTemplate.h
9913fcc2f352c63ea536aa5e1ecd5aabb76e4234 25-Mar-2010 Nuno Lopes <nunoplopes@sapo.pt> add dump() method to CanQual for debugging purposes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99505 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
d9ab76bbce7b8a563aa847cfcdcd39d8280f11bd 25-Mar-2010 Nuno Lopes <nunoplopes@sapo.pt> add dump() method to CanQual for debugging purposes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99505 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
490a4b524bc8ec4bf23fa20e4b7173135fda7e91 24-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> When a declaration of a function is missing an exception specification
that was present in a prior declaration, emit a warning rather than a
hard error (which we did before, and still do with mismatched
exception specifications). Moreover, provide a fix-it hint with the
throw() clause that should be added, e.g.,

t.C:10:7: warning: 'operator new' is missing exception specification
'throw(std::bad_alloc)'
void *operator new(unsigned long sz)
^
throw(std::bad_alloc)

As part of this, disable the warning when we're missing an exception
specification on operator new, operator new[], operator delete, or
operator delete[] when exceptions are turned off (-fno-exceptions).

Fixes PR5957.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99388 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
2eef829b19bdc59976a827fa39b409440e352bff 24-Mar-2010 Douglas Gregor <dgregor@apple.com> When a declaration of a function is missing an exception specification
that was present in a prior declaration, emit a warning rather than a
hard error (which we did before, and still do with mismatched
exception specifications). Moreover, provide a fix-it hint with the
throw() clause that should be added, e.g.,

t.C:10:7: warning: 'operator new' is missing exception specification
'throw(std::bad_alloc)'
void *operator new(unsigned long sz)
^
throw(std::bad_alloc)

As part of this, disable the warning when we're missing an exception
specification on operator new, operator new[], operator delete, or
operator delete[] when exceptions are turned off (-fno-exceptions).

Fixes PR5957.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99388 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
eclBase.h
eclContextInternals.h
ependentDiagnostic.h
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.h
eclBase.h
eclContextInternals.h
ependentDiagnostic.h
fec20e6dbd3c93a232a8f1e85f8aa5752e69f8bb 24-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure to properly track the anonymous namespace that lives inside
each namespace, even when the outer namespace has multiple
definitions. As part of this, collapsed two pointers worth of storage
(original namespace and inner anonymous namespace) into a single
pointer with a distinguishing bit, since the two are mutually
exclusive, saving a pointer per NamespaceDecl. Fixes PR6620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99368 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a418147c61a14cd21d4cce8f9c7a8750d2a59803 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Make sure to properly track the anonymous namespace that lives inside
each namespace, even when the outer namespace has multiple
definitions. As part of this, collapsed two pointers worth of storage
(original namespace and inner anonymous namespace) into a single
pointer with a distinguishing bit, since the two are mutually
exclusive, saving a pointer per NamespaceDecl. Fixes PR6620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99368 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
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.h
xternalASTSource.h
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.h
xternalASTSource.h
69969963d321e2001ed1ebfc6d17107604d75b12 19-Mar-2010 John McCall <rjmccall@apple.com> Remember the "found declaration" for an overload candidate, which is the
entity (if applicable) which was actually looked up. If a candidate was found
via a using declaration, this is the UsingShadowDecl; otherwise, if
the candidate is template specialization, this is the template; otherwise,
this is the function.

The point of this exercise is that "found declarations" are the entities
we do access control for, not their underlying declarations. Broadly speaking,
this patch fixes access control for using declarations.

There is a *lot* of redundant code calling into the overload-resolution APIs;
we really ought to clean that up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98945 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
9aa472c45d2bd81b7b52c225e8acc560d716db97 19-Mar-2010 John McCall <rjmccall@apple.com> Remember the "found declaration" for an overload candidate, which is the
entity (if applicable) which was actually looked up. If a candidate was found
via a using declaration, this is the UsingShadowDecl; otherwise, if
the candidate is template specialization, this is the template; otherwise,
this is the function.

The point of this exercise is that "found declarations" are the entities
we do access control for, not their underlying declarations. Broadly speaking,
this patch fixes access control for using declarations.

There is a *lot* of redundant code calling into the overload-resolution APIs;
we really ought to clean that up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98945 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
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.h
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.h
db5980861dc9061cf0d87db38a4eabc0feb7a135 17-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Reduce the default alignment for ASTContext and Stmt/Expr allocation
from 16 bytes to 8 bytes, since we don't ever use those low 4
bits. Should save some storage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98754 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
tmt.h
f4e689b8528770001f4792f1f4ebdfb09d859e3d 17-Mar-2010 Douglas Gregor <dgregor@apple.com> Reduce the default alignment for ASTContext and Stmt/Expr allocation
from 16 bytes to 8 bytes, since we don't ever use those low 4
bits. Should save some storage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98754 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
tmt.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
479f3d4f292c4bbaf42cd9bb1539df16d105975a 15-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> During C++ name lookup, use DeclContext::Equals() rather than
comparing DeclContext pointers, to avoid having to remember to call
getPrimaryContext() everywhere. This is the last part PR6594.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98546 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
dbdf5e7d0b6f1f8d8c496c1a0ada6f706cddf100 15-Mar-2010 Douglas Gregor <dgregor@apple.com> During C++ name lookup, use DeclContext::Equals() rather than
comparing DeclContext pointers, to avoid having to remember to call
getPrimaryContext() everywhere. This is the last part PR6594.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98546 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
ecl.h
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
ecl.h
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.h
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.h
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
ecl.h
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
ecl.h
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.h
eclFriend.h
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.h
eclFriend.h
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.h
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.h
8d766796bdcdde4476d8b2c618a1bde8b3d7f058 11-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add tentative support for accessing local variables with
external linkage (static, extern, etc.) in blocks in
rewriter. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98265 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6cb6eb4c792b504ad652d9230640656852e18ee9 11-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add tentative support for accessing local variables with
external linkage (static, extern, etc.) in blocks in
rewriter. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98265 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclCXX.h
eclFriend.h
eclVisitor.h
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
eclCXX.h
eclFriend.h
eclVisitor.h
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.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.h
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.h
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.h
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
rettyPrinter.h
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
rettyPrinter.h
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.h
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.h
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.h
ecl.h
eclTemplate.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ecl.h
eclTemplate.h
ype.h
ypeLoc.h
ypeNodes.def
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
ecordLayout.h
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
ecordLayout.h
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
xprObjC.h
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
xprObjC.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
38e21c3676cc46ef0ed2f3c2a09b7c5dc8d1384e 03-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Initialize your storage, dummy

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97615 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
e4687ef4b9c72e1c476fce27d0abc1a2f78f739c 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Initialize your storage, dummy

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97615 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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
ypeNodes.def
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
ypeNodes.def
cc392fc654e59b8d55df3901a82b193845ee44f4 26-Feb-2010 John McCall <rjmccall@apple.com> Use the power of types to track down another canonicalization bug in
the ABI-computation interface. Fixes <rdar://problem/7691046>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97197 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ype.h
ead608af31b6c9abeae1ca6d0b75094dac4641c0 26-Feb-2010 John McCall <rjmccall@apple.com> Use the power of types to track down another canonicalization bug in
the ABI-computation interface. Fixes <rdar://problem/7691046>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97197 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ype.h
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.h
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.h
4f557fe5b848b1cdeafc57b615db27966cf328e6 25-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of the location of the '~' in a pseudo-destructor expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97080 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
fce46ee68f779e239826e69e45d01d4c8e5323ca 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Keep track of the location of the '~' in a pseudo-destructor expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97080 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
0bd6205193f5c0865b47202d1da8fd9c7ddfa569 24-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Retain source information for the "type-name ::" in a
pseudo-destructor expression such as

p->T::~T()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97060 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
e0601ea1220348957dacec5f3dd0707837365290 24-Feb-2010 Douglas Gregor <dgregor@apple.com> Retain source information for the "type-name ::" in a
pseudo-destructor expression such as

p->T::~T()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97060 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
ttr.h
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
ttr.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
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.h
xprCXX.h
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.h
xprCXX.h
4906ddb118727fae0bfce803eb4c6cdcacce3070 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement PCH support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0cef483f3b9d6a7f9fdbc5910d0a3ed64130e8e1 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement PCH support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
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.h
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.h
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.h
eclObjC.h
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.h
eclObjC.h
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
ttr.h
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
ttr.h
05b2b140f05bfe635296a1a58902dc93092412cb 17-Feb-2010 Ted Kremenek <kremenek@apple.com> Change GNUInlineAttr definition to just use DEF_SIMPLE_ATTR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96517 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
3f477eabe90c55ad65ab70b1a3abd77060fbec06 17-Feb-2010 Ted Kremenek <kremenek@apple.com> Change GNUInlineAttr definition to just use DEF_SIMPLE_ATTR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96517 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ttr.h
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
ttr.h
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.h
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.h
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.h
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.h
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.h
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.h
f0533bcf6543bbb5d1b0338c01510eeacea44a76 16-Feb-2010 John McCall <rjmccall@apple.com> Support local namespace aliases and permit them to be instantiated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96335 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
3dbd3d5c04cd5abd7dfd83b15f51d7c610a3c512 16-Feb-2010 John McCall <rjmccall@apple.com> Support local namespace aliases and permit them to be instantiated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96335 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
95e20014f3cf65a7e7717849772e52c105fb7da3 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95991 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b37b648b3f2bba4c557a1604ced19b526b25a372 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95991 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
27dc8619071ac2ef47318bf4ff21b99a3e3793ae 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Improve documentation for DependentTypeOfExprType, DependentDecltypeType. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95989 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c4875ee41ba35f1d746f4266ce47461247f19f41 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Improve documentation for DependentTypeOfExprType, DependentDecltypeType. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95989 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d665afdb7e5fdcb4a295c91863cc13c90c3bf4c4 12-Feb-2010 John McCall <rjmccall@apple.com> Waste two bits in every clang::Type so that the type class can be read
in a single byte-load rather than some crazy bitmunging operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95964 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ypeNodes.def
27935ee59c30b0d8b610ab676aab8e65350af932 12-Feb-2010 John McCall <rjmccall@apple.com> Waste two bits in every clang::Type so that the type class can be read
in a single byte-load rather than some crazy bitmunging operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95964 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ypeNodes.def
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.h
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.h
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
xprObjC.h
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
xprObjC.h
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.h
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.h
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.h
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.h
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
ttr.h
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
ttr.h
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.h
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.h
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
ttr.h
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
ttr.h
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
eclCXX.h
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
eclCXX.h
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
ecl.h
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
ecl.h
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.h
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.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
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
eclCXX.h
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
eclCXX.h
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
ttr.h
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
ttr.h
f8fd82ba49827db0f6a6ba00c55a7b56b12a19fa 10-Feb-2010 Shih-wei Liao <sliao@google.com> Check in LLVM r95781.
PValue.h
ST.h
STConsumer.h
STContext.h
STDiagnostic.h
STImporter.h
ttr.h
XXInheritance.h
anonicalType.h
harUnits.h
ecl.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclGroup.h
eclNodes.def
eclObjC.h
eclTemplate.h
eclVisitor.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
ullExpr.h
estedNameSpecifier.h
arentMap.h
rettyPrinter.h
ecordLayout.h
edeclarable.h
tmt.h
tmtCXX.h
tmtGraphTraits.h
tmtIterator.h
tmtNodes.def
tmtObjC.h
tmtVisitor.h
emplateBase.h
emplateName.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeLocNodes.def
ypeLocVisitor.h
ypeNodes.def
ypeOrdering.h
ypeVisitor.h
nresolvedSet.h
c5d12db8396180a6a84e82caac1e11709f29da03 10-Feb-2010 John McCall <rjmccall@apple.com> Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path. Prepare for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95775 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
6b2accb4793e16b2e93a8c2589f5df702231f17a 10-Feb-2010 John McCall <rjmccall@apple.com> Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path. Prepare for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95775 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
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.h
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.h
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.h
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.h
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
ype.h
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
ype.h
6d24cd5aba5ccff206cfd191fea8b2553c7dee56 08-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of whether a tag was defined in a declarator vs. being
defined by itself, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95586 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
591bd3cb605f1f0229b4b1d8a4b8183377064ec5 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Keep track of whether a tag was defined in a declarator vs. being
defined by itself, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95586 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
548e9ea5aa883368715bf3af889213a0109d22e1 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll r95513 back in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95515 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
eb7f96141f754150a92433286fa385910a22f494 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll r95513 back in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95515 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
8ba488ce817e898a6c6fadf62f91f908f7053b5c 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll out r95513, it seems to have broken self hosting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95514 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
a8ad5d4975aea17c0e7868f83c25083a0eb2040d 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll out r95513, it seems to have broken self hosting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95514 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
b82b35f9cd18aabea0144d413f29c1f5c08f72cc 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXBoolLiteralExpr and CXXNullPtrLiteralExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95513 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
1eb1113b139503a3895714d94ec9c037ae62d3b1 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXBoolLiteralExpr and CXXNullPtrLiteralExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95513 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
ype.h
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.h
ype.h
663a2dc482905170a9ee846bf52c500c6741688b 05-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Oops, thanks Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95429 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.h
4794081837ba088965a71652a46494ef4c6b2590 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Oops, thanks Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95429 91177308-0d34-0410-b5e6-96231b3b80d8
STImporter.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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
eclCXX.h
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
eclCXX.h
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
ype.h
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
ype.h
14ae946ce5c568b2fdfe7512bb9ef0294f8d2ef5 04-Feb-2010 John McCall <rjmccall@apple.com> Mangle member expressions. Also invented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95284 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
2f27bf854f0519810b34afd209089cc75536b757 04-Feb-2010 John McCall <rjmccall@apple.com> Mangle member expressions. Also invented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95284 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
9f628a7a92013f6114687ebb063ff4f5a982ee6a 04-Feb-2010 John McCall <rjmccall@apple.com> Add mangling support for calls, sizeof/alignof, constructor calls,
float literals, and unresolved lookups (which required hand-wavey extensions).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95273 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
1dd7383dc48718c452e71a625b29531dd96fbb9d 04-Feb-2010 John McCall <rjmccall@apple.com> Add mangling support for calls, sizeof/alignof, constructor calls,
float literals, and unresolved lookups (which required hand-wavey extensions).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95273 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
xprObjC.h
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
xprObjC.h
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.h
ype.h
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.h
ype.h
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
tmtCXX.h
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
tmtCXX.h
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
tmtCXX.h
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
tmtCXX.h
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
xprObjC.h
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
xprObjC.h
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.h
tmt.h
tmtNodes.def
tmtVisitor.h
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.h
tmt.h
tmtNodes.def
tmtVisitor.h
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.h
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.h
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.h
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.h
5c0e897ed39db3443ca9695471a87d77f1ac9768 01-Feb-2010 John McCall <rjmccall@apple.com> Access checking for implicit user-defined conversions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94971 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
b13b737a2450167c82e148590e8019b839ce6b98 01-Feb-2010 John McCall <rjmccall@apple.com> Access checking for implicit user-defined conversions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94971 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
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.h
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.h
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.h
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.h
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.h
xprCXX.h
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.h
xprCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
22b9be9e2cf26a261e4aeb9de19ea2c3a27a1e43 30-Jan-2010 Anders Carlsson <andersca@mac.com> More asm cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94920 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
a5a79f7d16b48d3be8bcc8c7650e31aefd92b657 30-Jan-2010 Anders Carlsson <andersca@mac.com> More asm cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94920 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
44c97fa58167368f7f7984544cace6a721e37aa2 29-Jan-2010 Anders Carlsson <andersca@mac.com> Add getters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94803 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
4e1c181e2bb378dad55dd25c18611e3a0fb6c22a 29-Jan-2010 Anders Carlsson <andersca@mac.com> Add getters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94803 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
437b9a1e67de664cecba5cbbbdf51ccf5da23bed 29-Jan-2010 Anders Carlsson <andersca@mac.com> Simplify EmitLValueForField - we can get whether the field is part of a union or not from the FieldDecl (through its DeclContext).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94798 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e6d2a534851a649485cb087e9dfcaf8a65886858 29-Jan-2010 Anders Carlsson <andersca@mac.com> Simplify EmitLValueForField - we can get whether the field is part of a union or not from the FieldDecl (through its DeclContext).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94798 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
xprCXX.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
fbb374bb50c1a5606186b617bcce34ce21213922 29-Jan-2010 John McCall <rjmccall@apple.com> Do a little magic and a little greasework to make it much more efficient
to cast a DeclContext down to a specific implementation class.

There are still lots of calls to Decl::castFromDeclContext left, mostly
arising from DeclContext::getParent().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94786 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
80cd64a8450d8e2c079dc134d9711cd45ba89d63 29-Jan-2010 John McCall <rjmccall@apple.com> Do a little magic and a little greasework to make it much more efficient
to cast a DeclContext down to a specific implementation class.

There are still lots of calls to Decl::castFromDeclContext left, mostly
arising from DeclContext::getParent().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94786 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclTemplate.h
a3c199b287733dbe42fc28b144e24bb0a09f1da9 28-Jan-2010 John McCall <rjmccall@apple.com> Access control for surrogate function calls. Required a moderately gross hack
to get the access bits set properly in conversion sets.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94744 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
233a6419097ed97b67ff8efcacef9af613262ca3 28-Jan-2010 John McCall <rjmccall@apple.com> Access control for surrogate function calls. Required a moderately gross hack
to get the access bits set properly in conversion sets.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94744 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
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.h
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.h
fa4c6c212906ec7806e0892d1d48ba92e068509e 27-Jan-2010 Anders Carlsson <andersca@mac.com> It's not Explicit anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94657 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
3a18917b5260d67426f55792118262aa6ad42c06 27-Jan-2010 Anders Carlsson <andersca@mac.com> It's not Explicit anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94657 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
nresolvedSet.h
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.h
nresolvedSet.h
b19509ec56e5f79e3a4f41b649da74a632fe31be 27-Jan-2010 Ted Kremenek <kremenek@apple.com> Add const version of ObjCMethodDecl::getCanonicalDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94633 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
13e635c55eb23f736d38abf9c954801bd6482db4 27-Jan-2010 Ted Kremenek <kremenek@apple.com> Add const version of ObjCMethodDecl::getCanonicalDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94633 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
d8b5014c8b689915eb87797060fd5c183ef600da 26-Jan-2010 Anders Carlsson <andersca@mac.com> Use the right definition when emitting a global variable. Fixes PR5564.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94555 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3bb92693c3332c1e99870a4e45afff3892e1c6ae 26-Jan-2010 Anders Carlsson <andersca@mac.com> Use the right definition when emitting a global variable. Fixes PR5564.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94555 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
a12cfc33df90a89eb078feb7150df53745397aa7 26-Jan-2010 John McCall <rjmccall@apple.com> Avoid some unnecessary copying of unresolved lookup results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94531 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
75345163535eb1765ba8fb971974be895645cb45 26-Jan-2010 John McCall <rjmccall@apple.com> Avoid some unnecessary copying of unresolved lookup results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94531 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
61b29a1dd02abc71d991daabf566b02a38fea9f9 26-Jan-2010 John McCall <rjmccall@apple.com> Preserve access bits through overload resolution much better. Some
general refactoring in operator resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94498 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
6e26689f5d513e24ad7783a4493201930fdeccc0 26-Jan-2010 John McCall <rjmccall@apple.com> Preserve access bits through overload resolution much better. Some
general refactoring in operator resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94498 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
7a39d4eef0a6541c2cf56cb0462d47e5b8a062e7 24-Jan-2010 Anders Carlsson <andersca@mac.com> Fix a pretty bad bug where if a constructor (or conversion function) was marked as 'explicit', but then defined out-of-line, we would not treat it as being explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94366 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
7a6e13aa2e3874fecf45043ed1a26900b8c13b98 24-Jan-2010 Anders Carlsson <andersca@mac.com> Fix a pretty bad bug where if a constructor (or conversion function) was marked as 'explicit', but then defined out-of-line, we would not treat it as being explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94366 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
eclCXX.h
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.h
eclCXX.h
8c8779833fab2e6e8d844c255312c468f559749c 22-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Teach the cursor visitor to walk all of the C and Objective-C
declarations that have enough source information to make such a walk
useful. This includes walking into variable initializers and enum
constants, the types behind typedefs, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94124 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
1ef2fc1888d8d14e97ebe561ccbd421282de3ce2 22-Jan-2010 Douglas Gregor <dgregor@apple.com> Teach the cursor visitor to walk all of the C and Objective-C
declarations that have enough source information to make such a walk
useful. This includes walking into variable initializers and enum
constants, the types behind typedefs, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94124 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
66a1e5dd245505deb9badbe72a8877392b5eb386 21-Jan-2010 John McCall <rjmccall@apple.com> Due to local reversions and re-patching, I accidentally had multiple copies
of the 'payload' in this header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94109 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
0380043d402fa87e00dc6166f9167ad4e73b34f4 21-Jan-2010 John McCall <rjmccall@apple.com> Due to local reversions and re-patching, I accidentally had multiple copies
of the 'payload' in this header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94109 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
d1224ba451b73cd38e0fb0ef2713fbc300f9e107 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings for with respect to dead functional casts in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94106 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
2d6ceab0ad062989ecb7b8666c85e58a2fcd95ce 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings for with respect to dead functional casts in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94106 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
ype.h
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
ype.h
27dc20f88c6c0990ebea1c468f2610e3e896d115 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94088 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
d8265b838360578032020757d9a2a84c86457edc 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94088 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
4347259d31856682ac492d955359add71613f1c3 21-Jan-2010 Mike Stump <mrs@apple.com> Add infrastructure to add base initializers and member initializers to
the CFG. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b978a441c7d8bf59e7fede938e1f3b672573b443 21-Jan-2010 Mike Stump <mrs@apple.com> Add infrastructure to add base initializers and member initializers to
the CFG. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
a90cde534c19e7333722487e5f4a67e7ce2a59d6 20-Jan-2010 John McCall <rjmccall@apple.com> Change LLVM/clang #includes to use quotes, not angle-brackets. Just a think-o
prompted by the #include <iterator> above.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94040 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
7264fa161fe77b74163417ce7ab28e3da46381f7 20-Jan-2010 John McCall <rjmccall@apple.com> Change LLVM/clang #includes to use quotes, not angle-brackets. Just a think-o
prompted by the #include <iterator> above.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94040 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
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.h
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.h
231646006b6e167456ef6ccd209cfc1e4c7a094b 20-Jan-2010 Daniel Dunbar <daniel@zuster.org> Use sizeof() instead of hard-coding a size for WrittenBuiltinSpecs, eek!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94024 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
d31351288e25e8a7a2a919c99ffe281c2a41b53c 20-Jan-2010 Daniel Dunbar <daniel@zuster.org> Use sizeof() instead of hard-coding a size for WrittenBuiltinSpecs, eek!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94024 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
232815543878063ae6157fe77ab1348e22bac967 20-Jan-2010 John McCall <rjmccall@apple.com> Make UnresolvedSet.h standalone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93964 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
b377c98af6d5d5ad0cf3d391129518bfa50cbca9 20-Jan-2010 John McCall <rjmccall@apple.com> Make UnresolvedSet.h standalone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93964 91177308-0d34-0410-b5e6-96231b3b80d8
nresolvedSet.h
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.h
ecl.h
eclCXX.h
xprCXX.h
nresolvedSet.h
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.h
ecl.h
eclCXX.h
xprCXX.h
nresolvedSet.h
349f08701b41fd9991d80ab14dabccb4897c3eac 19-Jan-2010 John McCall <rjmccall@apple.com> The type of a compound literal expression is not necessarily the same as the
type which was syntactically written. Fixes PR 6080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93933 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1d7d8d66eff7ed0f3e957d330930cc9ab8047add 19-Jan-2010 John McCall <rjmccall@apple.com> The type of a compound literal expression is not necessarily the same as the
type which was syntactically written. Fixes PR 6080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93933 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c22ed34c3b6febf47b4b7d2e6d299433618d21ac 19-Jan-2010 John McCall <rjmccall@apple.com> Move AccessSpecifier into the new Specifiers.h; fixes the layering violations
inherent in, well, pretty much every use of AccessSpecifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93804 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
ad2b804faf29042e6c4e331d0987f103f1e2fd31 19-Jan-2010 John McCall <rjmccall@apple.com> Move AccessSpecifier into the new Specifiers.h; fixes the layering violations
inherent in, well, pretty much every use of AccessSpecifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93804 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
c1beadbbdca275e932d68978944b8feefbf51941 18-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93752 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
42f56b50062cd3b3c6b23fdb9053578ae9145664 18-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93752 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b1215843673dae08b29b4fc004f2d4ef273cb76a 18-Jan-2010 Mike Stump <mrs@apple.com> Silence a control reaches end of function warning. Patch by Enea
Zaffanella.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93743 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocVisitor.h
b7fd588ea95bfbe8436380091ab0f61a4210ba4b 18-Jan-2010 Mike Stump <mrs@apple.com> Silence a control reaches end of function warning. Patch by Enea
Zaffanella.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93743 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLocVisitor.h
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.h
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.h
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.h
ype.h
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.h
ype.h
c5f3e9f42a6befec845017ba12a6ec5407c2c8b2 16-Jan-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93658 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
ce757a7a1ee905f87551996a69da3e95e8afeeb7 16-Jan-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93658 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
d5ecc399aa8985536852b0af8c2c63d5650f6857 15-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93522 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
9d125033a9853f3b572a4c9e2f9e2d4e5e346973 15-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93522 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
eclarationName.h
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.h
eclarationName.h
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.h
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.h
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.h
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.h
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.h
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.h
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
harUnits.h
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
harUnits.h
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
ttr.h
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
ttr.h
698d8f3d012663fd816aece0570f291926fb35d0 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93118 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
82d0a418c8699fc6f4a9417457ffe93d43bba1c1 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93118 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
48a26b4d276d5d0fd55da6182c8dcae33b11479a 08-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Add an "implicit" bit to CXXThisExpr, so that we can track
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92958 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
828a197317288e3333b0ce6f5cedadd036e3531f 08-Jan-2010 Douglas Gregor <dgregor@apple.com> Add an "implicit" bit to CXXThisExpr, so that we can track
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92958 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
42c0c4c4c5a06ed3bca2f21b65d3f42827dcfd57 07-Jan-2010 Ted Kremenek <kremenek@apple.com> Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration. The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.

This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92891 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
782f2f52b78d8ca785110398a7f7b56b830b9ac7 07-Jan-2010 Ted Kremenek <kremenek@apple.com> Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration. The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.

This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92891 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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
xpr.h
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
xpr.h
04ed4d956e8beb7b32f54e57d414b1c209a1b029 05-Jan-2010 Chris Lattner <sabre@nondot.org> fix a bug mike noticed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92559 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
6ffe643322949dd776285a6df60d3578f3918be4 05-Jan-2010 Chris Lattner <sabre@nondot.org> fix a bug mike noticed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92559 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
3cbd6c34b9affed2b0571489e52f50444172d949 04-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure to use ASTContext::getAs*ArrayType() when decomposing array
types. Fixes APFloat.cpp compilation failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92523 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
442471309fa97348f849687a6a8ef4acc3bc2c1f 04-Jan-2010 Douglas Gregor <dgregor@apple.com> Make sure to use ASTContext::getAs*ArrayType() when decomposing array
types. Fixes APFloat.cpp compilation failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92523 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
6d18ae945b0b85054942aaac9ee32011d5b8b34d 30-Dec-2009 Chandler Carruth <chandlerc@gmail.com> More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.

Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92289 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e724246b9f655801bd96b727daf9dddc44beef4d 30-Dec-2009 Chandler Carruth <chandlerc@gmail.com> More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.

Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92289 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
xprCXX.h
xprObjC.h
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.h
xprCXX.h
xprObjC.h
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.h
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.h
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.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ype.h
ypeLoc.h
ypeNodes.def
48b6ae35216b660d09f5f31e7e03cdd5613d5539 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Make sure operator new[] and operator delete[] match. This will hopefully silence 3 remaining MSVC warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92163 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
0235d1510d0677b26f2d0448694e5e3e8a1ee043 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Make sure operator new[] and operator delete[] match. This will hopefully silence 3 remaining MSVC warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92163 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
480622ffee581a2915378aa97f2cd8f1af66b639 24-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92143 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
7557a1348d2821dce126a778aa7acd7a00b814fd 24-Dec-2009 Douglas Gregor <dgregor@apple.com> Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92143 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
tmtIterator.h
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.h
tmtIterator.h
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.h
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.h
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.h
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.h
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.h
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.h
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
tmt.h
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
tmt.h
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.h
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.h
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
harUnits.h
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
harUnits.h
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.h
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.h
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.h
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.h
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.h
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.h
917c9e1d36105d8b37c8029b15d1e18dd90c17ad 19-Dec-2009 Daniel Dunbar <daniel@zuster.org> Remove ';' after method definition. Noticed by clang++, which one would think
would have a higher respect for its own code. This is getting old, is this
warning really adding value?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91779 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ecl.h
eclObjC.h
emplateBase.h
7177dee8aee4b432911c91f1b788963bec0cac9f 19-Dec-2009 Daniel Dunbar <daniel@zuster.org> Remove ';' after method definition. Noticed by clang++, which one would think
would have a higher respect for its own code. This is getting old, is this
warning really adding value?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91779 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
ecl.h
eclObjC.h
emplateBase.h
ce30d59346b391749cead26ef459613c350c14df 19-Dec-2009 Anders Carlsson <andersca@mac.com> Correctly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91748 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
29f1a6070ac35fcbea9241c843df7f3f7c5c3228 19-Dec-2009 Anders Carlsson <andersca@mac.com> Correctly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91748 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
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
harUnits.h
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
harUnits.h
c06b4882497a2127bc9f2d204951f29435103224 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> Use System/DataTypes.h, stdint.h isn't portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91707 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
5231eaa5f58c49860d5446d5269685cd9c063ccb 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> Use System/DataTypes.h, stdint.h isn't portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91707 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
85246b1219cf9ebc357874c81a1c84263b82288a 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
new opaque value type, CharUnits. This will help us avoid accidentally mixing
quantities that are in bit and character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91689 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
4273f7068f16863f2469b45a3f00c3b4217bdbb4 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
new opaque value type, CharUnits. This will help us avoid accidentally mixing
quantities that are in bit and character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91689 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
3294366fb304e88e780aa86c78594f4978e4a16f 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91688 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
cc906ef220c9be2644ad942457766d46a0b3651e 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91688 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
b82f552c63f8476d771f3bad90ca1b2c33ebc9bf 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Initial implementation of CharUnits, an opaque value class for representing
sizes, offsets, and alignments in character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91683 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
64437137888d69b8ef03f3057524e5056e7d9dd6 18-Dec-2009 Ken Dyck <ken.dyck@onsemi.com> Initial implementation of CharUnits, an opaque value class for representing
sizes, offsets, and alignments in character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91683 91177308-0d34-0410-b5e6-96231b3b80d8
harUnits.h
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.h
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.h
bc9012ac0bf35e1ba8c9aa1068fb60e44fdedb9a 16-Dec-2009 John McCall <rjmccall@apple.com> Shift things around so that it's easier to recover from a missing
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.

The diagnostic is still iffy, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91538 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3b4294e5c1e904a2e0f74449dbc3f52f69cc8e9f 16-Dec-2009 John McCall <rjmccall@apple.com> Shift things around so that it's easier to recover from a missing
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.

The diagnostic is still iffy, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91538 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9a8f2ca476f55a6516c972bf2845a786ea616194 16-Dec-2009 Anders Carlsson <andersca@mac.com> More FullExpr work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91514 91177308-0d34-0410-b5e6-96231b3b80d8
ullExpr.h
ac7db1fecfa5dbea890b6b57767d52ac12641352 16-Dec-2009 Anders Carlsson <andersca@mac.com> More FullExpr work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91514 91177308-0d34-0410-b5e6-96231b3b80d8
ullExpr.h
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.h
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.h
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
ullExpr.h
tmt.h
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
ullExpr.h
tmt.h
54cd39974f9a8b026851d607f4be60164fee3c2d 16-Dec-2009 John McCall <rjmccall@apple.com> Successive anonymous namespaces name the same scope. I misinterpreted the
standard the last time. Fixes PR5766.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91493 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5fdd7643ae81af4ace04f8be888f225b9fcc64b7 16-Dec-2009 John McCall <rjmccall@apple.com> Successive anonymous namespaces name the same scope. I misinterpreted the
standard the last time. Fixes PR5766.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91493 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
e38592f880f425a6d9ea856a81703522a8ae345b 15-Dec-2009 Chris Lattner <sabre@nondot.org> move isPodLike<clang::QualType> out to Type.h. We don't
want some clients of QualType to think it's a pod and some to
not know it is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91424 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ypeOrdering.h
aed1df80bf64228e1429c1edc408397f9174847c 15-Dec-2009 Chris Lattner <sabre@nondot.org> move isPodLike<clang::QualType> out to Type.h. We don't
want some clients of QualType to think it's a pod and some to
not know it is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91424 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ypeOrdering.h
dbf0031fbbd30144c3ac070baa4f2d0e551a8de9 15-Dec-2009 Chris Lattner <sabre@nondot.org> update to match LLVM API change:

Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91422 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
ypeOrdering.h
06159e878569e5f39bf0e8f11b84ac3ad0970597 15-Dec-2009 Chris Lattner <sabre@nondot.org> update to match LLVM API change:

Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91422 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
ypeOrdering.h
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.h
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.h
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
eclBase.h
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
eclBase.h
00874ad5bb1845b7dfa3d39411ecfc09df321ad7 13-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Silence some release build warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91234 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
60cfcecaf48e4310339dcfbdb0e3f0e6d2853855 13-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Silence some release build warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91234 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
e26ac9c9acf105e72a23ebefabfce652f0541db9 12-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Rework the way we handle template instantiation for
implicitly-generated AST nodes. We previously built instantiated nodes
for each of these AST nodes, then passed them on to Sema, which was
not prepared to see already-type-checked nodes (see PR5755). In some
places, we had ugly workarounds to try to avoid re-type-checking
(e.g., in VarDecl initializer instantiation).

Now, we skip implicitly-generated nodes when performing instantiation,
preferring instead to build just the AST nodes that directly reflect
what was written in the source code. This has several advantages:

- We don't need to instantiate anything that doesn't have a direct
correlation to the source code, so we can have better location
information.
- Semantic analysis sees the same thing at template instantiation
time that it would see for a non-template.
- At least one ugly hack (VarDecl initializers) goes away.

Fixes PR5755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91218 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
a88cfbfac9bbcbb9858f048d6d73a48711d8e93d 12-Dec-2009 Douglas Gregor <dgregor@apple.com> Rework the way we handle template instantiation for
implicitly-generated AST nodes. We previously built instantiated nodes
for each of these AST nodes, then passed them on to Sema, which was
not prepared to see already-type-checked nodes (see PR5755). In some
places, we had ugly workarounds to try to avoid re-type-checking
(e.g., in VarDecl initializer instantiation).

Now, we skip implicitly-generated nodes when performing instantiation,
preferring instead to build just the AST nodes that directly reflect
what was written in the source code. This has several advantages:

- We don't need to instantiate anything that doesn't have a direct
correlation to the source code, so we can have better location
information.
- Semantic analysis sees the same thing at template instantiation
time that it would see for a non-template.
- At least one ugly hack (VarDecl initializers) goes away.

Fixes PR5755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91218 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
emplateBase.h
ypeLocVisitor.h
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
emplateBase.h
ypeLocVisitor.h
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.h
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.h
2af481dc4abb92b99f655264582aa2ff86170385 12-Dec-2009 Anders Carlsson <andersca@mac.com> Improve diagnostics for malformed delete operator function declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91180 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
9d59ecb4d2c2e8efdb214589753826b662246d82 12-Dec-2009 Anders Carlsson <andersca@mac.com> Improve diagnostics for malformed delete operator function declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91180 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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.h
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.h
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.h
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.h
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.h
eclContextInternals.h
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.h
eclContextInternals.h
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
eclCXX.h
ype.h
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
eclCXX.h
ype.h
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
eclBase.h
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
eclBase.h
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
ecl.h
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
ecl.h
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.h
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.h
ac5ad7ebb178bbc9e7b1bb0983852de795c7d027 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> More detailed analysis of typecast to an objective-c pointer
in objective-c++ mode without being too lenient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90895 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
92ef5d75720c032808181133e4d7c5f82230237e 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> More detailed analysis of typecast to an objective-c pointer
in objective-c++ mode without being too lenient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90895 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
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.h
ecordLayout.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.h
ecordLayout.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.h
ecl.h
eclCXX.h
eclObjC.h
eclTemplate.h
xpr.h
emplateBase.h
ypeLoc.h
ypeLocBuilder.h
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.h
ecl.h
eclCXX.h
eclObjC.h
eclTemplate.h
xpr.h
emplateBase.h
ypeLoc.h
ypeLocBuilder.h
1557461a4f7d494e2a669ede1fbe95c71dafb28e 07-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Remove a now out of date and out of place comment about predefined exprs from the FloatingLiteral class declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90726 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
19a9edb5dd7ab2c63249b28f45f16781a5577874 07-Dec-2009 Sam Weinig <sam.weinig@gmail.com> Remove a now out of date and out of place comment about predefined exprs from the FloatingLiteral class declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90726 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeNodes.def
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.h
ype.h
ypeLoc.h
ypeLocBuilder.h
ypeNodes.def
7e5ca36f05758666353d5353cf27c0e027e1782b 04-Dec-2009 Mike Stump <mrs@apple.com> Add an easy accessor for the end of the try/catch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90604 91177308-0d34-0410-b5e6-96231b3b80d8
tmtCXX.h
be0ed67bc79e96c26cd0ad41dcfab5a5020ead51 04-Dec-2009 Mike Stump <mrs@apple.com> Add an easy accessor for the end of the try/catch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90604 91177308-0d34-0410-b5e6-96231b3b80d8
tmtCXX.h
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.h
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.h
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
ecl.h
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
ecl.h
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.h
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.h
956affe43fe9655a9ffa93ffbc8f0458a854ec58 03-Dec-2009 John McCall <rjmccall@apple.com> Stop stripping UnresolvedUsingDecls out of LookupResults that have other
results in them (which we were doing intentionally as a stopgap). Fix
an DeclContext lookup-table ordering problem which was causing UsingDecls to
show up incorrectly when looking for ordinary results. And oh hey
Clang-Code-Syntax passes now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90367 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
fda8e12774921e3cac3ebcba1148bcf4479ddd7a 03-Dec-2009 John McCall <rjmccall@apple.com> Stop stripping UnresolvedUsingDecls out of LookupResults that have other
results in them (which we were doing intentionally as a stopgap). Fix
an DeclContext lookup-table ordering problem which was causing UsingDecls to
show up incorrectly when looking for ordinary results. And oh hey
Clang-Code-Syntax passes now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90367 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
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
ype.h
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
ype.h
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.h
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.h
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.h
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.h
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
eclCXX.h
eclNodes.def
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
eclCXX.h
eclNodes.def
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.h
emplateName.h
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.h
emplateName.h
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.h
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.h
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
ecordLayout.h
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
ecordLayout.h
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
ecl.h
xprCXX.h
tmt.h
tmtNodes.def
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
ecl.h
xprCXX.h
tmt.h
tmtNodes.def
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
tmtCXX.h
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
tmtCXX.h
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
ype.h
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
ype.h
c44208598d88308695d0e7c5a6d7ba3ead6e6904 30-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRef in Attr constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90140 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
bb377edda2656752016a0bc01fe4f9f8b6f80e19 30-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRef in Attr constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90140 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
tmt.h
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
tmt.h
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.h
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.h
cbfba6c81ae3ecd63bbf03aa209da28d4fef4017 28-Nov-2009 Anders Carlsson <andersca@mac.com> Add an iterator for walking the primary base chain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90023 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
1fb7cf9214402aacfaa74c92870b94c5879e97dc 28-Nov-2009 Anders Carlsson <andersca@mac.com> Add an iterator for walking the primary base chain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90023 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.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
ecordLayout.h
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.h
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.h
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.h
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.h
fcbd31311a686139f05764c16e267a537ec879b9 25-Nov-2009 Sean Hunt <rideau3@gmail.com> Parse C++ member check attributes - base_check, hiding, and override.
The attributes are currently ignored.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89837 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
7725e67639fa2fe74f8775b7ed884a076ffdbffc 25-Nov-2009 Sean Hunt <rideau3@gmail.com> Parse C++ member check attributes - base_check, hiding, and override.
The attributes are currently ignored.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89837 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
d77dffe44101d3425c00f6eeae6f17c499eb516d 25-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Qualify the name of the llvm::cast template. I am somewhat amazed that GCC parsed this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89822 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
3233441b439a3dee9fa187f2c195b5188e71483b 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Qualify the name of the llvm::cast template. I am somewhat amazed that GCC parsed this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89822 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
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.h
xprCXX.h
tmt.h
tmtNodes.def
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.h
xprCXX.h
tmt.h
tmtNodes.def
64ba265d4b05c2621add63b6d5959ac321bd5dc3 24-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

while (shared_ptr<WorkInt> p = getWorkItem()) {
// ...
}

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

while (blah)
RAIIObject raii(blah+1);



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89800 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5656e14d91405417182171a705ed3e3d2d6d7aa3 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

while (shared_ptr<WorkInt> p = getWorkItem()) {
// ...
}

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

while (blah)
RAIIObject raii(blah+1);



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89800 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
xprCXX.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
7a63864c30f20df3da1f9d674ae731ce2aeb9fed 24-Nov-2009 John McCall <rjmccall@apple.com> DeclarationName::getIdentifier should take a const IdentifierInfo, since the
constructor does anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89784 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
909e58988b3a3bb2ad36bec03aafa1302544fd73 24-Nov-2009 John McCall <rjmccall@apple.com> DeclarationName::getIdentifier should take a const IdentifierInfo, since the
constructor does anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89784 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
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.h
9a1020a0528e6c9b0bf0ff1eb44cec471469f6e6 24-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make sure redeclaration chains are properly linked, even through invalid decls. This fixes PR5415.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89777 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
46408eedfff5aa33662cedb6716a20616f3bad31 24-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make sure redeclaration chains are properly linked, even through invalid decls. This fixes PR5415.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89777 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
a4b8172b40e73af01884d28c0e832ab117951eb6 24-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Explicitly store the condition variable within switch statements, and
make sure that this variable is destroyed when we exit the switch
statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89776 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d3d5301c44138b92bf01286183f5bf310cdd37cf 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Explicitly store the condition variable within switch statements, and
make sure that this variable is destroyed when we exit the switch
statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89776 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
39c2ebcf7097defbccd2e5b2d56a53a61e4dbf03 24-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add getByteSize() and getTypeSizeInBytes().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89760 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f5f514477d8a4e04e511d345b9fb896153f70e9d 24-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add getByteSize() and getTypeSizeInBytes().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89760 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ccb5a3248dbe899ccd0081c0b4e62e2842956496 24-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89717 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8cfe5a784133d90bf329fd20801824a6f71bb8ca 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89717 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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.h
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.h
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.h
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.h
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
xpr.h
xprCXX.h
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
xpr.h
xprCXX.h
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.h
ecl.h
eclCXX.h
eclTemplate.h
xpr.h
xprCXX.h
emplateBase.h
ype.h
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.h
ecl.h
eclCXX.h
eclTemplate.h
xpr.h
xprCXX.h
emplateBase.h
ype.h
331835cdfdc06157ab5143808dd44f3143e9861e 22-Nov-2009 John McCall <rjmccall@apple.com> Consider a FunctionTemplate to be an overload all on its lonesome. Track
this information through lookup rather than rederiving it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89570 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
7453ed4cb2cab113de3378df371b1c6f1243d832 22-Nov-2009 John McCall <rjmccall@apple.com> Consider a FunctionTemplate to be an overload all on its lonesome. Track
this information through lookup rather than rederiving it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89570 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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
ttr.h
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
ttr.h
9ae4976e33e484b05a6ed1910a10570fcafce8f5 21-Nov-2009 Mike Stump <mrs@apple.com> Checkpoint current work. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89513 91177308-0d34-0410-b5e6-96231b3b80d8
tmtCXX.h
2bf701ee4babb5c4a9ea99ca4675c5ef040bd402 21-Nov-2009 Mike Stump <mrs@apple.com> Checkpoint current work. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89513 91177308-0d34-0410-b5e6-96231b3b80d8
tmtCXX.h
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
xprCXX.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
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
ype.h
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
ype.h
502995460462ad6a49a9cbb84dab33d7ea75b437 18-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Implement code completion for Objective-C category names in @interface
and @implementation declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89223 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
33ced0b8550f3e7169f326944731ee02e9338659 18-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement code completion for Objective-C category names in @interface
and @implementation declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89223 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
eclCXX.h
eclNodes.def
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.h
eclCXX.h
eclNodes.def
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.h
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.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
e4f33fbd5005a236d88314528058d6db8b12c506 17-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure, for sure this time, that expressions do not have reference type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89104 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
905d11d53aeb6b26744f44fedc2b2820c7a62df6 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Make sure, for sure this time, that expressions do not have reference type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89104 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
eclBase.h
eclCXX.h
eclNodes.def
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
eclBase.h
eclCXX.h
eclNodes.def
3e8f5018fc04d40e2489fc703f0c847d5c57115a 17-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Add missing #include found by Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89043 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
b91c7f67e85309fbd4cd5007c873e1d27b86e8bb 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Add missing #include found by Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89043 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
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.h
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.h
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.h
ypeLoc.h
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.h
ypeLoc.h
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.h
anonicalType.h
ype.h
ypeLoc.h
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.h
anonicalType.h
ype.h
ypeLoc.h
683b021318387947f24f1553abb11e727d35a7eb 15-Nov-2009 Anders Carlsson <andersca@mac.com> Make sure that virtual destructors have delete operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88877 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
6d7013940a37f03fd324ef438ff984a5369013b0 15-Nov-2009 Anders Carlsson <andersca@mac.com> Make sure that virtual destructors have delete operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88877 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
3e45b913d53b7353f25eed5e11212bf719e5f0ab 15-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Make a few headers parse standalone

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88832 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
ecordLayout.h
edeclarable.h
ypeLocBuilder.h
7745cab137b9d91205f13a7adaebe6ed801595f7 15-Nov-2009 Douglas Gregor <dgregor@apple.com> Make a few headers parse standalone

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88832 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
ecordLayout.h
edeclarable.h
ypeLocBuilder.h
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.h
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.h
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.h
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.h
7afa0dc617379fe6a1ac2d56006ffe337341cf82 13-Nov-2009 Chris Lattner <sabre@nondot.org> add a fixme, inheriting from PointerIntPair is gross :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87048 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
efc18e41f122b6ccac507bd9ec1aa7cb8845c2db 13-Nov-2009 Chris Lattner <sabre@nondot.org> add a fixme, inheriting from PointerIntPair is gross :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87048 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
4d07786b4231ef8d83f96aaaf710314c85eed77b 12-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> We need the definition of NamedDecl in DeclContextInternals.h, since Clang is type-checking the template definition more thoroughly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87037 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
c0213f2691aed7c3f8f252e073b0b3913ee1c33c 12-Nov-2009 Douglas Gregor <dgregor@apple.com> We need the definition of NamedDecl in DeclContextInternals.h, since Clang is type-checking the template definition more thoroughly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87037 91177308-0d34-0410-b5e6-96231b3b80d8
eclContextInternals.h
b0b2636370c810d4140200d9b956dbcb510a7bce 12-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Give CanQual<T> an implicit conversion to bool, so that it can be used
in "if" statements like:

if (CanQual<ReferenceType> RefType = T.getAs<ReferenceType>())

Thanks to Clang for pointing out this mistake :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86995 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
cffecd08f1974dc7cc328bd620b2f69daf442fda 12-Nov-2009 Douglas Gregor <dgregor@apple.com> Give CanQual<T> an implicit conversion to bool, so that it can be used
in "if" statements like:

if (CanQual<ReferenceType> RefType = T.getAs<ReferenceType>())

Thanks to Clang for pointing out this mistake :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86995 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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.h
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.h
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.h
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.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
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.h
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.h
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
eclTemplate.h
emplateBase.h
ypeLoc.h
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
eclTemplate.h
emplateBase.h
ypeLoc.h
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
ype.h
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
ype.h
406b56a9a0ed38e9fbcea1f51ea28ee3719517d3 09-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86596 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
89c49f09b0292dc7c03885f6c765d667a9837597 09-Nov-2009 Douglas Gregor <dgregor@apple.com> Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86596 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2c20fd833cd2e6a75e25e1203ebc80fe23a802ed 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGen
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86571 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
8f4c59e912f08919bd051fbca3d0dd2b90382ab3 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGen
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86571 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
bd48e8c48190a8f036a539463e7b55ebb0a573c7 05-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Adds doxygen comment for HasSideEffects method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86150 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6ddf4784a22b994b954ed74c6061d4603d474639 05-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Adds doxygen comment for HasSideEffects method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86150 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
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
xpr.h
7536a5fe4cf7fa1a9972e1401a32c54fbae88cf2 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Tweak formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86070 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
3926a1fe92f622f194d7d99560d0b17b2af65a61 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Tweak formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86070 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
000f59548655c6a0f9dc69521406506de022f5c8 04-Nov-2009 John McCall <rjmccall@apple.com> Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5ab75172051a6d2ea71a80a79e81c65519fd3462 04-Nov-2009 John McCall <rjmccall@apple.com> Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
emplateName.h
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.h
emplateName.h
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.h
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.h
7f437c99d5bec4dd91aa7404e64c0237e288f4d8 03-Nov-2009 Ted Kremenek <kremenek@apple.com> Move 'static inline' functions GetNullarySelector() and GetUnarySelector() from CFRefCount.cpp to ASTContext.h. These functions are likely to be generally useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85886 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
d5925bdff8bda8e062985caea299946636104d99 03-Nov-2009 Ted Kremenek <kremenek@apple.com> Move 'static inline' functions GetNullarySelector() and GetUnarySelector() from CFRefCount.cpp to ASTContext.h. These functions are likely to be generally useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85886 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
854d2b8695ea2d66a3ff8973170fc531efae5d0a 30-Oct-2009 John McCall <rjmccall@apple.com> Finally suppress a compiler warning from gcc on release-asserts. Also fixes
a crash on <vector> in same, which bears additional investigation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85598 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
ypeLoc.h
cbe12738371bec6ff20372e1d3426cffc85d8323 30-Oct-2009 John McCall <rjmccall@apple.com> Finally suppress a compiler warning from gcc on release-asserts. Also fixes
a crash on <vector> in same, which bears additional investigation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85598 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
ypeLoc.h
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.h
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.h
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.h
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.h
997b30eccf20a93658b692604a4c89848c098d9c 30-Oct-2009 John McCall <rjmccall@apple.com> Report accurate source-location information when rebuilding types during
template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85545 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
85737a71fee8c737f7cfba79a0aca89298fe573b 30-Oct-2009 John McCall <rjmccall@apple.com> Report accurate source-location information when rebuilding types during
template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85545 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
671b0ff0d8b39fa6ba97a7a16d0d98124020d9aa 30-Oct-2009 John McCall <rjmccall@apple.com> Silence a gcc warning where it notices that default-constructing a class
doesn't initialize anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85533 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
7c475ee1339c03e2d544a28aa9b8da393ce7d20c 30-Oct-2009 John McCall <rjmccall@apple.com> Silence a gcc warning where it notices that default-constructing a class
doesn't initialize anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85533 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
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.h
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.h
ypeLoc.h
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.h
ypeLoc.h
9532add6f24ae449c22f8c98f2246a974eee95be 29-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Fix Release-Asserts build breakage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85509 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
8de39b431d3775cd46584080beec3a75d019bd28 29-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix Release-Asserts build breakage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85509 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
2509390283cc92808f9d67495b994f7a0c8eddd4 29-Oct-2009 John McCall <rjmccall@apple.com> Apparently when is now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85501 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
4fff4b3fdf49272a26b7cb7bd564a521e938805b 29-Oct-2009 John McCall <rjmccall@apple.com> Apparently when is now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85501 91177308-0d34-0410-b5e6-96231b3b80d8
emplateBase.h
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.h
eclTemplate.h
xpr.h
xprCXX.h
emplateBase.h
ype.h
ypeLoc.h
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.h
eclTemplate.h
xpr.h
xprCXX.h
emplateBase.h
ype.h
ypeLoc.h
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
eclTemplate.h
emplateBase.h
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
eclTemplate.h
emplateBase.h
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.h
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.h
2dc6522289d676177a7bd9c524a59a76c50530ac 28-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Mangle based on the declaration we're given, not the canonical
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85400 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
457e2815d43fa68f7ff7cd2f7e9d1bf7b6fdc653 28-Oct-2009 Douglas Gregor <dgregor@apple.com> Mangle based on the declaration we're given, not the canonical
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85400 91177308-0d34-0410-b5e6-96231b3b80d8
edeclarable.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
3ea917bf3bdf43c4dd8d1aa3469295d4ba2b8a5a 27-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Chris's suggestions for the precendence warnings. Reformat the code a bit. Test the fixits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85231 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
aee3c9375f97a49edef2a36f15df6abd9748e2a1 27-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Chris's suggestions for the precendence warnings. Reformat the code a bit. Test the fixits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85231 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xpr.h
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
xpr.h
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
eclGroup.h
ecordLayout.h
tmtIterator.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
eclGroup.h
ecordLayout.h
tmtIterator.h
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.h
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.h
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.h
anonicalType.h
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.h
anonicalType.h
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.h
eclNodes.def
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.h
eclNodes.def
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.h
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.h
a86b882c81a748417bbf10b488a779a6e78818cb 23-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix operator precedence in Doug's most recent commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84964 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
2cf719c3c3d805f630dfc6b1255e52647820888e 23-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix operator precedence in Doug's most recent commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84964 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ype.h
ypeLoc.h
ypeNodes.def
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
anonicalType.h
ype.h
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
anonicalType.h
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
ypeLocBuilder.h
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.h
ypeLocBuilder.h
72415c5c8facb2991705e689a092c0affbe75598 21-Oct-2009 John McCall <rjmccall@apple.com> Publicize getSigilLoc / setSigilLoc for better metaprogramming.

Fix the ReferenceTypeLoc hierarchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84714 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
bb833dcc562f686a0652865d1945cfa3a421379c 21-Oct-2009 John McCall <rjmccall@apple.com> Publicize getSigilLoc / setSigilLoc for better metaprogramming.

Fix the ReferenceTypeLoc hierarchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84714 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
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.h
06b164b7d92a75478ef391104cf745ad473df3e0 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Update NamedDecl::getName() to work for empty names.
- I'm not sure this is ideal, but otherwise clients must be overly careful when handling decl's which can have empty names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84457 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
45475c696ecfd6d296535adb4723b7ba8817c06c 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Update NamedDecl::getName() to work for empty names.
- I'm not sure this is ideal, but otherwise clients must be overly careful when handling decl's which can have empty names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84457 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c05b6f3a9ae8cc57d174c6f2ce01d2bacc2d8477 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add ObjCImplementationDecl::getName() for consistency, with FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84455 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
d0c10e20d5ba8c1a8a077db128c03eddc3158673 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add ObjCImplementationDecl::getName() for consistency, with FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84455 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
226262ae8d69f060747948b1a52aa2c5d244d857 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add FIXME calling for rename of NamedDecl::getNameAsString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84454 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b409e2ddfd97fc51db377e346a6dbb8a317035b3 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add FIXME calling for rename of NamedDecl::getNameAsString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84454 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9712926717b71836e1e287e319ff5653df25a0c3 19-Oct-2009 Anders Carlsson <andersca@mac.com> Fix tyop noticed by Sean Hunt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84449 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
f67cea84bac1d3417f0baaf1fcbc86ee126e2d87 19-Oct-2009 Anders Carlsson <andersca@mac.com> Fix tyop noticed by Sean Hunt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84449 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
ecl.h
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
ecl.h
ae8bee82369414db0865b321f328190bf8fbe4eb 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84435 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b5217efa5be2fd6be48d207267c8bcda6bf9206c 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84435 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
5a0c5fb984577232cdaaf527c3e275620b3100a7 18-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> non-POD members => make it a class (also silences MSVC warnings)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84426 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
4e0e2f1c5fde88a235d71a6f4f87f5c3fcaab7ac 18-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> non-POD members => make it a class (also silences MSVC warnings)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84426 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
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.h
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.h
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.h
ype.h
ypeLoc.h
ypeNodes.def
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.h
ype.h
ypeLoc.h
ypeNodes.def
80d53d0b51aa2e48c3954c02ab50f7cb7cf311ed 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add NameDecl::getName() -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84394 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ecfa8d2d865a997e2240dd7ea8f939844e347200 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add NameDecl::getName() -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84394 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ypeLoc.h
ypeLocNodes.def
ypeLocVisitor.h
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
ypeLoc.h
ypeLocNodes.def
ypeLocVisitor.h
e940efe4c977acfdd693208e654eeb4af89dd88a 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Remove a FIXME that doesn't belong, there are numerous other places that use
alignment in bits in clang. If we really want to fix this, it should be a bugzilla.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84328 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
67f594c0a0f285df815fe8eb64c59d4c23f99949 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Remove a FIXME that doesn't belong, there are numerous other places that use
alignment in bits in clang. If we really want to fix this, it should be a bugzilla.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84328 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
af8b56844f43fcef07307d5494436e29ad329831 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add IdentiferInfo::getNameStr() -> StringRef.

Also, add getNameStart as a synonym for getName(). getName() is now deprecated,
when all clients are updated then getNameStr() should be renamed to
getName(). PR5218.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84306 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
7fe60650c1133ee74a3395cf1063690e274bb7ac 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add IdentiferInfo::getNameStr() -> StringRef.

Also, add getNameStart as a synonym for getName(). getName() is now deprecated,
when all clients are updated then getNameStr() should be renamed to
getName(). PR5218.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84306 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
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.h
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.h
e99ec20791613393d88c5292be32d90637456272 16-Oct-2009 John McCall <rjmccall@apple.com> Add an accessor to extra the type directly from a DeclaratorInfo
without an opaque call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84277 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d9067b318604fddf960057fcb59145381c449d9e 16-Oct-2009 John McCall <rjmccall@apple.com> Add an accessor to extra the type directly from a DeclaratorInfo
without an opaque call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84277 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e05db11d09b8461c6eb1a2e4e2ef7f2d2be1c369 16-Oct-2009 Ted Kremenek <kremenek@apple.com> Provide 'static' version of BinaryOperator::isShiftOp().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84268 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
40a5ef90ac8d3f29bc8fe4ff80e00eaf3ef5b79f 16-Oct-2009 Ted Kremenek <kremenek@apple.com> Provide 'static' version of BinaryOperator::isShiftOp().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84268 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e6f70046cc9acf8b51952211f6d2aa98998e73df 16-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
7d1d49d2971b20a97b3c2a301470b9eaaa130137 16-Oct-2009 Douglas Gregor <dgregor@apple.com> Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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.h
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.h
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.h
anonicalType.h
ype.h
ypeNodes.def
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.h
anonicalType.h
ype.h
ypeNodes.def
953d06ccb58f1e73e09ee892631ee86cf1de3157 16-Oct-2009 John McCall <rjmccall@apple.com> ConcreteTypeLoc subclasses which call getInnerTypeLoc() should get a
compile-time error now; moreover, remove the need for an explicit hasInnerType()
call. Thanks to Doug Gregor for the metaprogramming approach.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84215 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
a6f56429aa9a02e71426e99db8b0ae94d0115215 16-Oct-2009 John McCall <rjmccall@apple.com> ConcreteTypeLoc subclasses which call getInnerTypeLoc() should get a
compile-time error now; moreover, remove the need for an explicit hasInnerType()
call. Thanks to Doug Gregor for the metaprogramming approach.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84215 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
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.h
3d3d16cfa0a911055c5d7cb2ff4400c48752dd94 15-Oct-2009 John McCall <rjmccall@apple.com> Complete some unfinished comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84169 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
f2130a6e3cef10b435feadf6ad8bebaaf9a81a88 15-Oct-2009 John McCall <rjmccall@apple.com> Complete some unfinished comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84169 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
ypeLocNodes.def
ypeLocVisitor.h
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.h
ypeLocNodes.def
ypeLocVisitor.h
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.h
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.h
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.h
ecl.h
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.h
ecl.h
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
eclTemplate.h
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
eclTemplate.h
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.h
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.h
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.h
eclCXX.h
eclTemplate.h
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.h
eclCXX.h
eclTemplate.h
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.h
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.h
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.h
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.h
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.h
ecl.h
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.h
ecl.h
b6a0249748ea465da1e75880239044d6e8fac4cb 08-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Compress storage for MemberSpecializationInfo into a single
pointer. Yay, PointerIntPair.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83512 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
44e368b6a85c42d681148ccd5e0052418ff9751e 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Compress storage for MemberSpecializationInfo into a single
pointer. Yay, PointerIntPair.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83512 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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.h
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.h
26b8955aaa75ca5ae58e1671731f0752ed28c1e0 07-Oct-2009 Mike Stump <mrs@apple.com> Fix eof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83432 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
da5529121eb3102432170ee0a1797b9e58044a2f 07-Oct-2009 Mike Stump <mrs@apple.com> Fix eof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83432 91177308-0d34-0410-b5e6-96231b3b80d8
XXInheritance.h
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
XXInheritance.h
eclCXX.h
eclarationName.h
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
XXInheritance.h
eclCXX.h
eclarationName.h
6fe12e8550fc84db231cb60c093c1e59fcf56b4c 06-Oct-2009 Mike Stump <mrs@apple.com> This is slightly contentious, but, if llvm has gone to addressable
units, we should as well. The problem is the non-predictability of
the dimension of the values. I'd love for the dimension to be part of
the static type system... but in C++ it is kinda annoying to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83345 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
8cf7a1a6dd284a356d0cc69448e35f9b13a7b35a 06-Oct-2009 Mike Stump <mrs@apple.com> This is slightly contentious, but, if llvm has gone to addressable
units, we should as well. The problem is the non-predictability of
the dimension of the values. I'd love for the dimension to be part of
the static type system... but in C++ it is kinda annoying to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83345 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
0c6d1f94a45dcb3f83adf9fb44461ea9b55dfd85 02-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure to free the explicit template arguments provided for an
explicit instantiation. Also, tighten up reference-count checking to
help catch these issues earlier. Fixes PR5069.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83225 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b2f81cf7f8445e0c65c0428f4fbb0442566916b8 02-Oct-2009 Douglas Gregor <dgregor@apple.com> Make sure to free the explicit template arguments provided for an
explicit instantiation. Also, tighten up reference-count checking to
help catch these issues earlier. Fixes PR5069.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83225 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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
ecl.h
eclBase.h
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
ecl.h
eclBase.h
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.h
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.h
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.h
ypeLocVisitor.h
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.h
ypeLocVisitor.h
f70c796848eaa08e8b2986d5be82e5a6b7eec3d7 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Fix Decl class hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83109 91177308-0d34-0410-b5e6-96231b3b80d8
eclNodes.def
fbc85e565271c762debfb3dcfce3a18df3e2b396 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix Decl class hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83109 91177308-0d34-0410-b5e6-96231b3b80d8
eclNodes.def
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.h
ypeLocNodes.def
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.h
ypeLocNodes.def
f453db071fe7be38ede2607671fa196c58cffc88 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce TypedefLoc::getTypedefDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83096 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
9036d5e369aae65e3baccdeed74c796e3d367b3d 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce TypedefLoc::getTypedefDecl().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83096 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
ypeLocNodes.def
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.h
ypeLocNodes.def
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
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.h
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.h
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.h
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.h
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
ypeLoc.h
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
ypeLoc.h
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.h
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.h
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.h
eclCXX.h
edeclarable.h
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.h
eclCXX.h
edeclarable.h
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
eclBase.h
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
eclBase.h
06c13d6e31ba05d4a0bb31274aecce4544571673 25-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> WIP implementation of explicit instantiation of function templates,
member functions of class template specializations, and static data
members. The mechanics are (mostly) present, but the semantic analysis
is very weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82789 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
d5a423b279e787e9fdd8309fe52cb515388c54ea 25-Sep-2009 Douglas Gregor <dgregor@apple.com> WIP implementation of explicit instantiation of function templates,
member functions of class template specializations, and static data
members. The mechanics are (mostly) present, but the semantic analysis
is very weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82789 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
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.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.h
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.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
ype.h
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
ype.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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.h
anonicalType.h
ype.h
ypeNodes.def
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.h
anonicalType.h
ype.h
ypeNodes.def
e0dd8ec0b57438c26f2565c5fabb9d62d27a6a6a 24-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Make C++ temporary-related expressions provide proper source-range information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82665 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
96be6917e1c4ba1f4435a14c9e7c6c139571d086 24-Sep-2009 Douglas Gregor <dgregor@apple.com> Make C++ temporary-related expressions provide proper source-range information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82665 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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
eclCXX.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
eclCXX.h
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
ecordLayout.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
ecordLayout.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
ecl.h
eclCXX.h
ype.h
ypeNodes.def
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
ecl.h
eclCXX.h
ype.h
ypeNodes.def
03546f72ab350b0181d20a9e95da6b451401cc00 18-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> For code completion in C++ member access expressions and tag names,
look into the current scope for anything that could start a
nested-names-specifier. These results are ranked worse than any of the
results actually found in the lexical scope.

Perform a little more pruning of the result set, eliminating
constructors, __va_list_tag, and any duplication of declarations in
the result set. For the latter, implemented
NamespaceDecl::getCanonicalDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82231 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
33224e61bfca370850abae89bbd415a4dabe07fa 18-Sep-2009 Douglas Gregor <dgregor@apple.com> For code completion in C++ member access expressions and tag names,
look into the current scope for anything that could start a
nested-names-specifier. These results are ranked worse than any of the
results actually found in the lexical scope.

Perform a little more pruning of the result set, eliminating
constructors, __va_list_tag, and any duplication of declarations in
the result set. For the latter, implemented
NamespaceDecl::getCanonicalDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82231 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
eclNodes.def
eclTemplate.h
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
eclNodes.def
eclTemplate.h
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.h
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.h
75f48e16726933b75d77737f4af43620e21bfdcd 15-Sep-2009 Anders Carlsson <andersca@mac.com> Get rid of the CastInfo struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81839 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
c0a2fd8f092722c8f78b566ac4506a21437040e9 15-Sep-2009 Anders Carlsson <andersca@mac.com> Get rid of the CastInfo struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81839 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
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.h
xprCXX.h
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.h
xprCXX.h
c927d7e282394200e6fc1cb82576ad6a17c64f53 14-Sep-2009 John McCall <rjmccall@apple.com> Skeletal support for friend class templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81801 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
05b23ea2119b4c411719bd6631e5d679ba5e7ef1 14-Sep-2009 John McCall <rjmccall@apple.com> Skeletal support for friend class templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81801 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
fa4770459f62d47f6889d145347b8bf02462b543 14-Sep-2009 Anders Carlsson <andersca@mac.com> Fix a bug in getFriendObjectKind where we would clear out all mask bits except IDNS_TagFriend and IDNS_OrdinaryFriend but then check for IDNS_Tag and IDNS_Ordinary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81730 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
255d6415a692e8384971755f91541497d54b3193 14-Sep-2009 Anders Carlsson <andersca@mac.com> Fix a bug in getFriendObjectKind where we would clear out all mask bits except IDNS_TagFriend and IDNS_OrdinaryFriend but then check for IDNS_Tag and IDNS_Ordinary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81730 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
ee39e6176a9e5e34999a55a48a57abde2ee21eb8 13-Sep-2009 Anders Carlsson <andersca@mac.com> CXXMethodDecl::isVirtual needs to check the canonical declaration. Fixes PR4878.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81715 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
8195bc932d27e21be46b9a1f8ce268ebd419246b 13-Sep-2009 Anders Carlsson <andersca@mac.com> CXXMethodDecl::isVirtual needs to check the canonical declaration. Fixes PR4878.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81715 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
xpr.h
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
xpr.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
93c4d4d481fde4024e734e19551d2de0e8555ba0 11-Sep-2009 John McCall <rjmccall@apple.com> Track a class template specialization's point of instantiation separately
from its location. Initialize appropriately.

When implicitly creating a declaration of a class template specialization
after encountering the first reference to it, use the pattern class's
location instead of the location of the first reference.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81515 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
9cc7807e1622c2f945b607bdd39dd283df5e7bb5 11-Sep-2009 John McCall <rjmccall@apple.com> Track a class template specialization's point of instantiation separately
from its location. Initialize appropriately.

When implicitly creating a declaration of a class template specialization
after encountering the first reference to it, use the pattern class's
location instead of the location of the first reference.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81515 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
eclTemplate.h
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.h
eclTemplate.h
73cf66ee8e3e654e21345bc1303b60f28d298eac 11-Sep-2009 Anders Carlsson <andersca@mac.com> Instantiate PredefinedExprs correctly. Patch by Sam Weinig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81498 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
773f3973cf5e2b6b8788e895967dcb3c1e6ffe79 11-Sep-2009 Anders Carlsson <andersca@mac.com> Instantiate PredefinedExprs correctly. Patch by Sam Weinig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81498 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
0c6215978605dfde5ba2c4fdea8fb3c11ec67f81 09-Sep-2009 Anders Carlsson <andersca@mac.com> If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81383 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3 09-Sep-2009 Anders Carlsson <andersca@mac.com> If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81383 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
STConsumer.h
STContext.h
STDiagnostic.h
ttr.h
anonicalType.h
ecl.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclGroup.h
eclObjC.h
eclTemplate.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
estedNameSpecifier.h
arentMap.h
rettyPrinter.h
ecordLayout.h
edeclarable.h
tmt.h
tmtGraphTraits.h
tmtIterator.h
tmtObjC.h
tmtVisitor.h
emplateName.h
ype.h
ypeLoc.h
ypeOrdering.h
ypeVisitor.h
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.h
STConsumer.h
STContext.h
STDiagnostic.h
ttr.h
anonicalType.h
ecl.h
eclBase.h
eclCXX.h
eclContextInternals.h
eclGroup.h
eclObjC.h
eclTemplate.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
xternalASTSource.h
estedNameSpecifier.h
arentMap.h
rettyPrinter.h
ecordLayout.h
edeclarable.h
tmt.h
tmtGraphTraits.h
tmtIterator.h
tmtObjC.h
tmtVisitor.h
emplateName.h
ype.h
ypeLoc.h
ypeOrdering.h
ypeVisitor.h
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
xprCXX.h
emplateName.h
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
xprCXX.h
emplateName.h
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.h
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.h
4bb774e2352b6c5f459b345a5e0f41bd244e70a7 08-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression in generating objc's GC API
in assiging to c pointer types with a GC'able
attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81244 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ac423ba85bb59cc7cc1d43081b20d7e8d40355ff 08-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression in generating objc's GC API
in assiging to c pointer types with a GC'able
attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81244 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
eclObjC.h
xpr.h
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.h
eclObjC.h
xpr.h
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.h
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.h
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
rettyPrinter.h
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
rettyPrinter.h
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.h
ecl.h
ype.h
ypeNodes.def
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.h
ecl.h
ype.h
ypeNodes.def
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.h
eclTemplate.h
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.h
eclTemplate.h
0670594f65a1718aa383721718bc6b6d89025a1e 04-Sep-2009 Mike Stump <mrs@apple.com> Cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81024 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
f79079565e15e6a328372076ac5583af16c8dbce 04-Sep-2009 Mike Stump <mrs@apple.com> Cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81024 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
tmtNodes.def
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.h
tmtNodes.def
122f940d749ab8a0f78b97b0f9252b41fb1248cd 04-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Actually initialize HasQualifier and HasExplicitTemplateArgumentList in the EmptyShell constructor for MemberExpr. Should clear up some valgrind failures in PCH reading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80984 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e6585a7d71510be00a625686153f48d496d3bbf1 04-Sep-2009 Douglas Gregor <dgregor@apple.com> Actually initialize HasQualifier and HasExplicitTemplateArgumentList in the EmptyShell constructor for MemberExpr. Should clear up some valgrind failures in PCH reading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80984 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
bc2fb7fd319e8beaf899395ffa5b44ea833a648e 03-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80953 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
c68afe2cbe7f875a9243c411077602fb5f5dc74b 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80953 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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
xprCXX.h
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
xprCXX.h
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.h
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.h
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.h
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.h
e7228108544bf81c0a5fd9979f55911414dd0318 02-Sep-2009 Anders Carlsson <andersca@mac.com> Fix a crash when referencing static data members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80835 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a0d4b63d15138ca00e12df3c0573954b07ea40a8 02-Sep-2009 Anders Carlsson <andersca@mac.com> Fix a crash when referencing static data members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80835 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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
xpr.h
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
xpr.h
f02d2aefb7a9b3d186de72b0109ea00f74bd459d 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80690 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
61481dad22ebca3fba3fe4fb67a3b926d0895e9c 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80690 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
6e862e28ca9115c404fd0542e8727a476366c849 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Tip-toe around strict-aliasing violation. Fixes PR4061.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80674 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
35f153f8ff4fd6a9b39c077026c3e5cc2c721a82 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Tip-toe around strict-aliasing violation. Fixes PR4061.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80674 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
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.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
e6c7b0611256a2e2dbaad79d1f587b18186d41e5 30-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Fix TypeLoc::operator bool().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80447 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
19a97e27a545959ee9b395a96140661148a6b5b0 30-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix TypeLoc::operator bool().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80447 91177308-0d34-0410-b5e6-96231b3b80d8
ypeLoc.h
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.h
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.h
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.h
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.h
a903eb4de66320b25f766fdf6bdd505283a8fd1d 29-Aug-2009 John McCall <rjmccall@apple.com> Fix the breakage by handling indirect instantiations. This would be much
improved if there were a consistent name for getInstantiatedFromMemberX()
across all classes. Cheap refactor if someone wants to do it, but let's get the
buildbots happy first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80425 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
52a575a5ce7b27b6612357cdba5aa4ec1574ad5e 29-Aug-2009 John McCall <rjmccall@apple.com> Fix the breakage by handling indirect instantiations. This would be much
improved if there were a consistent name for getInstantiatedFromMemberX()
across all classes. Cheap refactor if someone wants to do it, but let's get the
buildbots happy first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80425 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
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.h
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.h
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
xpr.h
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
xpr.h
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.h
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.h
6145173144dc3a03dcfcc021df08cbcd76af91c4 28-Aug-2009 Anders Carlsson <andersca@mac.com> Instantiate unresolved using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80366 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
0dde18e5a713bc186062ca1ebc9967500b07faee 28-Aug-2009 Anders Carlsson <andersca@mac.com> Instantiate unresolved using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80366 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
eclCXX.h
eclNodes.def
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.h
eclCXX.h
eclNodes.def
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
eclCXX.h
eclNodes.def
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
eclCXX.h
eclNodes.def
2993eddf5716775128f10b731a0627daab97bacc 28-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> When looking for overloaded member operators, make sure to instantiate
class template specializations (when possible) and look into base
classes. Thanks to Eli for the test case!

FIXME -=1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80302 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
8a5ae2401645788144c0ae769a2fb899866801f5 28-Aug-2009 Douglas Gregor <dgregor@apple.com> When looking for overloaded member operators, make sure to instantiate
class template specializations (when possible) and look into base
classes. Thanks to Eli for the test case!

FIXME -=1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80302 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
3b896451923635c7d82f943dbaba1c03e6bb7c1f 27-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Implement instantiation of the declarations of member function
templates within class templates, producing a member function template
of a class template specialization. If you can parse that, I'm
sorry. Example:

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

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

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

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

More testing to come...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80252 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
d60e105e6d1624da647ef7dd35a9cf6fad1b763e 27-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement instantiation of the declarations of member function
templates within class templates, producing a member function template
of a class template specialization. If you can parse that, I'm
sorry. Example:

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

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

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

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

More testing to come...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80252 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
aa5bff55484f0610783419d493e692aafa40faf9 27-Aug-2009 Gabor Greif <ggreif@gmail.com> iterator.h is no more. Be standards compliant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80225 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtIterator.h
f5afb5e1fa1877a4adf3328e5be31b2f959d82eb 27-Aug-2009 Gabor Greif <ggreif@gmail.com> iterator.h is no more. Be standards compliant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80225 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtIterator.h
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.h
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.h
3a4fed165ad3b46aee9ac07e25474fe98d5a13f2 27-Aug-2009 Anders Carlsson <andersca@mac.com> In ActOnCXXTypeConstructExpr, check that the type is complete and non-abstract before creating any expressions. This assures that any templates are instantiated if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80200 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
bb60a509f47a95a4ed9366ec1fc65850da654d38 27-Aug-2009 Anders Carlsson <andersca@mac.com> In ActOnCXXTypeConstructExpr, check that the type is complete and non-abstract before creating any expressions. This assures that any templates are instantiated if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80200 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
9c71db1d83b6c08e92f0dd69fd0e23bc0aeaf6d2 27-Aug-2009 Mike Stump <mrs@apple.com> Regularize the case and sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80163 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
1feade8e520be483293dbf55eb57a51720899589 27-Aug-2009 Mike Stump <mrs@apple.com> Regularize the case and sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80163 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
52be1ca6972aae4d4bc4e4293b2b49cb05272b4c 26-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Implement support for C++ direct initializers that involve dependent
types or type-dependent expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80143 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
83ddad3ab513f5d73698cf9fbeb4ed3f011bc3b9 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement support for C++ direct initializers that involve dependent
types or type-dependent expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80143 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a1377ad3b9dd3b078f419b3a829bfb83e8c2baaa 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80136 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
58d3f1af9b4efa426826816a16894986b78b2692 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80136 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c3e811318b81d07db4b2a4f8aca7e83298e4366c 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> AST for conversion by conversion functions. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80135 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9099ff0cf91ac9e0b2d5a142807fa384ce842fc4 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> AST for conversion by conversion functions. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80135 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cf13d4ad85bceb69c8dfb2fc9f2b4276ccd3a130 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> update to CXXFunctionalCastExpr to support ir-gen for
type convesions of class objects [class.conv]. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80127 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
e9f42087aabfdb6b2afc35c7e38ac65da063b409 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> update to CXXFunctionalCastExpr to support ir-gen for
type convesions of class objects [class.conv]. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80127 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
346198721c8f96f8ab2f0fcf1fe129170ad2394f 26-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Source location information for ? and : in a ConditionalOperator, from Enea Zaffanella

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80097 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
47e1f7c68bf375cac470fdb2b599ddbb395aeb52 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Source location information for ? and : in a ConditionalOperator, from Enea Zaffanella

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80097 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
90d6e4d832c48f214970b9be930fd11b2cf60282 25-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Changed condition of an assert.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80020 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
cf5c19b9b7145e7fc092fa1309085deded25b0f1 25-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Changed condition of an assert.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80020 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
82d05b9db0e33bfd819442cbc51dfa5c5818669a 25-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Sanity checking for statement reference counts. Thanks for the suggestion, Fariborz

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79995 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8b55ce79391dcce51c52f8aff923f4607e6cd977 25-Aug-2009 Douglas Gregor <dgregor@apple.com> Sanity checking for statement reference counts. Thanks for the suggestion, Fariborz

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79995 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
fef99322746767af932eec8260f2ce7a813e4c01 25-Aug-2009 Anders Carlsson <andersca@mac.com> Add Decl getter/setters for uninstantiated default arguments for function parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79965 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
66e78e23e35630e72d77b27ea145f236f49e2732 25-Aug-2009 Anders Carlsson <andersca@mac.com> Add Decl getter/setters for uninstantiated default arguments for function parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79965 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d5afcd799493200dfe8fca7f33311c34d27a3b0b 24-Aug-2009 Chris Lattner <sabre@nondot.org> normalize the CharacterLiteral::getLocation method name, patch
by Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79924 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
018d8e0596dd57401eeddcf11ac84ff0a065fbbe 24-Aug-2009 Chris Lattner <sabre@nondot.org> normalize the CharacterLiteral::getLocation method name, patch
by Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79924 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b35c799aeb381f5e4e8a61e839a1bea9cc21a68e 24-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Try to complete a type before looking for conversion functions within
that type. Note that we do not produce a diagnostic if the type is
incomplete; rather, we just don't look for conversion functions. Fixes PR4660.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79919 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
5842ba9fd482bb2fe5198b32c2ae549cd5474e6d 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Try to complete a type before looking for conversion functions within
that type. Note that we do not produce a diagnostic if the type is
incomplete; rather, we just don't look for conversion functions. Fixes PR4660.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79919 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
xpr.h
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
xpr.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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
xprObjC.h
tmtNodes.def
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
xprObjC.h
tmtNodes.def
627c055b81f90ad8af138615887af68a55bd1383 20-Aug-2009 John McCall <rjmccall@apple.com> Add syntax examples for the friend declaration types.

Remove an assert trivialized by dominating code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79520 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
f18970d1dd3a88b7a50e9abd4fd4ceef675a8a2e 20-Aug-2009 John McCall <rjmccall@apple.com> Add syntax examples for the friend declaration types.

Remove an assert trivialized by dominating code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79520 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
d64b41e7dda166fef72cb25b2c26f28c0c22a425 20-Aug-2009 John McCall <rjmccall@apple.com> Basic nested-template implementation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79504 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
e29ba20148e9b7835ad463b39cd4ee9223eafbbf 20-Aug-2009 John McCall <rjmccall@apple.com> Basic nested-template implementation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79504 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
fd3d5fdac0d25464e1b9c36bc646965494d44f66 19-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce LocInfoType which is a Sema-specific implementation detail.

This is a Type subclass that can hold a DeclaratorInfo* when we have type source info coming
out of a declarator that we want to preserve. This is used only at the "border" of Parser/Sema for
passing/getting QualTypes, it does not participate in the type system semantics in any way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79394 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
1bb8a45f7386a23871598d05141a07af03067925 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce LocInfoType which is a Sema-specific implementation detail.

This is a Type subclass that can hold a DeclaratorInfo* when we have type source info coming
out of a declarator that we want to preserve. This is used only at the "border" of Parser/Sema for
passing/getting QualTypes, it does not participate in the type system semantics in any way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79394 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ecl.h
eclCXX.h
eclNodes.def
eclObjC.h
eclTemplate.h
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
ecl.h
eclCXX.h
eclNodes.def
eclObjC.h
eclTemplate.h
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.h
ecl.h
ypeLoc.h
ypeLocNodes.def
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.h
ecl.h
ypeLoc.h
ypeLocNodes.def
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
xprObjC.h
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
xprObjC.h
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
xprObjC.h
tmtNodes.def
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
xprObjC.h
tmtNodes.def
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.h
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.h
010bd7dc60facc8769d91521d9a6a6b932eb58bb 16-Aug-2009 Anders Carlsson <andersca@mac.com> Destroy bound temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79196 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
8478ce6d3f2416a694e39f791655a473c3907d62 16-Aug-2009 Anders Carlsson <andersca@mac.com> Destroy bound temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79196 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
7fb13801b165ac3b72d62fde53f16187e6cdec07 16-Aug-2009 Anders Carlsson <andersca@mac.com> Move builtin call checking out into a separate function, make CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79157 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
d406bf0e8c17012110a8476d03c6f9a97b56ecf7 16-Aug-2009 Anders Carlsson <andersca@mac.com> Move builtin call checking out into a separate function, make CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79157 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
3d752dbee56ff1988d81644613aa595fc8d7bfa4 14-Aug-2009 Anders Carlsson <andersca@mac.com> Make the CXXDefaultArgExpr constructor protected and add a static Create function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79013 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
f1480eee38b59d15438fb7bc50865ac7c7e22403 14-Aug-2009 Anders Carlsson <andersca@mac.com> Make the CXXDefaultArgExpr constructor protected and add a static Create function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79013 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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
ecordLayout.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
ecordLayout.h
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.h
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.h
651efb73490efb9715fb4ca21cac71b9ae86d2a2 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for synthesizing copy assignment operator.
WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78841 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2198ba12b73a8e6801d13f25de38031da6df46b6 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for synthesizing copy assignment operator.
WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78841 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.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.h
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.h
257589e9035a669dd4c67645009cedca2b491b01 12-Aug-2009 Nate Begeman <natebegeman@mac.com> Fix a fixme by allocating ShuffleVectorExprs in the Context


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78780 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a88dc3079bedf70a5cfc39791727e43a10383006 12-Aug-2009 Nate Begeman <natebegeman@mac.com> Fix a fixme by allocating ShuffleVectorExprs in the Context


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78780 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
eclObjC.h
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.h
eclObjC.h
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
eclCXX.h
eclNodes.def
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
eclCXX.h
eclNodes.def
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.h
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.h
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.h
eclCXX.h
eclNodes.def
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.h
eclCXX.h
eclNodes.def
9d87976f7f2e258d12eb546a473518d493afedd7 11-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78645 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
b98b1991c7ad1eaedb863bdbdd784ec164277675 11-Aug-2009 Douglas Gregor <dgregor@apple.com> Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78645 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
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.h
tmtNodes.def
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.h
tmtNodes.def
c0b0396e7e37b56bc73c43c2dc290cd801fa1567 10-Aug-2009 Anders Carlsson <andersca@mac.com> Add a CastInfo struct that will be used for cast information when constructing cast expressions. Right now it only stores the cast kind, but in the future it might store conversion functions and constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78599 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
bd0fb30fa2a039439d1a30a83ea896801394d780 10-Aug-2009 Anders Carlsson <andersca@mac.com> Add a CastInfo struct that will be used for cast information when constructing cast expressions. Right now it only stores the cast kind, but in the future it might store conversion functions and constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78599 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
07d7174ab7769b6ca5b2375081500788d89ae1ea 10-Aug-2009 Mike Stump <mrs@apple.com> Add walking bases in reverse order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78578 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
b98f05c7389a5426c54f0e864043bb34862fa4e7 10-Aug-2009 Mike Stump <mrs@apple.com> Add walking bases in reverse order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78578 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
tmtNodes.def
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.h
tmtNodes.def
31af091f101c08ecb39a00c2b4741bec5cc00150 09-Aug-2009 Ryan Flynn <pizza@parseerror.com> map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
76168e289ca4b307259e3bc9b3353f03b05bb6b9 09-Aug-2009 Ryan Flynn <pizza@parseerror.com> map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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
ttr.h
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
ttr.h
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.h
xprCXX.h
xprObjC.h
tmt.h
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.h
xprCXX.h
xprObjC.h
tmt.h
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
xpr.h
tmt.h
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
xpr.h
tmt.h
5c09af0f78493759fee5948784d270d9126a2d51 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add a CK_ArrayToPointerDecay cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78434 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
112a0a8ddf23f6d25e0920002d5d4c1df0515f86 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add a CK_ArrayToPointerDecay cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78434 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b4671fa23fe684b71594cf2010d0286d0bd2718d 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add CK_ToUnion and use it for aggregate expression codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78429 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4d8673b645ad86e496b886a0f80b60763f67071d 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add CK_ToUnion and use it for aggregate expression codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78429 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b41b2052f4188f2254c28a877c2c8f1787d9d6a4 08-Aug-2009 John McCall <rjmccall@apple.com> Just add global scope to the associated namespaces set instead of tracking it
separately. Add the framework (currently unfed) for finding friend declarations
during argument-dependent lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78414 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
6ff0785f1e58fb2cfb702d2995d076c6648a9a13 08-Aug-2009 John McCall <rjmccall@apple.com> Just add global scope to the associated namespaces set instead of tracking it
separately. Add the framework (currently unfed) for finding friend declarations
during argument-dependent lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78414 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
e57c0274c8b59b3674582fd7e1acd16ceca5466f 07-Aug-2009 Mike Stump <mrs@apple.com> Add rbegin and rend for virtual bases, might come in handy some day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78412 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
89ed850a1b586a4ed303ee8a8140bed11b85b390 07-Aug-2009 Mike Stump <mrs@apple.com> Add rbegin and rend for virtual bases, might come in handy some day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78412 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
ecordLayout.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
ecordLayout.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.h
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.h
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.h
xprCXX.h
tmt.h
tmtCXX.h
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.h
xprCXX.h
tmt.h
tmtCXX.h
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
eclCXX.h
ecordLayout.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
eclCXX.h
ecordLayout.h
c28afc985a8b167225c02ece59dda573f61cbd9f 05-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a comment that trailed off

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78167 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
b890f04174d52e41db19b883244abb17a3254ef1 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix a comment that trailed off

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78167 91177308-0d34-0410-b5e6-96231b3b80d8
anonicalType.h
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.h
anonicalType.h
eclarationName.h
ype.h
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.h
anonicalType.h
eclarationName.h
ype.h
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.h
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.h
841324a33cb8dd0868bd3102f5ba0b4f10dddf0f 04-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor template instantiation for types into a generic tree
transformation template (TreeTransform) that handles the
transformation and reconstruction of AST nodes. Template instantiation
for types is a (relatively small) customization of the generic tree
transformation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78071 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.h
577f75a7498e9e2536434da0ef0da0eea390d18b 04-Aug-2009 Douglas Gregor <dgregor@apple.com> Refactor template instantiation for types into a generic tree
transformation template (TreeTransform) that handles the
transformation and reconstruction of AST nodes. Template instantiation
for types is a (relatively small) customization of the generic tree
transformation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78071 91177308-0d34-0410-b5e6-96231b3b80d8
emplateName.h
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.h
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.h
1ecbf595ee2f85e3c2bc960193c994041cc053ab 02-Aug-2009 Anders Carlsson <andersca@mac.com> Use the correct cast kind for dynamic_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77905 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
714179b179a31a0c3769a968ee18ba87b901b13f 02-Aug-2009 Anders Carlsson <andersca@mac.com> Use the correct cast kind for dynamic_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77905 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d067278002fa1cf2e4999da5df9e9e0d23d08ae6 31-Jul-2009 Mike Stump <mrs@apple.com> And now we can generate a simple vtable. Still a work in progress...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77737 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
82b56961dcb813674dbda3c5f5aaee703d55741c 31-Jul-2009 Mike Stump <mrs@apple.com> And now we can generate a simple vtable. Still a work in progress...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77737 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
1d680aeba651b7bf2f31b44e45f751d57a5b7a9e 31-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix 80-col violation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77683 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
78b89b0ef7f3803cd31df3656f9536bfd6f0dd48 31-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix 80-col violation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77683 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
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.h
ype.h
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.h
ype.h
851869475d149002c1ee0ec6cafab37fb645aea8 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add CK_DerivedToBase and use it PerformObjectMemberConversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
3503d041ca8a3535a1c1a30005a6b18ae7aed5db 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add CK_DerivedToBase and use it PerformObjectMemberConversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77652 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7ef181c5df246e133e86b97e684f650decc67e37 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
cdef2b75aa60cde1ca00e0aa3f89139ac89c6ae4 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
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.h
ype.h
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.h
ype.h
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.h
ype.h
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.h
ype.h
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.h
ype.h
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.h
ype.h
36a0ec0ea2597d051d6048c623b3885f37ab89a3 30-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for future ir-gen for destructor calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77608 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
426cc3828ce07a2cff15c9837f5958e6fc4b7739 30-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for future ir-gen for destructor calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77608 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclTemplate.h
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
eclTemplate.h
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
ecordLayout.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
ecordLayout.h
66d14cf34f847b632a6aa479871751235e3298a9 30-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Add ObjCMethodDecl::isThisDeclarationADefinition().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77544 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
66570b230941651245accbc5680b60e904eb993c 30-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ObjCMethodDecl::isThisDeclarationADefinition().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77544 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
eclCXX.h
eclTemplate.h
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.h
eclCXX.h
eclTemplate.h
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
xprCXX.h
ype.h
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
xprCXX.h
ype.h
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.h
emplateName.h
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.h
emplateName.h
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
eclTemplate.h
ype.h
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
eclTemplate.h
ype.h
bbe4f96aaf32fad56812cec2f536256a6554209f 29-Jul-2009 Steve Naroff <snaroff@apple.com> Incorporate feedback from Chris (on r76979).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77452 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
99b10be143e3148b9499af4c0e9ebaf46757cfe6 29-Jul-2009 Steve Naroff <snaroff@apple.com> Incorporate feedback from Chris (on r76979).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77452 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
827f93d0d67a9fd2e35119196a6a4b67ca943b4a 28-Jul-2009 Mike Stump <mrs@apple.com> Update comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77355 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
8fad9941a635a42ee644e7396ca84cbaaa5c1b6e 28-Jul-2009 Mike Stump <mrs@apple.com> Update comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77355 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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
ecordLayout.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
ecordLayout.h
fda7da669298c7428a1c963013d9a8c71cbedbc5 28-Jul-2009 John McCall <rjmccall@apple.com> Bounds checking for address spaces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77303 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
efadb7768e7c7418185f5a4010ecd8b21ca9731b 28-Jul-2009 John McCall <rjmccall@apple.com> Bounds checking for address spaces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77303 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
065e8c860559b117e8a32181d1f2e15d8c249722 28-Jul-2009 John McCall <rjmccall@apple.com> Allow functions to be marked "implicit return zero" and so mark main().
Codegen by initializing the return value with its LLVM type's null value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77288 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0cfeb63f532973777f6fe75d3468c3acad4adfe3 28-Jul-2009 John McCall <rjmccall@apple.com> Allow functions to be marked "implicit return zero" and so mark main().
Codegen by initializing the return value with its LLVM type's null value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77288 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
xpr.h
tmt.h
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
xpr.h
tmt.h
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
eclBase.h
eclNodes.def
eclObjC.h
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
eclBase.h
eclNodes.def
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
0f95d329cc0ba37faa0f3d522991a581a407482c 26-Jul-2009 Mike Stump <mrs@apple.com> Improve comments (Thanks Fariborz).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ae92140b542d5c1c096e39e74e59526184819b30 26-Jul-2009 Mike Stump <mrs@apple.com> Improve comments (Thanks Fariborz).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ype.h
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.h
ype.h
d484def4535a53f2ecfaf28410727773cb01c8da 25-Jul-2009 John McCall <rjmccall@apple.com> Flesh out the QualifierSet API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77046 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
8fceb57f6980c67bb8f12e29d75736cf057951e8 25-Jul-2009 John McCall <rjmccall@apple.com> Flesh out the QualifierSet API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77046 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ecl.h
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.h
ecl.h
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.h
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.h
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
xprObjC.h
tmtNodes.def
ype.h
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
xprObjC.h
tmtNodes.def
ype.h
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.h
xprCXX.h
ype.h
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.h
xprCXX.h
ype.h
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.h
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.h
234e410417536afad6519b6e37b9305c656a7dd8 23-Jul-2009 Ted Kremenek <kremenek@apple.com> Add instance predicate method to match static method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76832 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a4e70568ae8902d48aad215c16b0fc8b40308106 23-Jul-2009 Ted Kremenek <kremenek@apple.com> Add instance predicate method to match static method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76832 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
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
ype.h
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
ype.h
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.h
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.h
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.h
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.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
467a23c408c93a9c92e65fe1d99146c3c82c8e93 21-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Add an assertion for the return value of Decl::getNextRedeclaration().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76511 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
22cbd2b794676c3b29c2b401c26730ed7047809e 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add an assertion for the return value of Decl::getNextRedeclaration().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76511 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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.h
eclObjC.h
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.h
eclObjC.h
9c2aefb2845f600a09a8046072bae296d8eff565 21-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Reuse VarDecl::Init to store the default argument of a ParmVarDecl,
reducing the size of ParmVarDecl by one pointer. Also means that we'll
properly (de-)serialize default arguments in C++ PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76487 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
75f1af02091235a21180cf22ac9f7dd0025577f6 21-Jul-2009 Douglas Gregor <dgregor@apple.com> Reuse VarDecl::Init to store the default argument of a ParmVarDecl,
reducing the size of ParmVarDecl by one pointer. Also means that we'll
properly (de-)serialize default arguments in C++ PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76487 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.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
ecordLayout.h
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
ecordLayout.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
ecordLayout.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
ecordLayout.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
ecordLayout.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
STRecordLayout.h
ecordLayout.h
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
STRecordLayout.h
ecordLayout.h
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
efece9a9f7d61b7892dd1370a97429114b1eb5e2 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76299 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
ac4e3794c60fc194fb2bd9764aa81d4cae530ecc 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76299 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
eclBase.h
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.h
eclBase.h
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.h
edeclarable.h
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.h
edeclarable.h
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.h
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.h
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.h
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.h
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
ecl.h
eclBase.h
eclTemplate.h
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
ecl.h
eclBase.h
eclTemplate.h
c5c807c17608381e6019f714fe594a49ee9cc955 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76269 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a2e85ada1dfef36201a31f6646bc4ea3bd76a89a 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76269 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f856701d5116b235e2ea551f81212dab24cfa0d4 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Add getSourceRange() methods for ObjC Decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76267 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ddfd4c9eda34765b08fae4cb31ad5a365face107 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add getSourceRange() methods for ObjC Decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76267 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
xprCXX.h
ype.h
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
xprCXX.h
ype.h
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.h
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.h
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
ype.h
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
ype.h
8a9cddd2edc7f89ebba24b63435fcb62769614f5 17-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> ObjCCategoryImplDecl and ObjCImplementation do not derive directly from DeclContext but from a new abstract ObjCImplDecl.
Reflect this change on the "DeclContext hierarchy".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76137 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclNodes.def
eclObjC.h
bfb498d0996ef049efe9476f2802976fd145cd60 17-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> ObjCCategoryImplDecl and ObjCImplementation do not derive directly from DeclContext but from a new abstract ObjCImplDecl.
Reflect this change on the "DeclContext hierarchy".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76137 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclNodes.def
eclObjC.h
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
ype.h
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
ype.h
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
xprCXX.h
ype.h
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
xprCXX.h
ype.h
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.h
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.h
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
ype.h
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
ype.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
578a5f91b5d5d58d61b2896c88bcf3baca29964e 15-Jul-2009 Steve Naroff <snaroff@apple.com> Remove default argument, since it isn't being used (suggested by Fariborz).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75815 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
c02397509bb4057f3a7d6f5f4d764d122ed2381f 15-Jul-2009 Steve Naroff <snaroff@apple.com> Remove default argument, since it isn't being used (suggested by Fariborz).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75815 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
9f324ae90f87c56d3c1fc87b27bb9b6ebdf277b0 15-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "t".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75810 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f6265efe7e35fb0fba315da6391368aeee1e57c9 15-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "t".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75810 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
ype.h
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.h
ype.h
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
ype.h
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
ype.h
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
STRecordLayout.h
ecordLayout.h
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
STRecordLayout.h
ecordLayout.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
xprCXX.h
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.h
xprCXX.h
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.h
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.h
898111463b64a26d55af56474ad8cca1fdb76268 13-Jul-2009 Steve Naroff <snaroff@apple.com> - Improve comment for Type::getPointeeType().
- Remove a couple redundant casts/returns.
- Fix 80 column violations for all getAsStringInternal() methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75485 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f8910df57799256c1897a8610dc52685729ae90e 13-Jul-2009 Steve Naroff <snaroff@apple.com> - Improve comment for Type::getPointeeType().
- Remove a couple redundant casts/returns.
- Fix 80 column violations for all getAsStringInternal() methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75485 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
198e8e46d0bfe535f044df35d1b87da86a148a84 13-Jul-2009 Daniel Dunbar <daniel@zuster.org> Match declaration to definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75439 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
emplateName.h
ype.h
3b4ea54acf01f72f6eb74d96689dda86d950228f 13-Jul-2009 Daniel Dunbar <daniel@zuster.org> Match declaration to definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75439 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
emplateName.h
ype.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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
ype.h
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
ype.h
4e8d569581255e2749e578cf357dc58630ce4ebc 09-Jul-2009 Anders Carlsson <andersca@mac.com> Store the isAddressOfOperand in the UnresolvedDeclRefExpr, so that we can pass it when instantiating the expr. Fixes another member pointer bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75075 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
9b31df4acdeeb61bb084a03fc37bc5bd570a659e 09-Jul-2009 Anders Carlsson <andersca@mac.com> Store the isAddressOfOperand in the UnresolvedDeclRefExpr, so that we can pass it when instantiating the expr. Fixes another member pointer bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75075 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
33b1a9542bf9dbe0e0fc6b9b7a0b404ac4a1777e 08-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Initialize the ConstantArraySizeAsWritten field of PrintingPolicy class.

It contained garbage since the constructor didn't initialize it and caused test/Sema/array-constraint.c to randomly fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74989 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
bbb3128b449b6c5e7822e8b781445e348a9117dc 08-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initialize the ConstantArraySizeAsWritten field of PrintingPolicy class.

It contained garbage since the constructor didn't initialize it and caused test/Sema/array-constraint.c to randomly fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74989 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
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.h
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.h
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
ype.h
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
ype.h
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.h
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.h
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.h
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.h
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.h
eclReferenceMap.h
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.h
eclReferenceMap.h
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.h
STNode.h
eclReferenceMap.h
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.h
STNode.h
eclReferenceMap.h
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.h
rettyPrinter.h
ype.h
ypeNodes.def
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.h
rettyPrinter.h
ype.h
ypeNodes.def
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
eclReferenceMap.h
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
eclReferenceMap.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
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.h
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.h
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.h
xternalASTSource.h
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.h
xternalASTSource.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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
ecl.h
eclBase.h
eclObjC.h
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
ecl.h
eclBase.h
eclObjC.h
89e4c0af9fd45f9107a599e6cf104a3d30c2e9ed 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce DeclContext::getParentASTContext().

It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74505 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
048f30a483ca352ee7f235a5be181b9dcc5f9d9c 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce DeclContext::getParentASTContext().

It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74505 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
eclBase.h
eclObjC.h
xpr.h
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.h
eclBase.h
eclObjC.h
xpr.h
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
eclBase.h
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
eclBase.h
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
eclBase.h
xpr.h
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
eclBase.h
xpr.h
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
FG.h
estedNameSpecifier.h
rettyPrinter.h
tmt.h
ype.h
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
FG.h
estedNameSpecifier.h
rettyPrinter.h
tmt.h
ype.h
4b61ba63888136f05791f8e47172927451c6a9f3 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Take care of Chris's comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74486 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
16dbdce02366c372fe934c0528148fc38906f21a 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Take care of Chris's comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74486 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
4e0aba8010d63c1d6bcd9770088864b9c0cc0751 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose multiple initialzation of data-member/base
in the ctor-initializer list. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74465 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
7881a0565893f1da6faafbd86377f5b50e4376a5 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose multiple initialzation of data-member/base
in the ctor-initializer list. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74465 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
ecl.h
eclTemplate.h
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
ecl.h
eclTemplate.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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.h
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.h
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.h
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.h
ad538e5150e7248e49066e917db2620bd8af8825 26-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Template argument deduction is no longer responsible for checking
non-dependent parameter types. Instead, class template partial
specializations perform a final check of all of the instantiated
arguments. This model is cleaner, and works better for function
templates where the "final check" occurs during overload resolution.

Also, cope with cv-qualifiers when the parameter type was originally a
reference type, so that the deduced argument can be more qualified
than the transformed argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74323 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
f670c8cfa58b4c224eb8fb566130dc47844dd3de 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Template argument deduction is no longer responsible for checking
non-dependent parameter types. Instead, class template partial
specializations perform a final check of all of the instantiated
arguments. This model is cleaner, and works better for function
templates where the "final check" occurs during overload resolution.

Also, cope with cv-qualifiers when the parameter type was originally a
reference type, so that the deduced argument can be more qualified
than the transformed argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74323 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
ype.h
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.h
ype.h
607021675efc13cdaa93bbe22fa4526307d48cd3 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support: attributes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74280 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
6f3d838867538638b9bbf412028e8537ae12f3e5 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support: attributes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74280 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
eclTemplate.h
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.h
eclTemplate.h
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
eclBase.h
eclCXX.h
eclTemplate.h
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
eclBase.h
eclCXX.h
eclTemplate.h
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
ype.h
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
ype.h
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
4571d8171bac6b734fbfab217db433a1605d6b61 24-Jun-2009 Anders Carlsson <andersca@mac.com> [class.local] p1 and p3. Also, add back the xcodeproj file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74027 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
e41590d2504d73453d58f22e9176088990555cc1 24-Jun-2009 Anders Carlsson <andersca@mac.com> [class.local] p1 and p3. Also, add back the xcodeproj file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74027 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
8915a3dcd08b890239dc943d38892183f570da20 22-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Remove ImplicitMustBeDefined, use universal 'Used' flag
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73888 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
b7f4cc09ead099c1306d06db53e258d648d0f652 22-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Remove ImplicitMustBeDefined, use universal 'Used' flag
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73888 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
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
xprObjC.h
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
xprObjC.h
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.h
eclBase.h
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.h
eclBase.h
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.h
eclCXX.h
eclNodes.def
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.h
eclCXX.h
eclNodes.def
981892622a7fbb6d0e7eb7759ed7e8039e46bef9 20-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
e0762c92110dfdcdd207db461a4ea17afd168f1e 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
89942a084af119f82b4e99adde48afef1561f8ce 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use QualType to represent block's implicit return type as
to not lose its 'const/volatile' qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73795 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7d5c74ecbbd8719436c071f38657bc8e97ee4a24 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use QualType to represent block's implicit return type as
to not lose its 'const/volatile' qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73795 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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.h
ecl.h
eclBase.h
xpr.h
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.h
ecl.h
eclBase.h
xpr.h
38bc2b568f9a179119f196f7bcebd87b37c6355e 18-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73651 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclCXX.h
f5cecfbdcd20be224861f9e67c5973a9a2b61512 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73651 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclCXX.h
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
7739d8407b317ad76645a3d06419ca508c5090e7 17-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Added missing @endcode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73629 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
54481f194b6ac5c49f9220ca8d4f9f38d4d53c86 17-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Added missing @endcode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73629 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
5a95923ba25c50c96348bb7d2e45ca121c76736f 17-Jun-2009 Anders Carlsson <andersca@mac.com> Remove all non-const getters from TemplateArgumentList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73589 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
6f10d48b7da44da324247ddbf54e2ddda8e22dd3 17-Jun-2009 Anders Carlsson <andersca@mac.com> Remove all non-const getters from TemplateArgumentList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73589 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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.h
ype.h
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.h
ype.h
84802eb7168db69179f7fa73aa45bfee0be66104 15-Jun-2009 Anders Carlsson <andersca@mac.com> Include <limits>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73403 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
3f3ce82674b44a58a2af7d90feb55acd906dd762 15-Jun-2009 Anders Carlsson <andersca@mac.com> Include <limits>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73403 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
86e20d021b955f83db4494ef577f045560b97864 15-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> More XML output support, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73402 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
038f75abf5abd1e35736dd5c751ba20df1158aaa 15-Jun-2009 Douglas Gregor <dgregor@apple.com> More XML output support, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73402 91177308-0d34-0410-b5e6-96231b3b80d8
ypeVisitor.h
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.h
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.h
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.h
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.h
95d6c95238d03080803549be81139f03a098016e 14-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Update LLVM.

Implement support for C++ Substitution Failure Is Not An Error
(SFINAE), which says that errors that occur during template argument
deduction do *not* produce diagnostics and do not necessarily make a
program ill-formed. Instead, template argument deduction silently
fails. This is currently implemented for template argument deduction
during matching of class template partial specializations, although
the mechanism will also apply to template argument deduction for
function templates. The scheme is simple:

- If we are in a template argument deduction context, any diagnostic
that is considered a SFINAE error (or warning) will be
suppressed. The error will be propagated up the call stack via the
normal means.
- By default, all warnings and errors are SFINAE errors. Add the
NoSFINAE class to a diagnostic in the .td file to make it a hard
error (e.g., for access-control violations).

Note that, to make this fully work, every place in Sema that emits an
error *and then immediately recovers* will need to check
Sema::isSFINAEContext() to determine whether it must immediately
return an error rather than recovering.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73332 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
5e9f35c7cb61aea46f56d46c77cbcf47c0cf28ba 14-Jun-2009 Douglas Gregor <dgregor@apple.com> Update LLVM.

Implement support for C++ Substitution Failure Is Not An Error
(SFINAE), which says that errors that occur during template argument
deduction do *not* produce diagnostics and do not necessarily make a
program ill-formed. Instead, template argument deduction silently
fails. This is currently implemented for template argument deduction
during matching of class template partial specializations, although
the mechanism will also apply to template argument deduction for
function templates. The scheme is simple:

- If we are in a template argument deduction context, any diagnostic
that is considered a SFINAE error (or warning) will be
suppressed. The error will be propagated up the call stack via the
normal means.
- By default, all warnings and errors are SFINAE errors. Add the
NoSFINAE class to a diagnostic in the .td file to make it a hard
error (e.g., for access-control violations).

Note that, to make this fully work, every place in Sema that emits an
error *and then immediately recovers* will need to check
Sema::isSFINAEContext() to determine whether it must immediately
return an error rather than recovering.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73332 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
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.h
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
STContext.h
uiltins.def
uiltins.h
PCBuiltins.def
argetBuiltins.h
86Builtins.def
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
STContext.h
uiltins.def
uiltins.h
PCBuiltins.def
argetBuiltins.h
86Builtins.def
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.h
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.h
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.h
uiltins.h
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.h
uiltins.h
81cb862d85f9e46753a01d12cf46e0604ee184b5 13-Jun-2009 Chris Lattner <sabre@nondot.org> declare an 'operator delete' to match operator new, this avoids many many
warnings when building with VC++, patch by AlisdairM!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73305 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
9509108b3dde280dca1999b5c054f5b789581e68 13-Jun-2009 Chris Lattner <sabre@nondot.org> declare an 'operator delete' to match operator new, this avoids many many
warnings when building with VC++, patch by AlisdairM!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73305 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
13fac3fcba7f8ad212cefb9a2a784c72a6cb3c74 13-Jun-2009 Anders Carlsson <andersca@mac.com> Have CheckClassTemplatePartialSpecializationArgs take a TemplateArgumentListBuilder. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73297 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
6360be748e494d35784834d39b2c2bc6cd187d0c 13-Jun-2009 Anders Carlsson <andersca@mac.com> Have CheckClassTemplatePartialSpecializationArgs take a TemplateArgumentListBuilder. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73297 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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.h
eclTemplate.h
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.h
eclTemplate.h
0485d88ad80aec19d42e079659f2ccf7a636b791 13-Jun-2009 Chris Lattner <sabre@nondot.org> add the location of the ')' in a do/while statement to DoStmt.
This fixes a source range problem reported by Olaf Krzikalla.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73266 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
989135901c750af61ef012b6b0a0368be415bc46 13-Jun-2009 Chris Lattner <sabre@nondot.org> add the location of the ')' in a do/while statement to DoStmt.
This fixes a source range problem reported by Olaf Krzikalla.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73266 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
eclTemplate.h
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
eclTemplate.h
623e2e07723aeb17b86146036f0ddec2a70fb93a 12-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Improve template argument deduction to keep track of why template
argument deduction failed. For example, given

template<typename T> struct is_same<T, T> { ... };

template argument deduction will fail for is_same<int, float>, and now
reports enough information

Right now, we don't do anything with this extra information, but it
can be used for informative diagnostics that say, e.g., "template
argument deduction failed because T was deduced to 'int' in one
context and 'float' in another".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73237 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
f67875d5addf36b951ad37fb04509ab2b572c88a 12-Jun-2009 Douglas Gregor <dgregor@apple.com> Improve template argument deduction to keep track of why template
argument deduction failed. For example, given

template<typename T> struct is_same<T, T> { ... };

template argument deduction will fail for is_same<int, float>, and now
reports enough information

Right now, we don't do anything with this extra information, but it
can be used for informative diagnostics that say, e.g., "template
argument deduction failed because T was deduced to 'int' in one
context and 'float' in another".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73237 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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
xprObjC.h
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
xprObjC.h
7e2e967f7df16c8f9b3cf75ff243765dc7d8ad3a 07-Jun-2009 Anders Carlsson <andersca@mac.com> Template instantiation support for Obj-C @encode expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73034 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
fc0f021b492cf28ee7b3a6bd4445ae569e6f15de 07-Jun-2009 Anders Carlsson <andersca@mac.com> Template instantiation support for Obj-C @encode expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73034 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
79488fc6abfbe7dba27b9bd924048904840d3cc0 07-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Remove a few more vector builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73022 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
8fff25719eb9363ac197ac4b375699a9afe9d36d 07-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Remove a few more vector builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73022 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
8faaf944d56cb82000a7378eae1fc4d466f35207 07-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Now that LLVM CodeGen can handle the generic variations a bit better,
get rid of a few more clang vector builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73015 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
e0ae8bdadc4fef56db7f0e3336d0379a89eb462f 07-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Now that LLVM CodeGen can handle the generic variations a bit better,
get rid of a few more clang vector builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73015 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
cac5494abf318f05bbf2355df0f7eff0ff999341 06-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of a bunch of dead builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72996 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
a311be7ddb3f6d732fce2ea09c8ffbeabaa94984 06-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of a bunch of dead builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72996 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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.h
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.h
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.h
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.h
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.h
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.h
17e7b22caa9f6688c9ba2622ed02dfe7efda5644 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR3443: Add stpcpy builtin (plus a few other related builtins). Yes,
we're still missing a mechanism to disable these in strict mode, but
that's not a new issue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72936 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
c292b22a64682050b2b16fced68dd3784f3e4fb9 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR3443: Add stpcpy builtin (plus a few other related builtins). Yes,
we're still missing a mechanism to disable these in strict mode, but
that's not a new issue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72936 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
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.h
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.h
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.h
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.h
a35faf97e36ffb4974f3f5f3ee6182fbbd9172c7 05-Jun-2009 Anders Carlsson <andersca@mac.com> Add a helper class for building template argument lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72915 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
1c5976e5e933c0d74f7e04e8f907a93f5edbfec1 05-Jun-2009 Anders Carlsson <andersca@mac.com> Add a helper class for building template argument lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72915 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
ab9f71a3121ae99e85e09a34a8a35824d0ba0694 05-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Several improvements to template argument deduction:
- Once we have deduced template arguments for a class template partial
specialization, we use exactly those template arguments for instantiating
the definition of the class template partial specialization.
- Added template argument deduction for non-type template parameters.
- Added template argument deduction for dependently-sized array types.

With these changes, we can now implement, e.g., the remove_reference
type trait. Also, Daniel's Ackermann template metaprogram now compiles
properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72909 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
199d99192fbcca9f043596c40ead4afab4999dba 05-Jun-2009 Douglas Gregor <dgregor@apple.com> Several improvements to template argument deduction:
- Once we have deduced template arguments for a class template partial
specialization, we use exactly those template arguments for instantiating
the definition of the class template partial specialization.
- Added template argument deduction for non-type template parameters.
- Added template argument deduction for dependently-sized array types.

With these changes, we can now implement, e.g., the remove_reference
type trait. Also, Daniel's Ackermann template metaprogram now compiles
properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72909 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
69d7d6fc461240866c4c6882a44123cc69cb5f7f 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Clean up builtin lists, add a few new builtins. (I re-sorted the
string.h builtins to be in the same order as the list in the C99
standard.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72882 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
0b308ad34ffb29e508b681b155696f8f999532bb 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Clean up builtin lists, add a few new builtins. (I re-sorted the
string.h builtins to be in the same order as the list in the C99
standard.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72882 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
bf23a8a69def861809aaa2e0adb35be3920cacea 04-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> When performing template argument deduction, ensure that multiple
deductions of the same template parameter are equivalent. This allows
us to implement the is_same type trait (!).

Also, move template argument deduction into its own file and update a
few build systems with this change (grrrr).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72819 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
0b9247f129401b4849682b2e2bcdea8fc977068a 04-Jun-2009 Douglas Gregor <dgregor@apple.com> When performing template argument deduction, ensure that multiple
deductions of the same template parameter are equivalent. This allows
us to implement the is_same type trait (!).

Also, move template argument deduction into its own file and update a
few build systems with this change (grrrr).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72819 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
1afe09b9b5ba10f250b0ba734a992518f8f9bdfb 03-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4290: Handle vfprintf in a way that doesn't give any diagnostics for
valid declarations and doesn't give an error for autoconf-style invalid
redeclarations. This isn't quite ideal, but I don't see any other way
easy way to handle it. (The only thing I can think of that's reasonably
general is adding a new builtin type FILETy which is only compatible
with a type equivalent to FILE, and that seems like overkill.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72760 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
c4db24a96d062b2d3fb1f46c28a75ed728b00030 03-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4290: Handle vfprintf in a way that doesn't give any diagnostics for
valid declarations and doesn't give an error for autoconf-style invalid
redeclarations. This isn't quite ideal, but I don't see any other way
easy way to handle it. (The only thing I can think of that's reasonably
general is adding a new builtin type FILETy which is only compatible
with a type equivalent to FILE, and that seems like overkill.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72760 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
97d7a93bcfda52995a5f94ebd6dcbea570c54685 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Missing file for __builtin_unwind_init support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72728 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
05b65ef3fbcc4b82e9a6527d92efc5f9fbdfa916 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Missing file for __builtin_unwind_init support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72728 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
6a3cb5fc4e59f0e8e2e69891a4f29e9babe0499d 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Add builtin declarations for the variants of sin and cos.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72718 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
0efa68487696d3cd8ae2f8207e4bfb5995d44951 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Add builtin declarations for the variants of sin and cos.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72718 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
ac5e9f9de0959d5b1d390dc9bdad2d6f3d77c5cb 01-Jun-2009 Anders Carlsson <andersca@mac.com> Fix a bug in hasEmptyExceptionSpec. (Thanks Sebastian for noticing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72691 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a12823f6c0ec9e0e644a9d0ee153e973f49c63fc 01-Jun-2009 Anders Carlsson <andersca@mac.com> Fix a bug in hasEmptyExceptionSpec. (Thanks Sebastian for noticing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72691 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
11269048f03d91e991150c429dc874ae3999acb0 31-May-2009 Anders Carlsson <andersca@mac.com> Improve irgen of 'new' further.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72677 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d3fd6bad1249d3f34d71b73e2333fab0db51cce4 31-May-2009 Anders Carlsson <andersca@mac.com> Improve irgen of 'new' further.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72677 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
eclCXX.h
eclNodes.def
eclTemplate.h
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
eclCXX.h
eclNodes.def
eclTemplate.h
9da59ae5fe60ad4b75251a8ca75c660826a24d23 31-May-2009 Anders Carlsson <andersca@mac.com> Add more getters to the new AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72651 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
f0721fe438d7e40c168e5d664970e7830bc138fb 31-May-2009 Anders Carlsson <andersca@mac.com> Add more getters to the new AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72651 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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
eclCXX.h
eclNodes.def
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
eclCXX.h
eclNodes.def
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.h
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.h
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.h
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.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
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.h
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.h
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.h
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.h
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.h
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
tmt.h
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
tmt.h
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
eclBase.h
rettyPrinter.h
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
eclBase.h
rettyPrinter.h
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.h
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.h
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
eclBase.h
rettyPrinter.h
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
eclBase.h
rettyPrinter.h
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.h
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.h
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.h
estedNameSpecifier.h
rettyPrinter.h
tmt.h
emplateName.h
ype.h
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.h
estedNameSpecifier.h
rettyPrinter.h
tmt.h
emplateName.h
ype.h
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.h
eclBase.h
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.h
eclBase.h
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.h
ype.h
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.h
ype.h
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
ecordLayout.h
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
ecordLayout.h
8d71743661227dd7a938d217ae28c55f2b7c1abf 27-May-2009 Douglas Gregor <doug.gregor@gmail.com> Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72482 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8dbc3c64965f99e48830885835b7d2fc26ec3cf5 27-May-2009 Douglas Gregor <dgregor@apple.com> Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72482 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ype.h
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
ype.h
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.h
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.h
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.h
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.h
0a4b3e5e61988bbd23a418f8c5d7aa3bda174ba0 26-May-2009 Anders Carlsson <andersca@mac.com> Remove a bunch of unused constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72407 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprObjC.h
tmtObjC.h
e9263729b701cb02201907c6942cada72d5eefbf 26-May-2009 Anders Carlsson <andersca@mac.com> Remove a bunch of unused constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72407 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprObjC.h
tmtObjC.h
4cb1cce4045851f6ebfbb6cb7262dee9b313698c 23-May-2009 Ted Kremenek <kremenek@apple.com> Use 'Exprs.data()' instead of 'Exprs.empty() ? NULL : ...'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72304 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
15dffd863b4d8f6f7b04b5c80566ea3531a14f41 23-May-2009 Ted Kremenek <kremenek@apple.com> Use 'Exprs.data()' instead of 'Exprs.empty() ? NULL : ...'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72304 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8b6324149527bd141346c88b87560775c1514e7b 23-May-2009 Douglas Gregor <doug.gregor@gmail.com> Fix the parent classes in TypeNodes.def, from Olaf Krzikalla

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72293 91177308-0d34-0410-b5e6-96231b3b80d8
ypeNodes.def
02fd8ddba96a529c5868162a13f7bb2c5e36d522 23-May-2009 Douglas Gregor <dgregor@apple.com> Fix the parent classes in TypeNodes.def, from Olaf Krzikalla

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72293 91177308-0d34-0410-b5e6-96231b3b80d8
ypeNodes.def
dcd7a7af67970771e691c49805c7e55e5721f5ba 23-May-2009 Ted Kremenek <kremenek@apple.com> Modify begin()/end() for AsmStmt iterators to handle the case when Exprs.empty()
is true. Because of recent changes to llvm::SmallVector, using these iterators
when Exprs was empty would cause an assertion failure.

This fixes: PR 4245.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72286 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d59a5bd0ab7821a643c540df8c84c70fef76a1c2 23-May-2009 Ted Kremenek <kremenek@apple.com> Modify begin()/end() for AsmStmt iterators to handle the case when Exprs.empty()
is true. Because of recent changes to llvm::SmallVector, using these iterators
when Exprs was empty would cause an assertion failure.

This fixes: PR 4245.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72286 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
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.h
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.h
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.h
c378232fae7e00cd6cd43af493c219e769fc316a 21-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for C++ throw expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72217 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
42e5b50f4dc897f252e0d476063a7f9846d96624 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ throw expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72217 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
306d7251d0fe8749f2a6a8cb67546830be520f0c 20-May-2009 Fariborz Jahanian <fjahanian@apple.com> implementation of format_arg for ObjC methods/functions.
Still more to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72173 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
5b160927672440076aa53c31d84149f70fd8d40e 20-May-2009 Fariborz Jahanian <fjahanian@apple.com> implementation of format_arg for ObjC methods/functions.
Still more to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72173 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
110536d7d0a3f15ce50fb93800718d9311a42cf7 20-May-2009 Anders Carlsson <andersca@mac.com> Create a temporary if the lvalue is a bitfield. Reported by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72155 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
38d068e8f13a119b89a3b8b0f79f35cab1ffd09a 20-May-2009 Anders Carlsson <andersca@mac.com> Create a temporary if the lvalue is a bitfield. Reported by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72155 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b4245188f28d3942f42380a803755acabe4f3aec 19-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for __builtin_types_compatible_p.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72134 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
dc241b42c7588f99027b035a09b71557a6db219e 19-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for __builtin_types_compatible_p.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72134 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e0513a3d92d53cd06fe37b48a31b5b86d63b8ed6 19-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for cast expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72119 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
a3a7b8eea87c90a5a257f685749222b212ddaf36 19-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for cast expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72119 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
536f73dd0285c8830454234935df46c8a715e07d 19-May-2009 Fariborz Jahanian <fjahanian@apple.com> Patch finishes off application of printf attribute on blocks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72111 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d66f22d9f8423579322a6dd16587ed52b0a58834 19-May-2009 Fariborz Jahanian <fjahanian@apple.com> Patch finishes off application of printf attribute on blocks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72111 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
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
tmtCXX.h
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
tmtCXX.h
2c82f46840555ba0ced3abaa22d526b6a2c5a2d7 18-May-2009 Anders Carlsson <andersca@mac.com> Remove an unused builtin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72033 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
409bf46742e2f38b2f4cec53c86b109bed42840d 18-May-2009 Anders Carlsson <andersca@mac.com> Remove an unused builtin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72033 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
d657fd86fc1c4de8e7ca9f2670796f3713c1c1be 18-May-2009 Anders Carlsson <andersca@mac.com> Add 'cmp' SSE builtins and get rid of a bunch of other builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72032 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
79dcf5f96ad75259867d19bbf69512f320032fce 18-May-2009 Anders Carlsson <andersca@mac.com> Add 'cmp' SSE builtins and get rid of a bunch of other builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72032 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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.h
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.h
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.h
xprCXX.h
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.h
xprCXX.h
83df82a4b8272c846b2b24350784793b57f8f561 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for IndirectGotoStmt. Now my life is complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71917 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5f1b9e689fa5c101512aef99225f2afea1673449 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for IndirectGotoStmt. Now my life is complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71917 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
34712db615418b178dff09ba45112bc44c4e1993 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for switch statements


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71916 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
dbb26db1d426fb6caaaf1b4fa47b46d1947c12c9 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for switch statements


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71916 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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.h
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.h
821a2a4a652b423d422fa3ea44f8d24165c38f59 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce the EXPR macro into StmtNodes.def, so that we can
distinguish between expression and statement nodes. No functionality
change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71902 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
20ecb9eec281184cfb2c7110b2f6d86fa446761f 16-May-2009 Douglas Gregor <dgregor@apple.com> Introduce the EXPR macro into StmtNodes.def, so that we can
distinguish between expression and statement nodes. No functionality
change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71902 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
1401330b1c620dd8e14af4e2c1b1589cf68dc2c3 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for "for" loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71901 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5831c6a1efc47e6a19d82fe3dd25b5b8fef6979d 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for "for" loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71901 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ef482764777252110a1095e7f5b7a300ccb26d4e 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for do-while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71899 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
9f3ca2a7747bd47f14d7693f333103fac29a24d2 15-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for do-while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71899 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
cbe3be67e42644ed596a4cc4444ea0cae48b39e6 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for WhileStmt and CXXConditionDeclExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71896 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
4a2e2041edc63db687677325e113b39b9d123c40 15-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for WhileStmt and CXXConditionDeclExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71896 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
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.h
30033494eab58aefa22eb275c00ef458b8e6a538 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for "if" statements. Also:

- Skip semantic analysis of the "if" condition if it is type-dependent.
- Added the location of the "else" keyword into IfStmt, so that we can
provide it for type-checking after template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71875 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d06f6ca61062f85926eb9d409eb3d4f8afcf93c7 15-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for "if" statements. Also:

- Skip semantic analysis of the "if" condition if it is type-dependent.
- Added the location of the "else" keyword into IfStmt, so that we can
provide it for type-checking after template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71875 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
f98556020bc7f248ac17c9804e4e5af1a636f514 15-May-2009 Anders Carlsson <andersca@mac.com> Check that the function being overridden is virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
77b7f1d4fb782c9152f91b76f9f8b1d1af21bd35 15-May-2009 Anders Carlsson <andersca@mac.com> Check that the function being overridden is virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
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.h
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.h
260059cab5bab4960880bc9155b32618201d7994 14-May-2009 Douglas Gregor <doug.gregor@gmail.com> Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71792 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
1eee0e753fb390b04848846e837714ec774b7bfd 14-May-2009 Douglas Gregor <dgregor@apple.com> Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71792 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
180f341a528dd5608704b40de48620720e6a9dc7 13-May-2009 Fariborz Jahanian <fjahanian@apple.com> Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71683 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
5b53005fb9ef24b8bdfe995f29b4662de468128a 13-May-2009 Fariborz Jahanian <fjahanian@apple.com> Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71683 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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.h
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.h
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
eclCXX.h
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
eclCXX.h
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.h
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.h
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.h
ecl.h
eclTemplate.h
ype.h
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.h
ecl.h
eclTemplate.h
ype.h
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.h
xprCXX.h
tmtNodes.def
ype.h
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.h
xprCXX.h
tmtNodes.def
ype.h
13ddd1af28133402e076d9d446f4f21152fe92fa 09-May-2009 Ted Kremenek <kremenek@apple.com> Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
b71368d28532908ae1c2dc23f91761781205b3d0 09-May-2009 Ted Kremenek <kremenek@apple.com> Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
f084b0ae1f63ac979e9472bf1e320e27b813e4f4 08-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental ownership attributes from Clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71216 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
008fc73ac971e5d30c8710e37e1f5f8a843052f1 08-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental ownership attributes from Clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71216 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
822adfe2333425ef0c6233d82ca99154eee6f168 08-May-2009 Chris Lattner <sabre@nondot.org> reimplement __sync_* builtins to be variadic and to follow the same
semantic rules that gcc and icc use. This implements the variadic
and concrete versions as builtins and has sema do the
disambiguation. There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71212 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
5caa370ea6f70bd3e7e4a9cc3b69ac1a849c8534 08-May-2009 Chris Lattner <sabre@nondot.org> reimplement __sync_* builtins to be variadic and to follow the same
semantic rules that gcc and icc use. This implements the variadic
and concrete versions as builtins and has sema do the
disambiguation. There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71212 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
d94f546b4b88bb7d3b8ff3d1665de2ec2629270d 08-May-2009 Zhongxing Xu <xuzhongxing@gmail.com> Revert r71079.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71202 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
a15f7ac7729b74d1d8bef0c009b803a4bbef20d3 08-May-2009 Zhongxing Xu <xuzhongxing@gmail.com> Revert r71079.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71202 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
ype.h
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.h
ype.h
a6e5bbebae136f9e5c031d89654d9d8160e9cefa 06-May-2009 Zhongxing Xu <xuzhongxing@gmail.com> add getTargetInfo() method to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71079 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
33c37b9b87453c835cd0e32a4a65db329da20356 06-May-2009 Zhongxing Xu <xuzhongxing@gmail.com> add getTargetInfo() method to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71079 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
03d242e18e54faad6da12eab590ddd5e261d077a 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'ns_autorelease'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
69aa08072decc20094bd1f75f4f9842e9bd357ad 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'ns_autorelease'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
60da2715e386e1f87513fc8596a0e267ca8e977b 05-May-2009 Chris Lattner <sabre@nondot.org> remove some incorrect and unimplemented atomic builtins (e.g.
__sync_umin_and_fetch), add some missing atomic builtins (e.g.
__sync_fetch_and_nand) and reorder the list to match the GCC
documentation. The builtins still need work and codegen
implementation, more patches coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70985 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
b0ed3029d96e31dfa71a61ac5aa8d04710e0fb12 05-May-2009 Chris Lattner <sabre@nondot.org> remove some incorrect and unimplemented atomic builtins (e.g.
__sync_umin_and_fetch), add some missing atomic builtins (e.g.
__sync_fetch_and_nand) and reorder the list to match the GCC
documentation. The builtins still need work and codegen
implementation, more patches coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70985 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
fed3c098f6345dfd908c0c27583db7140996ad8b 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
e351aa10dab6eb8b9b502166c7035dc7b0e723e0 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
a8d6fd978099620a754b62c590c39ca0dc0068a7 05-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental attribute 'ns_ownership_make_collectable.'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
d99b345a1ae77c746ef025e6a050908d69e2c543 05-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental attribute 'ns_ownership_make_collectable.'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
2c5710cb5f812255a8fc3bd8338139f5e72bf259 04-May-2009 Daniel Dunbar <daniel@zuster.org> Add ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70914 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
c2e57bfc7f784e8f2d6026ec6b03259c1109f120 04-May-2009 Daniel Dunbar <daniel@zuster.org> Add ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70914 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
514acdd174654fa8bc5bd20fb4582cb6057d2010 04-May-2009 Daniel Dunbar <daniel@zuster.org> Add ASTRecordLayout::getNextOffset accessor, and some doxygen comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70909 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
f773737e35b5a7c35ea75d5092249b7ba260cec3 04-May-2009 Daniel Dunbar <daniel@zuster.org> Add ASTRecordLayout::getNextOffset accessor, and some doxygen comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70909 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
eadf90ee4332b964f026c9f6dc74d803eb7cdbd9 04-May-2009 Daniel Dunbar <daniel@zuster.org> Initialize NextOffset correctly, otherwise tight layout fails for
empty classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70905 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
bc6ea8125afbab8635f5c319229d1ba8aa2e25e2 04-May-2009 Daniel Dunbar <daniel@zuster.org> Initialize NextOffset correctly, otherwise tight layout fails for
empty classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70905 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
028e811124293fa0c0f670ce16d102bbf76cf1c9 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes 'objc_ownership...' to 'ns_ownership...'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
75494ffb4ed3964fa22fb9ab15fddecedbc9fe10 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes 'objc_ownership...' to 'ns_ownership...'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
03d27943db8899157cd8aa4fcfb56abcba229435 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70884 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
31c215e62031b14e85c2f695c261817c044b465b 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70884 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ecordLayout.h
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
ecordLayout.h
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.h
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.h
d42baac9eb44438034448f1edbaa7bef081b3ad3 03-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4134: Implement __builtin_extract_return_addr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70794 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
3b660efb9f9fa3e87096f4a96a2093cd17c43c2e 03-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4134: Implement __builtin_extract_return_addr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70794 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
ecordLayout.h
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.h
ecordLayout.h
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.h
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.h
6277e4095e523d8a20d1eff82df66191ecd37487 03-May-2009 Eli Friedman <eli.friedman@gmail.com> Add Sema support for __builtin_setjmp/__builtin_longjmp. The primary
reason for adding these is to error out in CodeGen when trying to generate
them instead of silently emitting a call to a non-existent function.

(Note that it is not valid to lower these to setjmp/longjmp; in addition
to that lowering being different from the intent, setjmp and longjmp
require a larger buffer.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70658 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
d875fed28578835de89cd407e9db4be788596d7c 03-May-2009 Eli Friedman <eli.friedman@gmail.com> Add Sema support for __builtin_setjmp/__builtin_longjmp. The primary
reason for adding these is to error out in CodeGen when trying to generate
them instead of silently emitting a call to a non-existent function.

(Note that it is not valid to lower these to setjmp/longjmp; in addition
to that lowering being different from the intent, setjmp and longjmp
require a larger buffer.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70658 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
8813477d35efbfe22f9bb0436ec948e72913fb45 02-May-2009 Chris Lattner <sabre@nondot.org> explicitly know that the alignment of Type* is 3 bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70602 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
bfadf55ba5b736b13cc3e0fbc2b184569bc9f304 02-May-2009 Chris Lattner <sabre@nondot.org> explicitly know that the alignment of Type* is 3 bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70602 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
tmtNodes.def
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
tmtNodes.def
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
ype.h
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.h
ype.h
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.h
ype.h
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.h
ype.h
144b06c28e50e3bdec286c4fc74c3edf5553f88e 30-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement semantic analysis for transparent unions. This is largely
based on a patch from Anders Johnsen. CodeGen support is incomplete,
in that we do not properly coerce to the first field's type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70419 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
0c74e8a4e8865ec9ebb8efc0af247a3c077236c4 30-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement semantic analysis for transparent unions. This is largely
based on a patch from Anders Johnsen. CodeGen support is incomplete,
in that we do not properly coerce to the first field's type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70419 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
1653e238707eef9cbcc85109af0fa66aeb6593a8 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4103: improve source location information for members of the current
class. This isn't perfect, but it's a big improvement over not having
any location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
72527137c521ad9330ecb81ccd841159719dc8cd 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4103: improve source location information for members of the current
class. This isn't perfect, but it's a big improvement over not having
any location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ff8648dfaac35f96f8b59bf84ac2cd60cbe9d995 29-Apr-2009 Ted Kremenek <kremenek@apple.com> Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
bf20dbdec6ab7d02e96fac937ad57b2b95c0675c 29-Apr-2009 Ted Kremenek <kremenek@apple.com> Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
3ad0ab6248ba0a250846e02a8e1cb7848b0afb29 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix additional issues pointed out in PR4088.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70305 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
8a31774e1e18ff08a5ce0486bdf1c7a51be7a1e8 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix additional issues pointed out in PR4088.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70305 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
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
STContext.h
ttr.h
ecl.h
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
STContext.h
ttr.h
ecl.h
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.h
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.h
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
xternalASTSource.h
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
xternalASTSource.h
203169f80fe7bb3fbc52921019983206230afc01 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
c6a59e4bf225c7f8152faca72897321f0f6cabd1 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
15830ed32a2bdfd4d16bdedd4f155d013a5f6720 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_cfretain'. This is the same
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70218 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
4064de959853503d9b87065adac1b277fff8af20 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_cfretain'. This is the same
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70218 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
cd4da47cb7b56df43204438af87a838b91bc3e4f 27-Apr-2009 Chris Lattner <sabre@nondot.org> add an abbreviation for common PARM_VAR_DECL. All but 9 of the
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.

Before:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.23595e+07b/2.79494e+06B/698736W
% of file: 38.7233
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 139387
% Abbrev Recs: 0

After:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.02405e+07b/2.53006e+06B/632516W
% of file: 35.301
Num SubBlocks: 0
Num Abbrevs: 1
Num Records: 139387
% Abbrev Recs: 19.2902



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70199 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ea5ce4705df0743093925585d8edc80e0d8fe3ff 27-Apr-2009 Chris Lattner <sabre@nondot.org> add an abbreviation for common PARM_VAR_DECL. All but 9 of the
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.

Before:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.23595e+07b/2.79494e+06B/698736W
% of file: 38.7233
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 139387
% Abbrev Recs: 0

After:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.02405e+07b/2.53006e+06B/632516W
% of file: 35.301
Num SubBlocks: 0
Num Abbrevs: 1
Num Records: 139387
% Abbrev Recs: 19.2902



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70199 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
77055f6ac2f8f9975ce75657b6719eca7500fc17 27-Apr-2009 Chris Lattner <sabre@nondot.org> rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70189 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xternalASTSource.h
887e2b375fc5e00084ec7bf3dd050c2ca399a6d2 27-Apr-2009 Chris Lattner <sabre@nondot.org> rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70189 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xternalASTSource.h
ce066715485bcbaef75127726123466f334ae488 27-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
- Implement PCH support for ImplicitParamDecl
- Fix the handling of the body of an ObjCMethodDecl
- Several cast -> cast_or_null fixes
- Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
selectors.
- Make Selector::getAsString() work with NULL selectors.
- Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70163 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
405bad07391494d2eb025f8222c256c66b56e5f8 27-Apr-2009 Douglas Gregor <dgregor@apple.com> Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
- Implement PCH support for ImplicitParamDecl
- Fix the handling of the body of an ObjCMethodDecl
- Several cast -> cast_or_null fixes
- Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
selectors.
- Make Selector::getAsString() work with NULL selectors.
- Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70163 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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.h
eclBase.h
eclObjC.h
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.h
eclBase.h
eclObjC.h
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
xpr.h
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
xpr.h
79762bd703e2b04ae7b723e036ccc73760f4b1b4 26-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH read/write support for ObjC statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70143 91177308-0d34-0410-b5e6-96231b3b80d8
tmtObjC.h
1eb5540760dc79502e32d4fe9c28217476ea14b9 26-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH read/write support for ObjC statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70143 91177308-0d34-0410-b5e6-96231b3b80d8
tmtObjC.h
c6fd00a463f00f05093394a3a5b28b3b43ef88ac 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Update StmtNodes.def with the new base class of CXXTemporaryObjectExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70122 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
e38be7c18249b03159fb052b785d0cf500eda693 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Update StmtNodes.def with the new base class of CXXTemporaryObjectExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70122 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
8116b4b7d01741680a098d6dd17e47c1c9ac6713 26-Apr-2009 Chris Lattner <sabre@nondot.org> Split C++ statements out to their own file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70107 91177308-0d34-0410-b5e6-96231b3b80d8
tmtCXX.h
43c98041f7746f8d9445bdea873d86eca966b2b8 26-Apr-2009 Chris Lattner <sabre@nondot.org> Split C++ statements out to their own file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70107 91177308-0d34-0410-b5e6-96231b3b80d8
tmtCXX.h
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.h
tmtObjC.h
tmtVisitor.h
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.h
tmtObjC.h
tmtVisitor.h
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
xprObjC.h
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
xprObjC.h
fb3e40219796596ee5d29f90929ff05c4df4f77e 25-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH support for ObjCMessageExpr (needed to build Mail).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70044 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
c4f0bbdb166fbc31ab2cf0f6ff573fde9fa307b3 25-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH support for ObjCMessageExpr (needed to build Mail).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70044 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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.h
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.h
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.h
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.h
b98860c39ac5162b4b628962bdc08dd3571cdc3a 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked up
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70005 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
de9a81b92e9098daa8ca19df138e4807b4d8afe8 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked up
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70005 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
aa6e3187858164dac3c4d950b07d5b7b63f2e3bd 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_returns'. This isn't hooked
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70001 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
0fc169e864aef7fc9a782e60b222a360f406704a 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_returns'. This isn't hooked
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70001 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
c3221aae610fea665bf76ddee6ea3fc260c3fd6d 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for the global method pool (= instance and factory method
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69989 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f0aaf7a59729a4ae0146e3464ee987745be95829 24-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for the global method pool (= instance and factory method
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69989 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
9cda7a2a8ab3c05739f3a28d5815f9f34a3e3477 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that ObjCCompatibleAlias and ObjCImplementation decls are considered NamedDecls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69955 91177308-0d34-0410-b5e6-96231b3b80d8
eclNodes.def
76b329177a0bdf05641f74705692a59733090c53 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Make sure that ObjCCompatibleAlias and ObjCImplementation decls are considered NamedDecls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69955 91177308-0d34-0410-b5e6-96231b3b80d8
eclNodes.def
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.h
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.h
e684ff2a2d6b66da7fe90e19434659d87f2997e7 24-Apr-2009 Anders Carlsson <andersca@mac.com> Move the CXXConstructExpr before the CXXTemporaryObjectExpr so that the temporary object expr can inherit from the construct expr. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69953 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
15ef2b5820f9daccc44b9e847163b705b6f5863b 24-Apr-2009 Anders Carlsson <andersca@mac.com> Move the CXXConstructExpr before the CXXTemporaryObjectExpr so that the temporary object expr can inherit from the construct expr. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69953 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
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.h
eclObjC.h
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.h
eclObjC.h
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.h
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.h
9b6348dcc3aaa88b9b04dd51acb0d4c0bb35cf9b 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b3efa98e320590e8be9d62818e89e599303e65b4 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ab3d373c38a05fcc0d74ee7fcacdf48d3ea2ceab 23-Apr-2009 Chris Lattner <sabre@nondot.org> fix a problem producing debug info with global blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69875 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4863db4266d066617a1e5ad7c0f3f28c7995c61b 23-Apr-2009 Chris Lattner <sabre@nondot.org> fix a problem producing debug info with global blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69875 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c86c2c8330edd6ea862c94dde080125881d25fb5 23-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add implicit definition of objc_msgSend.
- As with malloc and friends, this is important where the return type
on a 64-bit platform would otherwise end up discarding the upper
32-bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69874 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
9396dcf9699541f54bc3990c0dfbaa929464f5df 23-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add implicit definition of objc_msgSend.
- As with malloc and friends, this is important where the return type
on a 64-bit platform would otherwise end up discarding the upper
32-bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69874 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
f6279ae5cf4070f1ff869efd99de24f86f1c4c30 23-Apr-2009 Chris Lattner <sabre@nondot.org> the logic for computing __func__ and friends is really broken:
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69872 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b5437d238752dc297e42410e98d38d5250fe0463 23-Apr-2009 Chris Lattner <sabre@nondot.org> the logic for computing __func__ and friends is really broken:
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69872 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
37a54fd84c8eee22873f71728a07377185fa1799 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH (de-)serialization of the protocols in an ObjCInterfaceDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69860 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
291be393aa33759e6e34b6429c5ffa206ba50115 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH (de-)serialization of the protocols in an ObjCInterfaceDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69860 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3f2c50557dc32075200f8fcb01dcfebfafa1a3ec 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ObjCPropertyImplDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69858 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
8818c4fb69cb2a4eec94b217a90f94f9e075296e 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ObjCPropertyImplDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69858 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
58e7ce47236aad981c16afe395717dc1cd487fe5 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ObjCCategoryImplDecl (which can't be tested now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69856 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
10b0e1fa3aabd8877dbbc0df1f2414e04afd5fdd 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ObjCCategoryImplDecl (which can't be tested now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69856 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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
eclObjC.h
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
eclObjC.h
3839f1c3e2fa6dd5a0482a7d948037c4d03ef4de 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for Objective-C property declarations (UNTESTED!)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69843 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
70e5a14c6076d63833c62d1d6d628c26309897c1 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for Objective-C property declarations (UNTESTED!)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69843 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
ecl.h
eclBase.h
eclCXX.h
eclGroup.h
eclTemplate.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
tmt.h
ype.h
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.h
ecl.h
eclBase.h
eclCXX.h
eclGroup.h
eclTemplate.h
eclarationName.h
xpr.h
xprCXX.h
xprObjC.h
tmt.h
ype.h
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.h
uiltins.h
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.h
uiltins.h
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.h
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.h
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
ype.h
ypeNodes.def
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
ype.h
ypeNodes.def
9b9f23586594572ec4c581b15c883f2a84a44ff1 22-Apr-2009 Chris Lattner <sabre@nondot.org> pch support for protocol qualified id's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69781 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
d7a3fcd48cb308074cc95031252bc64966f0703d 22-Apr-2009 Chris Lattner <sabre@nondot.org> pch support for protocol qualified id's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69781 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
c49bbe72221ca7cde0d45c52ae6a72374b2d8529 22-Apr-2009 Chris Lattner <sabre@nondot.org> add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69780 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
3a57a3765b6192a94ff4e5997ae0489a1471b308 22-Apr-2009 Chris Lattner <sabre@nondot.org> add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69780 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
80f83c6f299e76871b6b4f63b20de18197cd0cdc 22-Apr-2009 Chris Lattner <sabre@nondot.org> implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69779 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
4dcf151a555ff51e4d643e8e6eeb80f121d11d1b 22-Apr-2009 Chris Lattner <sabre@nondot.org> implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69779 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
uiltins.h
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
uiltins.h
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.h
eclObjC.h
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.h
eclObjC.h
c713da9e66dd3c47ee7b0011172e03b59ff02420 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not.

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers.

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69737 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
668c1a4fdcc56bdd050256b1688e116fe84b72db 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not.

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers.

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69737 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
4d107bccf19ce4a94f3efba4c853f4f85e48c9a9 22-Apr-2009 Chris Lattner <sabre@nondot.org> this is a warning now, return a well formed ast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69731 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5b54b88c4082bb81b8b341b622fda9a85cbd5fad 22-Apr-2009 Chris Lattner <sabre@nondot.org> this is a warning now, return a well formed ast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69731 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
STConsumer.h
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
STConsumer.h
97b53bda541230096b4966b4ae44d02b1756dad5 21-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).

Once selector support is in place, we should be able to take this for a spin (and add test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69674 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
30833f8d77c08f8f16371776fde85a9fde3d9b6e 21-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).

Once selector support is in place, we should be able to take this for a spin (and add test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69674 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3f3d40ed12bf642798b8f8f2c02ccb606020c819 21-Apr-2009 Chris Lattner <sabre@nondot.org> add support for goto checking and @synchronized blocks,
rdar://6810106


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69667 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
46c3c4ba78766ac0f1c5ec631b424773e21f5271 21-Apr-2009 Chris Lattner <sabre@nondot.org> add support for goto checking and @synchronized blocks,
rdar://6810106


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69667 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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
eclCXX.h
xprCXX.h
tmtNodes.def
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
eclCXX.h
xprCXX.h
tmtNodes.def
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.h
eclNodes.def
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.h
eclNodes.def
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.h
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.h
7ff82e7e864ca1825cef56a84b80a7999aa70316 21-Apr-2009 Mike Stump <mrs@apple.com> Fixup codegen for write barriers for block variables. Radar 6786715


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69642 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
75b163f4c832696edf4d66d8ac1ec0ed5ea59e17 21-Apr-2009 Mike Stump <mrs@apple.com> Fixup codegen for write barriers for block variables. Radar 6786715


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69642 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4bcc73af80ea01c73079f1f08cffdb0fca8fc476 20-Apr-2009 Daniel Dunbar <daniel@zuster.org> Mark TypeForDecl mutable.
- Let the const propogation begin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69628 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3bfb885583f8816bf296b61c5886b97a81158bab 20-Apr-2009 Daniel Dunbar <daniel@zuster.org> Mark TypeForDecl mutable.
- Let the const propogation begin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69628 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
59f28e9c704f31430f9670572fd04417f12ca4dc 20-Apr-2009 Steve Naroff <snaroff@apple.com> Fix spelling error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69620 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
28e71cf851b73a67604735a9a95aef800b144e2e 20-Apr-2009 Steve Naroff <snaroff@apple.com> Fix spelling error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69620 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
7333b4925d5032304792f8b0a268549bbbc3a6ef 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.

Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
33feeb019a5742b286eededd5446ec0fe87c5a61 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.

Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
15ce6cc75018b69a2fc849c9ee5bceb30e0e67c1 20-Apr-2009 Chris Lattner <sabre@nondot.org> the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
cf2a7211b4785068c7efa836baab90b198a4d2a6 20-Apr-2009 Chris Lattner <sabre@nondot.org> the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
87887da76ef2e4c5d22ce9bb45623b6b9a24cf19 20-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
e7785040107266d01ebdcc066365f70b7ace371f 20-Apr-2009 Douglas Gregor <dgregor@apple.com> Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
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.h
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.h
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.h
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.h
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.h
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
tmt.h
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
tmt.h
0ec3c6ad603fb0128360c59e7bad8cc1118bd33e 18-Apr-2009 Chris Lattner <sabre@nondot.org> reject invalid jumps among pieces of @try blocks. This seems to work
reasonably well except for the problem that @catches are nested within
each other in the AST, giving the ugly diagnostics in L8.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69477 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
07e775d5a1d5262a9cfe1ff333af713535b8cbab 18-Apr-2009 Chris Lattner <sabre@nondot.org> reject invalid jumps among pieces of @try blocks. This seems to work
reasonably well except for the problem that @catches are nested within
each other in the AST, giving the ugly diagnostics in L8.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69477 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
6c892e4acce59e8caeccaf69e08dd4449870e3f5 18-Apr-2009 Anders Carlsson <andersca@mac.com> Add functions for iterating over the argument types of an ObjCMethodDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69468 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6ea8e2152e1ba93b4c80e7268403a582896dc3dc 18-Apr-2009 Anders Carlsson <andersca@mac.com> Add functions for iterating over the argument types of an ObjCMethodDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69468 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
8c1d5fd953f214f47ca73a8b514b0baccfebd4c9 18-Apr-2009 Chris Lattner <sabre@nondot.org> add accessor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69436 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8f4e18fce5ef11a4e1bcb9dd7adcd2e20a21ef0a 18-Apr-2009 Chris Lattner <sabre@nondot.org> add accessor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69436 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
00b6c184715a0fa8e1af74b063f9cc05a9b60884 18-Apr-2009 Chris Lattner <sabre@nondot.org> __builtin_prefetch should be declared as "void __builtin_prefetch(const void *)",
not "const void __builtin_prefetch(void *)". This fixes PR3912.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69425 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
40c56f7129bdaf8a01e2ffe7ddde714a586eb45d 18-Apr-2009 Chris Lattner <sabre@nondot.org> __builtin_prefetch should be declared as "void __builtin_prefetch(const void *)",
not "const void __builtin_prefetch(void *)". This fixes PR3912.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69425 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
xternalASTSource.h
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.h
xternalASTSource.h
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.h
eclBase.h
eclCXX.h
eclObjC.h
xpr.h
xternalASTSource.h
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.h
eclBase.h
eclCXX.h
eclObjC.h
xpr.h
xternalASTSource.h
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
eclContextInternals.h
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
eclContextInternals.h
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.h
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.h
e246b741a2f4b00a690b9e975201b7ced23f68cf 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for blocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69373 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
84af7c27cdc615ff917a501d61256b4049383c97 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for blocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69373 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
eca12f63c262ab4d44f40b966790c9155518b3ae 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for GNU statement expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69370 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6a2dd55b0b3ae376d449a4b07bbb6b2d30b26330 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for GNU statement expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69370 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
95a8fe35717bf897cc9c0bcc47482a4ba3301120 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for indirect gotos and address-of-label expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69369 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
7d5c2f241c74e5f8d9ec492e8f9f268e5e9ae41f 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for indirect gotos and address-of-label expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69369 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
6e411bfd8bc304cf4746140e2ff51d243a564d27 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for labels and goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69364 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
1de05feeeafe5b215fe7617594a7076a5192a6e2 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for labels and goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69364 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
78ff29fdafdbdf8fcf3de07337355aa99eb00cf2 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for declaration statements, and a test for PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69356 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
84f2170062014d268951902164bed0d8bdea0e82 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for declaration statements, and a test for PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69356 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
22d2dcd05c69e223587fa4f3ce3f356d1631007f 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for return statements.

Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69355 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
0de9d8857b715c2f45c987651f4ce06d73330d93 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for return statements.

Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69355 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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.h
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.h
fb5f25baeb2fc7145db78312e05b9e34b39ec4e3 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for do-while and for loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69334 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
67d8249924ef38a5375ff9c92cd21c1854d6abab 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for do-while and for loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69334 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
a6b503f5f754f4c798ce80471cbcdf03a01205a3 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for while and continue statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69332 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d921cf976b4769af8d06d6763a2547dadf7940ab 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for while and continue statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69332 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
6a51bb864f69fdd310f475adcd5e5d75b8789bf0 17-Apr-2009 Anders Carlsson <andersca@mac.com> Add constructor getter to CXXTemporaryObjectExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69327 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
d87a5012d174ae5aa076b3fa800aecf55d70bac4 17-Apr-2009 Anders Carlsson <andersca@mac.com> Add constructor getter to CXXTemporaryObjectExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69327 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
8ee040e4581ec7530eae4b689ab7a4a9c9ce9bbd 16-Apr-2009 Chris Lattner <sabre@nondot.org> tblgen is now passing diagnostic group information in the .inc file, ignore it everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69269 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
19cbb44e3c4f2181dafa2ab92d3e3a26619b71d9 16-Apr-2009 Chris Lattner <sabre@nondot.org> tblgen is now passing diagnostic group information in the .inc file, ignore it everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69269 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
b70b48fec5bfeef402757d6ca8034ff879d52a66 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for CompoundLiteralExpr. This is the last C expression
that does not require PCH support for statements. Only AddrLabelExpr,
StmtExpr, and BlockExpr remain (for C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69255 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ba6d7e7fa5f79959d3eef39adb5620d845ba5198 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for CompoundLiteralExpr. This is the last C expression
that does not require PCH support for statements. Only AddrLabelExpr,
StmtExpr, and BlockExpr remain (for C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69255 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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.h
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.h
209d4621adeb4554b5e64a05d53c2fe40b0061d9 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for TypesCompatibleExpr, ChooseExpr, and GNUNullExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
44cae0c8669cdf83618cbe7fd36ea7a8e51cf97f 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for TypesCompatibleExpr, ChooseExpr, and GNUNullExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
c599bbf9f6816cbefa2650ab18a4ce610775425f 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for CompoundAssignOperator and ConditionalOperator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ad90e96fb7eed26d5217dd06ba50ecbbbebb59e6 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for CompoundAssignOperator and ConditionalOperator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
21ddd8cd9f39e8090e6637fc59eec1ead8092060 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ImaginaryLiteral and ArraySubscriptExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69233 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cb2ca73c1d7e76cc1358ce51457d2d5837d84f9b 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ImaginaryLiteral and ArraySubscriptExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69233 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1c5078881cbde0e85b487f7f022b91801646d4b5 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for declaration attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69225 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
68a2eb0cc76267ba0615992fb5e0977853c397b2 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for declaration attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69225 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
13d17ac85da60e14f4dace39d6c438a5ea016757 15-Apr-2009 Chris Lattner <sabre@nondot.org> Tblgen now passes the default mapping explicitly, instead of having it
be tied to the diag class. This requires an LLVM tree update.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69175 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
4ac072aceb9c68f7a023050e2ab9ccacb4fe6e5b 15-Apr-2009 Chris Lattner <sabre@nondot.org> Tblgen now passes the default mapping explicitly, instead of having it
be tied to the diag class. This requires an LLVM tree update.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69175 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
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.h
12d7405658246a6252805e4d64f54d4ebef41859 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for UnaryOperator, SizeOfAlignOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0b0b77fa29c74c99a77548ed86ca8a04f7cf6b02 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for UnaryOperator, SizeOfAlignOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
aa3572798c5ccf8e609ee7609d630d4bd5857327 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Switch designated-initializer checking from using designator iterators
to using designator indices. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69147 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
711997184366d584c9c437102cae1e9d9927b986 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Switch designated-initializer checking from using designator iterators
to using designator indices. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69147 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c75d0cbfbe5a6c525a1eaf5d2062a0386e5fc6b4 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for CStyleCastExpr and BinaryOperator expression kinds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69119 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
db600c330a37b1c3ab4533310729910ee188f900 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for CStyleCastExpr and BinaryOperator expression kinds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69119 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
4ea0b1fbabc67f7d2a1fe35df8dc0b1bd6bfdf56 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ParenExpr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69106 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c04db4feefa2b0dbbc6876cb4eeeee108aa6791d 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ParenExpr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69106 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a151ba485fefb14e2237321ba13c346853f765e3 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69101 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
087fd536809ebe754d91c641a98917e02dd7452d 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69101 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e2f3720dcee0a0fa77ddffa42a7cd4c88006659e 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH support for PredefinedExpr and FloatingLiteral expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69084 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
17fc223395d51be582fc666bb6ea21bd1dff26dc 14-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH support for PredefinedExpr and FloatingLiteral expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69084 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c10f86ffa5a4693fe3f3779305047d260c35d90b 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for a few very, very simple kinds of expressions. Hook up
expression (de-)serialization for VLAs, variable initializers,
enum constant initializers, and bitfield widths.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69075 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xpr.h
tmt.h
0b7489194f9f89fac39d57211c1e7953ae50251f 14-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for a few very, very simple kinds of expressions. Hook up
expression (de-)serialization for VLAs, variable initializers,
enum constant initializers, and bitfield widths.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69075 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xpr.h
tmt.h
429e56a918f44f517850a651cbb283d9f9f19fae 14-Apr-2009 Chris Lattner <sabre@nondot.org> recognize the gnuc_inline attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69044 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
26e25545b26ec06f5d674dbae00fb168e6688d90 14-Apr-2009 Chris Lattner <sabre@nondot.org> recognize the gnuc_inline attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69044 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
0df11ba02c3767922c68f0375c806adfb2d1d3a0 14-Apr-2009 Mike Stump <mrs@apple.com> Fix build error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69009 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
38c1effc8549af15d5049a684257c7ca8e9c7a87 14-Apr-2009 Mike Stump <mrs@apple.com> Fix build error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69009 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
631f6c64882b5254c5e4dbde6ec604dd4b96fd23 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69005 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
fdd0172ca1b3c837f8c2b37d69cc2085234e09fa 14-Apr-2009 Douglas Gregor <dgregor@apple.com> When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69005 91177308-0d34-0410-b5e6-96231b3b80d8
xternalASTSource.h
2a49179c4c884b49f446728ccf0f306751396255 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
expression or statement serialization before we can test them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69002 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1028bc67d56ea088c3a57c4c44c3f6aeff60a031 14-Apr-2009 Douglas Gregor <dgregor@apple.com> Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
expression or statement serialization before we can test them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69002 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
23ce3a5b5e65ff7d43001cd829a99932173a345e 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for functions and their parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68997 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3a2f7e42514ddbec983c61826ce85d3071e23e8e 14-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for functions and their parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68997 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
982365e249bd61429e7ed4e38556b8cd84dc356e 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68988 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8c70006581a9b9e9485570ca727a6c5f7be63521 13-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68988 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
47f1b2cbd21093c1348fe3c59f513cb2abed3255 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH support for enumerations and enumerators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0a2b45e5885b6b8477b167042c0f6cd1d99a1f13 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH support for enumerations and enumerators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8fc38c21132d37ff76f624ab1dcfe03ba63e2518 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix rdar://6774906, a crash handling implicit conversions between pointers
in different address spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68941 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ecca7536488e425417dcb005c39cc15ae1947aab 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix rdar://6774906, a crash handling implicit conversions between pointers
in different address spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68941 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
5140b9832b2a844ecea92c250bbe95f50d190baa 12-Apr-2009 Chris Lattner <sabre@nondot.org> add a new isNull() method to DeclGroupRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68909 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
20401698e3bd93a24bb5d9e18e435895cefe5fd1 12-Apr-2009 Chris Lattner <sabre@nondot.org> add a new isNull() method to DeclGroupRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68909 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
d50ecbcdb8e5b76f15a3625dccf03cdb1d620e4e 12-Apr-2009 Chris Lattner <sabre@nondot.org> add a new Decl::hasAttr<T>() predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68907 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
115cafcafec3572756635ca81ef83999ae0c8af7 12-Apr-2009 Chris Lattner <sabre@nondot.org> add a new Decl::hasAttr<T>() predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68907 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
eclContextInternals.h
xternalASTSource.h
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.h
eclContextInternals.h
xternalASTSource.h
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
xpr.h
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
xpr.h
cfbd5a86d2128bce79457e99a58dfce6ffe0eef4 10-Apr-2009 Chris Lattner <sabre@nondot.org> fix indentation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68760 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
c1da56ef012d02c77c13689f4ca1a2e4f002eb2a 10-Apr-2009 Chris Lattner <sabre@nondot.org> fix indentation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68760 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
1ce91f2da99710e0d14f15efc8c26d0fd8b24c4d 10-Apr-2009 Ted Kremenek <kremenek@apple.com> Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
clients of the analyzer to designate custom assertion routines as "noreturn"
functions from the analyzer's perspective but not the compiler's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68746 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
b725232b46e92f3e36b03a32a6fc75748c312122 10-Apr-2009 Ted Kremenek <kremenek@apple.com> Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allows
clients of the analyzer to designate custom assertion routines as "noreturn"
functions from the analyzer's perspective but not the compiler's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68746 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
eclBase.h
eclContextInternals.h
xternalASTSource.h
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.h
eclBase.h
eclContextInternals.h
xternalASTSource.h
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.h
ecl.h
eclBase.h
eclContextInternals.h
eclObjC.h
eclarationName.h
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.h
ecl.h
eclBase.h
eclContextInternals.h
eclObjC.h
eclarationName.h
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.h
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.h
2d643513564dfe6ce2d2f276514cf874be52ce77 09-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add more builtin definitions, including strcmp.
- PR3964.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68710 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
7a0048b3f59b9623e33bda2609c7a9fefc4a65c3 09-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add more builtin definitions, including strcmp.
- PR3964.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68710 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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
eclContextInternals.h
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
eclContextInternals.h
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
ecl.h
eclBase.h
eclContextInternals.h
eclVisitor.h
tmt.h
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
ecl.h
eclBase.h
eclContextInternals.h
eclVisitor.h
tmt.h
8654a5b5e407cdc32b1c4ea62363160d37eed055 07-Apr-2009 Daniel Dunbar <daniel@zuster.org> Implement __sync_{add,sub,and,or,xor}_and_fetch and
__sync_bool_compare_and_swap.
- <rdar://problem/6762223> [sema/irgen] support
__sync_bool_compare_and_swap and __sync_add_and_fetch


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68482 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
0002d23aaf10f307273dab5facda01c137283d22 07-Apr-2009 Daniel Dunbar <daniel@zuster.org> Implement __sync_{add,sub,and,or,xor}_and_fetch and
__sync_bool_compare_and_swap.
- <rdar://problem/6762223> [sema/irgen] support
__sync_bool_compare_and_swap and __sync_add_and_fetch


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68482 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
2431e605018b816767570dc53eae345183d9f8e6 04-Apr-2009 Anton Korobeynikov <asl@math.spbu.ru> Basic support for regparm codegen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68414 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
1102f4282ceb430dbc9fcedb9dd2ad25898a09e8 04-Apr-2009 Anton Korobeynikov <asl@math.spbu.ru> Basic support for regparm codegen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68414 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
cec0374ffa1f3ca65b875506d3a66c434c643aa6 03-Apr-2009 Chris Lattner <sabre@nondot.org> fix some warnings on VC++, patch by John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68391 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
tmt.h
fb523e16dd1f860ff02a3ae03e5e3e25327a5860 03-Apr-2009 Chris Lattner <sabre@nondot.org> fix some warnings on VC++, patch by John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68391 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
tmt.h
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.h
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.h
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.h
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.h
9a744e58dcfc2ba9a639be2d7a07e806415d206b 01-Apr-2009 Steve Naroff <snaroff@apple.com> More "prep" work for handling UTF16 CFString.

Patch by Jean-Daniel Dupas. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68203 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8d4141f83d9de379547cf05bd75d4c6cf894b189 01-Apr-2009 Steve Naroff <snaroff@apple.com> More "prep" work for handling UTF16 CFString.

Patch by Jean-Daniel Dupas. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68203 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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.h
estedNameSpecifier.h
emplateName.h
ype.h
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.h
estedNameSpecifier.h
emplateName.h
ype.h
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.h
emplateName.h
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.h
emplateName.h
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.h
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.h
2c8a08e939d78d1aff70bdda1f122a200861f4ab 31-Mar-2009 Steve Naroff <snaroff@apple.com> Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.

Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68114 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
33fdb738a6c125f4c788733897021b7c1a062b0c 31-Mar-2009 Steve Naroff <snaroff@apple.com> Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.

Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68114 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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
ype.h
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
ype.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
e089063ccbf6f60daab8a2739829430863a9f7a3 31-Mar-2009 Anders Carlsson <andersca@mac.com> Document NamespaceAliasDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68085 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
63840b5fc57b426e156d36e5109b7d418b711f7d 31-Mar-2009 Anders Carlsson <andersca@mac.com> Document NamespaceAliasDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68085 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclObjC.h
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
eclObjC.h
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.h
eclTemplate.h
emplateName.h
ype.h
ypeNodes.def
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.h
eclTemplate.h
emplateName.h
ype.h
ypeNodes.def
b27c69ce0f999f73a75d48e816ea193a0bee5066 30-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Added new info to property impl. AST node to support
objc2's ivar synthesis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68064 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
d497bae0ed149584636f07b638ba8db6e3f0fcb3 30-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Added new info to property impl. AST node to support
objc2's ivar synthesis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68064 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
af69ccc858fd14b1821fdc118b4a1d52ef588e39 30-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Remove a trivial FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68045 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
f1e5a9591317d20161aa0638ff36944ae8b89360 30-Mar-2009 Douglas Gregor <dgregor@apple.com> Remove a trivial FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68045 91177308-0d34-0410-b5e6-96231b3b80d8
estedNameSpecifier.h
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.h
eclBase.h
eclGroup.h
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.h
eclBase.h
eclGroup.h
19672e47f10cae8382d12246e34c6be64e0c7f8b 29-Mar-2009 Chris Lattner <sabre@nondot.org> Implement PointerLikeTypeTraits for DeclGroupRef.
Make OpaquePtr work with things that are pointer-like but not
necessarily pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67998 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
d51a183ffd7de05374ef20977e17ab4444bd633c 29-Mar-2009 Chris Lattner <sabre@nondot.org> Implement PointerLikeTypeTraits for DeclGroupRef.
Make OpaquePtr work with things that are pointer-like but not
necessarily pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67998 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
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.h
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.h
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.h
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.h
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.h
ype.h
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.h
ype.h
5e05f29efda155f4505b87eaa54331e45b1833dd 29-Mar-2009 Chris Lattner <sabre@nondot.org> add getNumLowBitsAvailable for OpaquePtr and QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67975 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
11a7f35c2e3a496342031c2ed721f58e691ebfca 29-Mar-2009 Chris Lattner <sabre@nondot.org> add getNumLowBitsAvailable for OpaquePtr and QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67975 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d776b2da9bd694c41f1506e152aeb35d1babeba6 29-Mar-2009 Chris Lattner <sabre@nondot.org> follow llvm mainline, where PointerLikeTypeInfo got renamed
to PointerLikeTypeTraits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67974 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
daae940507f2e93c6fa12e8062fa958e34cc2d1c 29-Mar-2009 Chris Lattner <sabre@nondot.org> follow llvm mainline, where PointerLikeTypeInfo got renamed
to PointerLikeTypeTraits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67974 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
cdd67caf66a2aa1a95da3ed9726bea7a3659b35b 29-Mar-2009 Chris Lattner <sabre@nondot.org> implement the PointerLikeTypeInfo trait for QualType, allowing
it to be stuck into a SmallPtrSet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67967 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4e7072872e8e2ed76a4c6933424bffa253896e7e 29-Mar-2009 Chris Lattner <sabre@nondot.org> implement the PointerLikeTypeInfo trait for QualType, allowing
it to be stuck into a SmallPtrSet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67967 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
87e3568d5f286a9d5bcafcef102fd7d875946dc5 29-Mar-2009 Anders Carlsson <andersca@mac.com> Handle the case where the namespace decl is an alias.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67965 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
af9e40f9909d89501617897c7295dff68c3907a3 29-Mar-2009 Anders Carlsson <andersca@mac.com> Handle the case where the namespace decl is an alias.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67965 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
eclNodes.def
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.h
eclNodes.def
57e39f0733b4018ad9de923cfbad0ddf20ebc674 28-Mar-2009 Chris Lattner <sabre@nondot.org> add accessors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67929 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
cc1f8693df4c96d7a8db585e5c05e31b8520f6c2 28-Mar-2009 Chris Lattner <sabre@nondot.org> add accessors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67929 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
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
eclGroup.h
tmt.h
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
eclGroup.h
tmt.h
034a87df6e74f1d1ff8f1ec2e72fad30a49827b4 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate unneeded iterator wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67927 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
0632dd6fe068011af5710c0d6a745724021ff620 28-Mar-2009 Chris Lattner <sabre@nondot.org> eliminate unneeded iterator wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67927 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b41cc2a93b6b22eaadaeaabde6072cbe21135e69 28-Mar-2009 Chris Lattner <sabre@nondot.org> change NamespaceDecl to hold its 'NextNamespace' pointer itself
instead of in NextDeclarator. This temporarily increases memory
usage, but simplifies and decouples things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67926 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f05ca7df086aa2c176bbc32408fb3f9eaef82c05 28-Mar-2009 Chris Lattner <sabre@nondot.org> change NamespaceDecl to hold its 'NextNamespace' pointer itself
instead of in NextDeclarator. This temporarily increases memory
usage, but simplifies and decouples things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67926 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
tmt.h
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
tmt.h
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.h
tmt.h
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.h
tmt.h
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.h
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.h
7954817083ece1f6a9fa6b64118f3799062ce20c 28-Mar-2009 Chris Lattner <sabre@nondot.org> simplify getNextDeclInScope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67918 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
96f4468b6b1bf69bb01c1207f716a3ffaeb4a8d3 28-Mar-2009 Chris Lattner <sabre@nondot.org> simplify getNextDeclInScope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67918 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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
STContext.h
ranslationUnit.h
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
STContext.h
ranslationUnit.h
2a594d0d2a5c1fe506608f75b7d135d743b56911 28-Mar-2009 Chris Lattner <sabre@nondot.org> change HandleTranslationUnit to take an ASTContext instead of TranslationUnit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67910 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
dacbc5d46aaeea817742b8c76c987b87d2490c85 28-Mar-2009 Chris Lattner <sabre@nondot.org> change HandleTranslationUnit to take an ASTContext instead of TranslationUnit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67910 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
ranslationUnit.h
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.h
ranslationUnit.h
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.h
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.h
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
ranslationUnit.h
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
ranslationUnit.h
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
xpr.h
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
xpr.h
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
xpr.h
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
xpr.h
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.h
eclarationName.h
estedNameSpecifier.h
ype.h
ypeNodes.def
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.h
eclarationName.h
estedNameSpecifier.h
ype.h
ypeNodes.def
8769fc8cd9d5734b13b457049594183a1631f172 27-Mar-2009 Ted Kremenek <kremenek@apple.com> Add missing header file change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67871 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.h
ced21016cec1f189a695857bed103ecc9e3f3696 27-Mar-2009 Ted Kremenek <kremenek@apple.com> Add missing header file change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67871 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.h
404adca9e6daa75b26b07f23b63b2deedec55b06 27-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Finish off semantic analysis for regparm, and remove the warning. Also
remove a redundant error in CodeGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67868 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
55d3aaf9a537888734762170823daf750ea9036d 27-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Finish off semantic analysis for regparm, and remove the warning. Also
remove a redundant error in CodeGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67868 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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.h
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.h
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.h
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.h
97703437b51ac8fdbd4adbc8edb33ad6cc161a08 27-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Besides the warning, issue unsupported diagnostics in
ir gen. No intended change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67857 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ee760330a415635369556796a97afcfd6207f4dc 27-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Besides the warning, issue unsupported diagnostics in
ir gen. No intended change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67857 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
e615803e1c4a70ba66b6687b2b95e1fdcd16cd3b 27-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Clarify that QualifiedNameType is sugar-only. This will matter once we can parse typename-specifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67803 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
119057adf21237d53dcd490cec9700dca2465e3e 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Clarify that QualifiedNameType is sugar-only. This will matter once we can parse typename-specifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67803 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
xprCXX.h
estedNameSpecifier.h
ype.h
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.h
xprCXX.h
estedNameSpecifier.h
ype.h
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.h
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.h
d76d7716fdda8042ef062c060de3992c87ee4b25 26-Mar-2009 Ted Kremenek <kremenek@apple.com> Because of the use of 'cast<TagDecl>', ASTContext.h now depends on Decl.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ad75653f81dece1c806e9c28dd7e7582c9929a27 26-Mar-2009 Ted Kremenek <kremenek@apple.com> Because of the use of 'cast<TagDecl>', ASTContext.h now depends on Decl.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67773 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
55216ac1d698c5d24c5d6a9f0986404cdc703762 26-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> The injected-class-name of class templates and class template
specializations can be treated as a template. Finally, we can parse
and process the first implementation of Fibonacci I wrote!

Note that this code does not handle all of the cases where
injected-class-names can be treated as templates. In particular,
there's an ambiguity case that we should be able to handle (but
can't), e.g.,

template <class T> struct Base { };
template <class T> struct Derived : Base<int>, Base<char> {
typename Derived::Base b; // error: ambiguous
typename Derived::Base<double> d; // OK
};




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67720 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
befc20e1dc869edb0e7b560e69f32d5c71f867ab 26-Mar-2009 Douglas Gregor <dgregor@apple.com> The injected-class-name of class templates and class template
specializations can be treated as a template. Finally, we can parse
and process the first implementation of Fibonacci I wrote!

Note that this code does not handle all of the cases where
injected-class-names can be treated as templates. In particular,
there's an ambiguity case that we should be able to handle (but
can't), e.g.,

template <class T> struct Base { };
template <class T> struct Derived : Base<int>, Base<char> {
typename Derived::Base b; // error: ambiguous
typename Derived::Base<double> d; // OK
};




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67720 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
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.h
0f60b3201cfbd32a43939cd26f128932d73a0421 25-Mar-2009 Anders Carlsson <andersca@mac.com> It doesn't make sense to set the access specifier to AS_none (I think)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67700 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
b8547e800f9553a72c2f3635ae2371692bd4411a 25-Mar-2009 Anders Carlsson <andersca@mac.com> It doesn't make sense to set the access specifier to AS_none (I think)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67700 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
a8cecf66e3d8ebbd30501d92692c912cc843160b 24-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Parse deleted function definitions and hook them up to Doug's machinery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67653 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
50de12f5783b57c74fd30ebfa3945181313625ff 24-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Parse deleted function definitions and hook them up to Doug's machinery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67653 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
412c34014b576ee253e5026e1e74a5ef62a41135 24-Mar-2009 Anders Carlsson <andersca@mac.com> More work on diagnosing abstract classes. We can now handle cases like

class C {
void g(C c);

virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67594 91177308-0d34-0410-b5e6-96231b3b80d8
eclVisitor.h
8211effbd3abc5948a5d6924c87e72323016a376 24-Mar-2009 Anders Carlsson <andersca@mac.com> More work on diagnosing abstract classes. We can now handle cases like

class C {
void g(C c);

virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67594 91177308-0d34-0410-b5e6-96231b3b80d8
eclVisitor.h
a6fe878ddf8804734de57b1bbd1c8a25ff963024 22-Mar-2009 Chris Lattner <sabre@nondot.org> add some missing type predicates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67474 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
26d1a40edc612f4c53399427480592101acb0dbe 22-Mar-2009 Chris Lattner <sabre@nondot.org> add some missing type predicates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67474 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
ca277321b9f701b45abbd450657bdbfb72428d0f 21-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Issue error if variables are defined inside an objc class,
category or protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67450 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b31cb7f1752ea011fd06ac9574ce24667d11cbdb 21-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Issue error if variables are defined inside an objc class,
category or protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67450 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
5db77cd6276bbca3a44db218d6989f516552654b 21-Mar-2009 Chris Lattner <sabre@nondot.org> continue dancing around the obvious algorithm issues in PR3810:
This speeds up getAsIdentifierInfo from being a call to a function
with a big switch to a single testl instruction. This speeds up
the example in PR3810 by 6.2%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67433 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
91058ff73fd3b00275348dd4d49f83501dfc0542 21-Mar-2009 Chris Lattner <sabre@nondot.org> continue dancing around the obvious algorithm issues in PR3810:
This speeds up getAsIdentifierInfo from being a call to a function
with a big switch to a single testl instruction. This speeds up
the example in PR3810 by 6.2%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67433 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
831c834f4de9c9db16fd7259cde3f310f98bbd88 20-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Improve documentation for MemberExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67401 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
57e8b05fe9ba03d410db9c161e032cb79c9ab5ba 20-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve documentation for MemberExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67401 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
23974ac63841eada280bdd4821091d1b127242a5 20-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Bindir and Win32 builds work, so switch to .inc files. Leave the .def files in the tree for a day or so longer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67346 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
4d7a089144f336b11e5e8ce437b3b27bce2b310d 20-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Bindir and Win32 builds work, so switch to .inc files. Leave the .def files in the tree for a day or so longer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67346 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
3d3732e278ed7586870606c96175e43d6326e2cc 19-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Variables marked as "extern" can actually have internal linkage if
there is a previous declaration marked "static". This fixes PR3645.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67336 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5ef122e9449a86e4a6466ea07ed7f5ba5f6a48bc 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Variables marked as "extern" can actually have internal linkage if
there is a previous declaration marked "static". This fixes PR3645.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67336 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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
ecl.h
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
ecl.h
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.h
estedNameSpecifier.h
ype.h
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.h
estedNameSpecifier.h
ype.h
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.h
estedNameSpecifier.h
ype.h
ypeNodes.def
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.h
estedNameSpecifier.h
ype.h
ypeNodes.def
2c7de6dabb766d0ab8350090fc9afc18743378de 18-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> objc: Implemented variables declared in class interface
whose sema decl is at the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67249 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
38e24c782c17b6058bf61d635747bbde19fb1bc7 18-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> objc: Implemented variables declared in class interface
whose sema decl is at the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67249 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
1b39ef49e647e821486916cafab07d641277c054 17-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor instantiation of declarations within a template into a much
cleaner visitor framework.

Added a visitor for declarations, which is quite similar to the
visitor for statatements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67104 91177308-0d34-0410-b5e6-96231b3b80d8
eclVisitor.h
8dbc2694424b4e842b1d5ea39744a137b58600c3 17-Mar-2009 Douglas Gregor <dgregor@apple.com> Refactor instantiation of declarations within a template into a much
cleaner visitor framework.

Added a visitor for declarations, which is quite similar to the
visitor for statatements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67104 91177308-0d34-0410-b5e6-96231b3b80d8
eclVisitor.h
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.h
ype.h
ypeNodes.def
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.h
ype.h
ypeNodes.def
c45057a4b1aae40e5b63424444cb2615a1bc4399 15-Mar-2009 Anders Carlsson <andersca@mac.com> Handle static_asserts when instantiating structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67031 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
94b15fbc3a10cdfb1639528a8a773b66a1e7cd9e 15-Mar-2009 Anders Carlsson <andersca@mac.com> Handle static_asserts when instantiating structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67031 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
eee67792c8f4abd48c28e7b3267022fda25bca8d 14-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Revert the switch to the tablegen diags. It fails for seperate objdir builds and cmake builds, and I have no clue what to do about it. Revisit this after someone with a clue about the build systems has looked at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67009 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
e89b6b272f9f3b15afa56a701a4d7a6b1001ed34 14-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Revert the switch to the tablegen diags. It fails for seperate objdir builds and cmake builds, and I have no clue what to do about it. Revisit this after someone with a clue about the build systems has looked at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67009 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
fa70786a0bc7a28c23c389fbe538038e1ea97ce2 14-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Switch diagnostics from .def to tablegen files. Please validate the Windows build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67007 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
3801d71fbeb6e74a22cdd6a858e10d887bc29c7a 14-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Switch diagnostics from .def to tablegen files. Please validate the Windows build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67007 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
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.h
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.h
eclNodes.def
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.h
eclNodes.def
544cda6467e24d0ced693fbb52f800405de610e7 14-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that the canonical representation of integral template arguments uses the bitwidth and signedness of the template parameter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66990 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
5b0f752655cc94b970113235110b56a722eb40d4 14-Mar-2009 Douglas Gregor <dgregor@apple.com> Make sure that the canonical representation of integral template arguments uses the bitwidth and signedness of the template parameter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66990 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
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.h
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.h
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
uiltins.h
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
uiltins.h
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
xpr.h
xprCXX.h
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
xpr.h
xprCXX.h
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.h
xprCXX.h
ype.h
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.h
xprCXX.h
ype.h
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.h
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.h
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.h
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.h
3fc092fead94ef6753b163765fce8219cfa3b8b8 13-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Improve the representation of operator expressions like "x + y" within
C++ templates. In particular, keep track of the overloaded operators
that are visible from the template definition, so that they can be
merged with those operators visible via argument-dependent lookup at
instantiation time.

Refactored the lookup routines for argument-dependent lookup and for
operator name lookup, so they can be called without immediately adding
the results to an overload set.

Instantiation of these expressions is completely wrong. I'll work on
that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66851 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
3fd95ce225393fe4a3623e429766a8c3f487ff9d 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve the representation of operator expressions like "x + y" within
C++ templates. In particular, keep track of the overloaded operators
that are visible from the template definition, so that they can be
merged with those operators visible via argument-dependent lookup at
instantiation time.

Refactored the lookup routines for argument-dependent lookup and for
operator name lookup, so they can be called without immediately adding
the results to an overload set.

Instantiation of these expressions is completely wrong. I'll work on
that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66851 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
63f5d6002bbb0d6b594e320c5522ac03cfb1b6e8 12-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Store the type of the integral value within a TemplateArgument, so that we can more efficiently reconstruct an IntegerLiteral from it during template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66833 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
c971f8694661776ecdec2ccc33fbe0333eeaf191 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Store the type of the integral value within a TemplateArgument, so that we can more efficiently reconstruct an IntegerLiteral from it during template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66833 91177308-0d34-0410-b5e6-96231b3b80d8
eclTemplate.h
cdea9de1b915a3a4ccdc738f5c38c6da1a9ced48 12-Mar-2009 Ted Kremenek <kremenek@apple.com> Add file I forgot to commit in previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66820 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
dc192323e740eec20d6d7c3162067242403aa37b 12-Mar-2009 Ted Kremenek <kremenek@apple.com> Add file I forgot to commit in previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66820 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
95ba1285f8e6e161f171f7fce558d3cff983666c 12-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Use StmtVisitor to handle the decoding of expressions for
instantiation. This is roughly the structure we want to expression
instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66816 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
313a81dd820c9b2c0203bdcd974c781a81e4f0cf 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Use StmtVisitor to handle the decoding of expressions for
instantiation. This is roughly the structure we want to expression
instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66816 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
eclBase.h
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.h
eclBase.h
8f53bb70407ca1f3f4d769b7a1bc2eb7a2592c6e 12-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Move most of the checking from ActOnCXXMemberDeclarator to other, more general routines. This is a step toward separating the checking logic from Declarators, which in turn is required for template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66734 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
021c3b372c58f5423b4fa2a5be6933d1c7ecc663 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Move most of the checking from ActOnCXXMemberDeclarator to other, more general routines. This is a step toward separating the checking logic from Declarators, which in turn is required for template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66734 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
26561a01cea14e8e768bd616fe764dd8e8727154 11-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate CXXClassMemberWrapper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66698 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
ff7fea809bab2badd0cb241703b14ac20ac258cb 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXClassMemberWrapper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66698 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
eclBase.h
eclCXX.h
eclNodes.def
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
eclBase.h
eclCXX.h
eclNodes.def
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.h
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.h
7c0c17b528295299020428f583a480a6dcb4c7e0 11-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> More Next objc2's gc ivar layout bitmap work.
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66615 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
820e0203079afd64b0de422832f9e0b31a27c0c8 11-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> More Next objc2's gc ivar layout bitmap work.
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66615 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
a5dfc18d3700f95c6f48790977d609e7e79e4099 10-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for class getter/setter call
using property dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66556 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
3523d4f59eb0aa1f200dcb943093ecfe75008735 10-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for class getter/setter call
using property dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66556 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
fdaed4c5837a0e7e66e063705a5b8c1e57fbca34 10-Mar-2009 Anders Carlsson <andersca@mac.com> Address Doug's comments wrt the mangler and fix Eli's test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66549 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4843e584b54460973b8445d38907bab0401ebb0c 10-Mar-2009 Anders Carlsson <andersca@mac.com> Address Doug's comments wrt the mangler and fix Eli's test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66549 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
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.h
eclTemplate.h
ype.h
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.h
eclTemplate.h
ype.h
73ec9325c26807fae7e2d7271229cf5ba37d547c 09-Mar-2009 Steve Naroff <snaroff@apple.com> Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(

This fixes <rdar://problem/6496506> Implement class setter/getter for properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66465 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
61f72cbd037e58f12cfe90cd442373f44092f030 09-Mar-2009 Steve Naroff <snaroff@apple.com> Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(

This fixes <rdar://problem/6496506> Implement class setter/getter for properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66465 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
42291e51b5d5ac9f263a13afdb0aa08788801d6a 08-Mar-2009 Chris Lattner <sabre@nondot.org> Update DeclNodes.def to reflect the move of ObjCCategoryImpl
from being a NamedDecl to being and ObjCImplDecl. This fixes
some valgrind issues where ObjCCategoryImpl's were being cast
to NamedDecl and then stuck on name lookup datastructures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66372 91177308-0d34-0410-b5e6-96231b3b80d8
eclNodes.def
6b5e4f0cc5672c7d5449db28d5ead94d32407cb2 08-Mar-2009 Chris Lattner <sabre@nondot.org> Update DeclNodes.def to reflect the move of ObjCCategoryImpl
from being a NamedDecl to being and ObjCImplDecl. This fixes
some valgrind issues where ObjCCategoryImpl's were being cast
to NamedDecl and then stuck on name lookup datastructures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66372 91177308-0d34-0410-b5e6-96231b3b80d8
eclNodes.def
8fc7dd955011ead87c968121f1085332fed8ccdf 08-Mar-2009 Chris Lattner <sabre@nondot.org> improve comments for MemberExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66371 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ddca44e86281bb7dcf5fdcaf1563434c524e3861 08-Mar-2009 Chris Lattner <sabre@nondot.org> improve comments for MemberExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66371 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
42e4139c17210534e71cf72b9a7a2f8b5a972fd4 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> Add Parse/Sema support for weak_import attribute.
- Also, diagnose weak applied to types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66259 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
6e775dbafba2ab6634decc489eb3b4301b4b506b 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> Add Parse/Sema support for weak_import attribute.
- Also, diagnose weak applied to types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66259 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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.h
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.h
15c04bd8111843ce92eaa9fb3199c62de5163676 05-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Use LLVM type header rather than using stdint.h directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66111 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
852157601505e0a641f1b66c9e2fb028f77bb7d1 05-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Use LLVM type header rather than using stdint.h directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66111 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
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
ttr.h
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
ttr.h
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
ttr.h
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
ttr.h
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.h
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.h
4db0f9a68d8b980b3d08afc3120bd373252aaa30 04-Mar-2009 Chris Lattner <sabre@nondot.org> fix infinite recursion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66014 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
91ee0140ecb60b5c1402edc9e577257636c4ca60 04-Mar-2009 Chris Lattner <sabre@nondot.org> fix infinite recursion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66014 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
edde56f5dab14ff4678e633a25323ba35782d891 04-Mar-2009 Chris Lattner <sabre@nondot.org> make CaseStmt::getSourceRange() iterative for deeply
nested cases instead of recursive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66013 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
3fb94a4918bd427fdb12df997dd87fd1017f0388 04-Mar-2009 Chris Lattner <sabre@nondot.org> make CaseStmt::getSourceRange() iterative for deeply
nested cases instead of recursive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66013 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
1fb145b96e5e004c5b7b1cc4e6e55f7dead47c57 04-Mar-2009 Daniel Dunbar <daniel@zuster.org> Add some more FIXME's about bits we could pack better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66003 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
fe133d98fd003db818dcc2a0f0dbf7416a01aaed 04-Mar-2009 Daniel Dunbar <daniel@zuster.org> Add some more FIXME's about bits we could pack better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66003 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d6e68cdd168e321986126f6c52c9cd15e7370842 04-Mar-2009 Daniel Dunbar <daniel@zuster.org> Woot, save 8 bytes in Decl on 64-bit by reordering fields. This
reduces allocated Decl size by ~8% on Cocoa.h (~700k).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66002 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
39d7650656fdd1be879ed7d0c722cfeae95e56d5 04-Mar-2009 Daniel Dunbar <daniel@zuster.org> Woot, save 8 bytes in Decl on 64-bit by reordering fields. This
reduces allocated Decl size by ~8% on Cocoa.h (~700k).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66002 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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
eclTemplate.h
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
eclTemplate.h
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
tmtIterator.h
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
tmtIterator.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
7cc13bfd6c8f6b0ea1f0989fe87fc3e8428b1c8c 01-Mar-2009 Chris Lattner <sabre@nondot.org> "This patch uses the new ObjCImplDecl class to merge Sema::ImplMethodsVsClassMethods and Sema::ImplCategoryMethodsVsIntfMethods methods.
And now, when clang check a class implementation to find unimplemented methods, it also checks all methods from the class extensions (unnamed categories).

There is also a test case to check this warning.

This patch contains also a minor update for ObjCImplDecl . getNameAsCString and getNameAsString now returns an empty string instead of crashing for unnamed categories."

Patch by Jean-Daniel Dupas!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65744 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
cddc88800bbd1213ec70ae5153c6a7f2e380fd8d 01-Mar-2009 Chris Lattner <sabre@nondot.org> "This patch uses the new ObjCImplDecl class to merge Sema::ImplMethodsVsClassMethods and Sema::ImplCategoryMethodsVsIntfMethods methods.
And now, when clang check a class implementation to find unimplemented methods, it also checks all methods from the class extensions (unnamed categories).

There is also a test case to check this warning.

This patch contains also a minor update for ObjCImplDecl . getNameAsCString and getNameAsString now returns an empty string instead of crashing for unnamed categories."

Patch by Jean-Daniel Dupas!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65744 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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
ype.h
ypeNodes.def
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
ype.h
ypeNodes.def
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.h
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.h
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.h
eclCXX.h
ype.h
ypeNodes.def
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.h
eclCXX.h
ype.h
ypeNodes.def
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.h
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.h
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
ecl.h
eclTemplate.h
ype.h
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
ecl.h
eclTemplate.h
ype.h
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
ype.h
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
ype.h
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.h
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.h
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
xpr.h
xprCXX.h
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
xpr.h
xprCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
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
xprObjC.h
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
xprObjC.h
155f9ce171714305166913e68f4a4fdcb313a214 24-Feb-2009 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65388 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c4a09c189981b4561428e4b56fd250718e2717bb 24-Feb-2009 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65388 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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
ype.h
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
ype.h
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.h
ype.h
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.h
ype.h
184541a6a7d218583d79d408534f77c27b7b8c6e 21-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a bug whereby a pointer to a __weak was not recognized
as __weak (objc2 gc specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65238 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4ae1f058902ffd92207af678e1c62e43258127c6 21-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a bug whereby a pointer to a __weak was not recognized
as __weak (objc2 gc specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65238 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
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.h
206d79e37a1aeece613d1563c151186c0ebc734c 20-Feb-2009 Chris Lattner <sabre@nondot.org> factor a bunch of common code out of the ObjCList template class
into a new shared ObjCListBase class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65164 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
793ccfd646d0388e06c587e962a18fa723b72f02 20-Feb-2009 Chris Lattner <sabre@nondot.org> factor a bunch of common code out of the ObjCList template class
into a new shared ObjCListBase class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65164 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
fb15fbfbf66b4d26a0778a4f76cf3f765cb8842e 20-Feb-2009 Chris Lattner <sabre@nondot.org> prune #includes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65158 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
68835718c4125f2f66740cd04de7088645ec695d 20-Feb-2009 Chris Lattner <sabre@nondot.org> prune #includes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65158 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
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.h
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.h
47a5771bb3f71086fa10d8893122d9521266047e 20-Feb-2009 Chris Lattner <sabre@nondot.org> more random cleanups, add some fixme's. ObjCCategoryImplDecl really
shouldn't be a NamedDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65153 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a8ff9f455d94d9609766cfd5186b6e21dc2102f1 20-Feb-2009 Chris Lattner <sabre@nondot.org> more random cleanups, add some fixme's. ObjCCategoryImplDecl really
shouldn't be a NamedDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65153 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
a0fbce253bf7ebbb80cc88915476d91b65d36714 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove dead list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65142 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
2f0fe337f499c78710b718324b25510670d885b1 20-Feb-2009 Chris Lattner <sabre@nondot.org> remove dead list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65142 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
e73c1d5d4193081bf658c8fb56ec2b3fcdf8223a 20-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add some stdlib builtins


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65115 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
f8ebb4154e261e34a0c77338fa1faa100ecfb28d 20-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add some stdlib builtins


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65115 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
0b53af20d4a56a5ec3bc5072aaa3a14f6d6fecd1 20-Feb-2009 Chris Lattner <sabre@nondot.org> replace a dirty hack with a clean solution. Too bad we can't
use Blocks for our callbacks ;-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65083 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
92dd386e3f05d176b45a638199d51f536bd9d1c4 20-Feb-2009 Chris Lattner <sabre@nondot.org> replace a dirty hack with a clean solution. Too bad we can't
use Blocks for our callbacks ;-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65083 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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
xpr.h
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
xpr.h
eb12e78ddbe63baed47cb92fb281d6d1aa689b1c 19-Feb-2009 Anders Carlsson <andersca@mac.com> Add sema support for the noinline attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65055 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
5bab788d40026ad6e932a3cd9b86bc13f8a27661 19-Feb-2009 Anders Carlsson <andersca@mac.com> Add sema support for the noinline attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65055 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ype.h
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
ype.h
126949ecf2a1051fa3271b42936129ea0299be99 19-Feb-2009 Gabor Greif <ggreif@gmail.com> fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65040 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4b5d486a0a2cb535d8c7e3f5c258eb3cba8cad29 19-Feb-2009 Gabor Greif <ggreif@gmail.com> fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65040 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
05c9b5f51a43211afcfcb86530a94fa935045cdd 19-Feb-2009 Chris Lattner <sabre@nondot.org> fix a typo gabor noticed


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65005 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8bea7c0ee44c71c817de7dc2be932b73bec90c9f 19-Feb-2009 Chris Lattner <sabre@nondot.org> fix a typo gabor noticed


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65005 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
85534581967bd50a73c25ae76c96d39b05854a05 19-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Couple of helpers for objc's gc attributes.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64989 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f6123ca578eb8aabb76ecce7df6857482017f502 19-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Couple of helpers for objc's gc attributes.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64989 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ype.h
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
ype.h
7029ee3fdeee514a79eafb2508723d27c97fe158 18-Feb-2009 Chris Lattner <sabre@nondot.org> minor spacing changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64968 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
bc5e150b6d94cf131f7d01bc715571b741c5b408 18-Feb-2009 Chris Lattner <sabre@nondot.org> minor spacing changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64968 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
tmtNodes.def
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.h
tmtNodes.def
aa57e866832a9a31351214c33de9b40a49510d84 18-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Downgrade complaints about calling unavailable functions to a warning
(as GCC does), except when we've performed overload resolution and
found an unavailable function: in this case, we actually error.

Merge the checking of unavailable functions with the checking for
deprecated functions. This unifies a bit of code, and makes sure that
we're checking for unavailable functions in the right places. Also,
this check can cause an error. We may, eventually, want an option to
make "unavailable" warnings into errors.

Implement much of the logic needed for C++0x deleted functions, which
are effectively the same as "unavailable" functions (but always cause
an error when referenced). However, we don't have the syntax to
specify deleted functions yet :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64955 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
48f3bb9f780f6e64ab71ba0202ca04b07473805a 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Downgrade complaints about calling unavailable functions to a warning
(as GCC does), except when we've performed overload resolution and
found an unavailable function: in this case, we actually error.

Merge the checking of unavailable functions with the checking for
deprecated functions. This unifies a bit of code, and makes sure that
we're checking for unavailable functions in the right places. Also,
this check can cause an error. We may, eventually, want an option to
make "unavailable" warnings into errors.

Implement much of the logic needed for C++0x deleted functions, which
are effectively the same as "unavailable" functions (but always cause
an error when referenced). However, we don't have the syntax to
specify deleted functions yet :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64955 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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
ype.h
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
ype.h
80ff83cc9136a4737632dc84ad8d124e82f45b76 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Cleanup objc's gc attributes code no longer needed.
This make warn-weak-field.m to fail (subject of
a followup patch).
attr-objc-gc.m no passes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64925 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ype.h
ba372b85524f712e5b97a176f6ce0197d365835d 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Cleanup objc's gc attributes code no longer needed.
This make warn-weak-field.m to fail (subject of
a followup patch).
attr-objc-gc.m no passes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64925 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ype.h
f17cb369ac6ed77e876f0b0a3996a12ffb48921a 18-Feb-2009 Chris Lattner <sabre@nondot.org> Start improving diagnostics that relate to subcharacters of string literals.
First step, handle diagnostics in StringLiteral's that are due to token pasting.

For example, we now handle:
id str2 = @"foo"
"bar"
@"baz"
" b\0larg"; // expected-warning {{literal contains NUL character}}

Correctly:

test/SemaObjC/exprs.m:17:15: warning: CFString literal contains NUL character
" b\0larg"; // expected-warning {{literal contains NUL character}}
~~~^~~~~~~

There are several other related issues still to be done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64924 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
60800081361b0ffc114877b8abbc81cb57b4edf6 18-Feb-2009 Chris Lattner <sabre@nondot.org> Start improving diagnostics that relate to subcharacters of string literals.
First step, handle diagnostics in StringLiteral's that are due to token pasting.

For example, we now handle:
id str2 = @"foo"
"bar"
@"baz"
" b\0larg"; // expected-warning {{literal contains NUL character}}

Correctly:

test/SemaObjC/exprs.m:17:15: warning: CFString literal contains NUL character
" b\0larg"; // expected-warning {{literal contains NUL character}}
~~~^~~~~~~

There are several other related issues still to be done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64924 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xprObjC.h
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
xprObjC.h
8d8199bd0c34741bfdf73349da780c195279838d 18-Feb-2009 Chris Lattner <sabre@nondot.org> add iterators for string token locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64899 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b137299ce5bb6c36fbba651858600857fda4dd50 18-Feb-2009 Chris Lattner <sabre@nondot.org> add iterators for string token locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64899 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
81f5be228ed67e67c6f74e7678de8f21c27dd447 18-Feb-2009 Chris Lattner <sabre@nondot.org> rename CheckBuiltinCFStringArgument -> CheckObjCString


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64894 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
690398188ea5b428f06aa13c7d4ce6eb741ad4f9 18-Feb-2009 Chris Lattner <sabre@nondot.org> rename CheckBuiltinCFStringArgument -> CheckObjCString


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64894 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
51f06af4822090f4936e0cb08a6254175c0d6fe2 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add ASTContext::MakeIntValue
- Makes an APSInt given a uint64_t and a type, with the appropriate
width and signedness to match the type. Yay for functional over
imperative.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64863 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
0cd7fc28d4f69b281522b1bc96decd2b92cfd812 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add ASTContext::MakeIntValue
- Makes an APSInt given a uint64_t and a type, with the appropriate
width and signedness to match the type. Yay for functional over
imperative.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64863 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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
xprCXX.h
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
xprCXX.h
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.h
eclNodes.def
eclTemplate.h
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.h
eclNodes.def
eclTemplate.h
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.h
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.h
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
ype.h
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
ype.h
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.h
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.h
b50464f6665ba9e50579bb5edc2abc573107dbfc 17-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove some redundant Decl -> Decl castings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64804 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d311f376c364e5a6c88b63b1d5c53f560ea5e650 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove some redundant Decl -> Decl castings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64804 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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
ype.h
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
ype.h
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.h
ype.h
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.h
ype.h
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.h
eclNodes.def
eclTemplate.h
ype.h
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.h
eclNodes.def
eclTemplate.h
ype.h
fd46ea2d06cfd25a032c1202d129b8f86f740f66 16-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.

- Define pow[lf]?, sqrt[lf]? as builtins.

- Add -fmath-errno option which binds to LangOptions.MathErrno

- Add new builtin flag Builtin::Context::isConstWithoutErrno for
functions which can be marked as const if errno isn't respected for
math functions. Sema automatically marks these functions as const
when they are defined, if MathErrno=0.

- IRgen uses const attribute on sqrt and pow library functions to
decide if it can use the llvm intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64689 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
uiltins.h
ef2abfee3ea16ec74942dc09e9e425f46aeb2582 16-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.

- Define pow[lf]?, sqrt[lf]? as builtins.

- Add -fmath-errno option which binds to LangOptions.MathErrno

- Add new builtin flag Builtin::Context::isConstWithoutErrno for
functions which can be marked as const if errno isn't respected for
math functions. Sema automatically marks these functions as const
when they are defined, if MathErrno=0.

- IRgen uses const attribute on sqrt and pow library functions to
decide if it can use the llvm intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64689 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
uiltins.h
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.h
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.h
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.def
uiltins.h
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.def
uiltins.h
09020eed49ea73a177a1ff116c2736065bb000de 16-Feb-2009 Chris Lattner <sabre@nondot.org> enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64667 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
73525de7fd9bdd534382dc89a24f1f76db3e04b9 16-Feb-2009 Chris Lattner <sabre@nondot.org> enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64667 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
e86e3e470060401ec4fe1ab984e4da6ae7adf003 16-Feb-2009 Chris Lattner <sabre@nondot.org> cleanup, add a getMethod() that takes a bool to indicate whether
the caller wants class or instance methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64654 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
53df12d1ba68dbd071d067f8236c16fba815aad5 16-Feb-2009 Chris Lattner <sabre@nondot.org> cleanup, add a getMethod() that takes a bool to indicate whether
the caller wants class or instance methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64654 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f119670d2ac5fb343b6adf4fdf2544e160f2f747 16-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the
declaration). Fixes PR3588.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64641 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6871981fbccba9e8a63997d58245ec0add114f49 16-Feb-2009 Douglas Gregor <dgregor@apple.com> When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the
declaration). Fixes PR3588.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64641 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
083c23e9acbb8322201e8a318f0fe00823b5d181 16-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Adopt a more principled approach to invalid declarations:
- If a declaration is an invalid redeclaration of an existing name,
complain about the invalid redeclaration then avoid adding it to
the AST (we can still parse the definition or initializer, if any).
- If the declaration is invalid but there is no prior declaration
with that name, introduce the invalid declaration into the AST
(for later error recovery).
- If the declaration is an invalid redeclaration of a builtin that
starts with __builtin_, we produce an error and drop the
redeclaration. If it is an invalid redeclaration of a library
builtin (e.g., malloc, printf), warn (don't error!) and drop the
redeclaration.

If a user attempts to define a builtin, produce an error and (if it's
a library builtin like malloc) suggest -ffreestanding.

This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is
still going to cause some problems when builtins are redeclared
without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64639 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
cda9c674998aedeb9319e95a0284f4d266dcef32 16-Feb-2009 Douglas Gregor <dgregor@apple.com> Adopt a more principled approach to invalid declarations:
- If a declaration is an invalid redeclaration of an existing name,
complain about the invalid redeclaration then avoid adding it to
the AST (we can still parse the definition or initializer, if any).
- If the declaration is invalid but there is no prior declaration
with that name, introduce the invalid declaration into the AST
(for later error recovery).
- If the declaration is an invalid redeclaration of a builtin that
starts with __builtin_, we produce an error and drop the
redeclaration. If it is an invalid redeclaration of a library
builtin (e.g., malloc, printf), warn (don't error!) and drop the
redeclaration.

If a user attempts to define a builtin, produce an error and (if it's
a library builtin like malloc) suggest -ffreestanding.

This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is
still going to cause some problems when builtins are redeclared
without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64639 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
d948978fa2ffdc6b014447c17e10d8b88eca73cf 16-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> castToDeclContext/castFromDeclContext are only required to be included in the class of decls that directly derive from DeclContext.
Their subclasses don't need them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64632 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
eclObjC.h
005f6b222dfddc12ada571e479ff2d7a58114d07 16-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> castToDeclContext/castFromDeclContext are only required to be included in the class of decls that directly derive from DeclContext.
Their subclasses don't need them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64632 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclCXX.h
eclObjC.h
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.h
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.h
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.h
eclNodes.def
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.h
eclNodes.def
2cb744bafa562600ca2142a262a97a90febe4041 15-Feb-2009 Chris Lattner <sabre@nondot.org> Refactor the deprecated and unavailable checks into a new
DiagnoseUseOfDeprecatedDecl method. This ensures that they
are treated consistently. This gets us 'unavailable' support
on a few new types of decls, and makes sure we consistently
silence deprecated when the caller is also deprecated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64612 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
76a642ff4fce7a0648c79a1f01324a8c3880e251 15-Feb-2009 Chris Lattner <sabre@nondot.org> Refactor the deprecated and unavailable checks into a new
DiagnoseUseOfDeprecatedDecl method. This ensures that they
are treated consistently. This gets us 'unavailable' support
on a few new types of decls, and makes sure we consistently
silence deprecated when the caller is also deprecated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64612 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
uiltins.def
uiltins.h
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
uiltins.def
uiltins.h
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.h
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.h
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
ttr.h
ecl.h
xpr.h
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
ttr.h
ecl.h
xpr.h
a9b9846bc55c2ec1f776a553f6e20e588acdebcc 14-Feb-2009 Chris Lattner <sabre@nondot.org> add parser and type checking support for attribute((objc_exception)).
We don't have "zero cost" exceptions for ObjC yet, so there is no codegen
support required.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64546 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
0db29ece81d360dcefbe912339c34abe5917f6a9 14-Feb-2009 Chris Lattner <sabre@nondot.org> add parser and type checking support for attribute((objc_exception)).
We don't have "zero cost" exceptions for ObjC yet, so there is no codegen
support required.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64546 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ttr.h
xpr.h
tmt.h
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
ttr.h
xpr.h
tmt.h
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.def
uiltins.h
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.def
uiltins.h
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.def
uiltins.h
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.def
uiltins.h
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
uiltins.def
uiltins.h
ecl.h
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
uiltins.def
uiltins.h
ecl.h
cfd596f9bb31b5325354d7a453455c299a619e06 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add VarDecl::hasExternalStorage (no functionality change).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64498 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1dd467a111794453e4d97af9907cb29ea72c44e5 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add VarDecl::hasExternalStorage (no functionality change).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64498 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b88b4f7a2b97817fe9937dcf1226ca1f5796ecaf 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Sema/AST support for attribute used. Patch by Anders Johnson (with small tweaks & test case)!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64478 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
b805dad4aa386aeae0f72512895bd238678d37a5 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Sema/AST support for attribute used. Patch by Anders Johnson (with small tweaks & test case)!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64478 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
eclGroup.h
tmt.h
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
eclGroup.h
tmt.h
f607f531905e9df9f6907cd81fe97a96fb7956c5 13-Feb-2009 Anders Carlsson <andersca@mac.com> Add sema support for the nodebug attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64441 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
d87df37e0adaba0d5e33da7b1a14d7f1d94c5eef 13-Feb-2009 Anders Carlsson <andersca@mac.com> Add sema support for the nodebug attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64441 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
ype.h
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.h
ype.h
fa3a832f26a79b56599f9d304c2d9ac8bbdff86a 13-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Tighten checking of the "overloadable" attribute. If any function by a
given name in a given scope is marked as "overloadable", every
function declaration and definition with that same name and in that
same scope needs to have the "overloadable" attribute. Essentially,
the "overloadable" attribute is not part of attribute merging, so it
must be specified even for redeclarations. This keeps users from
trying to be too sneaky for their own good:

double sin(double) __attribute__((overloadable)); // too sneaky
#include <math.h>

Previously, this would have made "sin" overloadable, and therefore
given it a mangled name. Now, we get an error inside math.h when we
see a (re)declaration of "sin" that doesn't have the "overloadable"
attribute.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64414 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ae17094c001972a5949944a0a77ef6adf2a92c8f 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Tighten checking of the "overloadable" attribute. If any function by a
given name in a given scope is marked as "overloadable", every
function declaration and definition with that same name and in that
same scope needs to have the "overloadable" attribute. Essentially,
the "overloadable" attribute is not part of attribute merging, so it
must be specified even for redeclarations. This keeps users from
trying to be too sneaky for their own good:

double sin(double) __attribute__((overloadable)); // too sneaky
#include <math.h>

Previously, this would have made "sin" overloadable, and therefore
given it a mangled name. Now, we get an error inside math.h when we
see a (re)declaration of "sin" that doesn't have the "overloadable"
attribute.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64414 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
3556bc72a4c38332a94becb05a4e8ff1f9917ef9 13-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Add basic support for C++ name mangling according to the Itanium C++
ABI to the CodeGen library. Since C++ code-generation is so
incomplete, we can't exercise much of this mangling code. However, a
few smoke tests show that it's doing the same thing as GCC. When C++
codegen matures, we'll extend the ABI tester to verify name-mangling
as well, and complete the implementation here.

At this point, the major client of name mangling is in the uses of the
new "overloadable" attribute in C, which allows overloading. Any
"overloadable" function in C (or in an extern "C" block in C++) will
be mangled the same way that the corresponding C++ function would be
mangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64413 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
5f2bfd4811996abb783aa6c7254c56baa6930e8c 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Add basic support for C++ name mangling according to the Itanium C++
ABI to the CodeGen library. Since C++ code-generation is so
incomplete, we can't exercise much of this mangling code. However, a
few smoke tests show that it's doing the same thing as GCC. When C++
codegen matures, we'll extend the ABI tester to verify name-mangling
as well, and complete the implementation here.

At this point, the major client of name mangling is in the uses of the
new "overloadable" attribute in C, which allows overloading. Any
"overloadable" function in C (or in an extern "C" block in C++) will
be mangled the same way that the corresponding C++ function would be
mangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64413 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
1f1cd39d71dadad454d96ec5eafb9b7450c832e4 12-Feb-2009 Anders Carlsson <andersca@mac.com> Add a very basic implemenation of global blocks. This needs to be cleaned up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64387 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d5cab5435371b8cc74a9e05ebd40b5995ebad149 12-Feb-2009 Anders Carlsson <andersca@mac.com> Add a very basic implemenation of global blocks. This needs to be cleaned up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64387 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
9750972322487f439c511244b303ad3e849b193d 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support __attribute__(section(<name>))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64380 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
17f194f4393a67fd28ad822c06d32b8cb99bad3f 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support __attribute__(section(<name>))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64380 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
fcb1919cf2625e2fd209dabd7bba8b06fff94821 12-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Initial implementation of function overloading in C.

This commit adds a new attribute, "overloadable", that enables C++
function overloading in C. The attribute can only be added to function
declarations, e.g.,

int *f(int) __attribute__((overloadable));

If the "overloadable" attribute exists on a function with a given
name, *all* functions with that name (and in that scope) must have the
"overloadable" attribute. Sets of overloaded functions with the
"overloadable" attribute then follow the normal C++ rules for
overloaded functions, e.g., overloads must have different
parameter-type-lists from each other.

When calling an overloaded function in C, we follow the same
overloading rules as C++, with three extensions to the set of standard
conversions:

- A value of a given struct or union type T can be converted to the
type T. This is just the identity conversion. (In C++, this would
go through a copy constructor).
- A value of pointer type T* can be converted to a value of type U*
if T and U are compatible types. This conversion has Conversion
rank (it's considered a pointer conversion in C).
- A value of type T can be converted to a value of type U if T and U
are compatible (and are not both pointer types). This conversion
has Conversion rank (it's considered to be a new kind of
conversion unique to C, a "compatible" conversion).

Known defects (and, therefore, next steps):
1) The standard-conversion handling does not understand conversions
involving _Complex or vector extensions, so it is likely to get
these wrong. We need to add these conversions.
2) All overloadable functions with the same name will have the same
linkage name, which means we'll get a collision in the linker (if
not sooner). We'll need to mangle the names of these functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64336 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
f9201e0ff1779567150b70856753d9f2c6a91467 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of function overloading in C.

This commit adds a new attribute, "overloadable", that enables C++
function overloading in C. The attribute can only be added to function
declarations, e.g.,

int *f(int) __attribute__((overloadable));

If the "overloadable" attribute exists on a function with a given
name, *all* functions with that name (and in that scope) must have the
"overloadable" attribute. Sets of overloaded functions with the
"overloadable" attribute then follow the normal C++ rules for
overloaded functions, e.g., overloads must have different
parameter-type-lists from each other.

When calling an overloaded function in C, we follow the same
overloading rules as C++, with three extensions to the set of standard
conversions:

- A value of a given struct or union type T can be converted to the
type T. This is just the identity conversion. (In C++, this would
go through a copy constructor).
- A value of pointer type T* can be converted to a value of type U*
if T and U are compatible types. This conversion has Conversion
rank (it's considered a pointer conversion in C).
- A value of type T can be converted to a value of type U if T and U
are compatible (and are not both pointer types). This conversion
has Conversion rank (it's considered to be a new kind of
conversion unique to C, a "compatible" conversion).

Known defects (and, therefore, next steps):
1) The standard-conversion handling does not understand conversions
involving _Complex or vector extensions, so it is likely to get
these wrong. We need to add these conversions.
2) All overloadable functions with the same name will have the same
linkage name, which means we'll get a collision in the linker (if
not sooner). We'll need to mangle the names of these functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64336 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
0ea4e306c61cdf9896f4c943ae44241659bbc0a3 11-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Reverted r64307. Moved hasSameType and hasSameUnqualifiedType from
Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64312 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
8e6563ba097732dc1fffcfc85f8dbbceac899a80 11-Feb-2009 Douglas Gregor <dgregor@apple.com> Reverted r64307. Moved hasSameType and hasSameUnqualifiedType from
Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64312 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
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.h
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.h
29b3d302e726e76bf5368bd1261509191ea0bdc4 11-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Rename Sema::hasSameType to QualType::isSameAs
Rename Sema::hasSameUnqualifiedType to QualType::isSameIgnoringQalifiers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64307 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
26a0bdb810681e2514b9ddc2d9779ce6c9a79409 11-Feb-2009 Douglas Gregor <dgregor@apple.com> Rename Sema::hasSameType to QualType::isSameAs
Rename Sema::hasSameUnqualifiedType to QualType::isSameIgnoringQalifiers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64307 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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
tmt.h
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
tmt.h
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
ecl.h
eclNodes.def
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
ecl.h
eclNodes.def
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.h
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.h
2fe2456e91294adb648ba55601b326ec61a908cc 10-Feb-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Bring in 'CHAR_BIT' for GCC 4.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64196 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4004226773ac4a3070a940199be01ed6bdf1cf23 10-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Bring in 'CHAR_BIT' for GCC 4.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64196 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
xprCXX.h
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.h
xprCXX.h
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.h
ype.h
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.h
ype.h
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.h
eclTemplate.h
ype.h
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.h
eclTemplate.h
ype.h
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.h
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.h
a60c62ed9466364782369cb165f9392651a43a64 09-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Make Sema::getTypeName return the opaque pointer of a QualType rather
than a Decl, which gives us some more flexibility to express the
results with the type system. There are no clients using this
flexibility yet, but it's meant to be able to describe qualified names
as written in the source (e.g., "foo::type") or template-ids that name
a class template specialization (e.g., "std::vector<INT>").

DeclSpec's TST_typedef has become TST_typename, to reflect its use to
describe types found by name (that may or may not be typedefs). The
type representation of a DeclSpec with TST_typename is an opaque
QualType pointer. All users of TST_typedef, both direct and indirect,
have been updated for these changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64141 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1a51b4a11b7db25cac2134249711ecaaf9d1c0a8 09-Feb-2009 Douglas Gregor <dgregor@apple.com> Make Sema::getTypeName return the opaque pointer of a QualType rather
than a Decl, which gives us some more flexibility to express the
results with the type system. There are no clients using this
flexibility yet, but it's meant to be able to describe qualified names
as written in the source (e.g., "foo::type") or template-ids that name
a class template specialization (e.g., "std::vector<INT>").

DeclSpec's TST_typedef has become TST_typename, to reflect its use to
describe types found by name (that may or may not be typedefs). The
type representation of a DeclSpec with TST_typename is an opaque
QualType pointer. All users of TST_typedef, both direct and indirect,
have been updated for these changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64141 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7fc6184d3eec638fdf75938a54a1937212a5f5af 08-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Add public placement-delete operators. These are automatically used if the allocation throws

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64056 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e2dedf8f61b8f306f704781456b482eb61871e8e 08-Feb-2009 Douglas Gregor <dgregor@apple.com> Add public placement-delete operators. These are automatically used if the allocation throws

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64056 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
tmt.h
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.h
tmt.h
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.h
tmtVisitor.h
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.h
tmtVisitor.h
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.h
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.h
76650bfc9c9b7008a746fc78fb38d459608ef35e 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Update comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63961 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
4398a78095cd05a3be702fbab25bfe324a5d7946 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Update comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63961 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
c2f979be169d0691d0446e76d4d364b4b1551e60 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Added special versions of new[]/delete[] to complement the new/delete which uses ASTContext's allocator. Updated some comments along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63949 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
42542c6a4b3c60f63820e6177a8938443831492c 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Added special versions of new[]/delete[] to complement the new/delete which uses ASTContext's allocator. Updated some comments along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63949 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
ecl.h
eclTemplate.h
ype.h
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.h
ecl.h
eclTemplate.h
ype.h
b96b92d2b8965ff7078ad9a2823d27f1411fb559 05-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Improvements and fixes for name lookup with using directives, from Piotr Rak!

Also, put Objective-C protocols into their own identifier
namespace. Otherwise, we find protocols when we don't want to in C++
(but not in C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63877 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
7dda67d8decef1b3621a151488c4b83bd8372d6a 05-Feb-2009 Douglas Gregor <dgregor@apple.com> Improvements and fixes for name lookup with using directives, from Piotr Rak!

Also, put Objective-C protocols into their own identifier
namespace. Otherwise, we find protocols when we don't want to in C++
(but not in C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63877 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
ST.h
eclBase.h
eclCXX.h
eclNodes.def
eclTemplate.h
ype.h
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
ST.h
eclBase.h
eclCXX.h
eclNodes.def
eclTemplate.h
ype.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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
STContext.h
eclBase.h
eclCXX.h
eclNodes.def
eclarationName.h
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
STContext.h
eclBase.h
eclCXX.h
eclNodes.def
eclarationName.h
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.h
eclBase.h
eclNodes.def
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.h
eclBase.h
eclNodes.def
67f2cef5687a340f953ef93f53ab242c3407d1fe 02-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Split specific_decl_iterator, which had a run-time field for
determining what decls are acceptable, into specific_decl_iterator
(in which all decls matching the SpecificDecl type requirements are
acceptable) and filtered_decl_iterator (which also does a run-time
check via a member pointer non-type template parameter). This saves
some space in the iterators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63535 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclObjC.h
669c9a28fa4be35e6b6322aa7f2f3b2968189b80 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Split specific_decl_iterator, which had a run-time field for
determining what decls are acceptable, into specific_decl_iterator
(in which all decls matching the SpecificDecl type requirements are
acceptable) and filtered_decl_iterator (which also does a run-time
check via a member pointer non-type template parameter). This saves
some space in the iterators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63535 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclObjC.h
d08a62ce5e76bccf4441dee48fa24bd02f25793e 02-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Slim down the specific_decl_iterator, since NULL denotes the end of the range. Good eyes, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63528 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
d6f0b4e97e681ea5d165125960f34b3b8c19e1dc 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Slim down the specific_decl_iterator, since NULL denotes the end of the range. Good eyes, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63528 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
538a4c24fd066b19d85fe24add5fb9bdbbe971ab 02-Feb-2009 Douglas Gregor <doug.gregor@gmail.com> Check value-initializations that occur when an initializer list
provides too few elements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63525 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
87fd703e097c27d63479cb83b687d4000a22bbb1 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Check value-initializations that occur when an initializer list
provides too few elements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63525 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
677e38ffb695d3963143a4ced265248bcc2332dd 31-Jan-2009 Anders Carlsson <andersca@mac.com> Add sema support for the cleanup attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63462 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
f6e35d0b9f1e9f1b4c5d3ef924415fa5e7c89849 31-Jan-2009 Anders Carlsson <andersca@mac.com> Add sema support for the cleanup attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63462 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
0abb34b3250462874bcde8d86fc548ea10cb4240 30-Jan-2009 Chris Lattner <sabre@nondot.org> memset takes an int, not a char.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63414 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
3f17f31479cfc2be2543e3e48f79d68dc2f2c41c 30-Jan-2009 Chris Lattner <sabre@nondot.org> memset takes an int, not a char.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63414 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
882d81c0098e4bb7be2dc232a066bf5009bbf53e 30-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix inverted logic in ParentMap::hasParent()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63410 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.h
e4173c25c28bee676cfa02aa8ecbf8db3517ef70 30-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix inverted logic in ParentMap::hasParent()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63410 91177308-0d34-0410-b5e6-96231b3b80d8
arentMap.h
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.h
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.h
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.h
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.h
8d9b1d84416ce012517da473bd37ec995f897266 29-Jan-2009 Chris Lattner <sabre@nondot.org> next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc. Patch by
Anders Johnsen!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63318 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
19e8e2cffc19606d0f44e7c2897cd126ffd3f9b0 29-Jan-2009 Chris Lattner <sabre@nondot.org> next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc. Patch by
Anders Johnsen!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63318 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
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.h
86a2484a87df299b1eeb17d379337eb073394f5d 29-Jan-2009 Chris Lattner <sabre@nondot.org> Fix -Wimplicit-function-declaration, which required some refactoring and
changes in various diagnostics code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63282 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
88eccaf06f9d88191723e71bdf5ca68409393be6 29-Jan-2009 Chris Lattner <sabre@nondot.org> Fix -Wimplicit-function-declaration, which required some refactoring and
changes in various diagnostics code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63282 91177308-0d34-0410-b5e6-96231b3b80d8
STDiagnostic.h
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
STDiagnostic.h
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
STDiagnostic.h
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.h
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.h
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
ecl.h
xpr.h
xprCXX.h
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
ecl.h
xpr.h
xprCXX.h
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.h
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.h
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
STContext.h
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
STContext.h
3f1cc56852a88fe7b956b30c5676b97ba9dc7c00 27-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> ivar meta-data generation for nonfragile-abi.
Still more work to do in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63126 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
98abf4bd3526a00a0e5cf71a9462c181f97b1c81 27-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> ivar meta-data generation for nonfragile-abi.
Still more work to do in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63126 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
b4c9d6c890a42aa6930a89089ada1a6e628f4f4a 27-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix definition of __builtin_ia32_vec_set_v2di and de-XFAIL
builtins-x86.c.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63069 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
2e2558ec5f5f70ec7f7a8a7e31d0c6be9e1f567e 27-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix definition of __builtin_ia32_vec_set_v2di and de-XFAIL
builtins-x86.c.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63069 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
743345196e54ad7287cccbe16e438d5a156f22d2 26-Jan-2009 Chris Lattner <sabre@nondot.org> improve ASTContext::getDeclAlign comment, as suggested by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62975 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f65dd5681b34f195a29ddd6ee134b7743ed78cdd 26-Jan-2009 Chris Lattner <sabre@nondot.org> improve ASTContext::getDeclAlign comment, as suggested by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62975 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
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.h
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.h
ype.h
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.h
ype.h
ecddc57ef650e1bc7b836d512fd2df17cf6ec81b 24-Jan-2009 Chris Lattner <sabre@nondot.org> fix some const-correctness issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62931 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
caae7b099a0324b7c15dc89a9b70969d5d7ce996 24-Jan-2009 Chris Lattner <sabre@nondot.org> fix some const-correctness issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62931 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
PValue.h
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
PValue.h
d8a7adf951f5a13305374eb63baec09e8c695508 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a small regression in warning about template type parameter redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62886 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
efe38bdea21953f89c1504cfd1c63bee5f15b1b6 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix a small regression in warning about template type parameter redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62886 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
4ac887b57a1bdccee7ad58170b6892c7f0d8a563 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that all NamedDecls have an identifier namespace.
Make sure that we know a call is invalid if we dropped arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62882 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
3fd56d755aa74f01fbe963195c95c963ea1fee91 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure that all NamedDecls have an identifier namespace.
Make sure that we know a call is invalid if we dropped arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62882 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
710f6d41708bc34c39b75a00d9cc91cee68cf4d8 23-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.

*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62812 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
87f55cf59e82f246d8605733e9300d0c5f6830a6 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.

*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62812 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
1c71ca4d2386caf0f4da7413aec49239de710e10 21-Jan-2009 Steve Naroff <snaroff@apple.com> Removed alignment argument to delete operator. It isn't needed and Visual Studio is offended by it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62707 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7106a3aea3cdbf409aed3e32235d909a47e25501 21-Jan-2009 Steve Naroff <snaroff@apple.com> Removed alignment argument to delete operator. It isn't needed and Visual Studio is offended by it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62707 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
5868db58aa9c7d60f985f7f5163f9f976884675a 21-Jan-2009 Chris Lattner <sabre@nondot.org> initialialize some ivars in ctor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62700 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
fd52fc7cb1405f05d48f2bef284ca76df00b6649 21-Jan-2009 Chris Lattner <sabre@nondot.org> initialialize some ivars in ctor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62700 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
75324939f58f0e711da23b15297d06049b42864f 20-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Provide a placement new taking an ASTContext argument.
This allows more concise syntax when allocating an object using the ASTContext's allocator.
Convert a few allocations to this operator to for test purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62623 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
e91b3bc1624ec877862e5d276f1b6f5026fe71e3 20-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Provide a placement new taking an ASTContext argument.
This allows more concise syntax when allocating an object using the ASTContext's allocator.
Convert a few allocations to this operator to for test purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62623 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
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.h
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.h
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.h
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.def
uiltins.h
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.def
uiltins.h
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
ranslationUnit.h
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
ranslationUnit.h
ff662f1910e027b708db1e6b3c21d0294e405d5b 20-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Fix Decl::NextDeclInScope access issue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62567 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
0cba85577ae613bce5768f3089003629a46b0e7f 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix Decl::NextDeclInScope access issue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62567 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
STConsumer.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
tmt.h
tmtIterator.h
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
STConsumer.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
tmt.h
tmtIterator.h
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.h
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.h
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
ype.h
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
ype.h
beae72d7a7e768056671c306300cf619d85a0c33 19-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Fix a typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62489 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ec0d7a6f4b0699cc9960e6d9fee0f957c64d1cf9 19-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix a typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62489 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
f1791b0a471cd61641eca7f4c0815cdce2f105ea 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Eliminate tabs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62449 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4b4218f48fef71a179c5a8287dae281580faf52f 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Eliminate tabs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62449 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ype.h
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
ype.h
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.h
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.h
7b49cec50220b69d83616aea2d5da3ce049611a0 18-Jan-2009 Anders Carlsson <andersca@mac.com> Change TargetInfo::validateInputConstraint to take begin/end name iterators instead of the number of outputs. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62433 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
45b050e72d058131e6f169fe54888bb91a003fb5 18-Jan-2009 Anders Carlsson <andersca@mac.com> Change TargetInfo::validateInputConstraint to take begin/end name iterators instead of the number of outputs. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62433 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
ecl.h
ype.h
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.h
ecl.h
ype.h
5ac8ffadad9f47686a75f8014cc389d1409bed96 16-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Fix <rdar://problem/6502934>. We were creating an ImplicitCastExpr
with reference type (it should be an lvalue with non-reference type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62345 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
66b947fdf9104b53d7e8caa8f71ee0c0e3fe1521 16-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix <rdar://problem/6502934>. We were creating an ImplicitCastExpr
with reference type (it should be an lvalue with non-reference type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62345 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
tmtNodes.def
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.h
tmtNodes.def
172e06da3e1af52c97069c81acb08ce4592e1ba9 14-Jan-2009 Steve Naroff <snaroff@apple.com> Add a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62214 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
be63802d1efe52697f49aafea49a5028b30b0aff 14-Jan-2009 Steve Naroff <snaroff@apple.com> Add a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62214 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
ttr.h
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.h
ttr.h
f18783ed9d00b74377fd9e9d3fb642ae16e187d8 13-Jan-2009 Chris Lattner <sabre@nondot.org> use a slightly more sensible position for an array ref's "getExprLoc"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62182 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5cd9d6daf3acd4cc87fecebd81d9495b9e4ba9cd 13-Jan-2009 Chris Lattner <sabre@nondot.org> use a slightly more sensible position for an array ref's "getExprLoc"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62182 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
62da645073b2cd56a17a033d2dc52d645bc0b840 13-Jan-2009 Argiris Kirtzidis <akyrtzi@gmail.com> DeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (causes compilation error on MSVC).
Add DeclContext::getDeclKind() and use that instead of DeclContext::KindTrait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62164 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
9b9ca01ff3136a7539dc08a4c4e1a3dd8c8d3a7d 13-Jan-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> DeclContext::KindTrait was not meant to be used outside of DeclContext::CastTo (causes compilation error on MSVC).
Add DeclContext::getDeclKind() and use that instead of DeclContext::KindTrait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62164 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
eclBase.h
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
eclBase.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
a2d4d283094987b494293c04b3066eaa4dc0cf83 10-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> add a bunch of castToDeclContext/castFromDeclContext methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62027 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
d2685209293a54fc2d888353c1fb839dcde616ef 10-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> add a bunch of castToDeclContext/castFromDeclContext methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62027 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
e575b0e2cc586417b53cdc04205f52a9a440fd1a 10-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> add castToDeclContext/castFromDeclContext methods to RecordDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62026 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e58336400c9bea6daa4e4038ec71a61bf430dd0b 10-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> add castToDeclContext/castFromDeclContext methods to RecordDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62026 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
54e4be99d5aeccb434916d8ae1bbc339c4969208 09-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add some comments to the virtual work. Thanks to Doug Gregor for the review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62012 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c9b580a4de1824b3155048d31aaa153316e150c2 09-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add some comments to the virtual work. Thanks to Doug Gregor for the review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62012 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
83faa29958e9a74b83445f2cf462dbaff46abb94 09-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Very basic support for pure virtual functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62003 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9ba73ad65446f6bc876f40cced866d85dff754da 09-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Very basic support for pure virtual functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62003 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ecl.h
eclBase.h
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
ecl.h
eclBase.h
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.h
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.h
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
ecl.h
eclBase.h
eclObjC.h
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
ecl.h
eclBase.h
eclObjC.h
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.h
eclObjC.h
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.h
eclObjC.h
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
ecl.h
eclBase.h
eclObjC.h
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
ecl.h
eclBase.h
eclObjC.h
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
xpr.h
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
xpr.h
d9be6cd400d25ed4571e20bc843b549416527f87 08-Jan-2009 Ted Kremenek <kremenek@apple.com> Added iterator mechanism to ObjCContainerDecl to iterate over both class and instance methods at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61941 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
7ed4faca5162b3ab85be7f7e57aa40e6ec170971 08-Jan-2009 Ted Kremenek <kremenek@apple.com> Added iterator mechanism to ObjCContainerDecl to iterate over both class and instance methods at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61941 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
eclBase.h
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.h
eclBase.h
5968d4e5f1650bc358537bac0b2b3b59ee8d09eb 08-Jan-2009 Steve Naroff <snaroff@apple.com> Add missing castToDeclContext/castFromDeclContext hooks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61939 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b718b407db1f921c5a2dc0164a23582c322f8ce0 08-Jan-2009 Steve Naroff <snaroff@apple.com> Add missing castToDeclContext/castFromDeclContext hooks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61939 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
1bb38178cac3733287569ceb2b1837e16a092f34 08-Jan-2009 Steve Naroff <snaroff@apple.com> Remove a dead decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61938 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6804461f7f154b38130e421b16daf7f2890feb49 08-Jan-2009 Steve Naroff <snaroff@apple.com> Remove a dead decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61938 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
228fe4f1c7208efa3c5a7e714db4bf8ed9709c0b 08-Jan-2009 Ted Kremenek <kremenek@apple.com> Initialized member variable 'Implicit' in Decl's ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61930 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
40449fe96e2c6210ecb59515aaf939516fc09c22 08-Jan-2009 Ted Kremenek <kremenek@apple.com> Initialized member variable 'Implicit' in Decl's ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61930 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
eclObjC.h
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.h
eclObjC.h
192bee432e8731fc9479564846e7a7205fd2c488 08-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> Fix comment because we could have arbitrary number of overloaded functions with
the same name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61920 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
41761d67291ae9ac74843f31737a96157d982c0b 08-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> Fix comment because we could have arbitrary number of overloaded functions with
the same name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61920 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
xpr.h
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
xpr.h
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.h
eclBase.h
eclCXX.h
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.h
eclBase.h
eclCXX.h
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
eclBase.h
eclObjC.h
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
eclBase.h
eclObjC.h
3a423135abbd36c8f1fbe6becbfb8aee0ba8583c 07-Jan-2009 Douglas Gregor <doug.gregor@gmail.com> Use DeclContext::getLookupContext wherever necessary to ensure that we look through transparent contexts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61861 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e21b99468ad408694caf4b4efbbb57ef9d89f99f 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Use DeclContext::getLookupContext wherever necessary to ensure that we look through transparent contexts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61861 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ecl.h
eclBase.h
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
ecl.h
eclBase.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
ab6168ebac90bcce5259b869c5b56741d52e1fb4 06-Jan-2009 Chris Lattner <sabre@nondot.org> add a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61797 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
d62fdc448b3ace606c8c9c9f13e43218fa204dbf 06-Jan-2009 Chris Lattner <sabre@nondot.org> add a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61797 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
ype.h
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.h
xprCXX.h
tmtNodes.def
ype.h
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.h
eclCXX.h
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.h
eclCXX.h
f463b9a2835c52f7ba564fdf61df4e55cd5c3db8 29-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Remove hasKind(). Use existing getKind().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61476 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
fc820a4394a33e4fccfd8283909d425708311d41 29-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Remove hasKind(). Use existing getKind().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61476 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
adf0b32b2643e05d9fb355148f026ba9fd7f2ecb 26-Dec-2008 Anders Carlsson <andersca@mac.com> Add __builtin_flt_rounds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61443 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
cfd489c46c9c004f410ced6fda985cb7a84a6515 26-Dec-2008 Anders Carlsson <andersca@mac.com> Add __builtin_flt_rounds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61443 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
4aab7fd69f9e49d906eaf302c5c3adfb09ff0e30 26-Dec-2008 Anders Carlsson <andersca@mac.com> Add two more builtins

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61439 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
3cd860c3e0b2ee64b3d5515569eeceecfc3901d5 26-Dec-2008 Anders Carlsson <andersca@mac.com> Add two more builtins

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61439 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
b27a8700761e1c1f955fc5cc3663289179c9e4d2 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61437 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
2f402708e62f89fb875442802e3d3f20fc909d33 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61437 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
ype.h
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
ype.h
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
ype.h
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
ype.h
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.h
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.h
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
ecl.h
xprCXX.h
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
ecl.h
xprCXX.h
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.h
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.h
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.h
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.h
b9b218e566459808be9f1c52b03afad3e0d39ed3 23-Dec-2008 Chris Lattner <sabre@nondot.org> Add a setter for CVR qualifiers, patch by Lukasz Janyst!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61367 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a3ab4b85f54090927c2dfa2585b9f0e48509e944 23-Dec-2008 Chris Lattner <sabre@nondot.org> Add a setter for CVR qualifiers, patch by Lukasz Janyst!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61367 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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
eclCXX.h
tmt.h
tmtNodes.def
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
eclCXX.h
tmt.h
tmtNodes.def
eec780da21a612b4b74f255ed37bed3bb50bbcac 22-Dec-2008 Anders Carlsson <andersca@mac.com> Implement the last intrinsics, _mm_insert_pi16 is the last remaining one now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61330 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
a6431dc8d2ebf54de31323bae1fd197dc165f8b2 22-Dec-2008 Anders Carlsson <andersca@mac.com> Implement the last intrinsics, _mm_insert_pi16 is the last remaining one now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61330 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ecl.h
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
ecl.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
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.h
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.h
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.h
xprObjC.h
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.h
xprObjC.h
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.h
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.h
e6be68ae1f97c922d437e89e74c95660b0b98e70 17-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Delay semantic analysis of the C++ names casts when the subexpression is type-dependent or the destination type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61165 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9103bb27f4eefa0e0d7935387750e3aca24abc49 17-Dec-2008 Douglas Gregor <dgregor@apple.com> Delay semantic analysis of the C++ names casts when the subexpression is type-dependent or the destination type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61165 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
eclObjC.h
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.h
eclObjC.h
ca328c32e7a189914842e667e4f3e4b65a531082 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Consolidated property check into property-typecheck-1.m file.
Improved on property diagnostics.
Added a FIXME per Steve's comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61141 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0b65b1dc5abed26492740206c24e86271c9dca6b 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Consolidated property check into property-typecheck-1.m file.
Improved on property diagnostics.
Added a FIXME per Steve's comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61141 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
746a24c07ce5704fecafd00c396b32d4e3dc612c 17-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Remove the crufty reverse_decl_iterator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61139 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
270b4146ad54784ce41d0374e6a894eaab6c1650 17-Dec-2008 Douglas Gregor <dgregor@apple.com> Remove the crufty reverse_decl_iterator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61139 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
b0b42f6f5b944688eefd7fba53c76c0b2230512e 17-Dec-2008 Chris Lattner <sabre@nondot.org> diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name. This implements PR3208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
777f07b6cd595bb0922e05768e5703fbc92b5695 17-Dec-2008 Chris Lattner <sabre@nondot.org> diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name. This implements PR3208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8f9b1b29de881c59cd08fceafe30b385e9684931 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Semantics of @protocol attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61114 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
bc1c877fe28fb6a825f0b226a0a2da99e713ea03 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Semantics of @protocol attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61114 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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
STContext.h
ecl.h
eclCXX.h
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
STContext.h
ecl.h
eclCXX.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ecl.h
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
ecl.h
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.h
xprObjC.h
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.h
xprObjC.h
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.h
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.h
98341049a14443ad41927de25d8950936a39aedd 12-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Enable out-of-line definitions of C++ constructors and destructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60947 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
9d35097bc0fefb2f77638be513cac72d1c09d840 12-Dec-2008 Douglas Gregor <dgregor@apple.com> Enable out-of-line definitions of C++ constructors and destructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60947 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
ecl.h
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
ecl.h
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
ecl.h
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
ecl.h
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.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclarationName.h
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.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclarationName.h
48840c744b86163706d32fe4f75a6c9f04f43730 11-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Added a warning when referencing an if's condition variable in the
"else" clause, e.g.,

if (int X = foo()) {
} else {
if (X) { // warning: X is always zero in this context
}
}

Fixes rdar://6425550 and lets me think about something other than
DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60858 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
caaf29a08761b14fbe42a29080c22dd6961056d1 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Added a warning when referencing an if's condition variable in the
"else" clause, e.g.,

if (int X = foo()) {
} else {
if (X) { // warning: X is always zero in this context
}
}

Fixes rdar://6425550 and lets me think about something other than
DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60858 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
2715a1f5a94534980bd61dab5652a3d8c03be39c 08-Dec-2008 Douglas Gregor <doug.gregor@gmail.com> Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it belongs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60708 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
f57172b24f08a68d179675989813d5479dc87829 08-Dec-2008 Douglas Gregor <dgregor@apple.com> Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it belongs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60708 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
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.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
xpr.h
ype.h
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.h
xpr.h
ype.h
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.h
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.h
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.h
ecl.h
eclBase.h
eclCXX.h
ype.h
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.h
ecl.h
eclBase.h
eclCXX.h
ype.h
e5cb586c259546f534d30df1c39b77e49dd3a839 05-Dec-2008 Chris Lattner <sabre@nondot.org> change getCurFunctionDecl to skip through Block contexts to find
the containing block. Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places. This fixes rdar://6405429.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60564 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
371f258e61e1365b951b17931a3c5ac1530fd1a0 05-Dec-2008 Chris Lattner <sabre@nondot.org> change getCurFunctionDecl to skip through Block contexts to find
the containing block. Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places. This fixes rdar://6405429.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60564 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f7b2b4cc4c839523b19e519d1298a08d13b7e91c 04-Dec-2008 Steve Naroff <snaroff@apple.com> Fix build breakage from my previous commit.

Will discuss with Chris...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60545 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
3fa1fff997eb9119b922aa18934d0a5f7364a1d7 04-Dec-2008 Steve Naroff <snaroff@apple.com> Fix build breakage from my previous commit.

Will discuss with Chris...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60545 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
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
xprObjC.h
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
xprObjC.h
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.h
xprCXX.h
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.h
xprCXX.h
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.h
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.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
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.h
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.h
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
xpr.h
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
xpr.h
f6c835deaf7e18292feda05162d683d4538e68f9 30-Nov-2008 Anders Carlsson <andersca@mac.com> Add Expr::EvalResult struct. (Not used just yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60295 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
94deaf675ae60e11c2d9475c6dbfd0c7123160f5 30-Nov-2008 Anders Carlsson <andersca@mac.com> Add Expr::EvalResult struct. (Not used just yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60295 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b0ddba7680089c5efea2bfe4eef9364f5c7ad515 29-Nov-2008 Anders Carlsson <andersca@mac.com> CXXFunctionalCastExpr inherits from ExplicitCastExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60249 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
960525cbfbfd46308090ec13946fcb250c887f09 29-Nov-2008 Anders Carlsson <andersca@mac.com> CXXFunctionalCastExpr inherits from ExplicitCastExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60249 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
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.h
tmtNodes.def
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.h
tmtNodes.def
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
ype.h
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
ype.h
bcda0b464e0df135b03758b84168707c81fbeb86 26-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Set default property attributes on each property.
Implemented anonymous category (also know as continuation class)
used to override main class's property attribute. This is work in
propgress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60114 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
8cf0bb3c2a798ce3acacaac2d3178648cd4c65c6 26-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Set default property attributes on each property.
Implemented anonymous category (also know as continuation class)
used to override main class's property attribute. This is work in
propgress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60114 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
271d4c2c75e2b6774cc017506d3b27e4fa1697ff 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d9d22dd9c94618490dbffb0e2caf222530ca39d3 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9c2ea3785c93cc1289735cc4ce855df7e832afa7 24-Nov-2008 Anders Carlsson <andersca@mac.com> __builtin_constant_p takes an argument that can have any type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59944 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
85879ee8b5942f97337bcb35ba4df9d4c634c68c 24-Nov-2008 Anders Carlsson <andersca@mac.com> __builtin_constant_p takes an argument that can have any type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59944 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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
ecl.h
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
ecl.h
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
ecl.h
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
ecl.h
254de7dd490d1163d6dad4302f5d8b7f9ae3dc30 23-Nov-2008 Chris Lattner <sabre@nondot.org> add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString(). This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59916 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
ype.h
011bb4edf731d529da1cbf71c7c2696aaf5a054f 23-Nov-2008 Chris Lattner <sabre@nondot.org> add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString(). This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59916 91177308-0d34-0410-b5e6-96231b3b80d8
eclarationName.h
ype.h
da5c087ebf3d47b40bae2e99671ce1929156a427 23-Nov-2008 Chris Lattner <sabre@nondot.org> Add support for sending QualType's directly into diags and convert two
diags over to use this. QualTypes implicitly print single quotes around
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59907 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
22caddc91d2f6186739c6b20ec58ed38cd68e595 23-Nov-2008 Chris Lattner <sabre@nondot.org> Add support for sending QualType's directly into diags and convert two
diags over to use this. QualTypes implicitly print single quotes around
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59907 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
xpr.h
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
xpr.h
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
xpr.h
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
xpr.h
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.h
xprObjC.h
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.h
xprObjC.h
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.h
xprObjC.h
tmtNodes.def
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.h
xprObjC.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
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.h
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.h
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.h
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.h
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
eclarationName.h
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
eclarationName.h
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.h
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.h
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.h
eclCXX.h
eclarationName.h
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.h
eclCXX.h
eclarationName.h
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
eclBase.h
eclarationName.h
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
eclBase.h
eclarationName.h
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.h
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.h
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.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclarationName.h
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.h
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
eclarationName.h
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.h
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.h
92bf5bd8de39fde937a719dbe31493fdfa8754d3 16-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59419 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
58ace88985b920971b052de8a9a7b89de0654dc0 16-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59419 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
d8fc4fcb055be3f7017283ba40616133a2fb3afd 16-Nov-2008 Chris Lattner <sabre@nondot.org> move some APValue methods out of line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59410 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
a9ab5d6bcf42dfd4f058ee3b1fbb32456c0bdfe8 16-Nov-2008 Chris Lattner <sabre@nondot.org> move some APValue methods out of line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59410 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
tmtNodes.def
tmtVisitor.h
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.h
tmtNodes.def
tmtVisitor.h
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.h
ypeOrdering.h
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.h
ypeOrdering.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
5c8658d33964f85b8c00e4329e26a17a99c80e2c 13-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Fix compilation on 64-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59192 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
b7c3ca8af0a1a3b66fb220562c72dd3102153d5b 13-Nov-2008 Douglas Gregor <dgregor@apple.com> Fix compilation on 64-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59192 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
550b80cc22ad79f0e4b59eaf11f4ecdca926cc8b 12-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Slightly improve type hash

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59173 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
b995d799e146a7d43a3e8311adb54653415434a1 12-Nov-2008 Douglas Gregor <dgregor@apple.com> Slightly improve type hash

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59173 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
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.h
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.h
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.h
ypeOrdering.h
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.h
ypeOrdering.h
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
xpr.h
tmtNodes.def
tmtVisitor.h
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
xpr.h
tmtNodes.def
tmtVisitor.h
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
xprCXX.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
45014fd2d7e50079dc092df04fec9af7ea0cb0e0 10-Nov-2008 Douglas Gregor <doug.gregor@gmail.com> Basic support for taking the address of an overloaded function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59000 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
904eed3f6148758d39a2d3c88f3133274460d645 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Basic support for taking the address of an overloaded function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59000 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
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.h
eclCXX.h
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.h
eclCXX.h
054a2638e71d2633851f262749de76808224ae6e 08-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Implement Sema support for C++ nested-name-specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58916 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclCXX.h
ef6e647b8d3268a765c2c4dd7f8a73cad281a8e6 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement Sema support for C++ nested-name-specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58916 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
eclCXX.h
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.h
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.h
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.h
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.h
c9e909c35b3c0610930fb5fb07a66d768dc6dc61 07-Nov-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Changes in preparation for nested-name-specifiers.

-When parsing declarators, don't depend on "CurScope->isCXXClassScope() == true" for constructors/destructors
-For C++ member declarations, don't depend on "Declarator.getContext() == Declarator::MemberContext"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58866 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
c7ed9c60b8ee04b119e23441cae2cfec74536ba9 07-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Changes in preparation for nested-name-specifiers.

-When parsing declarators, don't depend on "CurScope->isCXXClassScope() == true" for constructors/destructors
-For C++ member declarations, don't depend on "Declarator.getContext() == Declarator::MemberContext"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58866 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
a1cf66a5674bc3fed6f595345c597466e07d2450 06-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Sema-check virtual declarations. Complete dynamic_cast checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58804 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
d93f0ddba0965ded252e228134b30ce30e863fb0 06-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Sema-check virtual declarations. Complete dynamic_cast checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58804 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
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.h
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.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
xprObjC.h
tmtNodes.def
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.h
xprObjC.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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
xpr.h
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
xpr.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ecl.h
eclBase.h
eclCXX.h
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
ecl.h
eclBase.h
eclCXX.h
f441c73035ae4159c3738ece8252645a5691ed03 30-Oct-2008 Ted Kremenek <kremenek@apple.com> Add iterator/reverse_iterator to InitListExpr for iteration over the subexpressions of an initializer list. This is basically the same as child_iterator except reverse iteration is possible (which will be used by GRExprEngine::VisitInitListExpr).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58438 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7fcfa4a9b5054bc2a3bc65093f9d2e9e67a70838 30-Oct-2008 Ted Kremenek <kremenek@apple.com> Add iterator/reverse_iterator to InitListExpr for iteration over the subexpressions of an initializer list. This is basically the same as child_iterator except reverse iteration is possible (which will be used by GRExprEngine::VisitInitListExpr).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58438 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
f5660a9835287fcb7b93634b35a8faad6006b24c 29-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Make the non-reference check in Expr work always

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58388 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
f7c2aa0b049272d8f318988c1965760dcb852578 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Make the non-reference check in Expr work always

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58388 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
6a3008456334d17f7b68ccfa54ffaf39bb58fbd4 28-Oct-2008 Daniel Dunbar <daniel@zuster.org> 80-col fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58341 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8320aaaa01d931aa234fc3bce05b399ef41898d5 28-Oct-2008 Daniel Dunbar <daniel@zuster.org> 80-col fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58341 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
0a2da71034fea55ee786387314eae704b91e2f9b 28-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add attribute always_inline support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58304 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
af668b0e7d3581dea3b4f29a9262686e83887e5b 28-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add attribute always_inline support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58304 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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.h
tmt.h
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.h
tmt.h
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
ecl.h
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
ecl.h
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.h
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.h
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.h
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.h
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.h
eclCXX.h
ype.h
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.h
eclCXX.h
ype.h
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
eclCXX.h
ype.h
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
eclCXX.h
ype.h
55c645a12b73cabf6b8e19fbe8b3b3375f06d6e4 24-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Make QualTypeOrdering::operator() const

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58097 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
2b9d973eb749aee6becbcf5e51ab5d49b828c978 24-Oct-2008 Douglas Gregor <dgregor@apple.com> Make QualTypeOrdering::operator() const

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58097 91177308-0d34-0410-b5e6-96231b3b80d8
ypeOrdering.h
6eb489ef92bad10bc25072c489d03d0dc0879ccd 24-Oct-2008 Ted Kremenek <kremenek@apple.com> Added iterators for types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58050 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
e22d911dcff7a9c18b583817b7319c07600fd3ee 24-Oct-2008 Ted Kremenek <kremenek@apple.com> Added iterators for types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58050 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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
ype.h
ypeOrdering.h
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
ype.h
ypeOrdering.h
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.h
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.h
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
ype.h
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
ype.h
3fb675ab045253ffe2f1b333e9f8e746b50abeb4 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Move Sema::GetNonReferenceType to QualType::getNonReferenceType and make it inline

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57951 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e0a5d5fe8eab573f7764bf6d2ddb02bee8dceaf9 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Move Sema::GetNonReferenceType to QualType::getNonReferenceType and make it inline

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57951 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e5db4f7d7b6dc33259ee0248d73dd3794cd0a841 22-Oct-2008 Douglas Gregor <doug.gregor@gmail.com> Fix a thinko in the qualification-conversion check when the qualificaitons are disjoint, and add some overloading-based tests of qualification conversions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57942 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
9b6e2d209cc2931a9bb2ae51e744a8698b54db73 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Fix a thinko in the qualification-conversion check when the qualificaitons are disjoint, and add some overloading-based tests of qualification conversions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57942 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ype.h
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
ype.h
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.h
eclBase.h
eclCXX.h
xpr.h
ype.h
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.h
eclBase.h
eclCXX.h
xpr.h
ype.h
3cbc064cf343c2151488b7822430ed327ade176e 19-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Change a couple of cast<> to reinterpret_cast<>.
The casts<> require that "Decl.h" is included before "Type.h", use reinterpret_cast<> to remove that kind of dependency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57781 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
509447e7cb9c24a9f2bd149fe95030050b088622 19-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change a couple of cast<> to reinterpret_cast<>.
The casts<> require that "Decl.h" is included before "Type.h", use reinterpret_cast<> to remove that kind of dependency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57781 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.def
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.def
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.h
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.h
aa01a1079f4b240de74ede930c98200c356bce27 17-Oct-2008 Mon P Wang <wangmp@apple.com> Fixed vec_set_v2di signature


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57696 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
6d5e211fc5b324cc8847f4d791db2c773ef4791a 17-Oct-2008 Mon P Wang <wangmp@apple.com> Fixed vec_set_v2di signature


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57696 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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.h
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.h
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.h
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.h
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
ttr.h
ecordLayout.h
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
ttr.h
ecordLayout.h
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
xpr.h
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
xpr.h
9e43be159355338a5eba1d251a961af58ed77da1 15-Oct-2008 Mon P Wang <wangmp@apple.com> Added pinsrd, pinsrq, and some other vector intrinsics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57563 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
bc4f4030e245e36642f894d848f6a8bf94426cc2 15-Oct-2008 Mon P Wang <wangmp@apple.com> Added pinsrd, pinsrq, and some other vector intrinsics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57563 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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.h
eclBase.h
eclCXX.h
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.h
eclBase.h
eclCXX.h
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
xpr.h
xprObjC.h
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
xpr.h
xprObjC.h
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
ype.h
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
ype.h
32af58ce89a59dfc9520412338b84b5be78d2246 12-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> More const-ness goodness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57420 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
e2ed203b437c14de57a80d69b70164819d045d86 12-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> More const-ness goodness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57420 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
ecl.h
eclBase.h
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
ecl.h
eclBase.h
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
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
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
ecl.h
eclBase.h
eclCXX.h
eclObjC.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
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.h
eclBase.h
xpr.h
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.h
eclBase.h
xpr.h
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
tmt.h
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
tmt.h
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.h
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.h
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.h
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.h
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.h
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.h
bca33bfeb5bda73ae1cce89e3080f61a926c3d57 07-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr.
Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization.

In the case of "int x( expression );":
-The Init expression of VarDecl 'x' will be the expression inside the parentheses.
-VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57219 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ce8e2926d8922bff7dc2661ec9c043dd619dcc82 07-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr.
Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization.

In the case of "int x( expression );":
-The Init expression of VarDecl 'x' will be the expression inside the parentheses.
-VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57219 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5c29a5a9408d216d1a7c7d59913f94445a5218e9 07-Oct-2008 Ted Kremenek <kremenek@apple.com> Remove DeclStmt::getDecl(). Now clients of DeclStmt must explicitly reason about a DeclStmt referring to a collection of Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57217 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
655137a6c19110620d82d5f03cdcaec3a48c059f 07-Oct-2008 Ted Kremenek <kremenek@apple.com> Remove DeclStmt::getDecl(). Now clients of DeclStmt must explicitly reason about a DeclStmt referring to a collection of Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57217 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
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.h
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.h
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.h
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.h
6af830594002e5eb15afb5e82a5c1e66b81ed793 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Add const_decl_iterator to DecStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57186 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8a0d2660b6890ed95d34f37d142c0c52ac490194 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Add const_decl_iterator to DecStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57186 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
9e55d46140b05ed4dc7230b86ccf504a9a71985e 06-Oct-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Implement support for C++ direct initializers in declarations, e.g. "int x(1);".

This is how this kind of initializers appear in the AST:
-The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
-The new VarDecl::hasCXXDirectInitializer() returns true.

e.g, for "int x(1);":
-VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
-hasCXXDirectInitializer() of VarDecl 'x' returns true.

A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
Note that codegening works now for "int x(1);" without any changes to CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57178 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
73a0d889eda0f000a441319e39540509175b8e81 06-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for C++ direct initializers in declarations, e.g. "int x(1);".

This is how this kind of initializers appear in the AST:
-The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
-The new VarDecl::hasCXXDirectInitializer() returns true.

e.g, for "int x(1);":
-VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
-hasCXXDirectInitializer() of VarDecl 'x' returns true.

A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
Note that codegening works now for "int x(1);" without any changes to CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57178 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
73bd38ec64c21212e122d754524ec6c227db2dfc 06-Oct-2008 Chris Lattner <sabre@nondot.org> Remove the 'C' / isConstantExpr flag on builtins. Code should never
depend on the value of this flag, it should depend on whether
tryEvaluate is able to *actually* fold a builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57160 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
uiltins.h
6b47561af738b33c55c60776c3b095f049902308 06-Oct-2008 Chris Lattner <sabre@nondot.org> Remove the 'C' / isConstantExpr flag on builtins. Code should never
depend on the value of this flag, it should depend on whether
tryEvaluate is able to *actually* fold a builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57160 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
uiltins.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
dd6791c806f39b878486285c7725ba09844bf8ed 06-Oct-2008 Anders Carlsson <andersca@mac.com> Implement support for the const and pure attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57142 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
232eb7d33b96ad8f99de3b5ae840421b3a7c6cb7 06-Oct-2008 Anders Carlsson <andersca@mac.com> Implement support for the const and pure attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57142 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
c6f230d205bd7767f6973e2c2463567f2c9c4777 05-Oct-2008 Chris Lattner <sabre@nondot.org> Fix a problem reported in PR2766 that makes clang reject old versions
of GCC's headers. This impacts people that run clang in Tiger systems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57126 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
8223b1d05fc6f46e76bb06d836c1e6dec764e65b 05-Oct-2008 Chris Lattner <sabre@nondot.org> Fix a problem reported in PR2766 that makes clang reject old versions
of GCC's headers. This impacts people that run clang in Tiger systems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57126 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
e083e693e8cd5fa816311a13bd593e50f2e4d833 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix X86 palignr[128] builtins to match LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57102 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
affc3a9bfa794f9e781ba42491f9d16cb3d1abd6 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix X86 palignr[128] builtins to match LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57102 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
5356a3277126d7aff7fbecbe370af585c4692276 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix another X86 builtin definitions.
- vec_set_v4hi had "v4s" in place of "V4s"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57099 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
ec04b2622ab31655a7e06033f2b05384bf43688f 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix another X86 builtin definitions.
- vec_set_v4hi had "v4s" in place of "V4s"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57099 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
f328b1b32f1c959dab9237f4bd3d19accf5d32f8 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix some X86 builtin definitions.
- cmp instructions return int
- storedqu had bad const qualifier
- pmuldq128 used invalid type code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57098 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
1827db7711cb88e152999ae94f930ebc8d2c53a8 05-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix some X86 builtin definitions.
- cmp instructions return int
- storedqu had bad const qualifier
- pmuldq128 used invalid type code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57098 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
aeaf7eff830282cdf1e57b4eeb28833d57c9d4ed 03-Oct-2008 Steve Naroff <snaroff@apple.com> - Add a convenience constructor to Type.
- Many rewriter modifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57003 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
83ba14e260193a67bba3772134d1d428a1b1c394 03-Oct-2008 Steve Naroff <snaroff@apple.com> - Add a convenience constructor to Type.
- Many rewriter modifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57003 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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
uiltins.def
uiltins.h
xpr.h
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
uiltins.def
uiltins.h
xpr.h
4070a6f343ee6a0edf1161d4f6efc5e2c8ffc869 02-Oct-2008 Mon P Wang <wangmp@apple.com> Added SSE4.1 blend intrinsics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56936 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
946685626eb427b6c9b013b4d4de61cdd729363c 02-Oct-2008 Mon P Wang <wangmp@apple.com> Added SSE4.1 blend intrinsics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56936 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
1473f5255cb08085bb5476543a7dfee0da8933be 30-Sep-2008 Mon P Wang <wangmp@apple.com> Added support for sse intrinsics loadlpd, loadhpd, muldq128, and mulld128


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56830 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
7f57b000f232bc596dca627c976ace250c8171e3 30-Sep-2008 Mon P Wang <wangmp@apple.com> Added support for sse intrinsics loadlpd, loadhpd, muldq128, and mulld128


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56830 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
4eb0ce90d398b78c7a44ab74af6a0345adc04c3d 29-Sep-2008 Chris Lattner <sabre@nondot.org> move ExtVectorElementExpr down into the 'clang extensions' section.
Wrap line to 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56805 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a09f585a7fdbb01b4bf9de3679fd37005379ca66 29-Sep-2008 Chris Lattner <sabre@nondot.org> move ExtVectorElementExpr down into the 'clang extensions' section.
Wrap line to 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56805 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b23469fe1918b0e8154fcc54e3ec395cc4e1c4aa 28-Sep-2008 Chris Lattner <sabre@nondot.org> Replace a comparison with a static list of builtins that was wrong (it
wasn't covering checking builtins like __builtin___vsnprintf_chk) with
a check that won't get out of date.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56767 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.h
bd7eb1c3b2af5cd0a7540c79da85e2ce15a893f4 28-Sep-2008 Chris Lattner <sabre@nondot.org> Replace a comparison with a static list of builtins that was wrong (it
wasn't covering checking builtins like __builtin___vsnprintf_chk) with
a check that won't get out of date.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56767 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.h
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.h
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.h
f82d2b2274b4f6b6516fb276ae93b5881fc8960a 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Forgot to check in header file with last commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56709 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
e7b8d400208e886a167a4481a9024295a3ce17d1 27-Sep-2008 Ted Kremenek <kremenek@apple.com> Forgot to check in header file with last commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56709 91177308-0d34-0410-b5e6-96231b3b80d8
eclGroup.h
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.h
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.h
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.h
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.h
e1cecbae5d675d1c9abdd9be8fb4e915139de509 18-Sep-2008 Steve Naroff <snaroff@apple.com> Finish pushing blocks attribute through the clang attribute machinery.
Also added a couple simple tests from the "gcc.apple" test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56309 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
9eae5761c0691c0f11d7a823b8ee54f05786cbbe 18-Sep-2008 Steve Naroff <snaroff@apple.com> Finish pushing blocks attribute through the clang attribute machinery.
Also added a couple simple tests from the "gcc.apple" test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56309 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
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.h
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.h
rettyPrinter.h
tmt.h
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.h
rettyPrinter.h
tmt.h
dd54e91707d7fd748125776abcec5527212251d6 12-Sep-2008 Daniel Dunbar <daniel@zuster.org> Round out object size checking builtins (fprintf ones disabled as we
have no mapping to FILE*). We are also missing printf format
attributes for the printf style ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56168 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
df3ffb300a2b6f26707fa32f66c549091f3643aa 12-Sep-2008 Daniel Dunbar <daniel@zuster.org> Round out object size checking builtins (fprintf ones disabled as we
have no mapping to FILE*). We are also missing printf format
attributes for the printf style ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56168 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
c11aadbb9d897b7ccfcf1dce07c17b17713a5370 11-Sep-2008 Mon P Wang <wangmp@apple.com> Added SSE41 pminsd, pmaxsd, roundps and a few others


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56114 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
3e877ec791fb8f4b752b3193021c86b878082a4c 11-Sep-2008 Mon P Wang <wangmp@apple.com> Added SSE41 pminsd, pmaxsd, roundps and a few others


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56114 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
6e4dec42542f1bf02674226cd30b1e93ba343cf5 11-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add ObjCMethodDecl::getSourceRange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56083 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9776ba0d844cf9f6888e871e3fd246ae782f76f4 11-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add ObjCMethodDecl::getSourceRange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56083 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
xpr.h
xprCXX.h
tmtNodes.def
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
xpr.h
xprCXX.h
tmtNodes.def
3b3b028f58587b0713383e51e11aa6856a1eddad 09-Sep-2008 Mon P Wang <wangmp@apple.com> Added SSE4.1 packusdw


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55978 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
e01c2c9e072ed46ff791c8e9fb859786c6dae96e 09-Sep-2008 Mon P Wang <wangmp@apple.com> Added SSE4.1 packusdw


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55978 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
220cc9945b241f3d77b8c1810c2f9532cfb43486 09-Sep-2008 Mon P Wang <wangmp@apple.com> Added SSE41 pmovsx pmovzx intrinsics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55967 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
f47be933bef073708c2536fa69ef946e7fe08134 09-Sep-2008 Mon P Wang <wangmp@apple.com> Added SSE41 pmovsx pmovzx intrinsics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55967 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
5eea562fd2ab2f3a3c6090fb91ca69e3043d4c8f 08-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add ThreadSpecified bit to Decl.
- Patch from Kevin Tew.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55940 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6f0200e9ebf7f65df74b3cf55b4319b075b244a2 08-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add ThreadSpecified bit to Decl.
- Patch from Kevin Tew.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55940 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ecl.h
eclCXX.h
ype.h
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.h
ecl.h
eclCXX.h
ype.h
435adbe78af0b462e0826c3354cf3aecb79dff89 05-Sep-2008 Daniel Dunbar <daniel@zuster.org> Fix placement of const on a number of X86 builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55827 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
797a35d8a426e85e32d524e833b244242d0edb5d 05-Sep-2008 Daniel Dunbar <daniel@zuster.org> Fix placement of const on a number of X86 builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55827 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
4fea7b688be1fd4fd3fd34ed70127c78904eaa91 04-Sep-2008 Steve Naroff <snaroff@apple.com> Touchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to check for block pointers.
Added a couple FIXME's wrt PointLikeType. If the author reads this, it would be great to get some background on this class (thanks in advance).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55778 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
39218dfef550ad1cd7b7ece83a715996a113ffd1 04-Sep-2008 Steve Naroff <snaroff@apple.com> Touchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to check for block pointers.
Added a couple FIXME's wrt PointLikeType. If the author reads this, it would be great to get some background on this class (thanks in advance).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55778 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
30ad42d076bf0b3804f641ef2a006cc1486a9a5e 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add __builtin_object_size support.
- Currently CodeGen always returns a conservative value for this (-1
or 0 depending on the context).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55735 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
d5f8a4fd4d6dfb0415b93bb7ab721bba5cab1332 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add __builtin_object_size support.
- Currently CodeGen always returns a conservative value for this (-1
or 0 depending on the context).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55735 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
e4031f2b7eeba198f7560bf7f6f35d10e685adf3 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Modify object size checking builtins to lower to libc calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55721 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
b0a86c21f934d2dd9d5a6da2e52ee833da1d437b 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Modify object size checking builtins to lower to libc calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55721 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
tmtNodes.def
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.h
tmtNodes.def
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
xprObjC.h
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
xprObjC.h
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.h
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.h
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.h
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.h
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.h
eclCXX.h
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.h
eclCXX.h
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.h
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.h
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.h
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.h
42b265fccb1d7357ef3239848fe4696f87d1f1ea 29-Aug-2008 Nico Weber <nicolasweber@gmx.de> fix a comment that was forgotten in r54071

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55543 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
91c027e2021366396696977af7fdc0e070bdd614 29-Aug-2008 Nico Weber <nicolasweber@gmx.de> fix a comment that was forgotten in r54071

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55543 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
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.h
d38e358df9caf6494cf0e0222dec39c9a48c3b56 28-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Fix compilation error on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55465 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
77a49f6b1e5741f6bda71eb7837b43343925027b 28-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix compilation error on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55465 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
6b57d43f67bb4f9bfec53e65ce4787ccf9f4445d 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Objective-C @synthesize support.
- Only supports simple assignment and atomic semantics are ignored.
- Not quite usable yet because the methods do not actually get added
to the class metadata.
- Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain).
- Rearrange CodeGenFunction so synthesis can reuse function prolog /
epilog code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55365 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
af05bb9073319d8381b71c4325188853fd4b8ed6 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Objective-C @synthesize support.
- Only supports simple assignment and atomic semantics are ignored.
- Not quite usable yet because the methods do not actually get added
to the class metadata.
- Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain).
- Rearrange CodeGenFunction so synthesis can reuse function prolog /
epilog code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55365 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
eaf91c3bc35b4802d65c0213388b600108a8c735 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> 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@55356 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
451318c08a6342c10b8986060386fd9274418437 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> 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@55356 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
d83141a546b6aa53591ec8ba684da5364661abc6 24-Aug-2008 Anders Carlsson <andersca@mac.com> Add support for parsing the objc_gc attribute. Tests will come shortly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55269 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
aa0d25b44e510a5a62e7345f4fa3840a886841d2 24-Aug-2008 Anders Carlsson <andersca@mac.com> Add support for parsing the objc_gc attribute. Tests will come shortly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55269 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
07f9adeda2118c4a8739736befc3c102b5ef1d62 23-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> CXXFunctionalCastExpr is a subclass of CastExpr. Make it known to isa/dyn_cast/cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cb6accb4659af86627ce43f7a90bc92f763b075e 23-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> CXXFunctionalCastExpr is a subclass of CastExpr. Make it known to isa/dyn_cast/cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
xprCXX.h
tmtNodes.def
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
xprCXX.h
tmtNodes.def
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.h
ype.h
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.h
ype.h
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.h
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.h
67e778b69acc0d657966c50e9df7118ecfdc1b7f 21-Aug-2008 Daniel Dunbar <daniel@zuster.org> NeXT: Emit [meta]class protocol references.

Updated ObjCProtocolDecl::protocol_iterator to match that of
ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55143 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
dbc933701d20918add13b6a3c9d47ff8c75419cf 21-Aug-2008 Daniel Dunbar <daniel@zuster.org> NeXT: Emit [meta]class protocol references.

Updated ObjCProtocolDecl::protocol_iterator to match that of
ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55143 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
eclObjC.h
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.h
eclObjC.h
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.h
tmtNodes.def
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.h
tmtNodes.def
85bd81edce4057156d7f49408147f07daa675096 17-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Type::isIntegerType() returns true for types between Bool and LongLong.
Put WChar between them to make it integer type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54882 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2ff9b4c7c8fed9233a0b8de2e9507368c451aab6 17-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Type::isIntegerType() returns true for types between Bool and LongLong.
Put WChar between them to make it integer type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54882 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fb8e934a91506d30734770061922b1402cdae6e1 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update Expr::{getIntegerConstantExprValue, isIntegerConstantExpr} to
use default APSInt constructor instead of embedding arbitrary
constant.

Update OverloadExpr::getNumArgs to use getIntegerConstantExprValue.

Update OverloadExpr::getExpr to be const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54828 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8070a8497c0fb3e6f70a557f788405d8945b1208 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update Expr::{getIntegerConstantExprValue, isIntegerConstantExpr} to
use default APSInt constructor instead of embedding arbitrary
constant.

Update OverloadExpr::getNumArgs to use getIntegerConstantExprValue.

Update OverloadExpr::getExpr to be const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54828 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
232200866d298066c4a22e7d92587f3cd856bd7c 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Ident class tree in DeclBase properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54826 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
226e04a9b7790a7311aff2aa9df340c1841e20e3 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Ident class tree in DeclBase properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54826 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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.h
xprCXX.h
xprObjC.h
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.h
xprCXX.h
xprObjC.h
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.h
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.h
929832c339a9c0311b76f8580455ab5b40df2d9d 10-Aug-2008 Steve Naroff <snaroff@apple.com> Forgot to modify LAST_EXPR (thanks Nuno).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54619 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
3ac5e9fc38e1a59da84844f6adb95e803779098d 10-Aug-2008 Steve Naroff <snaroff@apple.com> Forgot to modify LAST_EXPR (thanks Nuno).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54619 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
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
xprObjC.h
tmtNodes.def
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
xprObjC.h
tmtNodes.def
4e596cf2381e1d8f689247d3acc310a25166899c 10-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update ShuffeVectorExpr::getShuffleMaskIdx to use
getIntegerConstantExprValue.

Tweak getIntegerConstantExprValue to suppress warning in
Release-Asserts mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54609 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a5d1cb7ef3f0780540e7fd7180399fd220ef0210 10-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update ShuffeVectorExpr::getShuffleMaskIdx to use
getIntegerConstantExprValue.

Tweak getIntegerConstantExprValue to suppress warning in
Release-Asserts mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54609 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
tmtNodes.def
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.h
tmtNodes.def
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.h
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.h
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.h
ype.h
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.h
ype.h
90a8c56548089c0697595348ce38efa69be6add2 09-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Make RecordDecl::Destroy() public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54561 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
243e4b2fd53c9505a90d11def53315bfbcc6ef97 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make RecordDecl::Destroy() public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54561 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
00c3088502598fab4e0956cdeedbd2477869d618 08-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Change line endings, CRLF -> LF.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54530 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
296e8671bca0d1d54c0755ba3fc1c7b285924fe6 08-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change line endings, CRLF -> LF.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54530 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
86cc394b773f087257317fadf4009121cbfdb13e 08-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Revert my previous commit where I replaced cast<> with static_cast<> in CXXFieldDecl::getMember().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54529 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
274479ec1f0fd5e8ee556854fb0e9b618448ffab 08-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert my previous commit where I replaced cast<> with static_cast<> in CXXFieldDecl::getMember().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54529 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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.h
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.h
ffafe4508c81947a2c247b2358334d5b79c5e721 08-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Add iterator access to field members for RecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
afebac1df82d16d6889470801e82501d714149c0 08-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add iterator access to field members for RecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54526 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c38918b56115b9d1794678062a820975674ee32d 08-Aug-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Use static_cast<> instead of cast<> for CXXFieldDecl::getMember().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54525 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
fef35f1ce99765670482124e2bd640bbe7a20a4f 08-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use static_cast<> instead of cast<> for CXXFieldDecl::getMember().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54525 91177308-0d34-0410-b5e6-96231b3b80d8
eclCXX.h
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
ype.h
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
ype.h
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.h
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.h
e1480475e42ea76517d1d661b7f2b2d7bc121f1b 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Add missing "classof" methods to NonNullAttr, fixing a heisencrash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54373 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
55b0c192e1ce00513a000f4c98bed7da5cf152b8 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Add missing "classof" methods to NonNullAttr, fixing a heisencrash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54373 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
c3540ff2f5b163ee0616e5a7d90424584a3f760b 05-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add more Parser/Sema support for GCC asm-label extension.
- ActOnDeclarator now takes an additional parameter which is the
AsmLabel if used. Its unfortunate that this bubbles up this high,
but we cannot just lump it in as an attribute without mistakenly
*accepting* it as an attribute.
- The actual asm-label itself is, however, encoded as an AsmLabelAttr
on the FunctionDecl.
- Slightly improved parser error recovery on malformed asm-labels.
- CodeGen support still missing...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
a80f8749f2968d19595ca2544114932bf0ca2c11 05-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add more Parser/Sema support for GCC asm-label extension.
- ActOnDeclarator now takes an additional parameter which is the
AsmLabel if used. Its unfortunate that this bubbles up this high,
but we cannot just lump it in as an attribute without mistakenly
*accepting* it as an attribute.
- The actual asm-label itself is, however, encoded as an AsmLabelAttr
on the FunctionDecl.
- Slightly improved parser error recovery on malformed asm-labels.
- CodeGen support still missing...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
eclBase.h
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
eclBase.h
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.h
ype.h
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.h
ype.h
dd2e9ca75a376d862d2141747e3057b03f42fe93 01-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support constructor and destructor attributes in CodeGen

- There is an miscompilation issue remaining due to a poor
interaction between the delayed emission of static functions and
the emission of constructors, but that already existed prior to
this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54258 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
6bfed7e411adc46eaf616371f85f68305c6e6257 01-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support constructor and destructor attributes in CodeGen

- There is an miscompilation issue remaining due to a poor
interaction between the delayed emission of static functions and
the emission of constructors, but that already existed prior to
this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54258 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
8716a019f15ee20184327c7905ef05f2106ba6c6 01-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support __attribute__(({con,de}structor)) in Parse & Sema
- Including possible priority argument
- In other news, the attribute parsing code really needs a cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54257 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
3068ae0feb5d477477f45045f7ec9d0414fe57f3 01-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support __attribute__(({con,de}structor)) in Parse & Sema
- Including possible priority argument
- In other news, the attribute parsing code really needs a cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54257 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
22dedc6e22fb732dc15068f38b72d691c138e8e7 31-Jul-2008 Ted Kremenek <kremenek@apple.com> Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54247 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
69c8f0aab655257e9e532d9d53756acf4f7a2d78 31-Jul-2008 Ted Kremenek <kremenek@apple.com> Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54247 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
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
ype.h
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
ype.h
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.h
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.h
01ee73fb7b2734d3ca1c5876dc623811518985df 27-Jul-2008 Chris Lattner <sabre@nondot.org> remove QualType::getCanonicalType. Also make
QualType::ReadBackpatch public so that FieldDecl doesn't need
to be a friend of QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54115 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
4243a94b43ef6207938f3023dfcfb804dd545363 27-Jul-2008 Chris Lattner <sabre@nondot.org> remove QualType::getCanonicalType. Also make
QualType::ReadBackpatch public so that FieldDecl doesn't need
to be a friend of QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54115 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
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
ype.h
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
ype.h
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
xpr.h
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
xpr.h
c5cff3042a9b78af61d0d39ec81c8516ebf9e05b 26-Jul-2008 Chris Lattner <sabre@nondot.org> remove a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54101 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
717250a2052ea65d95405127d4e5836a564dad18 26-Jul-2008 Chris Lattner <sabre@nondot.org> remove a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54101 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
ype.h
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.h
ype.h
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.h
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.h
b18e93c283e46a3564bc94a5227e252a796f0672 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Refine ObjCPropertyImplDecl:

- Remove a bunch of setXXX methods until we actually need them. This cleans up the
interface, and makes the object immutable until we have a reason to be mutable.

- Remove enum value OBJC_PR_IMPL_None since it was never used.

- Remove instance variable 'PropertyImplKind PropertyImplementation;'. This is
not needed because we can tell if ObjCPropertyImplDecl represents @synthesize
if 'ObjCPropertyDecl *PropertyDecl' is not null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54055 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
be57c3a3fef0776fca57ad88b2db263f37b074c4 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Refine ObjCPropertyImplDecl:

- Remove a bunch of setXXX methods until we actually need them. This cleans up the
interface, and makes the object immutable until we have a reason to be mutable.

- Remove enum value OBJC_PR_IMPL_None since it was never used.

- Remove instance variable 'PropertyImplKind PropertyImplementation;'. This is
not needed because we can tell if ObjCPropertyImplDecl represents @synthesize
if 'ObjCPropertyDecl *PropertyDecl' is not null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54055 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3c0deef0c753cc4d521c951e3025ddfefc2f72d5 25-Jul-2008 Nate Begeman <natebegeman@mac.com> De-tabify


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54046 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
82354bcedd1465bf40c9ba9e87e576dd9a8b81f0 25-Jul-2008 Nate Begeman <natebegeman@mac.com> De-tabify


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54046 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
ce13e1e523cd5a65934eb508c93074b8c43fcf74 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Implemented Sema support for attribute "unused".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54008 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
73798892751e378cbcdef43579c1d41685091fd0 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Implemented Sema support for attribute "unused".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54008 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
91a6920877a7288a84ac8d04d429435f9b9e1848 24-Jul-2008 Steve Naroff <snaroff@apple.com> Fix Sema::ActOnClassMessage() to pass through the identifier for "super".
This fixes a critical rewriter bug (<rdar://problem/6096760> clang ObjC rewriter: 'self' not expected value in class method called with 'super').

Also added a couple FIXME's since I'm not happy with my fix to Sema. It would be nicer if the super handling for class/instance messages was the same (based on PreDefinedExpr).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53994 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
fc93d52ada07d52de0ad4fd051b6a08e21d421ff 24-Jul-2008 Steve Naroff <snaroff@apple.com> Fix Sema::ActOnClassMessage() to pass through the identifier for "super".
This fixes a critical rewriter bug (<rdar://problem/6096760> clang ObjC rewriter: 'self' not expected value in class method called with 'super').

Also added a couple FIXME's since I'm not happy with my fix to Sema. It would be nicer if the super handling for class/instance messages was the same (based on PreDefinedExpr).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53994 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
198acff77e56982dd31a13c3c92610bdcf612c64 24-Jul-2008 Daniel Dunbar <daniel@zuster.org> Add Expr::getIntegerConstantExprValue helper method
- For getting an APSInt from a known integer constant Expr.
- TODO: Many users of Expr::isIntegerConstantExpr in codegen should
probably be using this instead...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53974 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cd8f646eca128f52a7bce0103c51ff82ce96f374 24-Jul-2008 Daniel Dunbar <daniel@zuster.org> Add Expr::getIntegerConstantExprValue helper method
- For getting an APSInt from a known integer constant Expr.
- TODO: Many users of Expr::isIntegerConstantExpr in codegen should
probably be using this instead...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53974 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
13df7e952939af7267769e2e06f2f2ce2750adc1 23-Jul-2008 Ted Kremenek <kremenek@apple.com> Initialize instance variable DeclAccess in ctor for ObjCIvarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53956 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
8f50b9c02abe7cd4945a9b77a8550a5207ea21cf 23-Jul-2008 Ted Kremenek <kremenek@apple.com> Initialize instance variable DeclAccess in ctor for ObjCIvarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53956 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
6bddd5191989f5c30dfdf25bf2f99a95df900902 23-Jul-2008 Ted Kremenek <kremenek@apple.com> Updated comment for class ObjCIvarDecl: it turns out the default access control
is protected, not private.

Added ObjCIvarDecl::getCanonicalAccessControl() to report the visible access
control of an ivar, whereas getAccessControl() returns the access control
relating to how the ivar was actually declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53954 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f079570fcad0d0053e75ebae29c883ec4276e020 23-Jul-2008 Ted Kremenek <kremenek@apple.com> Updated comment for class ObjCIvarDecl: it turns out the default access control
is protected, not private.

Added ObjCIvarDecl::getCanonicalAccessControl() to report the visible access
control of an ivar, whereas getAccessControl() returns the access control
relating to how the ivar was actually declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53954 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
24d49d0bd62af3da13f3331224f18ceb2fe48461 22-Jul-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Fix compilation error on GCC 4.3.0 ('memcpy' was not declared in this scope).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53934 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ea7e97e14f2f1f9817d2ae8a25ec6ea652e5287f 22-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix compilation error on GCC 4.3.0 ('memcpy' was not declared in this scope).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53934 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
bbafa5b0816c1ea67fb431487b20026362b30bca 22-Jul-2008 Ted Kremenek <kremenek@apple.com> Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
This implements <rdar://problem/6069935>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53891 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
584def7364f51e35bfcaf5c3c64673096533adda 22-Jul-2008 Ted Kremenek <kremenek@apple.com> Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
This implements <rdar://problem/6069935>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53891 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
33844332fc5300488e92aaa683f434f902b0f854 22-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement bzero, memset, memmove builtins.

This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53888 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
1caae959017b355e9bb61250d5a0d04edbf468b0 22-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement bzero, memset, memmove builtins.

This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53888 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
5b0de85aa9a53b70f57e4560cb8e3f509973df39 22-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement nans, prefetch, and trap builtins.

This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53885 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
4493f79fce48cd9cbd9f55fa9d452cde736747a0 22-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement nans, prefetch, and trap builtins.

This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53885 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
c0af254fe27f5960966db29479b64e820f663c32 21-Jul-2008 Ted Kremenek <kremenek@apple.com> Added sema support for the nonnull attribute. Will add test cases soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53881 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
eb2b2a3f1898f146c6e153a64ec58ec5e1750bd2 21-Jul-2008 Ted Kremenek <kremenek@apple.com> Added sema support for the nonnull attribute. Will add test cases soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53881 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
29921c4cbef086cb0dadba22f082c96148f69609 21-Jul-2008 Daniel Dunbar <daniel@zuster.org> Add __builtin_powi[fl] support


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53866 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
a933c3c052bbd87b01cc6fc7a7745e1c4b1757fb 21-Jul-2008 Daniel Dunbar <daniel@zuster.org> Add __builtin_powi[fl] support


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53866 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
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.h
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.h
726f4d4cbe766813f3f355be24899d699b7872a0 21-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement ffs, parity, and popcount builtins.
+ test case


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53851 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
04b290030eee33295600728450f348989d1a627e 21-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement ffs, parity, and popcount builtins.
+ test case


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53851 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
f914765ba1d70f599fa69bde38b8646c02d9b1aa 21-Jul-2008 Chris Lattner <sabre@nondot.org> continue cleaning up code, and disable sending a message directly to an
interface. This fixes a bug where we used to accept:

void test2(NSNumber x) {
[x METH];
}

which doesn't make sense and GCC rejects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53841 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2b1cc8be4dda4cd122485be0168b3c43d7dff15f 21-Jul-2008 Chris Lattner <sabre@nondot.org> continue cleaning up code, and disable sending a message directly to an
interface. This fixes a bug where we used to accept:

void test2(NSNumber x) {
[x METH];
}

which doesn't make sense and GCC rejects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53841 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d5f8179ed2b75e5c21109f3dd996836b5f743ecd 21-Jul-2008 Chris Lattner <sabre@nondot.org> rename getProtocols -> getProtocol, as it only returns a single
protocol. Simplify some code to use unconditional form of the
protocol access list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53832 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
9baefc21bfe1bf49ab4a234e9f267f00abe0b1b1 21-Jul-2008 Chris Lattner <sabre@nondot.org> rename getProtocols -> getProtocol, as it only returns a single
protocol. Simplify some code to use unconditional form of the
protocol access list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53832 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f81d921ec2f5bac3f35a94392fe2b764473884ee 21-Jul-2008 Chris Lattner <sabre@nondot.org> improve documentation of ObjCInterfaceType significantly. Also,
make the qual_* iterators and getNumProtocols() lists be accessible through
ObjCInterfaceType (returning an empty range if not a
ObjCQualifiedInterfaceType). This eliminates special checks in clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53830 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fb7701df5401fa1f5b3396d269fb33e731a00089 21-Jul-2008 Chris Lattner <sabre@nondot.org> improve documentation of ObjCInterfaceType significantly. Also,
make the qual_* iterators and getNumProtocols() lists be accessible through
ObjCInterfaceType (returning an empty range if not a
ObjCQualifiedInterfaceType). This eliminates special checks in clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53830 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b2b9da7c2995ddfa0ac00a702b60c8100e463f10 21-Jul-2008 Chris Lattner <sabre@nondot.org> simplify a bunch of code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53823 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
68a057b4292f5ff814ec8da53f6cda8cdcfbd2ae 21-Jul-2008 Chris Lattner <sabre@nondot.org> simplify a bunch of code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53823 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
2e966c430c098b7930e8a816200b071247bf00c9 21-Jul-2008 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53818 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
d85376aa66bc16488539f6bb11f97d0170b1fe6b 21-Jul-2008 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53818 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
481f4bcca5d3a688c89f036fc8cdb556457d019a 18-Jul-2008 Ted Kremenek <kremenek@apple.com> Provide static methods in BinaryOperator to determine if an opcode is an equality opcode, a relational opcode, or a logical opcode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53744 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
f2da7a06f6b98c3886d9b871ab839f5085b1c238 18-Jul-2008 Ted Kremenek <kremenek@apple.com> Provide static methods in BinaryOperator to determine if an opcode is an equality opcode, a relational opcode, or a logical opcode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53744 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
4e5bb1221fef5534ef364e2defff959dd2c2fab0 16-Jul-2008 Ted Kremenek <kremenek@apple.com> Added parsing/sema support for __attribute__ ((IBOutlet)), a clang-specific attribute that the static analyzer will use to recognize what ivars are IBOutlets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53644 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
96329d4e07a9bcddb5a927892b70408c8fd8c474 16-Jul-2008 Ted Kremenek <kremenek@apple.com> Added parsing/sema support for __attribute__ ((IBOutlet)), a clang-specific attribute that the static analyzer will use to recognize what ivars are IBOutlets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53644 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
PValue.h
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
PValue.h
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
PValue.h
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
PValue.h
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.h
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.h
df40dbffb74ee0b16ce55ccd4be8b57f8d74c4ab 09-Jul-2008 Chris Lattner <sabre@nondot.org> Add parser support for __builtin_stdarg_start, PR2531


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53328 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
f8396b6b58b423e7078dcda9092a065f9a4ba53a 09-Jul-2008 Chris Lattner <sabre@nondot.org> Add parser support for __builtin_stdarg_start, PR2531


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53328 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
b16ece4089a0128bfff5004101e15f6f5748232c 08-Jul-2008 Anders Carlsson <andersca@mac.com> Add LValue setters for APValue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53216 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
62f6b2110792f2db8feb35247b0ab824c6cc608d 08-Jul-2008 Anders Carlsson <andersca@mac.com> Add LValue setters for APValue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53216 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
55219f082cc8a095dd7d64495bb1bbdebaf2888f 04-Jul-2008 Seo Sanghyeon <sanxiyn@gmail.com> Fix warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53133 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b4825df6af2298f9007ee95ab5f16ed4b855ef4a 04-Jul-2008 Seo Sanghyeon <sanxiyn@gmail.com> Fix warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53133 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4ea864d965fed51cd1012d8cd8f4fc76d9d25245 03-Jul-2008 Ted Kremenek <kremenek@apple.com> Added an "ivar_empty" method to ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53099 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a0fb5861dec7aa1da0d21d5759678d76b00464f4 03-Jul-2008 Ted Kremenek <kremenek@apple.com> Added an "ivar_empty" method to ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53099 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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
PValue.h
xpr.h
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
PValue.h
xpr.h
26ef21085c85b74affb79ca68ca78ac07f1c5666 03-Jul-2008 Anders Carlsson <andersca@mac.com> Make APValue an APSInt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53072 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
2e478080f83f90728d8d56099cd32180c57debbc 03-Jul-2008 Anders Carlsson <andersca@mac.com> Make APValue an APSInt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53072 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
ecf7951f409695472e8bfa9940886ee8dcb289d7 02-Jul-2008 Ted Kremenek <kremenek@apple.com> Added method "HandleTranslationUnit" to ASTConsumer. This is called by ParseAST when all of the ASTs in a translation unit have been built.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53042 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
c87190da60bca25fe3bc1fe6831916f0076b72b8 02-Jul-2008 Ted Kremenek <kremenek@apple.com> Added method "HandleTranslationUnit" to ASTConsumer. This is called by ParseAST when all of the ASTs in a translation unit have been built.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53042 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
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.h
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.h
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.h
uiltins.def
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.h
uiltins.def
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.h
ype.h
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.h
ype.h
25349e4514db9ff59de74f2549113a75028af2a4 26-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Make clang work on 32 bit powerpc linux.

Patch by Nick Lewycky!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52777 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
e9484fc09a82b0bcd9f4921083440df4aea04f52 26-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Make clang work on 32 bit powerpc linux.

Patch by Nick Lewycky!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52777 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
9d464449c2a782e0a91ea85d79ad9e35418ec441 25-Jun-2008 Ted Kremenek <kremenek@apple.com> Add Profile method to QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52735 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3f2dcb1ca8bd2d5d3ccc5c80f4ab06f949d88a89 25-Jun-2008 Ted Kremenek <kremenek@apple.com> Add Profile method to QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52735 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3c5b5a448a9d66ea0a0a26adefe0ef5afd56a894 25-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Set CXXClassVar to identifier namespace IDNS_Ordinary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52718 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
09c31b0d78fc4e7f1d1828d01d9977cc3e242ea3 25-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Set CXXClassVar to identifier namespace IDNS_Ordinary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52718 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
d626facb27e3ef035fa9a1871e7c1ca113d45bd4 25-Jun-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Set CXXMethod to identifier namespace IDNS_Ordinary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52697 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
1ce6eadf80453d132d378ee031f3fbf5259a7d2a 25-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Set CXXMethod to identifier namespace IDNS_Ordinary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52697 91177308-0d34-0410-b5e6-96231b3b80d8
eclBase.h
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
xprObjC.h
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
xprObjC.h
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
xprObjC.h
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
xprObjC.h
a224a3045e613251881ee43e92e3e1a90eeffb21 24-Jun-2008 Ted Kremenek <kremenek@apple.com> Fix comments: "class method" should be "instance method" and vis versa


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52669 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
a75a8ea5b72ebdda5f651b57ae2c3b4e84b69253 24-Jun-2008 Ted Kremenek <kremenek@apple.com> Fix comments: "class method" should be "instance method" and vis versa


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52669 91177308-0d34-0410-b5e6-96231b3b80d8
xprObjC.h
d63b5017e0fa28d94bacd4ec26082a3442695339 22-Jun-2008 Chris Lattner <sabre@nondot.org> add a new clang::APValue class at Eli's request. It is a discriminated
union between [potentially complex] APInt/APFloat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52609 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
8031a85dc88225723d960c7c142e4fe97c2f12fe 22-Jun-2008 Chris Lattner <sabre@nondot.org> add a new clang::APValue class at Eli's request. It is a discriminated
union between [potentially complex] APInt/APFloat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52609 91177308-0d34-0410-b5e6-96231b3b80d8
PValue.h
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
xpr.h
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
xpr.h
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
xpr.h
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
xpr.h
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.h
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.h
8e5dfe98676eb6ed1c95a1d0d9854e267044992e 20-Jun-2008 Ted Kremenek <kremenek@apple.com> Added "Decl::getCodyBody()", a virtual method that returns the root AST node (Stmt*) that the Decl wraps (if any). Currently this only returns a non-null value for FunctionDecl and ObjCMethodDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52552 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
792481eec23d8c1aa92173be589e2ae9d02514a5 20-Jun-2008 Ted Kremenek <kremenek@apple.com> Added "Decl::getCodyBody()", a virtual method that returns the root AST node (Stmt*) that the Decl wraps (if any). Currently this only returns a non-null value for FunctionDecl and ObjCMethodDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52552 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclBase.h
eclObjC.h
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.h
eclBase.h
eclObjC.h
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.h
eclBase.h
eclObjC.h
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.h
tmt.h
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.h
tmt.h
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.h
xprObjC.h
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.h
xprObjC.h
25c3f2ff6c0a8c2d226b5f7b3db6223c36c7a027 10-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix getTrueExpr for ConditionalOperator to actually work. No testcase
because it's currently unused.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52166 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
dbdbbd7a7b728bf7734c992fe72b0e549d31a710 10-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix getTrueExpr for ConditionalOperator to actually work. No testcase
because it's currently unused.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52166 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
eclBase.h
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.h
eclBase.h
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
ecl.h
eclCXX.h
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
ecl.h
eclCXX.h
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
ST.h
ecl.h
eclBase.h
eclCXX.h
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
ST.h
ecl.h
eclBase.h
eclCXX.h
7853438716ca87cd811b17e1d7800da38e815638 08-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> implement the alias attirbute (in both Sema and Codegen)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52092 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
d4cbda6292b321c2e7dce7f039d92918fee99b3a 08-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> implement the alias attirbute (in both Sema and Codegen)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52092 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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
xpr.h
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
xpr.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
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.h
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.h
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.h
ecordLayout.h
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.h
ecordLayout.h
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
ecordLayout.h
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
ecordLayout.h
38f2caa6a8e671ce7189b63bfaeda11f323582ec 04-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Don't assume that the type of a FunctionDecl is a FunctionType; that
assumption isn't accurate in the presence of typedefs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51951 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
50c5c7241029651d4ff976f840bbca59fa81445f 04-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Don't assume that the type of a FunctionDecl is a FunctionType; that
assumption isn't accurate in the presence of typedefs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51951 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
ranslationUnit.h
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.h
ranslationUnit.h
8bb229201d651479a1219ed8806e855e12a0b669 04-Jun-2008 Steve Naroff <snaroff@apple.com> Add a few more built-in functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51921 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
eaf9a42b78ef8e5f2eac5dfaf45a666f2f1d00f9 04-Jun-2008 Steve Naroff <snaroff@apple.com> Add a few more built-in functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51921 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
a4280534357cc1347522886b5471d9e2e31d94c4 03-Jun-2008 Steve Naroff <snaroff@apple.com> Add a builtin. Fixes <rdar://problem/5982037> clang on xcode: error: incompatible operand types ('int' and 'char *').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51908 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
cf00e0bee3c664eff8c2f00272ddcf17a321b78f 03-Jun-2008 Steve Naroff <snaroff@apple.com> Add a builtin. Fixes <rdar://problem/5982037> clang on xcode: error: incompatible operand types ('int' and 'char *').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51908 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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
xprObjC.h
tmtNodes.def
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
xprObjC.h
tmtNodes.def
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
eclBase.h
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
eclBase.h
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.h
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.h
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
ecl.h
ype.h
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
ecl.h
ype.h
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
xprObjC.h
tmtNodes.def
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
xprObjC.h
tmtNodes.def
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
ST.h
xpr.h
xprObjC.h
tmtVisitor.h
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
ST.h
xpr.h
xprObjC.h
tmtVisitor.h
ca2a8dde4aa348ad253609fe417674b81bcd88f2 29-May-2008 Anton Korobeynikov <asl@math.spbu.ru> Update to follow recent LLVM changes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51689 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtIterator.h
525204a7ca5c3c0aac8166d8f27abb988a84c850 29-May-2008 Anton Korobeynikov <asl@math.spbu.ru> Update to follow recent LLVM changes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51689 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtIterator.h
fb9e3078971208f43283ac97c6bb27f58ed54baf 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Add the copysign builtins; I ran into a program that wanted
__builtin_copysign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51597 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
bcfd5d4ac69a3589b52bde91106f03f30de9e804 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Add the copysign builtins; I ran into a program that wanted
__builtin_copysign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51597 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
93eb82549eec82d75ce5dd3afbeeaf6fdb0e2a27 25-May-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Generate subprogram debug info with -g.
Also take care of freeing memory at the right places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51553 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
1c6a38bcea17801e9a4738753aee845381af2b6c 25-May-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Generate subprogram debug info with -g.
Also take care of freeing memory at the right places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51553 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
76a925c8bf3859582da550b7129514cc3f26af3e 24-May-2008 Steve Naroff <snaroff@apple.com> Fix range info for explicit ivar refs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51507 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8bf3b1d0e75da8b15bc331ebeb44f34b689f03ad 24-May-2008 Steve Naroff <snaroff@apple.com> Fix range info for explicit ivar refs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51507 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
ttr.h
xpr.h
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
ttr.h
xpr.h
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
ype.h
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
ype.h
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.h
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.h
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.h
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.h
8c50c627fadb07d528b3d40a420395e513f8f20b 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51307 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
6cfda23b3768f93a6eb0b2a9135c8334a20125bb 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51307 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
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
xpr.h
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
xpr.h
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.h
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.h
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.h
eclBase.h
eclObjC.h
tmt.h
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.h
eclBase.h
eclObjC.h
tmt.h
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.h
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.h
300ada5c29750d0b709777a4b8bfd177e6e58800 16-May-2008 Nate Begeman <natebegeman@mac.com> Fix some prototypes, and implement some builtins until we have our header files completed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51199 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
24512501319aa6d7f70b1bd79470df0197b832c8 16-May-2008 Nate Begeman <natebegeman@mac.com> Fix some prototypes, and implement some builtins until we have our header files completed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51199 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
77ed53d7332fc5111da28bbc88f0002082849dac 16-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix review nit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51194 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
dde8c94873976632e3ada4d8d067e1e244184d51 16-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix review nit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51194 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
afa2d386a3c22b7a135c52b486917037550c0ffc 15-May-2008 Argiris Kirtzidis <akyrtzi@gmail.com> Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51153 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1bf7dd75706a67de2368226b2d2c590c23d7dbf5 15-May-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make isFileVarDecl() return true when the VarDecl is in a C++ namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51153 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
37994b05af4d9bcae94769823be50d27b1b2efc9 15-May-2008 Steve Naroff <snaroff@apple.com> Add some of GCC's object checking builtin's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51133 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
6c178c563d51de6e5a12bd3a631728fd82fcad78 15-May-2008 Steve Naroff <snaroff@apple.com> Add some of GCC's object checking builtin's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51133 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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
uiltins.def
xpr.h
tmtNodes.def
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
uiltins.def
xpr.h
tmtNodes.def
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.h
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.h
938845d84161f34e084a1bf10b224ad7fb561aeb 12-May-2008 Ted Kremenek <kremenek@apple.com> 80 col violation fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50977 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
901b412d65d40ed8df16701e89bf5dd5b145cbd0 12-May-2008 Ted Kremenek <kremenek@apple.com> 80 col violation fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50977 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5c45be48e6125c5981ad48708dc7e8267bace63a 12-May-2008 Ted Kremenek <kremenek@apple.com> Add Type::getAsTypedefType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50970 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
769c9cfc6e06bd9d8ffe7a4397b939f19b0e4dc3 12-May-2008 Ted Kremenek <kremenek@apple.com> Add Type::getAsTypedefType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50970 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
bf020f3c9649ec3665d10636e5f8f48ea3a0ad17 10-May-2008 Mon P Wang <wangmp@apple.com> Added support to generate some atomic operators (add, sub, and, or etc..)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50919 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
1ffe281890f3cd7728316b45a1f3dd4d3120af7b 10-May-2008 Mon P Wang <wangmp@apple.com> Added support to generate some atomic operators (add, sub, and, or etc..)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50919 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
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.h
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.h
6bc6551b38f412ed3293e05a33881254fb632ec8 08-May-2008 Nate Begeman <natebegeman@mac.com> Add the non-immediate-shift vector builtins


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50870 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
f8add5dd6fc6b114f694aeaff8c89e6b23fa3f29 08-May-2008 Nate Begeman <natebegeman@mac.com> Add the non-immediate-shift vector builtins


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50870 91177308-0d34-0410-b5e6-96231b3b80d8
86Builtins.def
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.h
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.h
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.h
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.h
b7080aec42ece02e2b526eee5921b4ed4c50e60b 06-May-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50747 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
5251e130a23d997f7c0dfdc250cdc41f179e5bed 06-May-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50747 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
cb1a77a0c0f0a0eff49ecf103adc87ea8d663222 05-May-2008 Chris Lattner <sabre@nondot.org> Fix a bug from when this was a pointer instead of vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50639 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
28a309e387a0a69b0c055c1565aa147fc695f906 05-May-2008 Chris Lattner <sabre@nondot.org> Fix a bug from when this was a pointer instead of vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50639 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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
eclBase.h
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
eclBase.h
56846f2ed2594f49d78eee3645482a5e77d5e236 04-May-2008 Chris Lattner <sabre@nondot.org> improve array type comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50609 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
da2d71a50fe724c881b148fcc2c05a5e9b56e3a5 04-May-2008 Chris Lattner <sabre@nondot.org> improve array type comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50609 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
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.h
b52b7f2d58f4eef8c67f41e050a2f0aff60e4255 01-May-2008 Ted Kremenek <kremenek@apple.com> Added comments to ObjCMessageExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50525 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
66783caa67fd947787a0656fa642ddb4e770f074 01-May-2008 Ted Kremenek <kremenek@apple.com> Added comments to ObjCMessageExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50525 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
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.h
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.h
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.h
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.h
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.h
eclBase.h
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.h
eclBase.h
463ec844a8f24650ea5239c39903b182f7a5b4d8 25-Apr-2008 Nuno Lopes <nunoplopes@sapo.pt> initial support for recognizing __transparent_union__ attributes
comments on the ML will follow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50262 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
27ae6c6531ac13e4b316e7e0e7b7c846b61a8d15 25-Apr-2008 Nuno Lopes <nunoplopes@sapo.pt> initial support for recognizing __transparent_union__ attributes
comments on the ML will follow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50262 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
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.h
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.h
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.h
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.h
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.h
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.h
900e3dc71a96168ba088b7d3f7153bd42777c0ab 21-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Support for @dynamic AST build.
More property semantics checking.
First test case for ObjC2's property implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50057 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
c35b9e4e2efad727538c848cf30d4b0eb1031dc9 21-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Support for @dynamic AST build.
More property semantics checking.
First test case for ObjC2's property implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50057 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
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.h
xpr.h
tmtNodes.def
ype.h
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.h
xpr.h
tmtNodes.def
ype.h
c3ad5fe581baeb5eec8a1a32ab295a5187aec329 18-Apr-2008 Ted Kremenek <kremenek@apple.com> Several Expr subclasses did not mark "getSourceRange()" virtual. Fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49890 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
866b5c03e3b9c01cf496ad97b85a05afc917345b 18-Apr-2008 Ted Kremenek <kremenek@apple.com> Several Expr subclasses did not mark "getSourceRange()" virtual. Fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49890 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
78f7e31a5fbfc5adbf989f201197047255c51b64 18-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Initial work for property implementation declarations.
Mostly semantic checking in this patch. This is on going
and incomplete.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49882 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f624f8186d8fe474350051c6d3f00b2c204fbeae 18-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Initial work for property implementation declarations.
Mostly semantic checking in this patch. This is on going
and incomplete.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49882 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
ecl.h
eclBase.h
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.h
ecl.h
eclBase.h
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
eclBase.h
eclObjC.h
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
eclBase.h
eclObjC.h
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.h
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.h
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.h
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.h
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
xpr.h
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
xpr.h
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.h
eclBase.h
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.h
eclBase.h
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.h
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.h
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.h
eclBase.h
ype.h
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.h
eclBase.h
ype.h
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.h
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.h
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.h
xprCXX.h
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.h
xprCXX.h
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.h
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.h
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.h
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.h
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.h
eclBase.h
eclObjC.h
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.h
eclBase.h
eclObjC.h
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
eclBase.h
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
eclBase.h
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.h
xprCXX.h
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.h
xprCXX.h
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
eclBase.h
eclObjC.h
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
eclBase.h
eclObjC.h
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.h
xprCXX.h
tmtNodes.def
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.h
xprCXX.h
tmtNodes.def
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
ecl.h
eclBase.h
xpr.h
tmt.h
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
ecl.h
eclBase.h
xpr.h
tmt.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
eclObjC.h
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.h
eclObjC.h
e86716008551d268871e9aa7b27ea1b64b462991 07-Apr-2008 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49311 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
372bed091b6b1eca596130208e227e7077154de4 07-Apr-2008 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49311 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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
ype.h
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
ype.h
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.h
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.h
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
eclObjC.h
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
eclObjC.h
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.h
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.h
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.h
ype.h
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.h
ype.h
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.h
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.h
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.h
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.h
42a2174a9824760c915bb815c877b664dd37d97d 07-Apr-2008 Chris Lattner <sabre@nondot.org> remove the Decl::getCanonicalType() method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49295 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8bcfc5bef434d7052e28d0ce45182855659ebd3d 07-Apr-2008 Chris Lattner <sabre@nondot.org> remove the Decl::getCanonicalType() method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49295 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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
ecl.h
eclBase.h
eclObjC.h
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
ecl.h
eclBase.h
eclObjC.h
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.h
xpr.h
tmt.h
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.h
xpr.h
tmt.h
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.h
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.h
3277df47de6b65b55721726dc3f7b294e70ef6fe 04-Apr-2008 Chris Lattner <sabre@nondot.org> add an isAnyComplexType() method, which returns true for both
integer and FP complexes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49219 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f23d364084d1aabea688222780d6fc1dd8c7f78c 04-Apr-2008 Chris Lattner <sabre@nondot.org> add an isAnyComplexType() method, which returns true for both
integer and FP complexes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49219 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
9104f3c7cd14b86540031cb3699b159f874d7c68 04-Apr-2008 Steve Naroff <snaroff@apple.com> Add explicit support for diagnosing implicit function decls.
Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49214 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e2ef815de1da36c1ad1494cb58ce37adac1efa26 04-Apr-2008 Steve Naroff <snaroff@apple.com> Add explicit support for diagnosing implicit function decls.
Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49214 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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
ecl.h
eclBase.h
eclObjC.h
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
ecl.h
eclBase.h
eclObjC.h
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.h
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.h
74af9e99f71c492653da4d9d4351f8998c20e456 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Temporarily make the Decl virtual destructor public, so that calls to "delete"
can be tested on derived classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49141 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
7dd1cf4031a2a06be3e3c15353ff34d5ee6e8754 03-Apr-2008 Sam Bishop <sam@bishop.dhs.org> Temporarily make the Decl virtual destructor public, so that calls to "delete"
can be tested on derived classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49141 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
152081673111bafc852c4f90b45e9930cbbc84ed 02-Apr-2008 Steve Naroff <snaroff@apple.com> Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.

I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49107 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
3110251f13981689f384eb3c0aba2afffea18d9d 02-Apr-2008 Steve Naroff <snaroff@apple.com> Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.

I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49107 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
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
ype.h
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
ype.h
9db553e9ffdcd7c9fbd2fa6cf70646370e589159 02-Apr-2008 Chris Lattner <sabre@nondot.org> Various parts of the standard require something to be an "incomplete or
object type". Add a predicate that checks exactly this, as it is equivalent
to checking ot see if the type is *not* a function type, which is faster
to check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49082 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d805bec0fbb98aa10abbb41bfdcb2e2fab1bac96 02-Apr-2008 Chris Lattner <sabre@nondot.org> Various parts of the standard require something to be an "incomplete or
object type". Add a predicate that checks exactly this, as it is equivalent
to checking ot see if the type is *not* a function type, which is faster
to check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49082 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
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.h
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.h
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.h
eclObjC.h
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.h
eclObjC.h
8666d841f8ac32518ab78a9bffc9d2807f8e30b4 01-Apr-2008 Chris Lattner <sabre@nondot.org> improve comma consistency, yes I'm anal


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49004 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ade9bf0fabca700bc2a1dadb071179d03515e3cb 01-Apr-2008 Chris Lattner <sabre@nondot.org> improve comma consistency, yes I'm anal


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49004 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
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.h
eclObjC.h
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.h
eclObjC.h
5648a71297e17c05c0f986d18f27584990e38926 27-Mar-2008 Ted Kremenek <kremenek@apple.com> In ObjCMessageExpr: getSelector() const should just return "Selector", not "const Selector&" because Selector is just a smart pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48860 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c74840329eeee429d9527cf2f3694a74accd1603 27-Mar-2008 Ted Kremenek <kremenek@apple.com> In ObjCMessageExpr: getSelector() const should just return "Selector", not "const Selector&" because Selector is just a smart pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48860 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
efc11216a5755f69b5540289aa2dd374d4bc82ab 25-Mar-2008 Nate Begeman <natebegeman@mac.com> Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
8e7dafec4b70303dfaff95151cd06bfc5532720c 25-Mar-2008 Nate Begeman <natebegeman@mac.com> Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0cdce4dabe2953f76a00e46c084acad98588139c 25-Mar-2008 Ted Kremenek <kremenek@apple.com> Added "arg_iterators" to ObjCMessageExpr (for iterating over the arguments of a message expression)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48756 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
3fb94d87b937a89400d1195479702b6f6bb9a59e 25-Mar-2008 Ted Kremenek <kremenek@apple.com> Added "arg_iterators" to ObjCMessageExpr (for iterating over the arguments of a message expression)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48756 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e439fe0cb471da19ddb807acdf355baa816ea145 18-Mar-2008 Nate Begeman <natebegeman@mac.com> Fix a typo


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48482 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6a1bc1b95ee31c6892d46a6993b9e2d2d66831ee 18-Mar-2008 Nate Begeman <natebegeman@mac.com> Fix a typo


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48482 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8f9b504219b6c810318a8335626fa656058610d1 17-Mar-2008 Ted Kremenek <kremenek@apple.com> Added "inputs" and "outputs" iterator (expression) for AsmStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48465 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ec2f7dccb1f30ae137f74e764e44c2332b0a2ec0 17-Mar-2008 Ted Kremenek <kremenek@apple.com> Added "inputs" and "outputs" iterator (expression) for AsmStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48465 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
29ed685364c1f93720d3fc08037d93b18b7074e2 17-Mar-2008 Chris Lattner <sabre@nondot.org> eliminate the last signed element count.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48436 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b5feb35360526da42ad7e3fa7ef3d44a5992b83c 17-Mar-2008 Chris Lattner <sabre@nondot.org> eliminate the last signed element count.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48436 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
526bf9163cb103c06fbd1e77429baf22384d68b5 17-Mar-2008 Chris Lattner <sabre@nondot.org> clean up iteration over propertydecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48435 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a5674258f5e6f74f1c0ed3ece4d64fbb1b9afb11 17-Mar-2008 Chris Lattner <sabre@nondot.org> clean up iteration over propertydecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48435 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
ec4979bdcb038c005fdcc1bd9d3ecc56d10ff1c2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Convert more counts to be zero based instead of -1 based, make them unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48429 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f3a7af901231535191d14cb524d58f22907ac4d2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Convert more counts to be zero based instead of -1 based, make them unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48429 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
e2e6ab496be9134e80abaf56c76c0de45e65cc26 16-Mar-2008 Chris Lattner <sabre@nondot.org> make some more 'counts' unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48425 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
62db2f4214c1589082960f12c9cb8924fe0cf8c5 16-Mar-2008 Chris Lattner <sabre@nondot.org> make some more 'counts' unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48425 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
243ddef001bc8803df3a0a4c62f720e816ac0e75 16-Mar-2008 Chris Lattner <sabre@nondot.org> make NumClassMethods unsigned in categories


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48424 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a906135721c350435319347d2672bbb3bf494f91 16-Mar-2008 Chris Lattner <sabre@nondot.org> make NumClassMethods unsigned in categories


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48424 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
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.h
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.h
685d792c2a41538694068ad014622d81980853c1 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make the parameter count of ObjCMethodDecl unsigned, you
can't have negative arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48407 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
58cce3b0dcbdcc95b7e713795834b4cb2c8a008a 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make the parameter count of ObjCMethodDecl unsigned, you
can't have negative arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48407 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
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.h
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.h
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.h
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.h
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
ecl.h
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
ecl.h
9ea647e7f3d7ccbc62caa84b67211f4b9d29304a 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a ctor protected


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48401 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
fbdeba1c530dc3534a6f5b788e43d1a43c260128 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a ctor protected


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48401 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
58114f09323daa78692ca3d61a6a876d44705533 15-Mar-2008 Chris Lattner <sabre@nondot.org> move the ASTContext argument to be first in the argument list of
all Create methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48398 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c63e660882ff93841fa234d70ef6757038302b92 15-Mar-2008 Chris Lattner <sabre@nondot.org> move the ASTContext argument to be first in the argument list of
all Create methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48398 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4c7802b2a6c8ce3e65fd16ff97d6e25f821e5d4f 15-Mar-2008 Chris Lattner <sabre@nondot.org> Switch over functiondecl. This makes it obvious that the ASTContext
argument to Create should be first, not last.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48397 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a98e58ddb4696a0020fe97439d5295413f9e90b1 15-Mar-2008 Chris Lattner <sabre@nondot.org> Switch over functiondecl. This makes it obvious that the ASTContext
argument to Create should be first, not last.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48397 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
48d225c6b3bbcab06c12756cc0ca4c2a21d214ed 15-Mar-2008 Chris Lattner <sabre@nondot.org> switch the VarDecl allocation model to go through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48396 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9e151e154780e9cd443336143af1e996d1f387e5 15-Mar-2008 Chris Lattner <sabre@nondot.org> switch the VarDecl allocation model to go through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48396 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e4650488e8b15c43079c783191734d116fc7be3d 15-Mar-2008 Chris Lattner <sabre@nondot.org> start switching decls over to using an allocator controlled by ASTContext.
Right now only some ctors are switched over. I need to switch them all
over so I can change the dtor over.

This lets us experiment with region allocation and other things in the
future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48390 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
6c2b6eb8d836da19007f7540709e16d5e39a1cba 15-Mar-2008 Chris Lattner <sabre@nondot.org> start switching decls over to using an allocator controlled by ASTContext.
Right now only some ctors are switched over. I need to switch them all
over so I can change the dtor over.

This lets us experiment with region allocation and other things in the
future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48390 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
a4ff4277d928a0a8dc96e3b1381c37fbaf922e48 13-Mar-2008 Chris Lattner <sabre@nondot.org> improve DeclStmt to be able to store SourceRange info correctly.
Set the start of DeclStmt range. Right now the end is meaningless
though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48330 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
81c018d9482e7cc2addadc6202dcf162a01faefd 13-Mar-2008 Chris Lattner <sabre@nondot.org> improve DeclStmt to be able to store SourceRange info correctly.
Set the start of DeclStmt range. Right now the end is meaningless
though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48330 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d75d28b0ac4547ebf0e80f11a5c13a1415bca14e 07-Mar-2008 Nate Begeman <natebegeman@mac.com> Add fastcall/stdcall attribute support
Generate CallingConv::Fast when fastcall attribute is present


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48017 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
440b456709526c4277e71d2e0ff49e5d88dc7b17 07-Mar-2008 Nate Begeman <natebegeman@mac.com> Add fastcall/stdcall attribute support
Generate CallingConv::Fast when fastcall attribute is present


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48017 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
8cd0e9334436a89e85d8769d1d8f52d763497ee9 05-Mar-2008 Chris Lattner <sabre@nondot.org> remove the source location arguments to various target query methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
98be4943e8dc4f3905629a7102668960873cf863 05-Mar-2008 Chris Lattner <sabre@nondot.org> remove the source location arguments to various target query methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
402b337840023aa37ec402be193717ce6caed5d4 03-Mar-2008 Chris Lattner <sabre@nondot.org> Add a bunch of attributes, patch by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47837 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ddee4231e9bdfbac1e1f5385ff1a17fd0e0b0e39 03-Mar-2008 Chris Lattner <sabre@nondot.org> Add a bunch of attributes, patch by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47837 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ee4c3bfe73bf1302b8e59c76e057f0f79e649650 29-Feb-2008 Chris Lattner <sabre@nondot.org> Add support for attribute(deprecated), patch by Nuno Lopes!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47753 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
7e669b25144c7cfae0e51d4098016d6982504dbd 29-Feb-2008 Chris Lattner <sabre@nondot.org> Add support for attribute(deprecated), patch by Nuno Lopes!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47753 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
13bfae66b70d770df75dcdc4f624f9a596b48e78 27-Feb-2008 Ted Kremenek <kremenek@apple.com> Added support for attribute "noreturn."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47689 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
aecb38368546aa2cdb58d53bbcb3e8ad46365fc6 27-Feb-2008 Ted Kremenek <kremenek@apple.com> Added support for attribute "noreturn."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47689 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
5778d62432c481798479b7fba71c9da577cd076f 27-Feb-2008 Ted Kremenek <kremenek@apple.com> Removed VarDecl::hasStaticStorage() (redundant with hasGlobalStorage())
Removed VarDecl::hasAutoStorage() (only used by hasLocalStorage())

Merged logic from VarDecl::hasAutoStorage() into VarDecl::hasLocalStorage(),
and expanded (fixed) the logic of hasLocalStorage() to handle Extern and PrivateExtern.

Renamed Expr::hasStaticStorage() to Expr::hasGlobalStorage().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47681 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xpr.h
2e5f54aa1dd15a62c34a9d1d24a5a0692f43934a 27-Feb-2008 Ted Kremenek <kremenek@apple.com> Removed VarDecl::hasStaticStorage() (redundant with hasGlobalStorage())
Removed VarDecl::hasAutoStorage() (only used by hasLocalStorage())

Merged logic from VarDecl::hasAutoStorage() into VarDecl::hasLocalStorage(),
and expanded (fixed) the logic of hasLocalStorage() to handle Extern and PrivateExtern.

Renamed Expr::hasStaticStorage() to Expr::hasGlobalStorage().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47681 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xpr.h
f69c06ffebac44c5224209eb29f652b73045ab05 26-Feb-2008 Ted Kremenek <kremenek@apple.com> Changed VarDecl::hasGlobalStorage() to be the negation of hasLocalStorage().
Before it was the negation of hasAutoStorage(), which is incorrect.
"Register" storage for Decls do not indicate global variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47630 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9cae51aa5027dfb57bf1cc6b5fd1bdcec632aa14 26-Feb-2008 Ted Kremenek <kremenek@apple.com> Changed VarDecl::hasGlobalStorage() to be the negation of hasLocalStorage().
Before it was the negation of hasAutoStorage(), which is incorrect.
"Register" storage for Decls do not indicate global variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47630 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a7447ba9898d5534c9a9ce63784cdbeb30aa366d 26-Feb-2008 Chris Lattner <sabre@nondot.org> add parsing, ast building and pretty printing support for C++ throw expressions.
Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47582 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
tmtNodes.def
50dd289f45738ed22b7583d52ed2525b927042ff 26-Feb-2008 Chris Lattner <sabre@nondot.org> add parsing, ast building and pretty printing support for C++ throw expressions.
Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47582 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
tmtNodes.def
467d9d2f39f56ac637167c9cc4c2d91addfb084d 26-Feb-2008 Chris Lattner <sabre@nondot.org> fix const correctness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47580 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b22ef6feb04e6c960f2bfe7bb9ffa8d2ebb4fa14 26-Feb-2008 Chris Lattner <sabre@nondot.org> fix const correctness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47580 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
61fff7dfad1a2d2272c3e07962b3c7aa8bc5103d 25-Feb-2008 Ted Kremenek <kremenek@apple.com> doxygenify some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47564 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2de4a9b1d6186f83d98975e02daeb71bd9605440 25-Feb-2008 Ted Kremenek <kremenek@apple.com> doxygenify some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47564 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
43b885f70c4b4a2813c020e18415ebd052caabb8 25-Feb-2008 Chris Lattner <sabre@nondot.org> convert tabs to spaces, patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47560 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
c81c8144a661a49d7b9dae8d2080dee2e43186ec 25-Feb-2008 Chris Lattner <sabre@nondot.org> convert tabs to spaces, patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47560 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
dbd96b23eae3784172d91cfb086abb8ca732f92e 24-Feb-2008 Ted Kremenek <kremenek@apple.com> Two more Windows-related fixes:

- More enum signeness bitfield fixes (MSVC treats enums as signed).

- Fixed in Lex/HeaderSearch.cpp an unsafe copy between two
HeaderSearch::PerFileInfo entries in a common vector. The copy involved two
calls to getFileInfo() within the assignment; these calls could have
side-effects that enlarged the internal vector, and with MSVC this would
invalidate one of the values in the assignment.

Patch by Argiris Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47536 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
ype.h
ca63fa00786e51c207c829f4182f11a6c6b552be 24-Feb-2008 Ted Kremenek <kremenek@apple.com> Two more Windows-related fixes:

- More enum signeness bitfield fixes (MSVC treats enums as signed).

- Fixed in Lex/HeaderSearch.cpp an unsafe copy between two
HeaderSearch::PerFileInfo entries in a common vector. The copy involved two
calls to getFileInfo() within the assignment; these calls could have
side-effects that enlarged the internal vector, and with MSVC this would
invalidate one of the values in the assignment.

Patch by Argiris Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47536 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
ype.h
754d3fcd1db30ab9db9f03db80b81ff887e79eef 21-Feb-2008 Nate Begeman <natebegeman@mac.com> Handle __attribute__((annotate("string")))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47451 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
c398f0b5efb2f8ba39cd5b0170cf697f714afbcb 21-Feb-2008 Nate Begeman <natebegeman@mac.com> Handle __attribute__((annotate("string")))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47451 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
35fef52886c88e3855745917fcb0bf6a19fa0ba1 20-Feb-2008 Chris Lattner <sabre@nondot.org> Alternate address spaces work:

rename QualType::getQualifiers to getCVRQualifiers.
Add some fixme's and clean up some code relevant to qualifiers.
Change ASQualType to contain a Type* instead of a QualType.
Any CVR qualifiers should be on the outer qual type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47398 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
f46699ce225811d8d9dbab9d00189a0e54469457 20-Feb-2008 Chris Lattner <sabre@nondot.org> Alternate address spaces work:

rename QualType::getQualifiers to getCVRQualifiers.
Add some fixme's and clean up some code relevant to qualifiers.
Change ASQualType to contain a Type* instead of a QualType.
Any CVR qualifiers should be on the outer qual type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47398 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
7dce029af034c8a9794ea55590f05aac159422ae 16-Feb-2008 Anders Carlsson <andersca@mac.com> Better handling of the aligned attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47216 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
042c4e7e9f0b54104f4f2e098c028aa8247b6bed 16-Feb-2008 Anders Carlsson <andersca@mac.com> Better handling of the aligned attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47216 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
8d2b2b7adf81184ea632dafa42caa94294d6a9c7 16-Feb-2008 Anders Carlsson <andersca@mac.com> Make sizeof and __alignof work correctly with packed structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47202 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6a24acbb3dbb3bea9426716bee6ad6023ad15f3f 16-Feb-2008 Anders Carlsson <andersca@mac.com> Make sizeof and __alignof work correctly with packed structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47202 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5cf4d81c323fe4b16ea517a70fad62a95440f194 16-Feb-2008 Anders Carlsson <andersca@mac.com> Address comments from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47195 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
baa66fc389ca0a9f11e0c864304bcfd89de39439 16-Feb-2008 Anders Carlsson <andersca@mac.com> Address comments from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47195 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
e6da55e20f225677fb3cf1e59d8552db201c1a17 16-Feb-2008 Anders Carlsson <andersca@mac.com> Store attributes in a global hash map instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47193 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
adf21bdb3d17acfdb74657fcbc5035a404c6c8f4 16-Feb-2008 Anders Carlsson <andersca@mac.com> Store attributes in a global hash map instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47193 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
484eb5f5dcfd2620539e2fa89955d277da9d8c46 16-Feb-2008 Anders Carlsson <andersca@mac.com> Store attributes in a global hash map instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47191 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
b0dd26825e58a5f2982fd6d4ffa4c4ae6e24ff17 16-Feb-2008 Anders Carlsson <andersca@mac.com> Store attributes in a global hash map instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47191 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
851392614b02103894cb132000527e9d168df22e 15-Feb-2008 Ted Kremenek <kremenek@apple.com> Added predicate function "UnaryOperator::isIncrementOp()".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47181 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5d826b82936beb2c32dd02460332ba8035192c65 15-Feb-2008 Ted Kremenek <kremenek@apple.com> Added predicate function "UnaryOperator::isIncrementOp()".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47181 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8ff077864feed2c2b75424d37724f60e56d5a597 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Split out incomplete arrays from VariableArrayType into
IncompleteArrayType. This should make code dealing with both incomplete
and variable length arrays much more readable, plus it allows properly
making the distinction between isVariableArrayType() and
isVariablyModifiedType(). The patch is a little big, but it's
strightforward. so I don't think there should be any issues.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47165 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
c5773c4b8ce1ed6ed5c7112c9020c954a47dce96 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Split out incomplete arrays from VariableArrayType into
IncompleteArrayType. This should make code dealing with both incomplete
and variable length arrays much more readable, plus it allows properly
making the distinction between isVariableArrayType() and
isVariablyModifiedType(). The patch is a little big, but it's
strightforward. so I don't think there should be any issues.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47165 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
62f67fd7f670f1a8b222c6565b257c05e8e80fae 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Remove useless parameter from isConstantSizeType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47156 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3c2b3170041f69a92904e3bab9b6d654eaf260ac 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Remove useless parameter from isConstantSizeType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47156 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3f70c54223bb78cfdb6699dc296c3467c86e3b04 15-Feb-2008 Anders Carlsson <andersca@mac.com> Get rid of AttributeList in the AST and use the new Attr class instead

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47155 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
f78915fa196b3d284ad756f65eecadaefef71eef 15-Feb-2008 Anders Carlsson <andersca@mac.com> Get rid of AttributeList in the AST and use the new Attr class instead

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47155 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
ecl.h
cee3de855472f38a1014945d070f9a1c44b44229 14-Feb-2008 Anders Carlsson <andersca@mac.com> Address comments from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47118 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
81226601148d7e7c187b96c6ef86e83df204f59f 14-Feb-2008 Anders Carlsson <andersca@mac.com> Address comments from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47118 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
3c0e34853256d096b794944bea52853d3a711ab7 14-Feb-2008 Anders Carlsson <andersca@mac.com> Add Attr.h which is an AST-level class for GCC attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47112 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
d429cd459aef723fa0e7a44ac957d4c2256e241c 14-Feb-2008 Anders Carlsson <andersca@mac.com> Add Attr.h which is an AST-level class for GCC attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47112 91177308-0d34-0410-b5e6-96231b3b80d8
ttr.h
7a48d9c7189d7f7271d8c92aa51a63c79ee4c0cc 13-Feb-2008 Chris Lattner <sabre@nondot.org> Move IgnoreParenCasts to be a method on Expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47040 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
56f349400c5932a196509c0480ff6f99a9a0b48f 13-Feb-2008 Chris Lattner <sabre@nondot.org> Move IgnoreParenCasts to be a method on Expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47040 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
61814ffd7455e59135e6f32b682357e8c1c1ef8a 12-Feb-2008 Ted Kremenek <kremenek@apple.com> Fixed misspelling in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47016 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
6083ea3723ec3996ae3bdf8d1b352b0c3b3922c8 12-Feb-2008 Ted Kremenek <kremenek@apple.com> Fixed misspelling in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47016 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
9dd8a70fc9e35488c437f200adc4d3f0bd574205 12-Feb-2008 Ted Kremenek <kremenek@apple.com> Moved class declaration for ObjCForCollectionStmt to be co-located with
the class declarations for the other ObjC***Stmt classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47013 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
78492dae00fb85e0da0f966df4745edafdafb66c 12-Feb-2008 Ted Kremenek <kremenek@apple.com> Moved class declaration for ObjCForCollectionStmt to be co-located with
the class declarations for the other ObjC***Stmt classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47013 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
fdd35d727f251c4d314521645534d80b38cf6ba3 12-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Add wchar_t type to ASTContext. Will be needed for wide strings, since
they are of type wchar_t[].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
fd888a581d6d329f5b447c8ff4d37cf396315993 12-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Add wchar_t type to ASTContext. Will be needed for wide strings, since
they are of type wchar_t[].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47004 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
576df2979dd20306289699d4926f3025aa12d80a 11-Feb-2008 Steve Naroff <snaroff@apple.com> After yesterday's discussion (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-February/001044.html), decided not to change the semantics of Type::isIncompleteType().

This commit simply changes a couple comments to reflect this decision.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46970 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
406db935610a6e4f41c151d85b623c43967ba422 11-Feb-2008 Steve Naroff <snaroff@apple.com> After yesterday's discussion (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-February/001044.html), decided not to change the semantics of Type::isIncompleteType().

This commit simply changes a couple comments to reflect this decision.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46970 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a6dcce3fa6567d1cef5e7388a7fb06d3c7fe97fa 11-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR1992 by computing the right type for string literals, which
is an array type not a pointer type. This requires updating some
diags that change and updating the code generator to handle the
proper form of strings.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46941 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a7ad98ff0919d6a24ea7c46634ea29bea551c1a0 11-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR1992 by computing the right type for string literals, which
is an array type not a pointer type. This requires updating some
diags that change and updating the code generator to handle the
proper form of strings.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46941 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4f7f441db1d7b7137a39219ed3e0198385831b71 08-Feb-2008 Anders Carlsson <andersca@mac.com> Put back the top-level asm code; all tests pass now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46868 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
dfab6cb59a703f2ce4d58371652ce879f4c85a09 08-Feb-2008 Anders Carlsson <andersca@mac.com> Put back the top-level asm code; all tests pass now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46868 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f41100b0236a5561c6c72635493c2d21d66121e9 08-Feb-2008 Anders Carlsson <andersca@mac.com> Back out 46855 for now, it causes test failures on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46867 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3f9424f3206b834b5dd0e7c403348651ab6fafbb 08-Feb-2008 Anders Carlsson <andersca@mac.com> Back out 46855 for now, it causes test failures on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46867 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
7deb29f2d1d8e062e52c5ccba9994039db6a554b 07-Feb-2008 Anders Carlsson <andersca@mac.com> Handle top-level asm declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46855 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
61900f0ef4fc705e62609939f30a375a9576e43d 07-Feb-2008 Anders Carlsson <andersca@mac.com> Handle top-level asm declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46855 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
76b4983f4c80a8f51c57bc29dd2368353cdf4743 06-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to propagate qualifiers through the member operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46830 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
510190777c4bd53e960eea4665b204778fec1b64 06-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to propagate qualifiers through the member operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46830 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6b806042bb9da382ec2d0f8ae42cc17f967fb52d 06-Feb-2008 Chris Lattner <sabre@nondot.org> explicitly document that return statement argument does not necessarily follow the result type of the function. Add testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46823 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
c8edf6bd5f76bf50411d037c83d36847edfa68f0 06-Feb-2008 Chris Lattner <sabre@nondot.org> explicitly document that return statement argument does not necessarily follow the result type of the function. Add testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46823 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
a8c2d59f71f037e273a9b7e351aa3352a5ae3a73 06-Feb-2008 Chris Lattner <sabre@nondot.org> pass the astconsumer into Sema's ctor, clean up some stuff in
Sema::ActOnTranslationUnitScope. The various ObjC pieces at the top
of Sema.cpp should be moved into SemaObjC or something.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46787 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
2ae34ed8caf90ca4044feca07811561053c08666 06-Feb-2008 Chris Lattner <sabre@nondot.org> pass the astconsumer into Sema's ctor, clean up some stuff in
Sema::ActOnTranslationUnitScope. The various ObjC pieces at the top
of Sema.cpp should be moved into SemaObjC or something.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46787 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
de6a9c48c246c04625d9cdca499f2d089c7fb55a 06-Feb-2008 Anders Carlsson <andersca@mac.com> Handle simple asm statements correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46777 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
dfab34a696d1dba8622248c31aaf605906cb6109 06-Feb-2008 Anders Carlsson <andersca@mac.com> Handle simple asm statements correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46777 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
2a72bb32dfda134cb2bab50f5bb4a6b214f84348 04-Feb-2008 Christopher Lamb <christopher.lamb@gmail.com> Add experimental support for address space qualified types. Address space
qualifiers use the __attribute__((address_space(id))) syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46691 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
ebb97e98c03f8d7034bd3748a10e35f39a95c289 04-Feb-2008 Christopher Lamb <christopher.lamb@gmail.com> Add experimental support for address space qualified types. Address space
qualifiers use the __attribute__((address_space(id))) syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46691 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
397c4ce5d9535c21cb52679327960fd349c25cdf 01-Feb-2008 Steve Naroff <snaroff@apple.com> Minor API cleanup...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46649 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
be4b3332c2d17c03af6d015d9e8e2cc524806e6e 01-Feb-2008 Steve Naroff <snaroff@apple.com> Minor API cleanup...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46649 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
61aa7f9fda3864fb86e1efe6c1c33259a9e4d76f 01-Feb-2008 Ted Kremenek <kremenek@apple.com> For ObjCAtCatchStmt, removed field 'NextAtCatchStmt' (which referenced the next @catch)
and put the the next ObjcAtCatchStmt* as part of SubExprs. This fixes a bug with
iterating over the children of ObjcAtCatch, where the next @catch was not
properly being iterated over as a child.

Altered serialization of ObjCAtCatchStmt to reflect this new layout of
its subexpressions, and fixed an ownership issue with the next @catch not
being serialized as an owned pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46647 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ff981021554a4965943ca2d19019cea811614602 01-Feb-2008 Ted Kremenek <kremenek@apple.com> For ObjCAtCatchStmt, removed field 'NextAtCatchStmt' (which referenced the next @catch)
and put the the next ObjcAtCatchStmt* as part of SubExprs. This fixes a bug with
iterating over the children of ObjcAtCatch, where the next @catch was not
properly being iterated over as a child.

Altered serialization of ObjCAtCatchStmt to reflect this new layout of
its subexpressions, and fixed an ownership issue with the next @catch not
being serialized as an owned pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46647 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5f8c60921d638abb845afcdad93f59b13ed869a8 01-Feb-2008 Anders Carlsson <andersca@mac.com> Implement __builtin_huge_val.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46627 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
f7682b039609e1394f0f711de11ab3fb640289f2 01-Feb-2008 Anders Carlsson <andersca@mac.com> Implement __builtin_huge_val.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46627 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
c6078c9d9f70ba6fbcc3bc0150de889e397ba7a9 31-Jan-2008 Nate Begeman <natebegeman@mac.com> Remainder of the __builtin_overload feedback


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46601 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
796ef3d4a32ce8d9e76df0d5bcab07db97883064 31-Jan-2008 Nate Begeman <natebegeman@mac.com> Remainder of the __builtin_overload feedback


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46601 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
44aec4c8f8e3a76485a9238176285413a2a548c1 31-Jan-2008 Steve Naroff <snaroff@apple.com> Add support for CallExpr::isBuiltinConstantExpr(). For now, this hook is used to support CFConstantStrings. Can be extended to support other built-in functions.

This allows the following code to compile without error...

#include <CoreFoundation/CoreFoundation.h>

#define CONST_STRING_DECL(S, V) const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V);

CONST_STRING_DECL(kCFTimeZoneSystemTimeZoneDidChangeNotification, "kCFTimeZoneSystemTimeZoneDidChangeNotification")



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46592 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c4f8e8b645b8e0e685c089dde0674c6f29a24168 31-Jan-2008 Steve Naroff <snaroff@apple.com> Add support for CallExpr::isBuiltinConstantExpr(). For now, this hook is used to support CFConstantStrings. Can be extended to support other built-in functions.

This allows the following code to compile without error...

#include <CoreFoundation/CoreFoundation.h>

#define CONST_STRING_DECL(S, V) const CFStringRef S = (const CFStringRef)__builtin___CFStringMakeConstantString(V);

CONST_STRING_DECL(kCFTimeZoneSystemTimeZoneDidChangeNotification, "kCFTimeZoneSystemTimeZoneDidChangeNotification")



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46592 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1eaa671cb983cb325022fa58a64f48782ca02aa3 31-Jan-2008 Ted Kremenek <kremenek@apple.com> Added method "printTerminator" to CFGBlock so that external clients can
pretty-print a block's terminator.

When building CFGs, for IfStmts ('if'), we no longer add the ParenExpr
that is the subexpression of the IfStmt to the CFG; instead we add its
first descendant subexpression that is not a ParenExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46580 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
a292585207adbf6dcf6347db3526a7ec861d8eac 31-Jan-2008 Ted Kremenek <kremenek@apple.com> Added method "printTerminator" to CFGBlock so that external clients can
pretty-print a block's terminator.

When building CFGs, for IfStmts ('if'), we no longer add the ParenExpr
that is the subexpression of the IfStmt to the CFG; instead we add its
first descendant subexpression that is not a ParenExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46580 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
bd881ef0b56faad84f6e81ba56c6d107b8dac28e 30-Jan-2008 Nate Begeman <natebegeman@mac.com> Implement first round of feedback on __builtin_overload



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46572 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
67295d05c50ab0b5d1b0f9ef82a906701c348715 30-Jan-2008 Nate Begeman <natebegeman@mac.com> Implement first round of feedback on __builtin_overload



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46572 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
f0154e97e54100534ea0fb0495c9f91a6cbcda4a 30-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46570 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
bd144b7ac70cc96cb1ff822347c2bb9b330729ec 30-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46570 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5f5d622213a719e1da54300bf14639a6b677ab0e 30-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed misc. issues raised by Chris L. on @synchronized implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46558 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
78a677bbb5fa115fa0995b5783adeeefad67167e 30-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed misc. issues raised by Chris L. on @synchronized implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46558 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
26a9d928c664d0584828590755a9a8944412a5bb 30-Jan-2008 Chris Lattner <sabre@nondot.org> Eli points out this can only happen for scalar elements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46550 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
3fd1dfa22f2642c627ad2139b048b99fc5507ef3 30-Jan-2008 Chris Lattner <sabre@nondot.org> Eli points out this can only happen for scalar elements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46550 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
61f8977174bd3b0dff44c921d600aea6a2ff0c46 30-Jan-2008 Chris Lattner <sabre@nondot.org> Be more explicit about what flavors of initlistexpr's we can see. I don't
know if all of this is exactly right, but it seems like the right thing to
aim for. Steve, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46549 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
196ef51bc4d008ec1c69851fb3b0f8d036065931 30-Jan-2008 Chris Lattner <sabre@nondot.org> Be more explicit about what flavors of initlistexpr's we can see. I don't
know if all of this is exactly right, but it seems like the right thing to
aim for. Steve, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46549 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
006d1542188bc9b77c31246cbc344f724dce64a0 30-Jan-2008 Chris Lattner <sabre@nondot.org> move some constructors out of line and fix indentation in ObjCAtThrowStmt::getSourceRange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46547 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
db6ed1786bf460e1143f67d14bf2d71ad9856f81 30-Jan-2008 Chris Lattner <sabre@nondot.org> move some constructors out of line and fix indentation in ObjCAtThrowStmt::getSourceRange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46547 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
499bf41ed7af222723eda7d0e0e3364f688d92ab 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46533 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
a0f55792409289d1d343023fa8292cff6355e538 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46533 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
c9fd4d19ac2d2884dfceb8bbf8186b6529dde192 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> AST for @synchronized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46524 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
fa3ee8e6776634caf064ba5928ca7699d317a280 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> AST for @synchronized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46524 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
993360a70feeeb16068ad9d1342ababab6ee35d7 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Bunch of type defs, etc. for @synchronized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46520 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
c385c90c68dfa376650e2facfbb444b2ec9bd110 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Bunch of type defs, etc. for @synchronized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46520 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
52774ad4dcf54d85813a93001c3b866842f792cf 29-Jan-2008 Anders Carlsson <andersca@mac.com> Implement __builtin_offsetof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46515 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5a1deb8d9c0722beae28d693fa137bbb942bd11f 29-Jan-2008 Anders Carlsson <andersca@mac.com> Implement __builtin_offsetof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46515 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d404c3524e2e00e8c859fff659d5444a412dda23 28-Jan-2008 Steve Naroff <snaroff@apple.com> Implement "private extern" on function decls!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46464 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
7dd0bd4f8f83d9e679c830b30d67028b3609fde1 28-Jan-2008 Steve Naroff <snaroff@apple.com> Implement "private extern" on function decls!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46464 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1cbb276ad30a12054198499ccd12bb608c695eae 25-Jan-2008 Steve Naroff <snaroff@apple.com> Add more support for Apple's "private extern" extension...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46371 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d6326c6fe586ba178734c49ba33a2c1af021822c 25-Jan-2008 Steve Naroff <snaroff@apple.com> Add more support for Apple's "private extern" extension...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46371 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c884988f88ef700a358fb137bdcb8b5bf0af732c 23-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a nasty bug which took a while to come up with a test case,
diagnose, and took even longer to fix. It has to do with rewriting of a message
receiver which is an 'ivar' reference. Fix, however, is to remove a code which
was not doing the right thing and no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46279 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7da8d94cb79f311c5b126483b8edfe5dc70d6c8f 23-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a nasty bug which took a while to come up with a test case,
diagnose, and took even longer to fix. It has to do with rewriting of a message
receiver which is an 'ivar' reference. Fix, however, is to remove a code which
was not doing the right thing and no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46279 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
248db26430b2f5b826001755dc998b0e9dcfcd01 22-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Problem with ObjC's type-encoding of nested structs causing infinit recursion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46260 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7d6b46d9a9d75dea8ef9f6973dd50633c1f37963 22-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Problem with ObjC's type-encoding of nested structs causing infinit recursion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46260 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
00a313b920df9931e893c7194f932ff6f7580e04 21-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Elimate bogus warning when va_start is correctly used in
a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46232 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
2338d58a905191c4205d4f73affd0bdaa13493b4 21-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Elimate bogus warning when va_start is correctly used in
a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46232 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
771d8f421cc12a168e92a45f7f0be713ebda5b11 21-Jan-2008 Steve Naroff <snaroff@apple.com> Add a predicate/getter when checking for incomplete array types ("[]").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46231 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
5c06a69a3ef19cc6dbeed7f2acb9de28b66c45d4 21-Jan-2008 Steve Naroff <snaroff@apple.com> Add a predicate/getter when checking for incomplete array types ("[]").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46231 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
be72efa82435bb10430db4a5608ef3f8fb2f4907 19-Jan-2008 Steve Naroff <snaroff@apple.com> Fix two bugs with an @throw that doesn't have a statement.
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46184 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
20ebf8f15df48f27ce2bf7c1b3ae87565235600f 19-Jan-2008 Steve Naroff <snaroff@apple.com> Fix two bugs with an @throw that doesn't have a statement.
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46184 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ab6c590678b82ae86a72e024eac9dda6437eb76b 17-Jan-2008 Ted Kremenek <kremenek@apple.com> Modified the notion of "Block-level expressions" in CFGs to include Stmt*. This
is because GNU-style Statement-expressions cause the last statement in the
statement-expression to act like an expression.

We now have two notions: block-level statements and block-level expressions.

The former are all Stmt* that appear in the list of statements in CFGBlocks. The
latter is the subset of the former; these block-level statements are used as
subexpressions somewhere in the AST. CFG::isBlockExpr() returns true for the
latter, not the former (previously isBlockExpr() always returned true for
non-Expr Stmt*).

Modified the LiveVariables analysis to also track liveness state for block-level
expressions (using the updated definition of block-level expressions).

Modified the dataflow solver so that when it records values for block-level
statements, it records the dataflow value *before* the transfer function for a
Stmt* is evaluated (not after). This is more in sync in what clients will want.

Modified CFGStmtVisitor to record the current block-level statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46143 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
86946745225096243f6969dc745267b78fc211a6 17-Jan-2008 Ted Kremenek <kremenek@apple.com> Modified the notion of "Block-level expressions" in CFGs to include Stmt*. This
is because GNU-style Statement-expressions cause the last statement in the
statement-expression to act like an expression.

We now have two notions: block-level statements and block-level expressions.

The former are all Stmt* that appear in the list of statements in CFGBlocks. The
latter is the subset of the former; these block-level statements are used as
subexpressions somewhere in the AST. CFG::isBlockExpr() returns true for the
latter, not the former (previously isBlockExpr() always returned true for
non-Expr Stmt*).

Modified the LiveVariables analysis to also track liveness state for block-level
expressions (using the updated definition of block-level expressions).

Modified the dataflow solver so that when it records values for block-level
statements, it records the dataflow value *before* the transfer function for a
Stmt* is evaluated (not after). This is more in sync in what clients will want.

Modified CFGStmtVisitor to record the current block-level statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46143 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
9f3bfb7f98f3e4eb7641c700081eecd16d055c3a 17-Jan-2008 Nate Begeman <natebegeman@mac.com> Implement basic overload support via a new builtin, __builtin_overload.

__builtin_overload takes 2 or more arguments:
0) a non-zero constant-expr for the number of arguments the overloaded
functions will take
1) the arguments to pass to the matching overloaded function
2) a list of functions to match.

The return type of __builtin_overload is inferred from the function whose args
match the types of the arguments passed to the builtin. For example:

float a;
float sinf(float);
int sini(int);

float b = __builtin_overload(1, a, sini, sinf);

Says that we are overloading functions that take one argument, and trying to
pass an argument of the same type as 'a'. sini() does not match since it takes
and argument of type int. sinf does match, so at codegen time this will turn
into float b = sinf(a);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46132 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
e2ce1d9440186cf3332368291cd884a6e3ae8946 17-Jan-2008 Nate Begeman <natebegeman@mac.com> Implement basic overload support via a new builtin, __builtin_overload.

__builtin_overload takes 2 or more arguments:
0) a non-zero constant-expr for the number of arguments the overloaded
functions will take
1) the arguments to pass to the matching overloaded function
2) a list of functions to match.

The return type of __builtin_overload is inferred from the function whose args
match the types of the arguments passed to the builtin. For example:

float a;
float sinf(float);
int sini(int);

float b = __builtin_overload(1, a, sini, sinf);

Says that we are overloading functions that take one argument, and trying to
pass an argument of the same type as 'a'. sini() does not match since it takes
and argument of type int. sinf does match, so at codegen time this will turn
into float b = sinf(a);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46132 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
dcecd5cbbe024118ef7432299a44dbb511588cfc 17-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Renamed getSynthesizedSelectorSize to getSynthesizedMethodSize. Compute method name
size in accordance with how rewriter synthesizes method name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46131 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
faf5e779d16bb4590f2a97e1c7ded255eddd90f3 17-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Renamed getSynthesizedSelectorSize to getSynthesizedMethodSize. Compute method name
size in accordance with how rewriter synthesizes method name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46131 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
87e30c5f73ee7a900367a5f776f03a49807bf7c7 17-Jan-2008 Ted Kremenek <kremenek@apple.com> Added method Expr::IgnoreParens(), which returns the first non-ParenExpr Expr*.
Refactored the use of this method into both the Sema module and Analysis module,
which were using their own static functions that did the same thing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46129 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4e99a5fc3b203397a91136c6e695e405fb8fc606 17-Jan-2008 Ted Kremenek <kremenek@apple.com> Added method Expr::IgnoreParens(), which returns the first non-ParenExpr Expr*.
Refactored the use of this method into both the Sema module and Analysis module,
which were using their own static functions that did the same thing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46129 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4aaf0c933f55f2cfcb8fa873ba56272bad5658a2 17-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Computed length of a __func__ identifier used in an objective-c method correctly,
when creating its type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46109 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
847794a7620bfd5fda09ee06bc0205d30e17e2aa 17-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Computed length of a __func__ identifier used in an objective-c method correctly,
when creating its type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46109 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ba9a28748502398a323994d6d43b26c669b77dc4 17-Jan-2008 Steve Naroff <snaroff@apple.com> Type::isArithmeticType(): disallow incomplete enum decls.

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46102 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
67c49e892b50a9ccb64f7296e00c23c61a8b7186 17-Jan-2008 Steve Naroff <snaroff@apple.com> Type::isArithmeticType(): disallow incomplete enum decls.

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46102 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2c421bc2e631478472181d7c958b292f97149b93 16-Jan-2008 Chris Lattner <sabre@nondot.org> add accessors to switchstmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46082 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
20dabe8b8ff7ed6d2d0158fee43755a4bc7642c3 16-Jan-2008 Chris Lattner <sabre@nondot.org> add accessors to switchstmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46082 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
4300121ffff80d4b23d17689930e2aa2a83086b9 15-Jan-2008 Steve Naroff <snaroff@apple.com> - Change Type::isComplexType() to exlude GCC's complex integer extension. In general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec).
- Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType().

This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46005 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
02f62a9fedbc370fba081303399410a3afdde29f 15-Jan-2008 Steve Naroff <snaroff@apple.com> - Change Type::isComplexType() to exlude GCC's complex integer extension. In general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec).
- Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType().

This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46005 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
8888c7acd5cd43c7f910bfe03f5979ed4011de2a 15-Jan-2008 Steve Naroff <snaroff@apple.com> Add a comment...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45993 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
96d2c438f5c9ada8229f7f2ac049d2e9957bc954 15-Jan-2008 Steve Naroff <snaroff@apple.com> Add a comment...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45993 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
36e35e652e28cbdffbeda8cc3362888357ec7173 15-Jan-2008 Steve Naroff <snaroff@apple.com> Rework commit r45976, which was incorrect.

- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45992 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4cdec1c3ca80124024a787ce32833fd5b20cbb15 15-Jan-2008 Steve Naroff <snaroff@apple.com> Rework commit r45976, which was incorrect.

- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45992 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f3b25969dfe50a46b0a655cb2d1587e55a8e8c08 15-Jan-2008 Ted Kremenek <kremenek@apple.com> Removed mutation of CFGBlock through operator[]. For now the underlying ASTs,
however, can still be manipulated through the returned Stmt*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45990 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
3bf49e3fa8fa4630c48d78c19e3640fcaf67d07c 15-Jan-2008 Ted Kremenek <kremenek@apple.com> Removed mutation of CFGBlock through operator[]. For now the underlying ASTs,
however, can still be manipulated through the returned Stmt*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45990 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
3b1c3c095fca9acb7976cf11b2055cfa07996c6d 15-Jan-2008 Ted Kremenek <kremenek@apple.com> Added operator[] for CFGBlock. This provides random access to the statements
of a block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45984 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
be7a7d6f2e5b86807afd08a568863df973baaa38 15-Jan-2008 Ted Kremenek <kremenek@apple.com> Added operator[] for CFGBlock. This provides random access to the statements
of a block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45984 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
229bcdd2b25343e76da813ac6ef5391519a06676 14-Jan-2008 Ted Kremenek <kremenek@apple.com> Cleaned up comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45970 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
86d1777a6b7723865c1e67a7aafc797ec0a574ff 14-Jan-2008 Ted Kremenek <kremenek@apple.com> Cleaned up comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45970 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
a4f6b1f476b7094acedf1acfd23e2e8d09c6cd9d 14-Jan-2008 Ted Kremenek <kremenek@apple.com> Cleaned up comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45969 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
95b1a9055ea7a27c231f6e082e5bcee4947ea0ce 14-Jan-2008 Ted Kremenek <kremenek@apple.com> Cleaned up comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45969 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
be37fc0e62b9eba4f30a54e6188382bfb462b627 14-Jan-2008 Steve Naroff <snaroff@apple.com> Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.

Bug/patch by Eli Friedman!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e9b12198c4cc7f5687960100351b4af006c14469 14-Jan-2008 Steve Naroff <snaroff@apple.com> Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.

Bug/patch by Eli Friedman!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
806a5f566a37736a7de1eae35d324ce5ce7669ae 12-Jan-2008 Chris Lattner <sabre@nondot.org> Add first pieces of support for parsing and representing
extern "C" in C++ mode. Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45904 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c6fdc34ac0183bfa03d65f317c78b7bdac52897e 12-Jan-2008 Chris Lattner <sabre@nondot.org> Add first pieces of support for parsing and representing
extern "C" in C++ mode. Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45904 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5ee98a7de4266ec2de0bff9fcb270c3960aa52e6 11-Jan-2008 Ted Kremenek <kremenek@apple.com> Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
to have a much simpler, cleaner interpretation of what is a "location"
in a function (as encoded by a CFG).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45846 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
83c01da96f57cf732a5da9a83e2981241f205dc4 11-Jan-2008 Ted Kremenek <kremenek@apple.com> Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdge
to have a much simpler, cleaner interpretation of what is a "location"
in a function (as encoded by a CFG).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45846 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
df2b095116b8d71caeb20cf9b54c51c727403c67 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Allow messaging expression as foreach's collection expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45793 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
7571228ec9b31de7733ae96352ee4eaa8afcf2b5 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Allow messaging expression as foreach's collection expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45793 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
2ea769b494649b5ca4864acf154f2fedc7718029 09-Jan-2008 Chris Lattner <sabre@nondot.org> Fix a typo, patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45763 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3830f68e9e461a1b812b70f93103f8fb4ccb8c40 09-Jan-2008 Chris Lattner <sabre@nondot.org> Fix a typo, patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45763 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
42730c53aeef9ac6c258d317065fdf38da4e043c 07-Jan-2008 Ted Kremenek <kremenek@apple.com> Substituted all instances of the string "Objc" for "ObjC". This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
xpr.h
tmt.h
tmtNodes.def
ype.h
a526c5c67e5a0473c340903ee542ce570119665f 07-Jan-2008 Ted Kremenek <kremenek@apple.com> Substituted all instances of the string "Objc" for "ObjC". This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45715 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
xpr.h
tmt.h
tmtNodes.def
ype.h
324949ada542f6eabd2989c2240475a6526f829a 07-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Make interfaceTypesAreCompatible a private method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45713 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
8cc71e8d00896e758cf56ea86cfc1f62ade16478 07-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Make interfaceTypesAreCompatible a private method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45713 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
cadb0704e778f9ebdf6e58c399f435a5eae354cb 05-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Minor changes as suggested by Chris L.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45598 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
335a2d4122e41343fe11a775889b8bec5b14be60 05-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Minor changes as suggested by Chris L.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45598 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
04379f1f873cb08721223dabf4fa23e964b5087d 03-Jan-2008 Ted Kremenek <kremenek@apple.com> Constified methods front() and back() in CFGBlock.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45549 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
5156ad8b2e64850a13d4e9d9ddeb3f9c6b9d3ebb 03-Jan-2008 Ted Kremenek <kremenek@apple.com> Constified methods front() and back() in CFGBlock.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45549 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
9e920f38a2b2fb3c019f518c82d798452cd8b3b4 02-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> New declarations/defs for Objc2's foreach-statement. This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45511 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
0196cab54007ff072ec2642da8911c6b7e8d3fb5 02-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> New declarations/defs for Objc2's foreach-statement. This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45511 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
386ab8a072825ab47365159a2a078e3da1d752ae 02-Jan-2008 Chris Lattner <sabre@nondot.org> Compute the proper sourcerange for an CompoundLiteralExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45504 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0fc53dfc7a33f68e71ef245389c4e7cd34a62a39 02-Jan-2008 Chris Lattner <sabre@nondot.org> Compute the proper sourcerange for an CompoundLiteralExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45504 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
350b6ddaea5f7b260edc07567b6710077c786a31 29-Dec-2007 Chris Lattner <sabre@nondot.org> remove attributions from .def files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45413 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
PCBuiltins.def
tmtNodes.def
86Builtins.def
0538bc56e3fbb580921082bd80b2ddefb6ed2532 29-Dec-2007 Chris Lattner <sabre@nondot.org> remove attributions from .def files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45413 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
PCBuiltins.def
tmtNodes.def
86Builtins.def
959e5be188a505881058777f35abaaa3fe2de40b 29-Dec-2007 Chris Lattner <sabre@nondot.org> Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
ST.h
STConsumer.h
STContext.h
uiltins.h
FG.h
ecl.h
eclObjC.h
xpr.h
xprCXX.h
rettyPrinter.h
ecordLayout.h
tmt.h
tmtGraphTraits.h
tmtIterator.h
tmtVisitor.h
argetBuiltins.h
ranslationUnit.h
ype.h
0bc735ffcfb223c0186419547abaa5c84482663e 29-Dec-2007 Chris Lattner <sabre@nondot.org> Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
ST.h
STConsumer.h
STContext.h
uiltins.h
FG.h
ecl.h
eclObjC.h
xpr.h
xprCXX.h
rettyPrinter.h
ecordLayout.h
tmt.h
tmtGraphTraits.h
tmtIterator.h
tmtVisitor.h
argetBuiltins.h
ranslationUnit.h
ype.h
e9064e7d2ba2a867fdcc334fa5dd9b9b5c70cf67 29-Dec-2007 Christopher Lamb <christopher.lamb@gmail.com> Fix an error in the base/idx accessors for ArraySubscriptExpr's that crops up with vector element access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
33fd5c124aac15bab7cad95e4e0e7761356d2c06 29-Dec-2007 Christopher Lamb <christopher.lamb@gmail.com> Fix an error in the base/idx accessors for ArraySubscriptExpr's that crops up with vector element access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45390 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c257c0df2ed131339c32d69f8c0da15628acef1f 28-Dec-2007 Chris Lattner <sabre@nondot.org> Add accessors + iterator interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45378 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d18b3299debb7b0dbd9d34d9369189dc98c87f53 28-Dec-2007 Chris Lattner <sabre@nondot.org> Add accessors + iterator interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45378 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cd71bf4d38c564db4147a53aad25adbc82406436 21-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> More objective-c type analysis. This time involving objective types
of conforming protocols (or not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45276 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
d0c89c4609494e4aae0afb7704c35c0e9523f532 21-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> More objective-c type analysis. This time involving objective types
of conforming protocols (or not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45276 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
8782907922eb4311cd1ae35703695f9499a14362 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to do type-checking for objctive-c's object types.
More is yet to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45263 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
c395bda57a0b2f6d8433a462caa780a7dcb7307b 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to do type-checking for objctive-c's object types.
More is yet to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45263 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3900a1d8cc0ee7815f928dd588032d5b29166269 20-Dec-2007 Chris Lattner <sabre@nondot.org> add accessor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45262 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
18b2515e1bf8c86a4900792692e42fe1296be28d 20-Dec-2007 Chris Lattner <sabre@nondot.org> add accessor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45262 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5319d9cf6aa4db4992d7c426d0fabfec0a49011a 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> More objective-c typechecking stuff. This is work in progress and more patches
are due to arrive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45244 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7359f04a80cae1dcbd944ee07eb50a27ce7f5077 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> More objective-c typechecking stuff. This is work in progress and more patches
are due to arrive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45244 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
5333a6b1be5e1df8217a1997cc1958efd7d2f0dc 20-Dec-2007 Chris Lattner <sabre@nondot.org> Add iterator interface to function/method parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45233 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
d57f635d520e8cb5b93d3d770ff58db06c62de54 20-Dec-2007 Chris Lattner <sabre@nondot.org> Add iterator interface to function/method parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45233 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
17861c5ed9cb5eab947d99520a6ef9c706e65dbc 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Interned MainFileID within SourceManager. Since SourceManager is referenced by
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45228 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
95041a2029a069386ee67439f6d0fb524a9d184f 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Interned MainFileID within SourceManager. Since SourceManager is referenced by
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45228 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
74273de1e1c97b860e811d4917f11e1bfe6e0120 19-Dec-2007 Steve Naroff <snaroff@apple.com> Various tweaks to the get/lookup instance/class method API's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45224 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
94a5c3334bba3cc8cd1da85ba1118bc2c080add9 19-Dec-2007 Steve Naroff <snaroff@apple.com> Various tweaks to the get/lookup instance/class method API's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45224 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
d890f6a31b4814021ccaf8f2d82667a061b23bd5 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Removed "SourceFile" from TranslationUnit. This same information will (soon)
be available by querying the SourceManager within the ASTContext referenced by
the TranslationUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45223 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
fdfc198013c372c41669957639eac56d27fd57f4 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Removed "SourceFile" from TranslationUnit. This same information will (soon)
be available by querying the SourceManager within the ASTContext referenced by
the TranslationUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45223 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
ab74937a9a27abd5b5ca8456e0bd4f19f1f76a42 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Removed storing inode and device number in TranslationUnit.

Added "SourceFile" string to TranslationUnit to record corresponding
source file.

Updated serialization of TranslationUnits and logic in the driver to
correctly pass the source file information to the serializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45211 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
63ea863d4715249551ab10ae207386ddc383419e 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Removed storing inode and device number in TranslationUnit.

Added "SourceFile" string to TranslationUnit to record corresponding
source file.

Updated serialization of TranslationUnits and logic in the driver to
correctly pass the source file information to the serializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45211 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
89296c5e0beffc12f0e604716a53f2b19ed4903f 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Updated locations of TranslationUnit.[cpp,h] in XCode project.
Added AST/ASTConsumer.cpp to XCode project.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45206 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
9dadf5a3ffe04bfe7c00668557a947b5d474268b 19-Dec-2007 Ted Kremenek <kremenek@apple.com> Updated locations of TranslationUnit.[cpp,h] in XCode project.
Added AST/ASTConsumer.cpp to XCode project.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45206 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
957442db1d23f62ee2d0d71310bee240606b267d 19-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> This patch concludes implementation of dynamic objective-c type qualified by
protocol list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45203 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
411f373abf5692a1bd90d35a139d955fa67ae82d 19-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> This patch concludes implementation of dynamic objective-c type qualified by
protocol list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45203 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
e4e5e26d50a11cd848c54028599f3fdebfafa96b 19-Dec-2007 Steve Naroff <snaroff@apple.com> Emit errors when attempting to rewrite ObjC expressions that originate from a macro expansion.

We plan on fixing this and removing this restriction after the break...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45200 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5ca4020c6e1e4f8d81cf4c2890ca8a7c0dd28d56 19-Dec-2007 Steve Naroff <snaroff@apple.com> Emit errors when attempting to rewrite ObjC expressions that originate from a macro expansion.

We plan on fixing this and removing this restriction after the break...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45200 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
eccf070720b0db3d1ab9b55aca49347b927afda5 18-Dec-2007 Ted Kremenek <kremenek@apple.com> Moved ReadBitcodeFile and EmitBitcodeFile out of TranslationUnit and made them
the standalone functions ReadASTBitcodeFile and EmitASTBitcodeFile
respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45180 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
dca29279d724a5a84343d27644e7ba172570079f 18-Dec-2007 Ted Kremenek <kremenek@apple.com> Moved ReadBitcodeFile and EmitBitcodeFile out of TranslationUnit and made them
the standalone functions ReadASTBitcodeFile and EmitASTBitcodeFile
respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45180 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
c863207fa9c8b0bea3b99f381914db3c8e2a0b1d 18-Dec-2007 Steve Naroff <snaroff@apple.com> Fix serious regression with ObjcInterfaceDecl. Now that we are storing -1 to mean undefined, we need to change the respective getters from unsigned->int.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45179 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
49747fdd0a05dfc1f15910267d6f86dfe83e6fc8 18-Dec-2007 Steve Naroff <snaroff@apple.com> Fix serious regression with ObjcInterfaceDecl. Now that we are storing -1 to mean undefined, we need to change the respective getters from unsigned->int.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45179 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3f08f18630d9a41a933051510f9dd74604b1b43e 18-Dec-2007 Ted Kremenek <kremenek@apple.com> Moved TranslationUnit.h to include path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45176 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
9765ec210b8df446fd591ebbac848d805f7d4836 18-Dec-2007 Ted Kremenek <kremenek@apple.com> Moved TranslationUnit.h to include path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45176 91177308-0d34-0410-b5e6-96231b3b80d8
ranslationUnit.h
dcb2b1e489948a570ee07ca65e12d42edffa20ef 18-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Refactoring work. ObjcQualifiedIdType is now derived from 'Type'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45174 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
d58fabf7ed279be18a5e82617f809c9deff9be67 18-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Refactoring work. ObjcQualifiedIdType is now derived from 'Type'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45174 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
0448b4f2fecceebc0bddd67fe0f2c89afe604fdf 18-Dec-2007 Chris Lattner <sabre@nondot.org> remove the loc argument to Type::isConstantSizeType, which isn't useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45155 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
9bfa73c5ab7bf4b0e749d04f29da6884e8d5bd9f 18-Dec-2007 Chris Lattner <sabre@nondot.org> remove the loc argument to Type::isConstantSizeType, which isn't useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45155 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
6df9359cad97dc722c01e3ddbc6686ebcf21189c 18-Dec-2007 Chris Lattner <sabre@nondot.org> Fix const propagation bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45152 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
6e999782a102eb444cfc7b8eaa64f84911fdcf4f 18-Dec-2007 Chris Lattner <sabre@nondot.org> Fix const propagation bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45152 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e76e8416ff29ee39140b64ed47731237c67434ae 17-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implemented objective-c's dynamic object pointer qualified with
the protocol list (id<P,...> types).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45121 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
c569249ca0ab755ac79d8cbbfcb2bcae19743624 17-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implemented objective-c's dynamic object pointer qualified with
the protocol list (id<P,...> types).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45121 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
6d7ea52e0877109e4be0969d83b6071fbc314529 15-Dec-2007 Ted Kremenek <kremenek@apple.com> Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to be
so useful and introduced a few bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45051 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
f816f77480e70caadfdbd741cf17d84a6be30b71 15-Dec-2007 Ted Kremenek <kremenek@apple.com> Removed "isSizeOfExpr" mode from StmtIterator. It turned out not to be
so useful and introduced a few bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45051 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
e726eb4f743e253c666958e2517479e305e9cfcb 15-Dec-2007 Ted Kremenek <kremenek@apple.com> Added "mode" to StmtIterator to record if the expression being iterated
over is the subexpression of a sizeof(expression). Different clients
will wish to handle iteration over such subexpressions differently, and can
now easily query if they are iterating over such statements using the
StmtIterator's inSizeOfExpr().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45047 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
b51d2b2d5497693783338c58dd778b6427e85ba7 15-Dec-2007 Ted Kremenek <kremenek@apple.com> Added "mode" to StmtIterator to record if the expression being iterated
over is the subexpression of a sizeof(expression). Different clients
will wish to handle iteration over such subexpressions differently, and can
now easily query if they are iterating over such statements using the
StmtIterator's inSizeOfExpr().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45047 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
2ce399af4d1d1e32b32241b284f41484d810ffa6 15-Dec-2007 Steve Naroff <snaroff@apple.com> - Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class.
- Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage.
- Various changes to convert all clients to the above API's...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45046 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
58dbdeb69c063f82d644504fc638120198f7fad2 15-Dec-2007 Steve Naroff <snaroff@apple.com> - Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class.
- Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage.
- Various changes to convert all clients to the above API's...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45046 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b7cf09564c2681feac87ffa509dab98174e6ea06 14-Dec-2007 Ted Kremenek <kremenek@apple.com> Added support to StmtIterator to traverse the size expression of a VLA type
declared in a sizeof. For example:

sizeof(int[foo()]);

the expression "foo()" is an expression that is executed during the evaluation
of sizeof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45043 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
699e9fbeae34cdd651b8e6308649c8939f090cbd 14-Dec-2007 Ted Kremenek <kremenek@apple.com> Added support to StmtIterator to traverse the size expression of a VLA type
declared in a sizeof. For example:

sizeof(int[foo()]);

the expression "foo()" is an expression that is executed during the evaluation
of sizeof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45043 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
0c2f214d3500d1d080afa36b96db40407b91e70d 13-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceType



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45014 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
06cef25d0b8c383217413f061441c7ea40d1052b 13-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceType



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45014 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
54e10418b0a93e9c5e902254cae018f6990b72d5 13-Dec-2007 Chris Lattner <sabre@nondot.org> add some builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44995 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
99852af849df426018ba84d28b3a8f621dbf9e60 13-Dec-2007 Chris Lattner <sabre@nondot.org> add some builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44995 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
e33928b6572c72f7fe87b57db4f8ae3ed7baa9f1 13-Dec-2007 Ted Kremenek <kremenek@apple.com> Updated serialization of ParmVarDecl to serialize out objcDeclQualifier.
Previously this field was serialized out in VarDecl (a parent class), but
now the field belongs to ParmVarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44989 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
137bd91e8ef5fb407dce910704101bf730b13696 13-Dec-2007 Ted Kremenek <kremenek@apple.com> Updated serialization of ParmVarDecl to serialize out objcDeclQualifier.
Previously this field was serialized out in VarDecl (a parent class), but
now the field belongs to ParmVarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44989 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2e1eb2049a9823869b8d96ea400c9098acd85509 13-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.
Ted, this change necessitates (de)/serialization of ParmVarDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44972 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
de7b4cd12d0d1d3bb781a6633c46131747c8dc27 13-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.
Ted, this change necessitates (de)/serialization of ParmVarDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44972 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d7f64cde88c04e9f4a2c6295bf797fa31921296c 12-Dec-2007 Ted Kremenek <kremenek@apple.com> TargetInfo no longer includes a reference to SourceManager.

Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:

FullLoc.getManager().someMethod(FullLoc.getLocation());

instead we have:

FullLoc.someMethod();

Modified TextDiagnostics (and related classes) to use this short-hand.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
9c728dc4d8da89c73fcae74c9e72d7a83ffd7b6d 12-Dec-2007 Ted Kremenek <kremenek@apple.com> TargetInfo no longer includes a reference to SourceManager.

Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:

FullLoc.getManager().someMethod(FullLoc.getLocation());

instead we have:

FullLoc.someMethod();

Modified TextDiagnostics (and related classes) to use this short-hand.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
c26188aa9644a3575a86966d675972577ca1bde2 12-Dec-2007 Chris Lattner <sabre@nondot.org> add an ivar_size() method that never returns -1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44944 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
5564e07af5e62875f3b83fc2e5a8823588b5adea 12-Dec-2007 Chris Lattner <sabre@nondot.org> add an ivar_size() method that never returns -1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44944 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
69b38e8c570cf37dac82e9cc0c735f12b9bec3f8 12-Dec-2007 Chris Lattner <sabre@nondot.org> handle the -1'ness of undefined lists


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44939 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
23c3bb768fd3eb24ff1a7402856405129afac0e3 12-Dec-2007 Chris Lattner <sabre@nondot.org> handle the -1'ness of undefined lists


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44939 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9d76c72cd3748d1b1e105129614220cea8d665af 12-Dec-2007 Chris Lattner <sabre@nondot.org> unbreak the build. I'm still working on test failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44938 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
4c52509ffb9fdd6c93aa7b50812e316f1d920a26 12-Dec-2007 Chris Lattner <sabre@nondot.org> unbreak the build. I'm still working on test failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44938 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
c7b06750b64b3898d5bcbaf68dcdd9ba0aba9f40 12-Dec-2007 Chris Lattner <sabre@nondot.org> more cleanups changing things like getInstanceVariables to iterators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44930 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
be6df088d69bca0e99c7845a6cd8c1ca85034f31 12-Dec-2007 Chris Lattner <sabre@nondot.org> more cleanups changing things like getInstanceVariables to iterators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44930 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
dea5bece2eca7fcfa93656588cf6d5535fb65897 12-Dec-2007 Chris Lattner <sabre@nondot.org> resolve some fixmes and clean up some code by eliminating the get*Vars apis to some classes and use iterators instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44927 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ab4c4d5e5ececa77aae7e291fafcba3049319cdc 12-Dec-2007 Chris Lattner <sabre@nondot.org> resolve some fixmes and clean up some code by eliminating the get*Vars apis to some classes and use iterators instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44927 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ac9ab53d381740181c97506d8a1c95b11d9bef1f 12-Dec-2007 Chris Lattner <sabre@nondot.org> start cleaning up interfaces for objc bits and pieces by switching to an
iterator interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44926 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0157c5144513438bb74aebf50d18f95df4104acb 12-Dec-2007 Chris Lattner <sabre@nondot.org> start cleaning up interfaces for objc bits and pieces by switching to an
iterator interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44926 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
12519d477514bb7c7ff3431211f43d08e15e3966 12-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented type checking for pointer of objects of protocol-qualified types.
Note that incompatible-protocol-qualified-types.m is currently failing. This is
unrelated to this patch and Steve is looking at the general problem of not reporting
incompitible pointer types in return stetement..


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44897 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
4ffc54111fdc0baa45bb287f59774e06dea8caa4 12-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented type checking for pointer of objects of protocol-qualified types.
Note that incompatible-protocol-qualified-types.m is currently failing. This is
unrelated to this patch and Steve is looking at the general problem of not reporting
incompitible pointer types in return stetement..


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44897 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
b3ee1931bdd9322d3e29b7d104273eced454844c 11-Dec-2007 Ted Kremenek <kremenek@apple.com> Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7a9d49fd2bfac00e905b361ba76d26ab5b6c3b09 11-Dec-2007 Ted Kremenek <kremenek@apple.com> Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
9a3dedfe1e7680bd985a5e125b183136766cff94 11-Dec-2007 Chris Lattner <sabre@nondot.org> properly namespacify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44845 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
fb344d3ddd538746be75941d50b78ff148441abc 11-Dec-2007 Chris Lattner <sabre@nondot.org> properly namespacify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44845 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
c55a288e30894fbe804aad36581df1d7bf327aed 10-Dec-2007 Anders Carlsson <andersca@mac.com> Revert change that broke the build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44808 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
05f753b996a6ea712ab06787190fb3287610fc59 10-Dec-2007 Anders Carlsson <andersca@mac.com> Revert change that broke the build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44808 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
e8b36072c2d8b1577f1d03c364492c7689207ddb 10-Dec-2007 Anders Carlsson <andersca@mac.com> Address comments from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44804 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
c099b9a94f52f9d2c9135cfcfbc32bc17401500b 10-Dec-2007 Anders Carlsson <andersca@mac.com> Address comments from Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44804 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
7484e11f3388384be75237ca032161961a22bc93 10-Dec-2007 Anders Carlsson <andersca@mac.com> Forgot this file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44790 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
c916d70e0b65bbf6c2800e2818995ab1ce31388e 10-Dec-2007 Anders Carlsson <andersca@mac.com> Forgot this file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44790 91177308-0d34-0410-b5e6-96231b3b80d8
argetBuiltins.h
e1449c127b59bae6266b307ec551e67c9558967c 10-Dec-2007 Anders Carlsson <andersca@mac.com> Move target specific builtin IDs to TargetBuiltins.h so that they can be used by CGBuiltin.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44748 91177308-0d34-0410-b5e6-96231b3b80d8
PCBuiltins.def
86Builtins.def
564f1de67d7ba43646b8740db86d6269e3dfbe0b 10-Dec-2007 Anders Carlsson <andersca@mac.com> Move target specific builtin IDs to TargetBuiltins.h so that they can be used by CGBuiltin.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44748 91177308-0d34-0410-b5e6-96231b3b80d8
PCBuiltins.def
86Builtins.def
be4283cec1365a49e88859586c7caea491501892 07-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented when static typing is combined with protocols and use as receiver
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44685 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
7dd82836dca87cf828ce994f161b53a34f6cdb7e 07-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented when static typing is combined with protocols and use as receiver
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44685 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3b1caacf673de9811fea28268f33707b24a1d759 07-Dec-2007 Steve Naroff <snaroff@apple.com> Rewrite 'super' within a class method. This required some minor tweaks to the front-end.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44673 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9bcb5fc1fd48c1f40c6a3b5a59130ebc313b4957 07-Dec-2007 Steve Naroff <snaroff@apple.com> Rewrite 'super' within a class method. This required some minor tweaks to the front-end.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44673 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b4452ed9cfeba4dfbb9155b828e2b052dbd6cdbf 07-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implement "Protocol" as a built-in type declared as
"@class Protocol;"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44670 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
66c5dfc193c4090b67c5effb0e80e287b94de17e 07-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implement "Protocol" as a built-in type declared as
"@class Protocol;"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44670 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
a8897f00c3e8bee75e248feb9ad6fafbd541e264 05-Dec-2007 Anders Carlsson <andersca@mac.com> Implement codegen for builtin infinity functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44604 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
c8ee7988c4ea9ec784625d2a47a8575feb191421 05-Dec-2007 Anders Carlsson <andersca@mac.com> Implement codegen for builtin infinity functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44604 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
1defb8d5ad19aeafd348b63463abd3844908ccf8 05-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of: ObjCEncodeExpr, ObjCSelectorExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44593 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8f6dc77d1fa6c9fd71d26c96bfa007775d8e3905 05-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of: ObjCEncodeExpr, ObjCSelectorExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44593 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
336b2e876f0748659dbf8415e24d41ba88e66f8a 04-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Simplified setting up Method's scope before generating AST for its nody.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44576 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
b107ce82d425939ce32fc3c02faf7c2364abc1a3 04-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Simplified setting up Method's scope before generating AST for its nody.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44576 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
abb4f6ac8b35246285fe31035ee915e6a137c68b 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ObjCStringLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44568 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
46dc0a54ed6deb165117a6b0166d9bb7acb785f5 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ObjCStringLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44568 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
461155627628ee992cd92e7d60920e84b2a675ea 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ObjcAtThrowStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44567 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5bdd4e300b432246b9d261702828e9875414128b 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ObjcAtThrowStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44567 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b006fb3973661ac21f589829bf573b403371111b 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ObjcAtTryStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44566 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
9c1efff14b0e001f73c875ed5b184fb3569d641d 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ObjcAtTryStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44566 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
54ef3bd4604692e1671d9e8466be598c86490750 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ObjcAtFinallyStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44564 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
04be5aae2dc17292e2007401599638f3c6ba30de 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ObjcAtFinallyStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44564 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
a0c7df3c56442c64697595b4fa499defe31f7fd9 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ObjcAtCatchStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44563 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
af526779b36f43f59e47cfc5b10bb0c48562f4a9 04-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ObjcAtCatchStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44563 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
7a5f9d58033a557549ad5717c746522143f78afa 03-Dec-2007 Ted Kremenek <kremenek@apple.com> Added getTrueExpr() and getFalseExpr() to ConditionalOperator. These methods
provide handy accessors to the subexpressions of ConditionalOperator that
automatically take into account the GCC extension where the "LHS" expression is
omitted: e.g x ?: y;. When the LHS expression is available, getTrueExpr() is the
same as getLHS(); when LHS is NULL, getTrueExpr() returns the condition expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44536 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
395a2abf0028968d85958610e393e067885dc14f 03-Dec-2007 Ted Kremenek <kremenek@apple.com> Added getTrueExpr() and getFalseExpr() to ConditionalOperator. These methods
provide handy accessors to the subexpressions of ConditionalOperator that
automatically take into account the GCC extension where the "LHS" expression is
omitted: e.g x ?: y;. When the LHS expression is available, getTrueExpr() is the
same as getLHS(); when LHS is NULL, getTrueExpr() returns the condition expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44536 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e5860b7c6e1e6933b6c5602fc0259ef14d1dd5ce 03-Dec-2007 Chris Lattner <sabre@nondot.org> add a fixme


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44523 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
7c6b3d3ac3f8526c3ae444620ed7d58d25311aed 03-Dec-2007 Chris Lattner <sabre@nondot.org> add a fixme


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44523 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
56118007865a64979aa30c1d77d1363bfaabd7ad 02-Dec-2007 Anders Carlsson <andersca@mac.com> Implement __builtin_bswap32 and __builtin_bswap64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44521 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
df4852ac816e6050d53b808b86d7c1c9738eb99e 02-Dec-2007 Anders Carlsson <andersca@mac.com> Implement __builtin_bswap32 and __builtin_bswap64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44521 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
d22cc722e595723dfd77330c9efb64848fd3adf9 02-Dec-2007 Chris Lattner <sabre@nondot.org> all filevar's have static storage. Previously a global with
extern storage class was returning false from hasStaticStorage.
Ted, please review this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44515 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d411e04db18f7d07a889d51086861b23cbe05518 02-Dec-2007 Chris Lattner <sabre@nondot.org> all filevar's have static storage. Previously a global with
extern storage class was returning false from hasStaticStorage.
Ted, please review this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44515 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
db3fb0318d9bb4018161106a991fb5de8d96f263 02-Dec-2007 Chris Lattner <sabre@nondot.org> Teach clang the prototype for __builtin_alloca.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44504 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
434415af9de3cd9d72d43a78ffe714250fab83dc 02-Dec-2007 Chris Lattner <sabre@nondot.org> Teach clang the prototype for __builtin_alloca.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44504 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
5fec5968c1b24fe70629e4ba13e013e461acfb58 02-Dec-2007 Chris Lattner <sabre@nondot.org> register clz and ctz builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44500 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
bbb75f63001af0d9b62995d3a5d62f7469bd74d3 02-Dec-2007 Chris Lattner <sabre@nondot.org> register clz and ctz builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44500 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
b8eb007afdef9e27fc536d6f693c974895cab374 02-Dec-2007 Oliver Hunt <oliver@apple.com> Add support for __builtin_expect which is needed for assert,
among other things.

Also change a codegen warning to dump to stderr so it doesn't
mess with -emit-llvm output



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44497 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
6f0768bc565028d2536fc41ee0d466c13985a921 02-Dec-2007 Oliver Hunt <oliver@apple.com> Add support for __builtin_expect which is needed for assert,
among other things.

Also change a codegen warning to dump to stderr so it doesn't
mess with -emit-llvm output



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44497 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
d883a78da130374f8adc471769917b6bbdaa37d8 01-Dec-2007 Chris Lattner <sabre@nondot.org> Add #include, patch by Cédric Venet


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44491 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
6e340496341a4704be0ede9c1ff4f8eacea7ee2c 01-Dec-2007 Chris Lattner <sabre@nondot.org> Add #include, patch by Cédric Venet


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44491 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
3663e0c0126aeaf3f725b88c8555a257233b50b0 30-Nov-2007 Ted Kremenek <kremenek@apple.com> Added method "HandleTopLevelDeclaration" to ASTConsumer. This will eventually
be the new hook that ASTStreamer calls to feed top-level Decls to
ASTConsumers.

The difference between "HandleTopLevelDeclaration" and "HandleTopLevelDecl" is
that "HandleTopLevelDecl" is currently called by ASTStreamer for every
top-level declaration, including those that appear within a Decl chain. Using
the new interface, ASTStreamer would only call HandleTopLevelDeclaration for
Decls that appear that the beginning of a Decl chain (i.e., a group of related
decls).

To preserve the behavior that all subclasses of ASTConsumer currently expect,
the default implementation of HandleTopLevelDeclaration simply calls
HandleTopLevelDecl, and for decl chains it calls HandleTopLevelDecl for each
Decl* in a chain of Decls.

The advantage of this interface is that some subclasses of ASTConsumer only
really want the Decl chain, and not each individual Decl passed to them. This
extra level of indirection allows subclasses to override the default behavior
if they so desire.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44444 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
2ff3e691ecc63a5d82d4023b46b5b47ce14ace53 30-Nov-2007 Ted Kremenek <kremenek@apple.com> Added method "HandleTopLevelDeclaration" to ASTConsumer. This will eventually
be the new hook that ASTStreamer calls to feed top-level Decls to
ASTConsumers.

The difference between "HandleTopLevelDeclaration" and "HandleTopLevelDecl" is
that "HandleTopLevelDecl" is currently called by ASTStreamer for every
top-level declaration, including those that appear within a Decl chain. Using
the new interface, ASTStreamer would only call HandleTopLevelDeclaration for
Decls that appear that the beginning of a Decl chain (i.e., a group of related
decls).

To preserve the behavior that all subclasses of ASTConsumer currently expect,
the default implementation of HandleTopLevelDeclaration simply calls
HandleTopLevelDecl, and for decl chains it calls HandleTopLevelDecl for each
Decl* in a chain of Decls.

The advantage of this interface is that some subclasses of ASTConsumer only
really want the Decl chain, and not each individual Decl passed to them. This
extra level of indirection allows subclasses to override the default behavior
if they so desire.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44444 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
ddedbe29217898338b166385b058bb7512fbc0e1 29-Nov-2007 Ted Kremenek <kremenek@apple.com> Added "isExact" field to FloatingLiteral. This flag indicates whether or not
the APFloat representing the parsed literal can represent the literal value
exactly. This is useful when performing various semantic checks on the code,
and issuing appropriate warnings to users.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44423 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
720c4ec57b6110873cd533ad434853a27e7c3f4a 29-Nov-2007 Ted Kremenek <kremenek@apple.com> Added "isExact" field to FloatingLiteral. This flag indicates whether or not
the APFloat representing the parsed literal can represent the literal value
exactly. This is useful when performing various semantic checks on the code,
and issuing appropriate warnings to users.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44423 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
743ec37b37ef887b855c24a8ebbb21d91572b1b5 27-Nov-2007 Chris Lattner <sabre@nondot.org> add several cases that Expr::hasStaticStorage missed, pointed out by Oliver Hunt


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4cc627111453b75519d5130b57e06256da7b00e8 27-Nov-2007 Chris Lattner <sabre@nondot.org> add several cases that Expr::hasStaticStorage missed, pointed out by Oliver Hunt


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
fb0d1395d81a1e202d11efc838921d0915fddf8b 27-Nov-2007 Anders Carlsson <andersca@mac.com> Add builtin type signature support for vector types. Add correct type signatures for a bunch of MMX builtins. We now parse all the intrinsics in mmintrin.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44357 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
142f36de332925dbe19d73d0612d9879b4f80e84 27-Nov-2007 Anders Carlsson <andersca@mac.com> Add builtin type signature support for vector types. Add correct type signatures for a bunch of MMX builtins. We now parse all the intrinsics in mmintrin.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44357 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
4ce42301dacf13aae7a5340ec6fb02c496fb0669 27-Nov-2007 Anders Carlsson <andersca@mac.com> Add more semantic analysis for inline asm statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44349 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d04c6e23f2e10eeb9936778d67f4a1c4a14cc4f6 27-Nov-2007 Anders Carlsson <andersca@mac.com> Add more semantic analysis for inline asm statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44349 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
759f45d5cfb417b39d6e249dbf4925492939d51c 24-Nov-2007 Anders Carlsson <andersca@mac.com> Keep track of whether the asm is volatile or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44297 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
39c47b56f45437bbc49c9568b7308a400234a730 24-Nov-2007 Anders Carlsson <andersca@mac.com> Keep track of whether the asm is volatile or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44297 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
965d52002ff8e79e8ac26a4bd5b8df87d93bdaf4 22-Nov-2007 Anders Carlsson <andersca@mac.com> Store output and input operands as well as clobber information in the AsmStmt. Ted, could you please review the serialization/deserialization code?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44266 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b235fc2cf37621c7fc6511bb2b8788c95f9fb9fc 22-Nov-2007 Anders Carlsson <andersca@mac.com> Store output and input operands as well as clobber information in the AsmStmt. Ted, could you please review the serialization/deserialization code?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44266 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
076c11195af18f4af5765239dc25bff2697fbce3 20-Nov-2007 Anders Carlsson <andersca@mac.com> Store inline asm code in the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44255 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
6a0ef4b83c91a6d6d5acb4ed5577c4659fe022a3 20-Nov-2007 Anders Carlsson <andersca@mac.com> Store inline asm code in the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44255 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e79dbe20141db33e67e8576ff04ae31eac3456be 20-Nov-2007 Anders Carlsson <andersca@mac.com> Add __builtin_abs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44254 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
c2251dc59b0edc28f9303637dec970a7520939ad 20-Nov-2007 Anders Carlsson <andersca@mac.com> Add __builtin_abs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44254 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
9f176d13cf85ed4d3ecfb172ea206a6400253637 15-Nov-2007 Steve Naroff <snaroff@apple.com> Finish up variadic methods/messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44172 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
49f109c786f99eb7468dac3976db083a65493444 15-Nov-2007 Steve Naroff <snaroff@apple.com> Finish up variadic methods/messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44172 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
29fe74607889cd56d40c4958800f0abf1f73a436 15-Nov-2007 Steve Naroff <snaroff@apple.com> Implement support for variadic methods (work in progress).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44171 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
335eafa5be51f6440672a74c73d588af72e96732 15-Nov-2007 Steve Naroff <snaroff@apple.com> Implement support for variadic methods (work in progress).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44171 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6b759ce37a32bd56946d9fb72109cf46365e8da7 15-Nov-2007 Steve Naroff <snaroff@apple.com> - Implement ivar rewrite (patch by Fariborz).
- RewriteMessageExpr()...make implicit casts explicit with synthesizing call (removing warnings when calling objc_msgSend()).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44156 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7e3411b23eb3724da5461dc6d6f97d14b3b0a52f 15-Nov-2007 Steve Naroff <snaroff@apple.com> - Implement ivar rewrite (patch by Fariborz).
- RewriteMessageExpr()...make implicit casts explicit with synthesizing call (removing warnings when calling objc_msgSend()).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44156 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
64be4ada44c719304c1dee75fb1e551f84b7779a 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Added QualType::ReadBackpatch to allow QualType initialization with
backpatching. This original was available, but then we removed it. It is back
again to help with deserialization of FieldDecls. Because FieldDecls are
currently owned by RecordDecls, which are owned by a TagType, the type of the
FieldDecl may not be deserialized prior to deserializing the FieldDecl. Thus
backpatching solves the problem of constructing a FieldDecl that references a
type that has not yet been deserialized.

Simplified serialization of TagType to not require passing in the
SerializedPtrID. Registration of the materialized type object is done after
the CreateImpl method returns (as with other types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44143 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
21d50e12c3c412d8457071dc419363b7a7e8b855 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Added QualType::ReadBackpatch to allow QualType initialization with
backpatching. This original was available, but then we removed it. It is back
again to help with deserialization of FieldDecls. Because FieldDecls are
currently owned by RecordDecls, which are owned by a TagType, the type of the
FieldDecl may not be deserialized prior to deserializing the FieldDecl. Thus
backpatching solves the problem of constructing a FieldDecl that references a
type that has not yet been deserialized.

Simplified serialization of TagType to not require passing in the
SerializedPtrID. Registration of the materialized type object is done after
the CreateImpl method returns (as with other types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44143 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
387539fbcc04cafeb648771cb5db9c4faab03e48 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of InitListExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44137 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6336f8dbae5145eb7b1429a8ec424c44e668f7cb 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of InitListExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44137 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
2d85710dea4040b1a3d0503cc8a4f0e88a9be610 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CompoundLiteralExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44134 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4b7d9ca9fd65a5a68e907b1b7effe33bf1e93629 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CompoundLiteralExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44134 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9c2b8bd3ec1facd60e14e326db05b96f1f5a9b2a 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of EnumDecl and EnumConstantDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44127 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
583e008bbfbb937524d567ad6450b8f0e8485bca 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of EnumDecl and EnumConstantDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44127 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2f260e5577624b69d5b112babaea59ee34e9e6ef 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FieldDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44126 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f9d56c8be593e539098df95b636469104f2967a4 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FieldDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44126 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
581571c848395ba6c7401b5384f91ead457c9adc 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of RecordDecls. Changed serialization of TagType to
have an owning pointer to the referred TagDecl. This should hopefully fix a
bug where TagDecls (including decls from structs, etc.) were not serialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44106 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
aad48b6b2dfc81ad36a05d161c775cd6aab5b339 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of RecordDecls. Changed serialization of TagType to
have an owning pointer to the referred TagDecl. This should hopefully fix a
bug where TagDecls (including decls from structs, etc.) were not serialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44106 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
87f0429f888ee5d332304641611b88f7b54b5065 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FunctionTypeNoProto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44094 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2b14d46231fd75ad1e58043e9fab029c54c817cb 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FunctionTypeNoProto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44094 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
5cde3834f43c0946ec8debfda9c6fb588b6b33fd 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of VariableArrayTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44093 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ed1a01d4d0ee773eb6478ff9701b46d2f0c06952 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of VariableArrayTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44093 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2f665cd2aa263b89ac880dc45283847e5322a6c2 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of TypedefType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44092 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b28166d11e788bc99fd5cd47c4f649ea0195c3b1 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of TypedefType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44092 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4234c1b1a9c858b005f4ad7dc85908b63adcafdd 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ConstantArrayType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44091 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
da5dbb4a0ad091791bdb0dad1b9ceba3c04a7f5c 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ConstantArrayType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44091 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
8db5aa1ca0d42cf8aeaa78cbe196a50f70fc9fc1 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of TagTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a225400804cc53dd9cf6b28cf0e8e7f103a7522f 14-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of TagTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44090 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a7392b33f5f6a4fe080b3713877d5c58428cf39f 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Removed line with typo (declared friendship with ASTContext). Line was
not needed since friendship is declared elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44079 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
950ba9cc6aaa508381fbf56224c68d2da81caa4b 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Removed line with typo (declared friendship with ASTContext). Line was
not needed since friendship is declared elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44079 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
1dfb01cfef910819019c6ef028b82265241868b8 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of AsmStmt (or rather what is currently implemented
in AsmStmt).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44077 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
1f85acd5ff54345788b93111197088160fe9f06e 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of AsmStmt (or rather what is currently implemented
in AsmStmt).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44077 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
deac9c3cf701b04f18af21c222f75c9f6b9ae60b 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for SizeOfAlignOfTypeExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44075 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ea2fe9b435e1b55135de32dcac97366554706ac4 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for SizeOfAlignOfTypeExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44075 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
24160d3509ca6890815069aa59182fc07e650ea1 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for MemberExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44074 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
bd57e7c4754c0ce5d7d460041c8fd613e45c4319 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for MemberExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44074 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
84079d78c2a044e19e74609b356750fff3661fa5 13-Nov-2007 Nate Begeman <natebegeman@mac.com> Give AST-walk passes a way to access DeclSpec attributes on functions and
variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44073 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1b4e251f6d73997732f64e550a2b9cb5ac945c78 13-Nov-2007 Nate Begeman <natebegeman@mac.com> Give AST-walk passes a way to access DeclSpec attributes on functions and
variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44073 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
034a78cafc3505323698ea72db19dc5095324e06 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Rewrote type serialization to used the same methodology as we do for Decls.
Removed tons of dead code in ASTContext concerning how types use to be
serialized.
Removed serialization methods from QualType that are no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44070 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
03ed44061df258e74a40383bda849e14b892a8c6 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Rewrote type serialization to used the same methodology as we do for Decls.
Removed tons of dead code in ASTContext concerning how types use to be
serialized.
Removed serialization methods from QualType that are no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44070 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
ba3ddb21e973cc5e9ce9daf1cefe2e05813b78e9 13-Nov-2007 Chris Lattner <sabre@nondot.org> improve handling of address of global when checking for
constants and initializers. Patch by Sanghyeon Seo, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44049 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1d09ecca892185ba067e47ba879f424de59950ef 13-Nov-2007 Chris Lattner <sabre@nondot.org> improve handling of address of global when checking for
constants and initializers. Patch by Sanghyeon Seo, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44049 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
16c1f61097a33cb93c71ff4661cd918f6a7d276a 13-Nov-2007 Steve Naroff <snaroff@apple.com> Minor indenting changes and removed a level of casting in getClassInterface();



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44039 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0b9cc05556c47b8aa02aea57c7679ff68f196051 13-Nov-2007 Steve Naroff <snaroff@apple.com> Minor indenting changes and removed a level of casting in getClassInterface();



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44039 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a645d8779ae4e8f57136d5bfe1c661dc4adb4d3c 13-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to set context (interface, category, etc.) in which method is declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44038 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b245a33e6f562377946dc9cb5694a2d3cb8a98a3 13-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to set context (interface, category, etc.) in which method is declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44038 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
acba361778a020cd919fca85cf45088e9b81a0af 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Renamed all serialization "Materialize" methods to "Create" to conform with
the new serialization API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44035 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
tmt.h
ype.h
0f84c0059cec39fd1c73ac05bc2864dca664e7f4 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Renamed all serialization "Materialize" methods to "Create" to conform with
the new serialization API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44035 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
tmt.h
ype.h
ddf953af0136f591dd34f4ba7e6a7867ca564714 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Restructured serialization code for decls to make it cleaner, easier to
understand, and batched the emission owned subobjects (using
BatchEmitOwnedPtr) to get a smaller output bitcode size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44033 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
928fd7f76808b895b68a9c6ed55a8f185fad6a35 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Restructured serialization code for decls to make it cleaner, easier to
understand, and batched the emission owned subobjects (using
BatchEmitOwnedPtr) to get a smaller output bitcode size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44033 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4af724922ea737ae8726aa879a50f36a4a667318 12-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to do statically typed ivar references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44028 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
232220c6982e3a70d8f7fc06a011ead490a2f516 12-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to do statically typed ivar references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44028 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
3123363889ae55dd0f3b35f776c4916d1ad5bbb3 12-Nov-2007 Steve Naroff <snaroff@apple.com> Add category method definitions incrementally, removing a FIXME (like we do for class implementations).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44027 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
e1e6c0d5c79c0ee7ed62fef47a19aa7ecef40db4 12-Nov-2007 Steve Naroff <snaroff@apple.com> Add category method definitions incrementally, removing a FIXME (like we do for class implementations).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44027 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
d732bbd0e362ed22de357c22b40e708ba99ad614 12-Nov-2007 Ted Kremenek <kremenek@apple.com> In Stmt serialization, renamed directEmit to EmitImpl and
directMaterialize to CreateImpl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44020 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
ec0aa78745f7b3bc96c20fffd1115bf26aaa0ead 12-Nov-2007 Ted Kremenek <kremenek@apple.com> In Stmt serialization, renamed directEmit to EmitImpl and
directMaterialize to CreateImpl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44020 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
5eb2a4a41a9c7df7124a79de8776cc8e7667547e 12-Nov-2007 Steve Naroff <snaroff@apple.com> Implement instance variable references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44016 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
7779db42c94405ecbd6ee45efb293483fa6cbeff 12-Nov-2007 Steve Naroff <snaroff@apple.com> Implement instance variable references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44016 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
dd2e26c9fbdd9097180b4d864551ddd14c0b02d3 12-Nov-2007 Steve Naroff <snaroff@apple.com> - Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr.
- Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars.
- A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44015 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0330071714f1ba09e926becd666f4fc0ed62bc0b 12-Nov-2007 Steve Naroff <snaroff@apple.com> - Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr.
- Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars.
- A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44015 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b82c50f435ecf93eccd42b07af631c776918a53f 11-Nov-2007 Steve Naroff <snaroff@apple.com> This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() about private methods (r43989).

While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end).

Other details...

- Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments.
- Removed Parser::AllImplMethods (a nice cleanup).
- Added location info to ObjcImplementationDecl (since we will need it very soon:-)
- Modified message.m test to no longer allow the bogus diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43995 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0416fb9f379b49abb3eb0c1cb2ca75107e5a71d1 11-Nov-2007 Steve Naroff <snaroff@apple.com> This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() about private methods (r43989).

While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end).

Other details...

- Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments.
- Removed Parser::AllImplMethods (a nice cleanup).
- Added location info to ObjcImplementationDecl (since we will need it very soon:-)
- Modified message.m test to no longer allow the bogus diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43995 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
b1c7ad904eaf27fbcc33363c991efff5edd3575d 11-Nov-2007 Steve Naroff <snaroff@apple.com> Teach Sema::ActOnInstanceMessage() about private methods. That is, methods declared in an implementation (but not listed in the interface).

This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late).

I will complete this later...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43989 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
c43d868355374d48296ad3be2c9c536698a5e9a8 11-Nov-2007 Steve Naroff <snaroff@apple.com> Teach Sema::ActOnInstanceMessage() about private methods. That is, methods declared in an implementation (but not listed in the interface).

This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late).

I will complete this later...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43989 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
e6f59f1f5da7205cb942de24e5d121cbabdcae4b 10-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Represent method definitions as separate AST nodes. Pretty print will come next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43979 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
60fbca0b027ff5a6579f16cb6e3abab826e0d967 10-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Represent method definitions as separate AST nodes. Pretty print will come next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43979 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
8473b22fde0b777a9151cb4c06aed7ac3e81ce17 09-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Added class context to method declarations. Provide "interface *" type
to 'self' method of instance methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43957 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
1f7b6f88f18d7f6b10265acec5d41c4ed1897487 09-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Added class context to method declarations. Provide "interface *" type
to 'self' method of instance methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43957 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3a4dfc1434039e7ba4cbefa965be906998116acd 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of AddrLabelExpr.
Implemented serialization of ConditionalOperator.
Implemented serialization of StmtExpr.
Fixed bug in serialization of IndirectGoto (did not properly serialize subexpression).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43891 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
aa33763cc3dfa2fcb4fdb3c5b4be0c37f8d8f8e9 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of AddrLabelExpr.
Implemented serialization of ConditionalOperator.
Implemented serialization of StmtExpr.
Fixed bug in serialization of IndirectGoto (did not properly serialize subexpression).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43891 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6d4adb27e6b9fdb74ea48d3ccda8df3daedc9d64 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Revised serialization of CaseStmt to emit all of the owned pointers (its
subexpressions) all together in one block at the end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43862 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
103fc81f12aa635aa0a573c94b1aceb496b4e587 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Revised serialization of CaseStmt to emit all of the owned pointers (its
subexpressions) all together in one block at the end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43862 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
dc4fc278b4511d15d6b3576eb38e9a589f8ff0e4 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CompoundAssignOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43860 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
83efb151a0c1df8cb8fb25d6dbb6c0f12f07f60a 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CompoundAssignOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43860 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e21b584bd53571c08456c493181aec7f2657779d 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of UnaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43858 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1049436d4b53d928b555f7381bc1639dd302bbc7 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of UnaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43858 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7a87333172641d9cf8327c3fb7a3649da2664c38 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CallExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43854 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d7fe4ea296646f049e4ff4cc37aa92ff4014a6b3 08-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CallExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43854 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d7017492da8cb998874185450c2e9b06a8ecc9e1 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ArraySubscriptExpr.
Added "using ..." for "Serializer" and "Deserializer" to reduce amount
of typing for serialization methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43849 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
96fa54fc6dc7f4c8dad1fb22fc7fc4f4d775d6c0 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ArraySubscriptExpr.
Added "using ..." for "Serializer" and "Deserializer" to reduce amount
of typing for serialization methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43849 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
705cb5d216ced7e2529f82bf351eaf3bc3d99a4e 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CastExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43848 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9971c9ace70624987cd74645a75f4bfbc05afdf2 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CastExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43848 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8c9833bef9ae1fb5460b7c8f4ac8b0378a34c4d6 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ImplicitCastExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43847 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a7c20dd6c78db562ff463ee5fb13e248a1d3c93f 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ImplicitCastExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43847 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
efa540d7a27ba91dba8cdc05c6fc80890201c837 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of StringLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43834 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7febad7377c04607aa2c744d58af61e1abea6250 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of StringLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43834 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
105f21a0c5ca4d97e0e8c3ebd726b4c43561cb77 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ImaginaryLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43833 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1c72de1be77fc43cc27e9bf1cbfe7bd25bee2f81 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ImaginaryLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43833 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
18abf6b786e506dcd062485d18d7c81689f00aa6 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FloatingLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43832 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
612c9b9ca73593b3194866c9e1a51554db9752e7 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FloatingLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43832 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1d635454ecd6bb90a2185726f54e7f3147be1ea0 07-Nov-2007 Steve Naroff <snaroff@apple.com> Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead, return false if the declarations aren't in scope. This was a hold over from when 'id' and 'Class' were initialized lazily.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43827 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
45ecd5daa36385b7e0b2f657357805e01f5d8cbf 07-Nov-2007 Steve Naroff <snaroff@apple.com> Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead, return false if the declarations aren't in scope. This was a hold over from when 'id' and 'Class' were initialized lazily.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43827 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ce14dd1144de1dc6bd1f85e47b2d28d2f3bdd084 07-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed an array overflow bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43826 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
89079eac7d6e3091b74b477a4a5ff0cdaf35496c 07-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed an array overflow bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43826 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b80a1af42d7f4c388805fec58037970eac25dd72 07-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43825 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
564576b225386cbff375351597dd5e2a92872d38 07-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43825 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
42f440c6f76e9df129ed4878904db4112f8705e1 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CharacterLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43824 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7338a8299ec393eaf6bb580b5ef9ab2b08b5bd11 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of CharacterLiteral.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43824 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
539a418f6ac1f4a529ff003db85e36214539b195 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialiation of PreDefinedExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43823 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1ba485e582edfc8636afc25a6d7453c869530688 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialiation of PreDefinedExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43823 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6c4dba7d96b48b6e5eefe05f62c60d8efaf16ab9 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ContinueStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43822 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
96f22423c52c22d263b4e5f7ee762122b607459e 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of ContinueStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43822 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e7d27d5205b282b7955e53d39a699b427e0d9c60 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of IndirectGotoStmt.
Added "FIXME" regarding the lack of source location information for IndirectGotoStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43821 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
225a2d946f73aed3b38f265fcb4e7d7d88136928 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of IndirectGotoStmt.
Added "FIXME" regarding the lack of source location information for IndirectGotoStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43821 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
affd8beaaea7ecc28eb0317cb8e639e32e848580 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of GotoStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43818 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
3f0767b74b16b37bcce60ff457609161a0665784 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of GotoStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43818 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
f34da90170a3847a5d8cd44d1302f9a24215e538 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43817 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
07ba046c7d7bbc1f42b86b3ed012eec8fc7849da 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43817 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ab97f4d0cd659bc71bac626acb6618bb16c2a7c7 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of DoStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43816 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e3299ef345bb8a71901108bf83a824591eae6c1a 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of DoStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43816 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
55e559a710c4777fb8c0652d25e1f528e1b12e27 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for WhileStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43815 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5572b94b76a78a35bac32d1ef04907c7a651adba 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for WhileStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43815 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ca22d35b4eb4d109425bbbf844cdfae952c974e3 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of IfStmt.

Fixed declarations of several "directEmit" methods of classes that subclass
Stmt that were missing a "virtual" keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43814 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
4210f3dfd73ad3482f9cfa0a382e1fd78f22976d 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of IfStmt.

Fixed declarations of several "directEmit" methods of classes that subclass
Stmt that were missing a "virtual" keyword.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43814 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
249d7cdaa6eb9a1849ba2695c817082d9a8c018d 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of SwitchStmt, CaseStmt, BreakStmt, DefaultStmt,
and ParenExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43806 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
9eea2ca5f2cb5d77569274702b5b06273e426dc2 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of SwitchStmt, CaseStmt, BreakStmt, DefaultStmt,
and ParenExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43806 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
e9f69847484fc16fa464717edc0414d2bf8752e9 07-Nov-2007 Steve Naroff <snaroff@apple.com> Rewrite ObjC @try/@catch/@finally. Some minor tweaks to the AST nodes...

Still need to rewrite @throw (and do more testing)...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43803 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
7573098b83e780d1c5bea13b384b610d8f155676 07-Nov-2007 Steve Naroff <snaroff@apple.com> Rewrite ObjC @try/@catch/@finally. Some minor tweaks to the AST nodes...

Still need to rewrite @throw (and do more testing)...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43803 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
08df2c65dc1843d432507088f8bad65738191a5f 07-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> AST for objective-c's @throw statement and its pretty-printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43802 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
39f8f159c488a900e5958d5aab3e467af9ec8a2b 07-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> AST for objective-c's @throw statement and its pretty-printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43802 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
56a74bb45bf095baa0cb3a097f03ba0816683fa5 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of LabelStmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43800 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
b15132fda52046ba65eafd6f4b448f7aa16b7e8d 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of LabelStmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43800 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
25aaa265c75cadf0b85924bee245726a6c5419b2 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Added serialization/deserialization of NullStmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43797 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
4927be6102784fc69c50234f7e2253283b3e99e4 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Added serialization/deserialization of NullStmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43797 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
2bd6e653973498d04da27eef1c855b194a0990fb 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Added serialization/deserialization of DeclStmts.
Reordered stmt serialization method implementations to be in alphabetical order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43796 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
0965f446e7685dc01fc0b5e718610530eed3cc63 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Added serialization/deserialization of DeclStmts.
Reordered stmt serialization method implementations to be in alphabetical order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43796 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
47281109ed285b89e60e3c52c5bc3edc79c16daf 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Overhauled serialization of statements. We no longer use specialized SerializeTrait<> classes,
but methods in Stmt (like other objects we are serializing). Full serialization of all statements
is not yet complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43793 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
2dc9ac73a8a34cabf261a81a1653d7379065ac61 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Overhauled serialization of statements. We no longer use specialized SerializeTrait<> classes,
but methods in Stmt (like other objects we are serializing). Full serialization of all statements
is not yet complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43793 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
ca14c33a9b2c6548130e92759368494f37ef46d5 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Added static inline method "ReadVal" to QualType for more succinct
deserialization code of objects containing QualTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43792 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f623c85c80f875be9d20caf4a0c15092e42e0b9e 07-Nov-2007 Ted Kremenek <kremenek@apple.com> Added static inline method "ReadVal" to QualType for more succinct
deserialization code of objects containing QualTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43792 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d8df6d8004cd9784179ccc94d90bd368d1625b81 06-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for objc2's property ASTs, as well as pretty-priting the ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43778 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
82a5fe3d1cf204b672cdab24d72275b6ad2c3527 06-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for objc2's property ASTs, as well as pretty-priting the ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43778 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
b3b786280c1146b90ecc9156bce9065c930060ce 06-Nov-2007 Steve Naroff <snaroff@apple.com> Fix a "basic" bug that resulted in a bogus SourceLocation.

Off hand, I don't know why this change makes a difference (I thought the two constructor idioms were equivalent).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43770 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ccdbc5c6f14965d91a352d114c109a9d4d9552b8 06-Nov-2007 Steve Naroff <snaroff@apple.com> Fix a "basic" bug that resulted in a bogus SourceLocation.

Off hand, I don't know why this change makes a difference (I thought the two constructor idioms were equivalent).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43770 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5d9929476ce28d1c121a20b6256b72f4f74f5bd3 05-Nov-2007 Ted Kremenek <kremenek@apple.com> Made methods "Emit" and "Materialize" in ASTContext (used for serialization) public.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43713 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
aa499b6ab30975d0cea225f71b33e7ee60b88a1f 05-Nov-2007 Ted Kremenek <kremenek@apple.com> Made methods "Emit" and "Materialize" in ASTContext (used for serialization) public.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43713 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
1e1c391211712f267804d5a0f6cc27e4195fe5bf 03-Nov-2007 Steve Naroff <snaroff@apple.com> Add a method prototype slot/getter to the ObjCMessageExpr AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43666 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
db611d556f71f98b66b69514d45958d76e5727ab 03-Nov-2007 Steve Naroff <snaroff@apple.com> Add a method prototype slot/getter to the ObjCMessageExpr AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43666 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
0add5d23d9c69bf307e94cacc195f253af6501a5 03-Nov-2007 Steve Naroff <snaroff@apple.com> Implement rewrite rules for ObjC string constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43665 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
beaf299a2701c5559a4e5d76b0c40f805afb8e6a 03-Nov-2007 Steve Naroff <snaroff@apple.com> Implement rewrite rules for ObjC string constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43665 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
8593cbf821294b7ffe0889fc056db5fbe41afff8 03-Nov-2007 Chris Lattner <sabre@nondot.org> Fix ownership model of ParseAST to allow the dtor of
ASTConsumer to process the AST before it is destroyed.
This allows elimination of HandleObjcMetaDataEmission.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
31e6c7ddfeeefe05b67220bc87fa23d4338d1056 03-Nov-2007 Chris Lattner <sabre@nondot.org> Fix ownership model of ParseAST to allow the dtor of
ASTConsumer to process the AST before it is destroyed.
This allows elimination of HandleObjcMetaDataEmission.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
2da6b3d1320e61f96c018ebaef5bef5a03d2c72e 03-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Provide both const and non-const accessor methods for @try and @finally ASTs.
My previous patch did the same for @catch AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43654 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8aab17e82aab6b3f266ef1884253226d2cb8b8d8 03-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Provide both const and non-const accessor methods for @try and @finally ASTs.
My previous patch did the same for @catch AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43654 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d45362449f3ffbc770ce1a20fe3a0efb20681121 03-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Provide const and none-const version of methods accessing various @catch nodes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43653 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
606efdfeb9eef70871eb62a26dfd115e209e899c 03-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Provide const and none-const version of methods accessing various @catch nodes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43653 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
59e9e043c380fd4dbef9096dd1b00cbc83ce049e 02-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> pretty-print @try/@catch/@finally from AST as the validation of AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43649 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
7794cb85d394750db0631c02b7aa7837ae56764c 02-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> pretty-print @try/@catch/@finally from AST as the validation of AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43649 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e607c9ec6128dddca21c6f9b8ff6edd85ea06818 02-Nov-2007 Ted Kremenek <kremenek@apple.com> Added most of the boilerplate code for Decl serialization. Still a few
key functions to implement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43648 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0497331350e9f7838c03eca5f2782a53160f7423 02-Nov-2007 Ted Kremenek <kremenek@apple.com> Added most of the boilerplate code for Decl serialization. Still a few
key functions to implement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43648 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b8bf60729f38262374422c27cc761a37d94a36c4 02-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> AST for @try statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43640 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
bd49a647afd9cc534fef13cadf652d4e9c396e2b 02-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> AST for @try statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43640 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
0679836a831c0feef62acf2e2a75002419349bf3 02-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> AST build for @catch clause (this is work in progress).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43628 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
3b1191d7eaf2f4984564e01ab84b6713a9d80e70 02-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> AST build for @catch clause (this is work in progress).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43628 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
414bf8f439a8f8656ec48f79438232119d83cac2 01-Nov-2007 Ted Kremenek <kremenek@apple.com> Simplified Serialization code for SourceLocation and SourceRange, and
updated it to the recently updated Serialization API.

Changed clients of SourceLocation serialization to call the
appropriate new methods.

Updated Decl serialization code to put new skeleton serialization code
in place that is much better than the older trait-specialization
approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43625 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
beb7713c6102687f7e49e27b8228e84a69d8f6c6 01-Nov-2007 Ted Kremenek <kremenek@apple.com> Simplified Serialization code for SourceLocation and SourceRange, and
updated it to the recently updated Serialization API.

Changed clients of SourceLocation serialization to call the
appropriate new methods.

Updated Decl serialization code to put new skeleton serialization code
in place that is much better than the older trait-specialization
approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43625 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
709524816623144c1c9d25a1506573245cd1bd16 01-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Bunch of class declarations for objective-c's @try-catch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43623 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
b210bd0404f84b99259c9987d347a44d3c202238 01-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Bunch of class declarations for objective-c's @try-catch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43623 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
7a78e43db820f48c784ab6d24d2e4c85ac7c5ed6 01-Nov-2007 Devang Patel <dpatel@apple.com> Rename classes and collections that maintain record layout information.
Now, at AST level record info is maintained by ASTRecordLayout class.
Now, at code gen level record info is maintained by CGRecordLayout class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43619 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecordLayout.h
88a981b47c7face1b1fdaa9074256245107b9ca9 01-Nov-2007 Devang Patel <dpatel@apple.com> Rename classes and collections that maintain record layout information.
Now, at AST level record info is maintained by ASTRecordLayout class.
Now, at code gen level record info is maintained by CGRecordLayout class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43619 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecordLayout.h
e1fed7a7fd266a5fc8da531668dcdc785a0ea5c6 01-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of QualTypes within ASTContext. Clarified
ownership model of some type pointers. Added FIXMEs to serialization.

Added comments to ASTContext indicating which variables we are intentionally
*not* serializing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43618 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
a9a4a24592a2164114a8a36717650e6341eb67a4 01-Nov-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of QualTypes within ASTContext. Clarified
ownership model of some type pointers. Added FIXMEs to serialization.

Added comments to ASTContext indicating which variables we are intentionally
*not* serializing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43618 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
65e7eb5a21e5114763acfb37c201d0c425060ebb 01-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Remaining work to collect objective-c's type qualifiers and use them to encode
method types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43617 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
ecb01e666665efabd2aa76a76f6080e2a78965fa 01-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Remaining work to collect objective-c's type qualifiers and use them to encode
method types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43617 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
48532db77bc2c5321cbc5818d4c9cbd7d80c87f4 01-Nov-2007 Ted Kremenek <kremenek@apple.com> Reverted unnecessary inlining of operator!=, since negating operator== is
just as efficient and much more succinct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43614 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.h
385cdaa3f583e600ffebc3f1035de76cd177f299 01-Nov-2007 Ted Kremenek <kremenek@apple.com> Reverted unnecessary inlining of operator!=, since negating operator== is
just as efficient and much more succinct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43614 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.h
f616a24cbc5870ff19b33f70e1f8dbb1ead65ab4 01-Nov-2007 Devang Patel <dpatel@apple.com> Propagate bitfield info.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43613 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
54e62357516ace7175a923dad4f94463e793e516 01-Nov-2007 Devang Patel <dpatel@apple.com> Propagate bitfield info.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43613 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5003e8bfcd7cf7a6e0ed8c5dd61a6c998bead4d7 01-Nov-2007 Chris Lattner <sabre@nondot.org> add support for vector type compatibility checking. Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43604 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
770951b5bb6028a8d326ddb4a13cef7d4a128162 01-Nov-2007 Chris Lattner <sabre@nondot.org> add support for vector type compatibility checking. Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43604 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
68228a90a7da28494437c03bcb2d93d4cda15d73 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented more of serialization/deserialization for ASTContext. We now
(hypothetically) read in/write out most of the types. Bugs likely exist.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43584 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
fee0452973f28691a61aab0fb074468ce3e34b9b 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented more of serialization/deserialization for ASTContext. We now
(hypothetically) read in/write out most of the types. Bugs likely exist.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43584 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
a092334bb4bee918977af3b904efdf5cb51c33ee 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented short-circuited version of Builtin::Info::operator!=.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43574 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.h
9b181b3eec13686ac05fb2c57c3f4baf2d4074a9 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented short-circuited version of Builtin::Info::operator!=.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43574 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.h
8709373142dde1f527d9b0b3e319449995dc4782 31-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed problem with rewriting stand-alone @implementation (with no matching @interface).
A new test case added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43568 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3a3ca1b35a7121aea0bf465a192dce748465e10f 31-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed problem with rewriting stand-alone @implementation (with no matching @interface).
A new test case added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43568 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
c8253192b917a5684717c58f4032e0891d089b00 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of Variable Array Types (VLAs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43561 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
ype.h
2e7d352dbec06755105237afba183492d31d03cb 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of Variable Array Types (VLAs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43561 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
ype.h
738e6c088f67beb174062d6161528f8b7ee1a489 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Renamed ivar "ArrayTypes" in ASTContext to "ComplexArrayTypes".

Added skeleton code for serialization of ASTContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43558 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7192f8e9592729882a09d84d77838db26e39ebd4 31-Oct-2007 Ted Kremenek <kremenek@apple.com> Renamed ivar "ArrayTypes" in ASTContext to "ComplexArrayTypes".

Added skeleton code for serialization of ASTContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43558 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7f23e3d8d24dfa5043e720b5057d51381f8391f8 31-Oct-2007 Anders Carlsson <andersca@mac.com> Encode Class, SEL and Objective-C objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43540 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
8baaca50f07d0c10bba69c8d88c1b9078c92d06d 31-Oct-2007 Anders Carlsson <andersca@mac.com> Encode Class, SEL and Objective-C objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43540 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
2e09e44dfb579f93fe6e1c5051a9fe532b66c865 31-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added new type and bitfield fields in some decl types in preparation for objective-c's type qualifiers.
Added initialization of Class/SEMA types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43534 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
8be9d0a9cdce8baa53844e54f6045c4600274269 31-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added new type and bitfield fields in some decl types in preparation for objective-c's type qualifiers.
Added initialization of Class/SEMA types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43534 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
c48deecfd383ba2d0f26fc439e11c4bcc4472d74 30-Oct-2007 Chris Lattner <sabre@nondot.org> shrinkify storage class to a bitfield, add a fixme about merging it in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43509 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e6889f961f2f29d10f6b4ce3e23fadb9309ddab7 30-Oct-2007 Chris Lattner <sabre@nondot.org> shrinkify storage class to a bitfield, add a fixme about merging it in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43509 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2058dc43f8d01d65fce80b6287891b624c98e14a 30-Oct-2007 Ted Kremenek <kremenek@apple.com> Added vector to ASTContext to store references to "complete" VLA types
(VLAs with a specified size expresssion). This vector owns the
references to these type objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43502 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
347b9f33b3216459bcf60cdd52c739fa3028321e 30-Oct-2007 Ted Kremenek <kremenek@apple.com> Added vector to ASTContext to store references to "complete" VLA types
(VLAs with a specified size expresssion). This vector owns the
references to these type objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43502 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
667f16849c15fa9f75f81f369a48fba80c889949 30-Oct-2007 Steve Naroff <snaroff@apple.com> - Add location info to category/protocol AST's
- Rewrite categories.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43501 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
423cb565abc681b770fb4b9b4bc24d398c98157b 30-Oct-2007 Steve Naroff <snaroff@apple.com> - Add location info to category/protocol AST's
- Rewrite categories.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43501 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ef20ed3ac942b1f3af877e7d9c0c58f6f50c8ddd 30-Oct-2007 Steve Naroff <snaroff@apple.com> More support for rewriting ObjC intefaces. Still some edge cases to handle...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43493 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f908a87299d278164540f90b5b6e6cab7b14fb41 30-Oct-2007 Steve Naroff <snaroff@apple.com> More support for rewriting ObjC intefaces. Still some edge cases to handle...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43493 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9b57fbac2b861414bf1e4c2320067da8574757ac 30-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Assert if isObjcIdType is called before 'id' type is built.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43484 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7ed05071969757ef84d7fd43168a82cb46d610fd 30-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Assert if isObjcIdType is called before 'id' type is built.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43484 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
3793e1ab25169c0d5be43f3abe2b4dc92989c043 30-Oct-2007 Ted Kremenek <kremenek@apple.com> VariableArrayTypes (VLAs) without a size expression are now uniqued
and inserted into a FoldingSet owned by ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43482 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
2bd24ba6d10f8c811c8e2a57c8397e07082ba497 30-Oct-2007 Ted Kremenek <kremenek@apple.com> VariableArrayTypes (VLAs) without a size expression are now uniqued
and inserted into a FoldingSet owned by ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43482 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
c81f316d260b8b8b9da21a0f9a22baa334e063fb 29-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Encoding for objectiive-c methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
33e1d64ab5cd5d27f8530ccd056191fe2c9f3f2e 29-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Encoding for objectiive-c methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
7f70eb7d19fd81f10779a0a2e5b02aea48229ad2 29-Oct-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Added a missing #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43477 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
481038b5f37b77d7aa24c3ed5a751bc9c37e32e6 29-Oct-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Added a missing #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43477 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
1a7fa7ba1d5f4eed5870e8953e1d794190602c28 29-Oct-2007 Steve Naroff <snaroff@apple.com> This commit contains lot's of small tweaks to how we pass around and store SourceLocation's for interfaces/protocols/categories/implementations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43475 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
60fcceeedbfc8b4a99cb942e2bc5aeb9e2f92a1f 29-Oct-2007 Steve Naroff <snaroff@apple.com> This commit contains lot's of small tweaks to how we pass around and store SourceLocation's for interfaces/protocols/categories/implementations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43475 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
fce813e3159a67a57a03cdca45ac4e10d4cffac3 29-Oct-2007 Ted Kremenek <kremenek@apple.com> Modified StmtIterator to support iteration over the size expressions
of VariableTypeArray types that appear in DeclStmts.

Removed operator-- from StmtIterator. operator-- added undesired
complexity, and we have no consumers of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43471 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtIterator.h
ype.h
92866e2e90f6d93fb95e25a7ac4438e239d89ce6 29-Oct-2007 Ted Kremenek <kremenek@apple.com> Modified StmtIterator to support iteration over the size expressions
of VariableTypeArray types that appear in DeclStmts.

Removed operator-- from StmtIterator. operator-- added undesired
complexity, and we have no consumers of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43471 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtIterator.h
ype.h
e0f97619d1bf13541971e1601fa0bf157c7102d9 29-Oct-2007 Ted Kremenek <kremenek@apple.com> Renamed internal variables of StmtIteratorBase to make the code
slightly more succinct.

Introduced VariableArrayType* within StmtIteratorBase to (soon)
support iteration over the size expressions of variable length arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43455 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
65f31e451c8d631f0e76cb9c8935465d68830cb1 29-Oct-2007 Ted Kremenek <kremenek@apple.com> Renamed internal variables of StmtIteratorBase to make the code
slightly more succinct.

Introduced VariableArrayType* within StmtIteratorBase to (soon)
support iteration over the size expressions of variable length arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43455 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
36f07d8c36fad7b71488d5ba147b472d779b37f0 29-Oct-2007 Anders Carlsson <andersca@mac.com> Add (partial) support for @encode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
85f9bceab1542aafff012d4d28e998f4ba16e362 29-Oct-2007 Anders Carlsson <andersca@mac.com> Add (partial) support for @encode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
de4d2bd06970a2914ab172431a1b741bb5a7adb2 29-Oct-2007 Chris Lattner <sabre@nondot.org> Add prototype info for __builtin_memcpy, reducing #diagnostics from 37 to 34 on
PR1750


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43435 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
52735a0339dd31750251a13aac73677693410c9d 29-Oct-2007 Chris Lattner <sabre@nondot.org> Add prototype info for __builtin_memcpy, reducing #diagnostics from 37 to 34 on
PR1750


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43435 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
8a40a83b02506a093be6649b11a67bbc04545387 29-Oct-2007 Chris Lattner <sabre@nondot.org> Implement *skeletal* support for representing GNU inline asm stmts in the AST,
resolving a crash on a .i file in PR1750. We now generate 49 errors on the
.i file in that bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43433 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
fe795956194141c91ae555985c9b930595bff43f 29-Oct-2007 Chris Lattner <sabre@nondot.org> Implement *skeletal* support for representing GNU inline asm stmts in the AST,
resolving a crash on a .i file in PR1750. We now generate 49 errors on the
.i file in that bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43433 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
2afc72b0b6b3d2f44ca2576c98d307310d556983 29-Oct-2007 Chris Lattner <sabre@nondot.org> Fix a major bug in the Type::getAs*Type methods: they didn't strip off
typeof(type) and typeof(expr) correctly. Now provide a single point of
contact (Type::getDesugaredType) for doing the shallow stripping we need.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43432 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
dea6146deede4b89a1757d46cd92ebf158659c25 29-Oct-2007 Chris Lattner <sabre@nondot.org> Fix a major bug in the Type::getAs*Type methods: they didn't strip off
typeof(type) and typeof(expr) correctly. Now provide a single point of
contact (Type::getDesugaredType) for doing the shallow stripping we need.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43432 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
68ee6a63fe3a1a4d386d57057c8ad4859c85748d 28-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for TypedefType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43423 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4f50ee3e6db9d5ec8c1a56fa07510dab06194564 28-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for TypedefType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43423 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0b365b4f0b4aa1fdd5d89942342f6c6f6fefd882 28-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FunctionTypeProto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43419 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4340bfa9f442b450b8d81081fb463b03a0096230 28-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FunctionTypeProto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43419 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b4498bd320cffda59566b658b59fbbc70978adf5 27-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FunctionTypeNoProto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e81e24c84bae6d5a999d9e34a21c4ec73f91d37e 27-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization of FunctionTypeNoProto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b90d06fb38d0b1862749bd0a0d24c3b94d4d5e4f 27-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for VectorType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43417 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
71ac846a4e20ad378700df040abeb3eb06163bca 27-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented serialization for VectorType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43417 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
27a32d6f18844a97446d6e2002bf181da591332a 27-Oct-2007 Ted Kremenek <kremenek@apple.com> More work on type serialization: added support for serializing BuiltinTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43414 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a4cb4525cf4bf8f61299147f22ffc187ed1eac9e 27-Oct-2007 Ted Kremenek <kremenek@apple.com> More work on type serialization: added support for serializing BuiltinTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43414 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3774dd9126402b3979f045f184ec7bb6d0d592c4 26-Oct-2007 Steve Naroff <snaroff@apple.com> Start rewriting ObjC interfaces. As a start, we comment out all the methods. This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43404 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
bef1185418705e16012b3dd50cd7c260c8d6b79c 26-Oct-2007 Steve Naroff <snaroff@apple.com> Start rewriting ObjC interfaces. As a start, we comment out all the methods. This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43404 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
78f138f44886abc5ab7fc1551d501308f1846d80 26-Oct-2007 Ted Kremenek <kremenek@apple.com> Added skeleton implementation of serialization for types (not complete).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43397 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
73af669633e13c813f80cd15ecf3e6414778aee4 26-Oct-2007 Ted Kremenek <kremenek@apple.com> Added skeleton implementation of serialization for types (not complete).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43397 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f185aef283b7faf2db1887a6693d3172843e6a50 26-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to synthesize computation of Ivar offset in rewritten c file.
Thanks to Steve N. to point out using of offsetof for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43391 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
26e4cd331c389a9b7d51c91981a7a10c8a909bf4 26-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to synthesize computation of Ivar offset in rewritten c file.
Thanks to Steve N. to point out using of offsetof for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43391 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
15294058128b89eb2973536cd76891649b6e80c6 26-Oct-2007 Ted Kremenek <kremenek@apple.com> Modified StmtIterator to now include visiting the initialization expression for EnumConstantDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43366 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmtIterator.h
b990f1834b4ba1c8e67ace010b0f554d0e59c1ea 26-Oct-2007 Ted Kremenek <kremenek@apple.com> Modified StmtIterator to now include visiting the initialization expression for EnumConstantDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43366 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmtIterator.h
17377da57cc24b845a4fb5bbf9e227c71e1fc270 25-Oct-2007 Ted Kremenek <kremenek@apple.com> Added skeleton for Decl serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43361 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2f1f8cb1b8f487086053579802407d64ca2b587f 25-Oct-2007 Ted Kremenek <kremenek@apple.com> Added skeleton for Decl serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43361 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ec8696628940a3aa3304513feec54f575102f088 25-Oct-2007 Ted Kremenek <kremenek@apple.com> changed #include of Serialization.h to SerializationFwd.h to reduce
compilation time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43354 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
0a449eed1dd2439b4b9c0a6291084816eab390c1 25-Oct-2007 Ted Kremenek <kremenek@apple.com> changed #include of Serialization.h to SerializationFwd.h to reduce
compilation time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43354 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
000f48fc683f280bbb16fe9926d1385f8bbf1319 25-Oct-2007 Ted Kremenek <kremenek@apple.com> Added constness to accessors in CompoundStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43342 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
cc326204dd97771c336b9aab3b9963ea30d69c29 25-Oct-2007 Ted Kremenek <kremenek@apple.com> Added constness to accessors in CompoundStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43342 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
f624cd28f1a58e7eff980eb3740a6ba192bb3833 25-Oct-2007 Chris Lattner <sabre@nondot.org> Add a new ChooseExpr::isConditionTrue method to unify
some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
27437caadea35f84d550cd29f024fcf3ea240eec 25-Oct-2007 Chris Lattner <sabre@nondot.org> Add a new ChooseExpr::isConditionTrue method to unify
some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
68e02272f5cc0e349ed568d005fd5de45ef630b2 25-Oct-2007 Ted Kremenek <kremenek@apple.com> Added accessors to CompoundStmt to retrieve the source locations for the
left and right bracket. This is useful for serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43318 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
54395d440dc82a5e51b945c6c2a7f4bc4bea0358 25-Oct-2007 Ted Kremenek <kremenek@apple.com> Added accessors to CompoundStmt to retrieve the source locations for the
left and right bracket. This is useful for serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43318 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
7122603bb762d042baf25e20bcb2d357cb3992ce 25-Oct-2007 Steve Naroff <snaroff@apple.com> More work on translating message expressions.

Still to do:

- Chris will fix a bug in the rewriting engine for nested stmts. For example, the following:

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

tranlates to:

NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];

...which is correct, except there is garbage after sel_getUid("init"). This is because the rewriter isn't updating the extent of the containing message expression.

- Do the crazy cast thang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43316 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
934f276cc5b45e19cd12ebb2d04fd7972a23865c 25-Oct-2007 Steve Naroff <snaroff@apple.com> More work on translating message expressions.

Still to do:

- Chris will fix a bug in the rewriting engine for nested stmts. For example, the following:

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

tranlates to:

NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];

...which is correct, except there is garbage after sel_getUid("init"). This is because the rewriter isn't updating the extent of the containing message expression.

- Do the crazy cast thang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43316 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c65a1fc4f4f84c5a08db7d08bbc2e49f0bb75ff5 24-Oct-2007 Ted Kremenek <kremenek@apple.com> Modified operator* for StmtIterator to return Stmt*& instead of Stmt*.
This permits in-place replacement of the original AST statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43295 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmtIterator.h
22c0fcba14e069bd3d35305ecd6d952f41666610 24-Oct-2007 Ted Kremenek <kremenek@apple.com> Modified operator* for StmtIterator to return Stmt*& instead of Stmt*.
This permits in-place replacement of the original AST statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43295 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmtIterator.h
4c4abed3000046bc27a919fbccc0df1a33cb6c43 23-Oct-2007 Steve Naroff <snaroff@apple.com> - Add rewrite rule for @class.
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
7e15891fc89256fc013bd1003676ad3197b85c25 23-Oct-2007 Steve Naroff <snaroff@apple.com> - Add rewrite rule for @class.
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ce7357d49e780ed5414257a59eb2b4cfa5a9c419 19-Oct-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Silenced a VC++ warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43179 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e203877d239454182c94bc2f730d69f4937bf818 19-Oct-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Silenced a VC++ warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43179 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a6478551aaf4095fe3b0d6a41905223c951f82a2 19-Oct-2007 Ted Kremenek <kremenek@apple.com> Fixed DeclStmt::child_begin() to actually create an iterator that
visits its decls, rather than just creating an "end()" iterator.

Fixed child_end() for statements and expressions to use
child_iterator() to create the end() iterator, rather than just
returning NULL.

Fixed bug in StmtIterator where we did not correctly detect if we had
marched off the end of the ScopedDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43156 91177308-0d34-0410-b5e6-96231b3b80d8
tmtGraphTraits.h
tmtIterator.h
9ac5928abeb3a47592201e1c30fe2930c20a507e 19-Oct-2007 Ted Kremenek <kremenek@apple.com> Fixed DeclStmt::child_begin() to actually create an iterator that
visits its decls, rather than just creating an "end()" iterator.

Fixed child_end() for statements and expressions to use
child_iterator() to create the end() iterator, rather than just
returning NULL.

Fixed bug in StmtIterator where we did not correctly detect if we had
marched off the end of the ScopedDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43156 91177308-0d34-0410-b5e6-96231b3b80d8
tmtGraphTraits.h
tmtIterator.h
45d52f7b948d91fc8816c860f1192b09300d0941 19-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite ivar tables metadata for classes defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f4d331dd922f92478ebf30e808c0ca97ce49418b 19-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite ivar tables metadata for classes defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6d1126731f34672a1eb196b064d2ee331bb3d61b 18-Oct-2007 Ted Kremenek <kremenek@apple.com> Refactored StmtIterator into classes StmtIteratorBase (non-templated)
and StmtIteratorImpl (templated), which StmtIterator and
ConstStmtIterator now succintly subclass.

Implemented iteration over the initializers in DeclStmts. This is not
thoroughly tested, so there may be bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43138 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
c325e7f51b4c92efd711b8ad289ec16da8cd64f0 18-Oct-2007 Ted Kremenek <kremenek@apple.com> Refactored StmtIterator into classes StmtIteratorBase (non-templated)
and StmtIteratorImpl (templated), which StmtIterator and
ConstStmtIterator now succintly subclass.

Implemented iteration over the initializers in DeclStmts. This is not
thoroughly tested, so there may be bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43138 91177308-0d34-0410-b5e6-96231b3b80d8
tmtIterator.h
4f398258f5e55a2fab236b4f515115ab0dd69e5d 18-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented 90% functionality of new child_iterator for Stmt objects
that will (soon) allow iteration over the initializers in
declarations. This new iterator mechanism is implemented by the
classes StmtIterator and ConstStmtIterator.

Patched a few files to use "operator++" instead of "operator+" on
child_iterators.

Friendship added in VarDecl to StmtIterator to allow returning a
reference to the initializer within the VarDecl. We may not wish this
as a permanent solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43105 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmt.h
tmtGraphTraits.h
tmtIterator.h
9caf8b1ca6beb254f420dada3c0e94d5ef027f58 18-Oct-2007 Ted Kremenek <kremenek@apple.com> Implemented 90% functionality of new child_iterator for Stmt objects
that will (soon) allow iteration over the initializers in
declarations. This new iterator mechanism is implemented by the
classes StmtIterator and ConstStmtIterator.

Patched a few files to use "operator++" instead of "operator+" on
child_iterators.

Friendship added in VarDecl to StmtIterator to allow returning a
reference to the initializer within the VarDecl. We may not wish this
as a permanent solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43105 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
tmt.h
tmtGraphTraits.h
tmtIterator.h
b391e6e2a8faa67ecdb1ad5d1b86e01ec4f2aa05 17-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Implementation of AST for @protocol expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43075 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
tmtNodes.def
390d50a725497e99247dc104a7d2c2a255d3af14 17-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Implementation of AST for @protocol expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43075 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
tmtNodes.def
957448a2bf1ce1fcda4f1dbbf99658a013fdb3ab 17-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fix location processing of @selector: the range should include the @ sign.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43051 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
2a35fa9b5e0f9d9429c04adb2e1249b6fd425e7a 17-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fix location processing of @selector: the range should include the @ sign.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43051 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cfd61c8faf638962f1f37807b5a8a565c20f4b57 17-Oct-2007 Chris Lattner <sabre@nondot.org> Fix location processing of @encode: the range should include the @ sign.
@selector probably gets this wrong also.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43048 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
674af9541256dc3ef803e3723027a8b028f1f7a2 17-Oct-2007 Chris Lattner <sabre@nondot.org> Fix location processing of @encode: the range should include the @ sign.
@selector probably gets this wrong also.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43048 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
6fe8b27c7cda9a6a307469be94770aed9c6ae343 17-Oct-2007 Chris Lattner <sabre@nondot.org> Add a new Rewriter::getRangeSize method.
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43047 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
tmt.h
311ff02fae0392bee6abe7723cdf5a69b2899a47 17-Oct-2007 Chris Lattner <sabre@nondot.org> Add a new Rewriter::getRangeSize method.
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43047 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
tmt.h
171f5b1258848d2b35a87b3ec345f7db899d69c6 16-Oct-2007 Steve Naroff <snaroff@apple.com> Remove ObjcMethodDecl::getNumMethodParams/getMethodParamDecl, they aren't used/needed.
Change ObjcMethodDecl::getMethodType to getResultType, to match FunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43045 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3bea81bbae827195acfdf7bedfb7ac80c487dc63 16-Oct-2007 Steve Naroff <snaroff@apple.com> Remove ObjcMethodDecl::getNumMethodParams/getMethodParamDecl, they aren't used/needed.
Change ObjcMethodDecl::getMethodType to getResultType, to match FunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43045 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
034beb260956032bfa6bceb97dfeb3aa5b98dcfa 16-Oct-2007 Chris Lattner <sabre@nondot.org> publish location info


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43044 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
05de8bc173c217f349f09b143bf5c6f6e82b87ae 16-Oct-2007 Chris Lattner <sabre@nondot.org> publish location info


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43044 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
53a24b70fa220fb20bccfcb33a2dbf7c062baf7f 16-Oct-2007 Chris Lattner <sabre@nondot.org> these aren't const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43040 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
10864b47250df7ae039fe9932bdf7a5b0c21280e 16-Oct-2007 Chris Lattner <sabre@nondot.org> these aren't const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43040 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
f807c2061e08c74432b054a54c1b3da385bf0838 16-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implement AST generation for objective-c's @selector expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43038 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
tmtNodes.def
b62f6813406a03bf8a371c4e46c9fad51d102121 16-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implement AST generation for objective-c's @selector expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43038 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
tmtNodes.def
7e46145da63391e7c81e18f65271ba9f73391e30 16-Oct-2007 Steve Naroff <snaroff@apple.com> Emit diagnostics for methods not found.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43037 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
983df5b2280980e59b0b062bcc2882230465a61e 16-Oct-2007 Steve Naroff <snaroff@apple.com> Emit diagnostics for methods not found.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43037 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f2e3031fe4911c5b82735c9495c2bb459d414693 16-Oct-2007 Steve Naroff <snaroff@apple.com> Change the type of ObjCStringLiteral from "struct __builtin_CFString *" to "NSConstantString *".

This makes the typecheck much happier. Without this change, the type checker would have to special case "struct __builtin_CFString *". This change does assume the interface for NSConstantString is declared in the translation unit.

I left ASTContext::getCFConstantStringType() around for now (with a comment that says it is currently unused).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43021 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
2198891824c38d45b2279de5d5e3ef9394eb457c 16-Oct-2007 Steve Naroff <snaroff@apple.com> Change the type of ObjCStringLiteral from "struct __builtin_CFString *" to "NSConstantString *".

This makes the typecheck much happier. Without this change, the type checker would have to special case "struct __builtin_CFString *". This change does assume the interface for NSConstantString is declared in the translation unit.

I left ASTContext::getCFConstantStringType() around for now (with a comment that says it is currently unused).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43021 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
85f0dc588193fc73c58e73769e266cd83ed415fe 15-Oct-2007 Steve Naroff <snaroff@apple.com> Move type compatibility predicates from Type to ASTContext. In addition, the predicates are now instance methods (they were previously static class methods on Type).

This allowed me to fix the following hack from this weekend...

// FIXME: Devise a way to do this without using strcmp.
// Would like to say..."return getAsStructureType() == IdStructType;", but
// we don't have a pointer to ASTContext.
bool Type::isObjcIdType() const {
if (const RecordType *RT = getAsStructureType())
return !strcmp(RT->getDecl()->getName(), "objc_object");
return false;
}

...which is now...

bool isObjcIdType(QualType T) const {
return T->getAsStructureType() == IdStructType;
}

Side notes:

- I had to remove a convenience function from the TypesCompatibleExpr class.

int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}

Which required a couple clients get a little more verbose...

- Result = TCE->typesAreCompatible();
+ Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());

Overall, I think this change also makes sense for a couple reasons...

1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43009 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
ype.h
ec0550fa3653d46560bf4484a2e988329c228e39 15-Oct-2007 Steve Naroff <snaroff@apple.com> Move type compatibility predicates from Type to ASTContext. In addition, the predicates are now instance methods (they were previously static class methods on Type).

This allowed me to fix the following hack from this weekend...

// FIXME: Devise a way to do this without using strcmp.
// Would like to say..."return getAsStructureType() == IdStructType;", but
// we don't have a pointer to ASTContext.
bool Type::isObjcIdType() const {
if (const RecordType *RT = getAsStructureType())
return !strcmp(RT->getDecl()->getName(), "objc_object");
return false;
}

...which is now...

bool isObjcIdType(QualType T) const {
return T->getAsStructureType() == IdStructType;
}

Side notes:

- I had to remove a convenience function from the TypesCompatibleExpr class.

int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}

Which required a couple clients get a little more verbose...

- Result = TCE->typesAreCompatible();
+ Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());

Overall, I think this change also makes sense for a couple reasons...

1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43009 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
xpr.h
ype.h
36760330e9e1cff31a7bcb5581bc7244e347f9e0 15-Oct-2007 Anders Carlsson <andersca@mac.com> Add code generation and sema checking for __builtin_va_arg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43006 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
7c50aca2fe36f6daa9bf1c8c428f30e72f96470a 15-Oct-2007 Anders Carlsson <andersca@mac.com> Add code generation and sema checking for __builtin_va_arg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43006 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
9d12c90f8c5aedbc20737a35feb370f9457d4e8e 15-Oct-2007 Steve Naroff <snaroff@apple.com> Added ASTContext::setObjcIdType/getObjcIdType(), set by Sema.

Also noticed ASTContext::BuiltinVaListType wasn't being initialized to the null type (so I set it).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42983 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
7e219e47de26346885d667131977bd9ca2d7662a 15-Oct-2007 Steve Naroff <snaroff@apple.com> Added ASTContext::setObjcIdType/getObjcIdType(), set by Sema.

Also noticed ASTContext::BuiltinVaListType wasn't being initialized to the null type (so I set it).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42983 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
1a402e6eccba8d1de9e1ceb5d6d271678af5933f 15-Oct-2007 Steve Naroff <snaroff@apple.com> Teach the type checker about "id". This removes the following bogus warning...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.m
t.m:29:18: warning: incompatible pointer types assigning 'id' to 'NSString *'
resultString = [[NSString alloc] initWithFormat:0 arguments:0];
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42975 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
954ea17353d3b24be52424bc287bdb6bef787fec 15-Oct-2007 Steve Naroff <snaroff@apple.com> Teach the type checker about "id". This removes the following bogus warning...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.m
t.m:29:18: warning: incompatible pointer types assigning 'id' to 'NSString *'
resultString = [[NSString alloc] initWithFormat:0 arguments:0];
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42975 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
705380bc9b8eaa0e7285eb64f22ef18112fe9057 15-Oct-2007 Steve Naroff <snaroff@apple.com> - Teach ObjcInterfaceDecl::lookupInstance/ClassMethod to look through protocols.
- Start looking up methods in the global method pools (for "id").
- Start integrating interface types into the type system.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42971 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ff1afdb4f5ee2fc74ec0af788e18b3a036eaaafe 15-Oct-2007 Steve Naroff <snaroff@apple.com> - Teach ObjcInterfaceDecl::lookupInstance/ClassMethod to look through protocols.
- Start looking up methods in the global method pools (for "id").
- Start integrating interface types into the type system.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42971 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f66d84aea51d377e0c24853a3d5cb689be1887ff 14-Oct-2007 Steve Naroff <snaroff@apple.com> Add category lookup (removing a couple FIXME's).
Changed ObjcInterfaceDecl::ListCategories->CategoryList.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42968 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3d58138992b9bc7b34aaa680f3ddf3971292eb7d 14-Oct-2007 Steve Naroff <snaroff@apple.com> Add category lookup (removing a couple FIXME's).
Changed ObjcInterfaceDecl::ListCategories->CategoryList.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42968 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
cebb8d62894435f30d3fc740faae304db4015b92 13-Oct-2007 Anders Carlsson <andersca@mac.com> Generate code for va_start and va_end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42939 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
793680ed8104bf088d1b382b963a8badcb3f07de 13-Oct-2007 Anders Carlsson <andersca@mac.com> Generate code for va_start and va_end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42939 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
1003f49442e4f7ff2aba44c5732234a9e4238000 13-Oct-2007 Chris Lattner <sabre@nondot.org> remove dead method with bogus comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42937 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
833b2eb738a2a7a77b5c758555694a0d6bc10e1b 13-Oct-2007 Chris Lattner <sabre@nondot.org> remove dead method with bogus comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42937 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
550e05034c6c8efcb7ab4c65f58048eee0892237 13-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Check and diagnose that objective-c objects may not be statically allocated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42936 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e7f64cc250245aa6c0e1ef6da7e9b6f62d5fedde 13-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Check and diagnose that objective-c objects may not be statically allocated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42936 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
05d212ac3137d7f82471526a7cdc581ec8981a94 12-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch implementa objective-c's @compatibilty-alias declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
243b64b0001172405ff803c61bdcaa8e98ec1552 12-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch implementa objective-c's @compatibilty-alias declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
d855a6ead44e3a875179400c472ac0b37df35f70 11-Oct-2007 Chris Lattner <sabre@nondot.org> slightly simplify interface


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42858 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
00bb283ecdfb1d5c69261c7663d166cee3f11a9b 11-Oct-2007 Chris Lattner <sabre@nondot.org> slightly simplify interface


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42858 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fb5b1e8f29523072ac5a2bf230de8b5334408e75 11-Oct-2007 Anders Carlsson <andersca@mac.com> Add __builtin_va_start to the list of builtins, make __builtin_va_list available to builtin functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42857 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
uiltins.def
b2cf3573d7351094f6247fcca94703ce88eb9ee0 11-Oct-2007 Anders Carlsson <andersca@mac.com> Add __builtin_va_start to the list of builtins, make __builtin_va_list available to builtin functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42857 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
uiltins.def
91193f64449fe1faf9306a04ade6539d26f44037 11-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to create protocol conforming class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42856 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
4b6c9051c6522894978c9ba6a819a659d102db36 11-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to create protocol conforming class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42856 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
e51672d4e025afa6990962c2eb5d0e50ae4be789 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Remove comment about protocols and namespace no longer relevant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42804 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0be657cb85538ff20358b700062a17450716419b 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Remove comment about protocols and namespace no longer relevant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42804 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
042e6e8101dfcd3401f8cd7df50a4ac5e91612df 09-Oct-2007 Chris Lattner <sabre@nondot.org> Update DeclKind enums to reflect ObjcProtocolDecl's inheritance change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42802 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4de884d3fba3250b3f2e7b54145f1e878ce7c3c3 09-Oct-2007 Chris Lattner <sabre@nondot.org> Update DeclKind enums to reflect ObjcProtocolDecl's inheritance change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42802 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ac142de525ab05fe14f21cfbb364833d1e7507a4 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Remove addition of protocol names to declaration scopes, use a separate
DenseMap to keep track of such declarations and derive ObjcProtocolDecl
directyly from NamedScope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42801 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
05672a0ce85f6a203a960a856d30c4606ab136a7 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Remove addition of protocol names to declaration scopes, use a separate
DenseMap to keep track of such declarations and derive ObjcProtocolDecl
directyly from NamedScope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42801 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
c5a342d3b1cc5fa6eef09653a6d8d091928366c0 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added better comment about protocol list for class ObjcQualifiedInterfaceType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42794 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
878520b6413663a13b1b56c7e3f256b1ecbb8db4 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added better comment about protocol list for class ObjcQualifiedInterfaceType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42794 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c04aff17dcfaa5f628bcfed0e393f2e946ea5184 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added a new class for Interfaces qualified by protocol list.
Protocols are now sorted and made unique in the list.
Enhanced pretty printer for @interface (So, I can see the protocol list).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42776 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e37882ad335896dedf345102bb425383e6221c37 09-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added a new class for Interfaces qualified by protocol list.
Protocols are now sorted and made unique in the list.
Enhanced pretty printer for @interface (So, I can see the protocol list).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42776 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3fc54197f86651e64f81d14410db2fd4e1e5af8e 08-Oct-2007 Steve Naroff <snaroff@apple.com> Removed unused instance variable from FieldDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42773 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
22cdd239dc1a5ed3635afc67465b12d5e6437578 08-Oct-2007 Steve Naroff <snaroff@apple.com> Removed unused instance variable from FieldDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42773 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3289bca033c3d7e3ee9089b6abe26db01e3f0e08 08-Oct-2007 Chris Lattner <sabre@nondot.org> Rename FileVariable -> FileVar for consistency with its class name,
likewise block and param. Reorder the layout of the Decl kind enum
so that the inheritance tree is reflected in the ordering. This allows
trivial range comparisons to determine whether something is an instance
of some abstract class, making classof faster.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42772 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
aa9fc46c6a797c86ae004092ab4f2b1bed6c4616 08-Oct-2007 Chris Lattner <sabre@nondot.org> Rename FileVariable -> FileVar for consistency with its class name,
likewise block and param. Reorder the layout of the Decl kind enum
so that the inheritance tree is reflected in the ordering. This allows
trivial range comparisons to determine whether something is an instance
of some abstract class, making classof faster.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42772 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
ac20be2b3aaae316b1f7e17b5c2c1d0ad9250c52 08-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Several small patches to do pretty printing for objective-c top-level decls
(minimal printing), Derive ObjcClassDecl from Decl. Ted may want to
take note of the change I made to CFGRecStmtDeclVisitor.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42764 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ab0aeb0bf3eb289013e9f37e75c3dfc4c618f53c 08-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Several small patches to do pretty printing for objective-c top-level decls
(minimal printing), Derive ObjcClassDecl from Decl. Ted may want to
take note of the change I made to CFGRecStmtDeclVisitor.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42764 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
935877d6939694f69d612d8d8d673e178e4ebb8e 08-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Removed unnecessary base class from some of objective-c classes:
ObjcProtocolDecl is now derived from ScopedDecl. ObjcForwardProtocolDecl from Decl.
ObjcImplementationDecl fom NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42756 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6d4caf26945095cc21dd7c79d2442668ed3a61b6 08-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Removed unnecessary base class from some of objective-c classes:
ObjcProtocolDecl is now derived from ScopedDecl. ObjcForwardProtocolDecl from Decl.
ObjcImplementationDecl fom NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42756 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
2fd1c65311af21735a004f3cb1e1250d79c57bee 07-Oct-2007 Chris Lattner <sabre@nondot.org> move IdentifierTable.h from liblex to libbasic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
xpr.h
c7229c338c21ef26b01ef3ecf9eec4fd373fa9ec 07-Oct-2007 Chris Lattner <sabre@nondot.org> move IdentifierTable.h from liblex to libbasic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
eclObjC.h
xpr.h
b2aa7cea4c96befa4a122c21d22aad7b4bb9edf7 07-Oct-2007 Chris Lattner <sabre@nondot.org> classof isn't right. This is causing assertion failures somehow now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42720 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f47a7f8531668b0b84a7638b6d899c0fbfb483fa 07-Oct-2007 Chris Lattner <sabre@nondot.org> classof isn't right. This is causing assertion failures somehow now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42720 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a7a191caaabffadaddc6e3ce26ca5718a8ca19b6 07-Oct-2007 Chris Lattner <sabre@nondot.org> move ImplementationClassInfo out of ASTContext into Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42714 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f38766870882b8cdd3d9de05f734c024f556b5bc 07-Oct-2007 Chris Lattner <sabre@nondot.org> move ImplementationClassInfo out of ASTContext into Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42714 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
e8d6ae78cb12747ce077a91b0e05fe66d44a0cca 07-Oct-2007 Chris Lattner <sabre@nondot.org> add comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42712 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
675218bd93229b0b63f172711391234f66f5f62a 07-Oct-2007 Chris Lattner <sabre@nondot.org> add comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42712 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
79b008459bd61e5f67f052fd07e168920f292d17 07-Oct-2007 Chris Lattner <sabre@nondot.org> switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42711 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6a0e89eece63e238ce873810f6f9bb50822e0296 07-Oct-2007 Chris Lattner <sabre@nondot.org> switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42711 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
910435b63b345aaf5c2cdac9d3fc1efba8a0fe37 07-Oct-2007 Chris Lattner <sabre@nondot.org> introduce a new NamedDecl class, switch a couple of things over to using it.
NamedDecl is a Decl that has an IdentifierInfo (for example, ScopedDecl),
but not ObjcMethodDecl.

Simplify some code in ActOnAddMethodsToObjcDecl, by doing the cast from
DeclTy to Decl at the start of the method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42710 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
fd5de471478a507dd2495c4ea9bcab801ea5fa65 07-Oct-2007 Chris Lattner <sabre@nondot.org> introduce a new NamedDecl class, switch a couple of things over to using it.
NamedDecl is a Decl that has an IdentifierInfo (for example, ScopedDecl),
but not ObjcMethodDecl.

Simplify some code in ActOnAddMethodsToObjcDecl, by doing the cast from
DeclTy to Decl at the start of the method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42710 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
8d336eed195f3ae2a24753571f59ebd899d2f2f0 07-Oct-2007 Chris Lattner <sabre@nondot.org> Every decl has a SourceLocation, move the location info into the Decl class instead of being in subclasses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42709 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
e5ab7f31054e87ee812830480a828a762cd9eb73 07-Oct-2007 Chris Lattner <sabre@nondot.org> Every decl has a SourceLocation, move the location info into the Decl class instead of being in subclasses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42709 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
2443d912f8b779a65180dda5309fabb34205f0d3 06-Oct-2007 Chris Lattner <sabre@nondot.org> simplify the interface to create ObjcClassDecl's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42706 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
7e620729fcb5a0042107f999dcf524f7357ce819 06-Oct-2007 Chris Lattner <sabre@nondot.org> simplify the interface to create ObjcClassDecl's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42706 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
6b1ed8d95b813c214fb3ee7e00dc1d31c4116067 06-Oct-2007 Chris Lattner <sabre@nondot.org> simplify the interface for creating ObjcForwardProtocolDecl



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42705 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ype.h
b97de3eddf0a0f7ff97204e7def6b7e0aa8953f2 06-Oct-2007 Chris Lattner <sabre@nondot.org> simplify the interface for creating ObjcForwardProtocolDecl



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42705 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ype.h
d5c9d3dfe91d5928fc2eb98d1dd60079605a7c80 06-Oct-2007 Chris Lattner <sabre@nondot.org> stub out some printing of objc decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42703 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
9fa5e65d08aee1875c5f2a841c8b0b4069bd00e5 06-Oct-2007 Chris Lattner <sabre@nondot.org> stub out some printing of objc decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42703 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f9e80dbb8e4fe683f6c20071d5cee8b7c8c7a015 05-Oct-2007 Steve Naroff <snaroff@apple.com> Layering refinements for selectors (suggested by Chris). Specifics...

- Add SelectorTable, which enables us to remove MultiKeywordSelector from the public header.
- Remove FoldingSet from IdentifierInfo.h and Preprocessor.h.
- Remove Parser::ObjcGetUnarySelector and Parser::ObjcGetKeywordSelector, they are subsumed by SelectorTable.
- Add MultiKeywordSelector to IdentifierInfo.cpp.
- Move a bunch of selector related methods from ParseObjC.cpp to IdentifierInfo.cpp.
- Added some comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42643 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
29238a0bf7cbf5b396efb451a0adb5fe4aa037ca 05-Oct-2007 Steve Naroff <snaroff@apple.com> Layering refinements for selectors (suggested by Chris). Specifics...

- Add SelectorTable, which enables us to remove MultiKeywordSelector from the public header.
- Remove FoldingSet from IdentifierInfo.h and Preprocessor.h.
- Remove Parser::ObjcGetUnarySelector and Parser::ObjcGetKeywordSelector, they are subsumed by SelectorTable.
- Add MultiKeywordSelector to IdentifierInfo.cpp.
- Move a bunch of selector related methods from ParseObjC.cpp to IdentifierInfo.cpp.
- Added some comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42643 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
67907bd05f10d430df8a0c8b4e13e8026bca4060 05-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for 1) Checking for duplicate methods decls in intterface and category.
2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42641 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
85ff2646c1aeedd1105f867a5bba8a58febd1d2a 05-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for 1) Checking for duplicate methods decls in intterface and category.
2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42641 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
e58e080af0f4949d8acffe5960751f1b9c44c7e6 05-Oct-2007 Devang Patel <dpatel@apple.com> switch statement code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42616 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
51b09f2c528c8460b5465c676173324e44176d62 05-Oct-2007 Devang Patel <dpatel@apple.com> switch statement code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42616 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
fa601d5b9f81a4c43c45f58844b1defde5dac54a 04-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed all my recent test cases to have the RUN command and
fixed consequence of these changes in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42600 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
4b6df3fa953267c5d755628c8afd818bb571e579 04-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed all my recent test cases to have the RUN command and
fixed consequence of these changes in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42600 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
78adb3998130b04401da53def39b65dacccdace0 03-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Renamed getCatLoc() to getLocation() to be consistant for such
getter names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42577 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
79139a121781854c3742273dd7b8289fa215341a 03-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Renamed getCatLoc() to getLocation() to be consistant for such
getter names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42577 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
91b708d7144f9ba5ac06d5552f375dde032e892c 03-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Unified SuperClass field name in an objective-c class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42556 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
93efc029bf485de724fd783ad14b58aaec9c919b 03-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Unified SuperClass field name in an objective-c class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42556 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
1c095a701313edd270c3ef5c5f17ed00d883c9eb 03-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Unified such names as protocol references, instance methods and class methods
and their accessors in a variety of objective-c classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42555 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
7ed9e0f97f4645edc5d4670385b985ea4c617ce7 03-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Unified such names as protocol references, instance methods and class methods
and their accessors in a variety of objective-c classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42555 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
89529b1f2cb5b36563c2c1eb67b56d7e13ceec20 02-Oct-2007 Steve Naroff <snaroff@apple.com> Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not Parser).
Add Sema::CheckImplementationIvars() to replace the previous action.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42553 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
a5997c4f36e0f5aa44623a5b1e3b914760d1ec68 02-Oct-2007 Steve Naroff <snaroff@apple.com> Remove Action::ActOnImpleIvarVsClassIvars(), it is only called by Sema (not Parser).
Add Sema::CheckImplementationIvars() to replace the previous action.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42553 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
f4bc79a4abcf7bd4a628ba1b2dc46bd5891089ad 02-Oct-2007 Steve Naroff <snaroff@apple.com> Rename ObjcInterfaceDecl::getIsForwardDecl() to isForwardDecl().
Rename ObjcProtocolDecl::getIsForwardProtoDecl() to isForwardDecl().
Rename ObjcInterfaceDecl::setIsForwardDecl() to setForwardDecl().
Rename ObjcProtocolDecl::setIsForwardProtoDecl() to setForwardDecl().

Two reasons:

#1: boolean predicates should start with "is".
#2: Since these two sets of methods represent the same concept, they should be named the same (polymorphism is good:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42545 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
768f26ee5892cd63ff0335a15d71a2385ba7c5ea 02-Oct-2007 Steve Naroff <snaroff@apple.com> Rename ObjcInterfaceDecl::getIsForwardDecl() to isForwardDecl().
Rename ObjcProtocolDecl::getIsForwardProtoDecl() to isForwardDecl().
Rename ObjcInterfaceDecl::setIsForwardDecl() to setForwardDecl().
Rename ObjcProtocolDecl::setIsForwardProtoDecl() to setForwardDecl().

Two reasons:

#1: boolean predicates should start with "is".
#2: Since these two sets of methods represent the same concept, they should be named the same (polymorphism is good:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42545 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
d3952f3baefee27164f4001d6b16df443e30feec 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Previously, I warned those methods not implemented in implementation class/category.
Now, I also warn those class/categories which are incomplete because of this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42544 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
ca3adf7e8cac8c9fbaf592b1e5c2be6f082de7ba 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Previously, I warned those methods not implemented in implementation class/category.
Now, I also warn those class/categories which are incomplete because of this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42544 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
fa465d1b96a38ec63dcdd4577630bf4710cff5cc 02-Oct-2007 Steve Naroff <snaroff@apple.com> - Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
- Add ObjcMessageExpr::getSelector(), getClassName().
- Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed).
- Remove FIXME for printing ObjCMessageExpr's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42543 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
xpr.h
6a8a9a41e9067b708498c02180159bafecfa044f 02-Oct-2007 Steve Naroff <snaroff@apple.com> - Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().
- Add ObjcMessageExpr::getSelector(), getClassName().
- Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed).
- Remove FIXME for printing ObjCMessageExpr's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42543 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
xpr.h
97456458081dc6ca251199da0cab7dc8b32b493f 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> ObjcCategoryDecl Does not subclass from ScopedDecl any more.
Ted may want to take a look at the change I made at
FGRecStmtDeclVisitor.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42535 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
60199032e41216fa2fca635c7a942e5473cdf979 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> ObjcCategoryDecl Does not subclass from ScopedDecl any more.
Ted may want to take a look at the change I made at
FGRecStmtDeclVisitor.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42535 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
35bc4d26039ff5633a8c4edf9697a2f81a2a6429 02-Oct-2007 Ted Kremenek <kremenek@apple.com> Moved ProgramEdge out out include/.../Analysis/PathSensitive to include/.../Analysis, as it is now used by the FlowSensitive subsystem as well.

Removed "Edge" nested class by CFG, as it is now subsumed by ProgramEdge.

Adjusted DataflowSolver and DataflowValues to use ProgramEdges instead
of CFG::Edge.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42534 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
4d20f2dd79e7829ade5e23945a2ef65a8fe1cf39 02-Oct-2007 Ted Kremenek <kremenek@apple.com> Moved ProgramEdge out out include/.../Analysis/PathSensitive to include/.../Analysis, as it is now used by the FlowSensitive subsystem as well.

Removed "Edge" nested class by CFG, as it is now subsumed by ProgramEdge.

Adjusted DataflowSolver and DataflowValues to use ProgramEdges instead
of CFG::Edge.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42534 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
a91aa32e224397b875e51e463dc6bf88c5bf5951 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch introduces the ObjcCategoryImplDecl class and does the checking related to
unimplemented methods in category implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42531 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
8f3fde00ad4d4f943321e338b914ae4740711c84 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch introduces the ObjcCategoryImplDecl class and does the checking related to
unimplemented methods in category implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42531 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
eclObjC.h
379cf513af71280a53c9be51a3bbc022946b629d 02-Oct-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Added a missing #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42516 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
c1581a0d64b0ee4f822ed2fca4442a111d03569a 02-Oct-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Added a missing #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42516 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
f280f5fb53b34dc171390f4ebf6c80088e291f2a 02-Oct-2007 Steve Naroff <snaroff@apple.com> Add comment to ObjcClassDecl.
Move ObjcClassDecl to be next to ObjcForwardProtocolDecl. Since they are very similar, might want to unify their names (e.g. ObjcForwardClassDecl).
Change indentation of ObjcForwardProtocolDecl to conform to everything else in DeclObjC.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42513 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
06ae8d68ef258ccd40c9cd1ce762eaae6f3d4432 02-Oct-2007 Steve Naroff <snaroff@apple.com> Add comment to ObjcClassDecl.
Move ObjcClassDecl to be next to ObjcForwardProtocolDecl. Since they are very similar, might want to unify their names (e.g. ObjcForwardClassDecl).
Change indentation of ObjcForwardProtocolDecl to conform to everything else in DeclObjC.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42513 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
e8f248dc3f1ac362aa989ce8a091d2cccd82dba1 02-Oct-2007 Steve Naroff <snaroff@apple.com> Add comments for ObjC Decl's.
Removed a constructor that was #if 0's out.
Added a FIXME for fariborz...categories shouldn't inherit from ScopedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42507 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
0c6b6243d3efd958c17943130e2a773653511edc 02-Oct-2007 Steve Naroff <snaroff@apple.com> Add comments for ObjC Decl's.
Removed a constructor that was #if 0's out.
Added a FIXME for fariborz...categories shouldn't inherit from ScopedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42507 91177308-0d34-0410-b5e6-96231b3b80d8
eclObjC.h
3a8198213c7834c5f122fc73ea90180f885b699e 01-Oct-2007 Ted Kremenek <kremenek@apple.com> CFG objects now internally store a (lazily created) map from block-level
expressions to IDs. This is used by various dataflow analyses, but is
also useful for anyone querying a CFG to determine where an expression
is evaluated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42495 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
63f5887f316fb52d243fcbb3631c039de6c4b993 01-Oct-2007 Ted Kremenek <kremenek@apple.com> CFG objects now internally store a (lazily created) map from block-level
expressions to IDs. This is used by various dataflow analyses, but is
also useful for anyone querying a CFG to determine where an expression
is evaluated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42495 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
3fafa108e3efbcc21b9a69e2564307350120566b 01-Oct-2007 Steve Naroff <snaroff@apple.com> Move ObjC decls to DeclObjC.h, a new AST header.
Update clients and add to project file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42494 91177308-0d34-0410-b5e6-96231b3b80d8
ST.h
STContext.h
ecl.h
eclObjC.h
980e508ca70d6de75d2abfd96b4681fc98bb2698 01-Oct-2007 Steve Naroff <snaroff@apple.com> Move ObjC decls to DeclObjC.h, a new AST header.
Update clients and add to project file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42494 91177308-0d34-0410-b5e6-96231b3b80d8
ST.h
STContext.h
ecl.h
eclObjC.h
a950a57363fb95ff32f182b32b31583021ef9ac6 01-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Moved two bitfields back to top of class ObjcMethodDecl so they pack
with those in their base class. In response to clattner's
September 30, 2007 12:54:49 AM PDT email.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42491 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
991e48b283e6c683f91fdaa467776bdc4b50f099 01-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Moved two bitfields back to top of class ObjcMethodDecl so they pack
with those in their base class. In response to clattner's
September 30, 2007 12:54:49 AM PDT email.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42491 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ad5682f2e714da183ed07cbc4c8592e4f72620d7 01-Oct-2007 Ted Kremenek <kremenek@apple.com> Removed "hasImplicitControlFlow" from class CFG, and moved it to class Stmt
as a member function. This function is no longer needed within the CFG
class, and logically belongs to the Stmt class as a predicate for a
Stmt instance.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42489 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
tmt.h
d48ade633d96b94cb435d73e2c935ea457152dec 01-Oct-2007 Ted Kremenek <kremenek@apple.com> Removed "hasImplicitControlFlow" from class CFG, and moved it to class Stmt
as a member function. This function is no longer needed within the CFG
class, and logically belongs to the Stmt class as a predicate for a
Stmt instance.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42489 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
tmt.h
ad21a61bb1f1f3e834ae028c6fd70dcce91d6625 30-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Unused ObjcProtoMethod is removed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42485 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d664ff7beb054a2f2f56ec438ff3ce65be96eddc 30-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Unused ObjcProtoMethod is removed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42485 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
90f163b4e94137e85019271a7a06155bca6f3466 30-Sep-2007 Chris Lattner <sabre@nondot.org> improve comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42478 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
7cb8491a8bb09de32174959f3f634a44264fd48f 30-Sep-2007 Chris Lattner <sabre@nondot.org> improve comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42478 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
a00e0747ef35b1aa6a5d570e29e6a2c4689e231c 29-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch fixes all issues mentioned in clattner's feedback of
September 28, 2007 4:39:24 PM PDT
Please let me know if I missed anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42473 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
3a63da7053b07583fe3881388ef35181b2d34d3e 29-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch fixes all issues mentioned in clattner's feedback of
September 28, 2007 4:39:24 PM PDT
Please let me know if I missed anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42473 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
dd243eff0724a4ba016415bf3c809de920e404d2 29-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to remove use of has table for protocol name lookup. This patch mirrors my
previous patch to do the same for class name lookup using a hash table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42471 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
1b6351f76e1e06893337441641c0e349939afb31 29-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to remove use of has table for protocol name lookup. This patch mirrors my
previous patch to do the same for class name lookup using a hash table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42471 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
0c5affb00a28ede46ad76793708b7c6ec5d8f14f 29-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Removed use of hash table for class decls and do a name look up directly.
There is still an issue if doing ScopedLookup is an overkill and we can
just access the decl using the identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42463 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
9d048ff59ffb5d41e57297c6509c11920052cf67 29-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Removed use of hash table for class decls and do a name look up directly.
There is still an issue if doing ScopedLookup is an overkill and we can
just access the decl using the identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42463 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
6cb1d3671bd17eb439e0f0742a9ee6a0f50dbbc0 29-Sep-2007 Steve Naroff <snaroff@apple.com> Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.

This motivated implementing a devious clattner inspired solution:-)

This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema).

This change was critical to make now, before we have too many clients.

I still need to add some comments to the Selector class...will likely add later today/tomorrow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42452 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
bcfb06ac6da1aa3c74ac1ef7a49c2807522366e7 29-Sep-2007 Steve Naroff <snaroff@apple.com> Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.

This motivated implementing a devious clattner inspired solution:-)

This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema).

This change was critical to make now, before we have too many clients.

I still need to add some comments to the Selector class...will likely add later today/tomorrow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42452 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
5975f77cfa30e87b5e59827e57799b364e0a350c 28-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to warn on umimplemented methods coming from class's
protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42436 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
00ae8d595534c0a444326204adee3486bbb43dcd 28-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to warn on umimplemented methods coming from class's
protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42436 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1e4e82f98a9fb1d08c9bdb1259af99ad0f10b45b 27-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for method implementation. It populates ObjcImplementationDecl object with method implementation declarations .
It checks and warns on those methods declared in class interface and not implemented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42412 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d0b015461a819913efa1161c56a8b897d7e8cdb2 27-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for method implementation. It populates ObjcImplementationDecl object with method implementation declarations .
It checks and warns on those methods declared in class interface and not implemented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42412 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4ed9d662047bb65315e1fe1b0a4175c87f5fe627 27-Sep-2007 Steve Naroff <snaroff@apple.com> Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set). SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits:

#1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable.

#2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%.

#3: It results in many API simplifications. Here are some highlights:

- Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages).
- Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo).
- Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured).

I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later.

Thanks to Chris for talking this through with me and suggesting this approach.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42395 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
68d331a78e655d97294e94fcfa63f92cc1f40578 27-Sep-2007 Steve Naroff <snaroff@apple.com> Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set). SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits:

#1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable.

#2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%.

#3: It results in many API simplifications. Here are some highlights:

- Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages).
- Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo).
- Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured).

I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later.

Thanks to Chris for talking this through with me and suggesting this approach.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42395 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
d34caf9a80dfb04817f8e2f1f5932d3fc3f00bb6 26-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch inserts ivars declared in @implementation in its object and verifies
that they conform(in type, name and numbers) to those declared in @interface.
Test case highlights kind of checking we do here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42360 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d0b90bff98bafb72ea9809f509bf37c93c60e74e 26-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch inserts ivars declared in @implementation in its object and verifies
that they conform(in type, name and numbers) to those declared in @interface.
Test case highlights kind of checking we do here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42360 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1c0eedbb720bbc574e4833fad59b36b629e03950 25-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to make ObjcImplementationDecl derived from TypeDecl and supprt legacy
objective-c code with no @interface declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42319 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0da1c1033832b572d23ff2fe7bb2ab959768727e 25-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to make ObjcImplementationDecl derived from TypeDecl and supprt legacy
objective-c code with no @interface declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42319 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c091b5df8f32a4805837fb909bbff82a01faafb5 25-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch introduces a new class to keep track of class implementation info. It also adds more
semantic checks for class and protocol declarations. Test cases are good indications of kind of
checking being done in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
ccb4f314248fb2202637d3290f2b17af5646da08 25-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch introduces a new class to keep track of class implementation info. It also adds more
semantic checks for class and protocol declarations. Test cases are good indications of kind of
checking being done in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
92803daaa6a40a3899c2e599bddc42732c2ce593 24-Sep-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Fixed VC++ bitfield to unsigned/signed sign propagation issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42252 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a8ae51f79d35b7c1822ba4a086176b4a8c862862 24-Sep-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Fixed VC++ bitfield to unsigned/signed sign propagation issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42252 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4e33ba30e07959f8f24b614617bd2e1f15578601 22-Sep-2007 Chris Lattner <sabre@nondot.org> add comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
3d2313ef5de46228b157b1f1f6e306812dae3942 22-Sep-2007 Chris Lattner <sabre@nondot.org> add comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42237 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7f298768e81651806d11343b9b1c6434002055cf 22-Sep-2007 Chris Lattner <sabre@nondot.org> further apfloat'ize the front-end, allowing codegen to pass
APFloat straight through to LLVM now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42236 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c9bec4bfea9090a08dd83a7b213f0c8adf8d78ec 22-Sep-2007 Chris Lattner <sabre@nondot.org> further apfloat'ize the front-end, allowing codegen to pass
APFloat straight through to LLVM now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42236 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
36f46b8a6b4c0c8274b8f2ea63f13098a0ef3351 22-Sep-2007 Chris Lattner <sabre@nondot.org> work around bugs and missing features in apfloat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42235 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1c9bdaef20398390818e9114269cd9925534b89c 22-Sep-2007 Chris Lattner <sabre@nondot.org> work around bugs and missing features in apfloat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42235 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
858eece2d335c82c4de7773d1da968298f858f44 22-Sep-2007 Chris Lattner <sabre@nondot.org> Use APFloat for the representation of FP immediates, ask the target
for *which* apfloat to use for a particular type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
525a05093a4816af961fe2bc6b8a81c17e2e26c2 22-Sep-2007 Chris Lattner <sabre@nondot.org> Use APFloat for the representation of FP immediates, ask the target
for *which* apfloat to use for a particular type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ac7758315f120e0cfd7d7bc3ea5974c10f0987c4 22-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch adds to new things to clang:
1. Handles saving and checking on protocols used in an @interface declaration
2. Checks and saves class's super class.
3. Adds semantic check to category declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42218 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b27c156688ca557cb277ecdfea6dccc1dac5b49f 22-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch adds to new things to clang:
1. Handles saving and checking on protocols used in an @interface declaration
2. Checks and saves class's super class.
3. Adds semantic check to category declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42218 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
766afb8a7f1ecde2060728637ab20f85b50c2265 21-Sep-2007 Chris Lattner <sabre@nondot.org> Make case sorting deterministic by not depending on pointer
values. Patch mostly by Gabor Greif for PR1682.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42203 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
764a7ce5217f9569e100a3445f47496ee82daf86 21-Sep-2007 Chris Lattner <sabre@nondot.org> Make case sorting deterministic by not depending on pointer
values. Patch mostly by Gabor Greif for PR1682.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42203 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
c716c94b77c762aaa320b24b51d238cfdcc6b6c5 21-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch instantiates objects for forward protocols and in general handles use of
protocols referenced in @protocol declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42191 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
894c57f565869b26a65436d250a9ca7a04d2abe0 21-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch instantiates objects for forward protocols and in general handles use of
protocols referenced in @protocol declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42191 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
a5f40405e24ca51e92e5ff9b692bad588edae078 20-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Handle forward declaration of classes and prevent re-instantiation of
ObjcInterfaceClass Objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42172 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
bd51b8745c7424fb95abb91370d1a38a24451a6e 20-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Handle forward declaration of classes and prevent re-instantiation of
ObjcInterfaceClass Objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42172 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
0b59d9cbe33a1062a9795c09a04d2f15d4f54cca 20-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Match to do some semantic analysis on objective-c class decl.
1. Detect used of undeclared/forward declared super class.
2. Detect duplicate definition of a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42168 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
1d5b0e37cd569f3d1ddfc5cabff649ef7e42f3c6 20-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Match to do some semantic analysis on objective-c class decl.
1. Detect used of undeclared/forward declared super class.
2. Detect duplicate definition of a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42168 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
51b0acaa81a2070b66fa5ebd8669dfc8f8fc0c3d 19-Sep-2007 Ted Kremenek <kremenek@apple.com> Moved GraphTraits<Stmt*> to StmtGraphTraits.h. This allows consumers of Stmt.h not to have to pay the cost
of parsing the GraphTraits templates if they don't need that functionality.

Defined nodes_iterator for GraphTraits<Stmt*> to be based on llvm::df_iterator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42150 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtGraphTraits.h
d2a4a1af1088fca80e2dc76eb3369db0fbbfdefd 19-Sep-2007 Ted Kremenek <kremenek@apple.com> Moved GraphTraits<Stmt*> to StmtGraphTraits.h. This allows consumers of Stmt.h not to have to pay the cost
of parsing the GraphTraits templates if they don't need that functionality.

Defined nodes_iterator for GraphTraits<Stmt*> to be based on llvm::df_iterator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42150 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtGraphTraits.h
2f491fb1bf65cf0349371c6882442b058c7bc901 19-Sep-2007 Ted Kremenek <kremenek@apple.com> Added GraphTraits template specialization for Stmt* to treat ASTs like graphs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42146 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5e97d4b5ec7ce97e311d7aa4e8bd2b4fd9dbfa2e 19-Sep-2007 Ted Kremenek <kremenek@apple.com> Added GraphTraits template specialization for Stmt* to treat ASTs like graphs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42146 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
4bc52cec7be91d70529b409efaeebf1b69705df3 19-Sep-2007 Steve Naroff <snaroff@apple.com> Remove SelectorTable/SelectorInfo, simply store all selectors in the central IdentifierTable.

Rationale:

We currently have a separate table to unique ObjC selectors. Since I don't need all the instance data in IdentifierInfo, I thought this would save space (and make more sense conceptually).

It turns out the cost of having duplicate entries for unary selectors (i.e. names without colons) outweighs the cost difference between the IdentifierInfo & SelectorInfo structures. Here is the data:

Two tables:

*** Selector/Identifier Stats:
# Selectors/Identifiers: 51635
Bytes allocated: 1999824

One table:

*** Identifier Table Stats:
# Identifiers: 49500
Bytes allocated: 1990316




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42139 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
21d5a95b8f50be3e0fdd8c53f92fc201f665a4b4 19-Sep-2007 Steve Naroff <snaroff@apple.com> Remove SelectorTable/SelectorInfo, simply store all selectors in the central IdentifierTable.

Rationale:

We currently have a separate table to unique ObjC selectors. Since I don't need all the instance data in IdentifierInfo, I thought this would save space (and make more sense conceptually).

It turns out the cost of having duplicate entries for unary selectors (i.e. names without colons) outweighs the cost difference between the IdentifierInfo & SelectorInfo structures. Here is the data:

Two tables:

*** Selector/Identifier Stats:
# Selectors/Identifiers: 51635
Bytes allocated: 1999824

One table:

*** Identifier Table Stats:
# Identifiers: 49500
Bytes allocated: 1990316




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42139 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
xpr.h
c39ca26d397ee4d285d4f9fa1caf5e3c33e1874a 19-Sep-2007 Steve Naroff <snaroff@apple.com> Progress on message expressions...

- Add ObjcMessageExpr AST node and associated constructors.
- Add SourceLocation's to ActOnKeywordMessage/ActOnUnaryMessage API.
- Instantiate message expressions...
- Replace alloca usage with SmallString.

Next step, installing a correct type, among other tweaks...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42116 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
563477da25f824e37c535131695dc4dc9b68c465 19-Sep-2007 Steve Naroff <snaroff@apple.com> Progress on message expressions...

- Add ObjcMessageExpr AST node and associated constructors.
- Add SourceLocation's to ActOnKeywordMessage/ActOnUnaryMessage API.
- Instantiate message expressions...
- Replace alloca usage with SmallString.

Next step, installing a correct type, among other tweaks...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42116 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
68447a6a4556976021ef856989ec561a2dd264fc 18-Sep-2007 Ted Kremenek <kremenek@apple.com> Added member template CFG::VisitBlockStmts to provide a succinct way
of visiting all block-level statements in a CFG.

Tightened implementation of UninitializedValues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42106 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
a90b0d1e585d993621a342d0b2874e61941372d5 18-Sep-2007 Ted Kremenek <kremenek@apple.com> Added member template CFG::VisitBlockStmts to provide a succinct way
of visiting all block-level statements in a CFG.

Tightened implementation of UninitializedValues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42106 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
9439387416ec6dd0cec4ddfb58d6ef47dd30642d 18-Sep-2007 Ted Kremenek <kremenek@apple.com> Additional comments and cosmetic cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42105 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
a36c6540346266f570b2fc7457950dea45d89988 18-Sep-2007 Ted Kremenek <kremenek@apple.com> Additional comments and cosmetic cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42105 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
f25220eb00bec12652342dfb98668ab3d310dfd1 18-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for object creation and handling of category declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42104 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
fd225cc227143553898f2d3902242d25db9a4902 18-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for object creation and handling of category declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42104 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d1472a55c9f8534547157abf95671ee43c78950f 18-Sep-2007 Ted Kremenek <kremenek@apple.com> Added type "CFG::Edge" to encapsulate the notion of directed-edges
within source-level CFGs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42098 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
4c64e8ee46ad6e2336f9c160a79eded6b16c68f8 18-Sep-2007 Ted Kremenek <kremenek@apple.com> Added type "CFG::Edge" to encapsulate the notion of directed-edges
within source-level CFGs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42098 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
4a2b0acffc9516aad938da641d0b4201be4e8281 18-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to remove ObjcProtoMethodDecl and use ObjcMethodDecl
instead for @protocol method decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42070 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
146fbb0c8b81cb62c8bf0e9a10ce8bc8403132c8 18-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to remove ObjcProtoMethodDecl and use ObjcMethodDecl
instead for @protocol method decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42070 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6d87ce556801a0e0e596bec8fd25287800d00ee0 17-Sep-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Fixed a VC++ issue related to bitmasks. As it turns out the compiler fills the unused bits of the word a bitmask is stored in with '1' (or randomly, I can't tell, I've seen '1' so far only), which creates wrong results in certain cases.

Please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42061 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
0bcccc763bef79171015c3b270e505b9c864ea8b 17-Sep-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Fixed a VC++ issue related to bitmasks. As it turns out the compiler fills the unused bits of the word a bitmask is stored in with '1' (or randomly, I can't tell, I've seen '1' so far only), which creates wrong results in certain cases.

Please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42061 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
63ca8ae2f3f4a1ecfc0fa5a938f68419ce4e3140 17-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to add objective-c's @protocl type declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42060 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
25e077d59a8e8e43b65882b69610a3d5e2aaf53c 17-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to add objective-c's @protocl type declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42060 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
590aba84dc921d487378ca65d7e0b47b9dcdd1f0 17-Sep-2007 Steve Naroff <snaroff@apple.com> Add const to debug hook...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42025 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e5ea380858f3d0a168c44ba42684e821997933d7 17-Sep-2007 Steve Naroff <snaroff@apple.com> Add const to debug hook...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42025 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
948fd378c0fb7aec046ef8a5d16929d2d7601fce 17-Sep-2007 Steve Naroff <snaroff@apple.com> Add support for ObjC keyword selectors.

- Add SelectorInfo/SelectorTable classes, modeled after IdentifierInfo/IdentifierTable.
- Add SelectorTable instance to ASTContext, created lazily through ASTContext::getSelectorInfo().
- Add SelectorInfo slot to ObjcMethodDecl.
- Add helper function to derive a SelectorInfo from ObjcKeywordInfo.

Misc: Got the Decl stats stuff up and running again...it was missing support for ObjC AST's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42023 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
3f128ad2691d299b96663da85a9e069c4081ea7c 17-Sep-2007 Steve Naroff <snaroff@apple.com> Add support for ObjC keyword selectors.

- Add SelectorInfo/SelectorTable classes, modeled after IdentifierInfo/IdentifierTable.
- Add SelectorTable instance to ASTContext, created lazily through ASTContext::getSelectorInfo().
- Add SelectorInfo slot to ObjcMethodDecl.
- Add helper function to derive a SelectorInfo from ObjcKeywordInfo.

Misc: Got the Decl stats stuff up and running again...it was missing support for ObjC AST's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42023 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
03c512e38cbee5bf4f8d586be8461c7a92b358ed 16-Sep-2007 Chris Lattner <sabre@nondot.org> Fix a GCC warning, patch by Justin Handville


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42007 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9e6622dbf397edd79a4300240e0c06ef22c55774 16-Sep-2007 Chris Lattner <sabre@nondot.org> Fix a GCC warning, patch by Justin Handville


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42007 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f0c31dd3324dd50bc2d3177f3a789db70fe8982c 16-Sep-2007 Steve Naroff <snaroff@apple.com> Fixes/tweaks that prevent "defaults-i.m" from compiling.

- Allow classnames as the receiver (removing a FIXME from ParseObjCMessageExpression).
- Added a FIXME to ParseObjCMessageExpression()...we need to return a message expr AST node!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42001 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8c9f13e494109426f358ef73bf873f77b1221564 16-Sep-2007 Steve Naroff <snaroff@apple.com> Fixes/tweaks that prevent "defaults-i.m" from compiling.

- Allow classnames as the receiver (removing a FIXME from ParseObjCMessageExpression).
- Added a FIXME to ParseObjCMessageExpression()...we need to return a message expr AST node!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42001 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1cc0171e8276e7cb3875b65784800a0a2abc8035 16-Sep-2007 Chris Lattner <sabre@nondot.org> add a new ASTConsumer consumer to simplify stuff in the driver.
Switch -parse-ast over to it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41991 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
556beb71b8820ed5243e385ffcc91433a494c170 16-Sep-2007 Chris Lattner <sabre@nondot.org> add a new ASTConsumer consumer to simplify stuff in the driver.
Switch -parse-ast over to it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41991 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumer.h
0acc9c9e548751e89229f8476156f331b7254d26 15-Sep-2007 Steve Naroff <snaroff@apple.com> Start converting Action methods from Parse-prefix to ActOn-prefix.

The previous naming scheme was confusing, since it resulted in both the Parser and Action modules having methods with the same name. In addition, the Action module never does any parsing...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41986 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
08d92e46d2ec2895f3c2ca14876830120bbe4f78 15-Sep-2007 Steve Naroff <snaroff@apple.com> Start converting Action methods from Parse-prefix to ActOn-prefix.

The previous naming scheme was confusing, since it resulted in both the Parser and Action modules having methods with the same name. In addition, the Action module never does any parsing...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41986 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c2e4644913c3c831b6498085c39fe05f3596ed7f 15-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Couple of new classes for objective-c's @protocol typings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41985 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e1076476e948325af6b867180d4b20b50bc89cf6 15-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Couple of new classes for objective-c's @protocol typings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41985 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9bb759f16cf586e4439a78fea0fc8870c52a03c1 15-Sep-2007 Steve Naroff <snaroff@apple.com> Several improvement to Sema::ParseRecordBody()...

- Adding a safer prologue. The previous prologue would accept a null and therefore assume we had an interface (which was incorrect).
- Fixed FieldDecl's classof method. This allowed me to simplify some unnecessary casting.
- When diagnosing errors, make sure the FieldDecl/EnclosingDecl are marked as invalid. In addition, don't delete the field...rather, add all fields to the enclosing decl. Memory management can/should be done elsewhere. This code was never "upgraded" to the recently added invalid decl strategy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41964 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
74216648a51e3aee7e59c27e1f1e5c132c024830 15-Sep-2007 Steve Naroff <snaroff@apple.com> Several improvement to Sema::ParseRecordBody()...

- Adding a safer prologue. The previous prologue would accept a null and therefore assume we had an interface (which was incorrect).
- Fixed FieldDecl's classof method. This allowed me to simplify some unnecessary casting.
- When diagnosing errors, make sure the FieldDecl/EnclosingDecl are marked as invalid. In addition, don't delete the field...rather, add all fields to the enclosing decl. Memory management can/should be done elsewhere. This code was never "upgraded" to the recently added invalid decl strategy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41964 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ebcc9b632f62f436f56e10b6eddffc7dd1d7ab32 14-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to store ivars into interface class object.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41961 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
b04a02184c5ec8745ea8a639fbdff2293fe0ae96 14-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to store ivars into interface class object.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41961 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
dc1ad7633d6628a1c0fbbf47404ed6b1fc0e37cd 14-Sep-2007 Steve Naroff <snaroff@apple.com> Now that the dust has settled on the Decl refactoring, I noticed FieldDecl didn't need NextDeclarator. As a result, I'm removing it.

Removing both slots (NextDeclarator/Next) end up reducing the size of fields/ivars by 40%.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f38661ec6e803b553bddae17325ac59809b45d83 14-Sep-2007 Steve Naroff <snaroff@apple.com> Now that the dust has settled on the Decl refactoring, I noticed FieldDecl didn't need NextDeclarator. As a result, I'm removing it.

Removing both slots (NextDeclarator/Next) end up reducing the size of fields/ivars by 40%.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41948 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
2591e1be4e9470da55cca6bdfe7e1ecf98919ba8 14-Sep-2007 Steve Naroff <snaroff@apple.com> Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.

Decl is now svelte:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41935 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
9474504790f11617479b8d6ef8b64e32d071f251 14-Sep-2007 Steve Naroff <snaroff@apple.com> Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.

Decl is now svelte:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41935 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
cb59747c5e40847b0886355bcd97eeaa94dfb9ae 13-Sep-2007 Steve Naroff <snaroff@apple.com> Phase 2 of making the Decl class more lightweight...

Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl.

Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41934 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xpr.h
tmt.h
8e74c93ddaa8268a999e1b25c723dc1984a434b4 13-Sep-2007 Steve Naroff <snaroff@apple.com> Phase 2 of making the Decl class more lightweight...

Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl.

Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41934 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
xpr.h
tmt.h
d21bc0d43b0e3f89e4aa55ad417e378ce7dc6c59 13-Sep-2007 Steve Naroff <snaroff@apple.com> Add "ScopedDecl" AST, used by ValueDecl and TypeDecl.

This allows us to sink the "Next" field, which isn't used by FieldDecl and ObjcIvarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41931 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c752d041b5d9bdd31dfb8ec9b059e6be9247b5af 13-Sep-2007 Steve Naroff <snaroff@apple.com> Add "ScopedDecl" AST, used by ValueDecl and TypeDecl.

This allows us to sink the "Next" field, which isn't used by FieldDecl and ObjcIvarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41931 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
409dfd126d424555116e0c561e95d961b6dbd7fb 13-Sep-2007 Chris Lattner <sabre@nondot.org> make the sourcemgr available through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41906 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
b800dc2d5e27ec60f567567b623cdc61152b8fb8 13-Sep-2007 Chris Lattner <sabre@nondot.org> make the sourcemgr available through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41906 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f7f1a1f7600c7ee836ebd8773f70c3c2d64c7522 13-Sep-2007 Steve Naroff <snaroff@apple.com> Add ASTContext::StringMap<char> to unique selector names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41894 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
a9aa5e69d8253e196be90c070738ab5bd9813730 13-Sep-2007 Steve Naroff <snaroff@apple.com> Add ASTContext::StringMap<char> to unique selector names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41894 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
86f74a46b4f62a9b403e646b5118c2a3171435f4 12-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for building method declaration nodes. Also fixed a segfault in cocoa.m due
to use of @property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41880 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e55cd00d23f0951c29b3b93e6034b2c4b3933a23 12-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for building method declaration nodes. Also fixed a segfault in cocoa.m due
to use of @property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41880 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
999c58d3d11af5647c73d3bab8157b19c5a8c0a1 12-Sep-2007 Ted Kremenek <kremenek@apple.com> Added static method "CFG::hasImplicitControlFlow".

This method is used to determine if an expression contains implicit
control-flow, and thus appears in a distinct statement slot in the CFG.

For example:

(1) x = ... ? ... ? ...

logically becomes:

(1) ... ? ... : ... (a unique statement slot for the ternary ?)
(2) x = [E1] (where E1 is actually the ConditionalOperator*)

A client of the CFG, when walking the statement at (2), will encounter
E1. In this case, hasImplicitControlFlow(E1) == true, and the client
will know that the expression E1 is explicitly placed into its own statement
slot to capture the implicit control-flow it has.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41868 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
155383b0fcd0a12a103310010f8c0d084b90b090 12-Sep-2007 Ted Kremenek <kremenek@apple.com> Added static method "CFG::hasImplicitControlFlow".

This method is used to determine if an expression contains implicit
control-flow, and thus appears in a distinct statement slot in the CFG.

For example:

(1) x = ... ? ... ? ...

logically becomes:

(1) ... ? ... : ... (a unique statement slot for the ternary ?)
(2) x = [E1] (where E1 is actually the ConditionalOperator*)

A client of the CFG, when walking the statement at (2), will encounter
E1. In this case, hasImplicitControlFlow(E1) == true, and the client
will know that the expression E1 is explicitly placed into its own statement
slot to capture the implicit control-flow it has.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41868 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
75494896d07edfb63a46a9f82e132641447b1e29 11-Sep-2007 Steve Naroff <snaroff@apple.com> - Add an ObjcIvarDecl AST node (a subclass of FieldDecl).
- Instantiate the node in Sema::ParseField(), based on the type of the TagDecl.
- Add Sema::ObjcAddInstanceVariable(), responsible for adorning/adding the ObjcIvarDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41864 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4473921b663539cc489435d6eae5c14df1bc4a96 11-Sep-2007 Steve Naroff <snaroff@apple.com> - Add an ObjcIvarDecl AST node (a subclass of FieldDecl).
- Instantiate the node in Sema::ParseField(), based on the type of the TagDecl.
- Add Sema::ObjcAddInstanceVariable(), responsible for adorning/adding the ObjcIvarDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41864 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4d627f5423338381d3465e2bf01e6f83bdfb65a5 11-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Change ObjcMethodDecl class derivation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41860 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
8a4010d40c7ba61a92c728814639674726888e8f 11-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Change ObjcMethodDecl class derivation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41860 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
61ce98c13c4e13f2f399533cac2f0c7469c4aea7 11-Sep-2007 Gabor Greif <ggreif@gmail.com> get rid of ugly "warning: no newline at end of file"
warnings that some compilers diagnose


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41847 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
8467583c2704e7a9691ea56939a029015f0ade0a 11-Sep-2007 Gabor Greif <ggreif@gmail.com> get rid of ugly "warning: no newline at end of file"
warnings that some compilers diagnose


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41847 91177308-0d34-0410-b5e6-96231b3b80d8
rettyPrinter.h
74a340749eb63af1ba7098c67f3ef72bd48f5ae8 11-Sep-2007 Ted Kremenek <kremenek@apple.com> Fixed isFunctionPointerType to correctly handle typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41814 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
01c2c6e3c94a3fa2ac15851b4af5de6dc3ae2af8 11-Sep-2007 Ted Kremenek <kremenek@apple.com> Fixed isFunctionPointerType to correctly handle typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41814 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3dc7cbc04c4f7e80829dd526e869b3188d2e6b09 10-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Early patch to collect objective-c methods inserts them in
class object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41801 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e3a2ca7e30601cdd31c77a830f4cc487851e8096 10-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Early patch to collect objective-c methods inserts them in
class object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41801 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
83b01279f2e6718581eeb1e5bdba58aa88e4649b 10-Sep-2007 Ted Kremenek <kremenek@apple.com> Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr
refers to a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41795 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
498b0d1aba38f5ec64d566d1dd9e6be237ecc50f 10-Sep-2007 Ted Kremenek <kremenek@apple.com> Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr
refers to a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41795 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7c6f0c755e48a2782bc0a0a4cfc63dc84e0f11d5 07-Sep-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Fixed compilation on Windows.
Silenced a couple of warnings.
Added *.vcproj file for new clangAnalysis library.
Renamed Basic to clangBasic projects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41767 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
124dd7b5777e29ecac006822bd4d4623f0dc4264 07-Sep-2007 Hartmut Kaiser <hartmut.kaiser@gmail.com> Fixed compilation on Windows.
Silenced a couple of warnings.
Added *.vcproj file for new clangAnalysis library.
Renamed Basic to clangBasic projects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41767 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
ype.h
81f1bbabbdb7dce07802111e2d9648eedc866d51 06-Sep-2007 Steve Naroff <snaroff@apple.com> The goal of this commit is to get just enough Sema support to recognize Objective-C classes
as types. That said, the AST nodes ObjcInterfaceDecl, ObjcInterfaceType, and ObjcClassDecl are *very*
preliminary.

The good news is we no longer need -parse-noop (aka MinimalActions) to parse cocoa.m.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41752 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
ype.h
3536b443bc50d58a79f14fca9b6842541a434854 06-Sep-2007 Steve Naroff <snaroff@apple.com> The goal of this commit is to get just enough Sema support to recognize Objective-C classes
as types. That said, the AST nodes ObjcInterfaceDecl, ObjcInterfaceType, and ObjcClassDecl are *very*
preliminary.

The good news is we no longer need -parse-noop (aka MinimalActions) to parse cocoa.m.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41752 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
ype.h
a65ad464c65453caee78a7c811682afcf42aefb5 06-Sep-2007 Ted Kremenek <kremenek@apple.com> Added LabelLoc to GotoStmt to record the source location of the label token
in the actual GotoStmt.

Fixed bug where GotoStmt::getSourceRange incorrectly used the target LabelStmt
to compute its extent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41745 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
61f62165220e75694fe333179c78815e2e48d71f 06-Sep-2007 Ted Kremenek <kremenek@apple.com> Added LabelLoc to GotoStmt to record the source location of the label token
in the actual GotoStmt.

Fixed bug where GotoStmt::getSourceRange incorrectly used the target LabelStmt
to compute its extent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41745 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
145945746c3eae2a8d82558a33f6dc661649a57b 05-Sep-2007 Ted Kremenek <kremenek@apple.com> Moved tracking of CFG block IDs into the CFG class.
Added CFG::getNumBlockIDs() to query the number of distinct block ids created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41724 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
9438252ad2ecae5338df565ca33c6969e4fbfa41 05-Sep-2007 Ted Kremenek <kremenek@apple.com> Moved tracking of CFG block IDs into the CFG class.
Added CFG::getNumBlockIDs() to query the number of distinct block ids created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41724 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
4f9109983a4b4e69c41436ac4b3ae9a370e9a725 04-Sep-2007 Steve Naroff <snaroff@apple.com> Simplified initializer semantic analysis by adding the following 2 methods:

- ArrayType::getBaseType(), and
- ConstantArrayType::getMaximumElements().

Wanted to do this cleanup before adding structure support, which will add more complexity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41715 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7cf8c444320313f0e5b8a483daa996ba844b11ff 04-Sep-2007 Steve Naroff <snaroff@apple.com> Simplified initializer semantic analysis by adding the following 2 methods:

- ArrayType::getBaseType(), and
- ConstantArrayType::getMaximumElements().

Wanted to do this cleanup before adding structure support, which will add more complexity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41715 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e6a8c9bf9c09ff6528ede8d0c472f3a12431cdb9 04-Sep-2007 Steve Naroff <snaroff@apple.com> Make sure initializer type promotions get propagated.

This fixes a recent regression with Codegen/mandel.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41696 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
9e8925e72f53a9e2c4633b6b48e965ed01702fe4 04-Sep-2007 Steve Naroff <snaroff@apple.com> Make sure initializer type promotions get propagated.

This fixes a recent regression with Codegen/mandel.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41696 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c75ccff9e318638cac63fe392f68893ab4177f45 03-Sep-2007 Chris Lattner <sabre@nondot.org> Eliminate some VC++ warnings, patch by Hartmut Kaiser!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41685 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
b8128140956c6f8f0ab143818775a81f4b4aa477 03-Sep-2007 Chris Lattner <sabre@nondot.org> Eliminate some VC++ warnings, patch by Hartmut Kaiser!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41685 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7c9d72d2c2077df381e3b66460333a7ff90d8ecb 02-Sep-2007 Steve Naroff <snaroff@apple.com> More progress on array initializers.

- Added Expr::isConstantExpr().
- Added type checking for InitListExpr elements.
- Added diagnostic for trying to initialize a variable sized object.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41674 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
38374b05791ee93300b9fbe8ceb3957f54184b37 02-Sep-2007 Steve Naroff <snaroff@apple.com> More progress on array initializers.

- Added Expr::isConstantExpr().
- Added type checking for InitListExpr elements.
- Added diagnostic for trying to initialize a variable sized object.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41674 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a610eabeb3fed484c251fa67c8de4437f43b4af6 01-Sep-2007 Steve Naroff <snaroff@apple.com> Finish converting SwitchStmt AST to source ranges.
Move DumpSourceRange() to DumpStmt().

Now -parse-ast-dump will display source range info for all stmts/exprs.

One day we should implement the source range protocol for Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41670 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
9dcbfa450d751bd68fc4af8b75da381d4f6984b9 01-Sep-2007 Steve Naroff <snaroff@apple.com> Finish converting SwitchStmt AST to source ranges.
Move DumpSourceRange() to DumpStmt().

Now -parse-ast-dump will display source range info for all stmts/exprs.

One day we should implement the source range protocol for Decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41670 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
c32a20d907fcfde8a078c903241665a823a7fae9 01-Sep-2007 Steve Naroff <snaroff@apple.com> Convert more statments over to SourceRanges...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41666 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
507f2d5811bd7da1a4d9d2f4960f32177dfab9de 01-Sep-2007 Steve Naroff <snaroff@apple.com> Convert more statments over to SourceRanges...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41666 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
5d2fff8f77b7e6d127af1d3fa25d1c4b24cd52f6 01-Sep-2007 Steve Naroff <snaroff@apple.com> Move SourceRange protocol from Expr->Stmt.

Converted many of the statements over. Still a hanful left...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41663 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
b5a69586f1b8855ee4c1f0bb7a8f0ff4fe32ce09 01-Sep-2007 Steve Naroff <snaroff@apple.com> Move SourceRange protocol from Expr->Stmt.

Converted many of the statements over. Still a hanful left...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41663 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
08176a5484771ab326f230aca24029ac40d11088 31-Aug-2007 Ted Kremenek <kremenek@apple.com> Added "PrinterHelper" interface (include/AST/PrinterHelper) that can
be passed as an (optional) argument to StmtPrinter to customize
printing of AST nodes.

Used new PrinterHelper interface to enhance printing and visualization
of CFGs. The CFGs now illustrate the semantic connectives between
statements and terminators, wheras in the previous printing certain
expressions would (visible) be printed multiple times to reflect which
expressions used the results of other expressions.

The end result is that the CFG is easier to read for flow of
expression values (following principles similar to the LLVM IR).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41651 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
rettyPrinter.h
tmt.h
42a509f6a4f71bb805cc4abbb26722a34dffddde 31-Aug-2007 Ted Kremenek <kremenek@apple.com> Added "PrinterHelper" interface (include/AST/PrinterHelper) that can
be passed as an (optional) argument to StmtPrinter to customize
printing of AST nodes.

Used new PrinterHelper interface to enhance printing and visualization
of CFGs. The CFGs now illustrate the semantic connectives between
statements and terminators, wheras in the previous printing certain
expressions would (visible) be printed multiple times to reflect which
expressions used the results of other expressions.

The end result is that the CFG is easier to read for flow of
expression values (following principles similar to the LLVM IR).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41651 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
rettyPrinter.h
tmt.h
ce9d5fe7e23345c3822d23e53ab837732d8f7616 31-Aug-2007 Ted Kremenek <kremenek@apple.com> Added #ifndef/#endif statements to protect the header from multiple inclusion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41648 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
cd881d534517f09a2fae10445f9b865f49ccc6c8 31-Aug-2007 Ted Kremenek <kremenek@apple.com> Added #ifndef/#endif statements to protect the header from multiple inclusion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41648 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
5eb879b0ab7cc0b98c5700b0c19cae3797530d9c 31-Aug-2007 Steve Naroff <snaroff@apple.com> Removed Sema::VerifyConstantArrayType(). With the new Array/ConstantArray/VariableArray nodes, this
routine was causing more trouble than it was worth. Anders/Chris noticed that it could return an error code
without emiting a diagnostic (which results in an silent invalid decl, which should *never* happen). In addition,
this routine didn't work well for typedefs and field decls. Lastly, it didn't consider that initializers aren't
in place yet.

Added Type::getAsConstantArrayType(), Type::getAsVariableArrayType(), Type::getAsVariablyModifiedType(),
and Type::isVariablyModifiedType();

Modified Sema::ParseDeclarator() and Sema::ParseField() to use the new predicates. Also added a FIXME for
the initializer omission. Also added a missing test for "static" @ file scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41647 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d7444aac1af1c2c1d5e5b7467ecf6006ee2d8abe 31-Aug-2007 Steve Naroff <snaroff@apple.com> Removed Sema::VerifyConstantArrayType(). With the new Array/ConstantArray/VariableArray nodes, this
routine was causing more trouble than it was worth. Anders/Chris noticed that it could return an error code
without emiting a diagnostic (which results in an silent invalid decl, which should *never* happen). In addition,
this routine didn't work well for typedefs and field decls. Lastly, it didn't consider that initializers aren't
in place yet.

Added Type::getAsConstantArrayType(), Type::getAsVariableArrayType(), Type::getAsVariablyModifiedType(),
and Type::isVariablyModifiedType();

Modified Sema::ParseDeclarator() and Sema::ParseField() to use the new predicates. Also added a FIXME for
the initializer omission. Also added a missing test for "static" @ file scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41647 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
762b7c71edb68cf759f947bceae37654f900ab45 31-Aug-2007 Anders Carlsson <andersca@mac.com> Add InitListExpr class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41636 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
66b5a8a39088598c01a9fa6f032dc908612dc8ec 31-Aug-2007 Anders Carlsson <andersca@mac.com> Add InitListExpr class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41636 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
e1765f25167e1cafcb9f2013e60a2dcc45afa482 31-Aug-2007 Chris Lattner <sabre@nondot.org> add some accessors for querying attributes of builtins. Add the new 'F' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41631 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
uiltins.h
d74c15fc0a492fe3ca32cd1865d84911dd0d6e99 31-Aug-2007 Chris Lattner <sabre@nondot.org> add some accessors for querying attributes of builtins. Add the new 'F' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41631 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
uiltins.h
e2579e398d370a480f4803d3337630a4a1f2f68a 30-Aug-2007 Steve Naroff <snaroff@apple.com> Fix a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41618 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
bdbf7b030a3e0ddb95240076683830e6f78c79a5 30-Aug-2007 Steve Naroff <snaroff@apple.com> Fix a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41618 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
24c9b98cc6a8de4a080e2dedb2797bdc2eeb688b 30-Aug-2007 Steve Naroff <snaroff@apple.com> Polish yesterday's Array/ConstantArray/VariableArray rewrite, removing a couple FIXME's.

Refactored Array/VariableArray, moving SizeModifier/IndexTypeQuals back up to Array. These
attributes are not specific to VLA's. Most of them are specific to array parameter types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41616 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
c9406125e2cac9208098655ac8058c095c2c3a65 30-Aug-2007 Steve Naroff <snaroff@apple.com> Polish yesterday's Array/ConstantArray/VariableArray rewrite, removing a couple FIXME's.

Refactored Array/VariableArray, moving SizeModifier/IndexTypeQuals back up to Array. These
attributes are not specific to VLA's. Most of them are specific to array parameter types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41616 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
2af6a80d611735efcba1dd0d8f9ee09b60a21e8f 30-Aug-2007 Chris Lattner <sabre@nondot.org> implement pretty printing of offsetof


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41615 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
704fe35d13c6c7c17ee8472da2321211fc5197c9 30-Aug-2007 Chris Lattner <sabre@nondot.org> implement pretty printing of offsetof


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41615 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
0d9bcea5eeecaa5c0e91951d185056154f65d102 30-Aug-2007 Chris Lattner <sabre@nondot.org> implement initial sema support for __builtin_offsetof


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41613 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtVisitor.h
73d0d4fac161ed12926e010dcf8b448a8de6a2ec 30-Aug-2007 Chris Lattner <sabre@nondot.org> implement initial sema support for __builtin_offsetof


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41613 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtVisitor.h
e07b67e2390fd269d2dd1e9a8bc46aac6988583a 30-Aug-2007 Ted Kremenek <kremenek@apple.com> Fixed bug for CaseStmt where the child_begin/child_end methods were not
including the expressions in the case statement itself (not the body of
the case).

This required moving SubStmt out of SwitchCase into CaseStmt and DefaultStmt
respectively. getSubStmt() now is a virtual call for SwitchCase, but is
a direct (static) call for CaseStmt and DefaultStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41609 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
d97bb6c1384cb773ba5cdbd198008dec127cebad 30-Aug-2007 Ted Kremenek <kremenek@apple.com> Fixed bug for CaseStmt where the child_begin/child_end methods were not
including the expressions in the case statement itself (not the body of
the case).

This required moving SubStmt out of SwitchCase into CaseStmt and DefaultStmt
respectively. getSubStmt() now is a virtual call for SwitchCase, but is
a direct (static) call for CaseStmt and DefaultStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41609 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
99b994b4386a39a2d784e57ac411770d729e9b0a 30-Aug-2007 Chris Lattner <sabre@nondot.org> Teach the stmtdumper to dump location/range info when a SourceMgr is available.
For example, -parse-ast-dump now prints:

static inline int __inline_isinff(float __x)
(CompoundStmt 0x2409a20
(ReturnStmt 0x2409a10
(BinaryOperator 0x24099f0 'int' <///usr/include/architecture/i386/math.h:183:63, col:102> '=='
(CallExpr 0x24098f0 'float' <col:63, col:82>
(ImplicitCastExpr 0x24098e0 'float (*)(float)' <col:63>
(DeclRefExpr 0x2409880 'float (float)' <col:63> Decl='__builtin_fabsf' 0x2409840))
(DeclRefExpr 0x24098a0 'float' <col:79> Decl='__x' 0x2409810))
(CallExpr 0x24099c0 'float' <col:87, col:102>
(ImplicitCastExpr 0x2409870 'float (*)(void)' <col:87>
(DeclRefExpr 0x2409980 'float (void)' <col:87> Decl='__builtin_inff' 0x2409940))))))

where it only prints filename/line# if it changes from the previous value. We
really need loc info on stmts though, like we have on exprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41602 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
e300c870f08d08badf2ebcb53ded49f304af37fc 30-Aug-2007 Chris Lattner <sabre@nondot.org> Teach the stmtdumper to dump location/range info when a SourceMgr is available.
For example, -parse-ast-dump now prints:

static inline int __inline_isinff(float __x)
(CompoundStmt 0x2409a20
(ReturnStmt 0x2409a10
(BinaryOperator 0x24099f0 'int' <///usr/include/architecture/i386/math.h:183:63, col:102> '=='
(CallExpr 0x24098f0 'float' <col:63, col:82>
(ImplicitCastExpr 0x24098e0 'float (*)(float)' <col:63>
(DeclRefExpr 0x2409880 'float (float)' <col:63> Decl='__builtin_fabsf' 0x2409840))
(DeclRefExpr 0x24098a0 'float' <col:79> Decl='__x' 0x2409810))
(CallExpr 0x24099c0 'float' <col:87, col:102>
(ImplicitCastExpr 0x2409870 'float (*)(void)' <col:87>
(DeclRefExpr 0x2409980 'float (void)' <col:87> Decl='__builtin_inff' 0x2409940))))))

where it only prints filename/line# if it changes from the previous value. We
really need loc info on stmts though, like we have on exprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41602 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
83c13010359c33354c581acee65d0c986a75247e 30-Aug-2007 Steve Naroff <snaroff@apple.com> Fix the following redefinition errors submitted by Keith Bauer...

[dylan:~/llvm/tools/clang] admin% cat tentative_decls.c
// incorrectly generates redefinition error
extern int array[3];
int array[3];

// incorrectly generates a redefinition error
extern void nup(int a[3]);
void nup(int a[3]) {}

It turns out that this exposed a fairly major flaw in the type system,
array types were never getting uniqued! This is because all array types
contained an expression, which aren't unique.

To solve this, we now have 2 array types, ConstantArrayType and
VariableArrayType. ConstantArrayType's are unique, VAT's aren't.

This is a fairly extensive set of fundamental changes. Fortunately,
all the tests pass. Nevertheless, there may be some collateral damage:-)
If so, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41592 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
fb22d96692c5240fb8d611290dbf7eeed3759c73 30-Aug-2007 Steve Naroff <snaroff@apple.com> Fix the following redefinition errors submitted by Keith Bauer...

[dylan:~/llvm/tools/clang] admin% cat tentative_decls.c
// incorrectly generates redefinition error
extern int array[3];
int array[3];

// incorrectly generates a redefinition error
extern void nup(int a[3]);
void nup(int a[3]) {}

It turns out that this exposed a fairly major flaw in the type system,
array types were never getting uniqued! This is because all array types
contained an expression, which aren't unique.

To solve this, we now have 2 array types, ConstantArrayType and
VariableArrayType. ConstantArrayType's are unique, VAT's aren't.

This is a fairly extensive set of fundamental changes. Fortunately,
all the tests pass. Nevertheless, there may be some collateral damage:-)
If so, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41592 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
bbc51adc4e01ab1bda471ac39ab924c4fd7ee316 30-Aug-2007 Chris Lattner <sabre@nondot.org> Allow a SourceManager to optionally be passed into Stmt::dump


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41588 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
0c727a35718556866a978f64ac549d9798735f08 30-Aug-2007 Chris Lattner <sabre@nondot.org> Allow a SourceManager to optionally be passed into Stmt::dump


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41588 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ec055e1daa47fad09e4a430ab2926c48a35bf2c1 30-Aug-2007 Ted Kremenek <kremenek@apple.com> Added an (optional) explicit "Label" statement to CFGBlock. If a
block begins with a label or case statement, CFGBlock::getLabel() will
return the corresponding LabelStmt/CaseStmt/DefaultStmt.

LabelStmts and SwitchCases no longer appear within the "executable"
statements of a CFGBlock.

More cleanups on visualization/pretty-printing of CFGs (less verbose).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41585 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
9cffe7366ea3beb33c2d58f43a8c3a04c1873e11 30-Aug-2007 Ted Kremenek <kremenek@apple.com> Added an (optional) explicit "Label" statement to CFGBlock. If a
block begins with a label or case statement, CFGBlock::getLabel() will
return the corresponding LabelStmt/CaseStmt/DefaultStmt.

LabelStmts and SwitchCases no longer appear within the "executable"
statements of a CFGBlock.

More cleanups on visualization/pretty-printing of CFGs (less verbose).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41585 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
b3bb91b8e968ca4e40567de7809306cc61a0163b 29-Aug-2007 Ted Kremenek <kremenek@apple.com> Added GraphTraits to source-level CFGs (CFG and CFGBlock) to allow
(LLVM-provided) graph algorithms such as DFS and graph visualization
to work effortless on source-level CFGs.

Further cleanup on pretty printing of CFGs. CFGBlock::dump and
CFGBlock::print now take the parent CFG as an argument. This allows
CFGBlocks to print their own appropriate label indicating whether or
not they are the Entry/Exit/IndirectGotoBlock without the CFG::print
routine doing it instead.

Added Graphviz visualization for CFGs: CFG::viewCFG. This employs the
GraphTraits just implemented.

Added "-view-cfg" mode the to clang driver. This is identical to
"-dump-cfg" except that it calls Graphviz to visualize the CFGs
instead of dumping them to the terminal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41580 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
7dba8607e59096014b7139ff20ef00870041d518 29-Aug-2007 Ted Kremenek <kremenek@apple.com> Added GraphTraits to source-level CFGs (CFG and CFGBlock) to allow
(LLVM-provided) graph algorithms such as DFS and graph visualization
to work effortless on source-level CFGs.

Further cleanup on pretty printing of CFGs. CFGBlock::dump and
CFGBlock::print now take the parent CFG as an argument. This allows
CFGBlocks to print their own appropriate label indicating whether or
not they are the Entry/Exit/IndirectGotoBlock without the CFG::print
routine doing it instead.

Added Graphviz visualization for CFGs: CFG::viewCFG. This employs the
GraphTraits just implemented.

Added "-view-cfg" mode the to clang driver. This is identical to
"-dump-cfg" except that it calls Graphviz to visualize the CFGs
instead of dumping them to the terminal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41580 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
bbe686be29157b575e53fbed328613117b525f26 29-Aug-2007 Chris Lattner <sabre@nondot.org> Teach Type::is[un]SignedIntegerType about enum decls. This allows the code generator
to emit signed comparisons when needed for enum decl references. This implements
test/CodeGen/enum.c. I think enums should be good now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41572 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
d5bbce4382622feb4ca5978c4bb8fcceb7aaec00 29-Aug-2007 Chris Lattner <sabre@nondot.org> Teach Type::is[un]SignedIntegerType about enum decls. This allows the code generator
to emit signed comparisons when needed for enum decl references. This implements
test/CodeGen/enum.c. I think enums should be good now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41572 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e0d976993a47507ddb565c660ed95845600cee34 29-Aug-2007 Chris Lattner <sabre@nondot.org> add some accessors



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41570 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
293c0baa7db9a338c7478a04457dc6801af5d308 29-Aug-2007 Chris Lattner <sabre@nondot.org> add some accessors



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41570 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d1ad6ae336bfad6062147f187b9973d47a3c355b 28-Aug-2007 Steve Naroff <snaroff@apple.com> Finish converting decls over to the new invalid decl API.

Also removed an old FIXME (FIXME: "auto func();" passes through...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41555 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5912a3544e438a92832b8c52c13f48d4f54795dc 28-Aug-2007 Steve Naroff <snaroff@apple.com> Finish converting decls over to the new invalid decl API.

Also removed an old FIXME (FIXME: "auto func();" passes through...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41555 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
0edd3a990acf17ccdde8d3e6e15caf324e302b57 28-Aug-2007 Ted Kremenek <kremenek@apple.com> Added support for indirect-gotos (GCC extension) in source-level CFGs.
This involves the construction of a specialized "dispatch" block that
all basic blocks containing indirect gotos unconditionally transfer
control-flow to. The successors of the dispatch block has as its successors
all of the blocks containing labels whose address was taken somewhere in
the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41554 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
19bb356317952445b03ee341c02f6147083c9eea 28-Aug-2007 Ted Kremenek <kremenek@apple.com> Added support for indirect-gotos (GCC extension) in source-level CFGs.
This involves the construction of a specialized "dispatch" block that
all basic blocks containing indirect gotos unconditionally transfer
control-flow to. The successors of the dispatch block has as its successors
all of the blocks containing labels whose address was taken somewhere in
the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41554 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
cae537d8b590de1e8cd0247563703188789c9c2d 28-Aug-2007 Steve Naroff <snaroff@apple.com> Move the "invalid decl" idiom up to Decl (where we have some bits to steal:-)

Converted ParmVarDecl, FileVarDecl, BlockVarDecl, and Sema::ParseIdentifierExpr() to use the idiom.

Updated array-constraint.c to make sure we no longer get "undeclared identifier" errors:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41552 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
53a3234f4bc3fd5c7e2403321bff9c907e1f2de6 28-Aug-2007 Steve Naroff <snaroff@apple.com> Move the "invalid decl" idiom up to Decl (where we have some bits to steal:-)

Converted ParmVarDecl, FileVarDecl, BlockVarDecl, and Sema::ParseIdentifierExpr() to use the idiom.

Updated array-constraint.c to make sure we no longer get "undeclared identifier" errors:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41552 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
f420df1c16b610f6741168d5ac5dbb8b677c7311 28-Aug-2007 Chris Lattner <sabre@nondot.org> add a sourcelocation to binary operator to keep track of the location of the operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41550 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
17d1b2ac9f8371a0a2e79d4f8e0008658164f080 28-Aug-2007 Chris Lattner <sabre@nondot.org> add a sourcelocation to binary operator to keep track of the location of the operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41550 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
90a018d9bb3d506fb9c240135fd76f4d4fccac05 28-Aug-2007 Chris Lattner <sabre@nondot.org> Change EnumDecl to store its corresponding integer type
directly in it. Remove TargetInfo::getEnumPolicy, as there is only
one policy that we support right now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41548 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
e00b18cfc3967a0349745055b49d0f3196d28f75 28-Aug-2007 Chris Lattner <sabre@nondot.org> Change EnumDecl to store its corresponding integer type
directly in it. Remove TargetInfo::getEnumPolicy, as there is only
one policy that we support right now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41548 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecl.h
2b8d885f5b49ff8714ebde12073f558e3376e317 28-Aug-2007 Chris Lattner <sabre@nondot.org> remove dead method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41531 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
050785860b8541c837982beef3f06d292d1d0c1d 28-Aug-2007 Chris Lattner <sabre@nondot.org> remove dead method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41531 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
91b03f7ab33aa738411a4aab073d4965726b642e 28-Aug-2007 Steve Naroff <snaroff@apple.com> Implement more thoughful error recovery when dealing with bogus declarator types.

For example, the following code was resulting in spurious warnings. This was the result of
Sema::GetTypeForDeclarator() synthesizing a type to hand back to the caller (in this case,
"int []", instead of "struct s[]", which is invalid).

struct s;
struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}}
return z;
}

Strategy: Flag the error in Declarator/DeclaratorChunk. This info is later stored in
the ParmVarDecl. If the decl is referenced, Sema::ParseIdentifierExpr() will check if
the type is invalid. If so, it quietly returns "true", without instantiating a DeclRefExpr.

This seems to work nicely. If Chris is happy with the approach, I will generalize this to
all VarDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41521 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e1223f7246c2c297f7b62816fd8c6a0a14151977 28-Aug-2007 Steve Naroff <snaroff@apple.com> Implement more thoughful error recovery when dealing with bogus declarator types.

For example, the following code was resulting in spurious warnings. This was the result of
Sema::GetTypeForDeclarator() synthesizing a type to hand back to the caller (in this case,
"int []", instead of "struct s[]", which is invalid).

struct s;
struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}}
return z;
}

Strategy: Flag the error in Declarator/DeclaratorChunk. This info is later stored in
the ParmVarDecl. If the decl is referenced, Sema::ParseIdentifierExpr() will check if
the type is invalid. If so, it quietly returns "true", without instantiating a DeclRefExpr.

This seems to work nicely. If Chris is happy with the approach, I will generalize this to
all VarDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41521 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6f1231830505f26b31dcb52c1e4e2b9fef648441 27-Aug-2007 Chris Lattner <sabre@nondot.org> constify some stuff



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41503 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
fb071532de6ebd5685de34d65a5440604ee570bb 27-Aug-2007 Chris Lattner <sabre@nondot.org> constify some stuff



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41503 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
eb56d2997a2f6751afa78a2f6cefc5cbda1c1ad2 27-Aug-2007 Chris Lattner <sabre@nondot.org> implement sizeof(enum x), patch inspired by Keith Bauer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41500 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
6cd862c631eb4fc10755c146bbeaea37c330e815 27-Aug-2007 Chris Lattner <sabre@nondot.org> implement sizeof(enum x), patch inspired by Keith Bauer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41500 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
86630055ef3c9c06e51bfd1dc2224efc1b53d9e6 27-Aug-2007 Chris Lattner <sabre@nondot.org> add some accessors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41496 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5ae962da4dc277f1819a00361d4dcd49dc66bd89 27-Aug-2007 Chris Lattner <sabre@nondot.org> add some accessors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41496 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
45fc9823e1978b227826409ffa8d54e7e0facf1f 27-Aug-2007 Steve Naroff <snaroff@apple.com> Replaced ASTContext::maxFloatingType() with ASTContext::compareFloatingType().

Changed Sema::UsualArithmeticConversions to use the new API.

This fixes the following case...

_Complex double X;
double y;

void foo() {
X = X + y;
}

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang complex.c -parse-ast-dump
Read top-level variable decl: 'X'
Read top-level variable decl: 'y'

void foo()
(CompoundStmt 0x2605cc0
(BinaryOperator 0x2605ca0 '_Complex double' '='
(DeclRefExpr 0x2605c10 '_Complex double' Decl='X' 0x2605ab0)
(BinaryOperator 0x2605c80 '_Complex double' '+'
(DeclRefExpr 0x2605c30 '_Complex double' Decl='X' 0x2605ab0)
(ImplicitCastExpr 0x2605c70 '_Complex double'
(DeclRefExpr 0x2605c50 'double' Decl='y' 0x2605ae0)))))



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41483 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
fb0d49669aa370b4c0993c5cee60275ef9fd6518 27-Aug-2007 Steve Naroff <snaroff@apple.com> Replaced ASTContext::maxFloatingType() with ASTContext::compareFloatingType().

Changed Sema::UsualArithmeticConversions to use the new API.

This fixes the following case...

_Complex double X;
double y;

void foo() {
X = X + y;
}

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang complex.c -parse-ast-dump
Read top-level variable decl: 'X'
Read top-level variable decl: 'y'

void foo()
(CompoundStmt 0x2605cc0
(BinaryOperator 0x2605ca0 '_Complex double' '='
(DeclRefExpr 0x2605c10 '_Complex double' Decl='X' 0x2605ab0)
(BinaryOperator 0x2605c80 '_Complex double' '+'
(DeclRefExpr 0x2605c30 '_Complex double' Decl='X' 0x2605ab0)
(ImplicitCastExpr 0x2605c70 '_Complex double'
(DeclRefExpr 0x2605c50 'double' Decl='y' 0x2605ae0)))))



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41483 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
c33c060e2f4e7c7e89e3b809f52cfc6d55ea9838 27-Aug-2007 Steve Naroff <snaroff@apple.com> Add Type::getAsBuiltinType() and Type::builtinTypesAreCompatible().
Modified Type::typesAreCompatible() to use the above.

This fixes the following bug submitted by Keith Bauer (thanks!).

int equal(char *a, const char *b)
{
return a == b;
}

Also tweaked Sema::CheckCompareOperands() to ignore the qualifiers when
comparing two pointer types (though it doesn't relate directly to this bug).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41476 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
77878cc5aa6ad01fc0c91bac1a61819dbf3bf691 27-Aug-2007 Steve Naroff <snaroff@apple.com> Add Type::getAsBuiltinType() and Type::builtinTypesAreCompatible().
Modified Type::typesAreCompatible() to use the above.

This fixes the following bug submitted by Keith Bauer (thanks!).

int equal(char *a, const char *b)
{
return a == b;
}

Also tweaked Sema::CheckCompareOperands() to ignore the qualifiers when
comparing two pointer types (though it doesn't relate directly to this bug).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41476 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fa0c453f572da6441d5a5997025bf0301d471b3b 27-Aug-2007 Steve Naroff <snaroff@apple.com> Tweak a comment and assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
716c7304ff5d27a95e1e7823acd1d09d5ec3e37f 27-Aug-2007 Steve Naroff <snaroff@apple.com> Tweak a comment and assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41475 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
3cf497f1272a7f6ca5066af13db1a7adbba81a7a 27-Aug-2007 Steve Naroff <snaroff@apple.com> Replaced ASTContext::maxComplexType() with ASTContext::getFloatingTypeOfSizeWithinDomain().

Changed Sema::UsualArithmeticConversions to correctly implement complex/float conversions,
using maxFloatingType() with getFloatingTypeOfSizeWithinDomain().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41474 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
f1448a0e4a1e868ff873a8530a61a09cb68666cc 27-Aug-2007 Steve Naroff <snaroff@apple.com> Replaced ASTContext::maxComplexType() with ASTContext::getFloatingTypeOfSizeWithinDomain().

Changed Sema::UsualArithmeticConversions to correctly implement complex/float conversions,
using maxFloatingType() with getFloatingTypeOfSizeWithinDomain().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41474 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
4716005144b12ee54ece88667eaacfecafdd03ab 27-Aug-2007 Chris Lattner <sabre@nondot.org> If a visitor doesn't define VisitBinMulAssign, fallback to VisitCompoundAssignOperator
instead of VisitBinaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41462 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
61919a125a9422002588a7b59e9d1df70089ee17 27-Aug-2007 Chris Lattner <sabre@nondot.org> If a visitor doesn't define VisitBinMulAssign, fallback to VisitCompoundAssignOperator
instead of VisitBinaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41462 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
26d8315f8ded4b34bd43990998f18f4cf91c4020 26-Aug-2007 Chris Lattner <sabre@nondot.org> dispatch to functions like VisitBinRemAssign with knowledge that
the operand is of type CompoundAssignOperator, not just BinaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41459 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
402f72f83f433a4b45bcad0c35f4d9f692b6a0fd 26-Aug-2007 Chris Lattner <sabre@nondot.org> dispatch to functions like VisitBinRemAssign with knowledge that
the operand is of type CompoundAssignOperator, not just BinaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41459 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
42deafb3a1fb04cab328b4400b90392746fb66f2 26-Aug-2007 Chris Lattner <sabre@nondot.org> Why didn't gcc catch this? :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41420 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
d3f6ca6942169131ce55dac18366d80f0393ed4f 26-Aug-2007 Chris Lattner <sabre@nondot.org> Why didn't gcc catch this? :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41420 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c7ac5ed8019764850639ece242b43bd8bdd5304e 26-Aug-2007 Chris Lattner <sabre@nondot.org> fix a bug introduced by the recent childification of ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41417 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
af458c9f658335bdea482395ff4a25c75935e129 26-Aug-2007 Chris Lattner <sabre@nondot.org> fix a bug introduced by the recent childification of ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41417 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
987058afafa52e7cca35fd27100a385b7be53b8c 26-Aug-2007 Chris Lattner <sabre@nondot.org> Make parse-ast-print print the storage class and inline
specifier of functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41416 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
70c8b2eccc9f1739a85cea9c4776b6b4c130071c 26-Aug-2007 Chris Lattner <sabre@nondot.org> Make parse-ast-print print the storage class and inline
specifier of functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41416 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
1de66eb40361fa106b7cbe7f7095d9392ebb24ae 26-Aug-2007 Chris Lattner <sabre@nondot.org> add a new ImaginaryLiteral AST node that is used to
represent imaginary literals:

float _Complex A;
void foo() {
A = 1.0iF;
}

generates:

(BinaryOperator 0x2305ec0 '_Complex float' '='
(DeclRefExpr 0x2305e60 '_Complex float' Decl='A' 0x2305cf0)
(ImaginaryLiteral 0x2305f40 '_Complex float'
(FloatingLiteral 0x2305ea0 'float' 1.000000))))



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41413 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
5d66145eed1c319df5a69977cb8ff74f597ea544 26-Aug-2007 Chris Lattner <sabre@nondot.org> add a new ImaginaryLiteral AST node that is used to
represent imaginary literals:

float _Complex A;
void foo() {
A = 1.0iF;
}

generates:

(BinaryOperator 0x2305ec0 '_Complex float' '='
(DeclRefExpr 0x2305e60 '_Complex float' Decl='A' 0x2305cf0)
(ImaginaryLiteral 0x2305f40 '_Complex float'
(FloatingLiteral 0x2305ea0 'float' 1.000000))))



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41413 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
ac5d4f13e3dd13d6e26cd8e4cbf41ec4623561ef 25-Aug-2007 Steve Naroff <snaroff@apple.com> Give CXXBoolLiteralExpr a type (all expressions need a valid type).

This fixes the following:

******************** TEST 'Parser/cxx-bool.cpp' FAILED! ********************
Command:
clang -fsyntax-only Parser/cxx-bool.cpp
Output:
SemaExpr.cpp:731: failed assertion `!t.isNull() && "DefaultFunctionArrayConversion - missing type"'
Output/cxx-bool.cpp.out.script: line 1: 22697 Abort trap clang -fsyntax-only Parser/cxx-bool.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41401 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
210679cacc47640107e46090de1a138977a0431e 25-Aug-2007 Steve Naroff <snaroff@apple.com> Give CXXBoolLiteralExpr a type (all expressions need a valid type).

This fixes the following:

******************** TEST 'Parser/cxx-bool.cpp' FAILED! ********************
Command:
clang -fsyntax-only Parser/cxx-bool.cpp
Output:
SemaExpr.cpp:731: failed assertion `!t.isNull() && "DefaultFunctionArrayConversion - missing type"'
Output/cxx-bool.cpp.out.script: line 1: 22697 Abort trap clang -fsyntax-only Parser/cxx-bool.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41401 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
06078d28fdbd047463840f78986c3193e14007af 25-Aug-2007 Chris Lattner <sabre@nondot.org> Split the ASTNode out for compound assignments out from binary operators. Now
they show up in dumps etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41393 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
eb14fe839ec24c2ca14e5f094be147a34e3d3339 25-Aug-2007 Chris Lattner <sabre@nondot.org> Split the ASTNode out for compound assignments out from binary operators. Now
they show up in dumps etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41393 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
d10426a074d37ef9ff0bf20b9fee807ee906c79d 25-Aug-2007 Chris Lattner <sabre@nondot.org> Fix clang -parse-ast-dump carbon.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41391 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
94f67810bcbdff4cef9177f7727caf91f3e1efa1 25-Aug-2007 Chris Lattner <sabre@nondot.org> Fix clang -parse-ast-dump carbon.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41391 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
03931a70695381cc41ae6f19ddc880d0b2d33cae 24-Aug-2007 Chris Lattner <sabre@nondot.org> Implement sema support for __real/__imag nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41375 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
dbb36971c68ea944ac4b1fbe2d97fe7cca3b20ac 24-Aug-2007 Chris Lattner <sabre@nondot.org> Implement sema support for __real/__imag nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41375 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
51be056a9c4fbb98da0a457eb4b52f34d76ba9e8 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Added child_begin/child_end to all subclasses of Stmt in Stmt.h. All
concrete subclasses of Stmt are now required to implement
child_begin/child_end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41374 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8297777fbe19c4d39e8a70c55346474868055fa1 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Added child_begin/child_end to all subclasses of Stmt in Stmt.h. All
concrete subclasses of Stmt are now required to implement
child_begin/child_end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41374 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
3cb01e268be3307b41932fa118e2c88babbfb551 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Implemented child_begin/child_end for our current set of C++ expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41368 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
c10d33c01478f2444b2b87aefa090493f028d2d5 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Implemented child_begin/child_end for our current set of C++ expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41368 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
9fdc8a9aba187772c470e52314fce5d1c5b42647 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Finished adding child_begin/child_end to all subclasses of Stmt in Expr.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41366 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1237c673c07f9d827129ba02720108816abde562 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Finished adding child_begin/child_end to all subclasses of Stmt in Expr.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41366 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
8f708368adf41c6b1ee0e028b574232d609f4e8b 24-Aug-2007 Steve Naroff <snaroff@apple.com> Surpress ImplicitCastExprs for compound assignment expressions. For compound assignments,
it is o.k. for the LHS and RHS to have different types. Converting the type can cause
errors like the one Chris noticed (below).

This change required a fair number of diffs (since there is a lot of shared code
between single and compound assignments). This makes the API's look a bit uglier,
however I couldn't think of a better way to do it (without duplicating code).

Fix the following (incorrect) error:

int A;
long long B;

void foo() {
A /= B;
}

$ clang ~/scalar.c -emit-llvm
/Users/sabre/scalar.c:6:5: error: expression is not assignable
A /= B;
~ ^

Now it works properly...

[dylan:~/llvm/tools/clang] admin% cat compound.c
int A;
long long B;

void foo() {
A /= B;
}
[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang compound.c -parse-ast-dump
Read top-level variable decl: 'A'
Read top-level variable decl: 'B'

void foo()
(CompoundStmt 0x2605c40
(BinaryOperator 0x2605c20 'int' '/=' ComputeTy='long long'
(DeclRefExpr 0x2605be0 'int' Decl='A' 0x2605a80)
(DeclRefExpr 0x2605c00 'long long' Decl='B' 0x2605ab0)))




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41364 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
9f5fa9bfc37c3e15895cd777e42f3dd8a7ec7a9d 24-Aug-2007 Steve Naroff <snaroff@apple.com> Surpress ImplicitCastExprs for compound assignment expressions. For compound assignments,
it is o.k. for the LHS and RHS to have different types. Converting the type can cause
errors like the one Chris noticed (below).

This change required a fair number of diffs (since there is a lot of shared code
between single and compound assignments). This makes the API's look a bit uglier,
however I couldn't think of a better way to do it (without duplicating code).

Fix the following (incorrect) error:

int A;
long long B;

void foo() {
A /= B;
}

$ clang ~/scalar.c -emit-llvm
/Users/sabre/scalar.c:6:5: error: expression is not assignable
A /= B;
~ ^

Now it works properly...

[dylan:~/llvm/tools/clang] admin% cat compound.c
int A;
long long B;

void foo() {
A /= B;
}
[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang compound.c -parse-ast-dump
Read top-level variable decl: 'A'
Read top-level variable decl: 'B'

void foo()
(CompoundStmt 0x2605c40
(BinaryOperator 0x2605c20 'int' '/=' ComputeTy='long long'
(DeclRefExpr 0x2605be0 'int' Decl='A' 0x2605a80)
(DeclRefExpr 0x2605c00 'long long' Decl='B' 0x2605ab0)))




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41364 91177308-0d34-0410-b5e6-96231b3b80d8
tmtNodes.def
e4acb9c47c9ab4d2e9d5cff04735dcbd59ac84c0 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Began implementing "child iterator" interface for Stmts and Exprs. Each
subclass of Stmt will implement child_begin() and child_end(), which will
be used to iterate over all the children (subexpressions/substatements) of
a Stmt object. This will provide for easy traversal over the AST, which
is useful for a variety of purposes.

None of the interfaces to subclasses of Stmt will be changed (other than
adding the child_begin and child_end methods).

The only caveat is that the implementation of subclasses of Stmt will require
colocating all substatements (subexpressions) in an array. This is because
we define child_iterator as Stmt**. All accessor methods to subexpressions
will need to be altered to reflect this new implementation.

This patch includes the typedefs for child_iterator, as well the implementation
for child_begin/child_end for the primary expressions and some postfix
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41363 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
77ed8e4edf6ed78c53fb20ec3210aff2a59c9d87 24-Aug-2007 Ted Kremenek <kremenek@apple.com> Began implementing "child iterator" interface for Stmts and Exprs. Each
subclass of Stmt will implement child_begin() and child_end(), which will
be used to iterate over all the children (subexpressions/substatements) of
a Stmt object. This will provide for easy traversal over the AST, which
is useful for a variety of purposes.

None of the interfaces to subclasses of Stmt will be changed (other than
adding the child_begin and child_end methods).

The only caveat is that the implementation of subclasses of Stmt will require
colocating all substatements (subexpressions) in an array. This is because
we define child_iterator as Stmt**. All accessor methods to subexpressions
will need to be altered to reflect this new implementation.

This patch includes the typedefs for child_iterator, as well the implementation
for child_begin/child_end for the primary expressions and some postfix
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41363 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
320956f9547c896722ce891d4b9ab2a84d10cc32 23-Aug-2007 Ted Kremenek <kremenek@apple.com> Refactored "getSubStmt" and "SubStmt" from the CaseStmt and DefaultStmt
class to their common parent class SwitchCase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41329 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
edcc752060be38bfa7e7b32691c0cc4d843622a8 23-Aug-2007 Ted Kremenek <kremenek@apple.com> Refactored "getSubStmt" and "SubStmt" from the CaseStmt and DefaultStmt
class to their common parent class SwitchCase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41329 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
ff2a8c57663f8976360916f3cea8ea6601efa7a3 23-Aug-2007 Ted Kremenek <kremenek@apple.com> Modified CFG to have explicit "Exit" pointer for exit block. This should
have been committed with my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41324 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
504927ac167053f3b5c2ae38c7ee3fa55bbf3a6c 23-Aug-2007 Ted Kremenek <kremenek@apple.com> Modified CFG to have explicit "Exit" pointer for exit block. This should
have been committed with my previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41324 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
2e41cb30170a23478ee199c5ce8484f697c17370 22-Aug-2007 Ted Kremenek <kremenek@apple.com> Added explicit pointer within class CFG to the Entry block.
Before we assumed that the first block in the list of blocks was the entry
block, but this has posed hurdles during CFG construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41293 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
fa2be43dbd6fdc4414e261db69aaf35dfb21a416 22-Aug-2007 Ted Kremenek <kremenek@apple.com> Added explicit pointer within class CFG to the Entry block.
Before we assumed that the first block in the list of blocks was the entry
block, but this has posed hurdles during CFG construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41293 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
8be1d4083346393791752ecec48c99e499bd252a 22-Aug-2007 Anders Carlsson <andersca@mac.com> Parse @encode expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41273 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
f9bcf01f82dfd2688f81e57bcc6300c9b13c51a6 22-Aug-2007 Anders Carlsson <andersca@mac.com> Parse @encode expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41273 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
c5de2228fbca2371924a413536ad11050edc98ad 22-Aug-2007 Ted Kremenek <kremenek@apple.com> Added CFG support for gotos and labels.

Modified CFG so that getEntry(), getExit(), front() and back() return
CFGBlock& instead of CFGBlock*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41258 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
0cebe3e29b22d11f2c65ef28fcfb5f0431877266 22-Aug-2007 Ted Kremenek <kremenek@apple.com> Added CFG support for gotos and labels.

Modified CFG so that getEntry(), getExit(), front() and back() return
CFGBlock& instead of CFGBlock*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41258 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
97f7531cdce6c2e875aaae42195d1724053e9f04 21-Aug-2007 Ted Kremenek <kremenek@apple.com> Added CFG infrastructure (CFG.cpp and CFG.h) for clang ASTs.

Added builder code to translate ASTs to CFGs. This currently supports
if, return, and non-control flow statements.

Added pretty-printer to debug CFGs.

Added a "-dump-cfg" option to the clang driver to dump CFGs for code
sent through the frontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41252 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
fddd51853f8ccaa1df2476376e6fd74d2f315c73 21-Aug-2007 Ted Kremenek <kremenek@apple.com> Added CFG infrastructure (CFG.cpp and CFG.h) for clang ASTs.

Added builder code to translate ASTs to CFGs. This currently supports
if, return, and non-control flow statements.

Added pretty-printer to debug CFGs.

Added a "-dump-cfg" option to the clang driver to dump CFGs for code
sent through the frontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41252 91177308-0d34-0410-b5e6-96231b3b80d8
FG.h
26116566c7e9a4d286c65fd2c0b81765a9ce0b21 21-Aug-2007 Ted Kremenek <kremenek@apple.com> Added reverse iterators for the body of CompountStmt. These are useful for
CFG construction (among other potential uses).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41248 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
4ce854736dd196e2304f554ebeac8b43c89cf9e2 21-Aug-2007 Ted Kremenek <kremenek@apple.com> Added reverse iterators for the body of CompountStmt. These are useful for
CFG construction (among other potential uses).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41248 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
94ac052f0a7c16f1265d1e39158be86129991837 21-Aug-2007 Chris Lattner <sabre@nondot.org> add unary operator support to the stmtvisitor



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtVisitor.h
13d130c3d225cdb5b1e6d9e86cea12eea718c707 21-Aug-2007 Chris Lattner <sabre@nondot.org> add unary operator support to the stmtvisitor



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41242 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtVisitor.h
a66cad4cbdef80f34d163983e1d7a79c4cfc5c19 21-Aug-2007 Anders Carlsson <andersca@mac.com> Implement parsing and code generation of Objective-C string literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41238 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
5508518a2702b00be3b15a26d772bde968972f54 21-Aug-2007 Anders Carlsson <andersca@mac.com> Implement parsing and code generation of Objective-C string literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41238 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
7a85fa1ba94c9f4cf960463dd3eb444ef6f89446 21-Aug-2007 Chris Lattner <sabre@nondot.org> add getAsComplexType() for consistency


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41229 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c6fb90a7246c2d5d3233e70107bf9d8c7c9e535b 21-Aug-2007 Chris Lattner <sabre@nondot.org> add getAsComplexType() for consistency


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41229 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fb3befa4a5029542a98b14395c714637e988759a 21-Aug-2007 Chris Lattner <sabre@nondot.org> Add the comparisons and logical binops to the visitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41227 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
2d5049fcbb4cb9b67086de32b806fffd9f856e30 21-Aug-2007 Chris Lattner <sabre@nondot.org> Add the comparisons and logical binops to the visitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41227 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
76cb1893629e72f4781b3c308aa8fd554be39d58 21-Aug-2007 Chris Lattner <sabre@nondot.org> Add the ability to visit binary operators without having to
match on binop then explicitly switching again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41214 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtVisitor.h
03d6fb99224c36935c9af9f4785cb33453c99b2b 21-Aug-2007 Chris Lattner <sabre@nondot.org> Add the ability to visit binary operators without having to
match on binop then explicitly switching again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41214 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtVisitor.h
66ef2b998a19aadfa01bfec702a8263a81feac84 21-Aug-2007 Chris Lattner <sabre@nondot.org> Now that the visitor is defined in one place, it is nice and easy to allow clients
to have visitors that return non-void.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41212 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
e12b4301820bbae6b67a88fa98617dc571331555 21-Aug-2007 Chris Lattner <sabre@nondot.org> Now that the visitor is defined in one place, it is nice and easy to allow clients
to have visitors that return non-void.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41212 91177308-0d34-0410-b5e6-96231b3b80d8
tmtVisitor.h
7ba21fafbb3cd2958bcdcfaf05a213086c185a27 21-Aug-2007 Chris Lattner <sabre@nondot.org> Switch StmtVisitor from using dynamic to static dispatch. This makes it
significantly faster and actually reduces the amount of code in the system.
This also allows for future visitor changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41211 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
tmt.h
tmtVisitor.h
c5598cbc4c3f2fb515af7f142f78ff630bdb5c01 21-Aug-2007 Chris Lattner <sabre@nondot.org> Switch StmtVisitor from using dynamic to static dispatch. This makes it
significantly faster and actually reduces the amount of code in the system.
This also allows for future visitor changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41211 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
xprCXX.h
tmt.h
tmtVisitor.h
1c1700f559db902f4c170a5aa0d0d697e06c2fa0 20-Aug-2007 Ted Kremenek <kremenek@apple.com> Modified ArraySubscriptExpr to have accessors getLHS and getRHS in addition
to getBase and getIdx. getBase and getIdx now return a "normalized" view
of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS
and getRHS return the expressions with syntactic fidelity to the original
source code.

Also modified client code of ArraySubscriptExpr, including the AST dumper
and pretty printer, the return-stack value checker, and the LLVM code
generator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41180 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
2324512285caac0332bbbc6e4cab6245d2a370a1 20-Aug-2007 Ted Kremenek <kremenek@apple.com> Modified ArraySubscriptExpr to have accessors getLHS and getRHS in addition
to getBase and getIdx. getBase and getIdx now return a "normalized" view
of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS
and getRHS return the expressions with syntactic fidelity to the original
source code.

Also modified client code of ArraySubscriptExpr, including the AST dumper
and pretty printer, the return-stack value checker, and the LLVM code
generator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41180 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1fadcd86b36392e4f31569c22a4a2d2eef6119a9 18-Aug-2007 Ted Kremenek <kremenek@apple.com> Fixed bug in VarDecl::hasAutoStorage: function parameters implicitly have
auto storage, but this routine would incorrectly return false.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41162 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
602f754796e00662445d58e1263d168f2b13490a 18-Aug-2007 Ted Kremenek <kremenek@apple.com> Fixed bug in VarDecl::hasAutoStorage: function parameters implicitly have
auto storage, but this routine would incorrectly return false.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41162 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
e7e7aa2c1a2d87e2ac26da4645dd881f66f24763 17-Aug-2007 Anders Carlsson <andersca@mac.com> Add initial support for constant CFStrings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41136 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
uiltins.def
71993dd85eed9cc42c6b2fa61ee5c53026b74817 17-Aug-2007 Anders Carlsson <andersca@mac.com> Add initial support for constant CFStrings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41136 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
uiltins.def
43a30985dfd581255d367932c960e9bd428fbc8a 16-Aug-2007 Ted Kremenek <kremenek@apple.com> Added a comment to ArraySubscriptExpr to note that the expressions like
"A[4]" are equivalent to "4[A]", and that a test that the expression
returned by "getBase()" has a pointer type is required to resolve which
subexpression is the "true" base expression of the array index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41113 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
fc4a1601a84d280d7e5c424b77843fdd743beec8 16-Aug-2007 Ted Kremenek <kremenek@apple.com> Added a comment to ArraySubscriptExpr to note that the expressions like
"A[4]" are equivalent to "4[A]", and that a test that the expression
returned by "getBase()" has a pointer type is required to resolve which
subexpression is the "true" base expression of the array index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41113 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5c41c215b79370ae71c45d703aa0dbb71b3eb072 15-Aug-2007 Ted Kremenek <kremenek@apple.com> Added the following utility methods to VarDecl that provide
canonicalized queries of a variable's storage:

hasAutoStorage - Does a variable have (implicit) auto storage?

hasStaticStorage - Does a variable have (implicit) static storage?

hasLocalStorage - Is the variable a non-static local variable?

hasGlobalStorage - Is the variable a global variable or a static
local variable?

Additional comments documenting these functions are included in the
source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41092 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
87ce144920a4f9c4cc8d6b021b1d759d7785317c 15-Aug-2007 Ted Kremenek <kremenek@apple.com> Added the following utility methods to VarDecl that provide
canonicalized queries of a variable's storage:

hasAutoStorage - Does a variable have (implicit) auto storage?

hasStaticStorage - Does a variable have (implicit) static storage?

hasLocalStorage - Is the variable a non-static local variable?

hasGlobalStorage - Is the variable a global variable or a static
local variable?

Additional comments documenting these functions are included in the
source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41092 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5ac50b585c1a9dd73a84db81690f4f4f9f0bf339 14-Aug-2007 Ted Kremenek <kremenek@apple.com> Added documentation to StringLiteral noting that the strings returned by
getStrData() are not null-terminated, and the lengths of these strings should
be determined using getByteLength().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41055 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
e6a82b2c29ad05534841e5f8fd033fb17b6f61e2 14-Aug-2007 Ted Kremenek <kremenek@apple.com> Added documentation to StringLiteral noting that the strings returned by
getStrData() are not null-terminated, and the lengths of these strings should
be determined using getByteLength().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41055 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ac485c1382b200b6d26d23e24adf0d47e5310326 09-Aug-2007 Chris Lattner <sabre@nondot.org> move a switch to common code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40967 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
36460eea641bf20a67b8b767b6d26373a90f0965 09-Aug-2007 Chris Lattner <sabre@nondot.org> move a switch to common code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40967 91177308-0d34-0410-b5e6-96231b3b80d8
xprCXX.h
538590e41d60834560e967650be749112b3bb1ca 09-Aug-2007 Chris Lattner <sabre@nondot.org> minor fixes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
06184086c10c6672f4bcc3630a5a2b0bed048f63 09-Aug-2007 Chris Lattner <sabre@nondot.org> minor fixes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40966 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
95578787e1c051dcec0637fc0a2e2d22c4829a9c 09-Aug-2007 Chris Lattner <sabre@nondot.org> add a new AST dumper interface (E->dump()). This dumps out
the AST in a structural, non-pretty, form useful for understanding
the AST. It isn't quite done yet, but is already somewhat useful.

For this example:

int test(short X, long long Y) {
return X < ((100));
}

we get (with -parse-ast-dump):

int test(short X, long long Y)
(CompoundStmt 0x2905ce0
(ReturnStmt 0x2905cd0
(BinaryOperator 0x2905cb0 '<'
(ImplicitCastExpr 0x2905ca0
(DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0))
(ParenExpr 0x2905c80
(ParenExpr 0x2905c60
(IntegerLiteral 0x2905c40 100))))))




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40954 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
6000dace22f110d8768476989313e9d981d690d0 09-Aug-2007 Chris Lattner <sabre@nondot.org> add a new AST dumper interface (E->dump()). This dumps out
the AST in a structural, non-pretty, form useful for understanding
the AST. It isn't quite done yet, but is already somewhat useful.

For this example:

int test(short X, long long Y) {
return X < ((100));
}

we get (with -parse-ast-dump):

int test(short X, long long Y)
(CompoundStmt 0x2905ce0
(ReturnStmt 0x2905cd0
(BinaryOperator 0x2905cb0 '<'
(ImplicitCastExpr 0x2905ca0
(DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0))
(ParenExpr 0x2905c80
(ParenExpr 0x2905c60
(IntegerLiteral 0x2905c40 100))))))




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40954 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
8d3b170e5cb1700b5cbd227182bc29ca0d16819d 09-Aug-2007 Steve Naroff <snaroff@apple.com> Finish implementing __builtin_classify_type()...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40951 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
13b7c5ff42d6077a8d59e2c9ec9e7fedd0150ae6 09-Aug-2007 Steve Naroff <snaroff@apple.com> Finish implementing __builtin_classify_type()...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40951 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
48a87933ae7a1bfc3cbc43879eba6d3510125e88 08-Aug-2007 Steve Naroff <snaroff@apple.com> Add support for __builtin_classify_type(). This builtin function isn't "public", however
it is used by "tgmath.h" (so we need to support it). It might also come in handy when
developing the overloaded function macros for OpenCU.

Next check-in will make this an integer constant expression...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40930 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
e8770421d8463db203b78eb96f93a75ea5e58346 08-Aug-2007 Steve Naroff <snaroff@apple.com> Add support for __builtin_classify_type(). This builtin function isn't "public", however
it is used by "tgmath.h" (so we need to support it). It might also come in handy when
developing the overloaded function macros for OpenCU.

Next check-in will make this an integer constant expression...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40930 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.def
2e3b1d2ed22e5638fa9c55cc1ea5dac4db6aecdc 07-Aug-2007 Chris Lattner <sabre@nondot.org> add some helpers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40901 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7effa1aceac1219529af23c776835f855b8d905c 07-Aug-2007 Chris Lattner <sabre@nondot.org> add some helpers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40901 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
5e4f6bd2743aeff08f409f198b7ab4422c1a57ca 05-Aug-2007 Steve Naroff <snaroff@apple.com> Make sure the good old "function/array conversion" is done to function parameters.

This resulted in the following error...

[dylan:clang/test/Parser] admin% cat parmvardecl_conversion.c
// RUN: clang -parse-ast-check %s

void f (int p[]) { p++; }

[dylan:clang/test/Parser] admin% clang -parse-ast-check parmvardecl_conversion.c
Errors seen but not expected:
Line 3: cannot modify value of type 'int []'

With this fix, the test case above succeeds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40831 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
69625f4925646669f68caa234cd9133261acaaa1 05-Aug-2007 Steve Naroff <snaroff@apple.com> Make sure the good old "function/array conversion" is done to function parameters.

This resulted in the following error...

[dylan:clang/test/Parser] admin% cat parmvardecl_conversion.c
// RUN: clang -parse-ast-check %s

void f (int p[]) { p++; }

[dylan:clang/test/Parser] admin% clang -parse-ast-check parmvardecl_conversion.c
Errors seen but not expected:
Line 3: cannot modify value of type 'int []'

With this fix, the test case above succeeds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40831 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
4048bab9bc3c0aedfa4d564b709da60135db5218 04-Aug-2007 Chris Lattner <sabre@nondot.org> fix constness issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40798 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
c1b607db38501f73c8e1461fc749a6b0e469f157 04-Aug-2007 Chris Lattner <sabre@nondot.org> fix constness issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40798 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
93c53018b1bf9f4299e1469b4b902da997e14471 03-Aug-2007 Steve Naroff <snaroff@apple.com> Implement __builtin_choose_expr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40794 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
d04fdd5f99f985abf2e7b7d7d4d427eebe001e55 03-Aug-2007 Steve Naroff <snaroff@apple.com> Implement __builtin_choose_expr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40794 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
9ae0ec74e1a444b7eadbffccee8a72b8f638991f 03-Aug-2007 Chris Lattner <sabre@nondot.org> fix a buggy comment I added


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40787 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
dd652cdb7046155437eeb3dff512768f0a57369b 03-Aug-2007 Chris Lattner <sabre@nondot.org> fix a buggy comment I added


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40787 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a0d03a715738f38c1f7a7e8a757eabd629786ab1 03-Aug-2007 Chris Lattner <sabre@nondot.org> Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40785 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
6481a57fefbf1a313ff439028470fe4c27a3b7a3 03-Aug-2007 Chris Lattner <sabre@nondot.org> Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40785 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
5054785f432e9c057af52fafbf01d5167d63ef0d 03-Aug-2007 Chris Lattner <sabre@nondot.org> add OCUVectorComponent::getNumComponents()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40778 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
4d0ac88428b3ed7c6f3a2f4e758ea5424ecd70ae 03-Aug-2007 Chris Lattner <sabre@nondot.org> add OCUVectorComponent::getNumComponents()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40778 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
42158e7b3a95f41d3482f1fb3a67392dbbf745da 03-Aug-2007 Chris Lattner <sabre@nondot.org> Add support for encoding a OCUVectorComponent into a single integer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40768 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
b8f849da3cedee2f61ad98389115ddd04e439d60 03-Aug-2007 Chris Lattner <sabre@nondot.org> Add support for encoding a OCUVectorComponent into a single integer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40768 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
9096b795541c783297fb19684a58c54d0fe823b8 03-Aug-2007 Chris Lattner <sabre@nondot.org> rename some helpers, have them return the idx of the field being accessed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40764 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
88dca0464804b8b26ae605f89784c927e8493ddd 03-Aug-2007 Chris Lattner <sabre@nondot.org> rename some helpers, have them return the idx of the field being accessed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40764 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ea255914df6c2d8fb79de53b5c2728b7b69e0d99 03-Aug-2007 Chris Lattner <sabre@nondot.org> mark some methods static, don't consider a vector to be an ocuvector


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40762 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
667405a3b00b04a36537d3a35ab7bdc6e2dd8c38 03-Aug-2007 Chris Lattner <sabre@nondot.org> mark some methods static, don't consider a vector to be an ocuvector


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40762 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f4bf5510976068f53ef19996aa1fbcc7cd3708a0 02-Aug-2007 Chris Lattner <sabre@nondot.org> Minor comment improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40760 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
cb92a118145c2a425666068d37c4049c38e24914 02-Aug-2007 Chris Lattner <sabre@nondot.org> Minor comment improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40760 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
18d38be41b6bb22b6f6378c868d237ae13a3d59f 02-Aug-2007 Steve Naroff <snaroff@apple.com> Add a couple const modifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40708 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7f28fe8e00ec4fac17977374d8da491f873a3b05 02-Aug-2007 Steve Naroff <snaroff@apple.com> Add a couple const modifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40708 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
1200b5a897982a428411e5fea413d065f517f996 02-Aug-2007 Steve Naroff <snaroff@apple.com> Hack Expr::isConstantExpr() to allow for __builtin_types_compatible_p.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40705 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
389cecc83f33e93c8ba6bf2e8269b8690404416f 02-Aug-2007 Steve Naroff <snaroff@apple.com> Hack Expr::isConstantExpr() to allow for __builtin_types_compatible_p.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40705 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5b5289288e689ff5bafde0af7716f05e076b3d71 02-Aug-2007 Steve Naroff <snaroff@apple.com> - Finish hooking up support for __builtin_types_compatible_p().
- Fix type printing code for recently added TypeOfExpr/TypeOfType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40700 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
363bcff47df2fda3cfcfcd994b7888157df58c43 02-Aug-2007 Steve Naroff <snaroff@apple.com> - Finish hooking up support for __builtin_types_compatible_p().
- Fix type printing code for recently added TypeOfExpr/TypeOfType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40700 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
63bad2d3e9e4fecaa6fb9e7ccf4e7419f74a4b16 02-Aug-2007 Steve Naroff <snaroff@apple.com> Add AST/Sema support for __builtin_types_compatible_p (a GNU extension).
Todo...still need to call the action from the parser...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40693 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
d34e915f33224c508ad55fbf975bd10b7876e197 02-Aug-2007 Steve Naroff <snaroff@apple.com> Add AST/Sema support for __builtin_types_compatible_p (a GNU extension).
Todo...still need to call the action from the parser...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40693 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
11b649c13734d15817f4780084bb220a338b1431 01-Aug-2007 Steve Naroff <snaroff@apple.com> Two typeof() related changes...

- Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr().
- Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal
for error diagnostics (since it's more natural to display the expressions type).

One "random" (or at least delayed:-) change...

- Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now
off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will
emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn
this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes
an issue, we can revisit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40676 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
8d1a3b8ca1e5fcc4567b5a6f51d82be2e460de1c 01-Aug-2007 Steve Naroff <snaroff@apple.com> Two typeof() related changes...

- Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr().
- Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal
for error diagnostics (since it's more natural to display the expressions type).

One "random" (or at least delayed:-) change...

- Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now
off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will
emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn
this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes
an issue, we can revisit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40676 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
b0fdfd50e1e4011486d5cb3773e1e87c8ec4325a 31-Jul-2007 Chris Lattner <sabre@nondot.org> move trivial type predicates inline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40651 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
611c1fff195d32df97706e0920c92468b2509900 31-Jul-2007 Chris Lattner <sabre@nondot.org> move trivial type predicates inline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40651 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e35a104a7d5caf8fa71117fbaa6f18cacc53c7a7 31-Jul-2007 Chris Lattner <sabre@nondot.org> split the rest of the type predicates into pure predicates:
there is now an isXXXType and a getAsXXXType


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40646 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
c8629630ce3e7f0da231bf10a4b39240caaac68a 31-Jul-2007 Chris Lattner <sabre@nondot.org> split the rest of the type predicates into pure predicates:
there is now an isXXXType and a getAsXXXType


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40646 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
f0c4a0a830c9154b1ae72e497c2ce586c10e9b71 31-Jul-2007 Chris Lattner <sabre@nondot.org> rename isReferenceType to follow the new scheme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40640 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
a1d9fdea79ba7bbd71862b9f9f78f5f117331fc7 31-Jul-2007 Chris Lattner <sabre@nondot.org> rename isReferenceType to follow the new scheme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40640 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7931f4a186bc76b21dd4629ee74d64264a7fb8a2 31-Jul-2007 Chris Lattner <sabre@nondot.org> make isPointerType() a pure predicate, rename the
existing one to getAsPointerType()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40639 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
befee48ff2a1dab236c5700f00ecca1cfdcd5837 31-Jul-2007 Chris Lattner <sabre@nondot.org> make isPointerType() a pure predicate, rename the
existing one to getAsPointerType()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40639 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7cbb14653934a298c09002b87704dc6531261771 31-Jul-2007 Steve Naroff <snaroff@apple.com> Add parsing and AST support for GNU "typeof".
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40631 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
d1861fd633d5096a00777c918eb8575ea7162fe7 31-Jul-2007 Steve Naroff <snaroff@apple.com> Add parsing and AST support for GNU "typeof".
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40631 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
6154214e20225a883a8a00226499534e9b514315 30-Jul-2007 Steve Naroff <snaroff@apple.com> Upgrade a comment...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40585 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
fcac0fff877a461bc5d5a57e6c6727a4c819d95a 30-Jul-2007 Steve Naroff <snaroff@apple.com> Upgrade a comment...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40585 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ba67f698f4380bf0533195e7332f45501c10504e 30-Jul-2007 Steve Naroff <snaroff@apple.com> Finish up semantic analysis for vector components.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40584 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
fec0b49c3fa621fbf63e420f3d54a5bb3a0265d2 30-Jul-2007 Steve Naroff <snaroff@apple.com> Finish up semantic analysis for vector components.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40584 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
82113e3a7b26c1a4b71d253c86de95f87cc8892e 29-Jul-2007 Steve Naroff <snaroff@apple.com> Implement pretty diagnostics when doing on-the-fly vector sizing (for vector component access).

For example, before this commit, the following diagnostics would be emitted...

ocu.c:49:12: error: incompatible types assigning 'float __attribute__((ocu_vector_type(3)))' to 'float4'
vec4_2 = vec4.rgb; // shorten
~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float __attribute__((ocu_vector_type(2)))' to 'float'
f = vec2.xx; // shorten
~ ^ ~~~~~~~

Now, the diagnostics look as you would expect...

ocu.c:49:12: error: incompatible types assigning 'float3' to 'float4'
vec4_2 = vec4.rgb; // shorten
~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float2' to 'float'
f = vec2.xx; // shorten
~ ^ ~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40579 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
bea0b34d99dddb7829857bbc96628713ab9c274b 29-Jul-2007 Steve Naroff <snaroff@apple.com> Implement pretty diagnostics when doing on-the-fly vector sizing (for vector component access).

For example, before this commit, the following diagnostics would be emitted...

ocu.c:49:12: error: incompatible types assigning 'float __attribute__((ocu_vector_type(3)))' to 'float4'
vec4_2 = vec4.rgb; // shorten
~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float __attribute__((ocu_vector_type(2)))' to 'float'
f = vec2.xx; // shorten
~ ^ ~~~~~~~

Now, the diagnostics look as you would expect...

ocu.c:49:12: error: incompatible types assigning 'float3' to 'float4'
vec4_2 = vec4.rgb; // shorten
~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float2' to 'float'
f = vec2.xx; // shorten
~ ^ ~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40579 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
c11705f9b742b542724dd56796bf90e07191e342 29-Jul-2007 Steve Naroff <snaroff@apple.com> Added a new expression, OCUVectorComponent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40577 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
ype.h
31a458462c6cf417a84e0c47852b18fb22d79acb 29-Jul-2007 Steve Naroff <snaroff@apple.com> Added a new expression, OCUVectorComponent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40577 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
ype.h
1b8a46c945927340ae7e79b771e93e7d36da4851 28-Jul-2007 Steve Naroff <snaroff@apple.com> Implement syntax/semantic analysis for OCU Vector Components.
Next step, AST support...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40568 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
e1b31fedbc006e6e4071bbb4f74c6116b56cfa9f 28-Jul-2007 Steve Naroff <snaroff@apple.com> Implement syntax/semantic analysis for OCU Vector Components.
Next step, AST support...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40568 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
806b319509d01bffe47317f11140c930da800dbb 26-Jul-2007 Steve Naroff <snaroff@apple.com> Add Type::isOCUVectorType().
Convert isFunctionType(), isStructureType(), and isUnionType() to the new API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40541 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
7064f5c95bbdb17680d0ea658d4090898c2592d3 26-Jul-2007 Steve Naroff <snaroff@apple.com> Add Type::isOCUVectorType().
Convert isFunctionType(), isStructureType(), and isUnionType() to the new API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40541 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
2cb6638a26cfa999e5fb999e6af9211127e681c1 26-Jul-2007 Steve Naroff <snaroff@apple.com> Various improvements to Sema::ParseMemberReferenceExpr().

- Added source range support to Diag's.
- Used the new type predicate API to remove dealing with the canonical
type explicitly.
- Added Type::isRecordType().
- Removed some casts.
- Removed a const qualifier from RecordType::getDecl().




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40508 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
dfa6aae5a119a527e537c35566ba3272fd8c5d74 26-Jul-2007 Steve Naroff <snaroff@apple.com> Various improvements to Sema::ParseMemberReferenceExpr().

- Added source range support to Diag's.
- Used the new type predicate API to remove dealing with the canonical
type explicitly.
- Added Type::isRecordType().
- Removed some casts.
- Removed a const qualifier from RecordType::getDecl().




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40508 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
4b0096578e961587d1ec0ed5dce45f592a65ed41 25-Jul-2007 Chris Lattner <sabre@nondot.org> Fix a couple of bugs, add some new cool stuff.

1. Fix a todo in Parser::ParseTag, to recover better. On code like
that in test/Sema/decl-invalid.c it causes us to return a single
error instead of multiple.
2. Fix an error in Sema::ParseDeclarator, where it would crash if the
declarator didn't have an identifier. Instead, diagnose the problem.
3. Start adding infrastructure to track the range of locations covered
by a declspec or declarator. This is mostly implemented for declspec,
but could be improved, it is missing for declarator.

Thanks to Neil for pointing out this crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40482 91177308-0d34-0410-b5e6-96231b3b80d8
ST.h
STContext.h
uiltins.def
uiltins.h
ecl.h
xpr.h
xprCXX.h
ecordLayout.h
tmt.h
tmtNodes.def
tmtVisitor.h
ype.h
700204c74b455746752e851b25565ebf932f5340 24-Jul-2007 Steve Naroff <snaroff@apple.com> Fix Sema::ParseCallExpr()...it wasn't doing the default array/function promotions on it's argument types.

This resulted in the following errors when compiling promote_types_in_proto.c test...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang test/Parser/promote_types_in_proto.c
test/Parser/promote_types_in_proto.c:7:24: error: incompatible types passing 'char *[]' to function expecting 'char *const []'
arrayPromotion(argv);
~~~~~~~~~~~~~~ ^~~~
test/Parser/promote_types_in_proto.c:8:27: error: incompatible types passing 'void (char *const [])' to function expecting 'void (char *const [])'
functionPromotion(arrayPromotion);
~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
2 diagnostics generated.

When fixing this, noticed that both ParseCallExpr() and ParseReturnStmt() were prematurely comparing types for
equivalence. This is incorrect (since the expr. promotions haven't been done yet). To fix this, I moved the
check "down" to Sema::CheckAssignmentConstraints().

I also converted Type::isArrayType() to the modern API (since I needed it). Still more Type predicates to
convert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40475 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ab18c4c0ac1a46a38aa84c2c8ea485612e21a614 24-Jul-2007 Chris Lattner <sabre@nondot.org> implement ast building and trivial semantic analysis of stmt exprs.
This implements test/Sema/stmt_exprs.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40465 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmt.h
tmtNodes.def
c1fcb7762673be706b0a40477d5e93411e918f93 22-Jul-2007 Anders Carlsson <andersca@mac.com> Refactor switch analysis to make it possible to detect duplicate case values

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40388 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
tmtNodes.def
aa4166c6c86e174362c0dc4e2cb63345f72cc5a0 21-Jul-2007 Chris Lattner <sabre@nondot.org> implement getSourceRange for ImplicitCast


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40264 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
227426661be33ff3e21f2b6b9f97971da2da044f 21-Jul-2007 Anders Carlsson <andersca@mac.com> Implement code generation for __func__, __FUNCTION__ and __PRETTY_FUNCTION__

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40162 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
942cfd37297528918616d06cd6e4e8bd6e4915a2 20-Jul-2007 Chris Lattner <sabre@nondot.org> Fix a valgrind error noticed by Benoit Boissinot


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40113 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
aff1edd84aaafef15b737acd8ec61abcca6d6bc3 19-Jul-2007 Steve Naroff <snaroff@apple.com> Finish fixing crasher with compound literals.

We still need to do sematic analysis (and implement initializers), however this
should complete the parsing & ast building for compound literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40067 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
76e773a443be9f006610f46529e07d4c8d857680 18-Jul-2007 Chris Lattner <sabre@nondot.org> implement i-c-e correct evaluation for sizeof/alignof, remove some obsolete fixme's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40012 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
5d2a6303467184b1f159bb6556efc434e50e3c28 18-Jul-2007 Chris Lattner <sabre@nondot.org> implement sizeof/alignof support for structs, unions and complex.

This allows us to compile this:

struct abc { char A; double D; };

int foo() {
return sizeof(struct abc);
return __alignof__(struct abc);
}

Into:

ret i32 16
ret i32 8



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40010 91177308-0d34-0410-b5e6-96231b3b80d8
ecordLayout.h
ype.h
73322924127c873c13101b705dd823f5539ffa5f 18-Jul-2007 Steve Naroff <snaroff@apple.com> First round of extended vector support. Here is an overview...

- added ocu_vector_type attribute, Sema::HandleOCUVectorTypeAttribute().
- added new AST node, OCUVectorType, a subclass of VectorType.
- added ASTContext::getOCUVectorType.
- changed ASTContext::convertToVectorType() to ASTContext::getVectorType(). This is
unrelated to extended vectors, however I was in the vicinity and it was on my todo list.
Added a FIXME to Sema::HandleVectorTypeAttribute to deal with converting complex types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40007 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
464175bba1318bef7905122e9fda20cff926df78 18-Jul-2007 Chris Lattner <sabre@nondot.org> initial layout support for structures and unions. This isn't actually
hooked up to anything, so it's not very useful yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40006 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ecordLayout.h
a8fe39eb2b955253c113162533d62b555f389de7 18-Jul-2007 Chris Lattner <sabre@nondot.org> add accessors


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40005 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
6c36be5b383875b490684bcf439d6d427298c1af 18-Jul-2007 Chris Lattner <sabre@nondot.org> Add initial switch stmt support, patch by Anders Carlsson!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39989 91177308-0d34-0410-b5e6-96231b3b80d8
tmt.h
251dcaf8616c6f04051e214f35cadb7de42aef7e 17-Jul-2007 Bill Wendling <isanbard@gmail.com> Return the correct type from isReferenceType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39956 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
08ad47cbd1f81fcb31dbc731c13b885a07e12704 17-Jul-2007 Bill Wendling <isanbard@gmail.com> Fix references:
According to the spec (C++ 5p6[expr]), we need to adjust "T&" to
"T" before further analysis. We do this via the "implicit cast"
thingy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39953 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a2c7767ce7d8feb10253f4b650826a20f3324c6f 17-Jul-2007 Chris Lattner <sabre@nondot.org> In the final step for preserving typedef info better in the AST, upgrade
isPointerType and isVectorType to only look through a single level of typedef
when one is present. For this invalid code:

typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
typedef int4* int4p;
void test(float4 a, int4p result, int i) {
result[i] = a;
}

we now get:

t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
result[i] = a;
~~~~~~~~~ ^ ~

instead of:

t.c:5:15: error: incompatible types assigning 'float4' to 'int __attribute__((vector_size(16)))'
result[i] = a;
~~~~~~~~~ ^ ~

The rest of the type predicates should be upgraded to do the same thing.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39932 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
ca51c97fbb10b9d48e1857e01c532493f87cd5f0 16-Jul-2007 Bill Wendling <isanbard@gmail.com> Constify the is*Lvalue() methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39907 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
7a2e047c602d6ba28d6c434c990d4b9f7ef8c694 16-Jul-2007 Chris Lattner <sabre@nondot.org> Now that isPointerType can return a pointer type, avoid stripping off typedef
information in the common case. On this invalid code:

typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
void test(float4 a, int4 *result, int i) {
result[i] = a;
}

we now generate:
t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
instead of:
t.c:5:15: error: incompatible types assigning 'float4' to 'int __attribute__((vector_size(16)))'

This implements test/Sema/typedef-retain.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39892 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
3acb13805673d47be95829bd5a4b1707952c0b6f 16-Jul-2007 Chris Lattner <sabre@nondot.org> as a very useful feature, make isVectorType and isPointerType return
the actual vectortype or pointertype when they return success.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39890 91177308-0d34-0410-b5e6-96231b3b80d8
ype.h
26dc7b39267b7d29b35a7887a5b8e54697192192 16-Jul-2007 Chris Lattner <sabre@nondot.org> Remove an extraneous QualType from CastExpr, it's type is always
the result type of the expr node.

Implement isIntegerConstantExpr for ImplicitCastExpr nodes the same
was as for CastExpr nodes.

Implement proper sign/zero extension as well as truncation and noop
conversion in the i-c-e evaluator. This allows us to correctly
handle i-c-e's like these:

char array[1024/(sizeof (long))];
int x['\xBb' == (char) 187 ? 1: -1];

this implements test/Sema/i-c-e2.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39888 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
2eadfb638eb1bb6ccfd6fd0453e764d47e27eed9 16-Jul-2007 Chris Lattner <sabre@nondot.org> set the correct width for a character literal when evaluating it as an i-c-e.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39886 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
590b6646ef747d2f7b42e5f40487ff07642d7b6f 16-Jul-2007 Chris Lattner <sabre@nondot.org> Refactor code so that isIntegerConstantExpr has an ASTContext available.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39884 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
ype.h
fa2eaabd304172dd8afc561f6156a65f8d0e442b 15-Jul-2007 Steve Naroff <snaroff@apple.com> This is the final step/commit for implementing exlicit implicit casts. Unlike the
previous two checkins, which involved lot's of tedious refactoring, this checkin is nice and clean:-)

- Hacked UsualUnaryConversions, UsualArithmeticConversions, and DefaultFunctionArrayConversion
to create the AST node (using a helper function promoteExprToType).
- Added a setType method to Expr.
- Changed Expr::isIntegerConstantExpr to allow for the new node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39866 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
d2d2a11a91d7ddf468bfb70f66362d24806ed601 14-Jul-2007 Chris Lattner <sabre@nondot.org> A significant refactoring of the type size stuff to also
compute type alignment. This info is needed for struct layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
90045e8ebabf50d6f1b3a67081a621b20b5e5341 14-Jul-2007 Steve Naroff <snaroff@apple.com> More changes related to implementing ImplicitCastExpr.

- Fixed a recent regression discovered by Keith Bauer (thanks!).
The fix involved adding (back) two arguments to UsualArithmeticConversions.
Without the reference arguments, no unary conversions were being passed back
to the caller. This had the effect of turning off the UsualUnaryConversions.
- Refactored CheckAssignmentConstraints into 3 functions. CheckAssignmentConstraints,
CheckSingleAssignmentConstraints, and CheckCompoundAssignmentConstraints.
- Changed the argument type of DefaultFunctionArrayConversion from QualType->Expr*&.
- Removed a bunch of casts in routines I was working on (cleanup).
- Fixed the visitor for ImplicitCastExpr (oops).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39840 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43d 14-Jul-2007 Chris Lattner <sabre@nondot.org> Move getSize() out of type, into ASTContext, where it has target info, and
where ASTContext can manage caches for struct layout, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39835 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
d0d560a0975c2f8c4a9559e84ec556b6a0baf7df 13-Jul-2007 Chris Lattner <sabre@nondot.org> eliminate extraneous type, add accessors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39830 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
49b4526992a8c8a6a290aa3efa9828154a24af8d 13-Jul-2007 Steve Naroff <snaroff@apple.com> Add (explicit) AST support for implicit casts. This should simplify the
code generator. Source translation tools can simply ignore this node.

- Added a new Expr node, ImplicitCastExpr.
- Changed UsualUnaryConversions/UsualArithmeticConversions to take references
to Expr *'s. This will allow these routines to instantiate the new AST node
and pass it back.
- Changed all clients of UsualUnary/UsualArithmetic (lot's of diff's).
- Changed some names in CheckConditionalOperands. Several variables where
only distinguished by their case (e.g. Cond, cond). Yuck (what was I thinking).
- Removed an old/crufty constructor in CastExpr (cleanup).

This check-in does not actually create the new AST node. I wanted to separate
the mechanical changes from the semantic changes. In addition, I need to
coordinate with Chris, since the semantic change will break the code generator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39814 91177308-0d34-0410-b5e6-96231b3b80d8
xpr.h
tmtNodes.def
8b9023ba35a86838789e2c9034a6128728c547aa 13-Jul-2007 Chris Lattner <sabre@nondot.org> Implement codegen for + and - with pointers. Patch contributed by
Keith Bauer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39793 91177308-0d34-0410-b5e6-96231b3b80d8
STContext.h
ype.h
3724c00ab70b1f86ae1afa01587c4cb811570433 12-Jul-2007 Chris Lattner <sabre@nondot.org> add missing specification for a default argument. I guess g++ 4.0 doesn't
notice this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39776 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
24c3990cd2469f9692c4b0c3edea4fba67baaf6e 12-Jul-2007 Chris Lattner <sabre@nondot.org> remember the initializer for a variable in the AST and teach the
pretty printer to print it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39770 91177308-0d34-0410-b5e6-96231b3b80d8
ecl.h
5f016e2cb5d11daeb237544de1c5d59f20fe1a6e 11-Jul-2007 Reid Spencer <rspencer@reidspencer.com> Stage two of getting CFE top correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8
ST.h
STContext.h
uiltins.def
uiltins.h
ecl.h
xpr.h
xprCXX.h
tmt.h
tmtNodes.def
tmtVisitor.h
ype.h