Commit Graph

61444 Commits

Author SHA1 Message Date
Chris Bieneman 5ac5d61b9c [CMake] If you're building compiler-rt, the bootstrap build should depend on it.
Adding optional dependency for the bootstrap targets on compiler-rt.

llvm-svn: 255801
2015-12-16 18:49:12 +00:00
Chris Bieneman 475f52c93f [CMake] Make CLANG_BOOTSTRAP_TARGETS overridable
This allows exposing a custom list of targets from the next stage build up.

llvm-svn: 255799
2015-12-16 18:45:53 +00:00
Chris Bieneman 77c5e78e71 [CMake] ExternalProject for compiler-rt needs to depend on llvm-config and clang
The add_dependencies call on compiler-rt-configure adds llvm-config and clang to the phony target, but not to the actual configure custom command. We need the dependency bound to the custom command so that it can't be re-ordered by Ninja.

llvm-svn: 255798
2015-12-16 18:42:14 +00:00
Paul Robinson d083b9a8f6 [PS4][Profile] add "--dependent-lib=libclang_rt.profile-x86_64.a" to
the CC1 command line when enabling code coverage.

Patch by Ying Yi!

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

llvm-svn: 255784
2015-12-16 17:25:27 +00:00
Manuel Klimek 66a4dae57f Make matchers thread compatible, so we can pass them to different threads and run them on multiple translation units in parallel.
llvm-svn: 255773
2015-12-16 15:48:58 +00:00
Andrey Bokhanko 0b135e05ec [x86] Exclusion of incorrect include headers paths for MCU target
Exclusion of /usr/include and /usr/local/include headers paths for MCU target.

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

llvm-svn: 255766
2015-12-16 13:27:38 +00:00
Daniel Jasper d2629dc812 clang-format: Extend header sort category implementation.
Specifically, it is sometimes necessary to keep certain #includes as
the first #include, even before the main #include for a .cc file.
Switching the category to be signed instead of unsigned isn't ideal,
but it seems as good of an option as any and is fully backwards
compatible.

llvm-svn: 255757
2015-12-16 10:10:16 +00:00
Akira Hatanaka 8ebd580cf5 [Objective-c] Fix a crash that occurs when ObjCTypeParamList::back() is
called on an empty list.

This commit makes Parser::parseObjCTypeParamListOrProtocolRefs return
nullptr if it sees an invalid type parameter (e.g., __kindof) in the
type parameter list.

rdar://problem/23068920

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

llvm-svn: 255754
2015-12-16 06:25:38 +00:00
Craig Topper c82f896188 [CodeGen] Use llvm::CmpInst::Predicate instead of unsigned for parameter types in EmitCompare to eliminate some later explicit casts. NFC.
llvm-svn: 255753
2015-12-16 06:24:28 +00:00
Reid Kleckner 60103383f0 Print qualified display names when emitting CodeView
This is what debuggers expect.  Words towards fixing PR21528.

llvm-svn: 255744
2015-12-16 02:04:40 +00:00
Chris Bieneman ae5433907a [CMake] Add support for generating profdata for clang from training files
Summary:
This patch adds support for using LIT to drive generating PGO profile data for clang.

This first pass implementation should work on Linux and Unix based platforms. If you build clang using CMake with LLVM_BUILD_INSTRUMENTED=On the CMake build generates a generate-profdata target that will use the just-built clang to build any test files (see hello_world.cpp as an example). Each test compile will generate profraw files for each clang process. After all tests have run CMake will merge the profraw files using llvm-profdata.

Future opportunities for extension:
* Support for Build->Profile->Build bootstrapping
* Support for linker order file generation using a similar mechanism and the same training data
* Support for Windows

Reviewers: dexonsmith, friss, bogner, cmatthews, vsk, silvas

Subscribers: cfe-commits

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

llvm-svn: 255740
2015-12-16 01:02:44 +00:00
Evgeniy Stepanov e3fb51cf5a [cfi] Exclude ubsan runtime library from non-diag CFI builds (driver changes).
Split the CFI runtime in two: cfi and cfi_diag. The latter includes
UBSan runtime to allow printing diagnostics.

llvm-svn: 255736
2015-12-16 00:38:42 +00:00
Reid Kleckner 39329d57b5 Reland "[SEH] Use llvm.x86.seh.recoverfp for SEH filters on x64 as well as 32bit"
I forgot to initialize RecoverFP.

llvm-svn: 255731
2015-12-16 00:26:37 +00:00
Reid Kleckner d8f719fa1c Revert "[SEH] Use llvm.x86.seh.recoverfp for SEH filters on x64 as well as 32bit"
This reverts commit r255710.

llvm-svn: 255728
2015-12-16 00:20:21 +00:00
Richard Smith 9043d75e75 Fix grammar.
llvm-svn: 255727
2015-12-16 00:19:23 +00:00
Richard Smith e873686e3c Update our claims about GCC's diagnostics quality to reflect recent improvements to GCC.
llvm-svn: 255726
2015-12-16 00:18:47 +00:00
Richard Smith 90ae7922b5 These days, GCC has at least minimal documentation for its VLAIS extension.
llvm-svn: 255723
2015-12-16 00:09:57 +00:00
Evgeniy Stepanov 028685a5db Relax checks in cfi-cross-dso test.
The test is failing with unnamed labels.

llvm-svn: 255712
2015-12-15 23:49:51 +00:00
Reid Kleckner cf2626600c [SEH] Use llvm.x86.seh.recoverfp for SEH filters on x64 as well as 32bit
llvm-svn: 255710
2015-12-15 23:47:40 +00:00
Evgeniy Stepanov fd6f92d5cb Cross-DSO control flow integrity (Clang part).
Clang-side cross-DSO CFI.

* Adds a command line flag -f[no-]sanitize-cfi-cross-dso.
* Links a runtime library when enabled.
* Emits __cfi_slowpath calls is bitset test fails.
* Emits extra hash-based bitsets for external CFI checks.
* Sets a module flag to enable __cfi_check generation during LTO.

This mode does not yet support diagnostics.

llvm-svn: 255694
2015-12-15 23:00:20 +00:00
NAKAMURA Takumi db87d5dbfd clang/test/CodeGen/ms_this.cpp: Fix for -Asserts.
llvm-svn: 255690
2015-12-15 22:42:28 +00:00
NAKAMURA Takumi 512bd57699 Fix clang/test/CodeGen/ms_this.cpp.
llvm-svn: 255685
2015-12-15 22:19:00 +00:00
David Majnemer 0b17d44faf [WinEH] Update clang to use operand bundles on call sites
This updates clang to use bundle operands to associate an invoke with
the funclet which it is contained within.

Depends on D15517.

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

llvm-svn: 255675
2015-12-15 21:27:59 +00:00
Krzysztof Parzyszek 6c3b837452 Unsupport test that should not be run on Hexagon
llvm-svn: 255667
2015-12-15 19:14:24 +00:00
Nico Weber 0d10b2cf3c clang-cl: Add an alias for /wd4100
llvm-svn: 255655
2015-12-15 17:07:16 +00:00
Michael Zuckerman 724d02a21e [Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm
add triple to test

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

llvm-svn: 255647
2015-12-15 14:35:51 +00:00
Michael Zuckerman 229158c491 [Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm
Clang doesn’t support a use of “this” pointer inside inline asm.
When I tried to compile a class or a struct (see example) with an inline asm that contains "this" pointer.
Clang returns with an error.
This patch fixes that.

error: expected unqualified-id
For example:
'''
struct A {
    void f() {
          __asm mov eax, this
              // error: expected unqualified-id
                  }
};
'''
Differential Revision: http://reviews.llvm.org/D15115

llvm-svn: 255645
2015-12-15 14:04:18 +00:00
Alexey Bataev d60e2a3ebf [OPENMP 4.5] Fix test compatibility with 32 bit mode.
llvm-svn: 255640
2015-12-15 11:38:29 +00:00
Alexey Bataev fc57d1601d [OPENMP 4.5] Codegen for 'hint' clause of 'critical' directive
OpenMP 4.5 defines 'hint' clause for 'critical' directive. Patch adds codegen for this clause.

llvm-svn: 255639
2015-12-15 10:55:09 +00:00
NAKAMURA Takumi b4a6884844 clang/test/Analysis/padding_c.c: Suppress a test incompatible to i686-linux.
error: 'warning' diagnostics expected but not seen:
    File clang/test/Analysis/padding_c.c Line 194 (directive at clang/test/Analysis/padding_c.c:193): Excessive padding in 'struct DefaultAttrAlign'
  1 error generated.

llvm-svn: 255636
2015-12-15 09:37:01 +00:00
Benjamin Kramer 5c248d89f3 [libclang] Add a flag to create the precompiled preamble on the first parse.
Summary:
The current default is to create the preamble on the first reparse, aka
second parse. This is useful for clients that do not want to block when
opening a file because serializing the preamble takes a bit of time.
However, this makes the reparse much more expensive and that may be on the
critical path as it's the first interaction a user has with the source code.

YouCompleteMe currently optimizes for the first code interaction by parsing
the file twice when loaded. That's just unnecessarily slow and this flag
helps to avoid that.

Reviewers: doug.gregor, klimek

Subscribers: cfe-commits

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

llvm-svn: 255635
2015-12-15 09:30:31 +00:00
Gabor Horvath 009c5d52e3 Add a new matcher to match character types.
llvm-svn: 255627
2015-12-15 08:35:45 +00:00
Alexey Bataev 28c75417b2 [OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.
OpenMP 4.5 adds 'hint' clause to critical directive. Patch adds parsing/semantic analysis for this clause.

llvm-svn: 255625
2015-12-15 08:19:24 +00:00
Xinliang David Li ddbdb1e0be [PGO] make profile prefix even shorter and more readable
llvm-svn: 255587
2015-12-15 00:33:12 +00:00
Xinliang David Li 8608513b69 [PGO] Shorten profile symbol prefixes
(test case update)
Profile symbols have long prefixes which waste space and creating pressure for linker.
This patch shortens the prefixes to minimal length without losing verbosity.

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

llvm-svn: 255576
2015-12-14 23:26:46 +00:00
Rafael Espindola 8ce88a59fd Update for llvm api change.
llvm-svn: 255572
2015-12-14 23:17:07 +00:00
George Burgess IV 8d141e0120 [Sema] Make nullness warnings appear in C++.
Given the following code:

    int *_Nullable ptr;
    int *_Nonnull nn = ptr;

...In C, clang will warn you about `nn = ptr`, because you're assigning
a nonnull pointer to a nullable pointer. In C++, clang issues no such
warning. This patch helps ensure that clang doesn't ever miss an
opportunity to complain about C++ code.

N.B. Though this patch has a differential revision link, the actual
review took place over email.

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

llvm-svn: 255556
2015-12-14 22:00:49 +00:00
Ben Craig cd7e9f143b Reordering fields to reduce padding in Clang. NFC
llvm-svn: 255552
2015-12-14 21:54:11 +00:00
Ben Craig 97c191c473 [PATCH] Adding checker to detect excess padding in records
The intent of this checker is to generate a report for any class / structure
that could reduce its padding by reordering the fields.  This results in a very
noisy checker.  To reduce the noise, this checker will currently only warn when
the number of bytes over "optimal" is more than 24.  This value is configurable
with -analyzer-config performance.Padding:AllowedPad=N.  Small values of
AllowedPad have the potential to generate hundreds of reports, and gigabytes
of HTML reports.

The checker searches for padding violations in two main ways.  First, it goes
record by record.  A report is generated if the fields could be reordered in a
way that reduces the padding by more than AllowedPad bytes.  Second, the
checker will generate a report if an array will cause more than AllowedPad
padding bytes to be generated.

The record checker currently skips many ABI specific cases.  Classes with base
classes are skipped because base class tail padding is ABI specific.  Bitfields
are just plain hard, and duplicating that code seems like a bad idea.  VLAs are
both uncommon and non-trivial to fix.

The array checker isn't very thorough right now.  It only checks to see if the
element type's fields could be reordered, and it doesn't recursively check to
see if any of the fields' fields could be reordered.  At some point in the
future, it would be nice if "arrays" could also look at array new usages and
malloc patterns that appear to be creating arrays.

llvm-svn: 255545
2015-12-14 21:38:59 +00:00
Petar Jovanovic 2f264c31d3 [PowerPC] Fix test/CodeGen/ppc-sfvarargs
The issue seems to be that .ll file may either use number of register
value or alias %numUsedRegs, so the check needs to cover both cases.

This will hopefully fix the last regression introduced by r255515.

llvm-svn: 255539
2015-12-14 20:30:02 +00:00
Petar Jovanovic 59a981a8f3 [PowerPC] Fix make-check issues
Previous change r255515 introduced a couple of issues likely caused by
a different configure setup.

llvm-svn: 255533
2015-12-14 19:22:35 +00:00
John McCall 9d145df4c8 Allow pseudo-destructor calls on forward-declared Objective-C class pointers.
rdar://18522255

llvm-svn: 255531
2015-12-14 19:12:54 +00:00
Hans Wennborg 4ae76c2692 clang-cl: make /Wall turn on both -Wall and -Wextra (PR25563)
The documentation suggests /Wall should really turn on -Wextra and any
other warnings that are not enabled by default. That would correspond
to Clang's -Weverything, but is probably not what users want.

llvm-svn: 255524
2015-12-14 18:46:11 +00:00
David Majnemer feeefb214d [MS ABI] Don't rely on terminatepad
We'd like to remove support for terminatepad from LLVM.  To do this, we
need to move Clang off of it first.  The intent behind terminatepad was
to carefully model exception specifications for the MSVC personality.

However, we don't support exception specifications for the MSVC
personality and neither does MSVC.  Instead, MSVC supports
all-or-nothing exception specifications.  We can model this limited
usage using cleanuppads which call std::terminate.

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

llvm-svn: 255521
2015-12-14 18:34:18 +00:00
Petar Jovanovic 88a328fbbe [Power PC] add soft float support for ppc32
This patch enables soft float support for ppc32 architecture and fixes
the ABI for variadic functions. This is the first in a set of patches
for soft float support in LLVM.

Patch by Strahinja Petrovic.

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

llvm-svn: 255515
2015-12-14 17:51:50 +00:00
Krzysztof Parzyszek 1065323eec [Hexagon] Xfail two tests that fail due to over-aligning arrays
llvm-svn: 255510
2015-12-14 17:17:20 +00:00
Krzysztof Parzyszek 1e6e3c60b4 [Hexagon] Update default paths and arguments
- Removed support for hexagonv3 and earlier.
- Added handling of hexagonv55 and hexagonv60.
- Added handling of target features (hvx, hvx-double).
- Updated paths to reflect current directory layout.

llvm-svn: 255502
2015-12-14 15:03:57 +00:00
Carlo Bertolli 6200a3d0f3 Add parse and sema of OpenMP distribute directive with all clauses except dist_schedule
llvm-svn: 255498
2015-12-14 14:51:25 +00:00
Alexey Bataev 33c56402d8 [OPENMP] Fix debug info for 'atomic' construct.
Debug info for statement under 'atomic' construct must point exactly to that statement, not the directive itself.

llvm-svn: 255487
2015-12-14 09:26:19 +00:00
Daniel Jasper 870d1bcdf9 clang-format: Add test for AlignAfterOpenBracket = AlwaysBreak in C++.
Revision 251405 added AlwaysBreak to support Google's JavaScript style. This
changeset complete existing AlignsAfterOpenBracket tests to exercise
AlwaysBreak for C++.

I thought this would be worthwhile.  With this option we can support request
from http://lists.llvm.org/pipermail/cfe-dev/2015-May/042942.html, that had
been requested a few times. This also partially solve related Bug 23422 and is
probably sufficient for most people.

  AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
  BinPackArguments = false;
  BinPackParameters = false;

With these setting we obtain this formatting:

  void fooWithAVeryLongParamList(
      int firstParameter,
      int secondParameter
      int lastParameter)
  {
      object.alsoThisDoenstFitSoIBreakImmidiatly(
          firstParameter,
          secondParameter,
          lastParameter);
  }

Patch by Jean-Philippe Dufraigne, thank you.

llvm-svn: 255486
2015-12-14 08:41:18 +00:00