]> granicus.if.org Git - clang/log
clang
12 years agoAdd various tests for captures and the reaching scope of the lambda
Douglas Gregor [Fri, 10 Feb 2012 09:26:04 +0000 (09:26 +0000)]
Add various tests for captures and the reaching scope of the lambda
expression. Implement C++11 [expr.prim.lambda]p12's requirement that
capturing a variable will odr-use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150237 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement the conversion to a function pointer for lambda expressions,
Douglas Gregor [Fri, 10 Feb 2012 08:36:38 +0000 (08:36 +0000)]
Implement the conversion to a function pointer for lambda expressions,
per C++ [expr.prim.lambda]p6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150236 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend CXXRecordDecl with a function that determines the mapping from
Douglas Gregor [Fri, 10 Feb 2012 07:45:31 +0000 (07:45 +0000)]
Extend CXXRecordDecl with a function that determines the mapping from
the variables captured by a lambda to the fields that store the
captured values. To be used in IRgen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150235 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate to new resolution for DR1458. When taking the address of an object of
Richard Smith [Fri, 10 Feb 2012 07:41:06 +0000 (07:41 +0000)]
Update to new resolution for DR1458. When taking the address of an object of
incomplete class type which has an overloaded operator&, it's now just
unspecified whether the overloaded operator or the builtin is used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150234 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove stray semi-colon.
Daniel Dunbar [Fri, 10 Feb 2012 06:00:29 +0000 (06:00 +0000)]
Remove stray semi-colon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150231 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove -Wswitch from -Wmost to -Wall, consitent with GCC.
David Blaikie [Fri, 10 Feb 2012 05:15:16 +0000 (05:15 +0000)]
Move -Wswitch from -Wmost to -Wall, consitent with GCC.

This is a relatively noisy warning for a codebase not explicitly designed for
it (effectively enforcing a stylistic constraint about the use of defaults
in switches over enums) & there's nothing Clang does to clean up the noise
when compared to GCC's implementation so the same decision seems suitable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150230 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r145999. This turned out to be a bad idea. Unfortunately, 'id' is used so...
Ted Kremenek [Fri, 10 Feb 2012 02:45:47 +0000 (02:45 +0000)]
Revert r145999.  This turned out to be a bad idea.  Unfortunately, 'id' is used so profusely
in many APIs and large codebases that this made the deprecated warning trigger happy to
the point of not being useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150223 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure we convert struct layout pragmas to attributes for class templates the...
Eli Friedman [Fri, 10 Feb 2012 02:02:21 +0000 (02:02 +0000)]
Make sure we convert struct layout pragmas to attributes for class templates the same way we do for non-template classes.  <rdar://problem/10791194>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150221 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] MallocChecker: add a list of false positives based on running
Anna Zaks [Fri, 10 Feb 2012 01:11:03 +0000 (01:11 +0000)]
[analyzer] MallocChecker: add a list of false positives based on running
the checker over postgres and sqlite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150216 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] MallocChecker Cleanup - harden against crashes, fix an error
Anna Zaks [Fri, 10 Feb 2012 01:11:00 +0000 (01:11 +0000)]
[analyzer] MallocChecker Cleanup - harden against crashes, fix an error
(use of return instead of continue), wording.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150215 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc translator: mode modern abi stuff.
Fariborz Jahanian [Fri, 10 Feb 2012 00:04:22 +0000 (00:04 +0000)]
objc translator: mode modern abi stuff.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150212 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove evil const_cast that's not needed anymore.
Bill Wendling [Thu, 9 Feb 2012 22:45:21 +0000 (22:45 +0000)]
Remove evil const_cast that's not needed anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150210 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitching to using dyn_cast_or_null, and fixing line endings in the test case.
Aaron Ballman [Thu, 9 Feb 2012 22:16:56 +0000 (22:16 +0000)]
Switching to using dyn_cast_or_null, and fixing line endings in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150209 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse SmallVector when we can instead of std::vector.
Bill Wendling [Thu, 9 Feb 2012 22:16:49 +0000 (22:16 +0000)]
Use SmallVector when we can instead of std::vector.

This looks like it had a small, but measurable performance improvement on -O0
compile time for our ObjC tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150208 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Proactively avoid inlining vararg functions and blocks until we properly...
Ted Kremenek [Thu, 9 Feb 2012 21:59:52 +0000 (21:59 +0000)]
[analyzer] Proactively avoid inlining vararg functions and blocks until we properly support them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150207 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: If a method is not implemented in the category implementation but
Fariborz Jahanian [Thu, 9 Feb 2012 21:30:24 +0000 (21:30 +0000)]
objc: If a method is not implemented in the category implementation but
has been declared in its primary class, superclass,
or in one of their protocols, no need to issue unimplemented method.
// rdar://10823023

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150206 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure a variable with a C++ direct initializer triggers jump scope checking....
Eli Friedman [Thu, 9 Feb 2012 20:13:14 +0000 (20:13 +0000)]
Make sure a variable with a C++ direct initializer triggers jump scope checking.  Fixes PR10620 / <rdar://problem/9958362> .

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150204 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoexamples/analyzer-plugin/: unbreak build
Dylan Noblesmith [Thu, 9 Feb 2012 20:02:49 +0000 (20:02 +0000)]
examples/analyzer-plugin/: unbreak build

It was never updated for API changes in r149311/r149336/r149339
and r147688.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150202 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agocmake: create a relative symlink to clang, not absolute
Dylan Noblesmith [Thu, 9 Feb 2012 20:02:46 +0000 (20:02 +0000)]
cmake: create a relative symlink to clang, not absolute

Hardcoding the location of the build directory seems like it would
break at `make install`/packaging time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150201 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoClass objects passed by value follow the same rules as structure objects.
Akira Hatanaka [Thu, 9 Feb 2012 19:54:16 +0000 (19:54 +0000)]
Class objects passed by value follow the same rules as structure objects.
Double fields of by-value class objects should be passed in floating point
registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150200 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoKill the brief and full explanation fields from StaticDiagInfoRec. They were unused...
Benjamin Kramer [Thu, 9 Feb 2012 19:38:26 +0000 (19:38 +0000)]
Kill the brief and full explanation fields from StaticDiagInfoRec. They were unused and wasted space for nothing.

- per PR11952.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150199 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix bugs in function MipsABIInfo::returnAggregateInRegs. Functions returning
Akira Hatanaka [Thu, 9 Feb 2012 18:49:26 +0000 (18:49 +0000)]
Fix bugs in function MipsABIInfo::returnAggregateInRegs. Functions returning
class objects follow the same rules as those returning struct objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150196 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't allow deduction of a lambda result type from an initializer
Douglas Gregor [Thu, 9 Feb 2012 18:40:39 +0000 (18:40 +0000)]
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

12 years ago[libclang] Add a libclang test I neglected to commit.
Argyrios Kyrtzidis [Thu, 9 Feb 2012 18:31:22 +0000 (18:31 +0000)]
[libclang] Add a libclang test I neglected to commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150193 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Add a PCH test.
Argyrios Kyrtzidis [Thu, 9 Feb 2012 18:31:19 +0000 (18:31 +0000)]
[PCH] Add a PCH test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150192 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTests for C++ [expr.prim.lambda]p5. We already implement all of these
Douglas Gregor [Thu, 9 Feb 2012 18:19:44 +0000 (18:19 +0000)]
Tests for C++ [expr.prim.lambda]p5. We already implement all of these
semantics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150190 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGetting Started: Add a missing "cd ../..".
Benjamin Kramer [Thu, 9 Feb 2012 16:04:50 +0000 (16:04 +0000)]
Getting Started: Add a missing "cd ../..".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150181 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdated information on how to perform command line testing on Windows when built...
Aaron Ballman [Thu, 9 Feb 2012 15:23:18 +0000 (15:23 +0000)]
Updated information on how to perform command line testing on Windows when built from MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150180 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused fun.
Benjamin Kramer [Thu, 9 Feb 2012 12:05:18 +0000 (12:05 +0000)]
Remove unused fun.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150172 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement return type deduction for lambdas per C++11
Douglas Gregor [Thu, 9 Feb 2012 10:18:50 +0000 (10:18 +0000)]
Implement return type deduction for lambdas per C++11
[expr.prim.lambda]p4, including the current suggested resolution of
core isue 975, which allows multiple return statements so long as the
types match. ExtWarn when user code is actually making use of this
extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150168 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRestore the appropriate lexical declaration context for a lambda's
Douglas Gregor [Thu, 9 Feb 2012 08:52:43 +0000 (08:52 +0000)]
Restore the appropriate lexical declaration context for a lambda's
function call operator (to the lambda class). This allows us to IRgen
calls to simple (non-capturing) lambdas, e.g.,

  [](int i, int j) -> int { return i + j; }(1, 2)

Eli will be providing test cases as he brings up more IRgen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150166 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the "unsupported" error for lambda expressions. It's annoying,
Douglas Gregor [Thu, 9 Feb 2012 08:26:42 +0000 (08:26 +0000)]
Remove the "unsupported" error for lambda expressions. It's annoying,
and rapidly becoming untrue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150165 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a test for the non-aggregaticity of lambda types per C++11
Douglas Gregor [Thu, 9 Feb 2012 08:15:36 +0000 (08:15 +0000)]
Add a test for the non-aggregaticity of lambda types per C++11
[expr.prim.lambda].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150164 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement C++ [expr.prim.lambda]p2, which bans lambda expressions in
Douglas Gregor [Thu, 9 Feb 2012 08:14:43 +0000 (08:14 +0000)]
Implement C++ [expr.prim.lambda]p2, which bans lambda expressions in
unevaluated operands. Be certain that we're marking everything
referenced within a capture initializer as odr-used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150163 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Add some comments, per Ted's request.
Argyrios Kyrtzidis [Thu, 9 Feb 2012 07:46:54 +0000 (07:46 +0000)]
[PCH] Add some comments, per Ted's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150162 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix ASTReader::FinishedDeserializing().
Argyrios Kyrtzidis [Thu, 9 Feb 2012 07:31:52 +0000 (07:31 +0000)]
Fix ASTReader::FinishedDeserializing().

We were passing a decl to the consumer after all pending deserializations were finished
but this was not enough; due to processing by the consumer we may end up into yet another
deserialization process but the way FinishedDeserializing() was setup we would not ensure
that everything was fully deserialized before returning to the consumer.

Separate ASTReader::FinishedDeserializing() into two semantic actions.
The first is ensuring that a deserialization process ends up will fully deserialized decls/types even
if the process is started by the consumer.
The second is pushing "interesting" decls to the consumer; we make sure that we don't re-enter this
section recursively be checking a variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150160 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't cache the artificial type for the this pointer, there's no
Eric Christopher [Thu, 9 Feb 2012 07:26:21 +0000 (07:26 +0000)]
Don't cache the artificial type for the this pointer, there's no
difference in the qual type. This is a workaround for the fact that
the type isn't artificial but the this decl is, however, we don't
have any way of representing it in the current metadata. For now,
however, just don't cache the full type.

Fixes rdar://10831526 and probably a couple of others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150159 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] MallocChecker: address a diagnostic "fixme".
Anna Zaks [Thu, 9 Feb 2012 06:48:19 +0000 (06:48 +0000)]
[analyzer] MallocChecker: address a diagnostic "fixme".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150158 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDR1359: A constexpr constructor does not need to initialize an empty struct or
Richard Smith [Thu, 9 Feb 2012 06:40:58 +0000 (06:40 +0000)]
DR1359: A constexpr constructor does not need to initialize an empty struct or
empty union. This still rejects anonymous member structs or unions which only
contain such empty class types, pending standard wording defining exactly what
an empty class type is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150157 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add custom path diagnostic to the Malloc Checker.
Anna Zaks [Thu, 9 Feb 2012 06:25:51 +0000 (06:25 +0000)]
[analyzer] Add custom path diagnostic to the Malloc Checker.

Very simple so far - we just highlight every allocation and release
site.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150156 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] MallocChecker cleanup, more tests.
Anna Zaks [Thu, 9 Feb 2012 06:25:47 +0000 (06:25 +0000)]
[analyzer] MallocChecker cleanup, more tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150155 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Set the DeclContext before doing any deserialization, to make sure internal
Argyrios Kyrtzidis [Thu, 9 Feb 2012 06:02:44 +0000 (06:02 +0000)]
[PCH] Set the DeclContext before doing any deserialization, to make sure internal
calls to Decl::getASTContext() by Decl's methods will find the TranslationUnitDecl
without crashing due to a parent declaration context still deserializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150153 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCorrect comment Clang C++ use in production.
David Blaikie [Thu, 9 Feb 2012 03:57:02 +0000 (03:57 +0000)]
Correct comment Clang C++ use in production.

This was from way-back-when (r82583) when Clang's C++ support wasn't prime-time
yet. Production quality C++ was tested experimentally from r100119 and turned
on by default in r141063.

Patch by Justin Bogner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150148 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse RAII object for cleanups.
Eli Friedman [Thu, 9 Feb 2012 03:47:20 +0000 (03:47 +0000)]
Use RAII object for cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150147 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor lambda IRGen so AggExprEmitter::VisitLambdaExpr does the right thing.
Eli Friedman [Thu, 9 Feb 2012 03:32:31 +0000 (03:32 +0000)]
Refactor lambda IRGen so AggExprEmitter::VisitLambdaExpr does the right thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150146 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCWG issue 1405: mutable members are allowed in literal types, but can't undergo
Richard Smith [Thu, 9 Feb 2012 03:29:58 +0000 (03:29 +0000)]
CWG issue 1405: mutable members are allowed in literal types, but can't undergo
lvalue-to-rvalue conversions in constant expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150145 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAttempting to initialize a union member that does not exist no longer crashes.
Aaron Ballman [Thu, 9 Feb 2012 03:29:06 +0000 (03:29 +0000)]
Attempting to initialize a union member that does not exist no longer crashes.

Patch by Remi Gacogne

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150144 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBasic IRGen for LambdaExprs with captures.
Eli Friedman [Thu, 9 Feb 2012 03:19:12 +0000 (03:19 +0000)]
Basic IRGen for LambdaExprs with captures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150141 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoA tiny bit more lambda IRGen.
Eli Friedman [Thu, 9 Feb 2012 02:56:22 +0000 (02:56 +0000)]
A tiny bit more lambda IRGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150140 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a typo in the LambdaExpr class.
Eli Friedman [Thu, 9 Feb 2012 02:55:22 +0000 (02:55 +0000)]
Fix a typo in the LambdaExpr class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150139 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement capture-by-copy for arrays in lambdas.
Douglas Gregor [Thu, 9 Feb 2012 02:45:47 +0000 (02:45 +0000)]
Implement capture-by-copy for arrays in lambdas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150138 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Avoid using Decl::setAttrs() and Decl::setLexicalDeclContext() from the ASTRead...
Argyrios Kyrtzidis [Thu, 9 Feb 2012 02:44:08 +0000 (02:44 +0000)]
[PCH] Avoid using Decl::setAttrs() and Decl::setLexicalDeclContext() from the ASTReaderDecl
directly; they internally call Decl::getASTContext() which may crash if a declaration context
parent is still deserializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150137 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't complain about the lack of a constructor for a lambda expression. They are...
Douglas Gregor [Thu, 9 Feb 2012 02:20:38 +0000 (02:20 +0000)]
Don't complain about the lack of a constructor for a lambda expression. They are constructed in different ways

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150136 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen we create a non-static data member in the closure object for a
Douglas Gregor [Thu, 9 Feb 2012 02:12:34 +0000 (02:12 +0000)]
When we create a non-static data member in the closure object for a
capture, make sure we actually add the field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150135 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFactor the logic for capturing variables in a lambda into its own
Douglas Gregor [Thu, 9 Feb 2012 01:56:40 +0000 (01:56 +0000)]
Factor the logic for capturing variables in a lambda into its own
function; it's going to get longer soon. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150132 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAlong the error path for lambdas, mark the lambda class as invalid and finalize it
Douglas Gregor [Thu, 9 Feb 2012 01:28:42 +0000 (01:28 +0000)]
Along the error path for lambdas, mark the lambda class as invalid and finalize it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150130 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix yet one more test
Douglas Gregor [Thu, 9 Feb 2012 01:26:17 +0000 (01:26 +0000)]
Fix yet one more test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150129 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdding support for warning when a non-C compatible user-defined type is returned...
Aaron Ballman [Thu, 9 Feb 2012 01:21:34 +0000 (01:21 +0000)]
Adding support for warning when a non-C compatible user-defined type is returned from an extern "C" function.

Fixes bug 6143

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150128 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix tests for r150123
Douglas Gregor [Thu, 9 Feb 2012 01:02:27 +0000 (01:02 +0000)]
Fix tests for r150123

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150126 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoVarious interrelated cleanups for lambdas:
Douglas Gregor [Thu, 9 Feb 2012 00:47:04 +0000 (00:47 +0000)]
Various interrelated cleanups for lambdas:
  - Complete the lambda class when we finish the lambda expression
    (previously, it was left in the "being completed" state)
  - Actually return the LambdaExpr object and bind to the resulting
  temporary when needed.
  - Detect when cleanups are needed while capturing a variable into a
  lambda (e.g., due to default arguments in the copy constructor), and
  make sure those cleanups apply for the whole of the lambda
  expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150123 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] MallocChecker: implement pessimistic version of the checker,
Anna Zaks [Wed, 8 Feb 2012 23:16:56 +0000 (23:16 +0000)]
[analyzer] MallocChecker: implement pessimistic version of the checker,
which allows values to escape through unknown calls.

Assumes all calls but the malloc family are unknown.

Also, catch a use-after-free when a pointer is passed to a
function after a call to free (previously, you had to explicitly
dereference the pointer value).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150112 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Split the MallocChecker into two versions - pessimistic and
Anna Zaks [Wed, 8 Feb 2012 23:16:52 +0000 (23:16 +0000)]
[analyzer] Split the MallocChecker into two versions - pessimistic and
optimistic.

TODO: actually implement the pessimistic version of the checker. Ex: it
needs to assume that any function that takes a pointer might free it.

The optimistic version relies on annotations to tell us which functions
can free the pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150111 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove explicit delete of PathDiagnosticMacroPiece, as it is now reference counted.
Ted Kremenek [Wed, 8 Feb 2012 22:48:17 +0000 (22:48 +0000)]
Remove explicit delete of PathDiagnosticMacroPiece, as it is now reference counted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150110 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agolast piece of metadata to complete modern metadata for
Fariborz Jahanian [Wed, 8 Feb 2012 22:23:26 +0000 (22:23 +0000)]
last piece of metadata to complete modern metadata for
protocol definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150106 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinor comment fix
Douglas Gregor [Wed, 8 Feb 2012 21:19:04 +0000 (21:19 +0000)]
Minor comment fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150090 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFactor C++11 lambda expressions implementation into a separate
Douglas Gregor [Wed, 8 Feb 2012 21:18:48 +0000 (21:18 +0000)]
Factor C++11 lambda expressions implementation into a separate
file. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150089 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen computing the type of a local variable reference within a lambda,
Douglas Gregor [Wed, 8 Feb 2012 20:56:50 +0000 (20:56 +0000)]
When computing the type of a local variable reference within a lambda,
only add 'const' for variables captured by copy in potentially
evaluated expressions of non-mutable lambdas. (The "by copy" part was
missing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150088 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen completing a lambda expression, make sure to check and attach the
Douglas Gregor [Wed, 8 Feb 2012 20:17:14 +0000 (20:17 +0000)]
When completing a lambda expression, make sure to check and attach the
body of the lambda to the function call operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150087 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] MallocChecker: convert from using evalCall to
Anna Zaks [Wed, 8 Feb 2012 20:13:28 +0000 (20:13 +0000)]
[analyzer] MallocChecker: convert from using evalCall to
post visit of CallExpr.

In general, we should avoid using evalCall as it leads to interference
with other checkers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150086 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMore rewriting of objective-c moderin abi metadata.
Fariborz Jahanian [Wed, 8 Feb 2012 19:53:58 +0000 (19:53 +0000)]
More rewriting of objective-c moderin abi metadata.
All protocol related metadata is close to completion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150084 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixing hex floating literal support so that it handles 0x.2p2 properly.
Aaron Ballman [Wed, 8 Feb 2012 13:36:33 +0000 (13:36 +0000)]
Fixing hex floating literal support so that it handles 0x.2p2 properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150072 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCodeGen: Move EHPersonality from CGException.h into the cpp file, it has no other...
Benjamin Kramer [Wed, 8 Feb 2012 12:41:24 +0000 (12:41 +0000)]
CodeGen: Move EHPersonality from CGException.h into the cpp file, it has no other users.

While at it make it value-initializable to get rid of static ctors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150070 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement DR1458: Taking the address of an object of incomplete class type is
Richard Smith [Wed, 8 Feb 2012 08:11:33 +0000 (08:11 +0000)]
Implement DR1458: Taking the address of an object of incomplete class type is
not a constant expression, because we can't tell whether the complete class type
will have an overloaded operator&.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150066 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove vperm2f* and vperm2i builtins. Same effect can be achieved with builtin_shuffl...
Craig Topper [Wed, 8 Feb 2012 07:33:36 +0000 (07:33 +0000)]
Remove vperm2f* and vperm2i builtins. Same effect can be achieved with builtin_shufflevector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150064 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd more testing for r149776.
Richard Smith [Wed, 8 Feb 2012 06:41:34 +0000 (06:41 +0000)]
Add more testing for r149776.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150061 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement the agreed resolution to DR1457: a signed left shift of a 1 bit into
Richard Smith [Wed, 8 Feb 2012 06:14:53 +0000 (06:14 +0000)]
Implement the agreed resolution to DR1457: a signed left shift of a 1 bit into
the sign bit doesn't have undefined behavior, but a signed left shift of a 1 bit
out of the sign bit still does. As promised to Howard :)

The suppression of the potential constant expression checking in system headers
is also removed, since the problem it was working around is gone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150059 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoA little bit of lambda IRGen.
Eli Friedman [Wed, 8 Feb 2012 05:34:55 +0000 (05:34 +0000)]
A little bit of lambda IRGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150058 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove vpermilp* builtins. Same effect can be achieved with builtin_shufflevector.
Craig Topper [Wed, 8 Feb 2012 05:16:54 +0000 (05:16 +0000)]
Remove vpermilp* builtins. Same effect can be achieved with builtin_shufflevector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150056 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove -Wcovered-switch-default out of -Wswitch (and -Wall), and make it an opt-in...
Ted Kremenek [Wed, 8 Feb 2012 05:08:58 +0000 (05:08 +0000)]
Move -Wcovered-switch-default out of -Wswitch (and -Wall), and make it an opt-in warning.

This is a great warning, but it was observed that a ton of real world code violates
it all the time for (semi-)legitimate reasons.  This warnings is fairly pedantic, which is good,
but not for everyone.  For example, there is a fair amount of idiomatic code out there
that does "default: abort()", and similar idioms.

Addresses <rdar://problem/10814651>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150055 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange PathDiagnosticPieces to be reference counted (simplifying their management...
Ted Kremenek [Wed, 8 Feb 2012 04:32:34 +0000 (04:32 +0000)]
Change PathDiagnosticPieces to be reference counted (simplifying their management), and introduce 'PathPieces' as a common container for PathDiagnosticPieces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150054 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor pieces of PathDiagnostic into its own data structure. No functionality...
Ted Kremenek [Wed, 8 Feb 2012 04:32:27 +0000 (04:32 +0000)]
Refactor pieces of PathDiagnostic into its own data structure.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150053 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure template argument deduction is consistently performed in an unevaluated...
Eli Friedman [Wed, 8 Feb 2012 03:07:05 +0000 (03:07 +0000)]
Make sure template argument deduction is consistently performed in an unevaluated context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150049 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Indexing: When suppressing references, suppress references
Argyrios Kyrtzidis [Wed, 8 Feb 2012 03:04:33 +0000 (03:04 +0000)]
[libclang] Indexing: When suppressing references, suppress references
of bases in C++ classes. rdar://10768707

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150048 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoConstify the getClassName routine and variables that come out of it,
Eric Christopher [Wed, 8 Feb 2012 01:53:14 +0000 (01:53 +0000)]
Constify the getClassName routine and variables that come out of it,
and then use it for forward decl names.

Part of rdar://10209967 and rdar://10400981

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150040 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDo not return records with non trivial destructors or copy constructors in
Akira Hatanaka [Wed, 8 Feb 2012 01:31:22 +0000 (01:31 +0000)]
Do not return records with non trivial destructors or copy constructors in
registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150035 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] For CXXOperatorCallExprs, give a valid source location to the DeclRefExpr
Argyrios Kyrtzidis [Wed, 8 Feb 2012 01:21:13 +0000 (01:21 +0000)]
[libclang] For CXXOperatorCallExprs, give a valid source location to the DeclRefExpr
that is referencing the member function, so we can index the referenced function.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150033 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomodern objc rewriter: mode metadata stuff. wip.
Fariborz Jahanian [Wed, 8 Feb 2012 00:50:52 +0000 (00:50 +0000)]
modern objc rewriter: mode metadata stuff. wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150030 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOnly complain about __strong __strong id, not __strong SomeStrongTypedef
John McCall [Wed, 8 Feb 2012 00:46:41 +0000 (00:46 +0000)]
Only complain about __strong __strong id, not __strong SomeStrongTypedef
or __strong __typeof__(some.strong.thing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150029 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevise the SplitQualType interface to make it its own thing instead of
John McCall [Wed, 8 Feb 2012 00:46:36 +0000 (00:46 +0000)]
Revise the SplitQualType interface to make it its own thing instead of
a typedef of std::pair.  This slightly improves type-safety, but mostly
makes code using it clearer to read as well as making it possible to add
methods to the type.

Add such a method for efficiently single-step desugaring a split type.
Add a method to single-step desugaring a locally-unqualified type.
Implement both the SplitQualType and QualType methods in terms of that.

Also, fix a typo ("ObjCGLifetime").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150028 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhitespace.
Eric Christopher [Wed, 8 Feb 2012 00:23:21 +0000 (00:23 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150026 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse the new forward declaration scheme for records. Also add more
Eric Christopher [Wed, 8 Feb 2012 00:23:18 +0000 (00:23 +0000)]
Use the new forward declaration scheme for records. Also add more
caching of results after we create them.

Fixes rdar://10809898

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150025 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove tabs.
Devang Patel [Wed, 8 Feb 2012 00:10:20 +0000 (00:10 +0000)]
Remove tabs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150021 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf a struct needs to be laid out, and it has not
Sean Callanan [Wed, 8 Feb 2012 00:04:52 +0000 (00:04 +0000)]
If a struct needs to be laid out, and it has not
been completed yet, then complete it if possible.
This fixes some assertion failures encountered by
LLDB.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150020 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomodern objc abi rewriter: mode protocol metadata
Fariborz Jahanian [Tue, 7 Feb 2012 23:31:52 +0000 (23:31 +0000)]
modern objc abi rewriter: mode protocol metadata
for modern objc abi.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150011 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix indentation and an 80-column violation.
Chad Rosier [Tue, 7 Feb 2012 23:24:49 +0000 (23:24 +0000)]
Fix indentation and an 80-column violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150010 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agonon-literal strftime format string is not unsafe.
Jean-Daniel Dupas [Tue, 7 Feb 2012 23:10:53 +0000 (23:10 +0000)]
non-literal strftime format string is not unsafe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150009 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Do not index implicit C++ member functions. rdar://10769813
Argyrios Kyrtzidis [Tue, 7 Feb 2012 22:46:16 +0000 (22:46 +0000)]
[libclang] Do not index implicit C++ member functions. rdar://10769813

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150007 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert my patches which removed Diagnostic.h includes by moving some operator overloa...
Benjamin Kramer [Tue, 7 Feb 2012 22:29:24 +0000 (22:29 +0000)]
Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line.

This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.

This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99.
This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789.
This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7.
This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f.
This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc rewriter: modern metadata for protocol decls. wip.
Fariborz Jahanian [Tue, 7 Feb 2012 20:15:08 +0000 (20:15 +0000)]
objc rewriter: modern metadata for protocol decls. wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150002 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn r149662, setDiagnosticMapping was modified to not allow warnings mapped to
Chad Rosier [Tue, 7 Feb 2012 19:55:45 +0000 (19:55 +0000)]
In r149662, setDiagnosticMapping was modified to not allow warnings mapped to
MAP_ERROR to be remapped to MAP_WARNING.  These new APIs are being added to
allow the diagnostic mapping's "no Werror" bit to be set, and potentially
downgrade anything already mapped to be a warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150001 91177308-0d34-0410-b5e6-96231b3b80d8