]> granicus.if.org Git - clang/log
clang
11 years ago[modules] Introduce ModuleFile::DirectImportLoc which is the source location
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:14 +0000 (16:36 +0000)]
[modules] Introduce ModuleFile::DirectImportLoc which is the source location
where the module was explicitly or implicitly imported in the local translation unit.

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

11 years agoFor ModuleLoader::makeModuleVisible() also pass the source location where the
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:12 +0000 (16:36 +0000)]
For ModuleLoader::makeModuleVisible() also pass the source location where the
module import occurred.

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

11 years agoIntroduce SourceManager::PredefinesFileID, to allow each checking of whether
Argyrios Kyrtzidis [Fri, 1 Feb 2013 16:36:07 +0000 (16:36 +0000)]
Introduce SourceManager::PredefinesFileID, to allow each checking of whether
a source location came from the predefines buffer.

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

11 years agoAdd check for @foo
Bill Schmidt [Fri, 1 Feb 2013 15:52:51 +0000 (15:52 +0000)]
Add check for @foo

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

11 years agoFix a string not seen without asserts
Bill Schmidt [Fri, 1 Feb 2013 15:41:02 +0000 (15:41 +0000)]
Fix a string not seen without asserts

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

11 years agoFixed segmentation fault when a CFGBlock has NULL successor.
Alexander Kornienko [Fri, 1 Feb 2013 15:39:20 +0000 (15:39 +0000)]
Fixed segmentation fault when a CFGBlock has NULL successor.

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

11 years agoFix PR14881 by implementing conversion rules between int and complex int.
Bill Schmidt [Fri, 1 Feb 2013 15:34:29 +0000 (15:34 +0000)]
Fix PR14881 by implementing conversion rules between int and complex int.

Prior to the patch, Clang does not properly promote types when a complex
integer operand is combined with an integer via a binary operator, or when
one is assigned to the other in either order.  This patch detects when
promotion is needed (and permissible) and generates the necessary code.

The test assmes no target has the same size operands for "char" and
"long long," and that no target performs arithmetic on char operands without
extending them to a larger format first.  If there are any targets for
which this is not the case, they should be XFAILed.

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

11 years agoRevise unit testing for -fno-altivec, -mno-altivec.
Bill Schmidt [Fri, 1 Feb 2013 14:45:29 +0000 (14:45 +0000)]
Revise unit testing for -fno-altivec, -mno-altivec.

As suggested, reverted the end-to-end test and added variations to an
existing Driver test.

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

11 years agolibclang: itroduce cxstring::createEmpty()
Dmitri Gribenko [Fri, 1 Feb 2013 14:21:22 +0000 (14:21 +0000)]
libclang: itroduce cxstring::createEmpty()

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

11 years agolibclang: introduce cxstring::createNull()
Dmitri Gribenko [Fri, 1 Feb 2013 14:13:32 +0000 (14:13 +0000)]
libclang: introduce cxstring::createNull()

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

11 years agoRe-design the convenience interfaces on MatchFinder.
Manuel Klimek [Fri, 1 Feb 2013 13:41:35 +0000 (13:41 +0000)]
Re-design the convenience interfaces on MatchFinder.

First, this implements a match() method on MatchFinder; this allows us
to get rid of the findAll implementation, as findAll is really a special
case of recursive matchers on match.

Instead of findAll, provide a convenience function match() that lets
users iterate easily over the results instead of needing to implement
callbacks.

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

11 years agoUse const visitors in ASTDumper.
Alexander Kornienko [Fri, 1 Feb 2013 12:35:51 +0000 (12:35 +0000)]
Use const visitors in ASTDumper.
http://llvm-reviews.chandlerc.com/D355
Patch by Philip Craig!

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

11 years agoHopefully fix windows build due to non-standard pair implementation.
Daniel Jasper [Fri, 1 Feb 2013 11:28:16 +0000 (11:28 +0000)]
Hopefully fix windows build due to non-standard pair implementation.

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

11 years agoRevamp of the basic layouting algorithm in clang-format.
Daniel Jasper [Fri, 1 Feb 2013 11:00:45 +0000 (11:00 +0000)]
Revamp of the basic layouting algorithm in clang-format.

In order to end up with good solutions, clang-format needs to try
"all" combinations of line breaks, evaluate them and select the
best one. Before, we have done this using a DFS with memoization
and cut-off conditions. However, this approach is very limited
as shown by the huge static initializer in the attachment of
llvm.org/PR14959.

Instead, this new implementation uses a variant of Dijkstra's
algorithm to do a prioritized BFS over the solution space.

Some numbers:
lib/Format/TokenAnnotator.cpp: 1.5s -> 0.15s
Attachment of PR14959: 10min+ (didn't finish) -> 10s

No functional changes intended.

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

11 years agoFix diagnostic for bad alignas use: it can't be applied to functions.
Richard Smith [Fri, 1 Feb 2013 08:25:07 +0000 (08:25 +0000)]
Fix diagnostic for bad alignas use: it can't be applied to functions.

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

11 years agoAdd a new -Wundefined-inline warning for inline functions which are used but not
Nick Lewycky [Fri, 1 Feb 2013 08:13:20 +0000 (08:13 +0000)]
Add a new -Wundefined-inline warning for inline functions which are used but not
defined. Fixes PR14993!

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

11 years agoImplement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Richard Smith [Fri, 1 Feb 2013 08:12:08 +0000 (08:12 +0000)]
Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Also support alignas(0), which C++11 and C11 require us to ignore.

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

11 years agoAdd PPC A2Q core and BG/Q preprocessor definitions
Hal Finkel [Fri, 1 Feb 2013 05:53:33 +0000 (05:53 +0000)]
Add PPC A2Q core and BG/Q preprocessor definitions

The a2q core is the variant of the a2 core used on the BG/Q supercomputers.

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

11 years agoDestroy arrays and ARC fields when throwing out of ctors.
John McCall [Fri, 1 Feb 2013 05:11:40 +0000 (05:11 +0000)]
Destroy arrays and ARC fields when throwing out of ctors.

Previously we were only handling non-array fields of class type.

Testcases derived from a patch by WenHan Gu.

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

11 years agoDon't do delayed exception-specification checking on an invalid
Douglas Gregor [Fri, 1 Feb 2013 04:49:10 +0000 (04:49 +0000)]
Don't do delayed exception-specification checking on an invalid
class. Fixes <rdar://problem/13017229>.

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

11 years agoEnable -fno-altivec, -mno-altivec for PowerPC.
Bill Schmidt [Fri, 1 Feb 2013 02:14:03 +0000 (02:14 +0000)]
Enable -fno-altivec, -mno-altivec for PowerPC.

Introduces these negation forms explicitly and uses them to control a new
"altivec" target feature for PowerPC.  This allows avoiding generating
Altivec instructions on processors that support Altivec.

The new test case verifies that the Altivec "lvx" instruction is not
used when -fno-altivec is present on the command line.

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

11 years ago[Sema][Attr]Fix alignment attribute printing.
Michael Han [Fri, 1 Feb 2013 01:19:17 +0000 (01:19 +0000)]
[Sema][Attr]Fix alignment attribute printing.

Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should
only model those appear in source code. Introduce attribute Accessor, and teach TableGen
to generate syntax kind accessors for Align attribute, and use those accessors to decide
if an alignment attribute is a declspec attribute.

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

11 years agoConsistently format sample diagnostics on this page.
Richard Smith [Fri, 1 Feb 2013 00:45:12 +0000 (00:45 +0000)]
Consistently format sample diagnostics on this page.

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

11 years agoclang/test/Index/headerfile-comment-to-html.m: Try to unbreak libxml2-less hosts...
NAKAMURA Takumi [Fri, 1 Feb 2013 00:17:45 +0000 (00:17 +0000)]
clang/test/Index/headerfile-comment-to-html.m: Try to unbreak libxml2-less hosts to eliminate "CommentXMLValid".

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

11 years agoComment parsing: add more comments to CommentCommands.td
Dmitri Gribenko [Thu, 31 Jan 2013 23:31:14 +0000 (23:31 +0000)]
Comment parsing: add more comments to CommentCommands.td

I hope the ASCII art delimiters are OK, since they group *groups* of commands --
that is really helpful.

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

11 years agoEscape backslash in the comment.
Dmitri Gribenko [Thu, 31 Jan 2013 23:20:06 +0000 (23:20 +0000)]
Escape backslash in the comment.

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

11 years agoUpdate the tests.
Bill Wendling [Thu, 31 Jan 2013 23:17:12 +0000 (23:17 +0000)]
Update the tests.

This update coincides with r174110. That change ordered the attributes
alphabetically.

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

11 years ago[Comment parsing] Add support for recognizing
Fariborz Jahanian [Thu, 31 Jan 2013 23:12:39 +0000 (23:12 +0000)]
[Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511

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

11 years ago[analyzer]RetainCount: Fix an autorelease related false positive.
Anna Zaks [Thu, 31 Jan 2013 22:36:17 +0000 (22:36 +0000)]
[analyzer]RetainCount: Fix an autorelease related false positive.

The Cnt variable is adjusted (incremented) for simplification of
checking logic. The increment should not be stored in the state.

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

11 years ago[analyzer] Don't track autorelease pools created by +new.
Jordan Rose [Thu, 31 Jan 2013 22:06:02 +0000 (22:06 +0000)]
[analyzer] Don't track autorelease pools created by +new.

This matches our behavior for autorelease pools created by +alloc. Some
people like to create autorelease pools in one method and release them
somewhere else.

If you want safe autorelease pool semantics, use the new ARC-compatible
syntax: @autoreleasepool { ... }

<rdar://problem/13121353>

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

11 years agoLexer: Don't warn about Unicode in preprocessor directives.
Jordan Rose [Thu, 31 Jan 2013 19:48:48 +0000 (19:48 +0000)]
Lexer: Don't warn about Unicode in preprocessor directives.

This allows people to use Unicode in their #pragma mark and in macros
that exist only to be string-ized.

<rdar://problem/13107323&13121362>

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

11 years agoPreprocessor: initialize member introduced in r173881.
Jordan Rose [Thu, 31 Jan 2013 19:26:01 +0000 (19:26 +0000)]
Preprocessor: initialize member introduced in r173881.

Compilation always sets this explicitly, but creating a preprocessor
manually should still put the 'IsPreprocessedOutput' flag in a valid state.

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

11 years agoReverted unintendedly-committed file.
Alexander Kornienko [Thu, 31 Jan 2013 19:05:31 +0000 (19:05 +0000)]
Reverted unintendedly-committed file.

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

11 years agoMicro-change: moved a brace for better readability
Alexander Kornienko [Thu, 31 Jan 2013 19:03:16 +0000 (19:03 +0000)]
Micro-change: moved a brace for better readability

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

11 years agoRevert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Thu, 31 Jan 2013 18:04:03 +0000 (18:04 +0000)]
Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."

It's causing hangs on our internal analyzer buildbot. Will restore after
investigating.

This reverts r173951 / baa7ca1142990e1ad6d4e9d2c73adb749ff50789.

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

11 years agoclang/test/Index/skip-parsed-bodies/compile_commands.json: Mark it as XFAIL:mingw32...
NAKAMURA Takumi [Thu, 31 Jan 2013 16:01:13 +0000 (16:01 +0000)]
clang/test/Index/skip-parsed-bodies/compile_commands.json: Mark it as XFAIL:mingw32, for now.

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

11 years agoNever break inside something that was a preprocessor directive.
Manuel Klimek [Thu, 31 Jan 2013 15:58:48 +0000 (15:58 +0000)]
Never break inside something that was a preprocessor directive.

Just put it in one unwrapped line and let the formatter handle it.

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

11 years agoSeveral improvements to the formatting of static initializers.
Daniel Jasper [Thu, 31 Jan 2013 14:59:26 +0000 (14:59 +0000)]
Several improvements to the formatting of static initializers.

1. Never avoid bin packing in static initializers as this can
   lead to terrible results.
2. If an element has to be broken over multiple lines, break after
   the following comma.

This should be a step forward, but there are still many cases
especially with nested static initializers that we handle badly.
More patches will follow.

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

11 years agoAttempt to fix Windows build breakage.
Evgeniy Stepanov [Thu, 31 Jan 2013 14:27:38 +0000 (14:27 +0000)]
Attempt to fix Windows build breakage.

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

11 years agoMove commonly useful code for AST testing into MatchVerfier.h.
Manuel Klimek [Thu, 31 Jan 2013 13:10:40 +0000 (13:10 +0000)]
Move commonly useful code for AST testing into MatchVerfier.h.

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

11 years agoAdd support for AArch64 target.
Tim Northover [Thu, 31 Jan 2013 12:13:10 +0000 (12:13 +0000)]
Add support for AArch64 target.

In cooperation with the LLVM patch, this should implement all scalar front-end
parts of the C and C++ ABIs for AArch64.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

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

11 years agoRevert r174043 and tweak the comment wording so I'm (hopefully) not confused by it...
Richard Smith [Thu, 31 Jan 2013 11:30:17 +0000 (11:30 +0000)]
Revert r174043 and tweak the comment wording so I'm (hopefully) not confused by it again!

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

11 years agoAdded outer template parameter lists to friend type AST nodes.
Enea Zaffanella [Thu, 31 Jan 2013 09:54:08 +0000 (09:54 +0000)]
Added outer template parameter lists to friend type AST nodes.

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

11 years ago[msan] Run more optimizations after MemorySanitizer pass.
Evgeniy Stepanov [Thu, 31 Jan 2013 09:53:29 +0000 (09:53 +0000)]
[msan] Run more optimizations after MemorySanitizer pass.

MSan instrumentation is driven by the original code. We take every
incoming instruction and emit another instruction (or ten) next to
it, operating on the shadow values (but sometimes on the real values,
too). Two programs in one, essentially. There can be any kinds of
redundancies in the second one, so we just run whatever is normally
run at -O2, and then exclude some passes that do not help much with
benchmarks.

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

11 years agoRemove incorrect warning signs from QualType::getUnqualifiedType(). These
Richard Smith [Thu, 31 Jan 2013 06:13:11 +0000 (06:13 +0000)]
Remove incorrect warning signs from QualType::getUnqualifiedType(). These
statements were only true for 65 CLs after they were introduced two years ago.

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

11 years agoWhen we're emitting a constructor or destructor call from a delegating
Douglas Gregor [Thu, 31 Jan 2013 05:50:40 +0000 (05:50 +0000)]
When we're emitting a constructor or destructor call from a delegating
constructor, retrieve our VTT parameter directly. Fixes PR14588 /
<rdar://problem/12867962>.

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

11 years agoImprove 'failed template argument deduction' diagnostic for the case where we
Richard Smith [Thu, 31 Jan 2013 05:19:49 +0000 (05:19 +0000)]
Improve 'failed template argument deduction' diagnostic for the case where we
have a direct mismatch between some component of the template and some
component of the argument. The diagnostic now says what the mismatch was, but
doesn't yet say which part of the template doesn't match.

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

11 years agoWhen code completing in a statement, parenthesized expression, or
Douglas Gregor [Thu, 31 Jan 2013 05:03:46 +0000 (05:03 +0000)]
When code completing in a statement, parenthesized expression, or
Objective-C message receiver, the user is as likely to want to write a
type name as any other declaration, so give types the same priority as
other declarations. Fixes <rdar://problem/12480600>.

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

11 years agoAllow the computation of the base priority for a declaration code completion result...
Douglas Gregor [Thu, 31 Jan 2013 04:52:16 +0000 (04:52 +0000)]
Allow the computation of the base priority for a declaration code completion result to consider the completion context

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

11 years agoReplace "failed template argument deduction" diagnostic with something useful
Richard Smith [Thu, 31 Jan 2013 04:03:12 +0000 (04:03 +0000)]
Replace "failed template argument deduction" diagnostic with something useful
in the one case where we've already factored out a reason code.

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

11 years agoRemove elements from Sema.UndefinedInternals as functions are defined. Also
Nick Lewycky [Thu, 31 Jan 2013 03:23:57 +0000 (03:23 +0000)]
Remove elements from Sema.UndefinedInternals as functions are defined. Also
filter the elements before emitting them into a PCH. No user-visible
functionality change, except that PCH files may be smaller?

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

11 years agoFix grammar in comment.
Nick Lewycky [Thu, 31 Jan 2013 03:15:20 +0000 (03:15 +0000)]
Fix grammar in comment.

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

11 years agoClarify the diagnostic for -Wnested-anon-types.
Richard Smith [Thu, 31 Jan 2013 03:11:12 +0000 (03:11 +0000)]
Clarify the diagnostic for -Wnested-anon-types.

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

11 years ago[analyzer] If a lazy binding is undefined, pretend that it's unknown instead.
Jordan Rose [Thu, 31 Jan 2013 02:57:06 +0000 (02:57 +0000)]
[analyzer] If a lazy binding is undefined, pretend that it's unknown instead.

This is a hack to work around the fact that we don't track extents for our
default bindings:

  CGPoint p;
  p.x = 0.0;
  p.y = 0.0;
  rectParam.origin = p;
  use(rectParam.size); // warning: uninitialized value in rectParam.size.width

In this case, the default binding for 'p' gets copied into 'rectParam',
because the 'origin' field is at offset 0 within CGRect. From then on,
rectParam's old default binding (in this case a symbol) is lost.

This patch silences the warning by pretending that lazy bindings are never
made from uninitialized memory, but not only is that not true, the original
default binding is still getting overwritten (see FIXME test cases).
The long-term solution is tracked in <rdar://problem/12701038>

PR14765 and <rdar://problem/12875012>

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

11 years agoWhen comparing two template template arguments in the template differ, consider
Richard Trieu [Thu, 31 Jan 2013 02:47:46 +0000 (02:47 +0000)]
When comparing two template template arguments in the template differ, consider
them the same if they are actually the same; having the same name isn't enough.

Similar to r174013, template template arguments were also mistakenly considered
the same when they had the same name but were in different namespaces.
In addition, when printing template template arguments, use the qualified name
if the regular name is the same.

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

11 years agoFix -Wcovered-switch-default and -Wunused-private-field warnings.
Richard Smith [Thu, 31 Jan 2013 02:04:38 +0000 (02:04 +0000)]
Fix -Wcovered-switch-default and -Wunused-private-field warnings.

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

11 years agoAdd indents to AST dumping and removed parenthesis from AST nodes.
Richard Trieu [Thu, 31 Jan 2013 01:44:26 +0000 (01:44 +0000)]
Add indents to AST dumping and removed parenthesis from AST nodes.
Indents were given the color blue when outputting with color.
AST dumping now looks like this:

Node
|-Node
| `-Node
`-Node
  `-Node

Compared to the previous:

(Node
  (Node
    (Node))
  (Node
    (Node)))

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

11 years agoFix ODR-use of a MemberExpr to check before marking a pure function used. Remove
Nick Lewycky [Thu, 31 Jan 2013 01:34:31 +0000 (01:34 +0000)]
Fix ODR-use of a MemberExpr to check before marking a pure function used. Remove
a workaround for this bug from the -Wundefined-internals warning.

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

11 years ago[analyzer] Fix a bug in region store that lead to undefined value false
Anna Zaks [Thu, 31 Jan 2013 01:19:52 +0000 (01:19 +0000)]
[analyzer] Fix a bug in region store that lead to undefined value false
positives.

The includeSuffix was only set on the first iteration through the
function, resulting in invalid regions being produced by getLazyBinding
(ex: zoomRegion.y).

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

11 years agoSometimes ld is just ld.
Matt Beaumont-Gay [Thu, 31 Jan 2013 01:15:55 +0000 (01:15 +0000)]
Sometimes ld is just ld.

Don't expect a character between the double-quotes and 'ld'.

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

11 years agoWhen comparing two templates in the template differ, consider them the
Douglas Gregor [Thu, 31 Jan 2013 01:08:35 +0000 (01:08 +0000)]
When comparing two templates in the template differ, consider them the
same if they are actually the same; having the same name isn't
enough. Fixes <rdar://problem/12931988>.

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

11 years agoMake sure that the Attribute object represents one attribute only.
Bill Wendling [Thu, 31 Jan 2013 00:30:05 +0000 (00:30 +0000)]
Make sure that the Attribute object represents one attribute only.

Several places were still treating the Attribute object as respresenting
multiple attributes. Those places now use the AttributeSet to represent
multiple attributes.

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

11 years agoFix unused variable warnings in -asserts build
Matt Beaumont-Gay [Thu, 31 Jan 2013 00:08:03 +0000 (00:08 +0000)]
Fix unused variable warnings in -asserts build

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

11 years agoReinstate r173952, this time limiting it to exactly the form
Douglas Gregor [Wed, 30 Jan 2013 23:10:17 +0000 (23:10 +0000)]
Reinstate r173952, this time limiting it to exactly the form

  #define X X

for which there is no point warning, ever.

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

11 years agoDiagnostics: Clarify name of line-length-limiting constant in r173976.
Jordan Rose [Wed, 30 Jan 2013 22:14:15 +0000 (22:14 +0000)]
Diagnostics: Clarify name of line-length-limiting constant in r173976.

Thanks, Sean.

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

11 years agoChanged to static_cast, due to post-commit review.
Filipe Cabecinhas [Wed, 30 Jan 2013 22:03:24 +0000 (22:03 +0000)]
Changed to static_cast, due to post-commit review.

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

11 years agoTableGen backends: use emitSourceFileHeader() to emit the warning about
Dmitri Gribenko [Wed, 30 Jan 2013 21:54:20 +0000 (21:54 +0000)]
TableGen backends: use emitSourceFileHeader() to emit the warning about
file contents being autogenerated

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

11 years agoCast to remove the narrowing conversion error in c++11.
Filipe Cabecinhas [Wed, 30 Jan 2013 21:50:21 +0000 (21:50 +0000)]
Cast to remove the narrowing conversion error in c++11.

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

11 years agoDiagnostics: if a line is longer than 4096 characters, don't print it.
Jordan Rose [Wed, 30 Jan 2013 21:41:07 +0000 (21:41 +0000)]
Diagnostics: if a line is longer than 4096 characters, don't print it.

Specifically, don't print snippets, caret diagnostics, or ranges for
lines over 4096 characters. We copy the line around a few times in our
diagnostics machinery, and we have to print a caret line that's just as
long. This uses a lot of memory just to create a poor user experience as
we print out a line much too long for anyone to read...or spend extra
energy trying to fit it to -fmessage-length.

<rdar://problem/13106850>

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

11 years agoRevert "[preprocessor] Don't warn about "disabled expansion of recursive macro""
Argyrios Kyrtzidis [Wed, 30 Jan 2013 20:42:17 +0000 (20:42 +0000)]
Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""

This reverts commit r173952

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

11 years agoHandle passing non-Qualtypes to %diff better. Instead of asserting, fall back
Richard Trieu [Wed, 30 Jan 2013 20:04:31 +0000 (20:04 +0000)]
Handle passing non-Qualtypes to %diff better.  Instead of asserting, fall back
to printing the default case.  This is a fix for PR15023.

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

11 years agoAdd OpenCL error that a kernel function must have void return type. Includes a test...
Tanya Lattner [Wed, 30 Jan 2013 19:48:52 +0000 (19:48 +0000)]
Add OpenCL error that a kernel function must have void return type. Includes a test case.

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

11 years agoFix comment in test/Lexer/utf8-invalid.c for updates in r173959.
Jordan Rose [Wed, 30 Jan 2013 19:29:14 +0000 (19:29 +0000)]
Fix comment in test/Lexer/utf8-invalid.c for updates in r173959.

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

11 years agoFix r173881 to properly skip invalid UTF-8 characters in raw lexing and -E.
Jordan Rose [Wed, 30 Jan 2013 19:21:12 +0000 (19:21 +0000)]
Fix r173881 to properly skip invalid UTF-8 characters in raw lexing and -E.

This caused hangs as we processed the same invalid byte over and over.

<rdar://problem/13115651>

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

11 years ago[analyzer] Make shallow mode more shallow.
Anna Zaks [Wed, 30 Jan 2013 19:12:39 +0000 (19:12 +0000)]
[analyzer] Make shallow mode more shallow.

Redefine the shallow mode to inline all functions for which we have a
definite definition (ipa=inlining). However, only inline functions that
are up to 4 basic blocks large and cut the max exploded nodes generated
per top level function in half.

This makes shallow faster and allows us to keep inlining small
functions. For example, we would keep inlining wrapper functions and
constructors/destructors.

With the new shallow, it takes 104s to analyze sqlite3, whereas
the deep mode is 658s and previous shallow is 209s.

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

11 years ago[analyzer] Use analyzer config for max-inlinable-size option.
Anna Zaks [Wed, 30 Jan 2013 19:12:36 +0000 (19:12 +0000)]
[analyzer] Use analyzer config for max-inlinable-size option.

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

11 years ago[analyzer] Move report false positive suppression to report visitors.
Anna Zaks [Wed, 30 Jan 2013 19:12:34 +0000 (19:12 +0000)]
[analyzer] Move report false positive suppression to report visitors.

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

11 years ago[analyzer] Remove further references to analyzer-ipa.
Anna Zaks [Wed, 30 Jan 2013 19:12:26 +0000 (19:12 +0000)]
[analyzer] Remove further references to analyzer-ipa.

Thanks Jordan!

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

11 years agoscan-build: When using Xcode 4.6, use build settings for doing proper build interposi...
Ted Kremenek [Wed, 30 Jan 2013 19:10:24 +0000 (19:10 +0000)]
scan-build: When using Xcode 4.6, use build settings for doing proper build interposition.

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

11 years agoHoist retrieval of Expr* into caller. No functionality change.
Ted Kremenek [Wed, 30 Jan 2013 19:10:21 +0000 (19:10 +0000)]
Hoist retrieval of Expr* into caller.  No functionality change.

Just makes the code a little cleaner, and easier to reason about.

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

11 years ago[preprocessor] Don't warn about "disabled expansion of recursive macro"
Argyrios Kyrtzidis [Wed, 30 Jan 2013 18:55:52 +0000 (18:55 +0000)]
[preprocessor] Don't warn about "disabled expansion of recursive macro"
for "#define X X".

This is a pattern that, for example, stdbool.h uses.
rdar://12435773

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

11 years ago[analyzer] Model trivial copy/move ctors with an aggregate bind.
Jordan Rose [Wed, 30 Jan 2013 18:16:06 +0000 (18:16 +0000)]
[analyzer] Model trivial copy/move ctors with an aggregate bind.

This is faster for the analyzer to process than inlining the constructor
and performing a member-wise copy, and it also solves the problem of
warning when a partially-initialized POD struct is copied.

Before:
  CGPoint p;
  p.x = 0;
  CGPoint p2 = p; <-- assigned value is garbage or undefined

After:
  CGPoint p;
  p.x = 0;
  CGPoint p2 = p; // no-warning

This matches our behavior in C, where we don't see a field-by-field copy.

<rdar://problem/12305288>

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

11 years agoDocumentation: fix escaping in JSON example
Dmitri Gribenko [Wed, 30 Jan 2013 17:58:39 +0000 (17:58 +0000)]
Documentation: fix escaping in JSON example

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

11 years agoDocumentation: add a link to Bear, a tool to help with JSON DB
Dmitri Gribenko [Wed, 30 Jan 2013 17:58:14 +0000 (17:58 +0000)]
Documentation: add a link to Bear, a tool to help with JSON DB

Patch by Laszlo Nagy

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

11 years agoDocumentation: fix link to ExecuteAction(), which was previously typoed as
James Dennett [Wed, 30 Jan 2013 17:53:07 +0000 (17:53 +0000)]
Documentation: fix link to ExecuteAction(), which was previously typoed as
"ExecutionAction()".

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

11 years agoComment parsing: fold named character references test into other HTML tests
Dmitri Gribenko [Wed, 30 Jan 2013 14:44:47 +0000 (14:44 +0000)]
Comment parsing: fold named character references test into other HTML tests

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

11 years agoComment parsing: resolve more named character references
Dmitri Gribenko [Wed, 30 Jan 2013 14:29:28 +0000 (14:29 +0000)]
Comment parsing: resolve more named character references

This reimplements r173850 with a better approach:
(1) use a TableGen-generated matcher instead of doing a linear search;
(2) avoid allocations for new strings by converting code points to string
    iterals with TableGen.

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

11 years agoRevert unintended change
Dmitri Gribenko [Wed, 30 Jan 2013 12:40:40 +0000 (12:40 +0000)]
Revert unintended change

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

11 years agoIndex/special-html-characters.m: mark this as XFAIL for valgrind
Dmitri Gribenko [Wed, 30 Jan 2013 12:17:33 +0000 (12:17 +0000)]
Index/special-html-characters.m: mark this as XFAIL for valgrind

Fix is being discussed on cfe-dev.

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

11 years agoMove UTF conversion routines from clang/lib/Basic to llvm/lib/Support
Dmitri Gribenko [Wed, 30 Jan 2013 12:06:08 +0000 (12:06 +0000)]
Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support

This is required to use them in TableGen.

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

11 years agoAlso promote fp16 types to double when they're anonymous variadic arguments.
Tim Northover [Wed, 30 Jan 2013 09:46:55 +0000 (09:46 +0000)]
Also promote fp16 types to double when they're anonymous variadic arguments.

__fp16 isn't covered by the standard, but this resolves the oddity that float
gets promoted when passed variadically, but not the smaller type. This is
required by the AArch64 ABI, and a sane action elsewhere.

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

11 years agoDon't generate no-op replacements.
Daniel Jasper [Wed, 30 Jan 2013 09:46:12 +0000 (09:46 +0000)]
Don't generate no-op replacements.

No functional changes.

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

11 years agoAdd "instancetype" as a code completion result for the return type of
Douglas Gregor [Wed, 30 Jan 2013 07:11:43 +0000 (07:11 +0000)]
Add "instancetype" as a code completion result for the return type of
an Objective-C method. Fixes <rdar://problem/13069990>.

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

11 years agoThe instance methods of the root class of an Objective-C hieararchy
Douglas Gregor [Wed, 30 Jan 2013 06:58:39 +0000 (06:58 +0000)]
The instance methods of the root class of an Objective-C hieararchy
can be messaged via the metaclass. Provide code completions for this
case. Fixes <rdar://problem/12560296>.

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

11 years agoC11: Provide the missing half of <stdalign.h>
Richard Smith [Wed, 30 Jan 2013 06:33:54 +0000 (06:33 +0000)]
C11: Provide the missing half of <stdalign.h>

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

11 years agoFix test failure from previous change.
Richard Smith [Wed, 30 Jan 2013 06:27:44 +0000 (06:27 +0000)]
Fix test failure from previous change.

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

11 years agoSemantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
Richard Smith [Wed, 30 Jan 2013 05:45:05 +0000 (05:45 +0000)]
Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
an attribute for consistency with our other noreturn mechanisms.

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

11 years agoDon't warn on fall-through from unreachable code.
Alexander Kornienko [Wed, 30 Jan 2013 03:49:44 +0000 (03:49 +0000)]
Don't warn on fall-through from unreachable code.

Summary:
A motivating example:
class ClassWithDtor {
public:
  ~ClassWithDtor() {}
};
void fallthrough3(int n) {
  switch (n) {
    case 2:
      do {
        ClassWithDtor temp;
        return;
      } while (0);  // This generates a chain of unreachable CFG blocks.
    case 3:
      break;
  }
}

Reviewers: rsmith, doug.gregor, alexfh

Reviewed By: alexfh

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D330

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

11 years agoUnresolved lookups can have using declarations that refer to
Douglas Gregor [Wed, 30 Jan 2013 02:10:08 +0000 (02:10 +0000)]
Unresolved lookups can have using declarations that refer to
unresolved using declarations. Fixes PR14768 / <rdar://problem/13030296>.

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

11 years agoDon't warn about Unicode characters in -E mode.
Jordan Rose [Wed, 30 Jan 2013 01:52:57 +0000 (01:52 +0000)]
Don't warn about Unicode characters in -E mode.

People use the C preprocessor for things other than C files. Some of them
have Unicode characters. We shouldn't warn about Unicode characters
appearing outside of identifiers in this case.

There's not currently a way for the preprocessor to tell if it's in -E mode,
so I added a new flag, derived from the PreprocessorOutputOptions. This is
only used by the Unicode warnings for now, but could conceivably be used by
other warnings or even behavioral differences later.

<rdar://problem/13107323>

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