]> granicus.if.org Git - clang/log
clang
12 years agoRevert r149083 which is not the direction we're going in the Clang
Chandler Carruth [Tue, 31 Jan 2012 02:21:20 +0000 (02:21 +0000)]
Revert r149083 which is not the direction we're going in the Clang
driver based on discussions with Doug Gregor. There are several issues:
1) The patch was not reviewed prior to commit and there were review comments.
2) The design of the functionality (triple-prefixed tool invocation)
   isn't the design we want for Clang going forward: it focuses on the
   "user triple" rather than on the "toolchain triple", and forces that
   bit of state into the API of every single toolchain instead of
   handling it automatically in the common base classes.
3) The tests provided are not stable. They fail on a few Linux variants
   (Gentoo among them) and on mingw32 and some other environments.

I *am* interested in the Clang driver being able to invoke
triple-prefixed tools, but we need to design that feature the right way.
This patch just extends the previous hack without fixing the underlying
problems with it. I'm working on a new design for this that I will mail
for review by tomorrow.

I am aware that this removes functionality that NetBSD relies on, but
this is ToT, not a release. This functionality hasn't been properly
designed, implemented, and tested yet. We can't "regress" until we get
something that really works, both with the immediate use cases and with
long term maintenance of the Clang driver.

For reference, the original commit log:
Keep track of the original target the user specified before
normalization. This used to be captured in DefaultTargetTriple and is
used for the (optional) $triple-$tool lookup for cross-compilation.
Do this properly by making it an attribute of the toolchain and use it
in combination with the computed triple as index for the toolchain
lookup.

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

12 years agoRevert r149311 which failed to compile.
Argyrios Kyrtzidis [Tue, 31 Jan 2012 02:14:24 +0000 (02:14 +0000)]
Revert r149311 which failed to compile.

Original log:

Convert ProgramStateRef to a smart pointer for managing the reference counts of ProgramStates.  This leads to a slight memory
improvement, and a simplification of the logic for managing ProgramState objects.

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

12 years agoFix "long double" and __SIZE_TYPE__ on powerpc, now with test fix.
Nico Weber [Tue, 31 Jan 2012 02:07:33 +0000 (02:07 +0000)]
Fix "long double" and __SIZE_TYPE__ on powerpc, now with test fix.

Fixes PR11867. Patch from Jeremy Huddleston!

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

12 years agoconstexpr: remove integral conversion overflow checking introduced in r149286.
Richard Smith [Tue, 31 Jan 2012 01:47:46 +0000 (01:47 +0000)]
constexpr: remove integral conversion overflow checking introduced in r149286.
As Eli points out, this is implementation-defined, and the way we define it
makes this fine.

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

12 years agoLet %S, %ls, %C match 16bit types in NSStrings.
Nico Weber [Tue, 31 Jan 2012 01:43:25 +0000 (01:43 +0000)]
Let %S, %ls, %C match 16bit types in NSStrings.

As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html

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

12 years agoClean up switch in Expr::CanThrow. No functional change.
Eli Friedman [Tue, 31 Jan 2012 01:21:45 +0000 (01:21 +0000)]
Clean up switch in Expr::CanThrow.  No functional change.

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

12 years agoMinor refactor within ExplodedGraph::reclaimRecentlyAllocatedNodes(). No functionali...
Ted Kremenek [Tue, 31 Jan 2012 01:20:02 +0000 (01:20 +0000)]
Minor refactor within ExplodedGraph::reclaimRecentlyAllocatedNodes().  No functionality change.

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

12 years agoConvert checker over to using ProgramStateRef.
Ted Kremenek [Tue, 31 Jan 2012 01:19:57 +0000 (01:19 +0000)]
Convert checker over to using ProgramStateRef.

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

12 years agofix test.
Fariborz Jahanian [Tue, 31 Jan 2012 01:05:11 +0000 (01:05 +0000)]
fix test.

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

12 years agoConvert ProgramStateRef to a smart pointer for managing the reference counts of Progr...
Ted Kremenek [Tue, 31 Jan 2012 00:57:20 +0000 (00:57 +0000)]
Convert ProgramStateRef to a smart pointer for managing the reference counts of ProgramStates.  This leads to a slight memory
improvement, and a simplification of the logic for managing ProgramState objects.

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

12 years agoConvert more uses of 'const ProgramState *' to 'ProgramStateRef' (and related cleanups).
Ted Kremenek [Tue, 31 Jan 2012 00:57:15 +0000 (00:57 +0000)]
Convert more uses of 'const ProgramState *' to 'ProgramStateRef' (and related cleanups).

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

12 years agoRevert r149285, it breaks test/Preprocessor/init.c.
Nico Weber [Mon, 30 Jan 2012 23:53:44 +0000 (23:53 +0000)]
Revert r149285, it breaks test/Preprocessor/init.c.

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

12 years agotest for a v-table dispatch that consumes an
Fariborz Jahanian [Mon, 30 Jan 2012 23:39:30 +0000 (23:39 +0000)]
test for a v-table dispatch that consumes an
argument. twik to support the test case.
// rdar://10444476

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

12 years agoconstexpr: disallow signed integer overflow in integral conversions in constant
Richard Smith [Mon, 30 Jan 2012 22:27:01 +0000 (22:27 +0000)]
constexpr: disallow signed integer overflow in integral conversions in constant
expressions in C++11.

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

12 years agoFix "long double" and __SIZE_TYPE__ on powerpc.
Nico Weber [Mon, 30 Jan 2012 22:25:29 +0000 (22:25 +0000)]
Fix "long double" and __SIZE_TYPE__ on powerpc.

Fixes PR11867. Patch from Jeremy Huddleston!

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

12 years agoRemove tgmath.h from the module map for now, because it currently causes a
Douglas Gregor [Mon, 30 Jan 2012 22:22:39 +0000 (22:22 +0000)]
Remove tgmath.h from the module map for now, because it currently causes a
cyclic module dependency due to its inclusion of math.h and
complex.h. I'll take another shot at it later.

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

12 years agoobjc-arc: Perform null check on receiver before sending methods which
Fariborz Jahanian [Mon, 30 Jan 2012 21:40:37 +0000 (21:40 +0000)]
objc-arc: Perform null check on receiver before sending methods which
consume one or more of their arguments. If not done, this will cause a leak
as method will not consume the argument when receiver is null.
In this patch, the null path releases consumed argument.
// rdar://10444474

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

12 years ago[analyzer] Rename the checker as per Ted's comment. Remove the reference
Anna Zaks [Mon, 30 Jan 2012 21:14:16 +0000 (21:14 +0000)]
[analyzer] Rename the checker as per Ted's comment. Remove the reference
from the driver.

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

12 years agoDisable "non literal format string" for NSString that result from a macro expansion.
Jean-Daniel Dupas [Mon, 30 Jan 2012 19:46:17 +0000 (19:46 +0000)]
Disable "non literal format string" for NSString that result from a macro expansion.
This is to prevent diagnostic when using NSLocalizedString or CFCopyLocalizedString
macros which are usually used in place of NS and CF strings literals.

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

12 years ago[analyzer] Make osx.cocos.CFContainersSyntax a default checker.
Anna Zaks [Mon, 30 Jan 2012 19:12:37 +0000 (19:12 +0000)]
[analyzer] Make osx.cocos.CFContainersSyntax a default checker.

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

12 years agoFix typo spotted by Sebastian. Thanks!
Douglas Gregor [Mon, 30 Jan 2012 18:49:05 +0000 (18:49 +0000)]
Fix typo spotted by Sebastian. Thanks!

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

12 years agoPer discussion on cxx-abi-dev, don't drop leading zeroes from the
John McCall [Mon, 30 Jan 2012 18:36:31 +0000 (18:36 +0000)]
Per discussion on cxx-abi-dev, don't drop leading zeroes from the
mangling of floating-point literals.  I just went ahead and
reimplemented toString() here;  if someone wants to generalize
the library routine to do this, or feels strongly that we should
be post-processing, please feel free.

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

12 years agoSmallBitVectorize the deduced parameter set.
Benjamin Kramer [Mon, 30 Jan 2012 16:17:39 +0000 (16:17 +0000)]
SmallBitVectorize the deduced parameter set.

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

12 years agoFix yet another issue introduced when renaming '-ccc-host-triple' to
Chandler Carruth [Mon, 30 Jan 2012 12:25:35 +0000 (12:25 +0000)]
Fix yet another issue introduced when renaming '-ccc-host-triple' to
'-target'. The original flag was part of a flag group that marked it as
driver-only. The new flag didn't ever get equivalent treatment. This
caused the '-target' flag to get passed down to any raw GCC invocation.
Marking it as a driver option fixes this and PR11875.

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

12 years agoRemove long dead code for handling vector shift by immediate builtins.
Craig Topper [Mon, 30 Jan 2012 08:51:36 +0000 (08:51 +0000)]
Remove long dead code for handling vector shift by immediate builtins.

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

12 years agoUpdate on format attribute handling.
Jean-Daniel Dupas [Mon, 30 Jan 2012 08:46:47 +0000 (08:46 +0000)]
Update on format attribute handling.
- Remove the printf0 special handling as we treat it as printf anyway.
- Perform basic checks (non-literal, empty) for all formats and not only printf/scanf.

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

12 years agoRemove custom handling for cmpsd/cmpss/cmppd/cmpps builtins. The builtins are now...
Craig Topper [Mon, 30 Jan 2012 08:38:42 +0000 (08:38 +0000)]
Remove custom handling for cmpsd/cmpss/cmppd/cmpps builtins. The builtins are now in IntrinsicsX86.td.

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

12 years agoCleanup 3dnow builtin handling. Most of them were already handled by LLVM connecting...
Craig Topper [Mon, 30 Jan 2012 08:18:19 +0000 (08:18 +0000)]
Cleanup 3dnow builtin handling. Most of them were already handled by LLVM connecting intrinsics and builtins in IntrinsicsX86.td.

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

12 years ago[analyzer] Add index out of bounds check for CFArrayGetArrayAtIndex.
Anna Zaks [Mon, 30 Jan 2012 06:42:48 +0000 (06:42 +0000)]
[analyzer] Add index out of bounds check for CFArrayGetArrayAtIndex.

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

12 years agoIntroduce TargetInfo::hasFeature() to query various feature names in
Douglas Gregor [Mon, 30 Jan 2012 06:38:25 +0000 (06:38 +0000)]
Introduce TargetInfo::hasFeature() to query various feature names in
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.

Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.

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

12 years agoSimplify code by using the new getAggregateElement method that got added
Chris Lattner [Mon, 30 Jan 2012 06:20:36 +0000 (06:20 +0000)]
Simplify code by using the new getAggregateElement method that got added
recently.  This also conveniently gets clang ready for a change about to
land in mainline.

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

12 years agoThread a TargetInfo through to the module map; we'll need it for
Douglas Gregor [Mon, 30 Jan 2012 06:01:29 +0000 (06:01 +0000)]
Thread a TargetInfo through to the module map; we'll need it for
target-specific module requirements.

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

12 years agoCMake: Promote the testing targets out of folders on IDE.
NAKAMURA Takumi [Mon, 30 Jan 2012 03:15:47 +0000 (03:15 +0000)]
CMake: Promote the testing targets out of folders on IDE.

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

12 years agoJust disable the compiler-builtins module test on MSVC for now
Douglas Gregor [Sun, 29 Jan 2012 23:53:54 +0000 (23:53 +0000)]
Just disable the compiler-builtins module test on MSVC for now

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

12 years agoTeach tgmath.h to only include <complex.h> if it's available.
Douglas Gregor [Sun, 29 Jan 2012 23:40:50 +0000 (23:40 +0000)]
Teach tgmath.h to only include <complex.h> if it's available.

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

12 years agoTry to get useful diagnostics out of the failing MSVC builders
Douglas Gregor [Sun, 29 Jan 2012 23:24:52 +0000 (23:24 +0000)]
Try to get useful diagnostics out of the failing MSVC builders

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

12 years agoAlternate fix to the modules failures that doesn't require us to tweak tgmath.h
Douglas Gregor [Sun, 29 Jan 2012 22:47:19 +0000 (22:47 +0000)]
Alternate fix to the modules failures that doesn't require us to tweak tgmath.h

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

12 years agoIf there's no math.h, then tgmath.h should just be empty
Douglas Gregor [Sun, 29 Jan 2012 22:35:57 +0000 (22:35 +0000)]
If there's no math.h, then tgmath.h should just be empty

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

12 years agoTemporary disable the -verify on this test in the hope of getting some useful output...
Douglas Gregor [Sun, 29 Jan 2012 22:30:38 +0000 (22:30 +0000)]
Temporary disable the -verify on this test in the hope of getting some useful output from the buildbots

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

12 years agoIntroduce a module map for (some of) the compiler-supplied
Douglas Gregor [Sun, 29 Jan 2012 20:52:14 +0000 (20:52 +0000)]
Introduce a module map for (some of) the compiler-supplied
headers. The remaining headers require more sophisticated
requirements; they'll be handled separately. Part of
<rdar://problem/10710060>.

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

12 years agorevert r149184
Fariborz Jahanian [Sun, 29 Jan 2012 20:27:13 +0000 (20:27 +0000)]
revert r149184

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

12 years agoSwitch over to LLVM's file-level locking facility
Douglas Gregor [Sun, 29 Jan 2012 20:15:24 +0000 (20:15 +0000)]
Switch over to LLVM's file-level locking facility

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

12 years agoUpdate line numbers. Sigh
Douglas Gregor [Sun, 29 Jan 2012 20:05:18 +0000 (20:05 +0000)]
Update line numbers. Sigh

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

12 years agoAlso require a proper shell
Douglas Gregor [Sun, 29 Jan 2012 20:04:46 +0000 (20:04 +0000)]
Also require a proper shell

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

12 years agoEnsure that we clean up after a failed module build and cope with the
Douglas Gregor [Sun, 29 Jan 2012 19:57:03 +0000 (19:57 +0000)]
Ensure that we clean up after a failed module build and cope with the
results in libclang.

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

12 years agoImplement code completion support for module import declarations, e.g.,
Douglas Gregor [Sun, 29 Jan 2012 18:15:03 +0000 (18:15 +0000)]
Implement code completion support for module import declarations, e.g.,

  @import <complete with module names here>

or

  @import std.<complete with submodule names here>

Addresses <rdar://problem/10710117>.

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

12 years agoRework HeaderSearch's interface for getting a module from a name and
Douglas Gregor [Sun, 29 Jan 2012 17:08:11 +0000 (17:08 +0000)]
Rework HeaderSearch's interface for getting a module from a name and
for getting the name of the module file, unifying the code for
searching for a module with a given name (into lookupModule()) and
separating out the mapping to a module file (into
getModuleFileName()). No functionality change.

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

12 years agoTest module lookup within a subdirectory of a normal include directory.
Douglas Gregor [Sun, 29 Jan 2012 16:43:46 +0000 (16:43 +0000)]
Test module lookup within a subdirectory of a normal include directory.

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

12 years agoWhen emitting an ARC epilogue that looks like a return of 'self',
John McCall [Sun, 29 Jan 2012 07:46:59 +0000 (07:46 +0000)]
When emitting an ARC epilogue that looks like a return of 'self',
kill the retain from the return site.

This has the workaround nature.  It's badness all around.

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

12 years agoGet a little bit smarter about killing off the ReturnValue alloca
John McCall [Sun, 29 Jan 2012 02:35:02 +0000 (02:35 +0000)]
Get a little bit smarter about killing off the ReturnValue alloca
in the presence of straight-line cleanups.  This is a simple but
important case, particularly for ARC.

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

12 years agoComplain about attempts to use 'protected' visibility on targets
John McCall [Sun, 29 Jan 2012 01:20:30 +0000 (01:20 +0000)]
Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it.  We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

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

12 years agoobjc-arc: Perform null check on receiver before sending methods which
Fariborz Jahanian [Sat, 28 Jan 2012 18:46:31 +0000 (18:46 +0000)]
objc-arc: Perform null check on receiver before sending methods which
consume one or more of their arguments. If not done, this will cause a leak
as method will not consume the argument when receiver is null.
// rdar://10444474

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

12 years agoMake the __builtin_c[lt]zs builtins target independent.
Benjamin Kramer [Sat, 28 Jan 2012 18:42:57 +0000 (18:42 +0000)]
Make the __builtin_c[lt]zs builtins target independent.

There is really no reason to have these only available on x86. It's
just __builtin_c[tl]z for shorts.

Modernize the test while at it.

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

12 years agoUse defined-at-zero behavior for CLZ/CTZ builtins on PowerPC.
Bob Wilson [Sat, 28 Jan 2012 18:02:29 +0000 (18:02 +0000)]
Use defined-at-zero behavior for CLZ/CTZ builtins on PowerPC.

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

12 years agoStaticAnalyzer: Move ObjC- and CXX-specific methods out of line so checkers that...
Benjamin Kramer [Sat, 28 Jan 2012 12:06:22 +0000 (12:06 +0000)]
StaticAnalyzer: Move ObjC- and CXX-specific methods out of line so checkers that don't care about the language don't have to pull in all the headers.

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

12 years agoAdded tests for template keyword presence.
Abramo Bagnara [Sat, 28 Jan 2012 11:04:22 +0000 (11:04 +0000)]
Added tests for template keyword presence.

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

12 years agoDiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,
Argyrios Kyrtzidis [Sat, 28 Jan 2012 04:35:52 +0000 (04:35 +0000)]
DiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,
caught by Chad.

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

12 years agoAllow the external AST source to provide a layout without specifying
Douglas Gregor [Sat, 28 Jan 2012 00:53:29 +0000 (00:53 +0000)]
Allow the external AST source to provide a layout without specifying
the alignment (because it's not encoded in DWARF). In this case, make
an educated guess at the alignment.

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

12 years agoRemove the "C" in "implicitly declaring C library function" diagnostic
Jean-Daniel Dupas [Fri, 27 Jan 2012 23:21:02 +0000 (23:21 +0000)]
Remove the "C" in "implicitly declaring C library function" diagnostic
because all functions are not C functions (i.e. NSLog).

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

12 years agoIntroduce module attributes into the module map grammar, along with a
Douglas Gregor [Fri, 27 Jan 2012 19:52:33 +0000 (19:52 +0000)]
Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.

If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.

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

12 years agoAdded source location for the template keyword in AST template-id expressions.
Abramo Bagnara [Fri, 27 Jan 2012 09:46:47 +0000 (09:46 +0000)]
Added source location for the template keyword in AST template-id expressions.

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

12 years agoRemove redundant checks.
Jean-Daniel Dupas [Fri, 27 Jan 2012 09:14:17 +0000 (09:14 +0000)]
Remove redundant checks.

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

12 years agoAvoid redundant NNS qualification in constructor/destructor names.
Abramo Bagnara [Fri, 27 Jan 2012 08:46:19 +0000 (08:46 +0000)]
Avoid redundant NNS qualification in constructor/destructor names.

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

12 years agoAdd test for -Wno-everything.
Argyrios Kyrtzidis [Fri, 27 Jan 2012 07:10:14 +0000 (07:10 +0000)]
Add test for -Wno-everything.

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

12 years agoDue to a bug, -Wno-everything works like -Weverything. Fix the bug by having
Argyrios Kyrtzidis [Fri, 27 Jan 2012 06:15:43 +0000 (06:15 +0000)]
Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.

We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.

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

12 years agoIn FixItRecompile::BeginInvocation() reset the diagnostics before executing
Argyrios Kyrtzidis [Fri, 27 Jan 2012 06:15:37 +0000 (06:15 +0000)]
In FixItRecompile::BeginInvocation() reset the diagnostics before executing
the original action.

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

12 years agoReimplement (de-)serialization of Objective-C categories to eliminate
Douglas Gregor [Fri, 27 Jan 2012 01:47:08 +0000 (01:47 +0000)]
Reimplement (de-)serialization of Objective-C categories to eliminate
the direct serialization of the linked-list structure. Instead, use a
scheme similar to how we handle redeclarations, with redeclaration
lists on the side. This addresses several issues:
  - In cases involving mixing and matching of many categories across
  many modules, the linked-list structure would not be consistent
  across different modules, and categories would get lost.
  - If a module is loaded after the class definition and its other
  categories have already been loaded, we wouldn't see any categories
  in the newly-loaded module.

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

12 years agoBe sure to emit delayed diagnostics after parsing the declaration
John McCall [Fri, 27 Jan 2012 01:29:43 +0000 (01:29 +0000)]
Be sure to emit delayed diagnostics after parsing the declaration
of a for-range variable.  Fixes PR11793.

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

12 years agoconstexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
Richard Smith [Fri, 27 Jan 2012 01:14:48 +0000 (01:14 +0000)]
constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.

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

12 years agoIn FixItRecompile::BeginInvocation(), check the return value of BeginSourceFile().
Argyrios Kyrtzidis [Fri, 27 Jan 2012 01:00:47 +0000 (01:00 +0000)]
In FixItRecompile::BeginInvocation(), check the return value of BeginSourceFile().

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

12 years agoPlacate gcc's -Wreturn-type
Matt Beaumont-Gay [Fri, 27 Jan 2012 00:46:27 +0000 (00:46 +0000)]
Placate gcc's -Wreturn-type

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

12 years agotest/Driver/prefixed-tools.c: Disable this on win32 hosts, msvc and mingw.
NAKAMURA Takumi [Fri, 27 Jan 2012 00:31:09 +0000 (00:31 +0000)]
test/Driver/prefixed-tools.c: Disable this on win32 hosts, msvc and mingw.

It had failed on Win32 due to inability of executing shell scripts.
Still it fails even with mingw MSYS bash.

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

12 years agotest/Driver/prefixed-tools.c: Fix newline at end-of-file.
NAKAMURA Takumi [Fri, 27 Jan 2012 00:31:03 +0000 (00:31 +0000)]
test/Driver/prefixed-tools.c: Fix newline at end-of-file.

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

12 years agoTurn off implicit truncation warning for compound assignment to bitfields; it might...
Eli Friedman [Thu, 26 Jan 2012 23:34:06 +0000 (23:34 +0000)]
Turn off implicit truncation warning for compound assignment to bitfields; it might be reasonable in some cases, but it clearly doesn't make sense in some cases, like the included testcase.

<rdar://problem/10238797>, part 2.

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

12 years agoTeach ccc-analyzer about -fobjc-abi-version.
Ted Kremenek [Thu, 26 Jan 2012 23:30:13 +0000 (23:30 +0000)]
Teach ccc-analyzer about -fobjc-abi-version.

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

12 years agoMake the bitfield implicit truncation warning slightly more aggressive, and make...
Eli Friedman [Thu, 26 Jan 2012 23:11:39 +0000 (23:11 +0000)]
Make the bitfield implicit truncation warning slightly more aggressive, and make the printed warning a bit more accurate.  The new behavior matches gcc's -Wconversion.  <rdar://problem/10238797>.

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

12 years agoRemove the ToolTriple logic in NetBSD, which was completely broken by
Joerg Sonnenberger [Thu, 26 Jan 2012 22:27:52 +0000 (22:27 +0000)]
Remove the ToolTriple logic in NetBSD, which was completely broken by
the recent refactoring. All interesting NetBSD release have a GNU as
version on i386 that supports --32, so don't bother with the conditional
setting of it.

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

12 years agoMake clz/ctz builtins defined for zero on ARM targets. rdar://10732455
Bob Wilson [Thu, 26 Jan 2012 22:14:27 +0000 (22:14 +0000)]
Make clz/ctz builtins defined for zero on ARM targets.  rdar://10732455

ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

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

12 years agoRemove obviously incorrect branch.
Joerg Sonnenberger [Thu, 26 Jan 2012 21:58:37 +0000 (21:58 +0000)]
Remove obviously incorrect branch.

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

12 years agoKeep track of the original target the user specified before
Joerg Sonnenberger [Thu, 26 Jan 2012 21:56:28 +0000 (21:56 +0000)]
Keep track of the original target the user specified before
normalization. This used to be captured in DefaultTargetTriple and is
used for the (optional) $triple-$tool lookup for cross-compilation.
Do this properly by making it an attribute of the toolchain and use it
in combination with the computed triple as index for the toolchain
lookup.

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

12 years agoChange references to 'const ProgramState *' to typedef 'ProgramStateRef'.
Ted Kremenek [Thu, 26 Jan 2012 21:29:00 +0000 (21:29 +0000)]
Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.

At this point this is largely cosmetic, but it opens the door to replace
ProgramStateRef with a smart pointer that more eagerly acts in the role
of reclaiming unused ProgramState objects.

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

12 years agoobjc-arc: introduce -no-finalize-removal which in gc mode,
Fariborz Jahanian [Thu, 26 Jan 2012 20:57:58 +0000 (20:57 +0000)]
objc-arc: introduce -no-finalize-removal which in gc mode,
leaves "finalize' behind and in arc mode, does not
include it. This allows the migrated source to be compiled
in both gc and arc mode. // rdar://10532441

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

12 years agoDon't suppress access-control or invalid-type diagnostics from a
John McCall [Thu, 26 Jan 2012 20:04:03 +0000 (20:04 +0000)]
Don't suppress access-control or invalid-type diagnostics from a
declarator just because we were able to build an invalid decl
for it.  The invalid-type diagnostics, in particular, are still useful
to know, and may indicate something about why the decl is invalid.

Also, recover from an illegal pointer/reference-to-unqualified-retainable
type using __strong instead of __autoreleasing;  in general, a random
object is much more likely to be __strong, so this avoids unnecessary
cascading errors in the most common case.

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

12 years agoTry harder to get X7 defined
Douglas Gregor [Thu, 26 Jan 2012 18:38:13 +0000 (18:38 +0000)]
Try harder to get X7 defined

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

12 years agoChange HasMutableFields to HasOnlyCMembers and consider that a tag inside
Argyrios Kyrtzidis [Thu, 26 Jan 2012 18:28:08 +0000 (18:28 +0000)]
Change HasMutableFields to HasOnlyCMembers and consider that a tag inside
another tag does not break C-like-ness. rdar://10756831

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

12 years agoDon't separately serialize the list of instance variables in an
Douglas Gregor [Thu, 26 Jan 2012 17:31:14 +0000 (17:31 +0000)]
Don't separately serialize the list of instance variables in an
Objective-C class. The AST reader just throws away this data anyway!

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

12 years agoForce layout of more of the unions and structures in this test
Douglas Gregor [Thu, 26 Jan 2012 17:23:00 +0000 (17:23 +0000)]
Force layout of more of the unions and structures in this test

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

12 years agoobjc: 'id' and block pointer compare in mergeTypes is
Fariborz Jahanian [Thu, 26 Jan 2012 17:08:50 +0000 (17:08 +0000)]
objc: 'id' and block pointer compare in mergeTypes is
made symmetrical. // rdar://10734265

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

12 years agoAST/ExprConstant.cpp: Silence a warning on ms cl.exe. "bool" does not prefer to be...
NAKAMURA Takumi [Thu, 26 Jan 2012 09:37:36 +0000 (09:37 +0000)]
AST/ExprConstant.cpp: Silence a warning on ms cl.exe. "bool" does not prefer to be compared to integer.

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

12 years agoSuppress any warnings from this test. They aren't interesting, and they
Chandler Carruth [Thu, 26 Jan 2012 09:28:50 +0000 (09:28 +0000)]
Suppress any warnings from this test. They aren't interesting, and they
end up in the same output file as the layout stuff. There may even be
a race condition which is causing this output to confuse the FileCheck
in some cases. I actually don't know how on earth the parsing of the
layout file even works given that there are diagnostics in the middle of
it. ;]

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

12 years agoExtend the ExternalASTSource interface to allow the AST source to
Douglas Gregor [Thu, 26 Jan 2012 07:55:45 +0000 (07:55 +0000)]
Extend the ExternalASTSource interface to allow the AST source to
provide the layout of records, rather than letting Clang compute
the layout itself. LLDB provides the motivation for this feature:
because various layout-altering attributes (packed, aligned, etc.)
don't get reliably get placed into DWARF, the record layouts computed
by LLDB from the reconstructed records differ from the actual layouts,
and badness occurs. This interface lets the DWARF data drive layout,
so we don't need the attributes preserved to get the answer write.

The testing methodology for this change is fun. I've introduced a
variant of -fdump-record-layouts called -fdump-record-layouts-simple
that always has the simple C format and provides size/alignment/field
offsets. There is also a -cc1 option -foverride-record-layout=<file>
to take the output of -fdump-record-layouts-simple and parse it to
produce a set of overridden layouts, which is introduced into the AST
via a testing-only ExternalASTSource (called
LayoutOverrideSource). Each test contains a number of records to lay
out, which use various layout-changing attributes, and then dumps the
layouts. We then run the test again, using the preprocessor to
eliminate the layout-changing attributes entirely (which would give us
different layouts for the records), but supplying the
previously-computed record layouts. Finally, we diff the layouts
produced from the two runs to be sure that they are identical.

Note that this code makes the assumption that we don't *have* to
provide the offsets of bases or virtual bases to get the layout right,
because the alignment attributes don't affect it. I believe this
assumption holds, but if it does not, we can extend
LayoutOverrideSource to also provide base offset information.

Fixes the Clang side of <rdar://problem/10169539>.

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

12 years agoUse createRecordFwdDecl here since that's what we're doing.
Eric Christopher [Thu, 26 Jan 2012 07:11:58 +0000 (07:11 +0000)]
Use createRecordFwdDecl here since that's what we're doing.

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

12 years agoRevert previous patch unifying all of the C++ record prep in one area,
Eric Christopher [Thu, 26 Jan 2012 07:01:04 +0000 (07:01 +0000)]
Revert previous patch unifying all of the C++ record prep in one area,
the gdb testsuite complains too much about the ordering of items printed,
even if the offsets in the debug info are correct.

This reverts commit 027cb30af828f07750f9185782822297a5c57231.

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

12 years agoFix a minor bug in r148582, which made -ccc-host-triple into an alias option.
Bob Wilson [Thu, 26 Jan 2012 06:22:30 +0000 (06:22 +0000)]
Fix a minor bug in r148582, which made -ccc-host-triple into an alias option.
I'm not adding a testcase because -ccc-host-triple is slated to be removed,
but clang crashes if you try to use -ccc-host-triple without this fix.

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

12 years agoRemove another duplicated variable.
Eric Christopher [Thu, 26 Jan 2012 06:20:57 +0000 (06:20 +0000)]
Remove another duplicated variable.

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

12 years agoconstexpr: evaluate (bool)&x as true when x is a local variable or a temporary.
Richard Smith [Thu, 26 Jan 2012 04:47:34 +0000 (04:47 +0000)]
constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.

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

12 years agoRemove the headers now that ::close() is not used.
Argyrios Kyrtzidis [Thu, 26 Jan 2012 04:42:21 +0000 (04:42 +0000)]
Remove the headers now that ::close() is not used.

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

12 years agoIn FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
Argyrios Kyrtzidis [Thu, 26 Jan 2012 04:19:04 +0000 (04:19 +0000)]
In FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
with close(); return it instead.

Fixes mingw build and eliminates possible racing issues.

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

12 years ago[analyzer] The CFContainer test should only be run on x86_64.
Anna Zaks [Thu, 26 Jan 2012 04:00:23 +0000 (04:00 +0000)]
[analyzer] The CFContainer test should only be run on x86_64.

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

12 years agoRewrite/FrontendActions.cpp: Tweak to unbreak msvc.
NAKAMURA Takumi [Thu, 26 Jan 2012 03:47:18 +0000 (03:47 +0000)]
Rewrite/FrontendActions.cpp: Tweak to unbreak msvc.

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