History log of /external/clang/lib/Sema/SemaStmt.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8123b6e7838216a53ba050f07e36fee28e1bbdaf 06-Sep-2012 Sam Panzer <espanz@gmail.com> Clarified diagnostics for range-based for loops with invalid ranges

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
568ba871bbac959029671b81f8e531edb7e0d7d6 04-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Revert r163083 per chandlerc's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5be92de217a1940d0e109abd0f401df4480c1a4b 02-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Implemented parsing and AST support for the MS __leave exception statement. Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
06b3a06007e02aebe497f34651a4e50b00adb051 01-Sep-2012 Chris Lattner <sabre@nondot.org> don't warn about unused values when the unused value is a statement expression expanded from a macro. This is of dubious utility in general, but is specifically a major issue for the linux kernel. This resolves PR13747.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5354e77e60e82828c7c2361f5c688c2667ab59cc 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Now that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.

This required changing all get() calls to data() and using the simpler constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3fe198bf0d6118c7b080c17c3bb28d7c84e458b9 23-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Rip out remnants of move semantic emulation and smart pointers in Sema.

These were nops for quite a while and only lead to confusion. ASTMultiPtr
now behaves like a proper dumb array reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e1715b66a878bcab315513351e5df68bfc010d2e 21-Aug-2012 Sam Panzer <espanz@gmail.com> Better diagnostics for range-based for loops with bad range types.

The old error message stating that 'begin' was an undeclared identifier
is replaced with a new message explaining that the error is in the range
expression, along with which of the begin() and end() functions was
problematic if relevant.

Additionally, if the range was a pointer type or defines operator*,
attempt to dereference the range, and offer a FixIt if the modified range
works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4b5e48d39eb94ee12f3d89df60525053d8b0275e 17-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Extract AsmStmt handling into a separate file, so as to not
pollute SemaStmt with extraneous asm handling logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
64b8578d9c359f86c073105382625248f66c038b 17-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Instantiate the MCStreamer as a NullStream. We're parsing
instruction, not emitting them, so a NullStream is fine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2f648515c8bf964c87eb3b6ce37bb816d7d9b2bc 17-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7e1fb9abfc8d67fe4e7203ef6830a893df704d7b 17-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Extract a helper function, getSpelling(). Also use this on
tokens we don't know how to handle; this should aid when debugging.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
eeff8ce11d687429d545cb6ce9bdaa44319ca72f 17-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] If we don't know how to handle a token then assume this is not a
simple asm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
700ce64db453624d2a3f2d34d25207c97b2b064f 17-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a helper function, isMSAsmKeyword().

These require special handling, which we don't currently handle. This is being
put in place to ensure we don't do invalid symbol table lookups or try to parse
invalid assembly. The test cases just makes sure the latter isn't happening.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bc20bbb0bf90446a469848c658ca376832f43dc8 16-Aug-2012 Sam Panzer <espanz@gmail.com> Removed unused LParenLoc parameter to ActOnCXXForRangeStmt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2863c0e0f6cd7c0b9d8b999905b1688d3f2f2377 16-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Perform symbol table lookup on variables. The idea is to use
this information to determine valid MC operands. This will also be used for
semantic analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f64c11815e68f025737dc41d8d94e31e1426274d 16-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Start tracking which tokens are registers and which are
variables, function or label references. The former is a potential clobber.
The latter is either an input or an output. Unfortunately, it's difficult to
test this patch at the moment, but the added test case will eventually do so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
058ab170a5b8597f32c3f343a1e9de2cd7b05848 16-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add inputs and outputs to AST. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b5f9eb8a0709082bba8e8de3a6c643928570aaa0 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use a set container to remove redundant clobbers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bec224b33b383c993d127ef7f618ce27df7105e6 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Address a FIXME by computing the number of asm statements when
building the AsmString.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f37e4218bb40ed956f0ef1d2e5eee2b2c3aa20d2 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] MSVC parses multiple __asm statements on a single line as one
statement. For example,

if (x)
__asm out dx, ax __asm out dx, ax

results in a single inline asm statement (i.e., both "out dx, ax" statements are
predicated on if(x)).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a8ac203967adaa18c5cbf869e368f7103060be1a 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Don't emit newlines as these are ignored by the AsmParser
anyways. Also, simplify some conditional logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
89c57a2198145564ab6d0b2ad10fee5a1131bd15 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Capturing loop-scoped (std::string)Reg with a StringRef is bad.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7bd092b054444e9800e8de1d8d71c408dbdc8ead 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add the left brace source location and improve the pretty
printer. Patch by Enea Zaffanella <zaffanella@cs.unipr.it>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4fda501bd5cf99311ce068b335c08b2e39b794d0 15-Aug-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib/Sema/SemaStmt.cpp: Include MCAsmLexer.h to appease msvc to define llvm::AsmToken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1ac64aa0edf3d847ee0f162dcab33d0f69dc72ff 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Have MC start parsing the asms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
92570bd1597f355d5673a94960323f81d99c4921 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove the last bits of LineEnds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
13a178fb530204d9e852ead599d69cef6b874003 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Simplify more logic by using the Token::hasLeadingSpace() and
Token::isAtStartOfLine() APIs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5dfc44131128abc354fb6936caed01b71c83be70 14-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Address a potential buffer overflow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
fdbd3c5705a7183809c5f49d1e50fbfd93641ceb 14-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Simplify the logic in patchMSAsmString. We no longer need to
track the LineEnds now that single line asm statments aren't merged.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
58d33ad9c83f1195a7db544e4b41daa019aaa767 14-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a helpful assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d8238a4e9cc7f77b50a8f02aa4710b3b4fbdf7ad 13-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Address a potential buffer overflow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
265f538b2c8b9e19196ce8a78a3da78671eb6f2b 13-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.

The AsmParser expects a single asm instruction, but valid ms-style inline asm
statements may contain multiple instructions.

This happens with asm blocks

__asm {
mov ebx, eax
mov ecx, ebx
}

or when multiple asm statements are adjacent to one another

__asm mov ebx, eax
__asm mov ecx, ebx

and

__asm mov ebx, eax __asm mov ecx, ebx

Currently, asm blocks are not properly handled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5e8d300a38fefc021da263d87998b0024aa3b7e0 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asm
statements. Therefore, we can't pass the PatchedAsmString to the AsmParser
and expect things to work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e790bc32ca3eb7cc396b45071d7987776e965ed7 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Fix a memory leak introduced in r161686.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4399ea9d473365224d9e4db0cd94aab849eb59b7 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add clobbers to AST representation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f9a6a411e603370dd201ca1f5379fdf1ef3ecced 10-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use asserts as these calls are now guarded by identical checks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1093f4928a4263d08b44d96e468a42515d8a28f3 10-Aug-2012 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
613f44418b55c39c1d3f30c5e8f52f3e3248384c 09-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
cace2103efe3449c406bcdfd4874dfb1e94c811a 09-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use StringRef here, per Jordan's suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4144f9079e685408cef414e29970b7b7960eddf0 09-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Simplify logic for empty asm statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
47f49892fb229488ff11653e1dec373873dfcffb 09-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Instantiate the various parts to the AsmParser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
be3d0dbf2e8d2f93191ff4c023dd3bbf8f859d5a 09-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Initialize targets and assembly printers/parsers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
77c7b0a7d04bf28b6fe15d21dc9a5b5d366347cc 08-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Use more idiomatic logic. Thanks, Bill.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
871ee56e8003b8ce6f0658351ca051db504d9dc4 08-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Make sure IsSimple is correctly handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d854c63dca5ef01c505fbd43684d8bf3f3691cc7 08-Aug-2012 Chad Rosier <mcrosier@apple.com> Remove extraneous comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b64f3101e65e6931a1b3b3479ca6357624b37667 08-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a very simple test case. Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
62f22b87801882646418bae85111e565f7a53ddb 08-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Refactor the logic to generate the AsmString into Sema. No
functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e696b6924d14b0e0590b5d923ca1646e6f67ac40 08-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add support for detecting simple ms-style inline asm. Simple
asm statements are those that don't reference variable names, function names,
and labels.

Add logic to generate a patched AsmString that will eventually be consumed by
the AsmParser. No functional change at this point, so unfortunately no test
case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3a32c9c565f970fd319b97a6056a4725cfa4f0f5 08-Aug-2012 Chad Rosier <mcrosier@apple.com> Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
79efe24e125553b7fd4a35ffb3b7a45c4f1e661a 07-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Stmt destructors are never called, so allocate the AsmToks using
the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8f726de55412870ef70e788b852c6cc50873e15b 06-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Pass Tokens to Sema and store them in the AST. No functional
change intended. No test case as there's no real way to test at this time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e61354b274ec5aa6acf3d15271896ce7596bb123 27-Jul-2012 Anna Zaks <ganna@apple.com> Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.

Also, fix a subtle bug, which occurred due to lookupPrivateMethod
defined in DeclObjC.h not looking up the method inside parent's
categories.

Note, the code assumes that Class's parent object has the same methods
as what's in the Root class of a the hierarchy, which is a heuristic
that might not hold for hierarchies which do not descend from NSObject.
Would be great to fix this in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
379b28183a7dcb715c3f3eb2da4b0157d6d8ffbe 17-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> Issue warning when assigning out-of-range integer values to enums.
Due to performance cost, this is an opt-in option placed
under -Wassign-enum. // rdar://11824807


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8951067a2bc35fb2a535bc18432cb2d02a762b73 12-Jul-2012 Nico Weber <nicolasweber@gmx.de> Don't try to do RVO on block variables that refer to an enclosing local.

Fixes PR13314, clang crashing on blocks refering to an enclosing local
when the enclosing function returns void.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4990890fc9428f98bef90ba349203a648c592778 09-Jul-2012 Alexander Kornienko <alexfh@google.com> Inline storage of attributes in AttributedStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4d3db4eb6caa49a7cdbfe1798728ce4b23cd0b53 06-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c++11: extend c++11 range-based loop to iterate
over objective-c container collection. // rdar://9293227


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a1eec4bd198b96ef40a7c15cd0e131ca94511ad8 04-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: Refactor parse/sema portion of
objective-c's fast enumeration statement,
for more work to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7dd900ed308506f9cf1cb72c70db1652f94cab37 02-Jul-2012 Jordan Rose <jordan_rose@apple.com> In blocks, only pretend that enum constants have enum type if necessary.

In C, enum constants have the type of the enum's underlying integer type,
rather than the type of the enum. (This is not true in C++.) Thus, when a
block's return type is inferred from an enum constant, it is incompatible
with expressions that return the enum type.

In r158899, I told block returns to pretend that enum constants have enum
type, like in C++. Doug Gregor pointed out that this can break existing code.

Now, we don't check the types of return statements until the end of the block.
This lets us go back and add implicit casts in blocks with mixed enum
constants and enum-typed expressions.

<rdar://problem/11662489> (again)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
81a5641e5f446d0e879595d3659e76845c7a9410 21-Jun-2012 Jordan Rose <jordan_rose@apple.com> Pretend that enum constants have enum type when inferring a block return type.

In C, enum constants have the type of the enum's underlying integer type,
rather than the type of the enum. (This is not true in C++.) This leads to
odd warnings when returning enum constants directly in blocks with inferred
return types. The easiest way out of this is to pretend that, like C++, enum
constants have enum type when being returned from a block.

<rdar://problem/11662489>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8e1e0543cc3b63e0bc116bae0d2f1e8fc530b436 20-Jun-2012 Chad Rosier <mcrosier@apple.com> Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
52e4ed949ba52958db1e938860e3b49944ce8680 20-Jun-2012 Chad Rosier <mcrosier@apple.com> [ms-style asm] Change the fatal error to an extension warning. Apparently, this
error was asserting on anything that included Windows.h. MS-style inline asm is
still dropped, but at least now we're not completely silent about it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8cd64b4c5553fa6284d248336cb7c82dc960a394 11-Jun-2012 Chad Rosier <mcrosier@apple.com> Etch out the code path for MS-style inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a248e9c1dd56af68aba419e9717d369c5e61210a 08-Jun-2012 Richard Trieu <rtrieu@google.com> Remove a commented out variable declaration. This was originally a debugging
variable which wasn't removed when the original patch was committed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
facde171ae4b8926622a1bffa833732a06f1875b 06-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused private member variables found by clang's new -Wunused-private-field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a6115068cde719142eb394db88612c185cabd05b 24-May-2012 Eli Friedman <eli.friedman@gmail.com> Add a warning to diagnose statements in C++ like "*(volatile int*)x;". Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
50de5e3247a20e0e548dc47022a011250e6e4e8f 16-May-2012 Douglas Gregor <dgregor@apple.com> Use a llvm::SmallString rather than std::string for duplicate-case errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3940ce83438e2332ba541f4e65e700fbefe0c7a8 16-May-2012 Douglas Gregor <dgregor@apple.com> Produce more useful 'duplicate case' diagnostics. Fixes PR9243, from Terry Long!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
dbbecccb8431bb4545fc01c6401abc4253667360 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12826: Converting an lvalue to an xvalue is a no-op conversion, not an lvalue-to-rvalue conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d1376ee0945a4eba0590ae33d14bade860b08a7d 08-May-2012 John McCall <rjmccall@apple.com> Bind cleanups after doing l2r conversion on the operand of a
@throw expression; l2r conversion can introduce new cleanups
in certain cases, like when the expression is an ObjC property
reference of retainable type in ARC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ab41fe914f63bb470dfa7e400876ada72f57a931 05-May-2012 Douglas Gregor <dgregor@apple.com> Move Sema::VerifyIntegerConstantExpression() and
Sema::ConvertToIntegralOrEnumerationType() from PartialDiagnostics to
abstract "diagnoser" classes. Not much of a win here, but we're
-several PartialDiagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d10099e5c8238fa0327f03921cf2e3c8975c881e 04-May-2012 Douglas Gregor <dgregor@apple.com> Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()
off PartialDiagnostic. PartialDiagnostic is rather heavyweight for
something that is in the critical path and is rarely used. So, switch
over to an abstract-class-based callback mechanism that delays most of
the work until a diagnostic is actually produced. Good for ~11k code
size reduction in the compiler and 1% speedup in -fsyntax-only on the
code in <rdar://problem/11004361>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9087599e5ee64ecd30194b3d89f8748ac95c62f7 04-May-2012 Richard Trieu <rtrieu@google.com> Skip checking for infinite for-loops if there are global or static variables
in the conditional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
694e796f462748ab4dc7ecdf4be5da44dd2c8c94 30-Apr-2012 Richard Trieu <rtrieu@google.com> Add -Wloop-analysis. This warning will fire on for loops which the variables
in the loop conditional do not change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
534986f2b21e6050bf00163cd6423fd92155a6ed 14-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
29bbd1a33edfd3c81c35d5076530c2867a05bddc 30-Mar-2012 John McCall <rjmccall@apple.com> Handle placeholder expressions in an ObjC for-collection loop.
The way we handle this implicitly removes the ability to use
property l-values in this position, but that's really okay.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
38ac243e300798e8cd9fe05888cd97beabfb94e6 30-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we perform the relevant implied conversions correctly for ObjC methods with related result types. PR12384.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
54faba4f7f3f0e8f1376da1c459312596ad5486d 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> For enums with no tag name, display its location in
the diagnostic instead of displaying ''.
// rdar://11082110


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9354f6aaa70e1543d122644fee0c3f834324d2fc 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> fixes the diagnostic issued in // rdar://11069896


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4e648e4770d85febaf15ad8b7bad458bd7338ae2 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Allow void blocks to return witn a void expression in
c-mode to match behavior with void functions in c. Issue
warning with -pedantic. // rdar://11069896


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3ef963bab9916ff4d2def248db1ce38a55bfce18 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Undo previous patch as I checked more than I intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7e725bc7a099fefa5e0f03e2208838d3cdf064e3 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> modern objective-c rewriter: remove 'const' from
pointer field declarations in several meta-data.
// rdar://11079898


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ebcb57a8d298862c65043e88b2429591ab3c58d3 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals. This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch. It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5b38a0f98e4420dae1bd3e13959bc207c97a9e98 22-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Doug's review comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
33deb35535aebe81bed0eaf5c14f3032276a086e 22-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Fix parsing and processing initializer lists in return statements and as direct member initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
793cd1c4cdfaafc52e2c2ad9dae959befe4bb166 15-Feb-2012 Douglas Gregor <dgregor@apple.com> Specialize noreturn diagnostics for lambda expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0bcc3d87223d7796946bfa6dd6174af900d8eba4 15-Feb-2012 Douglas Gregor <dgregor@apple.com> Fix silly precedence error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4e88df72e690498aeba2dc3d5089388b27be66fa 15-Feb-2012 Douglas Gregor <dgregor@apple.com> Specialize the diagnostic complaining about conflicting types of
return statements within a lambda; this diagnostic previously referred
to blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
625bb569df0c34feec0d52c0ec5215f21ef2e054 14-Feb-2012 Dmitri Gribenko <gribozavr@gmail.com> Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)

* if, switch, range-based for: warn if semicolon is on the same line.
* for, while: warn if semicolon is on the same line and either next
statement is compound statement or next statement has more
indentation.

Replacing the semicolon with {} or moving the semicolon to the next
line will always silence the warning.

Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a0c2b21e0d84ad289781e08e14148da6b8b8b76d 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Don't allow deduction of a lambda result type from an initializer
list; it is not an expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
f39aec17b89f8f0dd78e78c50ad2fa08f12272e3 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't allow a value of a scoped enumeration to be used as the first bound for an
array new expression. This lays some groundwork for the implicit conversion to
integral or unscoped enumeration which C++11 ICEs undergo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d29975fd08713eb9d1777e60536addaa62df8995 31-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we call MaybeCreateExprWithCleanups for the sub-expression of an indirect goto.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e4b92761b43ced611c417ae478568610f1ad7b1e 27-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added source location for the template keyword in AST template-id expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
84b007fae6c0cd30fa07074d34fbe2bf61fa44f9 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Refactor to share code for handling return statements between lambda expressions and block literals. As it turns out, almost all the logic can be shared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ceccab908bd7824751b1def127272ec04dd4732b 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Slight refactoring; catch yet another case where we were missing an lvalue-to-rvalue conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3943b1c0215da2a4171dd6c696cb75d19e5a04a9 25-Jan-2012 Kaelyn Uhrain <rikka@google.com> Allow typo correction to be disabled in BuildOverloadedCallExpr variant.

This suppresses typo correction for auto-generated call expressions such
as to 'begin' or 'end' within a C++0x for-range statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b832f6dea893f25b40500a04781286236281cb20 23-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Minor fixups for auto deduction of initializer lists.

Fix some review comments.
Add a test for deduction when std::initializer_list isn't available yet.
Fix redundant error messages. This fixes and outstanding FIXME too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
585d7795c2dddaa510b3bb1b3b18633bfcfdf643 23-Jan-2012 David Blaikie <dblaikie@gmail.com> Implement -Wswitch-enum correctly.

Clang previously implemented -Wswitch-enum the same as -Wswitch. This patch
corrects the behavior to match GCC's. The critical/only difference being that
-Wswitch-enum is not silenced by the presence of a default case in the switch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8c382060c9e6668a94f1485dd16f012cda526c5f 23-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make sure the AST correctly represents lvalue-to-rvalue conversions where appropriate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9366750a5a97c8aeae1df4898ea849b087865195 22-Jan-2012 David Blaikie <dblaikie@gmail.com> Fix -Wswitch to warn about out of bounds enum cases even when there's a default

For consistency with GCC & reasonable sanity. The FIXME suggests that the
original author was perhaps using the default check for some other purpose,
not realizing the more obvious limitation/false-negatives it creates, but this
doesn't seem to produce any regressions & fixes the included test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
31ceb61172bca7ebc3fb90e9125864c7a29c55c0 21-Jan-2012 David Blaikie <dblaikie@gmail.com> Add -Wswitch-enum-redundant-default.

This warning acts as the complement to the main -Wswitch-enum warning (which
warns whenever a switch over enum without a default doesn't cover all values of
the enum) & has been an an-doc coding convention in LLVM and Clang in my
experience. The purpose is to ensure there's never a "dead" default in a
switch-over-enum because this would hide future -Wswitch-enum errors.

The name warning has a separate flag name so it can be disabled but it's grouped
under -Wswitch-enum & is on-by-default because of this.

The existing violations of this rule in test cases have had the warning disabled
& I've added a specific test for the new behavior (many negative cases already
exist in the same test file - and none regressed - so I didn't add more).

Reviewed by Ted Kremenek ( http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120116/051690.html )

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8ef7b203332b0c8d65876a1f5e6d1db4e6f40e4b 19-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: converted constant expression handling for enumerator values, case
values and non-type template arguments of integral and enumeration types.

This change causes some legal C++98 code to no longer compile in C++11 mode, by
enforcing the C++11 rule that narrowing integral conversions are not permitted
in the final implicit conversion sequence for the above cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
62b7cfb73e202051e7ab0dad42ba213acd0dec7e 17-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Auto deduction support for std::initializer_list, including for-range support. This means you can now write:

for (int i : {1, 4, 512, 23, 251}) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d87a0cd2b3e1c9e9f01212875f4cbe5b7bb7ab57 06-Jan-2012 Matt Beaumont-Gay <matthewbg@google.com> Suppress -Wunused-value within macros from system headers.

Along the way, move a helper function from SemaChecking.cpp to a more
accessible home in SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
79430e9983f5e67a378fc1f50cd6278f2cea8259 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Minor cleanup; no functional change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
80d4b55db94db2172a04617d1a80feca6bbcea5c 28-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Small refactoring and simplification of constant evaluation and some of its
clients. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
649657e7d6c150136cae5ab22e39b9794cff80cc 04-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Move block return type inference diagnostic to a common place where
Function or array lvalue conversions happens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
b3029960632ca8a3248e74770eda64d6c16f7246 14-Nov-2011 Douglas Gregor <dgregor@apple.com> Use Sema::RequireCompleteType to check for the completeness of
Objective-C classes. This has two purposes: to consistently provide
"forward declaration here" notes when we hit an incomplete type, and
to give LLDB a chance to complete the type.

RequireCompleteType bits from Sean Callanan!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1cd76e8ca8f890a4defadcae3372c025ebe7607c 11-Nov-2011 John McCall <rjmccall@apple.com> Don't apply NRVO to over-aligned variables. The caller only
guarantees alignment up to the ABI alignment of the return type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4b9c2d235fb9449e249d74f48ecfec601650de93 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
51f4708c00110940ca3f337961915f2ca1668375 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4f87062cb411d5a31cf39f1ac576bba4123930f2 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix some cases where a CK_IntegralCast was being used to convert an lvalue to an
rvalue. An assertion to catch this is in ImpCastExprToType will follow, but
vector operations currently trip over this (due to omitting the usual arithmetic
conversions). Also add an assert to catch missing lvalue-to-rvalue conversions
on the LHS of ->.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9c1ba407188fbb702e944fff66c30f21bdf99f8e 27-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> objc: fix an ir-gen crash caused by recent
property refactoring. // rdar://10327068


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3c3b7f90a863af43fa63043d396553ecf205351c 25-Oct-2011 John McCall <rjmccall@apple.com> Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
327a50f46449c946c42d50d97689bcb30e2af7d9 25-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r142914 and r142915, due to possibly missing file.

r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a1b852f8e1bee5ed3604ee483803cef39ce57a20 25-Oct-2011 John McCall <rjmccall@apple.com> Introduce a placeholder type for "pseudo object"
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.

Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ba0513de93d2fab6db5ab30b6927209fcc883078 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e50b01531afcb4afc40d27720afa09613ddcdfa2 11-Oct-2011 Ted Kremenek <kremenek@apple.com> Rework construction of CXXForRangeStmt not to recycle the same DeclRefExpr in multiple subexpressions. This breaks the tree structure
of the AST and completely breaks the CFG invariants.

Patch by Jim Goodnow II and reviewed by Richard Smith!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a6b8b2c09610b8bc4330e948ece8b940c2386406 10-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f45b357c0d0df99e160a6320e279ef788dd91ba6 14-Sep-2011 Eli Friedman <eli.friedman@gmail.com> PR10864: make sure we correctly delay type-checking for inline asm tied operands with dependent type. Patch by Likai Liu.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
5440bfaff6aec058b60bc6da75bb4f13b7a76491 18-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Remove the last FIXMEs on -Wunused-comparison since it got moved to
entirely use the existing -Wunused-value infrastructure. This also fixes
a few missed cases for -Wunused in general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0a7efe1142d241678c91bf93ee6adb51289863a4 18-Aug-2011 John McCall <rjmccall@apple.com> Reorganize the return-type vs. expression checking code in
block returns; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d963c37eb912342c8325048749e449861cf0a6e3 17-Aug-2011 John McCall <rjmccall@apple.com> Gather cleanups correctly in block return statements.
Thanks to Ted for finding this with magic tools.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ec8058f64bbcd79bd47748f4cf8628123dd3bae6 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Treating the unused equality comparisons as something other than part of
-Wunused was a mistake. It resulted in duplicate warnings and lots of
other hacks. Instead, this should be a special sub-category to
-Wunused-value, much like -Wunused-result is.

Moved to -Wunused-comparison, moved the implementation to piggy back on
the -Wunused-value implementation instead of rolling its own, different
mechanism for catching all of the "interesting" statements.

I like the unused-value mechanism for this better, but its currently
missing several top-level statements. For now, I've FIXME-ed out those
test cases. I'll enhance the generic infrastructure to catch these
statements in a subsequent patch.

This patch also removes the cast-to-void fixit hint. This hint isn't
available on any of the other -Wunused-value diagnostics, and if we want
it to be, we should add it generically rather than in one specific case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
50bf68fc9698742e36c311fc37e6e4b7de235c4b 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Don't suggest assignment in implausible situation. We still warn, as the
code is very likely to be buggy, but its going to require more
significant changes on the part of the user to correct it in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9d8eb3b2a892697aed332f6c318a8554fc2623ce 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Introduce a new warning, -Wtop-level-comparison. This warning is
a complement to the warnings we provide in condition expressions. Much
like we warn on conditions such as:

int x, y;
...
if (x = y) ... // Almost always a typo of '=='

This warning applies the complementary logic to "top-level" statements,
or statements whose value is not consumed or used in some way:

int x, y;
...
x == y; // Almost always a type for '='

We also mirror the '!=' vs. '|=' logic.

The warning is designed to fire even for overloaded operators for two reasons:

1) Especially in the presence of widespread templates that assume
operator== and operator!= perform the expected comparison operations,
it seems unreasonable to suppress warnings on the offchance that
a user has written a class that abuses these operators, embedding
side-effects or other magic within them.
2) There is a trivial source modification to silence the warning for
truly exceptional cases:

(void)(x == y); // No warning

A (greatly reduced) form of this warning has already caught a number of
bugs in our codebase, so there is precedent for it actually firing. That
said, its currently off by default, but enabled under -Wall.

There are several fixmes left here that I'm working on in follow-up
patches, including de-duplicating warnings from -Wunused, sharing code
with -Wunused's implementation (and creating a nice place to hook
diagnostics on "top-level" statements), and handling cases where a proxy
object with a bool conversion is returned, hiding the operation in the
cleanup AST nodes.

Suggestions for any of this code more than welcome. Also, I'd really
love suggestions for better naming than "top-level".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a8e0cd8cdecc7e0ba1792e46773b884c6eed4829 06-Aug-2011 John McCall <rjmccall@apple.com> Do l-value conversion, etc., on a switch condition expression in
ActOnStartOfSwitchStmt (i.e. before binding up a full-expression)
instead of ActOnFinishSwitchStmt.

Among other things, this means that property l-values are properly
converted inside the full-expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
42d7b2d25b6f90dc397886d05502b10ab5a8b51b 05-Aug-2011 Matt Beaumont-Gay <matthewbg@google.com> Specialize diag::warn_unused_call for the "warn_unused_result" attribute, so
it can be controlled with a distinct flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
07524039dce5c820f111a1b3f772b4261f004b4a 27-Jul-2011 John McCall <rjmccall@apple.com> The lock operand to an @synchronized statement is also
supposed to be a full-expression; make it so. In ARC, make sure
we retain the lock for the entire protected block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
990567cb60e8530ba01b41d4e056e32b44b95ec0 27-Jul-2011 John McCall <rjmccall@apple.com> Clean up the analysis of the collection operand to ObjC
for-in statements; specifically, make sure to close over any
temporaries or cleanups it might require. In ARC, this has
implications for the lifetime of the collection, so emit it
with a retain and release it upon exit from the loop.

rdar://problem/9817306



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2d3ba4f5a923a90c3fc290ddfba5e36c2d0a9b46 23-Jul-2011 Chris Lattner <sabre@nondot.org> Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f2dd68fb37a62571a4985c8dd05310ac90d07ef0 21-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc-arc: Fixes a crash @throw'ing an objc message.
// pr10411


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
ca0d0d4a0d6ecd256d4bf8c1a0dc183a83119833 30-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Improve the wording of the warning when returning a value from
a constructor or destructor.

Patch by Hans Wennborg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
de31fd7eeebdc64fb043463e7f515dab8eccac8d 28-Jun-2011 Eric Christopher <echristo@apple.com> Split out logic for valid clobbers and valid inline asm registers.

Fixes rdar://9281377


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
cd6f36693ed40cef8c8639c04438d865187c1f73 22-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> First part of PR9968: the __range variable in a dependent C++11 for-range statement is implicitly used by that statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7acddacc921cd0b3f813443a8641eeddb82dfbd4 17-Jun-2011 John McCall <rjmccall@apple.com> Objective-C fast enumeration loop variables are not retained in ARC, but
they should still be officially __strong for the purposes of errors,
block capture, etc. Make a new bit on variables, isARCPseudoStrong(),
and set this for 'self' and these enumeration-loop variables. Change
the code that was looking for the old patterns to look for this bit,
and change IR generation to find this bit and treat the resulting
variable as __unsafe_unretained for the purposes of init/destroy in
the two places it can come up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
856d3798af7c2f7251e4a295f3da7a09ce4c62ab 17-Jun-2011 John McCall <rjmccall@apple.com> Be sure to try a final ARC-production even in Objective-C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
926df6cfabf3eaa4afc990c097fa4619b76a9b57 11-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement Objective-C Related Result Type semantics.

Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
383616cd2e61131a534afd9364ef53f643e1f834 05-Jun-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Remove all references to InitializationSequence::FailedSequence from outside SemaInit.cpp. Replace them with the boolean conversion or the new Failed() function. This is a first step towards removing InitializationSequence::SequenceKind. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bc3e64f37fe2c68ab4bfcedf6f428e0198f2e349 05-Jun-2011 Douglas Gregor <dgregor@apple.com> Allow block returns in C++ with the form

return <expression> ;

in blocks with a 'void' result type, so long as <expression> has type
'void'. This follows the rules for C++ functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6a576ab708d3aa7d40e5d867ab1de5d3cb507553 05-Jun-2011 Douglas Gregor <dgregor@apple.com> When inferring the result type of a block based on a return statement
with a type-dependent expression, infer the placeholder type
'Context.DependentTy' to indicate that this is just a
placeholder. Fixes PR9982 / <rdar://problem/9486685>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
58f14c012e5d739b09532bb12645dc161f88cfcf 02-Jun-2011 Francois Pichet <pichet2000@gmail.com> Fix 80-column violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8d7946151cd15c0e7c34250c122d59b2f5027999 01-Jun-2011 Nick Lewycky <nicholas@mxc.ca> Even a return statement of an expression with a dependent type in a void
function might need to clean up its temporaries. Fixes PR10057.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
575a1c9dc8dc5b4977194993e289f9eda7295c39 20-May-2011 Douglas Gregor <dgregor@apple.com> Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.

Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
fc92137eee708b632c00a9b0934ff87aeae234a5 20-May-2011 Douglas Gregor <dgregor@apple.com> Diagnose unexpanded parameter packs in return statements. This
manifested in a crash with blocks in PR9953, but it was a ticking time
bomb for normal functions, too. Fixes PR9953.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4926d832aa2f0af9d7c00633727d49e7967eb978 20-May-2011 Douglas Gregor <dgregor@apple.com> Clean up two comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4da89c87b2b6ca31f1015ec19aae65a02971ea9a 11-May-2011 John McCall <rjmccall@apple.com> Use a heralded conversion to bool in inline-asm constraints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
28bbe4b8acc338476fe0825769b41fb32b423c72 28-Apr-2011 John Wiegley <johnw@boostpro.com> Parsing/AST support for Structured Exception Handling

Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
864c041e118155c2b1ce0ba36942a3da5a4a055e 26-Apr-2011 John McCall <rjmccall@apple.com> Make yet another placeholder type, this one marking that an expression is a bound
member function, i.e. something of the form 'x.f' where 'f' is a non-static
member function. Diagnose this in the general case. Some of the new diagnostics
are probably worse than the old ones, but we now get this right much more
universally, and there's certainly room for improvement in the diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b403d6d746239095a2c7bac958c924d92434e2b4 18-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR9741. The implicit declarations created for range-based for loops weren't being added to the DeclContext (nor were they being marked as implicit). Also, the declarations were being emitted in the wrong order when building the CFG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
429bb276991ff2dbc7c5b438828b9b7737cb15eb 08-Apr-2011 John Wiegley <johnw@boostpro.com> Use ExprResult& instead of Expr *& in Sema

This patch authored by Eric Niebler.

Many methods on the Sema class (e.g. ConvertPropertyForRValue) take Expr
pointers as in/out parameters (Expr *&). This is especially true for the
routines that apply implicit conversions to nodes in-place. This design is
workable only as long as those conversions cannot fail. If they are allowed
to fail, they need a way to report their failures. The typical way of doing
this in clang is to use an ExprResult, which has an extra bit to signal a
valid/invalid state. Returning ExprResult is de riguour elsewhere in the Sema
interface. We suggest changing the Expr *& parameters in the Sema interface
to ExprResult &. This increases interface consistency and maintainability.

This interface change is important for work supporting MS-style C++
properties. For reasons explained here
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013180.html>,
seemingly trivial operations like rvalue/lvalue conversions that formerly
could not fail now can. (The reason is that given the semantics of the
feature, getter/setter method lookup cannot happen until the point of use, at
which point it may be found that the method does not exist, or it may have the
wrong type, or overload resolution may fail, or it may be inaccessible.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
61478065fbcafcf5295bb0fb796c9a92f2d861e0 09-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Lookup selector in protocol list of qualified objc type
to avoid a bogus warning. // rdar:// 9072298



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
203548ba4b72e7e59320d352afc1eb0b5ab131de 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for LabelDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
15348aeb81285c75b2e92b5bf8d2db3445d147c2 28-Feb-2011 Anders Carlsson <andersca@mac.com> Add a -fcxx-exceptions flag to the frontend, which can be used to enable
C++ exceptions, even when exceptions have been turned off using -fno-exceptions.
Make the -fobjc-exceptions flag do the same thing, but for Objective-C exceptions.

C++ and Objective-C exceptions can also be disabled using -fno-cxx-excptions and
-fno-objc-exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1d6ab7af99a1fc059a6aa5da083640c1d94b07f7 24-Feb-2011 Chris Lattner <sabre@nondot.org> compute the integer width, not the memory width here. We want to know that
_Bool is 1 bit, not 8. This fixes an assertion on the testcase, which is
PR9304 and rdar://9045501.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
729b853f4bfa83e53c638a06a9dccf83b4e1f720 23-Feb-2011 Anders Carlsson <andersca@mac.com> Don't give an error for 'try' and 'throw' if they occur in system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
351ba91eaa6d30e523587b2d7ed676a5172c6e56 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Enhance Sema::DiagRuntimeBehavior() to delay some diagnostics to see if the related code is reachable. This suppresses some
diagnostics that occur in unreachable code (e.g., -Warray-bound).

We only pay the cost of doing the reachability analysis when we issue one of these diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
762696fff298627b72b63dbb0becf57f689801ca 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Update Sema::DiagRuntimeBehavior() to take an optional Stmt* to indicate the code the diagnostic is associated with.

This Stmt* is unused, but we will use it shortly for pruning diagnostics associated
with unreachable code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
935f0f01c1ed3c2052b797ac035d57a85b78adc4 21-Feb-2011 Chris Lattner <sabre@nondot.org> add one more case of mismatched input/output constraints.
When the mismatch is due to a larger input operand that is
a constant, truncate it down to the size of the output. This
allows us to accept some cases in the linux kernel and elsewhere.
Pedantically speaking, we generate different code than GCC, though
I can't imagine how it would matter:

Clang:
movb $-1, %al
frob %al

GCC:

movl $255, %eax
frob %al



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f0c4d28020fb13fdbf7d6fccfab1b7b6a118ad0e 21-Feb-2011 Chris Lattner <sabre@nondot.org> more code restructuring, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ca57b4b7658a031b74cda5ac504311998be8e343 21-Feb-2011 Chris Lattner <sabre@nondot.org> split the iteration loop out to a helper function, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4605c4f305dcf9a00baf120ba6e7c0a4f1e7bdc4 21-Feb-2011 Chris Lattner <sabre@nondot.org> fix a comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
34d49471e0b6386aefdc0f6bd15e4a4876ce5db1 21-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Clean up the tests for warning about unused function results given the
appropriate attribute. Add a bit more testing that finds a pretty bad
regression (since ~forever) in this warning. Fix it with a nice 2 line
change. =]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
da4b7cf09ebfd4e4098b516081fa9dae2f5c99e0 20-Feb-2011 Anders Carlsson <andersca@mac.com> Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b1fba3145392dc0cf54691576a4e6141e5081869 19-Feb-2011 Anders Carlsson <andersca@mac.com> There's no need to return early if we encounter a try/throw and exceptions are disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7f11d9cf5df1f8ce82af46eabc4ec5cec7d580b0 19-Feb-2011 Anders Carlsson <andersca@mac.com> Disallow try/catch/throw when exceptions are disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
337e550218128e7d922c09bb354fbc71de90c568 18-Feb-2011 Chris Lattner <sabre@nondot.org> Switch labels over to using normal name lookup, instead of their
own weird little DenseMap. Hey look, we now emit unused label
warnings deterministically, amazing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
57ad37823e198f977cac605dbfbaefb4daf325e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
dfbb02a16ac8c764b5ba1742450513d6212d2f9f 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0099530a2288df7c2140dd8992b7310b9f6930a9 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> 7bit-ize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
07f402cff25354c5f06f307f19b0c57c09d964bd 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Generalize the NRVO move-construction-based initialization routine. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
cc15f010672a13b38104a32e3cefc7adc07ffbf7 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4a46c77813af1241139b81a086b539e4d734cb86 21-Jan-2011 Douglas Gregor <dgregor@apple.com> We love parentheses

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f5d8f466c3eebaffc51468812bdcbe7f0fe4891a 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Promote the static getNRVOCandidate() function, which computed the
NRVO candidate for a return statement, to
Sema::getCopyElisionCandidate(), and teach it enough to also determine
the NRVO candidate for a throw expression. We still don't use the
latter information, however.

Along the way, implement core issue 1148, which eliminates copy
elision from catch parameters and clarifies that copy elision cannot
occur from function parameters (which we already implemented).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
711c52bb20d0c69063b52a99826fb7d2835501f1 05-Jan-2011 John McCall <rjmccall@apple.com> Refactor the application of type attributes so that attributes from
the declaration-specifiers and on the declarator itself are moved
to the appropriate declarator chunk. This permits a greatly
simplified model for how to apply these attributes, as well as
allowing a much more efficient query for the GC attribute.
Now all qualifier queries follow the same basic strategy of
"local qualifiers, local qualifiers on the canonical type,
then look through arrays". This can be easily optimized by
changing the canonical qualified-array-type representation.

Do not process type attributes as decl attributes on declarations
with declarators.

When computing the type of a block, synthesize a prototype
function declarator chunk if the decl-spec type was not a
function. This simplifies the logic for building block signatures.

Change the logic which inserts an objc_read_weak on a block
literal to only fire if the block has a __weak __block variable,
rather than if the return type of the block is __weak qualified,
which is not actually a sensible thing to ask.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5e3c67b4bd894a926282d24b4d0cbc0e123c9f4a 15-Dec-2010 John McCall <rjmccall@apple.com> Sundry missing lvalue-to-rvalue conversions. Also leave a TODO for the vital
future task of performing contextual conversion to size_t in a VLA size
expression. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bebbe0d9b7568ce43a464286bee49429489ef483 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Variadic templates: extend the Expr class with a bit that specifies
whether the expression contains an unexpanded parameter pack, in the
same vein as the changes to the Type hierarchy. Compute this bit
within all of the Expr subclasses.

This change required a bunch of reshuffling of dependency
calculations, mainly to consolidate them inside the constructors and
to fuse multiple loops that iterate over arguments to determine type
dependence, value dependence, and (now) containment of unexpanded
parameter packs.

Again, testing is painfully sparse, because all of the diagnostics
will change and it is more important to test the to-be-written visitor
that collects unexpanded parameter packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
49f4e1cbd839da27ff4814b4ea6d85a79f786cbd 10-Dec-2010 John McCall <rjmccall@apple.com> It's kindof silly that ExtQuals has an ASTContext&, and we can use that
space better. Remove this reference. To make that work, change some APIs
(most importantly, getDesugaredType()) to take an ASTContext& if they
need to return a QualType. Simultaneously, diminish the need to return a
QualType by introducing some useful APIs on SplitQualType, which is
just a std::pair<const Type *, Qualifiers>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9f71a8f4c7a182a5236da9e747d57cc1d1bd24c2 07-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4765fa05b5652fcc4356371c2f481d0ea9a1b007 06-Dec-2010 John McCall <rjmccall@apple.com> Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f6a1648197562e0b133440d612d9af297d0a86cc 04-Dec-2010 John McCall <rjmccall@apple.com> Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
12f78a6741a4cb3d904340f8d3d2714568b50e7a 02-Dec-2010 John McCall <rjmccall@apple.com> Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
44aa1f397855f130e88e62ffc1029f7f83bb5d2e 20-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r119838 "Don't warn for empty 'if' body if there is a macro that expands to nothing"
and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro.

Thanks to Abramo Bagnara for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a25b6a4b43e8b9611f7506e5fe1b448833b10a46 19-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:

if (condition)
CALL(0); // empty macro but don't warn for empty body.

Fixes rdar://8436021.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8113ecfa4e41e2c888b1794389dfe3bce6386493 10-Nov-2010 Ted Kremenek <kremenek@apple.com> Region-allocate all AttributeList objects from a factory object instead of manually managing them
using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these
objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up.

This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList
objects and then blows them away all at once. While conceptually simple, most of the changes in
this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications.

This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser
object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList
objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its
underlying allocator as we enter/leave key methods in the Parser. This means that we get
simple memory management while still having the ability to finely control memory use if necessary.

Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic
in many large files with attributes.

This fixes the leak reported in: <rdar://problem/8650003>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
11ab79030938209f50691acae0ddb65e72a58ca9 01-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit error when using a bound member function for something other than calling it.

Also avoids IRGen crashes due to accepting invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
b4eb64d8426c0eaa58d398961e0e74ff85063d7c 08-Oct-2010 John McCall <rjmccall@apple.com> Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers. rdar://problem/8232669



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
28164ab2ac1deea68cdb989f941728bf1860ce41 02-Oct-2010 Gabor Greif <ggreif@gmail.com> Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135

Some minor refacorings while I am here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
d2827af6f96d441d72315dbe6d8505c3be0f2aa6 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn when an expression result in a LabelStmt is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ce78461303f45fecb3460d1c49c9b71f27ad19c3 16-Sep-2010 Chris Lattner <sabre@nondot.org> improve the "enumeration value 'g' not handled in switch"
warning to handle multiple enumerators with one warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b3198178daf9d33466fc18e009e2c6692fdf29c0 16-Sep-2010 Ted Kremenek <kremenek@apple.com> Do not warn about empty bodies for 'if' statements if the body is expanded from a macro.

Fixes <rdar://problem/8436021>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
47bb27f16882e4f5ababdd0cf6642bb904a9aaf8 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e0ba9d1beeba01a96808c2fc61f9ca89acec313b 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Remove tabs I accidentally introduced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
fae962200efef618d1c24c14b9c3fed25876f059 03-Sep-2010 Chris Lattner <sabre@nondot.org> "I see dead code". IdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's usefulIdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's useful


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8c465e6494d16a19127873dc9bdc55177ac6b6fd 03-Sep-2010 John McCall <rjmccall@apple.com> Devirtualize Sema, kill off DeleteExpr and DeleteStmt, and reformat.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2d88708cbe4e4ec5e04e4acb6bd7f5be68557379 26-Aug-2010 John McCall <rjmccall@apple.com> Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
781472fe99a120098c631b0cbe33c89f8cef5e70 25-Aug-2010 John McCall <rjmccall@apple.com> Split FunctionScopeInfo and BlockScopeInfo into their own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5f1e0942a32657b625702aa52f82430d0120f424 24-Aug-2010 John McCall <rjmccall@apple.com> More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
60d7b3a319d84d688752be3870615ac0f111fb16 24-Aug-2010 John McCall <rjmccall@apple.com> OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9ae2f076ca5ab1feb3ba95629099ec2319833701 24-Aug-2010 John McCall <rjmccall@apple.com> Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d226f65006733ed7f709c3174f22ce33391cb58f 21-Aug-2010 John McCall <rjmccall@apple.com> DeclPtrTy -> Decl *



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
80a785c2452c73b7c41d4a867edcf5a090c78c46 13-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ea16110ce3a4fbb205735f0a55050bc11292e82c 13-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to issue warning when colllection expresion's type
does not implement 'countByEnumeratingWithState' API.
Implements radar 7634669.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e737f5041a36d0befb39ffeed8d50ba15916d3da 12-Aug-2010 Douglas Gregor <dgregor@apple.com> Move Sema's headers into include/clang/Sema, renaming a few along the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
faa3449a0f8b61ff25bd6aba78c50cabab213c24 11-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> IRGen support for functions returning objc object
types. Fixes PR7865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b60a77e453d32db0ab1914d28e175c2defc0eb65 01-Aug-2010 John McCall <rjmccall@apple.com> Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function. Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.

Turns off the jump-checker in a lot of cases in C++. rdar://problem/7702918


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3c46e8db99196179b30e7ac5c20c4efd5f3926d7 26-Jul-2010 Dan Gohman <gohman@apple.com> Fix namespace polution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ff331c15729f7d4439d253c97f4d60f2a7ffd0c6 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
35e12c90c1b107a75c5615aa76fdbd403661aaa6 15-Jul-2010 Douglas Gregor <dgregor@apple.com> Make the "unused result" warning a warning about run-time behavior, so
that we don't warn when there isn't going to be any computation anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ed8abf18329df67b0abcbb3a10458bd8c1d2a595 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
84745677f64863e025a6733cb29d0b94bc3a6ae2 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
6bc574daab3d3571d888cc4a21df67f2e2a14792 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Implement C++ DR299, which allows an implicit conversion from a class
type to an integral or enumeration type in the size of an array new
expression, e.g.,

new int[ConvertibleToInt(10)];

This is a GNU and C++0x extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
acb0bd85d30ecacbe872ca9d9cfac5d7b6038a43 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Re-improve recovery when the condition of a switch statement does not
have integral or enumeration type, so that we still check the contents
of the switch body. My previous patch made this worse; now we're back
to where we were previously.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c30614b7e2bad089f2509499379de509f33162d6 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Factor the conversion from a switch condition to an integral or
enumeration type out into a separate, reusable routine. The only
functionality change here is that we recover a little more
aggressively from ill-formed switch conditions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6623584c0ec508110d75572eef092bf98fedf3f4 29-Jun-2010 Douglas Gregor <dgregor@apple.com> With packed enums, an enumerator's value may be stored in more bits
than the enumeration type itself takes. Fixes PR7477.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0c293ea13d452c1a47a05ada5a5ee9acc69c66cc 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
43dec6bbde2d0a16c35978983761c8b7030c8e18 22-Jun-2010 Douglas Gregor <dgregor@apple.com> Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2ade35e2cfd554e49d35a52047cea98a82787af9 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6907fbe758d23e1aec4c0a67e7b633d1d855feb4 12-Jun-2010 John McCall <rjmccall@apple.com> When deciding whether an expression has the boolean nature, don't look through
explicit casts. Fixes PR7359.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0fb97083cc0f8a82e404e22991ae80d2216e71d5 18-May-2010 John McCall <rjmccall@apple.com> If a switch condition is constant, don't warn about missing enum cases.
If a switch condition is constant, warn if there's no case for it.

Constant switch conditions do come up in reasonable template code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44e 15-May-2010 John McCall <rjmccall@apple.com> Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d86c477fb5d3fc34864afecbbb5443da9355e8fb 15-May-2010 Douglas Gregor <dgregor@apple.com> Implement a simple form of the C++ named return value optimization for
return statements. We perform NRVO only when all of the return
statements in the function return the same variable. Fixes some link
failures in Boost.Interprocess (which is relying on NRVO), and
probably improves performance for some C++ applications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
3c9034cb7ff1d6c1e4ecd1b44c98f553df013c7c 15-May-2010 Douglas Gregor <dgregor@apple.com> Recognize when the named return value optimization applies in a
"return" statement and mark the corresponding CXXConstructExpr as
elidable. Teach CodeGen that eliding a temporary is different from
eliding an object construction.

This is just a baby step toward NRVO.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
eecf38f821fe8e113722096b77da7d68b26d28d1 06-May-2010 Douglas Gregor <dgregor@apple.com> Fixed DISABLE_SMART_POINTERS breakage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
586596fd7f7a336a2847b300c80614dcf39ab6d5 06-May-2010 Douglas Gregor <dgregor@apple.com> Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

(1) Forgetting to destroy temporaries created in the condition (!),
(2) Destroying the temporaries created in the condition *before*
converting the condition to a boolean value (or, in the case of a
switch statement, to an integral or enumeral value), or
(3) In a for statement, destroying the condition's temporaries at
the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
160b5630aa781ac348303e1ae088d27016637778 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Refactor Objective-C @catch parameter checking by detangling it from
function-parameter checking and splitting it into the normal
ActOn*/Build* pair in Sema. We now use VarDecl to represent the @catch
parameter rather than the ill-fitting ParmVarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8f5e3dd32e443768d9dbbad7191e123e6733750c 24-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
aab64d0b7f41ed30b15ba9210ed859424cbc7455 23-Apr-2010 Chris Lattner <sabre@nondot.org> Implement PR6845. We allow matching constraints to have different
input and output types when the smaller value isn't mentioned in the
asm string. Extend this support from integers to also allowing
fp values to be mismatched (if not mentioned in the asm string).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c3203e7ee1464a096f341c2e2a83a10be2da000a 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Template instantiation for the Objective-C "fast enumeration"
statement, i.e.,

for (element in collection) {
// do something
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8fdc13a78a43f09ac396e682c35d57ca0b48216d 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Template instantiation for Objective-C++ @synchronized statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d1377b25a36adfe6604f78cbd3a23a07cf0f29e6 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement template instantiation for Objective-C++ @throw statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2b334bb3126a67895813e49e6228dad4aec0b4d6 17-Apr-2010 Chris Lattner <sabre@nondot.org> make our existing "switch on bool" warning work for C. Since
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d6e44a3c4193bd422bfa78c8086fb16bb2168e34 17-Apr-2010 Douglas Gregor <dgregor@apple.com> Collapse the three separate initialization paths in
TryStaticImplicitCast (for references, class types, and everything
else, respectively) into a single invocation of
InitializationSequence.

One of the paths (for class types) was the only client of
Sema::TryInitializationByConstructor, which I have eliminated. This
also simplified the interface for much of the cast-checking logic,
eliminating yet more code.

I've kept the representation of C++ functional casts with <> 1
arguments the same, despite the fact that I hate it. That fix will
come soon. To satisfy my paranoia, I've bootstrapped + tested Clang
with these changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
209acbd6d0c1b4444eb8c1682717753e1cbe38de 07-Apr-2010 John McCall <rjmccall@apple.com> Devote a special diagnostic to the typo
(void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
849b243d4065f56742a4677d6dc8277609a151f8 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
6bb8017bb9e828d118e15e59d71c66bba323c364 30-Mar-2010 John McCall <rjmccall@apple.com> Propagate the "found declaration" (i.e. the using declaration instead of
the underlying/instantiated decl) through a lot of API, including "intermediate"
MemberExprs required for (e.g.) template instantiation. This is necessary
because of the access semantics of member accesses to using declarations:
only the base class *containing the using decl* need be accessible from the
naming class.

This allows us to complete an access-controlled selfhost, if there are no
recent regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f031774aa2638b4d3f487e7e44180c1f89b867ef 30-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add Support for 'warn_unused_result" attribute on
objective-c methods. (radar 7418262).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
fe6b2d481d91140923f4541f273b253291884214 30-Mar-2010 Douglas Gregor <dgregor@apple.com> Optimize PartialDiagnostic's memory-allocation behavior by placing a
cache of PartialDiagnostic::Storage objects into an allocator within
the ASTContext. This eliminates a significant amount of malloc
traffic, for a 10% performance improvement in -fsyntax-only wall-clock
time with 403.gcc's combine.c.

Also, eliminate the RequireNonAbstractType hack I put in earlier,
which was but a symptom of this larger problem.

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0faede6f31b07bcec7b776f2b420c3ea9bb3e58c 12-Mar-2010 John McCall <rjmccall@apple.com> Improve the unused-value check to look into comma expressions and filter out
voids in sub-expressions. Patch by Mike M!

Fixes PR4806.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9ea9bdbc14374f7bacdb50d3e52c664ff12150ff 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.

The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.

Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f9f627dbbc62fbf51b906c24c783b4249dc7e9bb 01-Mar-2010 Douglas Gregor <dgregor@apple.com> Don't warn about case-value conversions from a negative value to a
larger unsigned value, since this is implementation-defined
behavior. (We previously suppressed this warning when converting from
a signed value to an unsigned value of the same size).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2853eac24e2e70a74d7da817653b0528b976039f 18-Feb-2010 Douglas Gregor <dgregor@apple.com> Don't diagnose overflow in case statements when the conversion is a
signed<->unsigned conversion with the same bit width. Fixes
<rdar://problem/7658121>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
30ab37122300a5f6664b8ae2d0b43b4396eb6bcb 18-Feb-2010 Douglas Gregor <dgregor@apple.com> For -Wswitch-enum warnings, be sure to look through typedefs of enum
types. Fixes <rdar://problem/7643909>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4dffad64c5c7106dc5ac506be94944299c8f7bc3 11-Feb-2010 Douglas Gregor <dgregor@apple.com> When we have a dependent direct initializer but not a dependent
variable type, we can (and should) still check for completeness of the
variable's type. Do so, to work around an assertion that shows up in
Boost's shared_ptr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ba915af51ced751c46e7c2b9c6f3b59d2e668825 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Warn when cases are missing from a switch on a value of enumeration
type (-Wswitch), from Michal!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
04a67a6aa3dfdc92d57f7f8d93ba397348c868a4 05-Feb-2010 John McCall <rjmccall@apple.com> Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a1a396df16c02b22983b5c9592022fd9237d4866 03-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Implement Doug's suggestion. Eliminate the Stmts pointer from CXXTryStmt and instead allocate the statements after the object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b0e4cb6a88a4b4bd2ecdcc622e852fa3e20290c9 03-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Remove the SmallVector from CXXTryStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a873dfc9e7314681bb37efd9ab185045de121e43 03-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement the lvalue-to-rvalue conversion where needed. The
lvalue-to-rvalue conversion adjusts lvalues of qualified, non-class
type to rvalue expressions of the unqualified variant of that
type. For example, given:

const int i;
(void)(i + 17);

the lvalue-to-rvalue conversion for the subexpression "i" will turn it
from an lvalue expression (a DeclRefExpr) with type 'const int' into
an rvalue expression with type 'int'. Both C and C++ mandate this
conversion, and somehow we've slid through without implementing it.

We now have both DefaultFunctionArrayConversion and
DefaultFunctionArrayLvalueConversion, and which gets used depends on
whether we do the lvalue-to-rvalue conversion or not. Generally, we do
the lvalue-to-rvalue conversion, but there are a few notable
exceptions:
- the left-hand side of a '.' operator
- the left-hand side of an assignment
- a C++ throw expression
- a subscript expression that's subscripting a vector

Making this change exposed two issues with blocks:
- we were deducing const-qualified return types of non-class type
from a block return, which doesn't fit well
- we weren't always setting the known return type of a block when it
was provided with the ^return-type syntax

Fixes the current Clang-on-Clang compile failure and PR6076.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2877998bd8db2fac1c56430a4edcfa0ce138aff9 31-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Really trivial patch to accept pointer to const void in indirect goto. Despite
the lack of documentation, this matches the behavior of GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
966146e89141804ff6492739a2a6e6592ca671c7 31-Jan-2010 Anders Carlsson <andersca@mac.com> Remove the SmallVectors from AsmStmt. Fixes PR6105.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ff93dbd887e40588ed55d135037bb9287488b285 30-Jan-2010 Anders Carlsson <andersca@mac.com> Use IdentifierInfo * instead of std::string for the AsmStmt names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
fdba9c069023f686e2608affde02c82131ee1cf8 30-Jan-2010 Anders Carlsson <andersca@mac.com> Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f959fb5fb82ae2cbdf8635d734613a01818fb7bf 30-Jan-2010 Anders Carlsson <andersca@mac.com> StringRef-ize the TargetInfo::ConstraintInfo constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c6acbc58a7aef0a3382775424c80e9534b54b2ed 29-Jan-2010 Anders Carlsson <andersca@mac.com> Get rid of another old PerformCopyInitialization call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
703e39486689d6660e75f6b6de0068db031a51c7 24-Jan-2010 Anders Carlsson <andersca@mac.com> Implement instantiation of AsmStmts (Crazy, I know)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7e52de4b45286d057b367bb1f9283a1e32d79252 24-Jan-2010 Chris Lattner <sabre@nondot.org> fix PR6034, a crash on invalid where the switch stack would get
unbalanced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
eec51cf1ba5f0e62c9cdb81b5c63babdd6e649ab 20-Jan-2010 John McCall <rjmccall@apple.com> Give UnresolvedSet the ability to store access specifiers for each declaration.
Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a3899eb5e30426b00b80232a15ae557dd4caa5b8 20-Jan-2010 Mike Stump <mrs@apple.com> Implement goto inside of blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3b11fd3b52e7b88233c602407c151d07cb093e75 04-Jan-2010 Mike Stump <mrs@apple.com> Remember if the AsmStmt came from Microsoft-style inline assembly code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
54d76db0aa7107597cac0b80d8e138a37e6d1de9 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d6542d8efcf8389c3aab764f9e29ac284e16eda6 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't use the location information but we did spend a bunch of time building faked-up TypeLocs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d20254f2875d0004c57ee766f258dbcee29f4841 21-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR4010: add support for the warn_unused_result for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bd8f371fec3d69e5fd8e173e1bf4020225dd47d9 18-Dec-2009 Douglas Gregor <dgregor@apple.com> Try to de-bork DISABLE_SMART_POINTERS build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
18ef5e28a9a2677f8b1dce1fb2638d66e0a1621f 18-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:

- InitializationSequence now has a "C conversion sequence" category
and step kind, which falls back to
- Changed the diagnostics for returns to always have the result type
of the function first and the type of the expression second.
CheckSingleAssignmentConstraints to peform checking in C.
- Improved ASTs for initialization of return values. The ASTs now
capture all of the temporaries we need to create, but
intentionally do not bind the tempoary that is actually returned,
so that it won't get destroyed twice.
- Make sure to perform an (elidable!) copy of the class object that
is returned from a class.
- Fix copy elision in CodeGen to properly see through the
subexpressions that occur with elidable copies.
- Give "new" its own entity kind; as with return values and thrown
objects, we don't bind the expression so we don't call a
destructor for it.

Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6864748fc9a780e6db0bb5a7bd20aa889882dc94 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix semantic diagnostics that embed English works, from Nicola Gigante!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0ece491d8f62ce67f047491a6703fac0d3bd4ff4 15-Dec-2009 Anders Carlsson <andersca@mac.com> ShouldDestroyTemporaries? I don't think so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0de55e7e6b8a53c5d1f2e9a811fd0a4ea13ed5b0 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Fix a thinko where we weren't always performing unary conversions on the switch condition, fixing PR5612

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
be724bab2ba7ad47aebced25e7c8ec551eb72d28 25-Nov-2009 Douglas Gregor <dgregor@apple.com> When the condition of a switch() statement is semantically invalid,
still parse the body of the switch to try to avoid spurious
diagnostics. Fixes PR5606.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a0d3ca1ea5578bc736bb71bcec50ab41fefc87b9 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Refactor ActOnFinishSwitchStmt to simplify it further

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0be3193b3bc695eb4b0debc7f85bc832026ce862 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Refactor ActOnFinishSwitchStmt to simplify and reduce nesting

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
99e9b4d172f6877e6ba5ebe75bb8238721f5e01c 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
f21bac640870db0569e697a8a14f59f6ca069f80 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Require a class type to be complete before probing its conversion
functions for a switch condition's conversion to integral or
enumeration type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
84fb9c0be621c9e4ca4e56f67dae2a0bb6e44821 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement conversion from a switch condition with class type to an
integral or enumeration type (vi user-defined conversions). Fixes PR5518.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a7cf23a72b0846fc5aacf3f38bb8c8f9e76784cf 19-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Don't issue spurious diagnostic with Obj-C fast enumeration.
(radar 7409165).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a4923eb7c4b04d360cb2747641a5e92818edf804 16-Nov-2009 Douglas Gregor <dgregor@apple.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
66724ea67d7d598b937d86fa66f03f09a1c758f3 14-Nov-2009 Douglas Gregor <dgregor@apple.com> If we attempt to add a constructor template specialization that looks
like a copy constructor to the overload set, just ignore it. This
ensures that we don't try to use such a constructor as a copy
constructor *without* triggering diagnostics at the point of
declaration.

Note that we *do* diagnose such copy constructors when explicitly
written by the user (e.g., as an explicit specialization).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
df317bf71653eeb235da8337b1e8e790f9653aa4 04-Nov-2009 Mike Stump <mrs@apple.com> Refine volatile handling, specifically, we must have the canonical
type to look at the volatile specifier. I found these all from just
hand auditing the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
73c39abdbb79927605d740c93dd9629e3e4f9bfe 20-Oct-2009 Eli Friedman <eli.friedman@gmail.com> Remove default argument for ImpCastExprToType. Add appropriate argument
to all callers. Switch a few other users of CK_Unknown to proper cast
kinds.

Note that there are still some situations where we end up with
CK_Unknown; they're pretty easy to find with grep. There
are still a few missing conversion kinds, specifically
pointer/int/float->bool and the various combinations of real/complex
float/int->real/complex float/int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
12356b119032edd64e9c32f9f01920d12c2acc57 17-Oct-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Fix for PR5190, Credit to Zhanyong Wan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5f04881eb025f61396d0555d8173730fe2759e0a 16-Oct-2009 Chris Lattner <sabre@nondot.org> Implement PR4407 - missing warnings on case value overflow,
patch by Zhanyong Wan!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bc8d42c6f1565c0b2f93ad524edebfd7a4e6cac6 13-Oct-2009 Chris Lattner <sabre@nondot.org> make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5a881bb09928b7ade891efc680088aaad276f8d6 12-Oct-2009 John McCall <rjmccall@apple.com> Implement -Wparentheses: warn about using assignments in contexts that require
conditions. Add a fixit to insert the parentheses. Also fix a very minor
possible memory leak in 'for' conditions.

Fixes PR 4876 and rdar://problem/7289172



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1be8aee8745e8b814ad2f151aa214b0ef07833db 02-Oct-2009 Douglas Gregor <dgregor@apple.com> When the return type of a function is dependent, don't perform any
of the flow-control checks for falling off the end of a function,
since the return type may instantiate to void. Similarly, if a
return statement has an expression and the return type of the function
is void, don't complain if the expression is type-dependent, since
that type could instantiate to void.

Fixes PR5071.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
16b10378a93e8644008289fd86c1caf737d1395c 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> This patch does the following.
1) Issue digsnostics in non-fragile ABI, when an expression
evaluates to an interface type (except when it is used to
access a non-fragile ivar).
2) Issue unsupported error in fragile ABI when an expression
evaluates to an interface type (except when it is used to
access a fragile ivar).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
09105f52b1f28cbb1374c27c3c70f5517e2c465d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7765934ad7e157b5fcf925792a38e01b1edbcf8a 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
154440e6a8fa6ac5bca395876d79b530b39a2c1c 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f53b4433abb7a3bc14c0329d3175cbc291280137 18-Aug-2009 Anders Carlsson <andersca@mac.com> Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return expr inside a CXXExprWithTemporaries if needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
419cfb318cd69b6c717019288d5a3822be18d8f9 16-Aug-2009 Chris Lattner <sabre@nondot.org> Improve the diagnostic emitted when an unused ObjC property getter
is found. Instead of complaining about a generic "unused expr",
emit:
t.m:7:3: warning: property access result unused - getters should not have side effects

While objc property getters *could* have side effects, according to
the language best practices, they *shouldn't*. Hopefully the
diagnostic now gets this across.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a5e42a82ce055f29f3733f3a1f10da6cb9877dee 14-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> objc2's foreach statement's selector type can be
a block pointer too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3af708ff19e4ae2bf9e40550548361b00e5916bf 01-Aug-2009 Anders Carlsson <andersca@mac.com> More warnings for unused expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
754431107b61a0523df5271c2876a73dd5a051e9 31-Jul-2009 Anders Carlsson <andersca@mac.com> Diagnose unused expression results for all statements, just not compound statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
636463e4c43be15e2f0fd0b8a08667f3066d8af7 31-Jul-2009 Anders Carlsson <andersca@mac.com> Factor code out into a DiagnoseUnusedExprResult function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6217b80b7a1379b74cced1c076338262c3c980b3 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c447aba04527a71d254b151f79f444d1cbe83ce9 29-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Check for identical types in C++ catch expression. Patch by Erik Verbruggen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
35366a67baa970c287c714c957cf78a4131cf60d 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1a1a6e2bd4c5aefd7fd643cf25915f9623a02e59 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f49545602089be5b1f744e04326b8a566f6d8773 16-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
40b598eea1310ec9ed554d56ce3e25b34c585458 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e98da2e7af16056a53db327b520d4b53b4be5e7a 24-Jun-2009 Anders Carlsson <andersca@mac.com> Support for [class.local]p4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
68584ed35ad819a1668e3f527ba7f5dd4ae6a333 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
8662587fa75d3fb04f873e265841c9314c7f5523 31-May-2009 Chris Lattner <sabre@nondot.org> Downgrade an error about "return in a no-return function" from being
an error to being a warning that defaults to error. If you want this to
be a warning, you have to explicitly pass -Winvalid-noreturn to clang to
map it back to a warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a0ab25d2808fe77ffff54f25a015893791dfd4b6 30-May-2009 Anders Carlsson <andersca@mac.com> ActOnReturnStmt should also take a FullExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7f537c18c7029e73f0bd555be3782c066e7e2c1e 17-May-2009 Anders Carlsson <andersca@mac.com> Make ActOnWhileStmt take a FullExprArg for the condition expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6b1d283fe879fb11d7ce7a69feecf66e77b0eaf3 17-May-2009 Anders Carlsson <andersca@mac.com> Make ActOnExprStmt take a FullExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a99fad8ff134273fe85f2970c7d89133d1218900 17-May-2009 Anders Carlsson <andersca@mac.com> Add the FullExprArg wrapper and use it for if statement conditions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
390b4cc8b45a05612349269ef08faab3e4688f06 16-May-2009 Mike Stump <mrs@apple.com> Reflow some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
03d77760a5db7990724b6901cea958a673ce0b39 15-May-2009 Anders Carlsson <andersca@mac.com> Instantiate return statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3351f1145aa91ddd8022fcd3ca16c219db9e8277 03-May-2009 Chris Lattner <sabre@nondot.org> allow references to the larger value in a tied constraint
from the asm string, but reject references to the smaller one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
58bce89d12b1dfba16637ce3754d6cb24c3099bb 03-May-2009 Chris Lattner <sabre@nondot.org> code cleanup, avoid shadowing i.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
72056a237c536ee63285ab0850cb50f299281767 03-May-2009 Eli Friedman <eli.friedman@gmail.com> Don't insert an extra ParenExpr around asm operands.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f69fcaeb3843297757251a19f0a6f5bbffed7f32 03-May-2009 Chris Lattner <sabre@nondot.org> If we have mismatched integer tied operands, but the operand
number is not mentioned in the asm string, let it past sema.
Right now these are currently rejected by the llvm code generator
but this will be fixed next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c1f3b28004a032f4cd13721d4d884c6dcec29c31 03-May-2009 Chris Lattner <sabre@nondot.org> avoid a crash when we encounter a implicit cast of the paren expr due to
promotions. This should be fixed by not modeling asm operands (which
require the ()'s according to the grammar) as not being paren exprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7adaa18ef3be65971cd41cc61dd739baeb02af10 03-May-2009 Chris Lattner <sabre@nondot.org> rename some variables, improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
806503f8c839d7f5ebf3fbf7ee848c179be76dd2 03-May-2009 Chris Lattner <sabre@nondot.org> refactor matched operand type checking to happen after the AsmStmt is created,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e9146f2e9f1c4e281544e8c080934c72d41012ca 01-May-2009 Anders Carlsson <andersca@mac.com> Replace more release+static_cast with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f1b1d59a3f0650ab97b04235a14ae4549ca1c656 01-May-2009 Anders Carlsson <andersca@mac.com> Replace a bunch of static_cast + release with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6c92fa75e62937f9738696840efcb258560f4568 29-Apr-2009 Mike Stump <mrs@apple.com> Fixup Sema and CodeGen for block literal attributes when the return
type and argument types are missing, and let return type deduction
happen before we give errors for returning from a noreturn block.
Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
19c30c00e5e01e4608a43c7deb504f343f09e46d 29-Apr-2009 Mike Stump <mrs@apple.com> Sema and CodeGen support for attributes on blocks. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f7c41dab1a8de29b0991e853b8822bb0d1ddc01c 29-Apr-2009 Mike Stump <mrs@apple.com> Implement sema checking for noreturn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
972041f45bdf8df7ea447221292d7827466ba94b 27-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Improve validation of C++ exception handling: diagnose throwing incomplete types and jumps into protected try-catch scopes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
49ac88166d36f8c436780694f2ce955acde87c6a 26-Apr-2009 Chris Lattner <sabre@nondot.org> implement PR4077: [Linux kernel] inscrutable error on inline asm input/output constraint mismatch
Before we emitted:

$ clang t.c -S -m64
llvm: error: Unsupported asm: input constraint with a matching output constraint of incompatible type!

Now we produce:
$ clang t.c -S -m64
t.c:5:40: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'int'
asm volatile("foo " : "=a" (a) :"0" (b));
~~~ ~^~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d68876176a0d2c19e3864e7d38f6036c4f72f0a3 26-Apr-2009 Chris Lattner <sabre@nondot.org> in a tied operand, don't copy over the name or constraint string, just the flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2819fa85651526d59ade4fdc9da2cadd7b132973 26-Apr-2009 Chris Lattner <sabre@nondot.org> pull operands names "[foo]" into ConstraintInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
432c86969eced2ce658b3f3f2aa7407c8864f21b 26-Apr-2009 Chris Lattner <sabre@nondot.org> pull the constraint string into the ConstraintInfo struct
instead of passing it around in addition to it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
44def070435a2b5d67f0534f7a3a85a7389d60f2 26-Apr-2009 Chris Lattner <sabre@nondot.org> change TargetInfo::ConstraintInfo to be a struct that contains
the enum along with some other data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
16f0049415ec596504891259e2a83e19871c0d52 26-Apr-2009 Chris Lattner <sabre@nondot.org> split ObjC and C++ Statements out into their own headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a868a203a18571d091e5d226f5f100d4440f3d94 21-Apr-2009 Chris Lattner <sabre@nondot.org> implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
38c5ebd7b1b65304c7b5c7b9bf3f9162df22e77d 19-Apr-2009 Chris Lattner <sabre@nondot.org> add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid
calling into the jump checker when a function or method is known to contain
no VLAs or @try blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ad56d684259f706b7c0ae5ad9c23adb4f2926817 19-Apr-2009 Chris Lattner <sabre@nondot.org> Add location info for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bcfce66584e47bb07f49a86b7cb39b4fdd269a5a 18-Apr-2009 Chris Lattner <sabre@nondot.org> abstract the SwitchStack for blocks just like we do the goto labels.
This fixes a crash on invalid (test10). rdar://6805469


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
ea29a3a0d6948c4a51a261d19ec1a585d2a9c779 18-Apr-2009 Chris Lattner <sabre@nondot.org> refactor some code, adding a new getLabelMap() accessor method
so that clients can't poke the function-local one when they really
want the current block label. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
93c4945c9ead2d374fe3fc528e3017c7167265be 13-Apr-2009 Chris Lattner <sabre@nondot.org> if we already know that a decl is invalid in an @catch, don't verify its type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
e2b6833d445c7a4ce64f1816c05f176ba1740aca 12-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Parse deleted member functions. Parsing member declarations goes through a different code path that I forgot previously.
Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now.
The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
682bf92db408a6cbc3d37b5496a99b6ef85041ec 29-Mar-2009 Chris Lattner <sabre@nondot.org> Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc). These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b28317a8e5e0e2953d1e5406d753d6c3c7f1e7d2 28-Mar-2009 Chris Lattner <sabre@nondot.org> Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer. Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the
entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy. I will rectify
this with a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7e24e82a70a2c681f4291a3397bcd1e1005f251a 28-Mar-2009 Chris Lattner <sabre@nondot.org> rename some methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
33083823342649b1fccec856c1f239c09fc0d7e1 26-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Sanity-check argument to indirect goto.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bbf462314b1dc8e422b7c4dd4cac47e566aedf6d 26-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3869: actually enforce that the argument of an indirect goto
is of type void*. I'll try to add the appropriate checking later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
810f6d5d6223adaab0ccf0139f40de6484ad1bb5 13-Mar-2009 Chris Lattner <sabre@nondot.org> introduce a new -fheinous-gnu-extensions flag that enables really
really horrible extensions that are disabled by default but that can
be accepted by -fheinous-gnu-extensions (but which always emit a
warning when enabled).

As our first instance of this, implement PR3788/PR3794, which allows
non-lvalues in inline asms in contexts where lvalues are required. bleh.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d8eb456289a81728f9aac77ac0a4db0ea9cc231a 13-Mar-2009 Steve Naroff <snaroff@apple.com> Reimplement fix for <rdar://problem/6451399> problems with labels and blocks.

This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris).

The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
caaacecb2b64e6d2e402533baffda4cb540f4145 13-Mar-2009 Steve Naroff <snaroff@apple.com> Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).

Will replace with something better today...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
2ff0f42a962fec5a6300b5986297b417db173e6a 11-Mar-2009 Chris Lattner <sabre@nondot.org> position the caret properly on asm string diagnostics, e.g.:

Sema/asm.c:64:9: error: invalid % escape in inline assembly string
asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}}
~~^~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
fb5058ef67c054296c88db18ab1b3717845cb71d 11-Mar-2009 Chris Lattner <sabre@nondot.org> add plumbing to report diagnostics back through sema for malformed asmstrings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
24e1e707b4c362f18e371e2bbf054a8345b57bfa 04-Mar-2009 Chris Lattner <sabre@nondot.org> Change Parser::ParseCaseStatement to use an iterative approach to parsing
multiple sequential case statements instead of doing it with recursion. This
fixes a problem where we run out of stack space parsing 100K directly nested
cases.

There are a couple other problems that prevent this from being useful in
practice (right now the example only parses correctly with -disable-free and
doesn't work with -emit-llvm), but this is a start.

I'm not including a testcase because it is large and uninteresting for
regtesting.

Sebastian, I would appreciate it if you could scrutinize the smart pointer
gymnastics I do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d198abae5938262e501a409e833bf01ca8b8253e 04-Mar-2009 Steve Naroff <snaroff@apple.com> Change a warning to an error...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9d40ee50f8a013e5253101648092cf0daa76c335 03-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f50cb369273c6bd26c9629df92ee53f1d8af4149 03-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7ba138abd329e591a8f6d5001f60dd7082f71b3b 03-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6640991> Exception handling executes wrong clause (Daniel, please verify).

Also necessary to fix:

<rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements
<rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c97fb9a394ce2cc5e664fcb472e93553528378ad 03-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6635908> crash on invalid


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
93b2bdb866d49e3dab4623a822db281042e87382 01-Mar-2009 Daniel Dunbar <daniel@zuster.org> ObjCAtCatchStmt's ParamStmt is always a DeclStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f3cf89737965352ee02026992e2dc735824e185e 28-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6451399> problems with labels and blocks.

- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6032979a5d091e5607c7c467400449727d9beb5a 22-Feb-2009 Anders Carlsson <andersca@mac.com> Match gcc and always perform array/function conversion for asm input exprs. Fixes PR3641.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
026dc96ac6ece60da5e1b98e2a71bd0ff0939fd8 14-Feb-2009 Chris Lattner <sabre@nondot.org> Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
of its result.
3) extend isUnusedResultAWarning to directly return the loc and range
info that should be reported to the user. Make it substantially more
precise in some cases than what was previously reported.
4) teach isUnusedResultAWarning about CallExpr to decls that are
pure/const/warnunusedresult, fixing a fixme.
5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
pass in integers and use %select.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9653db7bd0e3665b955a0445859285f2e1e7dacd 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Remove DeclGroupOwningRef, since we intend for declarations to be owned
by DeclContexts (always) rather than by statements.

DeclContext currently goes out of its way to avoid destroying any
Decls that might be owned by a DeclGroupOwningRef. However, in an
error-recovery situation, a failure in a declaration statement can
cause all of the decls in a DeclGroupOwningRef to be destroyed after
they've already be added into the DeclContext. Hence, DeclContext is
left with already-destroyed declarations, and bad things happen. This
problem was causing failures that showed up as assertions on x86 Linux
in test/Parser/objc-forcollection-neg-2.m.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4ab2414f297fab1b290e77bfc3b049ccf45eda81 12-Feb-2009 Steve Naroff <snaroff@apple.com> Sema::ActOnObjCAtThrowStmt(): return from recently added errors. Thanks Chris!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3dcfe10a6801eb52f4c20f1242bea0a3a98aa146 12-Feb-2009 Steve Naroff <snaroff@apple.com> Turn warning into error. Minor incompatibility with GCC (for scalar types, GCC only produces a warning).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e21dd6ffef4585fa43cd3586ed971217d65bf56c 11-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6243503> [sema] @throw; accepted outside catch block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
7151bbb55c8a437073e42f74348c3fd5f1d5b410 11-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6206858> [sema] type check @throw statements.

Added a FIXME to handle 'rethrow' check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8189cde56b4f6f938cd65f53c932fe1860d0204c 07-Feb-2009 Ted Kremenek <kremenek@apple.com> Overhaul of Stmt allocation:
- Made allocation of Stmt objects using vanilla new/delete a *compiler
error* by making this new/delete "protected" within class Stmt.
- Now the only way to allocate Stmt objects is by using the new
operator that takes ASTContext& as an argument. This ensures that
all Stmt nodes are allocated from the same (pool) allocator.
- Naturally, these two changes required that *all* creation sites for
AST nodes use new (ASTContext&). This is a large patch, but the
majority of the changes are just this mechanical adjustment.
- The above changes also mean that AST nodes can no longer be
deallocated using 'delete'. Instead, one most do
StmtObject->Destroy(ASTContext&) or do
ASTContextObject.Deallocate(StmtObject) (the latter not running the
'Destroy' method).

Along the way I also...
- Made CompoundStmt allocate its array of Stmt* using the allocator in
ASTContext (previously it used std::vector). There are a whole
bunch of other Stmt classes that need to be similarly changed to
ensure that all memory allocated for ASTs comes from the allocator
in ASTContext.
- Added a new smart pointer ExprOwningPtr to Sema.h. This replaces
the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
'delete' to free memory instead of a Stmt's 'Destroy' method.

Big thanks to Doug Gregor for helping with the acrobatics of making
'new/delete' private and the new smart pointer ExprOwningPtr!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
98eb8a7a702b95183ed015706b1f1c66f5cb27a4 04-Feb-2009 Mike Stump <mrs@apple.com> Add support for blocks with explicit return types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
500d3297d2a21edeac4d46cbcbe21bc2352c2a28 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
03eb543cf7ebee463b33b5802b83ac92c21770cf 27-Jan-2009 Anders Carlsson <andersca@mac.com> If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
20c6b3b85e186cd52d5d99489132d71d498159eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e6ea27995fb15add0de47588b4226049fa0753e5 21-Jan-2009 Anders Carlsson <andersca@mac.com> Fix an inline asm sema bug that I introduced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d9fca6e3950346ea503f92f27ed0f9d8edde9feb 20-Jan-2009 Anders Carlsson <andersca@mac.com> Improvements to Sema of asm statements. Fixes <rdar://problem/6156893>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4afa39deaa245592977136d367251ee2c173dd8d 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
431e90e887c21c0d0d56fc12a2d359df8d53ea66 18-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert ObjC statement actions to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3037ed0a27dba62e522304183718efc149e8b6d9 18-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert asm statement action to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4cffe2fd5c23168bc08f0453c684cbd3f79471d3 18-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert more statement actions to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
f05b1520d6f175acbfc3913489f4dfa842875ec4 17-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert some more statement actions to smart pointers.
Fix a type error; parser wanted to pass the third part of a for-statement as a statement; should be expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
de307473448fb3cebcb4c10090728300b53bca03 11-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert some more actions to smart pointers.
No performance regression in my basic test.
Also fixed a type error in ActOnFinishSwitchStmt's arguments (body is a stmt).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
562489e0c8bbfc2490377542590e048cde822934 31-Dec-2008 Anders Carlsson <andersca@mac.com> Perform default function/array conversion for input arguments to inline asm statements if the input expr can be a memory operand

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
117054a99f4994e4ec8a1fc904b554e1f2dc9b29 28-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a two more statement actions to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8351da06ca3082dfd49dd8e3c1785a986920f57c 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Full AST support and better Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4b07b2968f87f3cd5a3d8c76145f1cbfd718d42d 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Partial AST and Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
a60528cdac7deee3991c2b48af4df4f315e49e9d 21-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a few Stmt actions to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
e878eb035b343d7d819c092102364ec9849716ae 18-Dec-2008 Chris Lattner <sabre@nondot.org> This is valid in C++.
void foo() { return foo(); }



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
65ce04bef06696379682410f399f37b43996d824 18-Dec-2008 Chris Lattner <sabre@nondot.org> Merge function-return.c into function.c

Fix PR2790 by making a warning an EXTWARN instead of EXTENSION.
Add a new EXTENSION warning for "return (some void expression);"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
898574e7496ba8fd76290079d3a9d06954992734 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
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
/external/clang/lib/Sema/SemaStmt.cpp
d3a61d5ec5357d19b7c0b6b599231e68dc5e237f 01-Dec-2008 Anders Carlsson <andersca@mac.com> Use VerifyIntegerConstantExpression for case values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d162584991885ab004a02573a73ce06422b921fc 24-Nov-2008 Chris Lattner <sabre@nondot.org> Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5f4a6829dc58cab2f76e2b98492859aa3b91e3f2 24-Nov-2008 Chris Lattner <sabre@nondot.org> Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
08631c5fa053867146b5ee8be658c229f6bf127c 23-Nov-2008 Chris Lattner <sabre@nondot.org> Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:

Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6dde0d5dc09f45f4d9508c964703e36fef1a0198 22-Nov-2008 Anders Carlsson <andersca@mac.com> Case values must be evaluated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
51fe996231b1d7199f76e4005ff4c943d5deeecd 22-Nov-2008 Anders Carlsson <andersca@mac.com> Use Expr::Evaluate for case statements. Fixes PR2525

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f3a41af4d5c98a72a1d6720bbbfd658e57ef2541 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove the last old-fashioned Diag method. Transition complete!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
d3a94e24ddf3fb90de76b17bd176d9ed61e66f2c 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove another old-school Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
3c73c41cefcfe76f36b7bed72c9f1ec195490951 19-Nov-2008 Chris Lattner <sabre@nondot.org> stop calling II::getName() unnecesarily in sema


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
dcd5ef12488e4c7ea844327835896ca86b609a97 19-Nov-2008 Chris Lattner <sabre@nondot.org> remove one more old-style Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
fa25bbb351f4fdd977f51254119cdfc2b525ce90 19-Nov-2008 Chris Lattner <sabre@nondot.org> Switch several more Sema Diag methods over. This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
27c8dc06f65d7abcf6a7e7f64a7960c9a150ca01 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
8ffb159441e923322bef6b5dee1aaf24c738d75e 08-Oct-2008 Ted Kremenek <kremenek@apple.com> Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ScopedDecl*.
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
f34afeed9a0112bf31fee185b6c80556111d3834 06-Oct-2008 Ted Kremenek <kremenek@apple.com> When processing Objective-C foreach statements, first check to see if the statement has a DeclStmt with a single Decl. Afterwards, use DeclStmt::getSolitaryDecl() to access that Decl (thus avoiding an assertion being triggered). These changes remove an unneeded use of ScopedDecl::getNextDeclarator() and DeclStmt::getDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1bddf7e9c5f0243f0a2f65bc40b31e060ff260f3 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Use the DeclStmt::decl_iterator to get the first decl in a DeclStmt instead of using DeclStmt::getDecl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
16564420ffe679b0e3cf310c418be6ef98d8e658 25-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6243788> clang: Incorrect return statement for Blocks?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c50a4a5f2eac14ac4c631d50b0a55cadc87700ce 17-Sep-2008 Steve Naroff <snaroff@apple.com> Sema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return type.
Sema::CheckReturnStackAddr(): Make sure we skip over implicit casts.
Added some more test cases...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6314ff264c345b5babb9faf50dad0bc68d7bd74e 11-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Do implicit conversion to bool for the condition in a do-while statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
5921093cf1c2e9a8bd1a22b6f612e551bae7476b 10-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement Sema support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
4eb206bebcdab28ababe8df55c6185cec2cdc071 03-Sep-2008 Steve Naroff <snaroff@apple.com> Add semantic analysis for "blocks".

Highlights...

- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().

Next steps...

- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1fe379f0fa6fbc0a6057e8966253aea2957ca953 25-Aug-2008 Anders Carlsson <andersca@mac.com> Objective-C foreach selector elements must be lvalues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
1708b963a014b48103e78131f960a13ee1aa6d0c 18-Aug-2008 Chris Lattner <sabre@nondot.org> Several cleanups and tweaks to diagnostics in Sema::ActOnAsmStmt,
no other functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
9aa77f137b9b368f5bf46e2ab7bc7bd1d5755a5b 17-Aug-2008 Chris Lattner <sabre@nondot.org> various updates to match r54873 on mainline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
32442bbc98bafa512fa42d46fedf60ed7d79f574 14-Aug-2008 Daniel Dunbar <daniel@zuster.org> Update some isIntegerConstantExpr uses to use
getIntegerConstantExprValue where appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
acc5f3e42334525bf28c86471551f83dfce222d5 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
c4a1dea2dc56bd1357ec91b829a0b9e68229a13e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
909cd267dd8f66867c0aaef3bef052dc27bde47c 08-Aug-2008 Ted Kremenek <kremenek@apple.com> Use DeclStmt::decl_iterator instead of walking the getNextDeclarator() chain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
28be73f74c9e241a23ea24fe5756623de6bf1084 26-Jul-2008 Chris Lattner <sabre@nondot.org> convert more code to use ASTContext to get canonical types instead
of doing it directly. This is required for PR2189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
834a72ac74cf4ff07ba6215545dba3db578f8a07 26-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095136, various crashes with incomplete enum types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
b6ccaac65ca72f72954eb3893bbd940bedd23f00 25-Jul-2008 Ted Kremenek <kremenek@apple.com> Move isObjCObjectPointerType() from Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
6bc52112dbc54551bd8e215d95bba4791b2275f7 23-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6094010 various asserts happening with wide strings in inline asm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
53d0ea5f5bfa647ec23418bf3a3b7c183b51e4bd 28-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
248a753f6b670692523c99afaeb8fe98f7ae3ca7 16-Apr-2008 Steve Naroff <snaroff@apple.com> Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaStmt.cpp