Граф коммитов

28186 Коммитов

Автор SHA1 Сообщение Дата
NAKAMURA Takumi 007c44ccbd BackendUtil.cpp: Add #include "llvm/TargetTransformInfo.h"
llvm/Target/TargetMachine.h will not provide "llvm/TargetTransformInfo.h" any more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 05:53:24 +00:00
Richard Smith 1d28caf3b5 PR14558: Compute triviality of special members (etc) at the end of the class
definition, rather than at the end of the definition of the set of nested
classes. We still defer checking of the user-specified exception specification
to the end of the nesting -- we can't check that until we've parsed the
in-class initializers for non-static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169805 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 01:14:52 +00:00
Anna Zaks c2cca2361a [analyzer] Don't generate a summary for "freeWhenDone" if method is
inlined.

Fixes a false positive that occurs if a user writes their own
initWithBytesNoCopy:freeWhenDone wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169795 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 00:17:53 +00:00
Bill Wendling d56f403413 Add support to Darwin for the -export_dynamic' flag to the linker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169775 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 21:48:41 +00:00
Argyrios Kyrtzidis 44dfff681f Return true from HeaderSearch::isFileMultipleIncludeGuarded if the file
was #import'ed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169761 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 20:08:37 +00:00
Bill Wendling 44f4a2d8a9 Specify if `-mno-red-zone' was used when creating the GCOV instrucmentation pass.
This prevents the functions generated by that pass from using the red zone.
<rdar://problem/12843084>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169755 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 19:47:53 +00:00
Daniel Jasper 8b39c6693a Addi formatting tests for pointer template parameters.
Fix spacing before ",".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 18:59:13 +00:00
Alexander Kornienko 56e49c5cc2 Clang-format: error recovery for access specifiers
Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D198

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169738 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 16:34:48 +00:00
Benjamin Kramer 29573b0a82 Unbreak the clang build after r169712.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169713 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 21:58:24 +00:00
Aaron Ballman fff3248e69 Virtual method overrides can no longer have mismatched calling conventions. This fixes PR14339.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 17:45:41 +00:00
Chandler Carruth b50d7a35c2 Cleanup and fix an assert that was mis-firing.
Note that there is no test suite update. This was found by a couple of
tests failing when the test suite was run on a powerpc64 host (thanks
Roman!). The tests don't specify a triple, which might seem surprising
for a codegen test. But in fact, these tests don't even inspect their
output. Not at all. I could add a bunch of triples to these tests so
that we'd get the test coverage for normal builds, but really someone
needs to go through and add actual *tests* to these tests. =[ The ones
in question are:

  test/CodeGen/bitfield-init.c
  test/CodeGen/union.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 10:33:27 +00:00
Chandler Carruth ef8d516e7e Fix the bitfield record layout in codegen for big endian targets.
This was an egregious bug due to the several iterations of refactorings
that took place. Size no longer meant what it original did by the time
I finished, but this line of code never got updated. Unfortunately we
had essentially zero tests for this in the regression test suite. =[

I've added a PPC64 run over the bitfield test case I've been primarily
using. I'm still looking at adding more tests and making sure this is
the *correct* bitfield access code on PPC64 linux, but it looks pretty
close to me, and it is *worlds* better than before this patch as it no
longer asserts! =] More commits to follow with at least additional tests
and maybe more fixes.

Sorry for the long breakage due to this....

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169691 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 07:26:04 +00:00
Richard Smith 2801d9afa1 Fix overload resolution for the initialization of a multi-dimensional
array from a braced-init-list. There seems to be a core wording wart
here (it suggests we should be testing whether the elements of the init
list are implicitly convertible to the array element type, not whether
there is an implicit conversion sequence) but our prior behavior appears
to be a bug, not a deliberate effort to implement the standard as written.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169690 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 06:48:56 +00:00
Richard Smith afee0ff915 PR14550: If a system header contains a bogus constexpr function definition,
don't mark the function as invalid, since we suppress the error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169689 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 05:55:43 +00:00
Richard Smith 569cdc82c1 PR14549. Don't assert if we see an incomplete decltype specifier at the end of the file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169688 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 04:17:57 +00:00
Benjamin Kramer 0f584640dc Escape % in the TextDiagnosticBuffer so they aren't interpreted twice when fed into the diagnostic formatting machinery again.
Fixes PR14543.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169677 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 12:42:30 +00:00
David Chisnall 6e399b42b5 long double should be 64 bits on FreeBSD/MIPS64. It possibly should be on
Linux too, as I think we inherited it from there.  The ABI spec says 128-bit,
although I think SGI's compiler on IRIX may be the only thing ever to support
this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169674 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 09:06:08 +00:00
Richard Smith bc2a35d5ff Finish implementing 'selected constructor' rules for triviality in C++11. In
the cases where we can't determine whether special members would be trivial
while building the class, we eagerly declare those special members. The impact
of this is bounded, since it does not trigger implicit declarations of special
members in classes which merely *use* those classes.

In order to determine whether we need to apply this rule, we also need to
eagerly declare move operations and destructors in cases where they might be
deleted. If a move operation were supposed to be deleted, it would instead
be suppressed, and we could need overload resolution to determine if we fall
back to a trivial copy operation. If a destructor were implicitly deleted,
it would cause the move constructor of any derived classes to be suppressed.

As discussed on cxx-abi-dev, C++11's selected constructor rules are also
retroactively applied as a defect resolution in C++03 mode, in order to
identify that class B has a non-trivial copy constructor (since it calls
A's constructor template, not A's copy constructor):

struct A { template<typename T> A(T &); };
struct B { mutable A a; };


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169673 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 08:32:28 +00:00
Richard Smith 55798658f8 Remove some remnants of the assumption that there is at most one of each
flavour of special member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169670 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 04:10:18 +00:00
DeLesley Hutchins 93699d23cd Thread-safety analysis: check member access on guarded non-primitive types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169669 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 03:46:30 +00:00
Richard Smith ac71351acd Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.

This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.

This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 02:53:02 +00:00
Argyrios Kyrtzidis 5f5250b140 [libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndef
directive as a macro expansion.

This is more of a "macro reference" than a macro expansion but it's close enough
for libclang's purposes. If it causes issues we can revisit and introduce a new
kind of cursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 02:21:17 +00:00
Argyrios Kyrtzidis 61c1c8ee3f [Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also pass
a MacroInfo object if the identifier was a macro name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 02:21:11 +00:00
Richard Smith d5be2b5483 Add a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 02:13:02 +00:00
Richard Smith d5bc867f65 Implement C++03 [dcl.init]p5's checking for value-initialization of references
properly, rather than faking it up by pretending that a reference member makes
the default constructor non-trivial. That leads to rejects-valids when putting
such types inside unions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169662 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 02:01:17 +00:00
Eli Bendersky 0ee69cc6d4 Currently when AST record layouts are dumped with -fdump-record-layouts, the
following:

sizeof=132, dsize=132, align=4
nvsize=132, nvalign=4

Is not indented, so when classes are nested there is no way to know to
which class it belongs.

Fix this problem by indenting the size summary properly for each class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 00:07:24 +00:00
Bill Wendling 785b778203 s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169652 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 23:17:26 +00:00
DeLesley Hutchins 12f37e4114 Fix analysis based warnings so that all warnings are emitted when compiling
with -Werror.  Previously, compiling with -Werror would emit only the first
warning in a compilation unit, because clang assumes that once an error occurs,
further analysis is unlikely to return valid results.  However, warnings that
have been upgraded to errors should not be treated as "errors" in this sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169649 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 22:53:48 +00:00
Matt Beaumont-Gay 422daa1b83 Appease -Wnon-virtual-dtor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169648 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 22:49:27 +00:00
Anna Zaks 75f31c4862 [analyzer] Optimization heuristic: do not reanalyze every ObjC method as
top level.

This heuristic is already turned on for non-ObjC methods
(inlining-mode=noredundancy). If a method has been previously analyzed,
while being inlined inside of another method, do not reanalyze it as top
level.

This commit applies it to ObjCMethods as well. The main caveat here is
that to catch the retain release errors, we are still going to reanalyze
all the ObjC methods but without inlining turned on.

Gives 21% performance increase on one heavy ObjC benchmark, which
suffered large performance regressions due to ObjC inlining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169639 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 21:51:47 +00:00
Jordan Rose afa7cae15b [analyzer] Fix r168019 to work with unpruned paths as well.
This is the case where the analyzer tries to print out source locations
for code within a synthesized function body, which of course does not have
a valid source location. The previous fix attempted to do this during
diagnostic path pruning, but some diagnostics have pruning disabled, and
so any diagnostic with a path that goes through a synthesized body will
either hit an assertion or emit invalid output.

<rdar://problem/12657843> (again)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169631 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 19:56:29 +00:00
Ted Kremenek 18f860ee6c Reduce conversions between Store <-> ImmutableMapRef in RegionStore.
This reduces canonicalization of ImmutableMaps.  This reduces analysis time
of one heavy Objective-C file by another 1%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169630 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 19:54:25 +00:00
Ted Kremenek 0c312a90c5 Add helper method to convert from a RegionStoreRefBindings to a Store.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169622 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 18:32:08 +00:00
Matthew Curtis 3d8d422381 Hexagon TC: forward appropriate args to assembler
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169611 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 17:23:04 +00:00
NAKAMURA Takumi 2a907f8735 Driver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka i386-redhat-linux6E).
Thanks to Bruce Stephens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 17:13:18 +00:00
Alexander Kornienko 469a21b14c Clang-format: extracted FormatTokenSource from UnwrappedLineParser.
Summary: FormatTokenLexer is here, FormatTokenBuffer is on the way. This will allow to re-parse unwrapped lines when needed.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D186

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169605 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 16:15:44 +00:00
Matthew Curtis 1dbaef5fe1 Hexagon TC: add cc1 defaults for hexagon-gcc
compatibility



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 13:52:44 +00:00
Daniel Jasper c74e2794be Small tweaks to clang-format.
Now not joining keywords with '::' and not putting a space between
a pointer pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169594 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 09:52:15 +00:00
Ted Kremenek bf25fb1e2e Cache queries to lookupPrivateMethod() within ObjCMethodCall::getRuntimeDefinition().
The same queries can happen thousands of times.  This reduces the analysis
time on one heavy Objective-C file by 2.4%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169589 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 07:30:19 +00:00
John McCall e56bb36e8e Fix the required args count for variadic blocks.
We were emitting calls to blocks as if all arguments were
required --- i.e. with signature (A,B,C,D,...) rather than
(A,B,...).  This patch fixes that and accounts for the
implicit block-context argument as a required argument.
In addition, this patch changes the function type under which
we call unprototyped functions on platforms like x86-64 that
guarantee compatibility of variadic functions with unprototyped
function types;  previously we would always call such functions
under the LLVM type T (...)*, but now we will call them under
the type T (A,B,C,D,...)*.  This last change should have no
material effect except for making the type conventions more
explicit;  it was a side-effect of the most convenient implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169588 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 07:03:17 +00:00
Ted Kremenek 23dca7d88f Further reduce analysis time by 0.2% on a heavy Objective-C example by avoiding over-eager canonicalization of clusters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169586 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 06:49:27 +00:00
David Blaikie 75191fdbc3 Unbreak the GCC (4.4 & other bot) builds from r169571.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169581 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 03:28:20 +00:00
Richard Smith 504643934a Per [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169574 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 02:10:28 +00:00
Ted Kremenek 29f5ccd7ef Change RegionStore to always use ImmutableMapRef for processing cluster bindings.
This reduces analysis time by 1.2% on one test case (Objective-C), but
also cleans up some of the code conceptually as well.  We can possible
just make RegionBindingsRef -> RegionBindings, but I wanted to stage
things.

After this, we should revisit Jordan's optimization of not canonicalizing
the immutable AVL trees for the cluster bindings as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169571 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 01:55:21 +00:00
Logan Chien c57d158c29 Revert r169557. It seems that the test is too restricted
and will break the build on buildbot.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169562 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 23:40:31 +00:00
Logan Chien cd15652e63 Add i686-linux-android for gcc toolchain detection.
* Look for i686-linux-android under <sysroot>/lib/gcc.

* This patch also slightly enhance the test suite for
  Android GCC toolchain detection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169557 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 22:59:37 +00:00
Ted Kremenek 14491490a5 Revert "[analyzer] Aggressively cut back on the canonicalization in RegionStore."
Jordan and I discussed this, and we are going to do this another way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169538 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 19:40:32 +00:00
Argyrios Kyrtzidis 35f3f36cb9 Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
that was skipped by the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 18:59:10 +00:00
Jordan Rose c39f9fa39c [analyzer] Remove isa<> followed by dyn_cast<>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 18:58:29 +00:00
Jordan Rose 9428723d67 [analyzer] Remove unused fields from ExprEngine.
'currStmt', 'CleanedState', and 'EntryNode' were being set, but only ever
used locally.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169529 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 18:58:26 +00:00