]> granicus.if.org Git - clang/log
clang
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

12 years agoAddress minor FIXME in RedeclLink to contain a PointerIntPair instead of derive from it.
David Blaikie [Mon, 28 May 2012 19:38:42 +0000 (19:38 +0000)]
Address minor FIXME in RedeclLink to contain a PointerIntPair instead of derive from it.

Use actual factory functions rather than derived classes acting as named constructors/factories.

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

12 years agoFix mangling of integral template arguments between 1 and 10. Add a test case
Charles Davis [Mon, 28 May 2012 16:53:33 +0000 (16:53 +0000)]
Fix mangling of integral template arguments between 1 and 10. Add a test case
for this. Reported by Timur Iskhodzhanov.

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

12 years agoFix Lang's fix. This should fix the tests for +Asserts builds.
Charles Davis [Mon, 28 May 2012 03:54:22 +0000 (03:54 +0000)]
Fix Lang's fix. This should fix the tests for +Asserts builds.

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

12 years agoadjust to mainline llvm API change.
Chris Lattner [Mon, 28 May 2012 01:47:53 +0000 (01:47 +0000)]
adjust to mainline llvm API change.

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

12 years agoFix PR12960 by not attempting to correct cases when we're not actually instantiatiati...
David Blaikie [Mon, 28 May 2012 01:26:45 +0000 (01:26 +0000)]
Fix PR12960 by not attempting to correct cases when we're not actually instantiatiating a template.

This comes up in the begin/end calls of a range-for (see the included test
case). Other suggestions are welcome, though this seems to do the trick without
regressing anything.

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

12 years agoTest case for 157547. Before that patch, all the digits would be mangled
Charles Davis [Mon, 28 May 2012 00:43:56 +0000 (00:43 +0000)]
Test case for 157547. Before that patch, all the digits would be mangled
as zeroes. Now the digits are properly non-zero.

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

12 years agoPR12962: Fix a rare use after free when collecting virtual overrides.
Benjamin Kramer [Sun, 27 May 2012 22:41:08 +0000 (22:41 +0000)]
PR12962: Fix a rare use after free when collecting virtual overrides.

The DenseMap reallocates after 64 insertions so this only happened in
large test cases under very specific circumstances.

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

12 years agoFix call to APSInt constructor - it doesn't take an initial value, just a
Lang Hames [Sun, 27 May 2012 21:39:49 +0000 (21:39 +0000)]
Fix call to APSInt constructor - it doesn't take an initial value, just a
bitwidth and signedness. Also rename the variable to reflect its purpose.

No test case - discovered during random code exploration.

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

12 years ago-Wdeprecated warning to include reference (as a note)
Fariborz Jahanian [Sun, 27 May 2012 16:59:48 +0000 (16:59 +0000)]
-Wdeprecated warning to include reference (as a note)
to the declaration in this patch. // rdar://10893232

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

12 years agoPass ProgramStateRef by reference.
Benjamin Kramer [Sun, 27 May 2012 15:32:10 +0000 (15:32 +0000)]
Pass ProgramStateRef by reference.

Retain + Release on a ref counted pointer is cheap, but not free (it adds a function call in this case).

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

12 years agoClose HTML tag properly.
Dmitri Gribenko [Sun, 27 May 2012 14:08:44 +0000 (14:08 +0000)]
Close HTML tag properly.

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

12 years agoUse the SelectorSet typedef more widely throughout Sema.
Benjamin Kramer [Sun, 27 May 2012 13:28:52 +0000 (13:28 +0000)]
Use the SelectorSet typedef more widely throughout Sema.

While there make it a SmallPtrSet.

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

12 years agoReplace some custom hash combines with the standard stuff from DenseMapInfo.
Benjamin Kramer [Sun, 27 May 2012 13:28:44 +0000 (13:28 +0000)]
Replace some custom hash combines with the standard stuff from DenseMapInfo.

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

12 years agoclang/unittests/Tooling/RewriterTestContext.h: Don't try to remove TemporaryDirectory.
NAKAMURA Takumi [Sun, 27 May 2012 13:10:14 +0000 (13:10 +0000)]
clang/unittests/Tooling/RewriterTestContext.h: Don't try to remove TemporaryDirectory.

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

12 years agoclang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32...
NAKAMURA Takumi [Sun, 27 May 2012 12:59:58 +0000 (12:59 +0000)]
clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32 doesn't allow rename/removing opened files.

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

12 years agoMangle template instantiations properly (as of VC 7.x) when compiling for
Charles Davis [Sat, 26 May 2012 23:12:19 +0000 (23:12 +0000)]
Mangle template instantiations properly (as of VC 7.x) when compiling for
the Microsoft Visual C++ ABI. Currently limited to type and integral
non-type arguments. Based on a patch by Timur Iskhodzhanov!

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

12 years agoOnly emit one set of braces for __VERSION__, getClangFullRepositoryVersion already...
Benjamin Kramer [Sat, 26 May 2012 19:39:52 +0000 (19:39 +0000)]
Only emit one set of braces for __VERSION__, getClangFullRepositoryVersion already adds some.

No test as the output is highly dependend on the local configuration.

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

12 years agoChange warning to error when property setter names conflict.
Fariborz Jahanian [Sat, 26 May 2012 16:10:06 +0000 (16:10 +0000)]
Change warning to error when property setter names conflict.
// rdar://11528439

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

12 years agoIn response to some discussions on IRC, tweak the wording of the new
Richard Smith [Sat, 26 May 2012 06:20:46 +0000 (06:20 +0000)]
In response to some discussions on IRC, tweak the wording of the new
-Wsometimes-uninitialized diagnostics to make it clearer that the cause
of the issue may be a condition which must always evaluate to true or
false, rather than an uninitialized variable.

To emphasize this, add a new note with a fixit which removes the
impossible condition or replaces it with a constant.

Also, downgrade the diagnostic from -Wsometimes-uninitialized to
-Wconditional-uninitialized when it applies to a range-based for loop,
since the condition is not written explicitly in the code in that case.

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

12 years agoFix indentation.
David Blaikie [Sat, 26 May 2012 05:35:39 +0000 (05:35 +0000)]
Fix indentation.

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

12 years agoDon't offer '[[clang::fallthrough]];' fix-it when a fall-through occurs to a
Alexander Kornienko [Sat, 26 May 2012 00:49:15 +0000 (00:49 +0000)]
Don't offer '[[clang::fallthrough]];' fix-it when a fall-through occurs to a
switch label immediately followed by a 'break;'.

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

12 years agofix codegen support for alloc_size attribute for static C++ methods
Nuno Lopes [Fri, 25 May 2012 21:45:08 +0000 (21:45 +0000)]
fix codegen support for alloc_size attribute for static C++ methods
add test case for C++ codegen

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

12 years ago[libclang] Add a test I forgot to commit for r156890.
Argyrios Kyrtzidis [Fri, 25 May 2012 20:05:57 +0000 (20:05 +0000)]
[libclang] Add a test I forgot to commit for r156890.

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