]> granicus.if.org Git - clang/log
clang
12 years agoReapply "Only emit debug information for methods that are user defined, there's"
Eric Christopher [Tue, 5 Jun 2012 18:16:22 +0000 (18:16 +0000)]
Reapply "Only emit debug information for methods that are user defined, there's"

As the failing testcase has been fixed.

This reverts commit 0637f407e6ee7fdccde17fbf9a5fcc4853187b3e.

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

12 years agoRecursiveASTVisitor: add ability to visit implicit declarations. Patch by
Richard Smith [Tue, 5 Jun 2012 16:18:26 +0000 (16:18 +0000)]
RecursiveASTVisitor: add ability to visit implicit declarations. Patch by
James Dennett!

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

12 years agoMips: Define __mips_hard_float macro additional to __mips_single_float
Simon Atanasyan [Tue, 5 Jun 2012 13:06:56 +0000 (13:06 +0000)]
Mips: Define __mips_hard_float macro additional to __mips_single_float
when single float ABI is selected.

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

12 years agoRevert "Only emit debug information for methods that are user defined, there's"
John McCall [Tue, 5 Jun 2012 06:10:39 +0000 (06:10 +0000)]
Revert "Only emit debug information for methods that are user defined, there's"

This reverts r157970, which was not passing on
  clang-x86_64-darwin10-nobootstrap-RA

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

12 years agoOnly emit debug information for methods that are user defined, there's
Eric Christopher [Tue, 5 Jun 2012 00:15:06 +0000 (00:15 +0000)]
Only emit debug information for methods that are user defined, there's
not much reason to emit for constructors and destructors that aren't
user defined.

rdar://11593099

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

12 years agoTeach format string checking about compile-time CFString constants.
Jordan Rose [Mon, 4 Jun 2012 23:52:23 +0000 (23:52 +0000)]
Teach format string checking about compile-time CFString constants.

Within the guts of CheckFormatHandler, the IsObjCLiteral flag was being used in
two ways: to see if null bytes were allowed, and to see if the '%@' specifier
is allowed.* The former usage has been changed to an explicit test and the
latter pushed down to CheckPrintfHandler and renamed ObjCContext, since it
applies to CFStrings as well.

* This also changes how wide chars are interpreted; in OS X Foundation, the
wide character type is 'unichar', a typedef for short, rather than wchar_t.

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

12 years agoMake suggestions for mismatched enum arguments to printf/scanf.
Jordan Rose [Mon, 4 Jun 2012 22:49:02 +0000 (22:49 +0000)]
Make suggestions for mismatched enum arguments to printf/scanf.

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

12 years agoTeach printf/scanf about enums with fixed underlying types.
Jordan Rose [Mon, 4 Jun 2012 22:48:57 +0000 (22:48 +0000)]
Teach printf/scanf about enums with fixed underlying types.

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

12 years agoPR13022: cope with parenthesized function types in MS name mangling.
Richard Smith [Mon, 4 Jun 2012 22:46:59 +0000 (22:46 +0000)]
PR13022: cope with parenthesized function types in MS name mangling.

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

12 years agoAdd a warning for when an array-to-pointer decay is performed on an array
Richard Smith [Mon, 4 Jun 2012 22:27:30 +0000 (22:27 +0000)]
Add a warning for when an array-to-pointer decay is performed on an array
temporary or an array subobject of a class temporary, and the resulting value
is used to initialize a pointer which outlives the temporary. Such a pointer
is always left dangling after the initialization completes and the array's
lifetime ends.

In order to detect this situation, this change also adds an
LValueClassification of LV_ArrayTemporary for temporaries of array type which
aren't subobjects of class temporaries. These occur in C++11 T{...} and GNU C++
(T){...} expressions, when T is an array type. Previously we treated the former
as a generic prvalue and the latter as a class temporary.

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

12 years ago[analyzer] Fixup for r157950. Unbreak the bots.
Anna Zaks [Mon, 4 Jun 2012 21:59:02 +0000 (21:59 +0000)]
[analyzer] Fixup for r157950. Unbreak the bots.

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

12 years agoDocument how fixits on errors and warnings must behave.
Nico Weber [Mon, 4 Jun 2012 21:56:14 +0000 (21:56 +0000)]
Document how fixits on errors and warnings must behave.

Review and wording tweaks by Richard.

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

12 years agoAdd a testcase for C++11 union support.
Eric Christopher [Mon, 4 Jun 2012 21:32:12 +0000 (21:32 +0000)]
Add a testcase for C++11 union support.

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

12 years ago[objcmt] Don't migrate to subscripting syntax if the required methods have not
Argyrios Kyrtzidis [Mon, 4 Jun 2012 21:23:26 +0000 (21:23 +0000)]
[objcmt] Don't migrate to subscripting syntax if the required methods have not
been declared on NSArray/NSDictionary.

rdar://11581975

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

12 years ago[analyzer] Fix a diagnostics bug which lead to a crash on the buildbot.
Anna Zaks [Mon, 4 Jun 2012 21:03:31 +0000 (21:03 +0000)]
[analyzer] Fix a diagnostics bug which lead to a crash on the buildbot.

This bug was triggered by r157851. It only happens in the case where we
don't perform optimal diagnostic pruning.

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

12 years agoFixes some test cases that should have come along with r157943.
Aaron Ballman [Mon, 4 Jun 2012 20:07:46 +0000 (20:07 +0000)]
Fixes some test cases that should have come along with r157943.

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

12 years agoobjective-c: Handle more warning cases for when
Fariborz Jahanian [Mon, 4 Jun 2012 19:16:34 +0000 (19:16 +0000)]
objective-c: Handle more warning cases for when
message receiver is 'weak' property.
// rdar://10225276

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

12 years agoFixed a problem related to resolution of built-in headers in case a path of tool...
Alexander Kornienko [Mon, 4 Jun 2012 19:02:59 +0000 (19:02 +0000)]
Fixed a problem related to resolution of built-in headers in case a path of tool's binary contains sym-links.

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

12 years agoRemoving the lambda extension warning concerning single return statements, as it...
Aaron Ballman [Mon, 4 Jun 2012 18:57:41 +0000 (18:57 +0000)]
Removing the lambda extension warning concerning single return statements, as it no longer applies.

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

12 years ago[diagtool] Properly order libraries in Makefile for buildbot.
Jordan Rose [Mon, 4 Jun 2012 17:21:14 +0000 (17:21 +0000)]
[diagtool] Properly order libraries in Makefile for buildbot.

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

12 years agoRemove AST and Parse from Driver's dependencies.
Jordan Rose [Mon, 4 Jun 2012 16:57:53 +0000 (16:57 +0000)]
Remove AST and Parse from Driver's dependencies.

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

12 years ago[diagtool] Re-add show-enabled, minimizing the code pulled in from Frontend.
Jordan Rose [Mon, 4 Jun 2012 16:57:50 +0000 (16:57 +0000)]
[diagtool] Re-add show-enabled, minimizing the code pulled in from Frontend.

Now correctly builds with both GNU make and CMake.

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

12 years agoRequire -pie when linking with ASan on Android.
Evgeniy Stepanov [Mon, 4 Jun 2012 11:15:05 +0000 (11:15 +0000)]
Require -pie when linking with ASan on Android.

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

12 years agoTest the '__thread' before 'static' warning.
Hans Wennborg [Mon, 4 Jun 2012 10:19:34 +0000 (10:19 +0000)]
Test the '__thread' before 'static' warning.

Also fix the '__thread' before 'extern' case.

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

12 years agoAdd fma3 intrinsic header file.
Craig Topper [Mon, 4 Jun 2012 03:42:47 +0000 (03:42 +0000)]
Add fma3 intrinsic header file.

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

12 years agoWhen adding built-in operator candidates for overload resolution
Douglas Gregor [Mon, 4 Jun 2012 00:15:09 +0000 (00:15 +0000)]
When adding built-in operator candidates for overload resolution
involving 'restrict', place restrict on the pointer type rather than
on the pointee type. Also make sure that we gather restrict from the
pointer type. Fixes PR12854 and the major part of PR11093.

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

12 years agoMake disabling SSE levels also disable AVX and FMA.
Craig Topper [Sun, 3 Jun 2012 22:23:42 +0000 (22:23 +0000)]
Make disabling SSE levels also disable AVX and FMA.

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

12 years agoMake AES and PCLMUL features imply SSE2 as that's needed to get the right types defined.
Craig Topper [Sun, 3 Jun 2012 21:56:22 +0000 (21:56 +0000)]
Make AES and PCLMUL features imply SSE2 as that's needed to get the right types defined.

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

12 years agoAdd __POPCNT__ to test cases for corei7 and corei7-avx
Craig Topper [Sun, 3 Jun 2012 21:49:41 +0000 (21:49 +0000)]
Add __POPCNT__ to test cases for corei7 and corei7-avx

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

12 years agoAdd fma feature flag for Intel FMA instructions.
Craig Topper [Sun, 3 Jun 2012 21:46:30 +0000 (21:46 +0000)]
Add fma feature flag for Intel FMA instructions.

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

12 years agoUpgrade test for the fma4->fma intrinsic change.
Benjamin Kramer [Sun, 3 Jun 2012 10:12:04 +0000 (10:12 +0000)]
Upgrade test for the fma4->fma intrinsic change.

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

12 years agoImprove fixit for comparison operator on lhs of bitwise operator.
Nico Weber [Sun, 3 Jun 2012 07:07:00 +0000 (07:07 +0000)]
Improve fixit for comparison operator on lhs of bitwise operator.

Before:
test.cc:2:18: note: place parentheses around the == expression to silence this warning
  if (0 == flags & 0xdd)
                 ^
                   (   )

Now:
test.cc:2:18: note: place parentheses around the == expression to silence this warning
  if (0 == flags & 0xdd)
                 ^
      (         )

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

12 years agoFollow-up on the test of r157892
Argyrios Kyrtzidis [Sat, 2 Jun 2012 18:20:16 +0000 (18:20 +0000)]
Follow-up on the test of r157892

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

12 years agoInitialize the non-target-dependent fields of the Preprocessor in its constructor
Argyrios Kyrtzidis [Sat, 2 Jun 2012 18:08:09 +0000 (18:08 +0000)]
Initialize the non-target-dependent fields of the Preprocessor in its constructor
so we can destroy it even if it was constructed with "DelayInitialization = true",
and we didn't end up calling Preprocessor::Initialize.

Fixes crashes in rdar://11558355

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

12 years agoRevert r157819, "#ifdef out a broken test on win32"
NAKAMURA Takumi [Sat, 2 Jun 2012 15:34:26 +0000 (15:34 +0000)]
Revert r157819, "#ifdef out a broken test on win32"

FYI, LLVM_ON_WIN32 is useless.

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

12 years agoToolInvocation::mapVirtualFile(): Tweak for Win32. Handle the key as native path.
NAKAMURA Takumi [Sat, 2 Jun 2012 15:34:21 +0000 (15:34 +0000)]
ToolInvocation::mapVirtualFile(): Tweak for Win32. Handle the key as native path.

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

12 years agoMIPS: Factor out code selects the float ABI as determined by -msoft-float,
Simon Atanasyan [Sat, 2 Jun 2012 15:06:29 +0000 (15:06 +0000)]
MIPS: Factor out code selects the float ABI as determined by -msoft-float,
-mhard-float, and -mfloat-abi= to the new function getMipsFloatABI. That
simplifies reuse of this code.

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

12 years agoFix typos found by http://github.com/lyda/misspell-check
Benjamin Kramer [Sat, 2 Jun 2012 10:20:41 +0000 (10:20 +0000)]
Fix typos found by http://github.com/lyda/misspell-check

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

12 years agoImplementation of a "soft opt-in" option for -Wimplicit-fallthrough diagnostics:...
Alexander Kornienko [Sat, 2 Jun 2012 01:01:07 +0000 (01:01 +0000)]
Implementation of a "soft opt-in" option for -Wimplicit-fallthrough diagnostics: -Wimplicit-fallthrough-per-method

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

12 years ago[analyzer] Rely on canBeInlined utility instead of checking CallExpr
Anna Zaks [Sat, 2 Jun 2012 00:40:52 +0000 (00:40 +0000)]
[analyzer] Rely on canBeInlined utility instead of checking CallExpr
explicitly.

This will make it easier to add inlining support to more expressions.

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

12 years ago[analyzer] Fix a spurious undef value warning.
Anna Zaks [Fri, 1 Jun 2012 23:48:44 +0000 (23:48 +0000)]
[analyzer] Fix a spurious undef value warning.

When we timeout or exceed a max number of blocks within an inlined
function, we retry with no inlining starting from a node right before
the CallEnter node. We assume the state of that node is the state of the
program before we start evaluating the call. However, the node pruning
removes this node as unimportant.

Teach the node pruning to keep the predecessors of the call enter nodes.

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

12 years ago[analyzer] Fix lack of coverage after empty inlined function.
Anna Zaks [Fri, 1 Jun 2012 23:48:40 +0000 (23:48 +0000)]
[analyzer] Fix lack of coverage after empty inlined function.

We should not stop exploring the path after we return from an empty
function.

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

12 years agoDisable diagnosic path pruning for ReturnUndefChecker.
Ted Kremenek [Fri, 1 Jun 2012 23:04:04 +0000 (23:04 +0000)]
Disable diagnosic path pruning for ReturnUndefChecker.

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

12 years ago[diagtool] Pull show-enabled back out for now.
Jordan Rose [Fri, 1 Jun 2012 22:23:02 +0000 (22:23 +0000)]
[diagtool] Pull show-enabled back out for now.

Need to figure out how to get Frontend's warning parsing without bringing
in all of Frontend.

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

12 years ago[diagtool] Unbork Makefile build.
Jordan Rose [Fri, 1 Jun 2012 22:02:18 +0000 (22:02 +0000)]
[diagtool] Unbork Makefile build.

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

12 years agoUpdate checker build.
Ted Kremenek [Fri, 1 Jun 2012 21:51:15 +0000 (21:51 +0000)]
Update checker build.

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

12 years ago[diagtool] Appease buildbot by adding llvm_unreachable.
Jordan Rose [Fri, 1 Jun 2012 21:50:37 +0000 (21:50 +0000)]
[diagtool] Appease buildbot by adding llvm_unreachable.

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

12 years ago[diagtool] Add 'show-enabled', which displays which warnings are enabled.
Jordan Rose [Fri, 1 Jun 2012 21:23:17 +0000 (21:23 +0000)]
[diagtool] Add 'show-enabled', which displays which warnings are enabled.

show-enabled uses the command line you give it to build a CompilerInstance,
so any flags you pass will be processed as if running clang proper.

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

12 years ago[diagtool] The driver skips two arguments, not one.
Jordan Rose [Fri, 1 Jun 2012 21:23:13 +0000 (21:23 +0000)]
[diagtool] The driver skips two arguments, not one.

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

12 years agostatic analyzer: add inlining support for directly called blocks.
Ted Kremenek [Fri, 1 Jun 2012 20:04:04 +0000 (20:04 +0000)]
static analyzer: add inlining support for directly called blocks.

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

12 years agoDon't allow multiple correction candidates that have the same identifier
Kaelyn Uhrain [Fri, 1 Jun 2012 18:11:16 +0000 (18:11 +0000)]
Don't allow multiple correction candidates that have the same identifier
but different nested name specifiers to quietly clobber each other so
only one remains if they do not refer to the same NamedDecl. Fixes
PR12951.

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

12 years ago#ifdef out a broken test on win32
Alexander Kornienko [Fri, 1 Jun 2012 16:48:55 +0000 (16:48 +0000)]
#ifdef out a broken test on win32

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

12 years ago[analyzer] SATestBuild should execute SVN updates even if Verbose is off.
Jordan Rose [Fri, 1 Jun 2012 16:24:43 +0000 (16:24 +0000)]
[analyzer] SATestBuild should execute SVN updates even if Verbose is off.

Also, re-use glob results when looking for failure logs.

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

12 years ago[analyzer] Fix SATestAdd to work with SATestBuild.
Jordan Rose [Fri, 1 Jun 2012 16:24:38 +0000 (16:24 +0000)]
[analyzer] Fix SATestAdd to work with SATestBuild.

Also, eliminate global 'IsReferenceBuild' in SATestBuild. It doesn't get
passed around that much.

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

12 years agoAdded a test for ToolInvocation::mapVirtualFile method.
Alexander Kornienko [Fri, 1 Jun 2012 14:50:43 +0000 (14:50 +0000)]
Added a test for ToolInvocation::mapVirtualFile method.

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

12 years agoSupport C++11 enum forward declarations.
Eric Christopher [Fri, 1 Jun 2012 00:22:57 +0000 (00:22 +0000)]
Support C++11 enum forward declarations.

Part of rdar://11570854

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

12 years ago[arcmt] Use CFBridgingRetain/CFBridgingRelease instead of __bridge_retained/__bridge_...
Argyrios Kyrtzidis [Fri, 1 Jun 2012 00:10:47 +0000 (00:10 +0000)]
[arcmt] Use CFBridgingRetain/CFBridgingRelease instead of __bridge_retained/__bridge_transfer
when migrating.

rdar://11569198

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

12 years agoAnonymous union members within a struct are now properly handled as an unevaluated...
Aaron Ballman [Fri, 1 Jun 2012 00:02:08 +0000 (00:02 +0000)]
Anonymous union members within a struct are now properly handled as an unevaluated field in C++11 mode.  This fixes PR12866.

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

12 years agoIn TypoCorrectionConsumer, BestResults to CorrectionResults to lessen
Kaelyn Uhrain [Thu, 31 May 2012 23:32:58 +0000 (23:32 +0000)]
In TypoCorrectionConsumer, BestResults to CorrectionResults to lessen
the confusion among all of the uses of Best* in relation to the set of
possible typo correction results. Also add a method to return the set of
typo corrections that have the single best edit distance--it returns the
second half of the first pair in TypoEditDistanceMap (with
getBestEditDistance already returning the first half).

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

12 years agoobjc: properties of NSObject attribute must
Fariborz Jahanian [Thu, 31 May 2012 23:18:32 +0000 (23:18 +0000)]
objc: properties of NSObject attribute must
have correct pointer type or issue error,
instead of crashing in IRGen. // rdar:// 11569860

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

12 years ago[analyzer] Fix BugType memory leak in IdempotentOperationChecker.
Tom Care [Thu, 31 May 2012 21:24:58 +0000 (21:24 +0000)]
[analyzer] Fix BugType memory leak in IdempotentOperationChecker.

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

12 years agoUpdating the visualizers to include more datatypes. Patch thanks to Jay Blanchard.
Aaron Ballman [Thu, 31 May 2012 19:27:30 +0000 (19:27 +0000)]
Updating the visualizers to include more datatypes.  Patch thanks to Jay Blanchard.

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

12 years ago[analyzer] Cleanup for r157721.
Anna Zaks [Thu, 31 May 2012 18:07:55 +0000 (18:07 +0000)]
[analyzer] Cleanup for r157721.
We should lock the number of elements after the initial parsing is
complete. Recursive AST visitors in AnalyzesConsumer and CallGarph can
trigger lazy pch deserialization resulting in more calls to
HandleTopLevelDecl and appending to the LocalTUDecls list. We should
ignore those.

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

12 years agoFix an object lifetime issue in clang/Tooling.
Alexander Kornienko [Thu, 31 May 2012 17:58:43 +0000 (17:58 +0000)]
Fix an object lifetime issue in clang/Tooling.

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

12 years agoAllow some BugReports to opt-out of PathDiagnostic callstack pruning until we have...
Ted Kremenek [Thu, 31 May 2012 06:03:17 +0000 (06:03 +0000)]
Allow some BugReports to opt-out of PathDiagnostic callstack pruning until we have significantly
improved the pruning heuristics.  The current heuristics are pretty good, but they make diagnostics
for uninitialized variables warnings particularly useless in some cases.

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

12 years agoAdd builtin for pclmulqdq instruction.
Craig Topper [Thu, 31 May 2012 05:18:48 +0000 (05:18 +0000)]
Add builtin for pclmulqdq instruction.

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

12 years agoOnly visit default arguments for template declarations when visiting the template...
Richard Smith [Wed, 30 May 2012 23:55:51 +0000 (23:55 +0000)]
Only visit default arguments for template declarations when visiting the template declaration which introduced them. Patch by Yang Chen!

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

12 years agoChange wording of 'memcpy' type mismatch warning and remove fixit.
Anna Zaks [Wed, 30 May 2012 23:14:52 +0000 (23:14 +0000)]
Change wording of 'memcpy' type mismatch warning and remove fixit.

As per comments following r157659.

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

12 years ago[analyzer]Fix another occurrence of iterator invalidation (LocalTUDecls)
Anna Zaks [Wed, 30 May 2012 23:14:48 +0000 (23:14 +0000)]
[analyzer]Fix another occurrence of iterator invalidation (LocalTUDecls)

Follow up in r155693, r155680.

Prevents a hard to reproduce crash with the following stack trace:
3  libsystem_c.dylib 0x00007ff55a835050 _sigtramp + 18446744029881443184
4  clang             0x0000000106218e97 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
+ 519
5  clang             0x0000000105cf3002 clang::ParseAST(clang::Sema&,
bool, bool) + 690
6  clang             0x00000001059a41d8
clang::ASTFrontendAction::ExecuteAction() + 312
7  clang             0x00000001059a3df7 clang::FrontendAction::Execute()
+ 231
8  clang             0x00000001059b0ecc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 860
9  clang             0x000000010595e451
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961
10 clang             0x0000000105947f29 cc1_main(char const**, char
const**, char const*, void*) + 969
11 clang             0x0000000105958259 main + 473
12 clang             0x0000000105947b34 start + 52

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

12 years agoAdd a test for '%@' suggestion for classes.
Jordan Rose [Wed, 30 May 2012 22:41:32 +0000 (22:41 +0000)]
Add a test for '%@' suggestion for classes.

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

12 years agoSuggest '%@' for Objective-C objects in ObjC format strings.
Jordan Rose [Wed, 30 May 2012 21:53:13 +0000 (21:53 +0000)]
Suggest '%@' for Objective-C objects in ObjC format strings.

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

12 years agoDisable -Wunique-enum for anonymous enums.
David Blaikie [Wed, 30 May 2012 20:45:14 +0000 (20:45 +0000)]
Disable -Wunique-enum for anonymous enums.

This is a large class of false positives where anonymous enums are used to
declare constants (see Clang's Diagnostics.h for example). A small number of
true positives could probably be found in this bucket by still warning if the
anonymous enum is used in a declarator (enum { ... } x;) but so far we don't
believe this to be a source of significant benefit so I haven't bothered to
preserve those cases.

General offline review/acknowledgment by rtrieu.

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

12 years agoTableGen: Remove extraneous '\' at EOL in generated tests.
Jim Grosbach [Wed, 30 May 2012 18:18:29 +0000 (18:18 +0000)]
TableGen: Remove extraneous '\' at EOL in generated tests.

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

12 years agoobjective-c: revert r157407. It broke a project
Fariborz Jahanian [Wed, 30 May 2012 17:33:54 +0000 (17:33 +0000)]
objective-c: revert r157407. It broke a project
and reported as PR12959. // rdar://11499742

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

12 years agoAdds a toString method to Replacement, which helps debugging.
Manuel Klimek [Wed, 30 May 2012 16:04:29 +0000 (16:04 +0000)]
Adds a toString method to Replacement, which helps debugging.
Adds missing header guards to Refactoring.h.

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

12 years agoFixed a memory leak in clang/Tooling.
Alexander Kornienko [Wed, 30 May 2012 12:10:28 +0000 (12:10 +0000)]
Fixed a memory leak in clang/Tooling.

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

12 years agosupply a simple-minded testcase for r156813, to check whether the embedded montavista...
Gabor Greif [Wed, 30 May 2012 09:56:26 +0000 (09:56 +0000)]
supply a simple-minded testcase for r156813, to check whether the embedded montavista gcc toolchain is recognized

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

12 years agoClang docs update: list command-line flags that control the size of generated debug...
Alexey Samsonov [Wed, 30 May 2012 06:55:10 +0000 (06:55 +0000)]
Clang docs update: list command-line flags that control the size of generated debug information. Reviewed by chandlerc@ and echristo@.

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

12 years agoSSE4A should not imply LZCNT and POPCNT. FMA4 should imply SSE4A. Add missing break...
Craig Topper [Wed, 30 May 2012 05:54:54 +0000 (05:54 +0000)]
SSE4A should not imply LZCNT and POPCNT. FMA4 should imply SSE4A. Add missing break at the end of btver1 feature list.

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

12 years agoUpdate FIXME. ABM is already covered by LZCNT and POPCNT.
Craig Topper [Wed, 30 May 2012 04:49:49 +0000 (04:49 +0000)]
Update FIXME. ABM is already covered by LZCNT and POPCNT.

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

12 years agoMark extrqi and insertqi immediate arguments as being ICE.
Craig Topper [Wed, 30 May 2012 04:45:24 +0000 (04:45 +0000)]
Mark extrqi and insertqi immediate arguments as being ICE.

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

12 years agoTest commit - Fix typo in comment.
Daniel Jasper [Wed, 30 May 2012 04:30:08 +0000 (04:30 +0000)]
Test commit - Fix typo in comment.

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

12 years agoRemove some extra braces.
Eric Christopher [Wed, 30 May 2012 01:14:28 +0000 (01:14 +0000)]
Remove some extra braces.

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

12 years agoAdd new -Wunique-enum which will warn on enums which all elements have the
Richard Trieu [Wed, 30 May 2012 01:01:11 +0000 (01:01 +0000)]
Add new -Wunique-enum which will warn on enums which all elements have the
same value and were initialized with literals.  Clang will warn on code like
this:

enum A {
  FIRST = 1,
  SECOND = 1
};

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

12 years agoAdd fixits for memory access warnings.
Anna Zaks [Wed, 30 May 2012 00:34:21 +0000 (00:34 +0000)]
Add fixits for memory access warnings.
Also, do not display the builtin name and macro expansion when the
function is a builtin.

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

12 years agoobjc: position of 'fixit' was off by one.
Fariborz Jahanian [Tue, 29 May 2012 21:52:45 +0000 (21:52 +0000)]
objc: position of 'fixit' was off by one.
This patch fixes it. // rdar://11488351

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

12 years agofixes radar no. in this test.
Fariborz Jahanian [Tue, 29 May 2012 19:59:25 +0000 (19:59 +0000)]
fixes radar no. in this test.

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

12 years agoobjective-c: fix a sema and IRGen crash when property
Fariborz Jahanian [Tue, 29 May 2012 19:56:01 +0000 (19:56 +0000)]
objective-c: fix a sema and IRGen crash when property
getter result type is safe but does not match with property
type resulting in spurious warning followed by crash in
IRGen. // rdar://11515196

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

12 years agoInstall ammintrin.h in the cmake build.
Benjamin Kramer [Tue, 29 May 2012 19:36:17 +0000 (19:36 +0000)]
Install ammintrin.h in the cmake build.

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

12 years agoAdd an ammintrin.h header for SSE4a intrinsics.
Benjamin Kramer [Tue, 29 May 2012 19:10:17 +0000 (19:10 +0000)]
Add an ammintrin.h header for SSE4a intrinsics.

This is a clean-room implementation based on public documentation and
I tried to validate it as much as possible against gcc.

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

12 years agoMIPS: Pass -KPIC argument to MIPS assembler if necessary.
Simon Atanasyan [Tue, 29 May 2012 19:07:33 +0000 (19:07 +0000)]
MIPS: Pass -KPIC argument to MIPS assembler if necessary.

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

12 years agoFactor out the code retrieves the last PIC related argument from
Simon Atanasyan [Tue, 29 May 2012 18:50:33 +0000 (18:50 +0000)]
Factor out the code retrieves the last PIC related argument from
the Clang::ConstructJob() to the new ArgList::getLastArg() routine
with eight argument. That simplifies reusing of this code.

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

12 years agoDefine __SSE4A__ when targeting new AMD CPUs.
Benjamin Kramer [Tue, 29 May 2012 17:48:39 +0000 (17:48 +0000)]
Define __SSE4A__ when targeting new AMD CPUs.

This doesn't really fit the existing SSELevel so it gets an extra flag.

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

12 years agoFix indenting.
David Blaikie [Tue, 29 May 2012 17:05:42 +0000 (17:05 +0000)]
Fix indenting.

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

12 years agoRevert r155737, restoring the MaxDepth in the BalancedDelimiterTracker to 256.
Chad Rosier [Tue, 29 May 2012 16:57:50 +0000 (16:57 +0000)]
Revert r155737, restoring the MaxDepth in the BalancedDelimiterTracker to 256.
r155737 turned out to be a temporary work around.  The correct fix was in r155823.

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

12 years agoSparc is bigendian.
Roman Divacky [Tue, 29 May 2012 16:10:50 +0000 (16:10 +0000)]
Sparc is bigendian.

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

12 years agoMake Clang driver pass the last option from -g group to the compiler.
Alexey Samsonov [Tue, 29 May 2012 08:10:34 +0000 (08:10 +0000)]
Make Clang driver pass the last option from -g group to the compiler.
Leave a better fixme for different debug info flags

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

12 years agoUse fewer temporaries mangling APSInt objects. The performance difference
Charles Davis [Tue, 29 May 2012 07:01:45 +0000 (07:01 +0000)]
Use fewer temporaries mangling APSInt objects. The performance difference
is negligible, but it makes the code clearer. Based on a suggestion by
Jordy Rose.

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

12 years agoOpenCL: Fix vector conditional operator CodeGen for the case where
Peter Collingbourne [Tue, 29 May 2012 00:35:18 +0000 (00:35 +0000)]
OpenCL: Fix vector conditional operator CodeGen for the case where
the operands are vectors of doubles.

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

12 years agoFix suspicous isIntegerType() check, found by PVS Studio (PR12357).
Benjamin Kramer [Mon, 28 May 2012 21:01:59 +0000 (21:01 +0000)]
Fix suspicous isIntegerType() check, found by PVS Studio (PR12357).

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