]> granicus.if.org Git - clang/log
clang
6 years ago[SourceLocations] Use stronger sort predicate to remove non-deterministic ordering
Mandeep Singh Grang [Wed, 29 Nov 2017 20:55:13 +0000 (20:55 +0000)]
[SourceLocations] Use stronger sort predicate to remove non-deterministic ordering

Summary:
This fixes the following failure uncovered by D39245:
  Clang :: Index/getcursor-preamble.m

Reviewers: gbenyei, akyrtzi, bkramer, arphaman

Reviewed By: arphaman

Subscribers: arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D40618

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

6 years ago[clang-cl] Alias /wd4018 to -Wno-sign-compare
Reid Kleckner [Wed, 29 Nov 2017 18:45:03 +0000 (18:45 +0000)]
[clang-cl] Alias /wd4018 to -Wno-sign-compare

This warning is known to be noisy and projects frequently disable it. In
particular, this should make building isl as bundled in polly with
clang-cl a lot quieter.

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

6 years ago[analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true
Devin Coughlin [Wed, 29 Nov 2017 18:25:37 +0000 (18:25 +0000)]
[analyzer] Fix unreachable creating PathDiagnosticLocation with widen-loops=true

In the original design of the analyzer, it was assumed that a BlockEntrance
doesn't create a new binding on the Store, but this assumption isn't true when
'widen-loops' is set to true. Fix this by finding an appropriate location
BlockEntrace program points.

Patch by Henry Wong!

Differential Revision: https://reviews.llvm.org/D37187

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

6 years ago[OPENMP] Do not allow `linear` clauses on non-simd distribute
Alexey Bataev [Wed, 29 Nov 2017 18:20:04 +0000 (18:20 +0000)]
[OPENMP] Do not allow `linear` clauses on non-simd distribute
directives.

`linear` clause is not allowed on non-simd distribute-based directives.

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

6 years ago[Driver] Turns out the GNU assembler does support falkor/saphira.
Chad Rosier [Wed, 29 Nov 2017 16:42:44 +0000 (16:42 +0000)]
[Driver] Turns out the GNU assembler does support falkor/saphira.

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

6 years agoFix function call to fix build
Ismail Donmez [Wed, 29 Nov 2017 15:18:02 +0000 (15:18 +0000)]
Fix function call to fix build

../tools/clang/lib/Driver/ToolChains/Cuda.cpp:80:18: error: reference to non-static member function must be called; did you mean to call it with no arguments?
    if (Distro(D.getVFS).IsDebian())
               ~~^~~~~~
                       ()

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

6 years ago[OPENMP] General improvement of handling of `teams distribute`
Alexey Bataev [Wed, 29 Nov 2017 15:14:16 +0000 (15:14 +0000)]
[OPENMP] General improvement of handling of `teams distribute`
directive, NFC.

Some general improvements in support of `teams distribute` directive.

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

6 years agoFollow up of r319317, add the missing header file
Sylvestre Ledru [Wed, 29 Nov 2017 15:11:53 +0000 (15:11 +0000)]
Follow up of r319317, add the missing header file

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

6 years agoFix 'control reaches end of non-void' warning by using llvm_unreachable.
Manuel Klimek [Wed, 29 Nov 2017 15:09:12 +0000 (15:09 +0000)]
Fix 'control reaches end of non-void' warning by using llvm_unreachable.

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

6 years agoAdd the nvidia-cuda-toolkit Debian package path to search path
Sylvestre Ledru [Wed, 29 Nov 2017 15:03:28 +0000 (15:03 +0000)]
Add the nvidia-cuda-toolkit  Debian package path to search path

Summary:
Reported here:
http://bugs.debian.org/882505

Patch by Andreas Beckmann

Reviewers: Hahnfeld, tra

Reviewed By: tra

Subscribers: jlebar, cfe-commits

Differential Revision: https://reviews.llvm.org/D40453

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

6 years agoRestructure how we break tokens.
Manuel Klimek [Wed, 29 Nov 2017 14:29:43 +0000 (14:29 +0000)]
Restructure how we break tokens.

This fixes some bugs in the reflowing logic and splits out the concerns
of reflowing from BreakableToken.

Things to do after this patch:
- Refactor the breakProtrudingToken function possibly into a class, so we
  can split it up into methods that operate on the common state.
- Optimize whitespace compression when reflowing by using the next possible
  split point instead of the latest possible split point.
- Retry different strategies for reflowing (strictly staying below the
  column limit vs. allowing excess characters if possible).

Differential Revision: https://reviews.llvm.org/D40310

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

6 years agoToolchain: Normalize dwarf, sjlj and seh eh
Martell Malone [Wed, 29 Nov 2017 07:25:12 +0000 (07:25 +0000)]
Toolchain: Normalize dwarf, sjlj and seh eh

This is a re-apply of r319294.

adds -fseh-exceptions and -fdwarf-exceptions flags

clang will check if the user has specified an exception model flag,
in the absense of specifying the exception model clang will then check
the driver default and append the model flag for that target to cc1

-fno-exceptions has a higher priority then specifying the model

move __SEH__ macro definitions out of Targets into InitPreprocessor
behind the -fseh-exceptions flag

move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into
InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check

remove unused USESEHExceptions from the MinGW Driver

fold USESjLjExceptions into a new GetExceptionModel function that
gives the toolchain classes more flexibility with eh models

Reviewers: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D39673

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

6 years agoRevert "Toolchain: Normalize dwarf, sjlj and seh eh"
Martell Malone [Wed, 29 Nov 2017 06:51:27 +0000 (06:51 +0000)]
Revert "Toolchain: Normalize dwarf, sjlj and seh eh"

This reverts rL319294.
The windows sanitizer does not like seh on x86.
Will re apply with None type for x86

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

6 years agoToolchain: Normalize dwarf, sjlj and seh eh
Martell Malone [Wed, 29 Nov 2017 06:25:13 +0000 (06:25 +0000)]
Toolchain: Normalize dwarf, sjlj and seh eh

adds -fseh-exceptions and -fdwarf-exceptions flags

clang will check if the user has specified an exception model flag,
in the absense of specifying the exception model clang will then check
the driver default and append the model flag for that target to cc1

clang cc1 assumes dwarf is the default if none is passed
and -fno-exceptions has a higher priority then specifying the model

move __SEH__ macro definitions out of Targets into InitPreprocessor
behind the -fseh-exceptions flag

move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into
InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check

remove unused USESEHExceptions from the MinGW Driver

fold USESjLjExceptions into a new GetExceptionModel function that
gives the toolchain classes more flexibility with eh models

Reviewers: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D39673

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

6 years agoUse static function instead of anonymous namespace
Serge Pavlov [Wed, 29 Nov 2017 05:10:11 +0000 (05:10 +0000)]
Use static function instead of anonymous namespace

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

6 years agoReland "Fix vtable not receiving hidden visibility when using push(visibility)"
Jake Ehrlich [Wed, 29 Nov 2017 00:54:20 +0000 (00:54 +0000)]
Reland "Fix vtable not receiving hidden visibility when using push(visibility)"

I had to reland this change in order to make the test work on windows

This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022

https://reviews.llvm.org/D39627

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

6 years ago[CMake] Support side-by-side checkouts in multi-stage build
Petr Hosek [Wed, 29 Nov 2017 00:34:46 +0000 (00:34 +0000)]
[CMake] Support side-by-side checkouts in multi-stage build

Passthrough LLVM_ENABLE_{PROJECTS,RUNTIMES} to followup stages to
support the side-by-side checkouts (aka monorepo layout).

Differential Revision: https://reviews.llvm.org/D40258

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

6 years ago[CMake] Use LIST_SEPARATOR rather than escaping in ExternalProject_Add
Petr Hosek [Wed, 29 Nov 2017 00:23:10 +0000 (00:23 +0000)]
[CMake] Use LIST_SEPARATOR rather than escaping in ExternalProject_Add

Escaping ; in list arguments passed to ExternalProject_Add doesn't seem
to be working in newer versions of CMake (see
https://public.kitware.com/Bug/view.php?id=16137 for more details). Use
a custom LIST_SEPARATOR instead which is the officially supported way.

Differential Revision: https://reviews.llvm.org/D40257

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

6 years ago[OPENMP] Generalize capturing of clauses expressions.
Alexey Bataev [Tue, 28 Nov 2017 21:11:44 +0000 (21:11 +0000)]
[OPENMP] Generalize capturing of clauses expressions.

The handling and capturing of the non-constant expressions of some of
the capturable clauses in combined directives is generalized.

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

6 years ago[OpenMP] Stable sort Privates to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 20:41:13 +0000 (20:41 +0000)]
[OpenMP] Stable sort Privates to remove non-deterministic ordering

Summary:
This fixes the following failures uncovered by D39245:
    Clang :: OpenMP/task_firstprivate_codegen.cpp
    Clang :: OpenMP/task_private_codegen.cpp
    Clang :: OpenMP/taskloop_firstprivate_codegen.cpp
    Clang :: OpenMP/taskloop_lastprivate_codegen.cpp
    Clang :: OpenMP/taskloop_private_codegen.cpp
    Clang :: OpenMP/taskloop_simd_firstprivate_codegen.cpp
    Clang :: OpenMP/taskloop_simd_lastprivate_codegen.cpp
    Clang :: OpenMP/taskloop_simd_private_codegen.cpp

Reviewers: rjmccall, ABataev, AndreyChurbanov

Reviewed By: rjmccall, ABataev

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D39947

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

6 years ago[CUDA] Report "unsupported VLA" errors only on device side.
Artem Belevich [Tue, 28 Nov 2017 18:51:42 +0000 (18:51 +0000)]
[CUDA] Report "unsupported VLA" errors only on device side.

This fixes erroneously reported CUDA compilation errors
in host-side code during device-side compilation.

I've also restricted OpenMP-specific checks to trigger only
if we're compiling with OpenMP enabled.

Differential Revision: https://reviews.llvm.org/D40275

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

6 years ago[Target] Make a copy of TargetOptions feature list before sorting during CodeGen
Craig Topper [Tue, 28 Nov 2017 18:00:32 +0000 (18:00 +0000)]
[Target] Make a copy of TargetOptions feature list before sorting during CodeGen

Currently CodeGen is calling std::sort on the features vector in TargetOptions for every function, but I don't think CodeGen should be modifying TargetOptions.

Differential Revision: https://reviews.llvm.org/D40228

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

6 years agoRefactor functions PrintTemplateArgumentList
Serge Pavlov [Tue, 28 Nov 2017 16:14:14 +0000 (16:14 +0000)]
Refactor functions PrintTemplateArgumentList

These functions were defined as static members of TemplateSpecializationType.
Now they are moved to namespace level. Previously there were different
implementations for lists containing TemplateArgument and TemplateArgumentLoc,
now these implementations share the same code.

This change is a result of refactoring patch D40508. NFC.

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

6 years ago[test] Fix a typo in a test comment. NFC.
Martin Storsjo [Tue, 28 Nov 2017 05:47:24 +0000 (05:47 +0000)]
[test] Fix a typo in a test comment. NFC.

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

6 years ago[WebAssembly] Add options for using the nontrapping-fptoint feature.
Dan Gohman [Tue, 28 Nov 2017 01:13:45 +0000 (01:13 +0000)]
[WebAssembly] Add options for using the nontrapping-fptoint feature.

This adds ways to control use of WebAssembly's new nontrapping-fptoint
feature.

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

6 years ago[clang-cl] Alias /Wall to -Weverything
Reid Kleckner [Mon, 27 Nov 2017 23:42:20 +0000 (23:42 +0000)]
[clang-cl] Alias /Wall to -Weverything

cl interprets this option to mean enable every supported warning, which
is what Clang's -Weverything flag does.

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

6 years ago[WebAssemby] Enable "-mthread-model single" by default, for now.
Dan Gohman [Mon, 27 Nov 2017 21:39:16 +0000 (21:39 +0000)]
[WebAssemby] Enable "-mthread-model single" by default, for now.

The WebAssembly standard does not yet have threads, and while it's in the
process of being standardized, it'll take some time for it to make it
through and be available in all popular implementations. With increasing
numbers of people using the LLVM wasm backend through LLVM directly rather
than through Emscripten, it's increasingly important to have friendly
defaults.

See also https://bugs.llvm.org/show_bug.cgi?id=35411

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

6 years ago[CMake][Fuchsia] Disable terminfo database in Fuchsia toolchain
Petr Hosek [Mon, 27 Nov 2017 20:29:13 +0000 (20:29 +0000)]
[CMake][Fuchsia] Disable terminfo database in Fuchsia toolchain

It's used to determine whether terminal supports colors, but within LLVM
it's only used in handful of places and in Clang it's only used in AST
dumper, otherwise Clang relies on the -fcolor-diagnostics flag which we
pass explicitly from our build system anyway. This eliminates one of the
shared libraries dependencies making the toolchain less reliant on the
host environment.

Differential Revision: https://reviews.llvm.org/D40329

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

6 years ago[OPENMP] Codegen for `distribute parallel for simd` directive.
Alexey Bataev [Mon, 27 Nov 2017 19:38:58 +0000 (19:38 +0000)]
[OPENMP] Codegen for `distribute parallel for simd` directive.

Initial codegen for `#pragma omp distribute parallel for simd` directive
and its clauses.

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

6 years ago[OPENMP] Codegen for `distribute parallel for simd` directive.
Alexey Bataev [Mon, 27 Nov 2017 19:38:52 +0000 (19:38 +0000)]
[OPENMP] Codegen for `distribute parallel for simd` directive.

Added proper codegen for `distribute parallel for simd` directive.

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

6 years agoSwitch CPU names not recognized by GNU assembler
Pirama Arumuga Nainar [Mon, 27 Nov 2017 19:18:39 +0000 (19:18 +0000)]
Switch CPU names not recognized by GNU assembler

Summary:
Switch CPU names not recognized by GNU assembler to a close CPU that it
does recognize.  In this patch, kryo, falkor and saphira all get
replaced by cortex-a57 when invoking the assembler.  In addition, krait
was already being replaced by cortex-a15.

Reviewers: weimingz

Subscribers: srhines, cfe-commits

Differential Revision: https://reviews.llvm.org/D40476

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

6 years ago[analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor.
Artem Dergachev [Mon, 27 Nov 2017 17:37:09 +0000 (17:37 +0000)]
[analyzer] pr34766: Fix a crash on explicit std::initializer_list constructor.

We didn't support the following syntax:

  (std::initializer_list<int>){12}

which suddenly produces CompoundLiteralExpr that contains
CXXStdInitializerListExpr.

Lift the assertion and instead pass the value through CompoundLiteralExpr
transparently, as it doesn't add much.

Differential Revision: https://reviews.llvm.org/D39803

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

6 years ago[analyzer] pr34404: Fix a crash on modeling pointers to indirect members.
Artem Dergachev [Mon, 27 Nov 2017 17:31:16 +0000 (17:31 +0000)]
[analyzer] pr34404: Fix a crash on modeling pointers to indirect members.

We were crashing whenever a C++ pointer-to-member was taken, that was pointing
to a member of an anonymous structure field within a class, eg.

  struct A {
    struct {
     int x;
    };
  };
  // ...
  &A::x;

Differential Revision: https://reviews.llvm.org/D39800

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

6 years ago[clang] Set up .arcconfig to point to new Diffusion C repository
Ben Hamilton [Mon, 27 Nov 2017 17:21:24 +0000 (17:21 +0000)]
[clang] Set up .arcconfig to point to new Diffusion C repository

Summary:
We want to automatically copy cfe-commits@ on review requests
to the clang repository.

Similar to D40179, I set up a new Diffusion repository with callsign
"C" for clang:

https://reviews.llvm.org/source/clang/

This explicitly updates clang's .arcconfig to point to the new C
repository in Diffusion, which will let us use Herald rule H268.

Reviewers: klimek, sammccall

Reviewed By: klimek

Subscribers: dlj, bkramer

Differential Revision: https://reviews.llvm.org/D40494

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

6 years ago[OPENMP] Improve handling of cancel directives in target-based
Alexey Bataev [Mon, 27 Nov 2017 16:54:08 +0000 (16:54 +0000)]
[OPENMP] Improve handling of cancel directives in target-based
constructs, NFC.

Improved handling of cancel|cancellation point directives inside
target-based for directives.

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

6 years agoConstify. NFC.
Vassil Vassilev [Mon, 27 Nov 2017 15:32:00 +0000 (15:32 +0000)]
Constify. NFC.

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

6 years ago[lit] Set shlibpath_var on Solaris
Fedor Sergeev [Mon, 27 Nov 2017 13:33:19 +0000 (13:33 +0000)]
[lit] Set shlibpath_var on Solaris

Summary:
During make check-all on Solaris, lit complains

llvm-lit: /vol/gcc/src/llvm/llvm/dist/tools/clang/test/Unit/lit.cfg.py:57: warning: unable to inject shared library path on 'SunOS'

The following patch avoids this: Solaris uses LD_LIBRARY_PATH like several other targets.

In theory, one could also handle LD_LIBRARY_PATH_{32,64} which take precedence over
LD_LIBRARY_PATH if set, but let's cross that bridge when we get there.

Patch by Rainer Orth.

Reviewers: rsmith, lichray
Reviewed By: lichray

Differential Revision: https://reviews.llvm.org/D39640

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

6 years ago[clang-format] Add option to group multiple #include blocks when sorting includes
Krasimir Georgiev [Mon, 27 Nov 2017 13:23:45 +0000 (13:23 +0000)]
[clang-format] Add option to group multiple #include blocks when sorting includes

Summary:
This patch allows grouping multiple #include blocks together and sort all includes as one big block.
Additionally, sorted includes can be regrouped after sorting based on configured categories.

Contributed by @KrzysztofKapusta!

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D40288

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

6 years ago[ASTImporter] Support importing CXXPseudoDestructorExpr
Aleksei Sidorin [Mon, 27 Nov 2017 10:30:00 +0000 (10:30 +0000)]
[ASTImporter] Support importing CXXPseudoDestructorExpr

Patch by Peter Szecsi!

Differential Revision: https://reviews.llvm.org/D38843

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

6 years ago[CodeGen] Collect information about sizes of accesses and access types for TBAA
Ivan A. Kosarev [Mon, 27 Nov 2017 09:39:29 +0000 (09:39 +0000)]
[CodeGen] Collect information about sizes of accesses and access types for TBAA

The information about access and type sizes is necessary for
producing TBAA metadata in the new size-aware format. With this
patch, D39955 and D39956 in place we should be able to change
CodeGenTBAA::createScalarTypeNode() and
CodeGenTBAA::getBaseTypeInfo() to generate metadata in the new
format under the -new-struct-path-tbaa command-line option. For
now, this new information remains unused.

Differential Revision: https://reviews.llvm.org/D40176

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

6 years ago[OpenCL] Add extensions cl_intel_subgroups and cl_intel_subgroups_short
Alexey Sotkin [Mon, 27 Nov 2017 09:14:17 +0000 (09:14 +0000)]
[OpenCL] Add extensions cl_intel_subgroups and cl_intel_subgroups_short

Reviewers: yaxunl, Anastasia, bader

Reviewed By: Anastasia, bader

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D39936

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

6 years agoEnable additonal features in NetBSD
Kamil Rytarowski [Sun, 26 Nov 2017 22:24:22 +0000 (22:24 +0000)]
Enable additonal features in NetBSD

Summary:
Enable for x86_64:

 - ESan,
 - KASan,
 - MSan.

Enable for x86_64 and i386:

 - Scudo.

These features are under active development and in various level of completeness.

Sponsored by <The NetBSD Foundation>

Reviewers: dvyukov, joerg, vitalybuka, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D40456

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

6 years agoDetermine the attribute subject for diagnostics based on declarative information...
Aaron Ballman [Sun, 26 Nov 2017 20:01:12 +0000 (20:01 +0000)]
Determine the attribute subject for diagnostics based on declarative information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing.

This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc).

Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute).

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

6 years ago[ASTImporter] Support TypeTraitExpr
Aleksei Sidorin [Sun, 26 Nov 2017 17:04:06 +0000 (17:04 +0000)]
[ASTImporter] Support TypeTraitExpr

Patch by Takafumi Kubota!

Differential Revision: https://reviews.llvm.org/D39722

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

6 years agoControl-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking suppo...
Oren Ben Simhon [Sun, 26 Nov 2017 12:34:54 +0000 (12:34 +0000)]
Control-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking support (Clang side)

Shadow stack solution introduces a new stack for return addresses only.
The stack has a Shadow Stack Pointer (SSP) that points to the last address to which we expect to return.
If we return to a different address an exception is triggered.
This patch includes shadow stack intrinsics as well as the corresponding CET header.
It includes CET clang flags for shadow stack and Indirect Branch Tracking.

For more information, please see the following:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

Differential Revision: https://reviews.llvm.org/D40224

Change-Id: I79ad0925a028bbc94c8ecad75f6daa2f214171f1

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

6 years ago[X86] Use separate builtins for fma4 scalar intrinsics. Use negations to remove some...
Craig Topper [Sat, 25 Nov 2017 19:32:12 +0000 (19:32 +0000)]
[X86] Use separate builtins for fma4 scalar intrinsics. Use negations to remove some of the scalar fma3 builtins.

fma4 instructions zero the upper bits of the xmm register. fma3 instructions leave the bits unmodified. This requires separate builtins for the different semantics.

While we're cleaning up the scalar builtins this also removes the fma3 fmsub/fnmadd/fnmsub builtins by using negates in the header file.

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

6 years ago[analyzer] Teach RetainCountChecker about CoreMedia APIs
Devin Coughlin [Sat, 25 Nov 2017 14:57:42 +0000 (14:57 +0000)]
[analyzer] Teach RetainCountChecker about CoreMedia APIs

Teach the retain-count checker that CoreMedia reference types use
CoreFoundation-style reference counting. This enables the checker
to catch leaks and over releases of those types.

rdar://problem/33599757

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

6 years agoclang-format: [JS] do not collapse short classes.
Martin Probst [Sat, 25 Nov 2017 09:35:33 +0000 (09:35 +0000)]
clang-format: [JS] do not collapse short classes.

Summary:
clang-format does not collapse short records, interfaces, unions, etc.,
but fails to do so if the record is preceded by certain modifiers
(export, default, abstract, declare). This change skips over all
modifiers, and thus handles all record definitions uniformly.

Before:
    export class Foo { bar: string; }
    class Baz {
      bam: string;
    }

After:
    export class Foo {
      bar: string;
    }
    class Baz {
      bam: string;
    }

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40430

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

6 years agoclang-format: [JS] handle semis in generic types.
Martin Probst [Sat, 25 Nov 2017 09:33:47 +0000 (09:33 +0000)]
clang-format: [JS] handle semis in generic types.

Summary:
TypeScript generic type arguments can contain object (literal) types,
which in turn can contain semicolons:

    const x: Array<{a: number; b: string;} = [];

Previously, clang-format would incorrectly categorize the braced list as
a block and terminate the line at the openening `{`, and then format the
entire expression badly.

With this change, clang-format recognizes `<` preceding a `{` as
introducing a type expression. In JS, `<` comparison with an object
literal can never be true, so the chance of introducing false positives
here is very low.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D40424

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

6 years agoclang-format: [JS] handle `for` as object label.
Martin Probst [Sat, 25 Nov 2017 09:24:33 +0000 (09:24 +0000)]
clang-format: [JS] handle `for` as object label.

Summary: Previously, clang-format would fail formatting `{for: 1}`.

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40441

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

6 years agoclang-format: [JS] disable ASI on decorators.
Martin Probst [Sat, 25 Nov 2017 09:19:42 +0000 (09:19 +0000)]
clang-format: [JS] disable ASI on decorators.

Summary:
Automatic Semicolon Insertion in clang-format tries to guess if a line
wrap should insert an implicit semicolong. The previous heuristic would
not trigger ASI if a token was immediately preceded by an `@` sign:

    function foo(@Bar  // <-- does not trigger due to preceding @
                baz) {}

However decorators can have arbitrary parameters:

    function foo(@Bar(param, param, param)  // <-- precending @ missed
                baz) {}

While it would be possible to precisely find the matching `@`, just
conversatively disabling ASI for the entire line is simpler, while also
not regressing ASI substatially.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D40410

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

6 years ago[clang-format] Deduplicate using declarations
Krasimir Georgiev [Fri, 24 Nov 2017 18:00:01 +0000 (18:00 +0000)]
[clang-format] Deduplicate using declarations

Summary: This deduplicated equivalent using declarations within a block.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D40435

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

6 years agoclang-format: [JS] do not break in ArrayType[].
Martin Probst [Fri, 24 Nov 2017 17:05:56 +0000 (17:05 +0000)]
clang-format: [JS] do not break in ArrayType[].

Summary:
Wrapping between the type name and the array type indicator creates
invalid syntax in TypeScript.

Before:
    const xIsALongIdent:
        YJustBarelyFitsLinex
            [];  // illegal syntax.

After:
    const xIsALongIdent:
        YJustBarelyFitsLinex[];

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40436

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

6 years agoclang-format: [JS] do not wrap before yield.
Martin Probst [Fri, 24 Nov 2017 17:05:35 +0000 (17:05 +0000)]
clang-format: [JS] do not wrap before yield.

Summary: The same rules apply as for `return`.

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40431

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

6 years agoclang-format: [JS] space between ! assert and in.
Martin Probst [Fri, 24 Nov 2017 17:04:40 +0000 (17:04 +0000)]
clang-format: [JS] space between ! assert and in.

Summary:
Before:
    x = y!in z;
After:
    x = y! in z;

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40433

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

6 years agoAvoid copying the data of in-memory preambles
Ilya Biryukov [Fri, 24 Nov 2017 13:12:38 +0000 (13:12 +0000)]
Avoid copying the data of in-memory preambles

Summary: Preambles are large and we should avoid copying them.

Reviewers: bkramer, klimek

Reviewed By: bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D40302

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

6 years ago[Tooling] Acknowledge that many CompilationDatabases don't support enumeration.
Sam McCall [Fri, 24 Nov 2017 12:13:55 +0000 (12:13 +0000)]
[Tooling] Acknowledge that many CompilationDatabases don't support enumeration.

Summary: Provide default implementations so that only getCompileCommands() is mandatory.

Reviewers: ioeric

Subscribers: cfe-commits, bkramer, klimek

Differential Revision: https://reviews.llvm.org/D40409

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

6 years agoclang-format: [JS] handle destructuring `of`.
Martin Probst [Fri, 24 Nov 2017 10:48:25 +0000 (10:48 +0000)]
clang-format: [JS] handle destructuring `of`.

Summary:
Previously, clang-format would drop a space character between `of` and
then following (non-identifier) token if the preceding token was part of
a destructuring assignment (`}` or `]`).

Before:
    for (const [a, b] of[]) {}

After:
    for (const [a, b] of []) {}

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40411

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

6 years ago[ASTMatchers] Matchers for new[] operators
Adam Balogh [Thu, 23 Nov 2017 12:43:20 +0000 (12:43 +0000)]
[ASTMatchers] Matchers for new[] operators

Two new matchers for `CXXNewExpr` are added which may be useful e.g. in
`clang-tidy` checkers. One of them is `isArray` which matches `new[]` but not
plain `new`. The other one, `hasArraySize` matches `new[]` for a given size.

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

6 years agoDo not perform the analysis based warning if the warnings are ignored
Olivier Goffart [Thu, 23 Nov 2017 08:15:22 +0000 (08:15 +0000)]
Do not perform the analysis based warning if the warnings are ignored

This saves some cycles when compiling with "-w".

(Also fix a potential crash on invalid code for tools that tries to recover from some
errors, because analysis might compute the CFG which crashes if the code contains
invalid declaration. This does not happen normally with because we also don't perform
these analysis if there was an error.)

Differential Revision: https://reviews.llvm.org/D40242

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

6 years ago[DeclPrinter] Allow printing fully qualified name of function declaration
Serge Pavlov [Thu, 23 Nov 2017 05:38:20 +0000 (05:38 +0000)]
[DeclPrinter] Allow printing fully qualified name of function declaration

When requesting a tooltip for a function call in an IDE, the fully
qualified name helps to remove ambiguity in the function signature.

Patch by Nikolai Kosjar!

Differential Revision: https://reviews.llvm.org/D40013

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Thu, 23 Nov 2017 01:20:07 +0000 (01:20 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 22 Nov 2017 21:32:07 +0000 (21:32 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[OPENMP] Add support for cancel constructs in `target teams distribute
Alexey Bataev [Wed, 22 Nov 2017 21:12:03 +0000 (21:12 +0000)]
[OPENMP] Add support for cancel constructs in `target teams distribute
parallel for`.

Add support for cancel/cancellation point directives inside `target
teams distribute parallel for` directives.

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

6 years ago[OPENMP] Add support for cancel constructs in [teams] distribute
Alexey Bataev [Wed, 22 Nov 2017 20:19:50 +0000 (20:19 +0000)]
[OPENMP] Add support for cancel constructs in [teams] distribute
parallel for directives.

Added codegen/sema support for cancel constructs in [teams] distribute
parallel for directives.

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

6 years agoRevert "[CodeGen] Fix vtable not receiving hidden visibility when using push(visibility)"
Petr Hosek [Wed, 22 Nov 2017 19:50:17 +0000 (19:50 +0000)]
Revert "[CodeGen] Fix vtable not receiving hidden visibility when using push(visibility)"

This reverts commit r318853: tests are failing on Windows bots

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

6 years ago[OPENMP] Added missed checks for for [simd] based directives.
Alexey Bataev [Wed, 22 Nov 2017 18:34:02 +0000 (18:34 +0000)]
[OPENMP] Added missed checks for for [simd] based directives.

Added missed checks/analysis for safelen/simdlen clauses + linear clause
in for [simd] based directives.

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

6 years agoCachePruning: Allow limiting the number of files in the cache directory.
Peter Collingbourne [Wed, 22 Nov 2017 18:27:31 +0000 (18:27 +0000)]
CachePruning: Allow limiting the number of files in the cache directory.

The default limit is 1000000 but it can be configured with a cache
policy. The motivation is that some filesystems (notably ext4) have
a limit on the number of files that can be contained in a directory
(separate from the inode limit).

Differential Revision: https://reviews.llvm.org/D40327

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

6 years ago[CodeGen] Fix vtable not receiving hidden visibility when using push(visibility)
Petr Hosek [Wed, 22 Nov 2017 17:59:30 +0000 (17:59 +0000)]
[CodeGen] Fix vtable not receiving hidden visibility when using push(visibility)

This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D39627

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

6 years ago[OPENMP] General improvement of code, NFC.
Alexey Bataev [Wed, 22 Nov 2017 17:19:31 +0000 (17:19 +0000)]
[OPENMP] General improvement of code, NFC.

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

6 years ago[OPENMP] Do not mark captured variables as artificial in debug info.
Alexey Bataev [Wed, 22 Nov 2017 16:02:03 +0000 (16:02 +0000)]
[OPENMP] Do not mark captured variables as artificial in debug info.

Captured variables should not be marked as artificial parameters in
outlined functions in debug info.

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

6 years ago[OpenMP] Adjust arguments of nvptx runtime functions
Jonas Hahnfeld [Wed, 22 Nov 2017 14:46:49 +0000 (14:46 +0000)]
[OpenMP] Adjust arguments of nvptx runtime functions

In the future the compiler will analyze whether the OpenMP
runtime needs to be (fully) initialized and avoid that overhead
if possible. The functions already take an argument to transfer
that information to the runtime, so pass in the default value 1.
(This is needed for binary compatibility with libomptarget-nvptx
currently being upstreamed.)

Differential Revision: https://reviews.llvm.org/D40354

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

6 years ago[OPENMP] Codegen for `target teams` directive.
Alexey Bataev [Wed, 22 Nov 2017 14:25:55 +0000 (14:25 +0000)]
[OPENMP] Codegen for `target teams` directive.

Added codegen of the clauses for `target teams` directive.

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

6 years ago[Docs] Update list of languages clang-format can format
Malcolm Parsons [Wed, 22 Nov 2017 10:47:35 +0000 (10:47 +0000)]
[Docs] Update list of languages clang-format can format

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

6 years ago[Driver] Make the use of relax relocations a per target option
Petr Hosek [Wed, 22 Nov 2017 01:38:31 +0000 (01:38 +0000)]
[Driver] Make the use of relax relocations a per target option

The support for relax relocations is dependent on the linker and
different toolchains within the same compiler can be using different
linkers some of which may or may not support relax relocations.

Give toolchains the option to control whether they want to use relax
relocations in addition to the existing (global) build system option.

Differential Revision: https://reviews.llvm.org/D39831

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

6 years ago[X86] Update CPUSupports code to reuse LLVM .def file [NFC]
Erich Keane [Wed, 22 Nov 2017 00:54:01 +0000 (00:54 +0000)]
[X86] Update CPUSupports code to reuse LLVM .def file [NFC]

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Tue, 21 Nov 2017 23:26:08 +0000 (23:26 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[OpenMP] Fix tests after r318789
Richard Trieu [Tue, 21 Nov 2017 22:53:19 +0000 (22:53 +0000)]
[OpenMP] Fix tests after r318789

Update use of __tgt_target that had some 32bit types updated to 64bit.

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

6 years agoAvoid unecessary opsize byte in segment move to memory
Nirav Dave [Tue, 21 Nov 2017 19:28:13 +0000 (19:28 +0000)]
Avoid unecessary opsize byte in segment move to memory

Segment moves to memory are always 16-bit. Remove invalid 32 and 64
bit variants.

Recommiting with missing clang inline assembly test change.

Fixes PR34478.

Reviewers: rnk, craig.topper

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D39847

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

6 years agoThe offsetof macro is intended to work with subobjects rather than simple identifiers...
Aaron Ballman [Tue, 21 Nov 2017 19:25:38 +0000 (19:25 +0000)]
The offsetof macro is intended to work with subobjects rather than simple identifiers designating a member, making the -Wextended-offsetof diagnostic obsolete as this construct is not an extension. Implements WG14 DR496.

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

6 years agoAdd an AST matcher for hasDefaultArgument() to match on parameter declarations that...
Aaron Ballman [Tue, 21 Nov 2017 19:22:34 +0000 (19:22 +0000)]
Add an AST matcher for hasDefaultArgument() to match on parameter declarations that have a default value.

Patch by Julie Hockett.

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

6 years ago[Clang][OpenMP] New clang/libomptarget map interface: new function signatures, clang...
George Rokos [Tue, 21 Nov 2017 18:25:12 +0000 (18:25 +0000)]
[Clang][OpenMP] New clang/libomptarget map interface: new function signatures, clang-side

This clang patch changes the __tgt_* API function signatures in preparation for the new map interface.
Changes are: Device IDs 32bits --> 64bits, Flags 32bits --> 64bits

Differential revision: https://reviews.llvm.org/D40281

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

6 years agoAdd -finstrument-function-entry-bare flag
Hans Wennborg [Tue, 21 Nov 2017 17:30:34 +0000 (17:30 +0000)]
Add -finstrument-function-entry-bare flag

This is an instrumentation flag that's similar to
-finstrument-functions, but it only inserts calls on function entry, the
calls are inserted post-inlining, and they don't take any arugments.

This is intended for users who want to instrument function entry with
minimal overhead.

(-pg would be another alternative, but forces frame pointer emission and
affects link flags, so is probably best left alone to be used for
generating gcov data.)

Differential revision: https://reviews.llvm.org/D40276

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

6 years ago[OPENMP] Initial support for asynchronous data update, NFC.
Alexey Bataev [Tue, 21 Nov 2017 17:08:48 +0000 (17:08 +0000)]
[OPENMP] Initial support for asynchronous data update, NFC.

OpenMP 5.0 introduces asynchronous data update/dependecies clauses on
target data directives. Patch adds initial support for outer task
regions to use task-based codegen for future async target data
directives.

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

6 years agoFix test/OpenMP/nvptx_data_sharing.cpp
Jonas Hahnfeld [Tue, 21 Nov 2017 16:49:11 +0000 (16:49 +0000)]
Fix test/OpenMP/nvptx_data_sharing.cpp

This was an oversight that stayed in the test from development.

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

6 years ago[ASTImporter] Support new AST nodes:
Aleksei Sidorin [Tue, 21 Nov 2017 16:08:41 +0000 (16:08 +0000)]
[ASTImporter] Support new AST nodes:

 * UnresolvedUsingType
 * EmptyDecl
 * NamespaceAliasDecl
 * UsingDecl
 * UsingShadowDecl
 * UsingDirectiveDecl
 * UnresolvedUsingValueDecl
 * UnresolvedUsingTypenameDecl

Refactor error handling in ImportTemplateArgumentLoc() method.
Add a test for inline namespaces.

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

6 years ago[OpenMP] Add implicit data sharing support when offloading to NVIDIA GPUs using OpenM...
Gheorghe-Teodor Bercea [Tue, 21 Nov 2017 15:54:54 +0000 (15:54 +0000)]
[OpenMP] Add implicit data sharing support when offloading to NVIDIA GPUs using OpenMP device offloading

Summary:
This patch is part of the development effort to add support in the current OpenMP GPU offloading implementation for implicitly sharing variables between a target region executed by the team master thread and the worker threads within that team.

This patch is the first of three required for successfully performing the implicit sharing of master thread variables with the worker threads within a team. The remaining two patches are:
- Patch D38978 to the LLVM NVPTX backend which ensures the lowering of shared variables to an device memory which allows the sharing of references;
- Patch (coming soon) is a patch to libomptarget runtime library which ensures that a list of references to shared variables is properly maintained.

A simple code snippet which illustrates an implicit data sharing situation is as follows:

```
#pragma omp target
{
   // master thread only
   int v;
   #pragma omp parallel
   {
      // worker threads
      // use v
   }
}
```

Variable v is implicitly shared from the team master thread which executes the code in between the target and parallel directives. The worker threads must operate on the latest version of v, including any updates performed by the master.

The code generated in this patch relies on the LLVM NVPTX patch (mentioned above) which prevents v from being lowered in the thread local memory of the master thread thus making the reference to this variable un-shareable with the workers. This ensures that the code generated by this patch is correct.
Since the parallel region is outlined the passing of arguments to the outlined regions must preserve the original order of arguments. The runtime therefore maintains a list of references to shared variables thus ensuring their passing in the correct order. The passing of arguments to the outlined parallel function is performed in a separate function which the data sharing infrastructure constructs in this patch. The function is inlined when optimizations are enabled.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, Hahnfeld, ABataev, caomhin

Reviewed By: ABataev

Subscribers: cfe-commits, jholewinski

Differential Revision: https://reviews.llvm.org/D38976

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

6 years agoAdd target triples to openmp-offload-gpu.c
Jonas Hahnfeld [Tue, 21 Nov 2017 15:06:28 +0000 (15:06 +0000)]
Add target triples to openmp-offload-gpu.c

This might fix the failure on Green Dragon.

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

6 years ago[OpenMP] Consistently use cubin extension for nvlink
Jonas Hahnfeld [Tue, 21 Nov 2017 14:44:45 +0000 (14:44 +0000)]
[OpenMP] Consistently use cubin extension for nvlink

This was previously done in some places, but for example not for
bundling so that single object compilation with -c failed. In
addition cubin was used for all file types during unbundling which
is incorrect for assembly files that are passed to ptxas.
Tighten up the tests so that we can't regress in that area.

Differential Revision: https://reviews.llvm.org/D40250

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

6 years ago[MINGW] normalize WIN32 macros
Martell Malone [Tue, 21 Nov 2017 11:28:29 +0000 (11:28 +0000)]
[MINGW] normalize WIN32 macros

move _WIN64 and _WIN32 defines to lib/Basic/Targets/OSTargets.h
move WIN32, WIN64 and __MINGW64__ to addMinGWDefines

fixes __MINGW64__ not being defined for aarch64
adds WIN32 definition for x64

Reviewers: mstorsjo

Differential Revision: https://reviews.llvm.org/D40285

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

6 years ago[Analyzer] Stable iteration on indirect goto LabelDecl's to avoid non-determinism...
Aleksei Sidorin [Tue, 21 Nov 2017 11:27:47 +0000 (11:27 +0000)]
[Analyzer] Stable iteration on indirect goto LabelDecl's to avoid non-determinism (attempt 2)

CFG wass built in non-deterministic order due to the fact that indirect
goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet
container. LabelDecl's are pointers, whose order is not deterministic,
and llvm::SmallSet sorts them by their non-deterministic addresses after
"small" container is exceeded. This leads to non-deterministic processing
of the elements of the container.

The fix is to use llvm::SmallSetVector that was designed to have
deterministic iteration order.

Patch by Ilya Palachev!

Differential Revision: https://reviews.llvm.org/D40073

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

6 years ago[Analyzer] Revert r318750 because incorrect files were added for commit.
Aleksei Sidorin [Tue, 21 Nov 2017 11:20:07 +0000 (11:20 +0000)]
[Analyzer] Revert r318750 because incorrect files were added for commit.

Sorry for the noise.

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

6 years ago[CodeGen] Generate TBAA type descriptors in a more reliable manner
Ivan A. Kosarev [Tue, 21 Nov 2017 11:18:06 +0000 (11:18 +0000)]
[CodeGen] Generate TBAA type descriptors in a more reliable manner

This patch introduces a couple of helper functions that make it
possible to handle the caching logic in a single place.

Differential Revision: https://reviews.llvm.org/D39953

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

6 years ago[Analyzer] Non-determinism: stable iteration on indirect goto LabelDecl's
Aleksei Sidorin [Tue, 21 Nov 2017 11:05:28 +0000 (11:05 +0000)]
[Analyzer] Non-determinism: stable iteration on indirect goto LabelDecl's

CFG wass built in non-deterministic order due to the fact that indirect
goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet
container. LabelDecl's are pointers, whose order is not deterministic,
and llvm::SmallSet sorts them by their non-deterministic addresses after
"small" container is exceeded. This leads to non-deterministic processing
of the elements of the container.

The fix is to use llvm::SmallSetVector that was designed to have
deterministic iteration order.

Patch by Ilya Palachev!

Differential Revision: https://reviews.llvm.org/D40073

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

6 years ago[Modules TS] Added module re-export support.
Hamza Sood [Tue, 21 Nov 2017 09:42:42 +0000 (09:42 +0000)]
[Modules TS] Added module re-export support.

This implements [dcl.modules.export] from the C++ Modules TS, which lets a module re-export another module with the "export import" syntax.
Differential Revision: https://reviews.llvm.org/D40270

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

6 years ago[x86][inline-asm] allow recognition of MPX regs inside ms inline-asm blob
Coby Tayree [Tue, 21 Nov 2017 08:50:10 +0000 (08:50 +0000)]
[x86][inline-asm] allow recognition of MPX regs inside ms inline-asm blob
Differential Revision: https://reviews.llvm.org/D38445

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

6 years ago[MS] add an init test for thumbv7-windows-msvc
Martell Malone [Tue, 21 Nov 2017 08:09:59 +0000 (08:09 +0000)]
[MS] add an init test for thumbv7-windows-msvc

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

6 years ago[MS] Increase default new alignment for win64 and test it
Reid Kleckner [Tue, 21 Nov 2017 01:25:56 +0000 (01:25 +0000)]
[MS] Increase default new alignment for win64 and test it

Summary:
This raises __STDCPP_DEFAULT_NEW_ALIGNMENT__ from 8 to 16 on Win64.
This matches platforms that follow the usual `2 * sizeof(void*)`
alignment requirement for malloc. We might want to consider making that
the default rather than relying on long double alignment.

Fixes PR35356

Reviewers: STL_MSFT, rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D40277

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

6 years agoRe-revert "Refactor debuginfo-tests."
Zachary Turner [Tue, 21 Nov 2017 01:20:28 +0000 (01:20 +0000)]
Re-revert "Refactor debuginfo-tests."

This is still breaking greendragon.

At this point I give up until someone can fix the greendragon
bots, and I will probably abandon this effort in favor of using
a private github repository.

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

6 years agoASTMatchers{,Macros}.h: Add some extra macros to use for decl/def of matchers
David Blaikie [Tue, 21 Nov 2017 01:09:18 +0000 (01:09 +0000)]
ASTMatchers{,Macros}.h: Add some extra macros to use for decl/def of matchers

Fix ODR violations caused by using internal linkage variables in
non-internal inline functions. (also removes duplicate definitions, etc)

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