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

16569 Коммитов

Автор SHA1 Сообщение Дата
Rafael Espindola 0aeb40f69b Add tests for a corner case of when to relax all instructions:
We don't want to relax all instructions in

$ clang -c test.s

since most users don't pass -O when using the driver to assemble.

On the other hand, -save-temps should not change the output unnecessary, so in

$ clang -c test.c -save-temps

we should relax all instructions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169815 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 05:52: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 39450d0469 Remove until I can fix this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169778 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 22:10:53 +00:00
Bill Wendling 41bde8c2fb Use correct flags for this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 21:15:22 +00:00
Chad Rosier 26df84a187 Fixup test case from r169755. These are driver options, not frontend options.
Also, add the -S option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169763 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 20:16:17 +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
Michael Ilseman 23add332da Remove unneeded typedef and volatile
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-10 18:48:08 +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 baab683a5a Add a triple to this test. It depends on little-endian bitfield layout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169696 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 10:39:18 +00:00
Chandler Carruth 5588a6903e Add a test case that I've been using to clarify the bitfield layout for
both LE and BE targets.

AFAICT, Clang get's this correct for PPC64. I've compared it to GCC 4.8
output for PPC64 (thanks Roman!) and to my limited ability to read power
assembly, it looks functionally equivalent. It would be really good to
fill in the assertions on this test case for x86-32, PPC32, ARM, etc.,
but I've reached the limit of my time and energy... Hopefully other
folks can chip in as it would be good to have this in place to test any
subsequent changes.

To those who care about PPC64 performance, a side note: there is some
*obnoxiously* bad code generated for these test cases. It would be worth
someone's time to sit down and teach the PPC backend to pattern match
these IR constructs better. It appears that things like '(shr %foo,
<imm>)' turn into 'rldicl R, R, 64-<imm>, <imm>' or some such. They
don't even get combined with other 'rldicl' instructions *immediately
adjacent*. I'll add a couple of these patterns to the README, but
I think it would be better to look at all the patterns produced by this
and other bitfield access code, and systematically build up a collection
of patterns that efficiently reduce them to the minimal code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169693 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 10:08:22 +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
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
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
Argyrios Kyrtzidis e1c2c2023e [libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.

This uniques them from other declarations with the same name but in different translation units.
rdar://10546541

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 22:41:46 +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
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
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
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
NAKAMURA Takumi 8fda1ab0fb clang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169587 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 06:57:40 +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
NAKAMURA Takumi de780d4424 test/Index/skip-parsed-bodies/compile_commands.json: Remove XFAIL on cygming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169566 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 00:05:36 +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
Argyrios Kyrtzidis 2a06447fcd [libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169558 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 23:04:24 +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
Matthew Curtis 570514153b hexagon-toolchain.c now passes on win32
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169548 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 21:25:18 +00:00
Matthew Curtis 803ebf185a relax hexagon-toolchain.c even more to accomodate mingw32 targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 20:55:41 +00:00
Matthew Curtis a64d703a7d relax hexagon-toolchain.c CHECK to accomodate mingw32 targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169543 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 20:21:20 +00:00
Argyrios Kyrtzidis 838eb7e865 [libclang] Introduce a new indexing mode where we skip function bodies
that were already parsed in the same "indexing session".

An indexing session is defined as using the same CXIndexAction object
for multiple clang_indexSourceFile calls.
Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will
enable the mode where we try to skip bodies that were already parsed in
another translation unit.

If a function's body was skipped, the "flags" field in the CXIdxDeclInfo
structure will have "CXIdxDeclFlag_Skipped" bit was set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 19:41:16 +00:00
Matthew Curtis 2ab3b6d794 Un-XFAIL hexagon-toolchain.c test for mingw32
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169533 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 19:03:09 +00:00
Jordan Rose 4ee1c557c3 [analyzer] Simplify RetainCountChecker's handling of dead symbols.
Previously we made three passes over the set of dead symbols, and removed
them from the state /twice/. Now we combine the autorelease pass and the
symbol death pass, and only have to remove the bindings for the symbols
that leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169527 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 18:58:18 +00:00
Fariborz Jahanian 762661a077 Fixes a typo in this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169519 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 17:50:40 +00:00
Matthew Curtis 33c95f1178 Hexagon TC: Add/improve support for small data
threshold, pic, pie



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169517 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 17:49:03 +00:00
Matthew Curtis c709c8adff Fix hexagon-toolchain.c test to handle versioned clang executables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169513 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 16:01:06 +00:00
Matthew Curtis 5fdf350e39 Hexagon TC: Reimplement Link::ConstructJob to call
linker directly

Rather than calling gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169512 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 15:46:07 +00:00
Benjamin Kramer 42427409fd Sema: Don't emit a warning when __func__ is used in a lambda outside of a function.
Fixes PR14518.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169510 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 15:42:21 +00:00
NAKAMURA Takumi 112aff155b test/Driver/hexagon-toolchain.c: Unbreak XPASS. Cygwin can be treated as unix-like system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169509 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 14:42:56 +00:00
Matthew Curtis 6781415fa6 Hexagon TC: Move getHexagonTargetCPU from Tools.cpp to
ToolChains.cpp

This is in anticipation of forthcoming library path changes.

Also ...
- Fixes some inconsistencies in how the arch is passed to tools.
- Add test cases for various forms of arch flags

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169505 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 14:16:43 +00:00
Matthew Curtis 4a29065eb1 Disable hexagon toolchain test on windows targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169498 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 13:06:19 +00:00
Matthew Curtis b3489a0d35 Hexagon TC: Update toolchain to add appropriate include
paths

- Inherit from Linux rather than ToolChain
- Override AddClangSystemIncludeArgs and AddClangCXXStdlibIncludeArgs
  to properly set include paths.

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