]> granicus.if.org Git - clang/log
clang
8 years agoclang-format: Correctly calculate affected ranges when sorting #includes.
Daniel Jasper [Tue, 30 Aug 2016 21:33:41 +0000 (21:33 +0000)]
clang-format: Correctly calculate affected ranges when sorting #includes.

affectedRanges takes a start and an end offset, not offset and length.

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

8 years ago[Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.
Bruno Cardoso Lopes [Tue, 30 Aug 2016 21:25:42 +0000 (21:25 +0000)]
[Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.

This adds support for modules that require (no-)gnu-inline-asm
environment, such as the compiler builtin cpuid submodule.

This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871

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

rdar://problem/26931199

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

8 years agoFix memory leak by storing returned pointer in std::unique_ptr
Richard Trieu [Tue, 30 Aug 2016 21:12:48 +0000 (21:12 +0000)]
Fix memory leak by storing returned pointer in std::unique_ptr

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

8 years ago[test] Pass a fake libLTO.dylib to a driver test which depends on it
Vedant Kumar [Tue, 30 Aug 2016 20:36:50 +0000 (20:36 +0000)]
[test] Pass a fake libLTO.dylib to a driver test which depends on it

This makes it possible to run 'check-clang' on Darwin without building
libLTO.dylib. See r280142 for more context.

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

8 years agoRevert "[test] Add libLTO as a clang test dependency on Darwin"
Vedant Kumar [Tue, 30 Aug 2016 20:36:48 +0000 (20:36 +0000)]
Revert "[test] Add libLTO as a clang test dependency on Darwin"

This reverts commit r280142. Mehdi suggested a better way to fix up the
test: just create a fake libLTO.dylib and tell the driver where to find
it. Patch incoming...

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

8 years ago[test] Add libLTO as a clang test dependency on Darwin
Vedant Kumar [Tue, 30 Aug 2016 19:57:40 +0000 (19:57 +0000)]
[test] Add libLTO as a clang test dependency on Darwin

Running 'check-clang' on a stock checkout of llvm+clang doesn't work on
Darwin, because test/Driver/darwin-ld-lto.c can't find libLTO.dylib. Add
libLTO as a clang test dependency on Darwin to fix the problem.

Note: We don't have this issue with check-all because libLTO is in the
test-depends target.

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

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

8 years agoPR29166: when merging declarations with typedef names for linkage purposes,
Richard Smith [Tue, 30 Aug 2016 19:13:18 +0000 (19:13 +0000)]
PR29166: when merging declarations with typedef names for linkage purposes,
don't assume that the anonymous struct will be part of the most recent
declaration of the typedef.

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

8 years agoUnrevert r280035 now that the clang-cl bug it exposed has been fixed by
Richard Smith [Tue, 30 Aug 2016 19:06:26 +0000 (19:06 +0000)]
Unrevert r280035 now that the clang-cl bug it exposed has been fixed by
r280133. Original commit message:

C++ Modules TS: driver support for building modules.

This works as follows: we add --precompile to the existing gamut of options for
specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag
specifies that an input is taken to the precompilation step and no further, and
this can be specified when building a .pcm from a module interface or when
building a .pch from a header file.

The .cppm extension (and some related extensions) are implicitly recognized as
C++ module interface files. If --precompile is /not/ specified, the file is
compiled (via a .pcm) to a .o file containing the code for the module (and then
potentially also assembled and linked, if -S, -c, etc. are not specified). We
do not yet suppress the emission of object code for other users of the module
interface, so for now this will only work if everything in the .cppm file has
vague linkage.

As with the existing support for module-map modules, prebuilt modules can be
provided as compiler inputs either via the -fmodule-file= command-line argument
or via files named ModuleName.pcm in one of the directories specified via
-fprebuilt-module-path=.

This also exposes the -fmodules-ts cc1 flag in the driver. This is still
experimental, and in particular, the concrete syntax is subject to change as
the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does
not enable support for implicitly loading module maps nor building modules via
the module cache, but those features can be turned on separately and used in
conjunction with the Modules TS support.

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

8 years agoPR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) input types.
Richard Smith [Tue, 30 Aug 2016 18:55:16 +0000 (18:55 +0000)]
PR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) input types.

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

8 years agotypo + indentation [NFC]
Etienne Bergeron [Tue, 30 Aug 2016 18:38:25 +0000 (18:38 +0000)]
typo + indentation [NFC]

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

8 years agoBasic/Targets.cpp: Add polaris10 and polaris11 gpus
Niels Ole Salscheider [Tue, 30 Aug 2016 18:00:22 +0000 (18:00 +0000)]
Basic/Targets.cpp: Add polaris10 and polaris11 gpus

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

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

8 years agoFix colored diagnostics from tools
Olivier Goffart [Tue, 30 Aug 2016 17:42:29 +0000 (17:42 +0000)]
Fix colored diagnostics from tools

r271042 changed the way the diagnostic arguments are parsed. It assumes that
the diagnostics options were already parsed by the "Driver".
For tools using clang::Tooling, the diagnostics argument were not parsed.

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

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

8 years agoDisable clang/test/SemaTemplate/instantiation-depth-default.cpp temporarily for targe...
NAKAMURA Takumi [Tue, 30 Aug 2016 15:38:18 +0000 (15:38 +0000)]
Disable clang/test/SemaTemplate/instantiation-depth-default.cpp temporarily for targeting mingw32. It crashes. Investigating.

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

8 years ago[OpenCL] Make is_valid_event, create_user_event overloadable.
Alexey Bader [Tue, 30 Aug 2016 14:42:54 +0000 (14:42 +0000)]
[OpenCL] Make is_valid_event, create_user_event overloadable.

Summary: Make is_valid_event and create_user_event overloadable like other built-ins.

Patch by Evgeniy Tyurin.

Reviewers: bader, yaxunl

Subscribers: Anastasia, cfe-commits

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

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

8 years agoFix typo in comment
Nico Weber [Tue, 30 Aug 2016 14:24:28 +0000 (14:24 +0000)]
Fix typo in comment

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

8 years ago[Hexagon] Use handleTargetFeaturesGroup to process target-specific features
Krzysztof Parzyszek [Tue, 30 Aug 2016 14:17:10 +0000 (14:17 +0000)]
[Hexagon] Use handleTargetFeaturesGroup to process target-specific features

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

8 years agoRevert r280035 (and followups r280057, r280085), it caused PR30195
Nico Weber [Tue, 30 Aug 2016 14:12:06 +0000 (14:12 +0000)]
Revert r280035 (and followups r280057, r280085), it caused PR30195

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

8 years agoHandle -mlong-calls on Hexagon
Krzysztof Parzyszek [Tue, 30 Aug 2016 13:57:50 +0000 (13:57 +0000)]
Handle -mlong-calls on Hexagon

Differential Revision:://reviews.llvm.org/D22766

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

8 years agoclang/test/Driver/modules-ts.cpp: Satisfy quoted filename.
NAKAMURA Takumi [Tue, 30 Aug 2016 13:07:53 +0000 (13:07 +0000)]
clang/test/Driver/modules-ts.cpp: Satisfy quoted filename.

On win32, backslashed filename is emitted like;

  -o "C:\\bb-win\\ninja-clang-i686-msc19-R\\build\\tools\\clang\\test\\Driver\\Output\\modules-ts.cpp.tmp.o"

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

8 years agoFix for commit 280064 that break the build.
Sjoerd Meijer [Tue, 30 Aug 2016 08:56:00 +0000 (08:56 +0000)]
Fix for commit 280064 that break the build.

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

8 years agoThis adds new options -fdenormal-fp-math and passes through option -ffast-math
Sjoerd Meijer [Tue, 30 Aug 2016 08:09:45 +0000 (08:09 +0000)]
This adds new options -fdenormal-fp-math and passes through option -ffast-math
to CC1, which are translated to function attributes and can e.g. be mapped on
build attributes FP_exceptions and FP_denormal. Setting these build attributes
allows better selection of floating point libraries.

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

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

8 years agoCombine two FileCheck patterns to prevent overzealous matching of .*
Richard Smith [Tue, 30 Aug 2016 05:14:38 +0000 (05:14 +0000)]
Combine two FileCheck patterns to prevent overzealous matching of .*

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

8 years ago[PowerPC] Update the DWARF register-size table
Hal Finkel [Tue, 30 Aug 2016 02:38:34 +0000 (02:38 +0000)]
[PowerPC] Update the DWARF register-size table

The PPC64 DWARF register-size table did not match the ABI specification (or
GCC, for that matter). Fix that, and add a regression test.

Fixes PR27931.

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

8 years ago[sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep...
Kostya Serebryany [Tue, 30 Aug 2016 01:27:03 +0000 (01:27 +0000)]
[sanitizer-coverage] add two more modes of instrumentation: trace-div and trace-gep, mostly usaful for value-profile-based fuzzing; clang part

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

8 years ago[PowerPC] Add support for -mlongcall
Hal Finkel [Tue, 30 Aug 2016 01:07:03 +0000 (01:07 +0000)]
[PowerPC] Add support for -mlongcall

Add support for GCC's PowerPC -mlongcall option; the backend supports the
corresponding target feature as of r280040.

Fixes PR19098.

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

8 years agoC++ Modules TS: driver support for building modules.
Richard Smith [Tue, 30 Aug 2016 00:44:54 +0000 (00:44 +0000)]
C++ Modules TS: driver support for building modules.

This works as follows: we add --precompile to the existing gamut of options for
specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag
specifies that an input is taken to the precompilation step and no further, and
this can be specified when building a .pcm from a module interface or when
building a .pch from a header file.

The .cppm extension (and some related extensions) are implicitly recognized as
C++ module interface files. If --precompile is /not/ specified, the file is
compiled (via a .pcm) to a .o file containing the code for the module (and then
potentially also assembled and linked, if -S, -c, etc. are not specified). We
do not yet suppress the emission of object code for other users of the module
interface, so for now this will only work if everything in the .cppm file has
vague linkage.

As with the existing support for module-map modules, prebuilt modules can be
provided as compiler inputs either via the -fmodule-file= command-line argument
or via files named ModuleName.pcm in one of the directories specified via
-fprebuilt-module-path=.

This also exposes the -fmodules-ts cc1 flag in the driver. This is still
experimental, and in particular, the concrete syntax is subject to change as
the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does
not enable support for implicitly loading module maps nor building modules via
the module cache, but those features can be turned on separately and used in
conjunction with the Modules TS support.

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

8 years ago[cfi] Export __cfi_check when linking with -fsanitize-cfi-cross-dso.
Evgeniy Stepanov [Mon, 29 Aug 2016 23:42:34 +0000 (23:42 +0000)]
[cfi] Export __cfi_check when linking with -fsanitize-cfi-cross-dso.

Multi-DSO CFI model requires every DSO to export a __cfi_check function.

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

8 years agoFix typo in test.
Evgeniy Stepanov [Mon, 29 Aug 2016 23:15:46 +0000 (23:15 +0000)]
Fix typo in test.

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

8 years agoFix a bug preventing the cause for a module file-not-found from being displayed
Adrian Prantl [Mon, 29 Aug 2016 20:46:59 +0000 (20:46 +0000)]
Fix a bug preventing the cause for a module file-not-found from being displayed

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

8 years agoFix a bug preventing the cause of a module-out-of-date error from being printed
Adrian Prantl [Mon, 29 Aug 2016 20:46:56 +0000 (20:46 +0000)]
Fix a bug preventing the cause of a module-out-of-date error from being printed

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

8 years agoTry to fix clang-offload-bunder.c test once more
Reid Kleckner [Mon, 29 Aug 2016 16:24:57 +0000 (16:24 +0000)]
Try to fix clang-offload-bunder.c test once more

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

8 years ago[Coverage] Prevent creating a redundant counter if a nested body ends with a macro.
Igor Kudrin [Mon, 29 Aug 2016 11:48:50 +0000 (11:48 +0000)]
[Coverage] Prevent creating a redundant counter if a nested body ends with a macro.

If there were several nested statements arranged in a way that all of them
end up with the same macro, then the expansion of this macro was assigned
with all the corresponding counters of these statements.
As a result, the wrong counter value was shown for the macro in llvm-cov.

This patch fixes the issue by preventing adding a counter for an expanded
source range if it already has an assigned counter, which is expected
to come from the most specific statement.

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

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

8 years agoAST: improve layout of SimpleTypoCorrector
Saleem Abdulrasool [Sun, 28 Aug 2016 21:33:30 +0000 (21:33 +0000)]
AST: improve layout of SimpleTypoCorrector

Add the "explicit" specifier to the single-argument constructor of
SimpleTypoCorrector.  Reorder the fields to remove excessive padding (8 bytes).

Patch by Alexander Shaposhnikov!

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

8 years agoFix a typo in the doc: overriden -> overridden
Sylvestre Ledru [Sun, 28 Aug 2016 20:22:34 +0000 (20:22 +0000)]
Fix a typo in the doc: overriden -> overridden

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

8 years agoclang-cl: Support MSVC2015's /validate-charset flag.
Nico Weber [Fri, 26 Aug 2016 21:51:14 +0000 (21:51 +0000)]
clang-cl: Support MSVC2015's /validate-charset flag.

Clang always assumes that files are utf-8. If an invalidly encoded character is
used in an identifier, clang always errors. If it's used in a character
literal, clang warns Winvalid-source-encoding (on by default). Clang never
checks the encoding of things in comments (adding this seems like a nice
feature if it doesn't impact performance).

For cl.exe /utf-8 (which enables /validate-charset), if a bad character is used
in an identifier, it emits both an error and a warning. If it's used in a
literal or a comment, it emits a warning.

So mapping /validate-charset to -Winvalid-source-encoding seems like a fairly
decent fit.

https://reviews.llvm.org/D23945

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

8 years agoclang-cl: Accept MSVC2015's '/utf-8' flag.
Nico Weber [Fri, 26 Aug 2016 21:26:29 +0000 (21:26 +0000)]
clang-cl: Accept MSVC2015's '/utf-8' flag.

Clang always behaves as if that's passed, so just ignore the flag.

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

8 years agoclang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.
Nico Weber [Fri, 26 Aug 2016 21:11:43 +0000 (21:11 +0000)]
clang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.

Also makes -fexec-charset accept utf-8 case-insensitively.
Like https://reviews.llvm.org/D23807, but for execution-charset.
Also replace a few .lower() comparisons with equals_lower().

https://reviews.llvm.org/D23938

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

8 years agoDon't diagnose non-modular includes when we are not compiling a module.
Manman Ren [Fri, 26 Aug 2016 17:16:46 +0000 (17:16 +0000)]
Don't diagnose non-modular includes when we are not compiling a module.

This is triggered when we are compiling an implementation of a module,
it has relative includes to a VFS-mapped module with umbrella headers.
Currently we will find the real path to headers under the umbrella directory,
but the umbrella directories are using virtual path.

rdar://27951255

Thanks Ben and Richard for reviewing the patch!
Differential Revision: http://reviews.llvm.org/D23858

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

8 years agoAdd support for -fdiagnostics-absolute-paths: printing absolute paths in diagnostics
Hans Wennborg [Fri, 26 Aug 2016 15:45:36 +0000 (15:45 +0000)]
Add support for -fdiagnostics-absolute-paths: printing absolute paths in diagnostics

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

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

8 years agoSort list of driver-known file extensions. It was previously approximately
Richard Smith [Fri, 26 Aug 2016 00:41:59 +0000 (00:41 +0000)]
Sort list of driver-known file extensions. It was previously approximately
ordered by length then alphabetically; apply that order consistently.

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

8 years agoC++ Modules TS: add frontend support for building pcm files from module
Richard Smith [Fri, 26 Aug 2016 00:14:38 +0000 (00:14 +0000)]
C++ Modules TS: add frontend support for building pcm files from module
interface files. At the moment, all declarations (and no macros) are exported,
and 'export' declarations are not supported yet.

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

8 years agoWiden type of __offset_flags in RTTI on Mingw64
Reid Kleckner [Thu, 25 Aug 2016 22:16:30 +0000 (22:16 +0000)]
Widen type of __offset_flags in RTTI on Mingw64

Otherwise we can't handle secondary base classes at offsets greater than
2**24. This agrees with libstdc++abi.

We could extend this change to other LLP64 platforms, but then we would
want to update libc++abi and it would require additional review.

Fixes PR29116

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

8 years ago[MS] Win64 va_arg should expect large arguments to be passed indirectly
Reid Kleckner [Thu, 25 Aug 2016 20:42:26 +0000 (20:42 +0000)]
[MS] Win64 va_arg should expect large arguments to be passed indirectly

Fixes PR20569

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

8 years agoFix clang-offload-bundler.c test on Windows
Reid Kleckner [Thu, 25 Aug 2016 20:40:23 +0000 (20:40 +0000)]
Fix clang-offload-bundler.c test on Windows

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

8 years agoRefactor to remove the assumption that we know the name of the module we're emitting...
Richard Smith [Thu, 25 Aug 2016 18:26:30 +0000 (18:26 +0000)]
Refactor to remove the assumption that we know the name of the module we're emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input).

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

8 years agoOmit column info for CodeView by default
Adrian McCarthy [Thu, 25 Aug 2016 18:24:35 +0000 (18:24 +0000)]
Omit column info for CodeView by default

Clang tracks only start columns, not start-end ranges. CodeView allows for that, but the VS debugger doesn't handle anything less than a complete range well--it either highlights the wrong part of a statement or truncates source lines in the assembly view. It's better to have no column information at all.

So by default, we'll omit the column information for CodeView targeting Windows.

Since the column info is still useful for sanitizers, I've promoted -gcolumn-info (and -gno-column-info) to a CoreOption and added a couple tests to make sure that works for clang-cl.

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

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

8 years ago[MS] Pass non-trivially-copyable objects indirectly on Windows ARM
Reid Kleckner [Thu, 25 Aug 2016 18:23:28 +0000 (18:23 +0000)]
[MS] Pass non-trivially-copyable objects indirectly on Windows ARM

This isn't exactly what MSVC does, unfortunately. MSVC does not pass
objects with destructors but no copy constructors by address. More ARM
expertise is required to really understand what should be done here.

Fixes PR29136.

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

8 years ago[Sema][Comments] Add support for TypeAliasTemplate
Bruno Cardoso Lopes [Thu, 25 Aug 2016 17:09:33 +0000 (17:09 +0000)]
[Sema][Comments] Add support for TypeAliasTemplate

Emit proper diagnostics when -Wdocumentation is used with constructs such as:

  template<typename T>
  using fn = int(T aaa, int ccc);

Previously clang wouldn't recognize the function and complain with
'comment that is not attached to a function declaration'.

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

rdar://problem/27300695

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

8 years agoFix offload bundler test to support Windows new lines.
Samuel Antao [Thu, 25 Aug 2016 14:35:20 +0000 (14:35 +0000)]
Fix offload bundler test to support Windows new lines.

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

8 years agoclang-format: [JS] nested and tagged template strings.
Martin Probst [Thu, 25 Aug 2016 10:13:21 +0000 (10:13 +0000)]
clang-format: [JS] nested and tagged template strings.

JavaScript template strings can be nested arbitrarily:

    foo = `text ${es.map(e => { return `<${e}>`; })} text`;

This change lexes nested template strings using a stack of lexer states to
correctly switch back to template string lexing on closing braces.

Also, reuse the same stack for the token-stashed logic.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoFix memory leaks in clang-offload-bundler
Vitaly Buka [Thu, 25 Aug 2016 07:21:34 +0000 (07:21 +0000)]
Fix memory leaks in clang-offload-bundler

Summary:
1. Pair removed from StringMap was not destroyed
2. ObjectFile had no owner

Reviewers: sfantao

Subscribers: llvm-commits

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

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

8 years agoRemove a pointless LLVM_CONSTEXPR. NFC.
George Burgess IV [Thu, 25 Aug 2016 01:54:37 +0000 (01:54 +0000)]
Remove a pointless LLVM_CONSTEXPR. NFC.

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

8 years agoLazily load the ContextDecl for a lambda's DefinitionData, to fix a
Richard Smith [Thu, 25 Aug 2016 00:34:00 +0000 (00:34 +0000)]
Lazily load the ContextDecl for a lambda's DefinitionData, to fix a
deserialization cycle caused by the ContextDecl recursively importing members
of the lambda's closure type.

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

8 years ago[Sema][Comments] Factor out function type loc logic. NFCI
Bruno Cardoso Lopes [Thu, 25 Aug 2016 00:22:08 +0000 (00:22 +0000)]
[Sema][Comments] Factor out function type loc logic. NFCI

This is in prepatation for @param TypeAliasTemplate support.

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

8 years agoDebugInfo: Let -gsplit-dwarf and -gmlt compose if -fno-split-dwarf-inlining is used
David Blaikie [Wed, 24 Aug 2016 23:22:36 +0000 (23:22 +0000)]
DebugInfo: Let -gsplit-dwarf and -gmlt compose if -fno-split-dwarf-inlining is used

If the inline info is not duplicated into the skeleton CU, then there's
value in using -gsplit-dwarf and -gmlt together (to keep all those extra
subprograms out of the skeleton CU, while also producing smaller .dwo
files)

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

8 years ago[Order Files] On Darwin use DTrace's oneshot probe
Chris Bieneman [Wed, 24 Aug 2016 22:09:46 +0000 (22:09 +0000)]
[Order Files] On Darwin use DTrace's oneshot probe

The oneshot probe only gets executed the first time the probe is hit in the process. For order file generation this is really all we care about.

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

8 years agoDisable test under asan: it uses a lot of stack, and asan increases the
Richard Smith [Wed, 24 Aug 2016 21:30:00 +0000 (21:30 +0000)]
Disable test under asan: it uses a lot of stack, and asan increases the
per-frame stack usage enough to cause it to hit our stack limit. This is not
ideal; we should find a better way of dealing with this, such as increasing
our stack allocation when built with ASan.

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

8 years agoPR29097: add an update record when we instantiate the default member
Richard Smith [Wed, 24 Aug 2016 21:25:37 +0000 (21:25 +0000)]
PR29097: add an update record when we instantiate the default member
initializer of an imported field.

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

8 years ago[Sema][Comments] Support @param with c++ 'using' keyword
Bruno Cardoso Lopes [Wed, 24 Aug 2016 21:11:43 +0000 (21:11 +0000)]
[Sema][Comments] Support @param with c++ 'using' keyword

Give appropriate warnings with -Wdocumentation for @param comments
that refer to function aliases defined with 'using'. Very similar
to typedef's behavior. This does not add support for
TypeAliasTemplateDecl yet.

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

rdar://problem/27300695

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

8 years agoFix offload bundler tests so that diagnostic can start with caps.
Samuel Antao [Wed, 24 Aug 2016 18:52:18 +0000 (18:52 +0000)]
Fix offload bundler tests so that diagnostic can start with caps.

Windows require that.

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

8 years agoDebugInfo: Add flag to CU to disable emission of inline debug info into the skeleton CU
David Blaikie [Wed, 24 Aug 2016 18:29:58 +0000 (18:29 +0000)]
DebugInfo: Add flag to CU to disable emission of inline debug info into the skeleton CU

In cases where .dwo/.dwp files are guaranteed to be available, skipping
the extra online (in the .o file) inline info can save a substantial
amount of space - see the original r221306 for more details there.

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

8 years agoclang-offload-bundler: Update libdeps.
NAKAMURA Takumi [Wed, 24 Aug 2016 17:05:48 +0000 (17:05 +0000)]
clang-offload-bundler: Update libdeps.

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

8 years agofix typo "varaible"
Nico Weber [Wed, 24 Aug 2016 16:37:21 +0000 (16:37 +0000)]
fix typo "varaible"

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

8 years agoAdd target REQUIRES directives to offload bundler test.
Samuel Antao [Wed, 24 Aug 2016 15:47:06 +0000 (15:47 +0000)]
Add target REQUIRES directives to offload bundler test.

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

8 years ago[Driver][OpenMP][CUDA] Add capability to bundle object files in sections of the host...
Samuel Antao [Wed, 24 Aug 2016 15:39:07 +0000 (15:39 +0000)]
[Driver][OpenMP][CUDA] Add capability to bundle object files in sections of the host binary format.

Summary:
This patch adds the capability to bundle object files in sections of the host binary using a designated naming convention for these sections. This patch uses the functionality of the object reader already in the LLVM library to read bundled files, and invokes clang with the incremental linking options to create bundle files.

Bundling files involves creating an IR file with the contents of the bundle assigned as initializers of globals binded to the designated sections. This way the bundling implementation is agnostic of the host object format.

The features added by this patch were requested in the RFC discussion in  http://lists.llvm.org/pipermail/cfe-dev/2016-February/047547.html.

Reviewers: echristo, tra, jlebar, hfinkel, ABataev, Hahnfeld

Subscribers: mkuron, whchung, cfe-commits, andreybokhanko, Hahnfeld, arpith-jacob, carlo.bertolli, mehdi_amini, caomhin

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

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

8 years agoclang-offload-bundler - offload files bundling/unbundling tool
Samuel Antao [Wed, 24 Aug 2016 15:21:05 +0000 (15:21 +0000)]
clang-offload-bundler - offload files bundling/unbundling tool

Summary:
One of the goals of programming models that support offloading (e.g. OpenMP) is to enable users to offload with little effort, by annotating the code with a few pragmas. I'd also like to save users the trouble of changing their existent applications' build system. So having the compiler always return a single file instead of one for the host and each target even if the user is doing separate compilation is desirable.

This diff proposes a tool named clang-offload-bundler (happy to change the name if required) that is used to bundle files associated with the same user source file but different targets, or to unbundle a file into separate files associated with different targets.

This tool supports the driver support for OpenMP under review in http://reviews.llvm.org/D9888. The tool is used there to enable separate compilation, so that the very first action on input files that are not source files is a "unbundling action" and the very last non-linking action is a "bundling action".

The format of the bundled files is currently very simple: text formats are concatenated with comments that have a magic string and target identifying triple in between, and binary formats have a header that contains the triple and the offset and size of the code for host and each target.

The goal is to improve this tool in the future to deal with archive files so that each individual file in the archive is properly dealt with. We see that archives are very commonly used in current applications to combine separate compilation results. So I'm convinced users would enjoy this feature.

This tool can be used like this:

`clang-offload-bundler -targets=triple1,triple2 -type=ii -inputs=a.triple1.ii,a.triple2.ii -outputs=a.ii`

or

`clang-offload-bundler -targets=triple1,triple2 -type=ii -outputs=a.triple1.ii,a.triple2.ii -inputs=a.ii -unbundle`

I implemented the tool under clang/tools. Please let me know if something like this should live somewhere else.

This patch is prerequisite for http://reviews.llvm.org/D9888.

Reviewers: hfinkel, rsmith, echristo, chandlerc, tra, jlebar, ABataev, Hahnfeld

Subscribers: whchung, caomhin, andreybokhanko, arpith-jacob, carlo.bertolli, mehdi_amini, guansong, Hahnfeld, cfe-commits

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

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

8 years ago[AST] Make InitListExpr::isExplicit const (NFC)
Vedant Kumar [Wed, 24 Aug 2016 06:44:57 +0000 (06:44 +0000)]
[AST] Make InitListExpr::isExplicit const (NFC)

Patch by Alexander Shaposhnikov!

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

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

8 years ago[Pragma] Clear loop distribution attribute between loops
Adam Nemet [Wed, 24 Aug 2016 04:31:56 +0000 (04:31 +0000)]
[Pragma] Clear loop distribution attribute between loops

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

8 years agoRemove excessive padding from PTHStatData (NFC)
Mehdi Amini [Wed, 24 Aug 2016 04:26:57 +0000 (04:26 +0000)]
Remove excessive padding from PTHStatData (NFC)

This diff reorders the fields and removes excessive padding.
This fixes the following warning:

PTHLexer.cpp:629:7: warning: Excessive padding in 'class (anonymous namespace)::PTHStatData' (14 padding bytes, where 6 is optimal). Optimal fields order: Size, ModTime, UniqueID, HasData, IsDirectory, consider reordering the fields or adding explicit padding members.

Patch by: Alexander Shaposhnikov <shal1t712@gmail.com>

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

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

8 years agoAdding an additional test to ensure the frame pointer is emitted
Douglas Yung [Wed, 24 Aug 2016 02:02:32 +0000 (02:02 +0000)]
Adding an additional test to ensure the frame pointer is emitted
when compiling with optimization when PS4 is the target.

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

8 years agoFix member call on null pointer, found by sanitizer buildbot.
Richard Smith [Tue, 23 Aug 2016 21:12:54 +0000 (21:12 +0000)]
Fix member call on null pointer, found by sanitizer buildbot.

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

8 years agodriver: Support checking for rlimits via cmake (when bootstrapping)
Chris Bieneman [Tue, 23 Aug 2016 20:07:07 +0000 (20:07 +0000)]
driver: Support checking for rlimits via cmake (when bootstrapping)

Summary:
Add a cmake check for sys/resource.h and replace the __has_include() check with its result, in order to make it possible to use rlimits when building with compilers not supporting __has_include() -- i.e. when bootstrapping.

// Please also re-apply dfcd52eb1d8e5d322404b40414cb7331c7380a8c (llvm-config.h fix)

Patch by: Michał Górny

Reviewers: rsmith, beanz

Subscribers: cfe-commits

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

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

8 years agoRemove two dos line endings.
Nico Weber [Tue, 23 Aug 2016 19:59:55 +0000 (19:59 +0000)]
Remove two dos line endings.

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

8 years agoFix regression introduced by r279164: only pass definitions as the PatternDef
Richard Smith [Tue, 23 Aug 2016 19:41:39 +0000 (19:41 +0000)]
Fix regression introduced by r279164: only pass definitions as the PatternDef
to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly
determine whether a function definition is visible, and mark both the function
and the template as visible when merging function template definitions to
provide hasVisibleDefinition with the relevant information.

The change to always pass the right declaration as the PatternDef to
DiagnoseUninstantiableTemplate also caused those checks to happen before other
diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the
same situations, so I sunk the relevant diagnostics into
DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes
in reviews.llvm.org/D23492 by Vassil Vassilev.

This reinstates r279486, reverted in r279500, with a fix to
DiagnoseUninstantiableTemplate to only mark uninstantiable explicit
instantiation declarations as invalid if we actually diagnosed them. (When we
trigger an explicit instantiation of a class member from an explicit
instantiation declaration for the class, it's OK if there is no corresponding
definition and we certainly don't want to mark the member invalid in that
case.) This previously caused a build failure during bootstrap.

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

8 years agoclang-cl: Make /Brepro actually work.
Nico Weber [Tue, 23 Aug 2016 19:32:02 +0000 (19:32 +0000)]
clang-cl: Make /Brepro actually work.

/Brepro means we want reproducible builds, i.e. we _don't_ want the timestamp
that's needed to be compatible with the incremental linker.

https://reviews.llvm.org/D23805

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

8 years agoARM-Darwin: ignore and diagnose attempts to omit frame pointer.
Tim Northover [Tue, 23 Aug 2016 18:12:58 +0000 (18:12 +0000)]
ARM-Darwin: ignore and diagnose attempts to omit frame pointer.

iOS (and other 32-bit ARM variants) always require a valid frame pointer to
improve backtraces. Previously the -fomit-frame-pointer and
-momit-leaf-frame-pointer options were being silently discarded via hacks in
the backend. It's better if Clang configures itself to emit the correct IR and
warns about (ignored) attempts to override this.

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

8 years agoclang-cl: Accept MSVC 2015's `/source-charset:utf-8` flag.
Nico Weber [Tue, 23 Aug 2016 16:47:09 +0000 (16:47 +0000)]
clang-cl: Accept MSVC 2015's `/source-charset:utf-8` flag.

clang already treats all inputs as utf-8. Warn if anything but utf-8 is passed.

Do this by mapping source-charset to finput-charset, which already behaves like
this. Slightly tweak finput-charset to accept "utf-8" case-insensitively. This
matches gcc's and cl.exe's behavior, and IANA says that character set names are
case-insensitive.

https://reviews.llvm.org/D23807

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

8 years ago[analyzer] Fix CloneDetector crash on calling methods of class templates.
Artem Dergachev [Tue, 23 Aug 2016 16:42:00 +0000 (16:42 +0000)]
[analyzer] Fix CloneDetector crash on calling methods of class templates.

If a call expression represents a method call of a class template,
and the method itself isn't templated, then the method may be considered
to be a template instantiation without template specialization arguments.

No longer crash when we could not find template specialization arguments.

Patch by Raphael Isemann!

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

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

8 years agoRevert r279486 "Fix regression introduced by r279164"
Chandler Carruth [Tue, 23 Aug 2016 02:00:51 +0000 (02:00 +0000)]
Revert r279486 "Fix regression introduced by r279164"

Build bots seem unhappy and as Richard was leaving he asked me to revert
this for him. Doing so.

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

8 years agoTypo.
Adrian Prantl [Mon, 22 Aug 2016 22:38:18 +0000 (22:38 +0000)]
Typo.

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

8 years agoAdd comments. NFC
Adrian Prantl [Mon, 22 Aug 2016 22:38:16 +0000 (22:38 +0000)]
Add comments. NFC

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

8 years agoAdd the second half of the testcase I should have added in 279485.
Adrian Prantl [Mon, 22 Aug 2016 22:30:34 +0000 (22:30 +0000)]
Add the second half of the testcase I should have added in 279485.

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

8 years agoFix regression introduced by r279164: only pass definitions as the PatternDef
Richard Smith [Mon, 22 Aug 2016 22:25:03 +0000 (22:25 +0000)]
Fix regression introduced by r279164: only pass definitions as the PatternDef
to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly
determine whether a function definition is visible, and mark both the function
and the template as visible when merging function template definitions to
provide hasVisibleDefinition with the relevant information.

The change to always pass the right declaration as the PatternDef to
DiagnoseUninstantiableTemplate also caused those checks to happen before other
diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the
same situations, so I sunk the relevant diagnostics into
DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes
in reviews.llvm.org/D23492 by Vassil Vassilev.

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

8 years agoModule debug info: Don't assert when encountering an incomplete definition
Adrian Prantl [Mon, 22 Aug 2016 22:23:58 +0000 (22:23 +0000)]
Module debug info: Don't assert when encountering an incomplete definition
in isDefinedInClangModule() and assume that the incomplete definition
is not defined in the module.

This broke the -gmodules self host recently.
rdar://problem/27894367

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

8 years ago[SemaObjC] Do not RebuildObjCMessageExpr without valid method decl
Bruno Cardoso Lopes [Mon, 22 Aug 2016 21:50:22 +0000 (21:50 +0000)]
[SemaObjC] Do not RebuildObjCMessageExpr without valid method decl

Fix crash-on-invalid in ObjC Sema by avoiding to rebuild a message
expression to a 'super' class in case the method to call does not exist
(i.e. comes from another missing identifier).

In this case, the typo transform is invoked upon the message expression
in an attempt to solve a typo in a 'super' call parameters, but it
crashes since it assumes the method to call has a valid declaration.

rdar://problem/27305403

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

8 years ago[AST] Remove unused function, to silence a GCC7 warning.
Davide Italiano [Mon, 22 Aug 2016 21:33:12 +0000 (21:33 +0000)]
[AST] Remove unused function, to silence a GCC7 warning.

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

8 years ago[GraphTraits] Replace all NodeType usage with NodeRef
Tim Shen [Mon, 22 Aug 2016 21:09:30 +0000 (21:09 +0000)]
[GraphTraits] Replace all NodeType usage with NodeRef

This should finish the GraphTraits migration.

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

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

8 years agoAMDGPU: Handle structs directly in AMDGPUABIInfo
Matt Arsenault [Mon, 22 Aug 2016 19:25:59 +0000 (19:25 +0000)]
AMDGPU: Handle structs directly in AMDGPUABIInfo

Structs are currently handled as pointer + byval, which makes AMDGPU
LLVM backend generate incorrect code when structs are used. This patch
changes struct argument to be handled directly and without flattening,
which Clover (Mesa 3D Gallium OpenCL state tracker) will be able to
handle. Flattening would expand the struct to individual elements and
pass each as a separate argument, which Clover can not
handle. Furthermore, such expansion does not fit the OpenCL
programming model which requires to explicitely specify each argument
index, size and memory location.

Patch by Vedran Miletić

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

8 years agoADT: Remove uses of ilist_*sentinel_traits, NFC
Duncan P. N. Exon Smith [Mon, 22 Aug 2016 18:57:44 +0000 (18:57 +0000)]
ADT: Remove uses of ilist_*sentinel_traits, NFC

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

8 years ago[CUDA] Collapsed offload actions should not be top-level jobs.
Artem Belevich [Mon, 22 Aug 2016 18:50:34 +0000 (18:50 +0000)]
[CUDA] Collapsed offload actions should not be top-level jobs.

If they are, we end up with the last intermediary output preserved
in the current directory after compilation.

Added a test case to verify that we're using appropriate filenames
for outputs of different phases.

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

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

8 years agoPR29086: DebugInfo: Improve support for fixed array dimensions in variable length...
David Blaikie [Mon, 22 Aug 2016 17:49:56 +0000 (17:49 +0000)]
PR29086: DebugInfo: Improve support for fixed array dimensions in variable length arrays

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

8 years agoRemove redundant test
David Blaikie [Mon, 22 Aug 2016 17:49:50 +0000 (17:49 +0000)]
Remove redundant test

test/CodeGenCXX/debug-info-zero-length-arrays.cpp tests this
functionality more comprehensively

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

8 years agoclang-format: [JS] supports casts to types starting with punctuation ("{[(").
Martin Probst [Mon, 22 Aug 2016 14:23:30 +0000 (14:23 +0000)]
clang-format: [JS] supports casts to types starting with punctuation ("{[(").

Before:

    x as{x: number}

After:

    x as {x: number}

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

8 years agoReapply "[analyzer] Added valist related checkers."
Gabor Horvath [Mon, 22 Aug 2016 11:21:30 +0000 (11:21 +0000)]
Reapply "[analyzer] Added valist related checkers."

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

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

8 years ago[analyzer] Correctly add assumptions based on array bounds.
Gabor Horvath [Mon, 22 Aug 2016 10:07:32 +0000 (10:07 +0000)]
[analyzer] Correctly add assumptions based on array bounds.

Also simplify the constraints generated by the checker.

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

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

8 years agoTest commit (Removing trailing whitespace).
Elad Cohen [Mon, 22 Aug 2016 07:34:21 +0000 (07:34 +0000)]
Test commit (Removing trailing whitespace).

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

8 years ago[X86][AVX512F] minor fix of the parameter names
Asaf Badouh [Sun, 21 Aug 2016 07:56:47 +0000 (07:56 +0000)]
[X86][AVX512F] minor fix of the parameter names
add "__" prefix

Bug 28842 https://llvm.org/bugs/show_bug.cgi?id=29040

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

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

8 years agoWdocumentation fix
Simon Pilgrim [Sat, 20 Aug 2016 20:21:27 +0000 (20:21 +0000)]
Wdocumentation fix

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

8 years ago[analyzer] Use faster hashing (MD5) in CloneDetector.
Artem Dergachev [Sat, 20 Aug 2016 17:35:53 +0000 (17:35 +0000)]
[analyzer] Use faster hashing (MD5) in CloneDetector.

This replaces the old approach of fingerprinting every AST node into a string,
which avoided collisions and was simple to implement, but turned out to be
extremely ineffective with respect to both performance and memory.

The collisions are now dealt with in a separate pass, which no longer causes
performance problems because collisions are rare.

Patch by Raphael Isemann!

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

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

8 years ago[Sema] Don't crash on scanf on forward-declared enums.
Benjamin Kramer [Sat, 20 Aug 2016 16:51:33 +0000 (16:51 +0000)]
[Sema] Don't crash on scanf on forward-declared enums.

This is valid in GNU C, which allows pointers to incomplete enums. GCC
just pretends that the underlying type is 'int' in those cases, follow
that behavior.

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