]> granicus.if.org Git - clang/log
clang
7 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

7 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

7 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

7 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

7 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

7 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

7 years agoPR28423: Compare primary declaration contexts.
Vassil Vassilev [Sat, 20 Aug 2016 14:50:22 +0000 (14:50 +0000)]
PR28423: Compare primary declaration contexts.

In certain cases (mostly coming from modules), Sema's idea of the StdNamespace
does not point to the first declaration of namespace std.

Patch by Cristina Cristescu!

Reviewed by Richard Smith.

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

7 years ago[analyzer] Make CloneDetector consider macro expansions.
Artem Dergachev [Sat, 20 Aug 2016 10:06:59 +0000 (10:06 +0000)]
[analyzer] Make CloneDetector consider macro expansions.

So far macro-generated code was treated by the CloneDetector as normal code.
This caused that some macros where reported as false-positive clones because
large chunks of code coming from otherwise concise macro expansions were treated
as copy-pasted code.

This patch ensures that macros are treated in the same way as literals/function
calls. This prevents macros that expand into multiple statements
from being reported as clones.

Patch by Raphael Isemann!

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

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

7 years ago[analyzer] Make CloneDetector consider template arguments.
Artem Dergachev [Sat, 20 Aug 2016 09:57:21 +0000 (09:57 +0000)]
[analyzer] Make CloneDetector consider template arguments.

For example, code samples `isa<Stmt>(S)' and `isa<Expr>(S)'
are no longer considered to be clones.

Patch by Raphael Isemann!

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

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

7 years agoRevert r279351 and r279357 due to bot failures
Manman Ren [Sat, 20 Aug 2016 03:00:54 +0000 (03:00 +0000)]
Revert r279351 and r279357 due to bot failures

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

7 years agoFix windows bot
Manman Ren [Sat, 20 Aug 2016 02:28:15 +0000 (02:28 +0000)]
Fix windows bot

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

7 years ago[NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.
Manman Ren [Sat, 20 Aug 2016 00:04:21 +0000 (00:04 +0000)]
[NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.

This is in preparation of adding a new type class ObjCTypeParamType that
can take protocol qualifiers. ObjCProtocolQualifiers will be shared between
ObjCObjectType and ObjCTypeParamType.

rdar://24619481
rdar://25060179

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

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

7 years ago[Driver] Remove unused #include of llvm/Support/config.h
Vedant Kumar [Fri, 19 Aug 2016 23:15:35 +0000 (23:15 +0000)]
[Driver] Remove unused #include of llvm/Support/config.h

This is a follow-up to r279112 (which removed the need for the header)
and in the same spirit as r279035 (which attempted to un-break
out-of-tree builds).

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

7 years ago[www] Add nullability questions to analyzer FAQ.
Devin Coughlin [Fri, 19 Aug 2016 22:04:45 +0000 (22:04 +0000)]
[www] Add nullability questions to analyzer FAQ.

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

7 years ago[CallGraph] Use decltype instead of pointer_to_unary_function. NFC.
Tim Shen [Fri, 19 Aug 2016 21:52:42 +0000 (21:52 +0000)]
[CallGraph] Use decltype instead of pointer_to_unary_function. NFC.

Reviewers: dblaikie

Subscribers: cfe-commits

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

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

7 years ago[GraphTraits] Make nodes_iterator dereference to NodeType*/NodeRef
Tim Shen [Fri, 19 Aug 2016 21:20:13 +0000 (21:20 +0000)]
[GraphTraits] Make nodes_iterator dereference to NodeType*/NodeRef

Currently nodes_iterator may dereference to a NodeType* or a NodeType&. Make them all dereference to NodeType*, which is NodeRef later.

Differential Revision: https://reviews.llvm.org/D23704
Differential Revision: https://reviews.llvm.org/D23705

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

7 years agoclang-format: [JS] handle object literals with casts.
Martin Probst [Fri, 19 Aug 2016 14:35:01 +0000 (14:35 +0000)]
clang-format: [JS] handle object literals with casts.

Summary: E.g. `{a: 1} as b`.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years agoFixed a typo (compilation_commands.json --> compile_commands.json).
Andrey Bokhanko [Fri, 19 Aug 2016 13:36:31 +0000 (13:36 +0000)]
Fixed a typo (compilation_commands.json --> compile_commands.json).

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

7 years ago[AMDGPU] add s_incperflevel/s_decperflevel builtins
Valery Pykhtin [Fri, 19 Aug 2016 12:54:31 +0000 (12:54 +0000)]
[AMDGPU] add s_incperflevel/s_decperflevel builtins

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

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

7 years agoclang/test/Modules/prebuilt-module.m: Prune "-triple" to fix a configuration mismatch.
NAKAMURA Takumi [Fri, 19 Aug 2016 05:25:26 +0000 (05:25 +0000)]
clang/test/Modules/prebuilt-module.m: Prune "-triple" to fix a configuration mismatch.

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

7 years agoRe-commit [OpenCL] AMDGCN: Fix size_t type
Yaxun Liu [Fri, 19 Aug 2016 05:17:25 +0000 (05:17 +0000)]
Re-commit [OpenCL] AMDGCN: Fix size_t type

There was a premature cast to pointer type in emitPointerArithmetic which caused assertion in tests with assertion enabled.

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

7 years agoC++ Modules TS: support parsing the 'module' declaration (including extensions
Richard Smith [Fri, 19 Aug 2016 01:43:06 +0000 (01:43 +0000)]
C++ Modules TS: support parsing the 'module' declaration (including extensions
from p0273r0 approved by EWG). We'll eventually need to handle this from the
lexer as well, in order to disallow preprocessor directives preceding the
module declaration and to support macro import.

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

7 years ago[www] Add analyzer FAQ about not releasing ivars in -dealloc.
Devin Coughlin [Fri, 19 Aug 2016 01:22:50 +0000 (01:22 +0000)]
[www] Add analyzer FAQ about not releasing ivars in -dealloc.

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

7 years ago[analyzer] Weaken assertion in trackNullOrUndefValue()
Devin Coughlin [Fri, 19 Aug 2016 01:05:31 +0000 (01:05 +0000)]
[analyzer] Weaken assertion in trackNullOrUndefValue()

We should ignore paren casts when making sure that the semantic expression
in a PseudoObjectExpr for an ObjC getter is a message send.

This has no other intended functionality change.

Adding a test for this exposed an interesting issue in another test case
that only manifests under ARC. trackNullOrUndefValue() is not properly
suppressing for nil values that are the result of nil propagation from a nil
receiver when the nil is returned from a function. I've added a FIXME for that
missing suppression.

rdar://problem/27290568

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

7 years agoAMDGPU: Add clang builtin for ds_swizzle.
Changpeng Fang [Thu, 18 Aug 2016 22:04:54 +0000 (22:04 +0000)]
AMDGPU: Add clang builtin for ds_swizzle.

Summary:
  int __builtin_amdgcn_ds_swizzle (int a, int imm);
while imm is a constant.

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

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

7 years agoPR28794: Don't try to instantiate function templates which are not visible.
Vassil Vassilev [Thu, 18 Aug 2016 22:01:25 +0000 (22:01 +0000)]
PR28794: Don't try to instantiate function templates which are not visible.

Reviewed by Richard Smith.

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

7 years agoC++ Modules TS: Add parsing support for module import declaration.
Richard Smith [Thu, 18 Aug 2016 21:59:42 +0000 (21:59 +0000)]
C++ Modules TS: Add parsing support for module import declaration.

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

7 years agoCodeGen: Rename a variable to better fit LLVM style. NFC
Justin Bogner [Thu, 18 Aug 2016 21:46:54 +0000 (21:46 +0000)]
CodeGen: Rename a variable to better fit LLVM style. NFC

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

7 years agoCodeGen: use range based for loop, NFC
Saleem Abdulrasool [Thu, 18 Aug 2016 21:40:06 +0000 (21:40 +0000)]
CodeGen: use range based for loop, NFC

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

7 years agoFixed more signed/unsigned mismatch warnings introduced in my change at r279076
Cameron Desrochers [Thu, 18 Aug 2016 20:56:48 +0000 (20:56 +0000)]
Fixed more signed/unsigned mismatch warnings introduced in my change at r279076

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

7 years ago[CUDA] Improve handling of math functions.
Justin Lebar [Thu, 18 Aug 2016 20:43:13 +0000 (20:43 +0000)]
[CUDA] Improve handling of math functions.

Summary:
A bunch of related changes here to our CUDA math headers.

- The second arg to nexttoward is a double (well, technically, long
  double, but we don't have that), not a float.

- Add a forward-declare of llround(float), which is defined in the CUDA
  headers.  We need this for the same reason we need most of the other
  forward-declares: To prevent a constexpr function in our standard
  library from becoming host+device.

- Add nexttowardf implementation.

- Pull "foobarf" functions defined by the CUDA headers in the global
  namespace into namespace std.  This lets you do e.g. std::sinf.

- Add overloads for math functions accepting integer types.  This lets
  you do e.g. std::sin(0) without having an ambiguity between the
  overload that takes a float and the one that takes a double.

With these changes, we pass testcases derived from libc++ for cmath and
math.h.  We can check these testcases in to the test-suite once support
for CUDA lands there.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years agoRevert [OpenCL] AMDGCN: Fix size_t type
Yaxun Liu [Thu, 18 Aug 2016 20:01:06 +0000 (20:01 +0000)]
Revert [OpenCL] AMDGCN: Fix size_t type

due to regressions in test/CodeGen/exprs.c on certain platforms.

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

7 years agoFix json compilation database syntax on non-Windows.
Zachary Turner [Thu, 18 Aug 2016 19:42:00 +0000 (19:42 +0000)]
Fix json compilation database syntax on non-Windows.

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

7 years ago[OpenCL] AMDGCN: Fix size_t type
Yaxun Liu [Thu, 18 Aug 2016 19:34:04 +0000 (19:34 +0000)]
[OpenCL] AMDGCN: Fix size_t type

Pointers of certain GPUs in AMDGCN target in private address space is 32 bit but pointers in other address spaces are 64 bit. size_t type should be defined as 64 bit for these GPUs so that it could hold pointers in all address spaces. Also fixed issues in pointer arithmetic codegen by using pointer specific intptr type.

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

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

7 years agoResubmit "[Tooling] Parse compilation database command lines on Windows."
Zachary Turner [Thu, 18 Aug 2016 19:31:48 +0000 (19:31 +0000)]
Resubmit "[Tooling] Parse compilation database command lines on Windows."

This patch introduced the ability to decide at runtime whether to parse
JSON compilation database command lines using Gnu syntax or Windows
syntax.  However, there were many existing unit tests written that
hardcoded Gnu-specific paths.  These tests were now failing because
the auto-detection logic was choosing to parse them using Windows
rules.

This resubmission of the patch fixes this by introducing an enum
which defines the syntax mode, which defaults to auto-detect, but
for which the unit tests force Gnu style parsing.

Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23628

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

7 years ago[MS] Silence -Wextern-init on const selectany variables
Reid Kleckner [Thu, 18 Aug 2016 18:45:07 +0000 (18:45 +0000)]
[MS] Silence -Wextern-init on const selectany variables

In C, 'extern' is typically used to avoid tentative definitions when
declaring variables in headers, but adding an intializer makes it a
defintion. This is somewhat confusing, so GCC and Clang both warn on it.
In C++, 'extern' is often used to give implictly static 'const'
variables external linkage, so don't warn in that case. If selectany is
present, this might be header code intended for C and C++ inclusion, so
apply the C++ rules.

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

7 years agoRemoved use of 'emplace' on std::map, since not all buildbot slaves support it
Cameron Desrochers [Thu, 18 Aug 2016 18:41:41 +0000 (18:41 +0000)]
Removed use of 'emplace' on std::map, since not all buildbot slaves support it

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

7 years agoUse __has_include rather than a configure-time macro to determine if
Richard Smith [Thu, 18 Aug 2016 18:22:22 +0000 (18:22 +0000)]
Use __has_include rather than a configure-time macro to determine if
<sys/resource.h> is available. This should fix out-of-tree builds, at the cost
of not providing the higher rlimits to stage 1 clang when built with an old
host compiler not implementing this feature yet (bootstrap builds should be
fine, though).

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

7 years agoRevert "[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds"
Vedant Kumar [Thu, 18 Aug 2016 17:43:02 +0000 (17:43 +0000)]
Revert "[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds"

This reverts commit r279035. According to Richard Smith, llvm-config.h
does not contain the right definitions.

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

7 years agoModule: add -fprebuilt-module-path to support loading prebuilt modules.
Manman Ren [Thu, 18 Aug 2016 17:42:15 +0000 (17:42 +0000)]
Module: add -fprebuilt-module-path to support loading prebuilt modules.

In this mode, there is no need to load any module map and the programmer can
simply use "@import" syntax to load the module directly from a prebuilt
module path. When loading from prebuilt module path, we don't support
rebuilding of the module files and we ignore compatible configuration
mismatches.

rdar://27290316
Differential Revision: http://reviews.llvm.org/D23125

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

7 years ago[libclang] Added missing entry for newly introduced 'clang_getAllSkippedRanges' to...
Cameron Desrochers [Thu, 18 Aug 2016 17:18:03 +0000 (17:18 +0000)]
[libclang] Added missing entry for newly introduced 'clang_getAllSkippedRanges' to libclang.exports

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

7 years ago[libclang] Fixed signed/unsigned comparison warning introduced in my revision r279076
Cameron Desrochers [Thu, 18 Aug 2016 16:25:42 +0000 (16:25 +0000)]
[libclang] Fixed signed/unsigned comparison warning introduced in my revision r279076

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

7 years ago[libclang] Add clang_getAllSkippedRanges function
Cameron Desrochers [Thu, 18 Aug 2016 15:43:55 +0000 (15:43 +0000)]
[libclang] Add clang_getAllSkippedRanges function

This complements the clang_getSkippedRanges function which returns skipped ranges filtered by a specific file.

This function is useful when all the ranges are desired (and a lot more efficient than the equivalent of asking for the ranges file by file, since the implementation of clang_getSkippedRanges iterates over all ranges anyway).

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

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

7 years ago[analyzer] Teach CloneDetector to find clones that look like copy-paste errors.
Artem Dergachev [Thu, 18 Aug 2016 12:29:41 +0000 (12:29 +0000)]
[analyzer] Teach CloneDetector to find clones that look like copy-paste errors.

The original clone checker tries to find copy-pasted code that is exactly
identical to the original code, up to minor details.

As an example, if the copy-pasted code has all references to variable 'a'
replaced with references to variable 'b', it is still considered to be
an exact clone.

The new check finds copy-pasted code in which exactly one variable seems
out of place compared to the original code, which likely indicates
a copy-paste error (a variable was forgotten to be renamed in one place).

Patch by Raphael Isemann!

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

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

7 years agoCorrect the documentation for isSignedInteger() and isUnsignedInteger().
Aaron Ballman [Thu, 18 Aug 2016 12:26:17 +0000 (12:26 +0000)]
Correct the documentation for isSignedInteger() and isUnsignedInteger().

Patch by Visoiu Mistrih Francis

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

7 years agoRevert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"
Diana Picus [Thu, 18 Aug 2016 09:25:07 +0000 (09:25 +0000)]
Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"

This reverts commit r279003 as it breaks some of our buildbots (e.g.
clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules).

The error is in OpenMP/teams_distribute_simd_ast_print.cpp:
clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527:
bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const
[with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>;
      KeyT = clang::Stmt*; ValueT = long unsigned int;
      KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>;
      BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]:
Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) &&
"Empty/Tombstone value shouldn't be inserted into map!"' failed.

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

7 years agorevert [analyzer] Added valist related checkers.
Gabor Horvath [Thu, 18 Aug 2016 09:13:37 +0000 (09:13 +0000)]
revert [analyzer] Added valist related checkers.

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

7 years agotest commit
Guy Blank [Thu, 18 Aug 2016 08:44:33 +0000 (08:44 +0000)]
test commit

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

7 years ago[analyzer] Added valist related checkers.
Gabor Horvath [Thu, 18 Aug 2016 08:43:26 +0000 (08:43 +0000)]
[analyzer] Added valist related checkers.

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

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

7 years ago[analyzer] Small cleanups when checkers retrieving statements from exploded
Gabor Horvath [Thu, 18 Aug 2016 07:54:50 +0000 (07:54 +0000)]
[analyzer] Small cleanups when checkers retrieving statements from exploded
nodes.

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

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

7 years ago[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds
Vedant Kumar [Thu, 18 Aug 2016 06:43:07 +0000 (06:43 +0000)]
[Driver] Use llvm-config.h, not config.h to unbreak out-of-tree builds

llvm/Config/config.h has intentionally been excluded from llvm
installations (see: llvm/CMakeLists.txt). Un-break out-of-tree builds
post-r278882 by switching to llvm-config.h, which is exported.

Suggested by Will Dietz!

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

7 years agoRemove debugging aids from this test and fix its expectations.
Richard Smith [Thu, 18 Aug 2016 06:15:19 +0000 (06:15 +0000)]
Remove debugging aids from this test and fix its expectations.

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

7 years ago[sanitizer-coverag] update the docs in __sanitizer_cov_trace_cmp
Kostya Serebryany [Thu, 18 Aug 2016 01:26:36 +0000 (01:26 +0000)]
[sanitizer-coverag] update the docs in __sanitizer_cov_trace_cmp

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

7 years agoPR28438: Update the information on an identifier with local definitions before
Richard Smith [Thu, 18 Aug 2016 01:16:55 +0000 (01:16 +0000)]
PR28438: Update the information on an identifier with local definitions before
trying to write out its macro graph, in case we imported a module that added
another module macro between the most recent local definition and the end of
the module.

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

7 years agoPrint the module format in clang -module-file-info.
Adrian Prantl [Wed, 17 Aug 2016 23:14:00 +0000 (23:14 +0000)]
Print the module format in clang -module-file-info.

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

7 years agoSupport object-file-wrapped modules in clang -module-file-info.
Adrian Prantl [Wed, 17 Aug 2016 23:13:53 +0000 (23:13 +0000)]
Support object-file-wrapped modules in clang -module-file-info.

rdar://problem/24504815

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

7 years ago[OpenMP] Sema and parsing for 'teams distribute simd’ pragma
Kelvin Li [Wed, 17 Aug 2016 23:13:03 +0000 (23:13 +0000)]
[OpenMP] Sema and parsing for 'teams distribute simd’ pragma

This patch is to implement sema and parsing for 'teams distribute simd’ pragma.

This patch is originated by Carlo Bertolli.

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

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

7 years ago[Darwin] Stop linking libclang_rt.eprintf.a
Chris Bieneman [Wed, 17 Aug 2016 21:54:30 +0000 (21:54 +0000)]
[Darwin] Stop linking libclang_rt.eprintf.a

Summary:
The eprintf library was added before the general OS X builtins library existed as a place to store one builtin function. Since we have for several years had an actual mandated builtin library for OS X > 10.5, we should just merge eprintf into the main library.

This change will resolve PR28855.

As a follow up I'll also patch compiler-rt to not generate the eprintf library anymore.

Reviewers: ddunbar, bob.wilson

Subscribers: cfe-commits

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

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

7 years ago[CMake] Adding toolchain targets to PGO and Apple CMake caches
Chris Bieneman [Wed, 17 Aug 2016 21:51:38 +0000 (21:51 +0000)]
[CMake] Adding toolchain targets to PGO and Apple CMake caches

The Xcode toolchain targets are useful on OS X hosts because you can construct and install multiple toolchians that can be used seamlessly.

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

7 years agoAdd test missed from r278983.
Richard Smith [Wed, 17 Aug 2016 21:42:10 +0000 (21:42 +0000)]
Add test missed from r278983.

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

7 years agoPR18417: Increase -ftemplate-depth to the value 1024 recommended by the C++
Richard Smith [Wed, 17 Aug 2016 21:41:45 +0000 (21:41 +0000)]
PR18417: Increase -ftemplate-depth to the value 1024 recommended by the C++
standard's Annex B. We now attempt to increase the process's stack rlimit to
8MiB on startup, which appears to be enough to allow this to work reliably.
(And if it turns out not to be, we can investigate increasing it further.)

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

7 years agoRevert "[Tooling] Parse compilation database command lines on Windows."
Zachary Turner [Wed, 17 Aug 2016 20:55:35 +0000 (20:55 +0000)]
Revert "[Tooling] Parse compilation database command lines on Windows."

This reverts commit 27a874790fc79f6391ad3703d7c790f51ac6ae1f.

After the introduction of windows command line parsing, some unit tests
began failing that expect to test gnu style command line quirks.  The
fix is mechanical but time consuming, so revert this for now.

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

7 years ago[OpenCL] AMDGPU: add support of cl_khr_subgroups
Yaxun Liu [Wed, 17 Aug 2016 20:39:49 +0000 (20:39 +0000)]
[OpenCL] AMDGPU: add support of cl_khr_subgroups

Patch by Aaron En Ye Shi.

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

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

7 years ago[Tooling] Parse compilation database command lines on Windows.
Zachary Turner [Wed, 17 Aug 2016 20:04:35 +0000 (20:04 +0000)]
[Tooling] Parse compilation database command lines on Windows.

When a compilation database is used on Windows, the command lines cannot
be parsed using the standard GNU style syntax. LLVM provides functions for
parsing Windows style command lines, so use them where appropriate.

After this patch, clang-tidy runs correctly on Windows.

Reviewed by: alexfh
Differential Revision: https://reviews.llvm.org/D23455

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

7 years ago[GraphWriter] Change GraphWriter to use NodeRef in GraphTraits
Tim Shen [Wed, 17 Aug 2016 20:02:38 +0000 (20:02 +0000)]
[GraphWriter] Change GraphWriter to use NodeRef in GraphTraits

Summary: Corresponding LLVM patch: D23580

Reviewers: dblaikie

Subscribers: cfe-commits

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

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

7 years ago[CodeGen][ObjC] Fix infinite recursion in getObjCEncodingForTypeImpl.
Akira Hatanaka [Wed, 17 Aug 2016 19:42:22 +0000 (19:42 +0000)]
[CodeGen][ObjC] Fix infinite recursion in getObjCEncodingForTypeImpl.

Check that ExpandStructures is true before visiting the list of ivars.

rdar://problem/27135221

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

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

7 years agoModule debug info: Fix a bug in handling record decls without fields.
Adrian Prantl [Wed, 17 Aug 2016 18:27:24 +0000 (18:27 +0000)]
Module debug info: Fix a bug in handling record decls without fields.

The previous condition would erroneously mark all CXXRecordDecls
that didn't have any fields as being defined in a clang module.
This patch fixes the condition to only apply to explicit template
instantiations.

<rdar://problem/27771823>

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

7 years agoSimplify condition. (NFC)
Adrian Prantl [Wed, 17 Aug 2016 16:42:15 +0000 (16:42 +0000)]
Simplify condition. (NFC)

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

7 years agoDebug info: Mark noreturn functions with DIFlagNoReturn.
Adrian Prantl [Wed, 17 Aug 2016 16:20:32 +0000 (16:20 +0000)]
Debug info: Mark noreturn functions with DIFlagNoReturn.

This affects functions with the C++11 [[ noreturn ]] and C11 _Noreturn
specifiers.

Patch by Victor Leschuk!

https://reviews.llvm.org/D23168

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

7 years ago[analyzer] Add a checker for loss of sign or precision in integral casts.
Artem Dergachev [Wed, 17 Aug 2016 16:02:45 +0000 (16:02 +0000)]
[analyzer] Add a checker for loss of sign or precision in integral casts.

This new checker tries to find execution paths on which implicit integral casts
cause definite loss of information: a certainly-negative integer is converted
to an unsigned integer, or an integer is definitely truncated to fit into
a smaller type.

Being implicit, such casts are likely to produce unexpected results.

Patch by Daniel Marjamäki!

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

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

7 years ago[analyzer] Add LocationContext information to SymbolMetadata.
Artem Dergachev [Wed, 17 Aug 2016 15:37:52 +0000 (15:37 +0000)]
[analyzer] Add LocationContext information to SymbolMetadata.

Like SymbolConjured, SymbolMetadata also needs to be uniquely
identified by the moment of its birth.

Such moments are coded by the (Statement, LocationContext, Block count) triples.
Each such triple represents the moment of analyzing a statement with a certain
call backtrace, with corresponding CFG block having been entered a given amount
of times during analysis of the current code body.

The LocationContext information was accidentally omitted for SymbolMetadata,
which leads to reincarnation of SymbolMetadata upon re-entering a code body
with a different backtrace; the new symbol is incorrectly unified with
the old symbol, which leads to unsound assumptions.

Patch by Alexey Sidorin!

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

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

7 years agoVisit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().
Martin Bohme [Wed, 17 Aug 2016 14:59:53 +0000 (14:59 +0000)]
Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture().

Summary:
rL277342 made RecursiveASTVisitor visit lambda capture initialization
expressions (these are the Exprs in LambdaExpr::capture_inits()).

jdennett identified two issues with rL277342 (see comments there for details):

- It visits initialization expressions for implicit lambda captures, even if
  shouldVisitImplicitCode() returns false.

- It visits initialization expressions for init captures twice (because these
  were already traveresed in TraverseLambdaCapture() before rL277342)

This patch fixes these issues and moves the code for traversing initialization
expressions into TraverseLambdaCapture().

This patch also makes two changes required for the tests:

- It adds Lang_CXX14 to the Language enum in TestVisitor.

- It adds a parameter to ExpectedLocationVisitor::ExpectMatch() that specifies
  the number of times a match is expected to be seen.

Reviewers: klimek, jdennett, alexfh

Subscribers: cfe-commits

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

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

7 years agoAdd an AST matcher for external formal linkage.
Aaron Ballman [Wed, 17 Aug 2016 13:10:42 +0000 (13:10 +0000)]
Add an AST matcher for external formal linkage.

Patch by Visoiu Mistrih

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

7 years agoAdd missing tests
Roger Ferrer Ibanez [Wed, 17 Aug 2016 06:52:15 +0000 (06:52 +0000)]
Add missing tests

Change r278483 was missing the tests

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

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

7 years ago[ThinLTO] Adapt backend invocation to llvm API changes.
Mehdi Amini [Wed, 17 Aug 2016 06:23:08 +0000 (06:23 +0000)]
[ThinLTO] Adapt backend invocation to llvm API changes.

Reviewers: tejohnson

Subscribers: mehdi_amini, llvm-commits

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

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

7 years agoCodeGen: Avoid dereferencing end() in ScalarExprEmitter::EmitOverflowCheckedBinOp
Duncan P. N. Exon Smith [Wed, 17 Aug 2016 03:15:29 +0000 (03:15 +0000)]
CodeGen: Avoid dereferencing end() in ScalarExprEmitter::EmitOverflowCheckedBinOp

Use BB.getNextNode(), which returns nullptr on end(), instead of
&*BB.getIterator(), which is UB on end().
CodeGenFunction::createBasicBlock expects nullptr in this case already.

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

7 years ago[PM] Update Clang for LLVM's r278896 which re-organized a header.
Chandler Carruth [Wed, 17 Aug 2016 03:09:11 +0000 (03:09 +0000)]
[PM] Update Clang for LLVM's r278896 which re-organized a header.

(sorry this didn't get landed closer in time...)

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

7 years agoAdd missing close brace to fix Windows bots. Oops :(
Richard Smith [Wed, 17 Aug 2016 02:22:39 +0000 (02:22 +0000)]
Add missing close brace to fix Windows bots. Oops :(

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

7 years agoSome missing usage of TargetParser. NFC.
Zijiao Ma [Wed, 17 Aug 2016 02:13:33 +0000 (02:13 +0000)]
Some missing usage of TargetParser. NFC.

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

7 years agoIf possible, set the stack rlimit to at least 8MiB on cc1 startup, and work
Richard Smith [Wed, 17 Aug 2016 01:05:07 +0000 (01:05 +0000)]
If possible, set the stack rlimit to at least 8MiB on cc1 startup, and work
around a Linux kernel bug where the actual amount of available stack may be a
*lot* lower than the rlimit.

GCC also sets a higher stack rlimit on startup, but it goes all the way to
64MiB. We can increase this limit if it proves necessary.

The kernel bug is as follows: Linux kernels prior to version 4.1 may choose to
map the process's heap as little as 128MiB before the process's stack for a PIE
binary, even in a 64-bit virtual address space. This means that allocating more
than 128MiB before you reach the process's stack high water mark can lead to
crashes, even if you don't recurse particularly deeply.

We work around the kernel bug by touching a page deep within the stack (after
ensuring that we know how big it is), to preallocate virtual address space for
the stack so that the kernel doesn't allow the brk() area to wander into it,
when building clang as a Linux PIE binary.

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

7 years ago[CMake] Workflow improvements to PGO generation
Chris Bieneman [Tue, 16 Aug 2016 22:16:29 +0000 (22:16 +0000)]
[CMake] Workflow improvements to PGO generation

This patch adds a few new convenience options used by the PGO CMake cache to setup options on bootstrap stages. The new options are:

PGO_INSTRUMENT_LTO - Builds the instrumented and final builds with LTO
PGO_BUILD_CONFIGURATION - Accepts a CMake cache script that can be used for complex configuration of the stage2-instrumented and stage2 builds.

The patch also includes a fix for bootstrap dependencies so that the instrumented LTO tools don't get used when building the final stage, and it adds distribution targets to the passthrough.

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

7 years agoEmit debug info for dynamic classes if they are imported from a DLL.
Adrian McCarthy [Tue, 16 Aug 2016 22:11:18 +0000 (22:11 +0000)]
Emit debug info for dynamic classes if they are imported from a DLL.

With -debug-info-kind=limited, we omit debug info for dynamic classes that live in other TUs. This reduces duplicate type information. When statically linked, the type information comes together. But if your binary has a class derived from a base in a DLL, the base class info is not available to the debugger.

The decision is made in shouldOmitDefinition (CGDebugInfo.cpp). Per a suggestion from rnk, I've tweaked the decision so that we do include definitions for classes marked as DLL imports. This should be a relatively small number of classes, so we don't pay a large price for duplication of the type info, yet it should cover most cases on Windows.

Essentially this makes debug info for DLLs independent, but we still assume that all TUs within the same DLL will be consistently built with (or without) debug info and the debugger will be able to search across the debug info within that scope to resolve any declarations into definitions, etc.

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

7 years ago[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2
Yaxun Liu [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2

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

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

7 years ago[CMake] Fixing typo in Info.plist generation
Chris Bieneman [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[CMake] Fixing typo in Info.plist generation

This is causing an error in the generation of the clang info plist.

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

7 years ago[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds
Chris Bieneman [Tue, 16 Aug 2016 20:44:58 +0000 (20:44 +0000)]
[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds

This is just a minor update to the Apple packaging configuration.

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

7 years agoTry to work around an MSVC 2013 bug around defaulted default ctors
Reid Kleckner [Tue, 16 Aug 2016 20:20:56 +0000 (20:20 +0000)]
Try to work around an MSVC 2013 bug around defaulted default ctors

An UnresolvedSetIterator() is supposed to be zeroed out, but MSVC 2013
does not do that.

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

7 years ago[ObjC] Warn on unguarded use of partial declaration
Erik Pilkington [Tue, 16 Aug 2016 17:44:11 +0000 (17:44 +0000)]
[ObjC] Warn on unguarded use of partial declaration

This commit adds a traversal of the AST after Sema of a function that diagnoses
unguarded references to declarations that are partially available (based on
availability attributes). This traversal is only done when we would otherwise
emit -Wpartial-availability.

This commit is part of a feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

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

7 years agoRevert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"
Reid Kleckner [Tue, 16 Aug 2016 16:04:14 +0000 (16:04 +0000)]
Revert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"

This reverts commit r278783.  It breaks usage of _xgetbv on Windows.

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

7 years agoReduce the number of allocations required for AST attributes. In test cases, the...
Aaron Ballman [Tue, 16 Aug 2016 14:48:39 +0000 (14:48 +0000)]
Reduce the number of allocations required for AST attributes. In test cases, the max resident memory changed from 65760k to 64476k which is 1.9% improvement. Allocations in grow_pod changed from 8847 to 4872 according to tcmalloc heap profiler. Overall running time remained the same.

Patch by Eugene Kosov

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

7 years agoReorder stderr redirection in test command.
Samuel Antao [Tue, 16 Aug 2016 14:38:39 +0000 (14:38 +0000)]
Reorder stderr redirection in test command.

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

7 years agoAdd empty --gcc-toolchain empty to cuda-detect test.
Samuel Antao [Tue, 16 Aug 2016 14:31:39 +0000 (14:31 +0000)]
Add empty --gcc-toolchain empty to cuda-detect test.

Unless we overload the default gcc toolchain with an empty string
the system root used in the tests will be ignored if the user builds
clang  with a custom gcc toolchain.

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

7 years agoLeft shifts of negative values are defined if -fwrapv is set
James Molloy [Tue, 16 Aug 2016 09:45:36 +0000 (09:45 +0000)]
Left shifts of negative values are defined if -fwrapv is set

This means we shouldn't emit ubsan detection code or warn.
Fixes PR25552.

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

7 years ago[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms
Marina Yatsina [Tue, 16 Aug 2016 08:13:36 +0000 (08:13 +0000)]
[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms

commit on behalf of guyblank

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

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

7 years ago[CUDA] Fix "declared here" note on deferred wrong-side errors.
Justin Lebar [Tue, 16 Aug 2016 00:48:21 +0000 (00:48 +0000)]
[CUDA] Fix "declared here" note on deferred wrong-side errors.

Previously we weren't deferring these "declared here" notes, which is
obviously wrong.

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

7 years agoPR28978: If we need overload resolution for the move constructor of an
Richard Smith [Tue, 16 Aug 2016 00:13:47 +0000 (00:13 +0000)]
PR28978: If we need overload resolution for the move constructor of an
anonymous union member of a class, we need overload resolution for the move
constructor of the class itself too; we can't rely on Sema to do the right
thing for us for anonymous union types.

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

7 years ago[CUDA] Raise an error if a wrong-side call is codegen'ed.
Justin Lebar [Mon, 15 Aug 2016 23:00:49 +0000 (23:00 +0000)]
[CUDA] Raise an error if a wrong-side call is codegen'ed.

Summary:
Some function calls in CUDA are allowed to appear in
semantically-correct programs but are an error if they're ever
codegen'ed.  Specifically, a host+device function may call a host
function, but it's an error if such a function is ever codegen'ed in
device mode (and vice versa).

Previously, clang made no attempt to catch these errors.  For the most
part, they would be caught by ptxas, and reported as "call to unknown
function 'foo'".

Now we catch these errors and report them the same as we report other
illegal calls (e.g. a call from a host function to a device function).

This has a small change in error-message behavior for calls that were
previously disallowed (e.g. calls from a host to a device function).
Previously, we'd catch disallowed calls fairly early, before doing
additional semantic checking e.g. of the call's arguments.  Now we catch
these illegal calls at the very end of our semantic checks, so we'll
only emit a "illegal CUDA call" error if the call is otherwise
well-formed.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[ADT] Change PostOrderIterator to use NodeRef. NFC.
Tim Shen [Mon, 15 Aug 2016 21:27:56 +0000 (21:27 +0000)]
[ADT] Change PostOrderIterator to use NodeRef. NFC.

Summary: Corresponding LLVM change: D23522

Reviewers: dblaikie

Subscribers: cfe-commits

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

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

7 years agoObjective-C diagnostics: isObjCNSObjectType should check through AttributedType.
Manman Ren [Mon, 15 Aug 2016 21:05:00 +0000 (21:05 +0000)]
Objective-C diagnostics: isObjCNSObjectType should check through AttributedType.

For the following example:
typedef __attribute__((NSObject)) CGColorRef ColorAttrRef;
@property (strong, nullable) ColorAttrRef color;
The property type should be ObjC NSObject type and the compiler should not emit
error: property with 'retain (or strong)' attribute must be of object type

rdar://problem/27747154

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

7 years agoAdd the notion of deferred diagnostics.
Justin Lebar [Mon, 15 Aug 2016 20:38:56 +0000 (20:38 +0000)]
Add the notion of deferred diagnostics.

Summary:
This patch lets you create diagnostics that are emitted if and only if a
particular FunctionDecl is codegen'ed.

This is necessary for CUDA, where some constructs -- e.g. calls from
host+device functions to host functions when compiling for device -- are
allowed to appear in semantically-correct programs, but only if they're
never codegen'ed.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years ago[CUDA] Include CUDA headers before anything else.
Justin Lebar [Mon, 15 Aug 2016 20:38:52 +0000 (20:38 +0000)]
[CUDA] Include CUDA headers before anything else.

Summary:
There's no point to --cuda-path if we then go and include /usr/include
first.  And if you install the right packages, Ubuntu will install (very
old) CUDA headers there.

Reviewers: tra

Subscribers: cfe-commits, Prazek

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

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