aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
AgeCommit message (Collapse)Author
2012-09-19Thread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED orDeLesley Hutchins
LOCKS_EXCLUDED is used on a method with a name that is is not a simple identifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164242 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19Remove Context argument from TemplateDeductionInfo constructor. It was no ↵Craig Topper
longer needed after the unused Context member was removed in r164104. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164196 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-19Add the TypeSourceInfo for the lambda call operator to the lambda'sEli Friedman
definition info; it needs to be there because the mangler needs to access it before we're finished defining the lambda class. PR12808. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164186 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18Fix a small bug in the way we handle builtin candidates forEli Friedman
relational operators of enumeration type. From the gcc testsuite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164171 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18Add an extra check for invalid decls in the lambda semantic analysis to ↵Eli Friedman
avoid a crash. PR13860. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164168 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18minor refactoring of my last check-in.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164145 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18c: warn when an integer value comparison with anFariborz Jahanian
integral expression have the obvious result. Patch reviewed by John McCall off line. // rdar://12202422 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164143 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18Warn about self references in in-class initializers.Hans Wennborg
This makes Clang warn about self references in in-class initializers, for example: struct S { int a = a + 42; }; This basically just moves UninitializedFieldVisitor up a bit in SemaDeclCXX.cpp, and adds a call to it from ActOnCXXInClassMemberInitializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164131 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18Per discussion on cfe-dev, remove -Wunique-enums entirely. ThereTed Kremenek
is no compelling argument that this is a generally useful warning, and imposes a strong stylistic argument on code beyond what it was intended to find warnings in. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164083 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17objective-C: don't warn about class extension property's Fariborz Jahanian
missing 'assign' attribute as it is determined by its overridden property in primary class. // rdar://12214070 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164080 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17objective-C: peroform property attribute consistencyFariborz Jahanian
checking on property declared in class extension. // rdar://12214070 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164053 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17-Warc-retain-cycles: look through [^{...} copy] and Block_copy(^{...})Jordan Rose
Retain cycles happen in the case where a block is persisted past its life on the stack, and the way that occurs is by copying the block. We should thus look through any explicit copies we see. Note that Block_copy is actually a type-safe wrapper for _Block_copy, which does all the real work. <rdar://problem/12219663> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164039 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-17Don't write uninitialized values even if nobody ever asks for it.Axel Naumann
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164033 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15const _Atomic(T) is not an atomic type, so do not allow it as the type 'A' inRichard Smith
C11 7.17's atomic operations. GNU's __atomic_* builtins do allow const-qualified atomics, though (!!) so don't restrict those. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163964 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15-Warc-retain-cycles: warn at variable initialization as well as assignment.Jordan Rose
Specifically, this should warn: __block block_t a = ^{ a(); }; Furthermore, this case which previously warned now does not, since the value of 'b' is captured before the assignment occurs: block_t b; // not __block b = ^{ b(); }; (This will of course warn under -Wuninitialized, as before.) <rdar://problem/11015883> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14Fix some dead stores which the static analyzer warned about. No functionalityRichard Smith
change (the problematic cases in ParseDecl.cpp are currently impossible). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14When diagnosing multiple mem-initializers in a delegating ctor, point to the ↵Richard Smith
delegating initializer, not to the first initializer. For good measure, also highlight the other initializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14objective-C arc: remove -Warc-abi in its entirety.Fariborz Jahanian
// rdar://10554025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14Fix warning on qualified typedef with 'unused' attribute, from Jason Haslam!Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163874 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14In debugger mode, allow comparisons between pointers and integersDouglas Gregor
without a cast. Fixes <rdar://problem/11830912>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163873 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-14As we do with base and member initializers in a dependent class, delayDouglas Gregor
type checking for non-static data member initializers in a dependent class, because our ASTs lose too much information to when type-checking an initializer. Fixes <rdar://problem/11974632>, although the result is still rather unsatisfactory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163871 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13When computing the decltype of an expression, consider Objective-CDouglas Gregor
ivar and property references as member accesses and produce the actual type of the declaration. Fixes <rdar://problem/12031582>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163858 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Actually rebuild function types properly when adjusting the functionDouglas Gregor
type of an instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Revert r163829. The world (or libstdc++, at least) is not ready.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163846 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13When we substitute into the type of a function based on theDouglas Gregor
TypeSourceInfo, we may have lost some adjustments made to the type of that function due to declaration merging. Adjust the resulting type correspondingly. Fixes PR12948 / <rdar://problem/11552434>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163845 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Implement C++11 [conv.prom]p4: an enumeration with a fixed underlying type hasRichard Smith
integral promotions to both its underlying type and to its underlying type's promoted type. This matters now that boolean conversions aren't permitted in converted constant expressions (a la DR1407): an enumerator with a fixed underlying type of bool still can be. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163841 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Don't perform template argument deduction against invalid templates;Douglas Gregor
it's likely to lead to a crash later on. Fixes PR12933 / <rdar://problem/11525335>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163838 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13remove duplicate code.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163833 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Promote the warning about extra qualification on a declaration from aDouglas Gregor
warning to an error. C++ bans it, and both GCC and EDG diagnose it as an error. Microsoft allows it, so we still warn in Microsoft mode. Fixes <rdar://problem/11135644>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163831 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Remove speculative fix for C++ core issue 1407, since it was resolved as NAD.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Move back the stuff about missing ownership attribute warningFariborz Jahanian
to SemaDeclObjC and apply some simplification per John's comment. // rdar://12280826 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Move no explicit ownership warning to SemaType.cpp.Fariborz Jahanian
// rdar://12280826 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Conditionally parse documentation comments in system headers byTed Kremenek
passing -fretain-comments-from-system-headers. By default, the compiler no longer parses such documentation comments, as they can result in a noticeable compile time/PCH slowdown. Fixes <rdar://problem/11860820>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163778 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.Jordan Rose
<rdar://problem/12061922> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163772 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).Jordan Rose
These will warn under -Wformat-non-iso, and will still be rejected outright on other platforms. <rdar://problem/12061922> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163771 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Add a few FIXMEs.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163758 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13[ms-inline asm] Handle the enumeration of input and output expressions in aChad Rosier
more robust way to address a few FIXMEs. The initial implementation, r163342, built the IR asm string and then tried to patch things on the fly without enough context. Specifically, it didn't skip mnemonics nor did it track with assembly instruction an expression was related to. The new implementation patches the operands and then builds the final IR string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163756 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12objective-C arc: don't issue no explicit ownership warning whenFariborz Jahanian
__autoreleasing is explicitely added to param type. // rdar://12280826 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163738 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12[ms-inline asm] If we have a single asm operand that maps to multipleChad Rosier
MCOperands then iterate over all of then when computing clobbers, inputs and outputs. On x86 the 1-to-many mapping is a memory operand that includes a BaseReg(reg), MemScale(imm), MemIndexReg(reg), an Expr(MCExpr or imm) and a MemSegReg(reg). Invalid register (Op.getReg() == 0) are not considered when computing clobber. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163728 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12Fix a couple of Doxygen issues pointed out by -Wdocumentation.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163722 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12PR13811: Add a FunctionParmPackExpr node to handle references to functionRichard Smith
parameter packs where the reference is not being expanded but the pack has been. Previously, Clang would segfault in such cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163672 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11[ms-inline asm] isDef/NumDefs in this context only refer to register ↵Chad Rosier
definitions, not memory definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11[ms-inline asm] As of r163657 this check is unnecessary.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11[ms-inline asm] Don't consider tokens or immediates when computing clobbers, ↵Chad Rosier
inputs and outputs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163657 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11Fix warning from r163642DeLesley Hutchins
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163643 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11Thread safety analysis: fix bug related to lock_returned attributeDeLesley Hutchins
on templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163642 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11[ms-inline asm] Add $$ before numeric constants in the IR.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163581 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10Fix PR13784: instantiation of an abstract class in a conditional operator.David Blaikie
A couple of missing "RequireNonAbstractType" calls in conditional operator handling. I looked for opportunities to tie this check in to all relevant callers of PerformCopyInitialization (couldn't be all callers since this is called for base subobject copying too, where it's acceptable to copy abstract types) but the callers varied too much & in many cases had substantial code or conditionals on the RequireNonAbstractType call, the PerformCopyInitialization call, or the code between the two calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163555 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10Move the null check outside of the loop, no functionality change.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163553 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10Remove redundant semicolons which are null statements.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163546 91177308-0d34-0410-b5e6-96231b3b80d8