Commit Graph

63109 Commits

Author SHA1 Message Date
Saleem Abdulrasool 724275ba5f Basic: thread CodeGenOptions into TargetInfo
This threads CodeGenOptions into the TargetInfo hierarchy.  This is motivated by
ARM which can change some target information based on the EABI selected
(-meabi).  Similar options exist for other platforms (e.g. MIPS) and thus is
generally useful.  NFC.

llvm-svn: 265640
2016-04-07 05:41:11 +00:00
Sean Silva 72af472523 Don't use PATH_MAX.
This is a SmallVector anyway, and so the exact size doesn't matter.

clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression
        llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen'

llvm-svn: 265634
2016-04-07 01:58:14 +00:00
Bruno Cardoso Lopes 4775fcfa4e [CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h
Use toUppercase instead of ::toupper()

llvm-svn: 265632
2016-04-07 01:12:18 +00:00
Bruno Cardoso Lopes 49acebea07 [CrashReproducer] Change std::toupper to ::toupper
Attempt to fix windows bots

llvm-svn: 265630
2016-04-07 01:04:09 +00:00
Bruno Cardoso Lopes 4c20bef1ef [CrashReproducer] Setup 'case-sensitive' in YAML files.
The crash reproducer was not setting up case sensitivity in the
VFS yaml files, which defaults to true. Make the crash reproducer
explicitly set that flag based on the case sensitivity of the .cache
path where vfs and modules are dumped.

llvm-svn: 265622
2016-04-07 00:00:57 +00:00
Bruno Cardoso Lopes 7caebc182a [CrashReproducer] Move ModuleDependencyCollector method around. NFC
llvm-svn: 265621
2016-04-07 00:00:42 +00:00
JF Bastien dd11ee7452 NFC: use AtomicOrdering isStrongerThan
Summary: As discussed in D18775.

Reviewers: jyknight

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

llvm-svn: 265617
2016-04-06 23:37:36 +00:00
Manman Ren 8f42e69b18 Keep -fmodule-implementation-of as an alias of -fmodule-name.
This helps us transitioning to -fmodule-name. Once the transitioning is done,
we can remove this alias.

rdar://24800983

llvm-svn: 265616
2016-04-06 23:28:26 +00:00
Sean Silva 31994e2eb6 Revert "Set the default C standard to C99 when targeting the PS4."
This reverts r265359.

It breaks
- llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
- llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast

Failing Tests (5):
    Clang :: FixIt/fixit-errors.c
    Clang :: Preprocessor/init.c
    Clang :: Sema/attr-deprecated.c
    Clang :: Sema/nullability.c
    Clang :: SemaObjC/objcbridge-attribute-arc.m

llvm-svn: 265601
2016-04-06 21:06:52 +00:00
Vassil Vassilev 59f6586da0 [modules] Add forgotten test case to r265597.
llvm-svn: 265599
2016-04-06 20:58:12 +00:00
Richard Smith b41ddae3a2 Fix order-of-evaluation bug (causing GCC buildbots to fail).
llvm-svn: 265598
2016-04-06 20:57:53 +00:00
Vassil Vassilev 71eafded89 [modules] Don't try to add lookup results to non-lookup contexts.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27186

Patch reviewed by Richard Smith.

llvm-svn: 265597
2016-04-06 20:56:03 +00:00
Richard Smith f50422aa44 Minor simplifications.
llvm-svn: 265594
2016-04-06 20:12:34 +00:00
Tim Northover 1390b4479e Restore slightly less dodgy diagnostic handler for inline asm
Turns out it was there mostly to prevent Clang asking people to report a bug.
This time we report something to Clang's real diagnostics handler so that it
exits with something approximating a real error and tidies up after itself.

llvm-svn: 265592
2016-04-06 19:58:07 +00:00
Richard Smith 882593f8f0 Diagnose template alias declarations in local classes.
Patch by Erik Pilkington!

llvm-svn: 265571
2016-04-06 17:38:58 +00:00
JF Bastien 92f4ef1017 NFC: make AtomicOrdering an enum class
Summary: See LLVM change D18775 for details, this change depends on it.

Reviewers: jyknight, reames

Subscribers: cfe-commits

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

llvm-svn: 265569
2016-04-06 17:26:42 +00:00
Richard Smith 290d801916 Re-commit r265518 ("[modules] Continue factoring encoding of AST records out of
ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug
(thanks, MSan!).

llvm-svn: 265564
2016-04-06 17:06:00 +00:00
Daniel Jasper 2cce7b728b clang-format: Fix label-in-if statement in macros where it is actually used.
Before:
  #define A \
    if (a)  \
    label:  \
    f()

After:
  #define A \
    if (a)  \
    label:  \
      f()

llvm-svn: 265557
2016-04-06 16:41:39 +00:00
Ed Schouten 506f295a10 Enable PIE for CloudABI.
As we're currently working on making CloudABI executables easier to
emulate in userspace (e.g., on OS X and Windows), it makes a whole lot
of sense to build these using PIE. By using PIE, they can simply be
loaded into the existing process address space without clashes.

PIE support got added to CloudABI's C library and seems to work pretty
well. CloudABI does not make use of an ld.so, so the binary's _start()
has all the logic in it to do the relocations.

Now that all but one bug in LLD relating to PIE support have been
squashed (and a patch for that is already in code review), I'd like to
go ahead and force the use of PIE for Clang 3.9. When released, we'll
also switch over to using LLD exclusively.

llvm-svn: 265546
2016-04-06 15:37:06 +00:00
Daniel Jasper 4060947289 clang-format: Support labels in brace-less ifs.
While I am not personally convinced about the usefulness of this
construct, we should break it.

Before:
  if (a) label:
  f();

After:
  if (a)
  label:
    f();

llvm-svn: 265545
2016-04-06 15:02:46 +00:00
Daniel Jasper 19bc1d007a clang-format: Fix incorrect function annotation detection.
Before:
  MACRO(
      abc).function() // wrap
      << abc;

After:
  MACRO(abc).function() // wrap
      << abc;

llvm-svn: 265540
2016-04-06 13:58:09 +00:00
Dmitry Polukhin 0b0da296e6 [OPENMP] Parsing and Sema support for 'omp declare target' directive
Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0
(4.5 support will be added in separate patch).

The declare target directive specifies that variables, functions (C, C++
and Fortran), and subroutines (Fortran) are mapped to a device. The declare
target directive is a declarative directive. In Clang declare target is
implemented as implicit attribute for the declaration.

The syntax of the declare target directive is as follows:

 #pragma omp declare target
 declarations-definition-seq
 #pragma omp end declare target

Based on patch from Michael Wong http://reviews.llvm.org/D15321

llvm-svn: 265530
2016-04-06 11:38:59 +00:00
Dmitry Polukhin 790b540099 Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."
This reverts commit r265518.

llvm-svn: 265526
2016-04-06 10:01:46 +00:00
Richard Smith 5811c40bb3 [modules] Continue factoring encoding of AST records out of ASTWriter.
llvm-svn: 265518
2016-04-06 06:26:08 +00:00
Manman Ren 29be7e10ca Update testing cases after backend changes.
llvm-svn: 265488
2016-04-05 23:27:51 +00:00
Richard Trieu 265c344ef8 Fix a crash on invalid with template handling
This is a fix for https://llvm.org/bugs/show_bug.cgi?id=25561 which was a
crash on invalid.  Change the handling of invalid decls to have a catch-all
case to prevent unexpecting decls from triggering an assertion.

llvm-svn: 265467
2016-04-05 21:13:54 +00:00
Nirav Dave e585b5c52b Fix broken tests from no-jump-table commit
Summary: Fix failing tests from no-jump-table flag addition

Reviewers: jyknight

Subscribers: llvm-commits

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

llvm-svn: 265439
2016-04-05 18:59:37 +00:00
Justin Lebar 19dafbd211 [CUDA] Show --cuda-gpu-arch option in clang --help.
For some reason it was hidden.

llvm-svn: 265436
2016-04-05 18:26:25 +00:00
Justin Lebar d3a44f6885 [CUDA] Add -fcuda-flush-denormals-to-zero.
Summary:
Setting this flag causes all functions are annotated with the
"nvvm-f32ftz" = "true" attribute.

In addition, we annotate the module with "nvvm-reflect-ftz" set
to 0 or 1, depending on whether -cuda-flush-denormals-to-zero is set.
This is read by the NVVMReflect pass.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

llvm-svn: 265435
2016-04-05 18:26:20 +00:00
Nirav Dave 99d607b63e Fix missing period in no-jump-table flag comment. NFC.
llvm-svn: 265432
2016-04-05 18:11:01 +00:00
Nirav Dave d2f44d8de0 Add -fno-jump-tables and-fjump-tables flags
Add no-jump-tables flag to disable use of jump tables when lowering
switch statements

Reviewers: echristo, hans

Subscribers: llvm-commits

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

llvm-svn: 265425
2016-04-05 17:50:43 +00:00
Andrey Turetskiy fd259ff9c4 [X86] Introduction of -march=lakemont.
Differential Revision: http://reviews.llvm.org/D18651

llvm-svn: 265405
2016-04-05 15:04:26 +00:00
Daniel Jasper 94b1bdf91a clang-format: Fix cast detection on "this".
Before:
  auto x = (X) this;

After:
  auto x = (X)this;

This fixes llvm.org/PR27198.

llvm-svn: 265385
2016-04-05 11:46:06 +00:00
Andy Gibbs 50b6ceff1f Consolidate and improve the handling of built-in feature-like macros
Summary:
The parsing logic has been separated out from the macro implementation logic, leading to a number of improvements:

* Gracefully handle unexpected/invalid tokens, too few, too many and nested parameters
* Provide consistent behaviour between all built-in feature-like macros
* Simplify the implementation of macro logic
* Fix __is_identifier to correctly return '0' for non-identifiers

Reviewers: doug.gregor, rsmith

Subscribers: rsmith, cfe-commits

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

llvm-svn: 265381
2016-04-05 08:36:47 +00:00
Richard Smith 8921007090 Move local helper class into anonymous namespace.
llvm-svn: 265364
2016-04-04 23:29:43 +00:00
Reid Kleckner 2ed6beac71 Fix test failure from r265361
llvm-svn: 265362
2016-04-04 23:14:14 +00:00
Sunil Srivastava 0e15a77d40 Set the default C standard to C99 when targeting the PS4.
Patch by Douglas Yung!

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

llvm-svn: 265359
2016-04-04 22:56:05 +00:00
James Y Knight e635215009 Fix "suggest parentheses" warning.
llvm-svn: 265355
2016-04-04 22:35:56 +00:00
John McCall 8cde42c400 Fix an unused-variable warning by using the variable in the place
it was supposed to have been used.

llvm-svn: 265344
2016-04-04 20:39:50 +00:00
Bruno Cardoso Lopes b810b02b85 [CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using modules/vfs
The reproducer should use -I/-F/-resource-dir in the same way as the
original command. The VFS already collects the right headers but without
these flags the reproducer will fail to do the right thing.

llvm-svn: 265343
2016-04-04 20:26:57 +00:00
George Burgess IV 6ae936cbf2 [Sema] Delete FIXME that has been fixed. NFC.
llvm-svn: 265341
2016-04-04 19:44:16 +00:00
Mike Spertus 8874ef7cf1 Fix redundant "typename typename T" in Visual Studio Native Visualizer
Also, a little minor cleanup

llvm-svn: 265338
2016-04-04 19:36:48 +00:00
John McCall eb3219a9c2 Assignment operators should return by reference.
Thanks to Sean Silva for pointing this out.

llvm-svn: 265328
2016-04-04 18:53:01 +00:00
Yunzhong Gao c293a2688d Add copyright notice to the modulemap file.
The module.modulemap file in the lib/Headers directory was missing the LLVM
copyright notice. This patch adds the copyright notice just like the rest of
the files in this directory.

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

llvm-svn: 265325
2016-04-04 18:46:09 +00:00
John McCall 12f2352152 IRGen-level lowering for the Swift calling convention.
llvm-svn: 265324
2016-04-04 18:33:08 +00:00
John McCall b8fa654164 Add a couple of convenience operations to CharUnits.
llvm-svn: 265323
2016-04-04 18:33:00 +00:00
Carlo Bertolli c687225b43 [OPENMP] Codegen for teams directive for NVPTX
This patch implements the teams directive for the NVPTX backend. It is different from the host code generation path as it:

Does not call kmpc_fork_teams. All necessary teams and threads are started upon touching the target region, when launching a CUDA kernel, and their execution is coordinated through sequential and parallel regions within the target region.
Does not call kmpc_push_num_teams even if a num_teams of thread_limit clause is present. Setting the number of teams and the thread limit is implemented by the nvptx-related runtime.
Please note that I am now passing a Clang Expr * to emitPushNumTeams instead of the originally chosen llvm::Value * type. The reason for that is that I want to avoid emitting expressions for num_teams and thread_limit if they are not needed in the target region.

http://reviews.llvm.org/D17963

llvm-svn: 265304
2016-04-04 15:55:02 +00:00
NAKAMURA Takumi cacd94e242 AnnotateFunctions: Tweak for mingw.
- Externalize the registry.
  - Update libdeps.

llvm-svn: 265301
2016-04-04 15:30:44 +00:00
John Brawn 8e62db3247 Add a PragmaHandler Registry for plugins to add PragmaHandlers to
This allows plugins which add AST passes to also define pragmas to do things
like only enable certain behaviour of the AST pass in files where a certain
pragma is used.

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

llvm-svn: 265295
2016-04-04 14:22:58 +00:00
Alexey Bataev 20dfd77826 [OPENMP 4.0] Support for 'inbranch|noinbranch' clauses in 'declare
simd'.

Added parsing/semantic analysis for 'inbranch|notinbranch' clauses of
'#pragma omp declare simd' construct.

llvm-svn: 265287
2016-04-04 10:12:15 +00:00