]> granicus.if.org Git - clang/log
clang
12 years agoFix typo "CursorKind.CONDITONAL_OPERATOR" in Python bindings, from
Douglas Gregor [Fri, 8 Jun 2012 00:16:27 +0000 (00:16 +0000)]
Fix typo "CursorKind.CONDITONAL_OPERATOR" in Python bindings, from
Manish Verma!

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

12 years agoRename a test case to a more generic name. This is a completely useless
Chandler Carruth [Fri, 8 Jun 2012 00:06:56 +0000 (00:06 +0000)]
Rename a test case to a more generic name. This is a completely useless
test, but David Sehr is looking at spiffing it up and adding some proper
tests for our alloca codegen.

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

12 years ago[analyzer] Add experimental "issue hash" to the plist diagnostic.
Anna Zaks [Fri, 8 Jun 2012 00:04:43 +0000 (00:04 +0000)]
[analyzer] Add experimental "issue hash" to the plist diagnostic.

CmpRuns.py can be used to compare issues from different analyzer runs.
Since it uses the issue line number to unique 2 issues, adding a new
line to the beginning of a file makes all issues in the file reported as
new.

The hash will be an opaque value which could be used (along with the
function name) by CmpRuns to identify the same issues. This way, we only
fail to identify the same issue from two runs if the function it appears
in changes (not perfect, but much better than nothing).

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

12 years ago[analyze] Change some of the malloc tests to use clang_analyzer_eval.
Anna Zaks [Fri, 8 Jun 2012 00:04:40 +0000 (00:04 +0000)]
[analyze] Change some of the malloc tests to use clang_analyzer_eval.

Thanks, Jordan.

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

12 years agoTeach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
Kaelyn Uhrain [Thu, 7 Jun 2012 23:57:12 +0000 (23:57 +0000)]
Teach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.

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

12 years agoIgnore corrections to functions with bodies when deciding which
Kaelyn Uhrain [Thu, 7 Jun 2012 23:57:08 +0000 (23:57 +0000)]
Ignore corrections to functions with bodies when deciding which
correction to use for an invalid function redeclaration.

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

12 years agoMinor comments and changes to clang-completion-mode.el, from David Wood!
Douglas Gregor [Thu, 7 Jun 2012 22:33:29 +0000 (22:33 +0000)]
Minor comments and changes to clang-completion-mode.el, from David Wood!

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

12 years ago[analyzer] Fixit for r158136.
Anna Zaks [Thu, 7 Jun 2012 20:18:08 +0000 (20:18 +0000)]
[analyzer] Fixit for r158136.

I falsely assumed that the memory spaces are equal when we reach this
point, they might not be when memory space of one or more is stack or
Unknown. We don't want a region from Heap space alias something with
another memory space.

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

12 years agoUser better API for vla in compund literals.
Fariborz Jahanian [Thu, 7 Jun 2012 18:15:55 +0000 (18:15 +0000)]
User better API for vla in compund literals.
// rdar://11485774

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

12 years agoAdd ext_vector type code for builtins, from John Garvin!
Douglas Gregor [Thu, 7 Jun 2012 18:08:25 +0000 (18:08 +0000)]
Add ext_vector type code for builtins, from John Garvin!

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

12 years agoFix many doxygen formatting errors.
Chandler Carruth [Thu, 7 Jun 2012 17:55:42 +0000 (17:55 +0000)]
Fix many doxygen formatting errors.

This patch affects docs only, and includes formatting changes only
(though those include some fixes for broken Doxygen markup that caused
some content to be missing from generated pages).  It avoids generating
many spurious pages such as
http://clang.llvm.org/doxygen/classRepresents.html, but likely not all
yet.

Patch by James Dennett.

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

12 years agoWhen emitting compund literal of vla pointer elements, make
Fariborz Jahanian [Thu, 7 Jun 2012 17:07:15 +0000 (17:07 +0000)]
When emitting compund literal of vla pointer elements, make
sure to emit vla size to prevent an irgen crash.
// rdar://11485774

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

12 years agoReuse APInt's getNumWords, which gets rounding right (my ad-hoc solution missed it).
Benjamin Kramer [Thu, 7 Jun 2012 15:54:03 +0000 (15:54 +0000)]
Reuse APInt's getNumWords, which gets rounding right (my ad-hoc solution missed it).

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

12 years agoPlug a long standing memory leak in TemplateArgument.
Benjamin Kramer [Thu, 7 Jun 2012 15:09:51 +0000 (15:09 +0000)]
Plug a long standing memory leak in TemplateArgument.

The integral APSInt value is now stored in a decomposed form and the backing
store for large values is allocated via the ASTContext. This way its not
leaked as TemplateArguments are never destructed when they are allocated in
the ASTContext. Since the integral data is immutable it is now shared between
instances, making copying TemplateArguments a trivial operation.

Currently getting the integral data out of a TemplateArgument requires creating
a new APSInt object. This is cheap when the value is small but can be expensive
if it's not. If this turns out to be an issue a more efficient accessor could
be added.

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

12 years agotest/Frontend/rewrite-includes.c: Tweak for win32's pathsep.
NAKAMURA Takumi [Thu, 7 Jun 2012 14:21:02 +0000 (14:21 +0000)]
test/Frontend/rewrite-includes.c: Tweak for win32's pathsep.

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

12 years agoMove sideeffecting call out of assert().
Benjamin Kramer [Thu, 7 Jun 2012 09:57:21 +0000 (09:57 +0000)]
Move sideeffecting call out of assert().

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

12 years ago[analyzer] Anti-aliasing: different heap allocations do not alias
Anna Zaks [Thu, 7 Jun 2012 03:57:32 +0000 (03:57 +0000)]
[analyzer] Anti-aliasing: different heap allocations do not alias

Add a concept of symbolic memory region belonging to heap memory space.
When comparing symbolic regions allocated on the heap, assume that they
do not alias.

Use symbolic heap region to suppress a common false positive pattern in
the malloc checker, in code that relies on malloc not returning the
memory aliased to other malloc allocations, stack.

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

12 years agoAttach fixits for CFBridgingRetain/Release outside any casts.
Jordan Rose [Thu, 7 Jun 2012 01:10:35 +0000 (01:10 +0000)]
Attach fixits for CFBridgingRetain/Release outside any casts.

Before, the note showed the location where you could insert __bridge variants,
but the actual fixit edit came after the cast.

No functionality change.

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

12 years agoInsert a space if necessary when suggesting CFBridgingRetain/Release.
Jordan Rose [Thu, 7 Jun 2012 01:10:31 +0000 (01:10 +0000)]
Insert a space if necessary when suggesting CFBridgingRetain/Release.

This was a problem for people who write 'return(result);'

Also fix ARCMT's corresponding code, though there's no test case for this
because implicit casts like this are rejected by the migrator for being
ambiguous, and explicit casts have no problem.

<rdar://problem/11577346>

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

12 years ago[arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a +0 method,
Argyrios Kyrtzidis [Thu, 7 Jun 2012 00:44:06 +0000 (00:44 +0000)]
[arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a +0 method,
automatically insert a __bridge cast.

radar://11560638

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

12 years agoreverse r158117.
Fariborz Jahanian [Wed, 6 Jun 2012 23:21:58 +0000 (23:21 +0000)]
reverse r158117.

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

12 years agoWhen doing arithmatic on vla pointer, make sure
Fariborz Jahanian [Wed, 6 Jun 2012 22:58:50 +0000 (22:58 +0000)]
When doing arithmatic on vla pointer, make sure
to emit vla size to prevent an irgen crash.
// rdar://11485774

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

12 years agoFix test/SemaObjC/cocoa-api-usage.m that broke via r158114.
Argyrios Kyrtzidis [Wed, 6 Jun 2012 22:32:07 +0000 (22:32 +0000)]
Fix test/SemaObjC/cocoa-api-usage.m that broke via r158114.

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

12 years ago[objcmt] When in ARC mode, also convert "[[.. alloc] init]" messages to literals,
Argyrios Kyrtzidis [Wed, 6 Jun 2012 22:23:12 +0000 (22:23 +0000)]
[objcmt] When in ARC mode, also convert "[[.. alloc] init]" messages to literals,
since the change from +1 to +0 will be handled fine by ARC.

rdar://11606358

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

12 years agoPuts the linktime dependencies into stupid-ld-required order, as proposed by Jordan...
Manuel Klimek [Wed, 6 Jun 2012 21:30:34 +0000 (21:30 +0000)]
Puts the linktime dependencies into stupid-ld-required order, as proposed by Jordan Rose.

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

12 years agoSwitches the RewriterTestContext away from PathV1.
Manuel Klimek [Wed, 6 Jun 2012 21:28:13 +0000 (21:28 +0000)]
Switches the RewriterTestContext away from PathV1.
Now the ToolingTests all work on Windows, and they also clean up their temporary directory if they don't crash.

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

12 years agoWhenever we have a BalancedDelimiterTracker, we have a 'nested' scope
Douglas Gregor [Wed, 6 Jun 2012 21:18:07 +0000 (21:18 +0000)]
Whenever we have a BalancedDelimiterTracker, we have a 'nested' scope
where '>' is going to behave as an operator (and not as a '>' closing
a template argument list).

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

12 years agoAllow CorrectTypo to add/modify nested name qualifiers to typos that
Kaelyn Uhrain [Wed, 6 Jun 2012 20:54:51 +0000 (20:54 +0000)]
Allow CorrectTypo to add/modify nested name qualifiers to typos that
are otherwise too short to try to correct.

The TODOs added to two of the tests are for existing deficiencies in the
typo correction code that could be exposed by using longer identifiers.

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

12 years ago[analyzer] Provide debug descriptions for all memory space regions.
Jordan Rose [Wed, 6 Jun 2012 20:47:00 +0000 (20:47 +0000)]
[analyzer] Provide debug descriptions for all memory space regions.

Patch by Guillem Marpons!

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

12 years agoFix Makefile: Options.td depends on CC1Options.td.
Jordan Rose [Wed, 6 Jun 2012 20:46:55 +0000 (20:46 +0000)]
Fix Makefile: Options.td depends on CC1Options.td.

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

12 years agoRevert Decl's iterators back to pointer value_type rather than reference value_type
David Blaikie [Wed, 6 Jun 2012 20:45:41 +0000 (20:45 +0000)]
Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

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

12 years agoRemove the last dead private member in clang.
Benjamin Kramer [Wed, 6 Jun 2012 20:15:08 +0000 (20:15 +0000)]
Remove the last dead private member in clang.

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

12 years agoAdd a -rewrite-includes option, which is similar to -rewrite-macros, but only expands...
David Blaikie [Wed, 6 Jun 2012 18:52:13 +0000 (18:52 +0000)]
Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.

Patch contributed by Lubos Lunak (l.lunax@suse.cz).
Review by Matt Beaumont-Gay (matthewbg@google.com).

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

12 years agoEscape \n and \r in doxycomment.
David Blaikie [Wed, 6 Jun 2012 18:43:20 +0000 (18:43 +0000)]
Escape \n and \r in doxycomment.

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

12 years agoDocuments linking requirements for libtooling.
Manuel Klimek [Wed, 6 Jun 2012 17:51:31 +0000 (17:51 +0000)]
Documents linking requirements for libtooling.

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

12 years agoRemove unused private member variables found by clang's new -Wunused-private-field.
Benjamin Kramer [Wed, 6 Jun 2012 17:32:50 +0000 (17:32 +0000)]
Remove unused private member variables found by clang's new -Wunused-private-field.

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

12 years agoAdd pedantic warning -Wempty-translation-unit (C11 6.9p1).
Jordan Rose [Wed, 6 Jun 2012 17:25:21 +0000 (17:25 +0000)]
Add pedantic warning -Wempty-translation-unit (C11 6.9p1).

In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl or a function
definition. In Clang the latter gives us a declaration as well.

The tricky bit about this warning is that our predefines can contain external
declarations (__builtin_va_list and the 128-bit integer types). Therefore our
AST parser now makes sure we have at least one declaration that doesn't come
from the predefines buffer.

Also, remove bogus warning about empty source files. This doesn't catch source
files that only contain comments, and never fired anyway because of our
predefines.

PR12665 and <rdar://problem/9165548>

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

12 years agoZap the /Za compiler switch from MSVC projects, the option is considered harmful...
Francois Pichet [Wed, 6 Jun 2012 12:00:10 +0000 (12:00 +0000)]
Zap the /Za compiler switch from MSVC projects, the option is considered harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed.

Only 1 minor code change was necessary: can't use cdecl as variable name anymore.

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

12 years agoIntroduce -Wunused-private-field. If enabled, this warning detects
Daniel Jasper [Wed, 6 Jun 2012 08:32:04 +0000 (08:32 +0000)]
Introduce -Wunused-private-field. If enabled, this warning detects
unused private fields of classes that are fully defined in the current
translation unit.

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

12 years agoDisable path pruning for UndefResultChecker. It turns out we usually want to see...
Ted Kremenek [Wed, 6 Jun 2012 06:25:37 +0000 (06:25 +0000)]
Disable path pruning for UndefResultChecker.  It turns out we usually want to see more of the path
to discover how a value was used uninitialized.

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

12 years agoA non-explicit constructor template with a second parameter that is a
Douglas Gregor [Tue, 5 Jun 2012 23:44:51 +0000 (23:44 +0000)]
A non-explicit constructor template with a second parameter that is a
parameter pack is a converting constructor. Fixes PR13003.

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

12 years agoPlistDiagnostics: force the ranges for control-flow edges to be single locations...
Ted Kremenek [Tue, 5 Jun 2012 22:00:52 +0000 (22:00 +0000)]
PlistDiagnostics: force the ranges for control-flow edges to be single locations, forcing
adjacent edges to have compatible ranges.  This simplifies the layout logic for some clients.

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

12 years agoobjective-c: merge deprecated/unavailable attributes to
Fariborz Jahanian [Tue, 5 Jun 2012 21:14:46 +0000 (21:14 +0000)]
objective-c: merge deprecated/unavailable attributes to
the overriding deprecated/unavailable method.
// rdar://11475360

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

12 years agoFixes the refactoring library test in VS2010.
Manuel Klimek [Tue, 5 Jun 2012 20:16:30 +0000 (20:16 +0000)]
Fixes the refactoring library test in VS2010.

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

12 years agoFix a bug with va_arg and vectors on Darwin x86-32. <rdar://problem/11592208>.
Eli Friedman [Tue, 5 Jun 2012 19:40:46 +0000 (19:40 +0000)]
Fix a bug with va_arg and vectors on Darwin x86-32.  <rdar://problem/11592208>.

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

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