Commit Graph

61506 Commits

Author SHA1 Message Date
James Y Knight 51a62f15d8 Tweak myriad-toolchain test.
The test failed when run on a SPARC host, since it was finding the
native gcc installation by accident.

llvm-svn: 256191
2015-12-21 20:30:49 +00:00
Vedant Kumar 2f5bb1150d Reapply "[CodeGen] Fix assignments of inline layouts into the byref structure"
When using blocks, a byref structure is created to represent the
closure. The "byref.layout" field of this structure is an i8*. However,
some 'inline' layouts are represented as i64's, not i8*'s.

Prior to r246985 we cast the i64 'inline' layout to an i8* before
assigning it into the byref structure. This patch brings the cast back
and adds a regression test.

The original version of this patch was too invasive. This version only adds the
cast to BuildByrefLayout.

Differential Revision: http://reviews.llvm.org/D15674

rdar://23713871

llvm-svn: 256190
2015-12-21 20:21:15 +00:00
Vedant Kumar 3ed0df070e Revert "[CodeGen] Fix assignments of inline layouts into the byref structure"
This reverts commit r256185. It breaks CodeGenObjC/fragile-arc.m.

llvm-svn: 256186
2015-12-21 19:43:25 +00:00
Vedant Kumar eb37ec87e4 [CodeGen] Fix assignments of inline layouts into the byref structure
When using blocks, a byref structure is created to represent the
closure. The "byref.layout" field of this structure is an i8*. However,
some 'inline' layouts are represented as i64's, not i8*'s.

Prior to r246985 we cast the i64 'inline' layout to an i8* before
assigning it into the byref structure. This patch brings the cast back
and adds a regression test.

rdar://23713871

llvm-svn: 256185
2015-12-21 19:30:37 +00:00
Daniel Jasper eb65e912aa clang-format: Properly set the BlockKind for more blocks.
Before:
  void f() { struct Dummy { };
    f();
  }

After:
  void f() {
    struct Dummy {};
    f();
  }

llvm-svn: 256175
2015-12-21 18:31:15 +00:00
Daniel Jasper a252f5d56d clang-format: Only consider the first #include that looks right to be
the main #include.

llvm-svn: 256170
2015-12-21 17:28:24 +00:00
Daniel Jasper 41a2bf74ed clang-format: [JS] Change Google-style default for aligning operands.
The style guide allows both, but apparently, this is the more dominant use.

llvm-svn: 256154
2015-12-21 13:52:19 +00:00
Daniel Jasper 32d75fa293 clang-format: Only try to find the "main" include in the first block of
includes.

llvm-svn: 256153
2015-12-21 13:40:49 +00:00
Alexander Kornienko fbd33be333 [scan-view] replace deprecated optparse with argparse
Summary: scan-view migrated from optparse deprecated Python module to its replacement (argparse) and resolved few conflicts with pep8

Reviewers: ddunbar, aaron.ballman, dcoughlin, jroelofs, zaks.anna

Subscribers: cfe-commits

Patch by Kirill Bobyrev!

Differential Revision: http://reviews.llvm.org/D15370

llvm-svn: 256150
2015-12-21 12:19:13 +00:00
Daniel Jasper 0bfdeb4b6d clang-format: Extend detection of the "main" #include to use the filename
Before, the first (non-system) header in a file was considered to be
the main include. This is conservative as it makes clang-format change
the #include order less often. Instead implement some basic usage of
the filename itself. With this patch, clang-format considers every
header to be a main include if the header file's basename is a prefix
to the filename the #include is in.

llvm-svn: 256148
2015-12-21 12:14:17 +00:00
James Molloy f97fdae4d0 [Driver] Pass -O* to the gold plugin via -plugin-opt
The gold plugin understands -O0..-O3, but these are not currently being passed to it.

llvm-svn: 256146
2015-12-21 10:44:36 +00:00
Craig Topper dfe29ae5db [Sema] Use range-based for loops. NFC
llvm-svn: 256135
2015-12-21 06:35:56 +00:00
NAKAMURA Takumi 9ec6a826dd [Cygwin] Enable TLS as emutls.
It resolves clang selfhosting with std::once() for Cygwin.

FIXME: It may be EmulatedTLS-generic also for X86-Android.
FIXME: Pass EmulatedTLS to LLVM CodeGen from Clang with -femulated-tls.
llvm-svn: 256134
2015-12-21 02:37:23 +00:00
Michael Kuperstein 591278c08d [X86] Add missing m64/int64 conversions
Define the 64-bit equivalents of _m_to_int and _m_from_int.

Differential Revision: http://reviews.llvm.org/D15572

llvm-svn: 256122
2015-12-20 12:37:18 +00:00
Michael Kuperstein beae026738 [X86] Add signed aliases for popcnt intrinsics
The Intel manual documents both an unsigned form (_mm_popcnt_u32)
and a signed form (_popcnt32) of the intrinsic. Add the missing signed form.

Differential Revision: http://reviews.llvm.org/D15568

llvm-svn: 256121
2015-12-20 12:35:35 +00:00
Paul Robinson 0334a047df Driver part of debugger tuning.
Adds driver options named -glldb and -gsce to mean -g plus tuning for
lldb and SCE debuggers respectively; the existing -ggdb option does
the same for gdb. Existing options -ggdb0, -ggdb1 etc. unpack into
-ggdb -g<N>.  (There will not be -glldb<N> or -gsce<N> options.) The
tuning gets a target-specific default in the driver, and is passed
into cc1 with the new -debugger-tuning option.

As fallout, fixes where '-gsplit-dwarf -g0' would ignore the -g0 part
on Linux.

Differential Revision: http://reviews.llvm.org/D15651

llvm-svn: 256104
2015-12-19 19:41:48 +00:00
Chris Bieneman b657449399 Revert "[CMake] Support a simple case for bootstrap builds to generate PGO data"
This reverts commit r256069, which was an unintentional tag along on
another commit.

llvm-svn: 256088
2015-12-19 05:47:50 +00:00
Richard Smith ac9f5a9c14 Test for diagnostic quality improvement in r256049.
llvm-svn: 256083
2015-12-19 03:12:14 +00:00
Richard Smith d63db6ef1f Fix crash-on-invalid if a :: is followed by two or more open parentheses (and then something else).
llvm-svn: 256080
2015-12-19 02:40:19 +00:00
Paul Robinson 45784a79fc Recommit CC1 part of debugger tuning; pass through setting from driver to LLVM.
Reapplies r256063, except instead of frugally re-using an LLVM enum,
we define a Clang enum, to avoid exposing too much LLVM interface.

Differential Revision: http://reviews.llvm.org/D15650

llvm-svn: 256078
2015-12-19 02:24:10 +00:00
Eric Christopher 75bea4d42b Use a command line alias to remove the need to rewrite a subtarget
feature for command line compatibility.

llvm-svn: 256076
2015-12-19 01:48:43 +00:00
Chris Bieneman 2281622685 [CMake] Fixing a typo in a flag
Turns out cc1's flag has 1 - not 2...

llvm-svn: 256070
2015-12-19 00:56:12 +00:00
Chris Bieneman a948007062 [CMake] Support a simple case for bootstrap builds to generate PGO data
Summary:
This patch adds support for the clang multi-stage bootstrapping to support PGO profdata generation, and can build a 2 or 3 stage compiler.

With this patch applied you can configure your build directory with the following invocation of CMake:

cmake -G <generator> -C <path_to_clang>/cmake/caches/PGO.cmake <source dir>

After configuration the following additional targets will be generated:

stage2-instrumented:
Builds a stage1 x86 compiler, runtime, and required tools (llvm-config, llvm-profdata) then uses that compiler to build an instrumented stage2 compiler.

stage2-instrumented-generate-profdata:
Depends on "stage2-instrumented" and will use the instrumented compiler to generate profdata based on the training files in <clang>/utils/perf-training

stage2:
Depends on "stage2-instrumented-generate-profdata" and will use the stage1 compiler with the stage2 profdata to build a PGO-optimized compiler.

stage2-check-llvm:
Depends on stage2 and runs check-llvm using the stage3 compiler.

stage2-check-clang:
Depends on stage2 and runs check-clang using the stage3 compiler.

stage2-check-all:
Depends on stage2 and runs check-all using the stage3 compiler.

stage2-test-suite:
Depends on stage2 and runs the test-suite using the stage3 compiler (requires in-tree test-suite).

Reviewers: bogner, silvas, chandlerc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15584

llvm-svn: 256069
2015-12-19 00:56:10 +00:00
Paul Robinson 7927150fea Revert r256063, it's killing clang-tools-extra
llvm-svn: 256066
2015-12-19 00:23:11 +00:00
Paul Robinson a3ff2e4e02 CC1 part of debugger tuning; pass through setting from driver to LLVM.
Differential Revision: http://reviews.llvm.org/D15650

llvm-svn: 256063
2015-12-18 23:41:11 +00:00
Chris Bieneman de879caeb8 [CMake] PGO training data
Adding in a few more lit substitutions for cc1 and the test exec path.

llvm-svn: 256057
2015-12-18 23:00:57 +00:00
Zachary Turner 6bc7f97f56 Fix invalid enum comparison.
llvm-svn: 256055
2015-12-18 22:58:42 +00:00
Richard Smith db0ac5572f Split RequireCompleteType into a function that actually requires that the type
is complete (with an error produced if not) and a function that merely queries
whether the type is complete. Either way we'll trigger instantiation if
necessary, but only the former will diagnose and recover from missing module
imports.

The intent of this change is to prevent a class of bugs where code would call
RequireCompleteType(..., 0) and then ignore the result. With modules, we must
check the return value and use it to determine whether the definition of the
type is visible.

This also fixes a debug info quality issue: calls to isCompleteType do not
trigger the emission of debug information for a type in limited-debug-info
mode. This allows us to avoid emitting debug information for type definitions
in more cases where we believe it is safe to do so.

llvm-svn: 256049
2015-12-18 22:40:25 +00:00
Zachary Turner 448592eeac Support AlwaysBreakAfterReturnType
This changes the behavior of AlwaysBreakAfterDeclarationReturnType
so that it supports breaking after declarations, definitions, or
both.

Differential Revision: http://reviews.llvm.org/D10370
Reviewed By: Daniel Jasper

llvm-svn: 256046
2015-12-18 22:20:15 +00:00
Richard Smith 82b8d4e6fd [modules] Don't try to use the definition of a class if
RequireCompleteType(..., 0) says we're not permitted to do so. The definition
might not be visible, even though we know what it is.

llvm-svn: 256045
2015-12-18 22:19:11 +00:00
Richard Smith 0f59cb38e7 Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call
for the derived class into it. This is mostly just a cleanup, but could in
principle be a bugfix if there is some codepath that reaches here and didn't
previously require a complete type (I couldn't find any such codepath, though).

llvm-svn: 256037
2015-12-18 21:45:41 +00:00
Bob Wilson 2b2a0ae76d PIC should not be enabled by default on Darwin with -static.
r245667 changed -static so that it doesn't override an explicit -fPIC
option, but -static should still change the default for Darwin for -fno-PIC.
This matches longstanding GCC and Clang behavior on Darwin and changing it
would be disruptive, with no significant benefit.
http://reviews.llvm.org/D15455
rdar://problem/23811045

llvm-svn: 256026
2015-12-18 20:37:54 +00:00
Chad Rosier e5dafd1765 Fix an unused variable warning from r256012.
llvm-svn: 256023
2015-12-18 20:08:40 +00:00
Adrian Prantl 8a634c1504 Add a defensive check for a nullptr.
llvm-svn: 256012
2015-12-18 19:44:31 +00:00
Yaron Keren 6522461080 Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry().
llvm-svn: 255993
2015-12-18 10:30:12 +00:00
Alexey Bataev 6f531ec0a2 [OPENMP] Remove explicit call for implicit barrier
#pragma omp parallel needs an implicit barrier that is currently done by an explicit call to __kmpc_barrier. However, the runtime already ensures a barrier in __kmpc_fork_call which currently leads to two barriers per region per thread.
Differential Revision: http://reviews.llvm.org/D15561

llvm-svn: 255992
2015-12-18 10:24:53 +00:00
Alexey Bataev 8ef3141127 [OPENMP] Fix for http://llvm.org/PR25878: Error compiling an OpenMP program
OpenMP codegen tried to emit the code for its constructs even if it was detected as a dead-code. Added checks to ensure that the code is emitted if the code is not dead.

llvm-svn: 255990
2015-12-18 07:58:25 +00:00
Alexey Bataev eb48235033 [OPENMP 4.5] Parsing/sema analysis for 'depend(source)' clause in 'ordered' directive.
OpenMP 4.5 adds 'depend(source)' clause for 'ordered' directive to support cross-iteration dependence. Patch adds parsing and semantic analysis for this construct.

llvm-svn: 255986
2015-12-18 05:05:56 +00:00
Douglas Gregor 0253543c92 ObjC properties: consider ownership of properties from protocols when synthesizing.
When determining whether ownership was explicitly written for a
property when it is being synthesized, also consider that the original
property might have come from a protocol. Fixes rdar://problem/23931441.

llvm-svn: 255943
2015-12-18 00:52:31 +00:00
Richard Trieu 031406fab0 Add a test for r255875 & r255929, comparisons on DynTypeNode wrapped QualType.
llvm-svn: 255937
2015-12-17 23:20:57 +00:00
Artem Belevich 8e9ba042a6 [CUDA] runtime wrapper header tweaks
* Pull in host-only implementations of few CUDA-specific math functions.
* #nclude <cmath> early to prevent its inclusion from CUDA headers after
  they've messed with __THROW macro.

llvm-svn: 255933
2015-12-17 22:25:22 +00:00
Richard Trieu 1cc243a08f Fix r255875, use '<' instead of '==' for 'operator<'
Aaron Ballman pointed out a typo from the copy and paste in r255875.  This will
preserve the strict weak ordering when comparing DynTypedNode.

llvm-svn: 255929
2015-12-17 21:56:22 +00:00
Easwaran Raman 695890c971 Attach maximum function count to Module when using PGO mode.
This sets the maximum entry count among all functions in the program to the module using module flags. This allows the optimizer to use this information.

Differential Revision: http://reviews.llvm.org/D15163

llvm-svn: 255918
2015-12-17 19:14:27 +00:00
Chad Rosier 803f43bf6d [x86] Filecheck is case sensitive. Capitalize directives.
llvm-svn: 255916
2015-12-17 19:01:55 +00:00
Chad Rosier 0df679e450 [x86] Filecheck is case sensitive. Capitalize directives.
llvm-svn: 255915
2015-12-17 18:54:42 +00:00
Artem Belevich 9b9294674b [CUDA] Make vtable construction aware of host/device side of CUDA compilation.
C++ emits vtables for classes that have key function present in the
current TU. While we compile CUDA the fact that key function was found
in this TU does not mean that we are going to generate code for it. E.g.
vtable for a class with host-only methods should not (and can not) be
generated on device side, because we'll never generate code for them
during device-side compilation.

This patch adds an extra CUDA-specific check during key method computation
and filters out potential key methods that are not suitable for this side
of CUDA compilation.

When we codegen vtable, entries for unsuitable methods are set to null.

Differential Revision: http://reviews.llvm.org/D15309

llvm-svn: 255911
2015-12-17 18:12:36 +00:00
Marina Yatsina 71ebc691f6 [ms-inline-asm] Add support for composite structs in MS inline asm
Add MS inline asm support for structs that contain fields that are also structs.

Differential Revision: http://reviews.llvm.org/D15578

llvm-svn: 255890
2015-12-17 12:51:51 +00:00
Alexey Bataev c9bd03dc05 [OPENMP] Fix for http://llvm.org/PR25142: openmp: Assertion failed: DD && "queried property of class with no definition", file AST/DeclCXX.h
Added processing for template specialization during data-sharing attributes analysis

llvm-svn: 255879
2015-12-17 06:55:08 +00:00
Richard Trieu cef8f89cb6 Add QualType case to operator< for DynTypedNode.
This allows sorting DynTypedNode's which are QualType's since QualType does
not have memoization.

llvm-svn: 255875
2015-12-17 04:46:48 +00:00
Manman Ren b0b3af7dd8 [TLS on Darwin] use CXX_FAST_TLS calling convention for access functions.
Also set nounwind attribute.

rdar://problem/9001553

llvm-svn: 255860
2015-12-17 00:42:36 +00:00