]> granicus.if.org Git - clang/log
clang
7 years agoFix incorrect use of current directory to find moved paths in ASTReader.
Manuel Klimek [Tue, 25 Jul 2017 10:22:06 +0000 (10:22 +0000)]
Fix incorrect use of current directory to find moved paths in ASTReader.

CurrentDir was set as the path of the current module, but that can change as
part of a chain of loaded modules.

When we try to locate a file mentioned in a module that does not exist, we use
a heuristic to look at the relative path between the original location of the
module and the file we look for, and use that relatively to the CurrentDir.

This only works if CurrentDir is the same as the (current) path of the module
file the file was mentioned in; if it is not, we look at the path relatively to
the wrong directory, and can end up reading random unrelated files that happen
to have the same name.

This patch fixes this by using the BaseDirectory of the module file the file
we look for was mentioned in instead of the CurrentDir heuristic.

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

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

7 years ago[analyzer] Treat throws as sinks for suppress-on-sink purposes.
Artem Dergachev [Tue, 25 Jul 2017 09:44:02 +0000 (09:44 +0000)]
[analyzer] Treat throws as sinks for suppress-on-sink purposes.

Because since r308957 the suppress-on-sink feature contains its own
mini-analysis, it also needs to become aware that C++ unhandled exceptions
cause sinks. Unfortunately, for now we treat all exceptions as unhandled in
the analyzer, so suppress-on-sink needs to do the same.

rdar://problem/28157554

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

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

7 years ago[analyzer] Further improve suppress-on-sink behavior in incomplete analyses.
Artem Dergachev [Tue, 25 Jul 2017 09:25:10 +0000 (09:25 +0000)]
[analyzer] Further improve suppress-on-sink behavior in incomplete analyses.

If a certain memory leak (or other similar bug) found by the analyzer is known
to be happening only before abnormal termination of the program ("sink", eg.
assertion failure in the code under analysis, or another bug that introduces
undefined behavior), such leak warning is discarded. However, if the analysis
has never reaches completion (due to complexity of the code), it may be
failing to notice the sink.

This commit further extends the partial solution introduced in r290341 to cover
cases when a complicated control flow occurs before encountering a no-return
statement (which anyway inevitably leads to such statement(s)) by traversing
the respective section of the CFG in a depth-first manner. A complete solution
still seems elusive.

rdar://problem/28157554

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

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

7 years ago[NFC] Use RAII to un-poison and then re-poison __VA_ARGS__
Faisal Vali [Tue, 25 Jul 2017 03:15:36 +0000 (03:15 +0000)]
[NFC] Use RAII to un-poison and then re-poison __VA_ARGS__
  - This will also be used for the forthcoming __VA_OPT__ feature approved for C++2a.
  - recommended by rsmith during his review of the __VA_OPT__ patch (https://reviews.llvm.org/D35782)

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

7 years agoDebug Info: Avoid completing class types when a definition is in a module.
Adrian Prantl [Mon, 24 Jul 2017 23:48:51 +0000 (23:48 +0000)]
Debug Info: Avoid completing class types when a definition is in a module.

This patch adds an early exit to CGDebugInfo::completeClassData() when
compiling with -gmodules and the to-be-completed type is available in
a clang module.

rdar://problem/23599990

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

7 years agoRevert "[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when...
Reid Kleckner [Mon, 24 Jul 2017 20:48:15 +0000 (20:48 +0000)]
Revert "[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two collides"

This reverts r308867 and r308866.

It broke the sanitizer-windows buildbot on C++ code similar to the
following:

  namespace cl { }
  void f() {
    __asm {
      mov al, cl
    }
  }

t.cpp(4,13):  error: unexpected namespace name 'cl': expected expression
    mov al, cl
            ^

In this case, MSVC parses 'cl' as a register, not a namespace.

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

7 years ago[clang-format] Reorder assignments, NFC
Krasimir Georgiev [Mon, 24 Jul 2017 19:52:49 +0000 (19:52 +0000)]
[clang-format] Reorder assignments, NFC

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

7 years ago[CodeGen] Propagate dllexport to thunks
Shoaib Meenai [Mon, 24 Jul 2017 17:16:27 +0000 (17:16 +0000)]
[CodeGen] Propagate dllexport to thunks

Under Windows Itanium, we need to export virtual and non-virtual thunks
if the functions being thunked are exported. These thunks would
previously inherit their dllexport attribute from the declaration, but
r298330 changed declarations to not have dllexport attributes. We
therefore need to add the dllexport attribute to the definition
ourselves now. This is consistent with MinGW GCC's behavior.

This redoes r306770 but limits the logic to Itanium. MicrosoftCXXABI's
setThunkLinkage ensures that thunks aren't exported under that ABI, so
I'm handling this in ItaniumCXXABI's setThunkLinkage for symmetry.

We need to export these thunks because they can be referenced outside
the library they're defined in. For example, if a child class without a
key function inherits from a parent class with a key function, the
parent's thunks will only be defined in the library with the key
function, but the construction vtable for the parent in the child might
be emitted outside the library (since the child doesn't have a key
function), and it needs to reference the parent's thunks.

We don't need to mark these thunks as imported since any references to
them will occur in data, so the compiler can't generate the IAT load
sequence anyway. Instead, we rely on the linker generating import thunks
for the thunks.

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

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

7 years agoAArch64 & ARM: move TargetInfo functions from .h to .cpp file. NFC.
Tim Northover [Mon, 24 Jul 2017 17:06:23 +0000 (17:06 +0000)]
AArch64 & ARM: move TargetInfo functions from .h to .cpp file. NFC.

Most of them are virtual anyway, and the few remaining ones can move to the
.cpp for consistency.

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

7 years agoWork around an MSVC2017 update 3 codegen bug.
Nico Weber [Mon, 24 Jul 2017 16:54:11 +0000 (16:54 +0000)]
Work around an MSVC2017 update 3 codegen bug.

C2017 update 3 produces a clang that crashes when compiling clang. Disabling
optimizations for StmtProfiler::VisitCXXOperatorCallExpr() makes the crash go
away.

Patch from Bruce Dawson <brucedawson@chromium.org>!
https://reviews.llvm.org/D35757

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

7 years ago[OPENMP] Fix the restrictions for in_reduction clause.
Alexey Bataev [Mon, 24 Jul 2017 14:52:13 +0000 (14:52 +0000)]
[OPENMP] Fix the restrictions for in_reduction clause.

This patch allows to use in_reduction clause even if the innermost
directive is not taskgroup.

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

7 years ago[clang-format] Fix comment levels between '} else {' and PPDirective.
Krasimir Georgiev [Mon, 24 Jul 2017 14:51:59 +0000 (14:51 +0000)]
[clang-format] Fix comment levels between '} else {' and PPDirective.

Summary:
This fixes a regression exposed by r307795 and rL308725 in which the level of a
comment line between '} else {' and a preprocessor directive is incorrectly set
as the level of the '} else {' line. For example, this :
```
int f(int i) {
  if (i) {
    ++i;
  } else {
    // comment
#ifdef A
    --i;
#endif
  }
}
```
was formatted as:
```
int f(int i) {
  if (i) {
    ++i;
  } else {
  // comment
#ifdef A
    --i;
#endif
  }
}
```

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

7 years ago[mips] Add support for -m(no-)extern-data.
Simon Dardis [Mon, 24 Jul 2017 14:02:09 +0000 (14:02 +0000)]
[mips] Add support for -m(no-)extern-data.

Add support for -m(no-)extern-data when using -mgpopt in the driver. It is
enabled by default in the backend.

Reviewers: atanasyan, slthakur

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

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

7 years ago[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two...
Coby Tayree [Mon, 24 Jul 2017 07:06:37 +0000 (07:06 +0000)]
[X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when the two collides

On MS-style, the following snippet:

int eax;
__asm mov eax, ebx

should yield loading of ebx, into the location pointed by the variable eax

This patch sees to it.

Currently, a reg-to-reg move would have been invoked.

llvm: D34739

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

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

7 years ago[Driver] Fuchsia defaults to -fno-math-errno
Petr Hosek [Sun, 23 Jul 2017 22:30:13 +0000 (22:30 +0000)]
[Driver] Fuchsia defaults to -fno-math-errno

Patch by Roland McGrath

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

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

7 years agoRemove Driver::UseStdLib.
Nico Weber [Sun, 23 Jul 2017 16:31:47 +0000 (16:31 +0000)]
Remove Driver::UseStdLib.

All but one place are checking options::OPT_nostdlib instead of looking at
this field, so convert that one other place to doing that as well.

No behavior change.

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

7 years ago[Modules] Rework r274270. Let Clang targets depend on intrinsics_gen.
NAKAMURA Takumi [Sun, 23 Jul 2017 05:09:44 +0000 (05:09 +0000)]
[Modules] Rework r274270. Let Clang targets depend on intrinsics_gen.

This gets rid of almost LLVM targets unconditionally depending on intrinsic_gen.

Clang's modules still have weird dependencies and hard to remove intrinsics_gen in better way.
Then, it'd be better to give whole clang targets depend on intrinsic_gen.

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

7 years agoclang/module.modulemap: Split out Clang_ToolingCore from Clang_Tooling.
NAKAMURA Takumi [Sun, 23 Jul 2017 01:40:36 +0000 (01:40 +0000)]
clang/module.modulemap: Split out Clang_ToolingCore from Clang_Tooling.

It cuts clangFormat's dependencies out of;

  Clang_Analysis
  Clang_C
  Clang_Diagnostics
  Clang_Driver
  Clang_Frontend
  Clang_Sema
  Clang_Serialization
  Clang_StaticAnalyzer_Core
  Clang_Tooling -> Clang_ToolingCore

Now, the module Clang_Format depends on;

  Clang_AST
  Clang_Basic
  Clang_ToolingCore

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

7 years ago[Bash-autocompletion] Fixed typo and add '-' after -Wno
Yuka Takahashi [Sat, 22 Jul 2017 12:35:15 +0000 (12:35 +0000)]
[Bash-autocompletion] Fixed typo and add '-' after -Wno

Summary: -Wno-<warning> was autocompleted as -Wno<warning>, so fixed this typo.

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

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

7 years ago[NFC, documentation] Prefer the term expansion instead of macro instantiation
Faisal Vali [Sat, 22 Jul 2017 12:04:37 +0000 (12:04 +0000)]
[NFC, documentation] Prefer the term expansion instead of macro instantiation

... in the few remaining places where this was not corrected.

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

7 years ago[index] Set SymbolSubKind::Accessor[GS]etter on class methods
Ben Langmuir [Fri, 21 Jul 2017 23:04:27 +0000 (23:04 +0000)]
[index] Set SymbolSubKind::Accessor[GS]etter on class methods

We have the same relation between class properties and getter/setters
that we have for instance properties, so set the same symbol sub-kind.

rdar://problem/32376404

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

7 years agoRemove Bitrig: Clang Changes
Erich Keane [Fri, 21 Jul 2017 22:46:31 +0000 (22:46 +0000)]
Remove Bitrig: Clang Changes

Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned.

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

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

7 years agoBreak up Targets.cpp into a header/impl pair per target type[NFCI]
Erich Keane [Fri, 21 Jul 2017 22:37:03 +0000 (22:37 +0000)]
Break up Targets.cpp into a header/impl pair per target type[NFCI]

Targets.cpp is getting unwieldy, and even minor changes cause the entire thing
to cause recompilation for everyone. This patch bites the bullet and breaks
it up into a number of files.

I tended to keep function definitions in the class declaration unless it
caused additional includes to be necessary. In those cases, I pulled it
over into the .cpp file. Content is copy/paste for the most part,
besides includes/format/etc.

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

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

7 years agoInline variable into assert to fix unused warning.
Richard Trieu [Fri, 21 Jul 2017 21:29:35 +0000 (21:29 +0000)]
Inline variable into assert to fix unused warning.

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

7 years ago[Hexagon] Attempt to fix selfhost bots
Krzysztof Parzyszek [Fri, 21 Jul 2017 21:23:05 +0000 (21:23 +0000)]
[Hexagon] Attempt to fix selfhost bots

The codegen testcase was checking for specific value names. Make it
ignore the names instead as they are irrelevant.

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

7 years agoFix tblgen error
Richard Trieu [Fri, 21 Jul 2017 20:32:22 +0000 (20:32 +0000)]
Fix tblgen error

Add Heading string to attribute documentation.

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

7 years ago[OPENMP] Fix build problem, NFC.
Alexey Bataev [Fri, 21 Jul 2017 19:26:22 +0000 (19:26 +0000)]
[OPENMP] Fix build problem, NFC.

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

7 years ago[OPENMP] Add ast-print tests for in_reduction clause, NFC.
Alexey Bataev [Fri, 21 Jul 2017 18:55:46 +0000 (18:55 +0000)]
[OPENMP] Add ast-print tests for in_reduction clause, NFC.

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

7 years agoComplex Long Double classification In RegCall calling convention
Erich Keane [Fri, 21 Jul 2017 18:50:36 +0000 (18:50 +0000)]
Complex Long Double classification In RegCall calling convention

This change is part of the RegCall calling convention support for LLVM.
Existing RegCall implementation was extended to include correct handling of
Complex Long Double type. Complex long double types should be returned/passed
in memory and not register stack. This patch implements this behavior.

Patch by: eandrews

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

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

7 years ago[OPENMP] Initial support for 'in_reduction' clause.
Alexey Bataev [Fri, 21 Jul 2017 18:48:21 +0000 (18:48 +0000)]
[OPENMP] Initial support for 'in_reduction' clause.

Parsing/sema analysis for 'in_reduction' clause for task-based
directives.

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

7 years ago[Hexagon] Add inline-asm constraint 'a' for modifier register class
Krzysztof Parzyszek [Fri, 21 Jul 2017 18:07:15 +0000 (18:07 +0000)]
[Hexagon] Add inline-asm constraint 'a' for modifier register class

For example
  asm ("memw(%0++%1) = %2" : : "r"(addr),"a"(mod),"r"(val) : "memory")

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

7 years ago[OPENMP] Simplify analysis of data-sharing attributes.
Alexey Bataev [Fri, 21 Jul 2017 17:24:30 +0000 (17:24 +0000)]
[OPENMP] Simplify analysis of data-sharing attributes.

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

7 years agoTest commit
Andrey Kasaurov [Fri, 21 Jul 2017 15:24:37 +0000 (15:24 +0000)]
Test commit

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

7 years agoTest commit
Nikolay Haustov [Fri, 21 Jul 2017 13:58:11 +0000 (13:58 +0000)]
Test commit

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

7 years ago[clang-diff] Get rid of unused variable warnings in ASTDiff.cpp
Alex Lorenz [Fri, 21 Jul 2017 13:18:51 +0000 (13:18 +0000)]
[clang-diff] Get rid of unused variable warnings in ASTDiff.cpp

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

7 years agoClang's tests should depend on clang-diff
Alex Lorenz [Fri, 21 Jul 2017 13:12:01 +0000 (13:12 +0000)]
Clang's tests should depend on clang-diff

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

7 years agoFix another compiler error from r308731
Alex Lorenz [Fri, 21 Jul 2017 13:04:57 +0000 (13:04 +0000)]
Fix another compiler error from r308731

std::pair in emplace back couldn't be constructed because SNodeId has an
explicit constructor. Not sure how this even compiled on my machine before.

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

7 years agoFix tuple construction compiler error from r308731
Alex Lorenz [Fri, 21 Jul 2017 12:57:40 +0000 (12:57 +0000)]
Fix tuple construction compiler error from r308731

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

7 years ago[clang-diff] Add initial implementation
Alex Lorenz [Fri, 21 Jul 2017 12:49:28 +0000 (12:49 +0000)]
[clang-diff] Add initial implementation

This is the first commit for the "Clang-based C/C++ diff tool" GSoC project.

ASTDiff is a new library that computes a structural AST diff between two ASTs
using the gumtree algorithm. Clang-diff is a new Clang tool that will show
the structural code changes between different ASTs.

Patch by Johannes Altmanninger!

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

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

7 years ago[clang-format] Fix comment levels between '}' and PPDirective
Krasimir Georgiev [Fri, 21 Jul 2017 10:26:13 +0000 (10:26 +0000)]
[clang-format] Fix comment levels between '}' and PPDirective

Summary:
This fixes a regression exposed by r307795 in which the level of a comment line
between '}' and a preprocessor directive is incorrectly set as the level of the
line before the '}'. In effect, this:
```
int f(int i) {
  int j = i;
  return i + j;
}
// comment

#ifdef A
#endif
```
was formatted as:
```
int f(int i) {
  int j = i;
  return i + j;
}
  // comment

#ifdef A
#endif
```

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoFixed failing assert in code completion.
Ilya Biryukov [Fri, 21 Jul 2017 09:24:00 +0000 (09:24 +0000)]
Fixed failing assert in code completion.

Summary:
The code was accessing uninstantiated default argument.
This resulted in failing assertion at ParmVarDecl::getDefaultArg().

Reviewers: erikjv, klimek, bkramer, krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

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

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

7 years ago[mips] Add `short_call` to the set of `long_call/far/near` attributes
Simon Atanasyan [Fri, 21 Jul 2017 08:10:57 +0000 (08:10 +0000)]
[mips] Add `short_call` to the set of `long_call/far/near` attributes

MIPS gcc supports `long_call/far/near` attributes only, but other
targets have the `short_call` attribut, so let's support it for MIPS
for consistency.

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

7 years agoFix tblgen error.
Richard Trieu [Fri, 21 Jul 2017 04:56:48 +0000 (04:56 +0000)]
Fix tblgen error.

tblgen couldn't determing a unique name between "long_call" and "far", so it
errored out when generating documentation.  Copy the documentation, and give
an explicit header for "long_call".

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

7 years ago[Driver] Consider -fno-sanitize=... state when filtering out -fsanitize-coverage=...
Petr Hosek [Fri, 21 Jul 2017 01:17:49 +0000 (01:17 +0000)]
[Driver] Consider -fno-sanitize=... state when filtering out -fsanitize-coverage=...

The driver ignores -fsanitize-coverage=... flags when also given
-fsanitize=... flags for sanitizer flavors that don't support the
coverage runtime. This logic failed to account for subsequent
-fno-sanitize=... flags that disable the sanitizer flavors that
conflict with -fsanitize-coverage=... flags.

Patch by Roland McGrath

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

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

7 years ago[CMake] Use ABI version 2 for C++ library in Fuchsia
Petr Hosek [Fri, 21 Jul 2017 00:59:38 +0000 (00:59 +0000)]
[CMake] Use ABI version 2 for C++ library in Fuchsia

Fuchsia has always been using ABI version 2 but I forgot this option
when setting up the cache file for runtimes build.

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

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

7 years ago[clang-format] Put '/**' and '*/' on own lines in multiline jsdocs
Krasimir Georgiev [Thu, 20 Jul 2017 22:29:39 +0000 (22:29 +0000)]
[clang-format] Put '/**' and '*/' on own lines in multiline jsdocs

Reviewers: mprobst

Reviewed By: mprobst

Subscribers: cfe-commits, klimek

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

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

7 years ago[mips] Add support for -m(no-)local-sdata
Simon Dardis [Thu, 20 Jul 2017 22:23:21 +0000 (22:23 +0000)]
[mips] Add support for -m(no-)local-sdata

Teach the driver to support -mlocal-sdata. The backend already matches GCC's
default behaviour.

Reviewers: atanasyan, slthakur

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

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

7 years ago[NVPTX] Add lowering of i128 params.
Artem Belevich [Thu, 20 Jul 2017 21:16:03 +0000 (21:16 +0000)]
[NVPTX] Add lowering of i128 params.

The patch adds support of i128 params lowering. The changes are quite trivial to
support i128 as a "special case" of integer type. With this patch, we lower i128
params the same way as aggregates of size 16 bytes: .param .b8 _ [16].

Currently, NVPTX can't deal with the 128 bit integers:
* in some cases because of failed assertions like
  ValVTs.size() == OutVals.size() && "Bad return value decomposition"
* in other cases emitting PTX with .i128 or .u128 types (which are not valid [1])
  [1] http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#fundamental-types

Differential Revision: https://reviews.llvm.org/D34555
Patch by: Denys Zariaiev (denys.zariaiev@gmail.com)

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

7 years ago[CodeGen][mips] Support `long_call/far/near` attributes
Simon Atanasyan [Thu, 20 Jul 2017 20:34:18 +0000 (20:34 +0000)]
[CodeGen][mips] Support `long_call/far/near` attributes

This patch adds support for the `long_call`, `far`, and `near` attributes
for MIPS targets. The `long_call` and `far` attributes are synonyms. All
these attributes override `-mlong-calls` / `-mno-long-calls` command
line options for particular function.

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

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

7 years ago[clang] Fix handling of "%zd" in scanf
Alexander Shaposhnikov [Thu, 20 Jul 2017 20:11:47 +0000 (20:11 +0000)]
[clang] Fix handling of "%zd" in scanf

This diff addresses FIXMEs in lib/Analysis/ScanfFormatString.cpp
for the case of ssize_t format specifier and adds tests.
In particular, this change enables Clang to emit a warning
on incorrect using of "%zd"/"%zn".

Test plan: make check-all

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

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

7 years ago[Docs] Regenerate the command line option reference.
Craig Topper [Thu, 20 Jul 2017 17:52:48 +0000 (17:52 +0000)]
[Docs] Regenerate the command line option reference.

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

7 years ago[OPENMP] Fix DSA processing for member declaration.
Alexey Bataev [Thu, 20 Jul 2017 16:47:47 +0000 (16:47 +0000)]
[OPENMP] Fix DSA processing for member declaration.

If the member declaration is captured in the OMPCapturedExprDecl, we may
loose data-sharing attribute info for this declaration. Patch fixes this
bug.

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

7 years agoReland "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Thu, 20 Jul 2017 14:04:12 +0000 (14:04 +0000)]
Reland "[mips] Teach the driver to accept -m(no-)gpopt."

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

This version fixes a logic error that generated warnings incorrectly and
gets rid of spurious arguments to the backend when -mgpopt is not used.

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

7 years ago[vfs] Assert that the status is known in equivalent().
Benjamin Kramer [Thu, 20 Jul 2017 11:57:02 +0000 (11:57 +0000)]
[vfs] Assert that the status is known in equivalent().

Otherwise we'd silently compare uninitialized data.

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

7 years agoclang/module.modulemap: Clang_Diagnostics: Activate "Sema/SemaDiagnostic.h".
NAKAMURA Takumi [Thu, 20 Jul 2017 07:51:47 +0000 (07:51 +0000)]
clang/module.modulemap: Clang_Diagnostics: Activate "Sema/SemaDiagnostic.h".

It seems issues were resolved.

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

7 years agoRevert "[StaticAnalyzer] Completely unrolling specific loops with known bound option"
Peter Szecsi [Thu, 20 Jul 2017 07:35:11 +0000 (07:35 +0000)]
Revert "[StaticAnalyzer] Completely unrolling specific loops with known bound option"

Revert r308561 and r308558.

Clang-ppc64be-linux seems to crash while running the test cases.

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

7 years agoclang/module.modulemap: Split out Clang_RewriteFrontend from Clang_Rewrite.
NAKAMURA Takumi [Thu, 20 Jul 2017 06:08:53 +0000 (06:08 +0000)]
clang/module.modulemap: Split out Clang_RewriteFrontend from Clang_Rewrite.

FIXME: Both Rewrite(Core) and RewriteFrontend don't cover just under clang/Rewrite. There's no file, though.

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

7 years ago[AArch64] Produce correct defaultlib directives for windows in MSVC style
Martin Storsjo [Thu, 20 Jul 2017 05:47:06 +0000 (05:47 +0000)]
[AArch64] Produce correct defaultlib directives for windows in MSVC style

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

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

7 years ago[NFC] Update local variable names to upper-case as per LLVM Coding Standards.
Faisal Vali [Thu, 20 Jul 2017 01:10:56 +0000 (01:10 +0000)]
[NFC] Update local variable names to upper-case as per LLVM Coding Standards.

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

7 years ago[StaticAnalyzer] Completely unrolling specific loops with known bound option
Peter Szecsi [Thu, 20 Jul 2017 00:05:25 +0000 (00:05 +0000)]
[StaticAnalyzer] Completely unrolling specific loops with known bound option

Missing files added to rL308558.

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

7 years agoThis feature allows the analyzer to consider loops to completely unroll. New
Peter Szecsi [Wed, 19 Jul 2017 23:50:00 +0000 (23:50 +0000)]
This feature allows the analyzer to consider loops to completely unroll. New
requirements/rules (for unrolling) can be added easily via ASTMatchers.

The current implementation is hidden behind a flag.

Right now the blocks which belong to an unrolled loop are marked by the
LoopVisitor which adds them to the ProgramState. Then whenever we encounter a
CFGBlock in the processCFGBlockEntrance which is marked then we skip its
investigating. That means, it won't be considered to be visited more than the
maximal bound for visiting since it won't be checked.

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

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

7 years ago[X86] Put avx512vpopcntdq in the right spot in the validateCpuSupports string switch.
Craig Topper [Wed, 19 Jul 2017 22:58:58 +0000 (22:58 +0000)]
[X86] Put avx512vpopcntdq in the right spot in the validateCpuSupports string switch.

The validateCpuSupports switch is in the order of the enum defined in CGBuiltin.cpp and libgcc/compiler-rt.

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

7 years agoImprove SEMA for attribute-target
Erich Keane [Wed, 19 Jul 2017 22:06:33 +0000 (22:06 +0000)]
Improve SEMA for attribute-target

Add more diagnosis for the non-multiversioning case.

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

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

7 years agoAdd isValidCPUName and isValidFeature to TargetInfo
Erich Keane [Wed, 19 Jul 2017 21:50:08 +0000 (21:50 +0000)]
Add isValidCPUName and isValidFeature to TargetInfo

These two functions are really useful for implementations of attributes
(including attribute-target), so add the functionality.

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

7 years agoAdd AlignedAllocation.h.
Akira Hatanaka [Wed, 19 Jul 2017 17:26:42 +0000 (17:26 +0000)]
Add AlignedAllocation.h.

I forgot to "git add" it in r308496.

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

7 years ago[Sema] Improve diagnostic message for unavailable C++17 aligned
Akira Hatanaka [Wed, 19 Jul 2017 17:17:50 +0000 (17:17 +0000)]
[Sema] Improve diagnostic message for unavailable C++17 aligned
allocation functions.

This changes the error message Sema prints when an unavailable C++17
aligned allocation function is selected.

Original message: "... possibly unavailable on x86_64-apple-macos10.12"
New message: "... only available on macOS 10.13 or newer"

This is a follow-up to r306722.

rdar://problem/32664169

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

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

7 years agoClear release notes for 6.0.0
Hans Wennborg [Wed, 19 Jul 2017 14:14:07 +0000 (14:14 +0000)]
Clear release notes for 6.0.0

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

7 years agoBump docs version to 6.0
Hans Wennborg [Wed, 19 Jul 2017 13:50:27 +0000 (13:50 +0000)]
Bump docs version to 6.0

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

7 years agoRevert "Reland "[mips] Teach the driver to accept -m(no-)gpopt.""
Simon Dardis [Wed, 19 Jul 2017 13:34:08 +0000 (13:34 +0000)]
Revert "Reland "[mips] Teach the driver to accept -m(no-)gpopt.""

This reverts r308458. Investigating further buildbot breakage.

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

7 years agoReland "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Wed, 19 Jul 2017 13:12:37 +0000 (13:12 +0000)]
Reland "[mips] Teach the driver to accept -m(no-)gpopt."

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

This version fixes a logic error that generated warnings incorrectly.

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

7 years agoRevert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)'...
Hans Wennborg [Wed, 19 Jul 2017 12:31:01 +0000 (12:31 +0000)]
Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files"

This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until
it's fixed, especially since this landed just before the 5.0 branch.

> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
>
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
>
> rdar://10184173
>
> Differential Revision: https://reviews.llvm.org/D35484

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

7 years agoRecommit r308327: Add a warning for missing '#pragma pack (pop)'
Alex Lorenz [Wed, 19 Jul 2017 11:30:41 +0000 (11:30 +0000)]
Recommit r308327: Add a warning for missing '#pragma pack (pop)'
and suspicious uses of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

7 years agoFix compilation problem introduced in r308433
Erik Verbruggen [Wed, 19 Jul 2017 11:15:36 +0000 (11:15 +0000)]
Fix compilation problem introduced in r308433

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

7 years agoRevert "[mips] Teach the driver to accept -m(no-)gpopt."
Simon Dardis [Wed, 19 Jul 2017 11:11:02 +0000 (11:11 +0000)]
Revert "[mips] Teach the driver to accept -m(no-)gpopt."

Revert r308431 and r308432, these caused broke some buildbots.

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

7 years agoAdd default values for function parameter chunks
Erik Verbruggen [Wed, 19 Jul 2017 10:45:40 +0000 (10:45 +0000)]
Add default values for function parameter chunks

Append optional chunks with their default values. For example:
before - "int i", after - "int i = 10"

Patch by Ivan Donchevskii!

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

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

7 years ago[mips] Add warning test for -mgpopt option.
Simon Dardis [Wed, 19 Jul 2017 10:39:15 +0000 (10:39 +0000)]
[mips] Add warning test for -mgpopt option.

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

7 years ago[mips] Teach the driver to accept -m(no-)gpopt.
Simon Dardis [Wed, 19 Jul 2017 10:38:03 +0000 (10:38 +0000)]
[mips] Teach the driver to accept -m(no-)gpopt.

This patch teaches the driver to pass -mgpopt by default to the backend when it
is supported, i.e. we are using -mno-abicalls.

Reviewers: atanasyan, slthakur

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

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

7 years agoUpdate clang-cl options in the users manual
Hans Wennborg [Wed, 19 Jul 2017 09:52:24 +0000 (09:52 +0000)]
Update clang-cl options in the users manual

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

7 years ago[analyzer] Add annotation attribute to trust retain count implementation
Devin Coughlin [Wed, 19 Jul 2017 04:10:44 +0000 (04:10 +0000)]
[analyzer] Add annotation attribute to trust retain count implementation

Add support to the retain-count checker for an annotation indicating that a
function's implementation should be trusted by the retain count checker.
Functions with these attributes will not be inlined and the arguments will
be treating as escaping.

Adding this annotation avoids spurious diagnostics when the implementation of
a reference counting operation is visible but the analyzer can't reason
precisely about the ref count.

Patch by Malhar Thakkar!

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

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

7 years ago[CMake] Build runtimes for Fuchsia targets
Petr Hosek [Wed, 19 Jul 2017 02:57:47 +0000 (02:57 +0000)]
[CMake] Build runtimes for Fuchsia targets

This relies on the multi-target runtimes build support.

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

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

7 years ago[scan-build-py] Patch to fix "-analyzer-config" option
Petr Hosek [Wed, 19 Jul 2017 00:29:41 +0000 (00:29 +0000)]
[scan-build-py] Patch to fix "-analyzer-config" option

I noticed that when I use "-analyze-config" option in scan-build-py, it
behaves differently from original perl based scan-build.

For example, command:

$ scan-build -analyzer-config ipa=basic-inlining make

Will work without any issues on perl version of scan-build. But on
scan-build-py it will throw an error message "error reading
'ipa=basic-inlining'".

After debugging, it turns out that the scan-build-py does not put
"-analyzer-config" flag in front of the analyzer config flags (in this
case is the "ipa=basic-inlining") in the final clang command line. This
patch fixes this issue.

Patch by Haowei Wu

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

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

7 years agoUpdate for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
Adrian Prantl [Wed, 19 Jul 2017 00:09:58 +0000 (00:09 +0000)]
Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).

<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822

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

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

7 years agoDebug Info: Set the MainFileName when generating -gmodules debug info for PCM.
Adrian Prantl [Tue, 18 Jul 2017 23:58:34 +0000 (23:58 +0000)]
Debug Info: Set the MainFileName when generating -gmodules debug info for PCM.

Previously it was uninitialized and thus always defaulted to "<stdin>".
This is mostly a cosmetic change that helps making the debug info more readable.

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

7 years ago[Driver] Always use -z rodynamic for Fuchsia
Petr Hosek [Tue, 18 Jul 2017 23:23:16 +0000 (23:23 +0000)]
[Driver] Always use -z rodynamic for Fuchsia

Fuchsia uses read-only .dynamic section.

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

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

7 years agoConvert attribute 'target' parsing from a 'pair' to a 'struct' to make further improv...
Erich Keane [Tue, 18 Jul 2017 20:41:02 +0000 (20:41 +0000)]
Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further improvements easier

Convert attribute 'target' parsing from a 'pair' to a 'struct' to make further
improvements easier

The attribute 'target' parse function previously returned a pair. Convert
this to a 'pair' in order to add more functionality, and improve usability.

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

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

7 years ago[Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp
Erik Pilkington [Tue, 18 Jul 2017 20:32:07 +0000 (20:32 +0000)]
[Sema] NFC: Move all availability checking code to SemaDeclAttr.cpp

Previously, this was awkwardly split up between SemaExpr.cpp.

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

7 years ago[OPENMP] Initial support for 'task_reduction' clause.
Alexey Bataev [Tue, 18 Jul 2017 20:17:46 +0000 (20:17 +0000)]
[OPENMP] Initial support for 'task_reduction' clause.

Parsing/sema analysis of the 'task_reduction' clause.

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

7 years agoAdd GCC's noexcept-type alias for c++1z-compat-mangling
Raphael Isemann [Tue, 18 Jul 2017 18:52:58 +0000 (18:52 +0000)]
Add GCC's noexcept-type alias for c++1z-compat-mangling

Summary: GCC has named this `-Wnoexcept-type`, so let's add an alias to stay compatible with the GCC flags.

Reviewers: rsmith, dexonsmith

Reviewed By: dexonsmith

Subscribers: cfe-commits, karies, v.g.vassilev, ahatanak

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

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

7 years agoDon't set TUScope to null when generating a module in incremental processing mode.
Raphael Isemann [Tue, 18 Jul 2017 18:24:42 +0000 (18:24 +0000)]
Don't set TUScope to null when generating a module in incremental processing mode.

Summary: When in incremental processing mode, we should never set `TUScope` to a nullptr otherwise any future lookups fail. We already have similar checks in the rest of the code, but we never hit this one because so far we didn't try to generate a module from the AST that Cling generates.

Reviewers: rsmith, v.g.vassilev

Reviewed By: v.g.vassilev

Subscribers: cfe-commits, v.g.vassilev

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

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

7 years agoRevert r308327
Alex Lorenz [Tue, 18 Jul 2017 17:36:42 +0000 (17:36 +0000)]
Revert r308327

I forgot to test clang-tools-extra which is now failing.

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

7 years agoAdd a warning for missing '#pragma pack (pop)' and suspicious uses
Alex Lorenz [Tue, 18 Jul 2017 17:23:51 +0000 (17:23 +0000)]
Add a warning for missing '#pragma pack (pop)' and suspicious uses
of '#pragma pack' in included files

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

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

7 years ago[OPENMP] Generalization of sema analysis of reduction-based clauses,
Alexey Bataev [Tue, 18 Jul 2017 15:32:58 +0000 (15:32 +0000)]
[OPENMP] Generalization of sema analysis of reduction-based clauses,
NFC.

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

7 years agoCodeGen: Insert addr space cast for automatic/temp var at right position
Yaxun Liu [Tue, 18 Jul 2017 14:46:03 +0000 (14:46 +0000)]
CodeGen: Insert addr space cast for automatic/temp var at right position

The uses of alloca may be in different blocks other than the block containing the alloca.
Therefore if the alloca addr space is non-zero and it needs to be casted to default
address space, the cast needs to be inserted in the same BB as the alloca insted of
the current builder insert point since the current insert point may be in a different BB.

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

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

7 years agoclang-format: [JS] Correctly format JavaScript imports with long module paths
Martin Probst [Tue, 18 Jul 2017 14:00:19 +0000 (14:00 +0000)]
clang-format: [JS] Correctly format JavaScript imports with long module paths

Currently the `UnwrappedLineParser` fails to correctly unwrap JavaScript
imports where the module path is not on the same line as the `from` keyword.
For example:

    import {A} from
    'some/path/longer/than/column/limit/module.js';```

This causes issues when in the middle a list of imports because the formatter
thinks it has reached the end of the imports, and therefore will not sort any
imports lower in the list.

The formatter will, however, split the `from` keyword and the module path if
the path exceeds the column limit, which triggers the issue the next time the
file is formatted.

Patch originally by Jared Neil - thanks!

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

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

7 years ago[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config...
NAKAMURA Takumi [Tue, 18 Jul 2017 08:55:03 +0000 (08:55 +0000)]
[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into clang/Config/config.h.

LLVM_ENABLE_MODULES is sensitive of -D. Move them into config.h.

FIXME: It'd be better that they are #cmakedefine01 rather than #cmakedefine.
(#if FOO rather than #if defined(FOO))
Then we can find missing #include "clang/Config/config.h" in the future.

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

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

7 years ago[Index] Prevent canonical decl becoming nullptr
Krasimir Georgiev [Tue, 18 Jul 2017 07:20:53 +0000 (07:20 +0000)]
[Index] Prevent canonical decl becoming nullptr

Summary:
This patch prevents getCanonicalDecl returning nullptr in case it finds
a canonical TemplateDeclaration with no attached TemplatedDecl.
Found by running the indexer over a version of the standard library deep inside
a template metaprogramming mess.

Reviewers: klimek, vsk

Reviewed By: vsk

Subscribers: vsk, arphaman, cfe-commits

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

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

7 years agoAlso add the option -no-pie (like -nopie)
Sylvestre Ledru [Tue, 18 Jul 2017 06:54:54 +0000 (06:54 +0000)]
Also add the option -no-pie (like -nopie)

Summary:
For example, this option is expected by ghc (haskell compiler). Currently, building with ghc will fail with:

```
clang: error: unknown argument: '-no-pie'
`gcc' failed in phase `Linker'. (Exit code: 1)
. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
configure_recipe
```

This won't do anything (but won't fail with an error)

Reviewers: rafael, joerg

Reviewed By: joerg

Subscribers: joerg, cfe-commits

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

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

7 years ago[OpenCL] Added extended tests on metadata generation for half data type and arrays.
Egor Churaev [Tue, 18 Jul 2017 06:04:01 +0000 (06:04 +0000)]
[OpenCL] Added extended tests on metadata generation for half data type and arrays.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: bader, cfe-commits, yaxunl

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

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

7 years ago[OPENMP] Pacify windows buildbots, NFC.
Alexey Bataev [Tue, 18 Jul 2017 00:42:35 +0000 (00:42 +0000)]
[OPENMP] Pacify windows buildbots, NFC.

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

7 years ago[analyzer] Add missing documentation for static analyzer checkers
Devin Coughlin [Tue, 18 Jul 2017 00:34:57 +0000 (00:34 +0000)]
[analyzer] Add missing documentation for static analyzer checkers

Some checks did not have documentation in the www/analyzer/ folder and also
some alpha checks became non-alpha.

Patch by Dominik Szabó!

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

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