]> granicus.if.org Git - clang/log
clang
12 years agoMove Storage and StorageAllocator out of the PartialDiagnostic class so we can forwar...
Benjamin Kramer [Sat, 4 Feb 2012 12:30:46 +0000 (12:30 +0000)]
Move Storage and StorageAllocator out of the PartialDiagnostic class so we can forward declare them.

Let ASTContext allocate the storage in its BumpPtrAllocator.
This will help us remove ASTContext's depedency on PartialDiagnostic.h soon.

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

12 years agoStaticAnalyzer: Remove FixIts from PathDiagnosticPieces.
Benjamin Kramer [Sat, 4 Feb 2012 12:30:37 +0000 (12:30 +0000)]
StaticAnalyzer: Remove FixIts from PathDiagnosticPieces.

They were unused and pulled in Diagnostic.h for no reason.

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

12 years agoIn C++11 mode, when an integral constant expression is desired and we have a
Richard Smith [Sat, 4 Feb 2012 09:53:13 +0000 (09:53 +0000)]
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

12 years agoDon't allow a value of a scoped enumeration to be used as the first bound for an
Richard Smith [Sat, 4 Feb 2012 07:07:42 +0000 (07:07 +0000)]
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

12 years ago[analyzer] Make sure Containers OutOfBounds checker does not crash on undefined argum...
Anna Zaks [Sat, 4 Feb 2012 06:40:52 +0000 (06:40 +0000)]
[analyzer] Make sure Containers OutOfBounds checker does not crash on undefined arguments, when CF functions are called with wrong number of arguments.

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

12 years agoDisallow constexpr main.
Richard Smith [Sat, 4 Feb 2012 06:10:17 +0000 (06:10 +0000)]
Disallow constexpr main.

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

12 years agoFix a rejects-valid in C++11: array new of a negative size, or overflowing array
Richard Smith [Sat, 4 Feb 2012 05:35:53 +0000 (05:35 +0000)]
Fix a rejects-valid in C++11: array new of a negative size, or overflowing array
new, is well-formed with defined semantics of throwing (a type which can be
caught by a handler for) std::bad_array_new_length, unlike in C++98 where it is
somewhere nebulous between undefined behavior and ill-formed.

If the array size is an integral constant expression and satisfies one of these
criteria, we would previous the array new expression, but now in C++11 mode, we
merely issue a warning (the code is still rejected in C++98 mode, naturally).

We don't yet implement new C++11 semantics correctly (see PR11644), but we do
implement the overflow checking, and (for the default operator new) convert such
expressions to an exception, so accepting such code now does not seem especially
unsafe.

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

12 years agoUnbreak failing test added in r149738.
Richard Smith [Sat, 4 Feb 2012 05:33:36 +0000 (05:33 +0000)]
Unbreak failing test added in r149738.

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

12 years agoArrayRef goodness in MultiplexConsumer, no functionality change.
Argyrios Kyrtzidis [Sat, 4 Feb 2012 05:23:00 +0000 (05:23 +0000)]
ArrayRef goodness in MultiplexConsumer, no functionality change.

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

12 years agoRemove unused field from FixItRecompile.
Argyrios Kyrtzidis [Sat, 4 Feb 2012 04:53:03 +0000 (04:53 +0000)]
Remove unused field from FixItRecompile.

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

12 years agoDon't warn on use of default allocator with an over-aligned type when the
Nick Lewycky [Sat, 4 Feb 2012 03:30:14 +0000 (03:30 +0000)]
Don't warn on use of default allocator with an over-aligned type when the
allocator is given the pointer to allocate into.

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

12 years agoFix ASTMerge tests that I broke in my previous commit.
Argyrios Kyrtzidis [Sat, 4 Feb 2012 03:26:16 +0000 (03:26 +0000)]
Fix ASTMerge tests that I broke in my previous commit.

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

12 years agoautoconf: update config header
Dylan Noblesmith [Sat, 4 Feb 2012 02:38:34 +0000 (02:38 +0000)]
autoconf: update config header

Sync with the change in r149652.

Also fix the comment to sync with LLVM's config.h header.

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

12 years ago[analyzer] Turn on by default two checkers:
Anna Zaks [Sat, 4 Feb 2012 02:31:57 +0000 (02:31 +0000)]
[analyzer] Turn on by default two checkers:
 - osx.coreFoundation.containers.IndexOutOfBounds
 - osx.cocoa.SelfInit

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

12 years ago[analyzer] fixup to the previous commit.
Anna Zaks [Sat, 4 Feb 2012 02:31:53 +0000 (02:31 +0000)]
[analyzer] fixup to the previous commit.

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

12 years ago[analyzer] Minor cleanups to the ObjCSelfInitChecker.
Anna Zaks [Sat, 4 Feb 2012 02:31:37 +0000 (02:31 +0000)]
[analyzer] Minor cleanups to the ObjCSelfInitChecker.
(Also renames in other ObjC checkers to create one category of checks.)

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

12 years agoFixed some testsuite problems introduced by my
Sean Callanan [Sat, 4 Feb 2012 02:28:18 +0000 (02:28 +0000)]
Fixed some testsuite problems introduced by my
last commit.  Sorry for the outage.

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

12 years agoComment mystery code.
Nick Lewycky [Sat, 4 Feb 2012 02:16:48 +0000 (02:16 +0000)]
Comment mystery code.

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

12 years agoRevert r149721. chapuni tells me akyrtzi already fixed the test
Nico Weber [Sat, 4 Feb 2012 01:50:30 +0000 (01:50 +0000)]
Revert r149721. chapuni tells me akyrtzi already fixed the test
by adding a triple, and the typedef makes things worse on windows.

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

12 years agoUse variable in place of multiple CI.getFrontendOpts() calls and use a bit
Argyrios Kyrtzidis [Sat, 4 Feb 2012 01:36:04 +0000 (01:36 +0000)]
Use variable in place of multiple CI.getFrontendOpts() calls and use a bit
of ArrayRef goodness. No functionality change.

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

12 years agoNew test case.
Devang Patel [Sat, 4 Feb 2012 01:30:45 +0000 (01:30 +0000)]
New test case.

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

12 years agoClang has existing support for debuggers that
Sean Callanan [Sat, 4 Feb 2012 01:29:37 +0000 (01:29 +0000)]
Clang has existing support for debuggers that
want to provide "po"-like functionality which
treats the result of an expression implicitly as
"id" (if it is not otherwise known) and prints
it as an Objective-C object.

This has in the past been gated by the
"DebuggerSupport" language option, but that is
too general.  Debuggers also provide other commands
like "print" that do not make any assumptions
about whether the object is an Objective-C object.

This patch makes the assumption conditional on a
new language option: DebuggerCastResultToId.  I
have also made corresponding modifications to the
testsuite.

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

12 years agoCreate new tag for the property. This is a work in progress.
Devang Patel [Sat, 4 Feb 2012 01:15:04 +0000 (01:15 +0000)]
Create new tag for the property. This is a work in progress.

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

12 years ago[libclang] Stick to the silly notion that a forward class/protocol
Argyrios Kyrtzidis [Sat, 4 Feb 2012 01:04:58 +0000 (01:04 +0000)]
[libclang] Stick to the silly notion that a forward class/protocol
declaration is a reference. rdar://10749990

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

12 years agoSuppress the used-but-not-defined warning for static data members while I look into...
Eli Friedman [Sat, 4 Feb 2012 00:54:05 +0000 (00:54 +0000)]
Suppress the used-but-not-defined warning for static data members while I look into a rather nasty bug in the new odr-use marking code.

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

12 years agoconstexpr:
Richard Smith [Sat, 4 Feb 2012 00:33:54 +0000 (00:33 +0000)]
constexpr:
  The recent support for potential constant expressions exposed a bug in the
  implementation of libstdc++4.6, where numeric_limits<int>::min() is defined
  as (int)1 << 31, which isn't a constant expression. Disable the 'constexpr
  function never produces a constant expression' error inside system headers
  to compensate.

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

12 years agoUpdate tests so that they don't rely upon LLVMDebugVersion number.
Devang Patel [Fri, 3 Feb 2012 23:58:39 +0000 (23:58 +0000)]
Update tests so that they don't rely upon LLVMDebugVersion number.

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

12 years agoMake _mm_cmpgt_epi8 immute to -funsigned-char.
Nick Lewycky [Fri, 3 Feb 2012 23:57:48 +0000 (23:57 +0000)]
Make _mm_cmpgt_epi8 immute to -funsigned-char.

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

12 years agoTry to get test passing on windows.
Nico Weber [Fri, 3 Feb 2012 23:36:13 +0000 (23:36 +0000)]
Try to get test passing on windows.

Idea by Jean-Daniel Dupas.

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

12 years agoMake explicit captures which cause implicit captures work correctly.
Eli Friedman [Fri, 3 Feb 2012 23:06:43 +0000 (23:06 +0000)]
Make explicit captures which cause implicit captures work correctly.

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

12 years agoImplement implicit capture for lambda expressions.
Eli Friedman [Fri, 3 Feb 2012 22:47:37 +0000 (22:47 +0000)]
Implement implicit capture for lambda expressions.

Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases.

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

12 years agoMake sure that the layout-override parser grabs the size, not the data
Douglas Gregor [Fri, 3 Feb 2012 19:31:51 +0000 (19:31 +0000)]
Make sure that the layout-override parser grabs the size, not the data
size. Otherwise, we can end up with bogus layouts.

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

12 years agoWhen a pack expansion occurs in the template argument list of an alias
Douglas Gregor [Fri, 3 Feb 2012 17:16:23 +0000 (17:16 +0000)]
When a pack expansion occurs in the template argument list of an alias
template without a corresponding parameter pack, don't immediately
substitute the alias template. This is under discussion in the C++
committee, and may become ill-formed, but for now we match GCC.

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

12 years agoAdd a triple to test/SemaObjC/format-strings-objc.m to make it pass in windows hosts.
Argyrios Kyrtzidis [Fri, 3 Feb 2012 17:13:43 +0000 (17:13 +0000)]
Add a triple to test/SemaObjC/format-strings-objc.m to make it pass in windows hosts.

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

12 years agoDon't warn about anonymous struct/union in C11.
Hans Wennborg [Fri, 3 Feb 2012 15:47:04 +0000 (15:47 +0000)]
Don't warn about anonymous struct/union in C11.

Also, in C, call this a C11 extension rather than a GNU extension.

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

12 years agoImplement support for a pack expansion into a fixed-length
Douglas Gregor [Fri, 3 Feb 2012 07:34:46 +0000 (07:34 +0000)]
Implement support for a pack expansion into a fixed-length
template. Such pack expansions can easily fail at template
instantiation time, if the expanded parameter packs are of the wrong
length. Fixes <rdar://problem/10040867>, PR9021, and the example that
came up today at Going Native.

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

12 years ago[analyzer] Testing: add automated reference results reset.
Anna Zaks [Fri, 3 Feb 2012 06:35:23 +0000 (06:35 +0000)]
[analyzer] Testing: add automated reference results reset.

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

12 years agoFix -ftrap-function fallout from llvm r145714. <rdar://problem/10799325>
Bob Wilson [Fri, 3 Feb 2012 06:27:22 +0000 (06:27 +0000)]
Fix -ftrap-function fallout from llvm r145714.  <rdar://problem/10799325>

That llvm change removed the -trap-func backend option, so that using
-ftrap-function with clang would cause the backend to complain.  Fix it
by adding the trap function name to the CodeGenOptions and passing it through
to the TargetOptions.

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

12 years agoChange Lexer::makeFileCharRange() to have it accept a CharSourceRange
Argyrios Kyrtzidis [Fri, 3 Feb 2012 05:58:29 +0000 (05:58 +0000)]
Change Lexer::makeFileCharRange() to have it accept a CharSourceRange
instead of a SourceRange, and handle the case where the range is
a char (not token) range.

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

12 years agoChange the fixed array of FixitHints to a SmallVector to lift off
Argyrios Kyrtzidis [Fri, 3 Feb 2012 05:58:22 +0000 (05:58 +0000)]
Change the fixed array of FixitHints to a SmallVector to lift off
the limit on the number of fixits.

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

12 years agoMove isSentinelNullExpr() from Sema to ASTContext to make it more widely
Argyrios Kyrtzidis [Fri, 3 Feb 2012 05:58:16 +0000 (05:58 +0000)]
Move isSentinelNullExpr() from Sema to ASTContext to make it more widely
available.

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

12 years agoFurther downgrade -Warc-bridge-casts-disallowed-in-nonarc to a warning (not mapped...
Ted Kremenek [Fri, 3 Feb 2012 05:01:51 +0000 (05:01 +0000)]
Further downgrade -Warc-bridge-casts-disallowed-in-nonarc to a warning (not mapped to an error).  We can consider mapping it back to an error later.

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

12 years agoThread safety analysis:
Richard Smith [Fri, 3 Feb 2012 04:45:26 +0000 (04:45 +0000)]
Thread safety analysis:
 * When we detect that a CFG block has inconsistent lock sets, point the
   diagnostic at the location where we found the inconsistency, and point a note
   at somewhere the inconsistently-locked mutex was locked.
 * Fix the wording of the normal (non-loop, non-end-of-function) case of this
   diagnostic to not suggest that the mutex is going out of scope.
 * Fix the diagnostic emission code to keep a warning and its note together when
   sorting the diagnostics into source location order.

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

12 years agoThread safety analysis: at a CFG join point between a block terminating in a
Richard Smith [Fri, 3 Feb 2012 03:30:07 +0000 (03:30 +0000)]
Thread safety analysis: at a CFG join point between a block terminating in a
'continue' and another block, prefer the lockset from the other block, and
diagnose the 'continue' block as being the end of a loop.

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

12 years agoC++ 5.2.10p2 has a note that mentions that, subject to all other restrictions,
Chad Rosier [Fri, 3 Feb 2012 02:54:37 +0000 (02:54 +0000)]
C++ 5.2.10p2 has a note that mentions that, subject to all other restrictions,
a cast to the same type is allowed so long as it does not cast away constness.

Fix for PR11747. Patch by Aaron Ballman. Reviewed by Eli.

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

12 years agoRefactor capture in blocks to use new-style capture hooks. Start adding a bit of...
Eli Friedman [Fri, 3 Feb 2012 02:04:35 +0000 (02:04 +0000)]
Refactor capture in blocks to use new-style capture hooks.  Start adding a bit of the code for lambdas.  The only visible changes are that we use the C++11 odr-used rules to figure out when a variable is captured, and type-checking in lambdas is slightly more accurate.

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

12 years ago[frontend] Don't allow a mapping to a warning override an error/fatal mapping.
Chad Rosier [Fri, 3 Feb 2012 01:49:51 +0000 (01:49 +0000)]
[frontend] Don't allow a mapping to a warning override an error/fatal mapping.
rdar://10736625

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

12 years agoNote whether a lambda is mutable in the LambdaScopeInfo; this information will be...
Eli Friedman [Fri, 3 Feb 2012 01:39:09 +0000 (01:39 +0000)]
Note whether a lambda is mutable in the LambdaScopeInfo; this information will be necessary to handle references to captured variables.

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

12 years agoMake error about using bridge casts in non-ARC mode a warning that is default mapped...
Ted Kremenek [Fri, 3 Feb 2012 01:30:34 +0000 (01:30 +0000)]
Make error about using bridge casts in non-ARC mode a warning that is default mapped to an error.  This is to ease the transition of large apps moving from non-ARC to ARC.

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

12 years agoDo not show macro expansion in strncat warnings, which can be defined as
Anna Zaks [Fri, 3 Feb 2012 01:27:37 +0000 (01:27 +0000)]
Do not show macro expansion in strncat warnings, which can be defined as
a builtin.

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

12 years agoobjc: Issue diagnostic when receiver type is a forward class declaration and
Fariborz Jahanian [Fri, 3 Feb 2012 01:02:44 +0000 (01:02 +0000)]
objc: Issue diagnostic when receiver type is a forward class declaration and
it is treated as of 'id' type resulting in multiple method lookup.
// rdar://10686120

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

12 years agoReplace the old --with-cxx-* configure options with a single --with-gcc-toolchain
Rafael Espindola [Fri, 3 Feb 2012 01:01:20 +0000 (01:01 +0000)]
Replace the old --with-cxx-* configure options with a single --with-gcc-toolchain
that just uses the new toolchain probing logic. This fixes linking with -m32 on
64 bit systems (the /32 dir was not being added to the search).

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

12 years agoRename -dependency-graphviz to -dependencncy-dot
Douglas Gregor [Thu, 2 Feb 2012 23:45:13 +0000 (23:45 +0000)]
Rename -dependency-graphviz to -dependencncy-dot

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

12 years agoAdd some code to accurately perform odr-used marking for variables per the C++11...
Eli Friedman [Thu, 2 Feb 2012 23:15:15 +0000 (23:15 +0000)]
Add some code to accurately perform odr-used marking for variables per the C++11 rules.

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

12 years agoFurther enhance comment for property in continuation class.
Fariborz Jahanian [Thu, 2 Feb 2012 22:37:48 +0000 (22:37 +0000)]
Further enhance comment for property in continuation class.

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

12 years agounnecessary include of TargetMachine.h?
Andrew Trick [Thu, 2 Feb 2012 22:36:19 +0000 (22:36 +0000)]
unnecessary include of TargetMachine.h?

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

12 years agoInitialize the user defined conversion function to null if this is an aggregate initi...
Benjamin Kramer [Thu, 2 Feb 2012 19:35:29 +0000 (19:35 +0000)]
Initialize the user defined conversion function to null if this is an aggregate initialization from an initializer list.

Found by valgrind.

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

12 years agoUse -isystem rather than relying on -isysroot to work consistently
Douglas Gregor [Thu, 2 Feb 2012 19:35:15 +0000 (19:35 +0000)]
Use -isystem rather than relying on -isysroot to work consistently

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

12 years agoobjc: comment the code which allows narroing of property object
Fariborz Jahanian [Thu, 2 Feb 2012 19:34:05 +0000 (19:34 +0000)]
objc: comment the code which allows narroing of property object
type in continuation class.

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

12 years agoYet more data from failing buildbots...
Douglas Gregor [Thu, 2 Feb 2012 19:30:09 +0000 (19:30 +0000)]
Yet more data from failing buildbots...

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

12 years agoobjective-c: When redeclaraing in continuation class a 'readonly'
Fariborz Jahanian [Thu, 2 Feb 2012 18:54:58 +0000 (18:54 +0000)]
objective-c: When redeclaraing in continuation class a 'readonly'
property to 'readwrite', also allow redeclaration of
property type to a narrowring object type.
// rdar://10790488

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

12 years agoDrop -verify to get better diagnostics from failing buildbots. Plus, we don't need...
Douglas Gregor [Thu, 2 Feb 2012 18:54:34 +0000 (18:54 +0000)]
Drop -verify to get better diagnostics from failing buildbots. Plus, we don't need it here

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

12 years agoBack out my heinous hack that tricked the module generation mechanism
Douglas Gregor [Thu, 2 Feb 2012 18:42:48 +0000 (18:42 +0000)]
Back out my heinous hack that tricked the module generation mechanism
into using non-absolute system includes (<foo>)...

... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.

As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.

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

12 years agoPacify gcc's -Wreturn-type
Matt Beaumont-Gay [Thu, 2 Feb 2012 18:35:35 +0000 (18:35 +0000)]
Pacify gcc's -Wreturn-type

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

12 years agoPass the SourceMgr to the MCContext for cc1as.
Jim Grosbach [Thu, 2 Feb 2012 17:54:07 +0000 (17:54 +0000)]
Pass the SourceMgr to the MCContext for cc1as.

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

12 years agoMove the code that sets the AddressSafety
Alexander Potapenko [Thu, 2 Feb 2012 11:49:28 +0000 (11:49 +0000)]
Move the code that sets the AddressSafety
attribute into CodeGenModule::SetLLVMFunctionAttributesForDefinition().

Previously it resided in CodeGenModule::GetOrCreateLLVMFunction, which
for some reason wasn't called for ObjC class methods, see
http://code.google.com/p/address-sanitizer/issues/detail?id=33

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

12 years agor149587 reverted
Anton Yartsev [Thu, 2 Feb 2012 06:06:34 +0000 (06:06 +0000)]
r149587 reverted

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

12 years agoFix for PR10657 (http://llvm.org/bugs/show_bug.cgi?id=10657)
Anton Yartsev [Thu, 2 Feb 2012 05:13:59 +0000 (05:13 +0000)]
Fix for PR10657 (http://llvm.org/bugs/show_bug.cgi?id=10657)
extern inline case considered

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

12 years agoSplit Sema::MarkDeclarationReferenced into multiple functions; the additional entry...
Eli Friedman [Thu, 2 Feb 2012 03:46:19 +0000 (03:46 +0000)]
Split Sema::MarkDeclarationReferenced into multiple functions; the additional entry points are needed to implement C++11 odr-use marking correctly.  No functional change in this patch; I'll actually make the change which fixes the odr-use marking in a followup patch.

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

12 years ago[analyzer] Fix a false positive in the CFArrayCreate check that surfaces
Anna Zaks [Thu, 2 Feb 2012 01:30:08 +0000 (01:30 +0000)]
[analyzer] Fix a false positive in the CFArrayCreate check that surfaces
the the code like this (due to x and &x being the same value but
different size):

void* x[] = { ptr1, ptr2, ptr3 };
CFArrayCreate(NULL, (const void **) &x, count, NULL);

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

12 years agoconstexpr:
Richard Smith [Thu, 2 Feb 2012 01:16:57 +0000 (01:16 +0000)]
constexpr:
  * support the gcc __builtin_constant_p() ? ... : ... folding hack in C++11
  * check for unspecified values in pointer comparisons and pointer subtractions

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

12 years agoIntroduce a -cc1 option "-dependency-graphviz" that determines header
Douglas Gregor [Thu, 2 Feb 2012 00:54:52 +0000 (00:54 +0000)]
Introduce a -cc1 option "-dependency-graphviz" that determines header
dependencies and outputs them in GraphViz format.

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

12 years agoobjc: don't crash if primary class is missing and continuation class
Fariborz Jahanian [Thu, 2 Feb 2012 00:49:12 +0000 (00:49 +0000)]
objc: don't crash if primary class is missing and continuation class
is declaring ivars. // rdar://10752081

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

12 years agoChange the check for constant-conversion with width-1 bitfields so it doesn't suppres...
Eli Friedman [Thu, 2 Feb 2012 00:40:20 +0000 (00:40 +0000)]
Change the check for constant-conversion with width-1 bitfields so it doesn't suppress quite as many cases.  Based off a testcase in the gcc testsuite.

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

12 years agoback out r149504
Dylan Noblesmith [Thu, 2 Feb 2012 00:40:14 +0000 (00:40 +0000)]
back out r149504

Too many weird build failures.

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

12 years agoPer discussion on cfe-dev, remove '#error' and '#warning' from diagnostic text.
Ted Kremenek [Thu, 2 Feb 2012 00:16:13 +0000 (00:16 +0000)]
Per discussion on cfe-dev, remove '#error' and '#warning' from diagnostic text.

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

12 years agoobjc2: add __has_feature(objc_default_synthesize_properties).
Fariborz Jahanian [Thu, 2 Feb 2012 00:15:51 +0000 (00:15 +0000)]
objc2: add __has_feature(objc_default_synthesize_properties).
// rdar://10770497

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

12 years agor149474 went a bit too far when combined with type caching. If we want
Eric Christopher [Wed, 1 Feb 2012 23:39:00 +0000 (23:39 +0000)]
r149474 went a bit too far when combined with type caching. If we want
a full type go ahead and emit it if we currently only have a forward
declaration.

Fixes gdb bots for gdb1090.exp and call-ar-st.exp.

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

12 years agoReject mismatched "#pragma GCC visibility push" and "#pragma GCC visibility pop".
Rafael Espindola [Wed, 1 Feb 2012 23:24:59 +0000 (23:24 +0000)]
Reject mismatched "#pragma GCC visibility push" and "#pragma GCC visibility pop".

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

12 years agoLook for declaration of CFBridgingRetain/CFBridgingRetain before
Fariborz Jahanian [Wed, 1 Feb 2012 22:56:20 +0000 (22:56 +0000)]
Look for declaration of CFBridgingRetain/CFBridgingRetain before
changing the diagnostic. Also use correct spelling for both.

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

12 years agomake: fix installation of generated header files
Dylan Noblesmith [Wed, 1 Feb 2012 22:23:31 +0000 (22:23 +0000)]
make: fix installation of generated header files

The PROJ_SRC_DIR != PROJ_OBJ_DIR path was missing the directory
creation logic that was in the path for non-generated headers.
PR11903.

(The oversight was copied and pasted from LLVM's Makefile.rules,
where it apparently existed since time immemorial til it was
corrected in r127325.)

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

12 years agocmake: don't install config.h (v2)
Dylan Noblesmith [Wed, 1 Feb 2012 22:22:37 +0000 (22:22 +0000)]
cmake: don't install config.h (v2)

This header is private and shouldn't be used by clients.

(This reverts r149540, reinstating r149496. False alarm.)

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

12 years agoRemove duplicated comment.
Eric Christopher [Wed, 1 Feb 2012 21:48:10 +0000 (21:48 +0000)]
Remove duplicated comment.

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

12 years agoFix comment.
Eric Christopher [Wed, 1 Feb 2012 21:44:56 +0000 (21:44 +0000)]
Fix comment.

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

12 years agocmake: revert r149496
Dylan Noblesmith [Wed, 1 Feb 2012 21:17:55 +0000 (21:17 +0000)]
cmake: revert r149496

It *looks* like this caused PR11903, somehow.

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

12 years agoMake sure that imported definitions get completed before we add
Douglas Gregor [Wed, 1 Feb 2012 21:00:38 +0000 (21:00 +0000)]
Make sure that imported definitions get completed before we add
anything into the corresponding DeclContext. Co-hacked with Sean;
fixes <rdar://problem/10768928>.

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

12 years agolibclang: Mark clang_Cursor_isNull with CINDEX_LINKAGE to make it available on windows.
Benjamin Kramer [Wed, 1 Feb 2012 20:37:28 +0000 (20:37 +0000)]
libclang: Mark clang_Cursor_isNull with CINDEX_LINKAGE to make it available on windows.

Patch by Timothy J Fontaine!

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

12 years ago[libclang] Make sure we don't ever leave a StoredDiagnostic associated with
Argyrios Kyrtzidis [Wed, 1 Feb 2012 19:54:02 +0000 (19:54 +0000)]
[libclang] Make sure we don't ever leave a StoredDiagnostic associated with
a SourceManager that has already been deleted, rdar://10768346.

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

12 years agoAdd missing dependency to unbreak the CMake build
Douglas Gregor [Wed, 1 Feb 2012 19:53:01 +0000 (19:53 +0000)]
Add missing dependency to unbreak the CMake build

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

12 years agosize() == 0 -> empty().
David Chisnall [Wed, 1 Feb 2012 19:16:56 +0000 (19:16 +0000)]
size() == 0 -> empty().

Spotted by rjmcall.

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

12 years ago[analyzer] Fix a crash in CheckerContext::isCLibraryFunction for C++
Anna Zaks [Wed, 1 Feb 2012 19:16:20 +0000 (19:16 +0000)]
[analyzer] Fix a crash in CheckerContext::isCLibraryFunction for C++
declarations with special names.

A patch by Dmitri Gribenko.

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

12 years agoAdd a new compiler warning, which flags anti-patterns used as the size
Anna Zaks [Wed, 1 Feb 2012 19:08:57 +0000 (19:08 +0000)]
Add a new compiler warning, which flags anti-patterns used as the size
argument in strncat.

The warning is ignored by default since it needs more qualification.

TODO: The warning message and the note are messy when
strncat is a builtin due to the macro expansion.

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

12 years agoDiagnose the restriction on default arguments in C++11 [expr.prim.lambda]p5.
Douglas Gregor [Wed, 1 Feb 2012 17:18:19 +0000 (17:18 +0000)]
Diagnose the restriction on default arguments in C++11 [expr.prim.lambda]p5.

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

12 years agoIntroduce the lambda scope before determining explicit captures, which
Douglas Gregor [Wed, 1 Feb 2012 17:04:21 +0000 (17:04 +0000)]
Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
  - We get rid of the ugly dance of computing all of the captures in
  data structures that clone those of CapturingScopeInfo, centralizing
  the logic for accessing/updating these data structures
  - We re-use the existing capture logic for 'this', which actually
  works now.

Cleaned up some diagnostic wording in minor ways as well.

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

12 years ago[analyzer] Testing: add 2 new checkers to the buildbot script.
Anna Zaks [Wed, 1 Feb 2012 16:46:57 +0000 (16:46 +0000)]
[analyzer] Testing: add 2 new checkers to the buildbot script.

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

12 years agotest/Driver/target.c: Relax expression for "gcc.exe" on win32.
NAKAMURA Takumi [Wed, 1 Feb 2012 15:16:22 +0000 (15:16 +0000)]
test/Driver/target.c: Relax expression for "gcc.exe" on win32.

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

12 years agoinclude clang's config.h unconditionally
Dylan Noblesmith [Wed, 1 Feb 2012 14:25:28 +0000 (14:25 +0000)]
include clang's config.h unconditionally

And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too. (clang r149497 / llvm r149498)

Also include the config.h header after all other headers, per
the LLVM coding standards.

It also turns out WindowsToolChain.cpp wasn't using the config
header at all, so that include's just deleted now.

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

12 years agotest/Modules/compiler_builtins.m: Appease Cygwin to add -D__need_wint_t.
NAKAMURA Takumi [Wed, 1 Feb 2012 14:09:19 +0000 (14:09 +0000)]
test/Modules/compiler_builtins.m: Appease Cygwin to add -D__need_wint_t.

On Cygwin, at first, <stddef.h> is included without __need_wint_t.
Next, <stddef.h> is included with __need_wint_t, though Modules feature would not process <stddef.h> twice.
Then, wint_t is not found in system headers.

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

12 years agotest/Modules/compiler_builtins.m: Mark this as XFAIL:win32. MS limits.h provides...
NAKAMURA Takumi [Wed, 1 Feb 2012 14:09:13 +0000 (14:09 +0000)]
test/Modules/compiler_builtins.m: Mark this as XFAIL:win32. MS limits.h provides size_t.

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

12 years agoautoconf: add private config.h to clang
Dylan Noblesmith [Wed, 1 Feb 2012 13:50:25 +0000 (13:50 +0000)]
autoconf: add private config.h to clang

This already exists in the CMake build, which is part of what makes
building clang separately from llvm via cmake possible. This cleans up
that discrepancy between the build systems (and sets the groundwork
for configuring clang separately, too).

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