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

12 years agoDon't ignore linkage when ignoring visibility in the instantiation of a
Rafael Espindola [Fri, 25 May 2012 17:22:33 +0000 (17:22 +0000)]
Don't ignore linkage when ignoring visibility in the instantiation of a
method template.

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

12 years agoadd CodeGen support for the alloc_size attribute
Nuno Lopes [Fri, 25 May 2012 17:04:42 +0000 (17:04 +0000)]
add CodeGen support for the alloc_size attribute

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

12 years agoDon't ignore linkage when ignoring visibility in the instantiation of a
Rafael Espindola [Fri, 25 May 2012 16:41:35 +0000 (16:41 +0000)]
Don't ignore linkage when ignoring visibility in the instantiation of a
function template.

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

12 years ago[analyzer] Don't crash on LValBitCast
Anna Zaks [Fri, 25 May 2012 16:02:16 +0000 (16:02 +0000)]
[analyzer] Don't crash on LValBitCast

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

12 years agoConsider the linkage for member class templates even when we have to ignore
Rafael Espindola [Fri, 25 May 2012 15:51:26 +0000 (15:51 +0000)]
Consider the linkage for member class templates even when we have to ignore
the visibility.

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

12 years agoWhen ignoring visibility in an instantiation, still consider the linkage.
Rafael Espindola [Fri, 25 May 2012 14:47:05 +0000 (14:47 +0000)]
When ignoring visibility in an instantiation, still consider the linkage.
Similar fixes for function and member template to follow as I write the
testcases.

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

12 years agoWhitespace fixes.
Rafael Espindola [Fri, 25 May 2012 14:17:45 +0000 (14:17 +0000)]
Whitespace fixes.

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

12 years agoLinks the entry point to the tooling documentation into clang's menu bar.
Manuel Klimek [Fri, 25 May 2012 08:39:21 +0000 (08:39 +0000)]
Links the entry point to the tooling documentation into clang's menu bar.

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

12 years agoRelease notes update for -Wsometimes-uninitialized.
Richard Smith [Fri, 25 May 2012 02:35:34 +0000 (02:35 +0000)]
Release notes update for -Wsometimes-uninitialized.

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

12 years agoSplit a chunk of -Wconditional-uninitialized warnings out into a separate flag,
Richard Smith [Fri, 25 May 2012 02:17:09 +0000 (02:17 +0000)]
Split a chunk of -Wconditional-uninitialized warnings out into a separate flag,
-Wsometimes-uninitialized. This detects cases where an explicitly-written branch
inevitably leads to an uninitialized variable use (so either the branch is dead
code or there is an uninitialized use bug).

This chunk of warnings tentatively lives within -Wuninitialized, in order to
give it more visibility to existing Clang users.

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

12 years ago[analyzer] Loading external plugins with scan-build
Anna Zaks [Fri, 25 May 2012 01:13:50 +0000 (01:13 +0000)]
[analyzer] Loading external plugins with scan-build

Load custom plugins when running scan-build. This is useful when
additional static analysis Checkers must be provided via clang's plugin
interface.

Loading additional plugins can now be done via the scan-build call:
scan-build -load-plugin <plugin.so>

A patch by Thomas Hauth.

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

12 years agoensure value passed to is space is representable as unsigned char
Seth Cantrell [Fri, 25 May 2012 00:03:29 +0000 (00:03 +0000)]
ensure value passed to is space is representable as unsigned char

if the value isn't an unsigned char or EOF behavior is undefined
(and on Windows there's an assertion)

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

12 years agoSome cleanups around the uninitialized variables warning, and a FIXME. No functional...
Richard Smith [Thu, 24 May 2012 23:45:35 +0000 (23:45 +0000)]
Some cleanups around the uninitialized variables warning, and a FIXME. No functional change.

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

12 years agocleanup some code.
Fariborz Jahanian [Thu, 24 May 2012 22:59:56 +0000 (22:59 +0000)]
cleanup some code.

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

12 years agoobjective-c: warn on use of property setters
Fariborz Jahanian [Thu, 24 May 2012 22:48:38 +0000 (22:48 +0000)]
objective-c: warn on use of property setters
backing two propeties because proprty names
match except for first letter being of different
case. // rdar://11528439, [PR12936].

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

12 years agoGet rid of some non-ASCII en-dashes that crept in.
Eli Friedman [Thu, 24 May 2012 22:36:31 +0000 (22:36 +0000)]
Get rid of some non-ASCII en-dashes that crept in.

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

12 years agoImplement the C++11 discarded value expression rules for volatile lvalues. <rdar...
Eli Friedman [Thu, 24 May 2012 22:04:19 +0000 (22:04 +0000)]
Implement the C++11 discarded value expression rules for volatile lvalues.  <rdar://problem/10790820>.

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

12 years agoUn-XFAIL CodeGen/builtins-nvptx.c now that the proper changes have
Justin Holewinski [Thu, 24 May 2012 21:39:33 +0000 (21:39 +0000)]
Un-XFAIL CodeGen/builtins-nvptx.c now that the proper changes have
landed in LLVM core

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

12 years agoA minor tweak to the new volatile lvalue warning: don't warn on "(void)x", where...
Eli Friedman [Thu, 24 May 2012 21:05:41 +0000 (21:05 +0000)]
A minor tweak to the new volatile lvalue warning: don't warn on "(void)x", where "x" refers to a local variable.  This should silence a useless warning in compiler-rt and other places.

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

12 years agoXFAIL this test, which does not pass on trunk since the grand
John McCall [Thu, 24 May 2012 20:58:21 +0000 (20:58 +0000)]
XFAIL this test, which does not pass on trunk since the grand
renaming in r157403.

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

12 years agoSet svn:keywords property to Id
Ted Kremenek [Thu, 24 May 2012 20:16:00 +0000 (20:16 +0000)]
Set svn:keywords property to Id

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

12 years agoNew & improved man page attached, now with standard license added.
Ted Kremenek [Thu, 24 May 2012 20:13:47 +0000 (20:13 +0000)]
New & improved man page attached, now with standard license added.
Plus, a patch for scan-build.

* mdoc corrections
* slightly more compact output
* same license as scan-build
* DESCRIPTION describes
* Default checkers corrected & explained
* Authors credited

The patch adds support for --help-checkers.  It just lists the default
checkers by recursively invoking "scan-build -h" and looking for the
magic '+' signs.

Patch by James Lowden!

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

12 years agoobjective-c: Fixes a corner case and interesting bug.
Fariborz Jahanian [Thu, 24 May 2012 18:29:41 +0000 (18:29 +0000)]
objective-c: Fixes a corner case and interesting bug.
Where diagnostic about unfound property is not
issued in the context where a setter is looked up
in situation in which name and property name differ
in their first letter case. // rdar://11363363

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

12 years ago[objcmt] Add test case for r157395.
Argyrios Kyrtzidis [Thu, 24 May 2012 17:49:22 +0000 (17:49 +0000)]
[objcmt] Add test case for r157395.

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

12 years agoReplace PTX back-end with NVPTX back-end in all places where Clang cares
Justin Holewinski [Thu, 24 May 2012 17:43:12 +0000 (17:43 +0000)]
Replace PTX back-end with NVPTX back-end in all places where Clang cares

NV_CONTRIB

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

12 years ago[analyzer] Minor cleanup to checkers' help text.
Anna Zaks [Thu, 24 May 2012 17:31:59 +0000 (17:31 +0000)]
[analyzer] Minor cleanup to checkers' help text.

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

12 years ago[analyzer] Treat cast of array to reference in the same way as array to
Anna Zaks [Thu, 24 May 2012 17:31:57 +0000 (17:31 +0000)]
[analyzer] Treat cast of array to reference in the same way as array to
pointer.

Fixes one of the crashes reported in PR12874.

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

12 years ago[analyzer] Fix typo. Thanks Jordy.
Anna Zaks [Thu, 24 May 2012 17:31:54 +0000 (17:31 +0000)]
[analyzer] Fix typo. Thanks Jordy.

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

12 years agoAdds menu sidebar to the docs.
Manuel Klimek [Thu, 24 May 2012 17:16:23 +0000 (17:16 +0000)]
Adds menu sidebar to the docs.

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

12 years agoUpdates the tooling docs with the links to the tutorials and
Manuel Klimek [Thu, 24 May 2012 17:09:10 +0000 (17:09 +0000)]
Updates the tooling docs with the links to the tutorials and
adds the menu include.

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

12 years agoAdds a tutorial for how to write clang plugins.
Manuel Klimek [Thu, 24 May 2012 17:07:18 +0000 (17:07 +0000)]
Adds a tutorial for how to write clang plugins.

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

12 years ago[objcmt] Warn when modern objc migrator does not convert a NSNumber message because...
Argyrios Kyrtzidis [Thu, 24 May 2012 16:48:23 +0000 (16:48 +0000)]
[objcmt] Warn when modern objc migrator does not convert a NSNumber message because it requires a cast.

rdar://11525138

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

12 years agoobjc: change option to be -Wobjc-interface-ivars
Fariborz Jahanian [Thu, 24 May 2012 16:19:51 +0000 (16:19 +0000)]
objc: change option to be -Wobjc-interface-ivars

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

12 years agoApply review comment from Jordan Rose.
Manuel Klimek [Thu, 24 May 2012 12:46:43 +0000 (12:46 +0000)]
Apply review comment from Jordan Rose.

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

12 years agoRemove 3.1 release notes to get ready for current development cycle.
Bill Wendling [Thu, 24 May 2012 06:42:56 +0000 (06:42 +0000)]
Remove 3.1 release notes to get ready for current development cycle.

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

12 years agofix Bug 12924
Seth Cantrell [Thu, 24 May 2012 05:14:44 +0000 (05:14 +0000)]
fix Bug 12924

http://llvm.org/bugs/show_bug.cgi?id=12924

This issue was that the source location was pointing to a
non-printable character and so CaretEnd was pointing one
_column_ past the caret but not one _character_ past the
caret. So the conversion between column and byte locations
wasn't working (because the conversion is only valid from
the first column or byte of a character).

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

12 years agoDR1152 / PR12931 / PR6177: A candidate function which requires binding a const
Richard Smith [Thu, 24 May 2012 04:29:20 +0000 (04:29 +0000)]
DR1152 / PR12931 / PR6177: A candidate function which requires binding a const
volatile reference to a temporary is not viable. My interpretation is that
DR1152 was a bugfix, not a rule change for C++11, so this is not conditional on
the language mode. This matches g++'s behavior.

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

12 years agoAdd a warning to diagnose statements in C++ like "*(volatile int*)x;". Conceptually...
Eli Friedman [Thu, 24 May 2012 00:47:05 +0000 (00:47 +0000)]
Add a warning to diagnose statements in C++ like "*(volatile int*)x;".  Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value.  I also made a few minor improvements to existing unused value warnings in the process.  <rdar://problem/11516811>.

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

12 years agoimplement Sema support for the alloc_size attribute
Nuno Lopes [Thu, 24 May 2012 00:22:00 +0000 (00:22 +0000)]
implement Sema support for the alloc_size attribute
Portions of this patch by Xi Wang. Reviewed by Jordy Rose. Thank you both.

Codegen support will follow soon.

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

12 years agomodern objc translation: Add translation of @autoreleasepool
Fariborz Jahanian [Wed, 23 May 2012 23:47:20 +0000 (23:47 +0000)]
modern objc translation: Add translation of @autoreleasepool
statement. // rdar://11474836.

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

12 years ago[libclang] Report CXType_ObjCId for 'const id', not CXType_Typedef.
Argyrios Kyrtzidis [Wed, 23 May 2012 23:30:16 +0000 (23:30 +0000)]
[libclang] Report CXType_ObjCId for 'const id', not CXType_Typedef.

rdar://11357807

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

12 years agoclang/test/Tooling: Update comments in left 2 tests on XFAIL. They are incompatible...
NAKAMURA Takumi [Wed, 23 May 2012 22:24:33 +0000 (22:24 +0000)]
clang/test/Tooling: Update comments in left 2 tests on XFAIL. They are incompatible to -fms-compatibility.

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

12 years agoclang/test/Tooling: Tweak 4 tests to escape the path separator s/\\/\\\\/g in JSON.
NAKAMURA Takumi [Wed, 23 May 2012 22:24:27 +0000 (22:24 +0000)]
clang/test/Tooling: Tweak 4 tests to escape the path separator s/\\/\\\\/g in JSON.

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

12 years agoTooling: Canonicalize Key in IndexByFile[]. llvm::sys::path::native() may be used...
NAKAMURA Takumi [Wed, 23 May 2012 22:24:20 +0000 (22:24 +0000)]
Tooling: Canonicalize Key in IndexByFile[]. llvm::sys::path::native() may be used here.

It fixes test/Tooling on Win32 hosts.

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

12 years ago[arcmt] Remove an unused -autorelease, without failing with error, for this
Argyrios Kyrtzidis [Wed, 23 May 2012 21:50:04 +0000 (21:50 +0000)]
[arcmt] Remove an unused -autorelease, without failing with error, for this
idiom that is used commonly in setters:

   [backingValue autorelease];
   backingValue = [newValue retain]; // in general a +1 assign

rdar://9914061

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

12 years ago[driver] Have the crash diagnostics print the clang version information.
Chad Rosier [Wed, 23 May 2012 21:38:47 +0000 (21:38 +0000)]
[driver] Have the crash diagnostics print the clang version information.
rdar://11518308

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

12 years agoUpdate checker build.
Ted Kremenek [Wed, 23 May 2012 19:57:38 +0000 (19:57 +0000)]
Update checker build.

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

12 years agoAdds the Refactoring library, which is a layer on top of the Tooling library
Manuel Klimek [Wed, 23 May 2012 16:29:20 +0000 (16:29 +0000)]
Adds the Refactoring library, which is a layer on top of the Tooling library
that allows easy refactoring across translation units.

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

12 years agoCorrect the starting location for instantiations of field declarations which
Richard Smith [Wed, 23 May 2012 04:22:22 +0000 (04:22 +0000)]
Correct the starting location for instantiations of field declarations which
start with a cv-qualifier. DeclaratorDecl::getTypeSpecStartLoc() does not
produce the location of the first type-specifier (the cv-qualifier) in this
case, because we don't track source locations for cv-qualifiers.

No test here: I've not found a way to test this with a lit-style test, and
introducing a gtest test for this seems unwarranted. Suggestions welcome!

Patch by Daniel Jasper!

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

12 years agoIf the first argument of __builtin_object_size can be folded to a constant
Richard Smith [Wed, 23 May 2012 04:13:20 +0000 (04:13 +0000)]
If the first argument of __builtin_object_size can be folded to a constant
pointer, but such folding encounters side-effects, ignore the side-effects
rather than performing them at runtime: CodeGen generates wrong code for
__builtin_object_size in that case.

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

12 years agoClang 3.1 is out: turn the relevant C++11 status boxes green.
Richard Smith [Wed, 23 May 2012 01:38:11 +0000 (01:38 +0000)]
Clang 3.1 is out: turn the relevant C++11 status boxes green.

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

12 years agoMove file to be more representative.
Eric Christopher [Wed, 23 May 2012 00:18:46 +0000 (00:18 +0000)]
Move file to be more representative.

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