]> granicus.if.org Git - clang/log
clang
12 years agoSet UserLabelPrefix and MCountName correctly for DragonFly BSD. Patch by Sascha...
Eli Friedman [Fri, 10 Feb 2012 23:02:29 +0000 (23:02 +0000)]
Set UserLabelPrefix and MCountName correctly for DragonFly BSD.  Patch by Sascha Wildner.

Setting UserLabelPrefix correctly fixes PR11949.

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

12 years agoSupport all null pointer literals in format strings.
David Blaikie [Fri, 10 Feb 2012 21:07:25 +0000 (21:07 +0000)]
Support all null pointer literals in format strings.

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

12 years agoobjctive-c translator: modern metadata for ivars. wip.
Fariborz Jahanian [Fri, 10 Feb 2012 20:47:10 +0000 (20:47 +0000)]
objctive-c translator: modern metadata for ivars. wip.

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

12 years agoHave the driver pass CPU and target feature information to cc1as.
Jim Grosbach [Fri, 10 Feb 2012 20:37:10 +0000 (20:37 +0000)]
Have the driver pass CPU and target feature information to cc1as.

When creating the MCSubtargetInfo, the assembler driver uses the CPU and
feature string to construct a more accurate model of what instructions
are and are not legal.

rdar://10840476

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

12 years ago[libclang] Indexing API: fully index using decls and directives.
Argyrios Kyrtzidis [Fri, 10 Feb 2012 20:10:48 +0000 (20:10 +0000)]
[libclang] Indexing API: fully index using decls and directives.

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

12 years ago[libclang] Indexing API: Fully index implict template instantiations.
Argyrios Kyrtzidis [Fri, 10 Feb 2012 20:10:44 +0000 (20:10 +0000)]
[libclang] Indexing API: Fully index implict template instantiations.

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

12 years agoAdd ArrayRef goodness in MultiplexASTMutationListener.
Argyrios Kyrtzidis [Fri, 10 Feb 2012 20:10:38 +0000 (20:10 +0000)]
Add ArrayRef goodness in MultiplexASTMutationListener.

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

12 years agoUpdate MultiplexASTMutationListener with the missing methods from ASTMutationListener.
Argyrios Kyrtzidis [Fri, 10 Feb 2012 20:10:36 +0000 (20:10 +0000)]
Update MultiplexASTMutationListener with the missing methods from ASTMutationListener.

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

12 years ago[libclang] Encode the template specialization parameters of a function
Argyrios Kyrtzidis [Fri, 10 Feb 2012 20:10:32 +0000 (20:10 +0000)]
[libclang] Encode the template specialization parameters of a function
specialization in its USR string.

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

12 years agoEnhance checking for null format string literal to take into account __null. Fixes...
Ted Kremenek [Fri, 10 Feb 2012 19:13:51 +0000 (19:13 +0000)]
Enhance checking for null format string literal to take into account __null.   Fixes <rdar://problem/8269537>.

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

12 years agoAllow implicit capture of 'this' in a lambda even when the capture
Douglas Gregor [Fri, 10 Feb 2012 17:46:20 +0000 (17:46 +0000)]
Allow implicit capture of 'this' in a lambda even when the capture
default is '=', and reword the warning about explicitly capturing
'this' in such lambdas to indicate that only explicit capture is
banned.

Introduce Fix-Its for this and other "save the programmer from
themself" rules regarding what can be explicitly captured and what
must be implicitly captured.

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

12 years agoAdd test from [expr.prim.lambda]p12, which deals with odr-use and
Douglas Gregor [Fri, 10 Feb 2012 16:48:36 +0000 (16:48 +0000)]
Add test from [expr.prim.lambda]p12, which deals with odr-use and
nested captures. We currently don't get odr-use correct in array
bounds, so that bit is commented out while we sort out what we need to
do.

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

12 years agoDon't introduce a lambda's operator() into the class until after we
Douglas Gregor [Fri, 10 Feb 2012 16:13:20 +0000 (16:13 +0000)]
Don't introduce a lambda's operator() into the class until after we
have finished parsing the body, so that name lookup will never find
anything within the closure type. Then, add this operator() and the
conversion function (if available) before completing the class.

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

12 years agoPR11684, core issue 1417:
Richard Smith [Fri, 10 Feb 2012 11:05:11 +0000 (11:05 +0000)]
PR11684, core issue 1417:

o Correct the handling of the restrictions on usage of cv-qualified and
  ref-qualified function types.
o Fix a bug where such types were rejected in template type parameter default
  arguments, due to such arguments not being treated as a template type arg
  context.
o Remove the ExtWarn for usage of such types as template arguments; that was
  a standard defect, not a GCC extension.
o Improve the wording and unify the code for diagnosing cv-qualifiers with the
  code for diagnosing ref-qualifiers.

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

12 years agoTest cleanup: prefer static_assert to handmade alternative.
Richard Smith [Fri, 10 Feb 2012 10:55:13 +0000 (10:55 +0000)]
Test cleanup: prefer static_assert to handmade alternative.

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

12 years agoLoosen the test from r150238 a bit to make some of our bots happy.
Evgeniy Stepanov [Fri, 10 Feb 2012 10:04:01 +0000 (10:04 +0000)]
Loosen the test from r150238 a bit to make some of our bots happy.

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

12 years agoTrack whether a function type has a trailing return type as type sugar. Use this
Richard Smith [Fri, 10 Feb 2012 09:58:53 +0000 (09:58 +0000)]
Track whether a function type has a trailing return type as type sugar. Use this
to pretty-print such function types better, and to fix a case where we were not
instantiating templates in lexical order. In passing, move the Variadic bit from
Type's bitfields to FunctionProtoType to get the Type bitfields down to 32 bits.
Also ensure that we always substitute the return type of a function when
substituting explicitly-specified arguments, since that can cause us to bail
out with a SFINAE error before we hit a hard error in parameter substitution.

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

12 years ago--lies.
Richard Smith [Fri, 10 Feb 2012 09:37:07 +0000 (09:37 +0000)]
--lies.

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

12 years agoAdd a lambda example from the working draft.
Douglas Gregor [Fri, 10 Feb 2012 09:37:05 +0000 (09:37 +0000)]
Add a lambda example from the working draft.

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

12 years agoFix function prolog codegen whe coerce-to type is a struct.
Evgeniy Stepanov [Fri, 10 Feb 2012 09:30:15 +0000 (09:30 +0000)]
Fix function prolog codegen whe coerce-to type is a struct.

This changes function prolog in such a way as to avoid out-of-bounds
stack store in the case when coerce-to type has a larger storage size
than the real argument type.

Fixes PR11905.

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

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