]> granicus.if.org Git - clang/log
clang
7 years agoUn-tabify source files, NFC.
Yaron Keren [Sat, 8 Oct 2016 06:45:10 +0000 (06:45 +0000)]
Un-tabify source files, NFC.

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

7 years agoUse StringRef in Command::printArg() instead of raw pointer (NFC)
Mehdi Amini [Sat, 8 Oct 2016 01:38:43 +0000 (01:38 +0000)]
Use StringRef in Command::printArg() instead of raw pointer (NFC)

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

7 years ago[CUDA] Do a better job at detecting wrong-side calls.
Justin Lebar [Sat, 8 Oct 2016 01:07:11 +0000 (01:07 +0000)]
[CUDA] Do a better job at detecting wrong-side calls.

Summary:
Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to
DiagnoseUseOfDecl.  This lets us catch some edge cases we were missing,
specifically around class operators.

This necessitates a few other changes:

 - Avoid emitting duplicate deferred diags in CheckCUDACall.

   Previously we'd carefully placed our call to CheckCUDACall such that
   it would only ever run once for a particular callsite.  But now this
   isn't the case.

 - Emit deferred diagnostics from a template
   specialization/instantiation's primary template, in addition to from
   the specialization/instantiation itself.  DiagnoseUseOfDecl ends up
   putting the deferred diagnostics on the template, rather than the
   specialization, so we need to check both.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

7 years agoRename variable to not use C++ reserved name (leading underscore + capital) (NFC)
Mehdi Amini [Fri, 7 Oct 2016 22:03:03 +0000 (22:03 +0000)]
Rename variable to not use C++ reserved name (leading underscore + capital) (NFC)

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

7 years agoFix MSVC build: requires namespace in front of StringRef (NFC)
Mehdi Amini [Fri, 7 Oct 2016 22:02:59 +0000 (22:02 +0000)]
Fix MSVC build: requires namespace in front of StringRef (NFC)

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

7 years agoDriver: use StringRef instead of raw pointer in lookupTypeForExtension() (NFC)
Mehdi Amini [Fri, 7 Oct 2016 21:41:00 +0000 (21:41 +0000)]
Driver: use StringRef instead of raw pointer in lookupTypeForExtension() (NFC)

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

7 years agoTurn ArchName/BoundArch in Driver from raw pointer to StringRef (NFC)
Mehdi Amini [Fri, 7 Oct 2016 21:27:26 +0000 (21:27 +0000)]
Turn ArchName/BoundArch in Driver from raw pointer to StringRef (NFC)

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

7 years agoVisually align table def with respective enum. NFC
Douglas Katzman [Fri, 7 Oct 2016 21:02:38 +0000 (21:02 +0000)]
Visually align table def with respective enum. NFC

'warn_attribute_wrong_decl_type' has to stay in sync with
'enum AttributeDeclKind' which is much easier when they line up.

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

7 years agoRevert r283572 - [Driver] Make -print-libgcc-file-name print compiler-rt lib when...
Michal Gorny [Fri, 7 Oct 2016 20:04:00 +0000 (20:04 +0000)]
Revert r283572 - [Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Revert the -print-libgcc-file-name change as the new test fails
on Darwin. It needs to be updated to run the libgcc part only on systems
supporting that rtlib.

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

7 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)
Artem Dergachev [Fri, 7 Oct 2016 19:25:10 +0000 (19:25 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)

The problem that caused the msvc crash has been indentified and fixed
in the previous commit. This patch contains the rest of r283092.

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

7 years agoSilence Warning. NFC.
Nirav Dave [Fri, 7 Oct 2016 19:11:33 +0000 (19:11 +0000)]
Silence Warning. NFC.

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

7 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.
Artem Dergachev [Fri, 7 Oct 2016 17:24:06 +0000 (17:24 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.

Remove the brace default initializer to see if this is what's causing
the msvc crash.

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

7 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.3.
Artem Dergachev [Fri, 7 Oct 2016 17:12:05 +0000 (17:12 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.3.

This is the primary suspect for causing the msvc crash, now that vector of
smart pointers was proven to be safe. Probably the default {}-initializer
is the problem.

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

7 years ago[Driver] Make -print-libgcc-file-name print compiler-rt lib when used
Michal Gorny [Fri, 7 Oct 2016 17:08:06 +0000 (17:08 +0000)]
[Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.

The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:

  clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)

in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.

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

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

7 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.2.
Artem Dergachev [Fri, 7 Oct 2016 15:55:18 +0000 (15:55 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.2.

Define the list of pieces in BugReport class. This is half of the changes
in the BugReport class code, which is pointed to by the msvc crash message.

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

7 years ago[analyzer] Re-apply r283092, attempt no.4, a small chunk.
Artem Dergachev [Fri, 7 Oct 2016 15:23:02 +0000 (15:23 +0000)]
[analyzer] Re-apply r283092, attempt no.4, a small chunk.

Define PathDiagnosticNotePiece. The next commit would be able to address the
BugReport class code that is pointed to by the msvc crash message.

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

7 years agoUpdate clang test to accomendate discriminator change in https://reviews.llvm.org...
Dehao Chen [Fri, 7 Oct 2016 15:21:29 +0000 (15:21 +0000)]
Update clang test to accomendate discriminator change in https://reviews.llvm.org/D25132

Summary: https://reviews.llvm.org/D25132 added discriminator even add -g0. This leads to test fail which is addressed in thie patch.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

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

7 years ago[analyzer] Don't merge different return nodes in ExplodedGraph
Daniel Marjamaki [Fri, 7 Oct 2016 14:21:08 +0000 (14:21 +0000)]
[analyzer] Don't merge different return nodes in ExplodedGraph

Returns when calling an inline function should not be merged in the ExplodedGraph unless they are same.

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

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

7 years agoWdocumentation fix
Simon Pilgrim [Fri, 7 Oct 2016 13:25:41 +0000 (13:25 +0000)]
Wdocumentation fix

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

7 years ago[ARM]: Add Cortex-R52 target
Javed Absar [Fri, 7 Oct 2016 12:08:41 +0000 (12:08 +0000)]
[ARM]: Add Cortex-R52 target

This patch adds Cortex-R52, the new ARM real-time processor.
Cortex-R52 implements the ARMv8-R architecture.

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

7 years agoRevert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."
Artem Dergachev [Fri, 7 Oct 2016 11:29:32 +0000 (11:29 +0000)]
Revert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."

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

7 years ago[analyzer] Re-apply r283092, attempt no.3, in small chunks this time.
Artem Dergachev [Fri, 7 Oct 2016 11:26:15 +0000 (11:26 +0000)]
[analyzer] Re-apply r283092, attempt no.3, in small chunks this time.

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

7 years agoRevert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Artem Dergachev [Fri, 7 Oct 2016 10:56:44 +0000 (10:56 +0000)]
Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

Vector of smart pointers wasn't the thing that caused msvc crash.

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

7 years ago[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Artem Dergachev [Fri, 7 Oct 2016 10:44:09 +0000 (10:44 +0000)]
[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

Replace SmallVector<IntrusiveRefCntPtr> with a vector of plain pointers.
Would insignificantly increase memory usage.

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

7 years agoUse StringReg in TargetParser APIs (NFC)
Mehdi Amini [Fri, 7 Oct 2016 08:37:29 +0000 (08:37 +0000)]
Use StringReg in TargetParser APIs (NFC)

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

7 years agoPR25890: Fix incoherent error handling in PerformImplicitConversion and
Richard Smith [Thu, 6 Oct 2016 23:12:58 +0000 (23:12 +0000)]
PR25890: Fix incoherent error handling in PerformImplicitConversion and
CheckSingleAssignmentConstraints. These no longer produce ExprError() when they
have not emitted an error, and reliably inform the caller when they *have*
emitted an error.

This fixes some serious issues where we would fail to emit any diagnostic for
invalid code and then attempt to emit code for an invalid AST, and conversely
some issues where we would emit two diagnostics for the same problem.

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

7 years ago[analyzer] Add explanation why analyzer report is not generated (fix for PR12421).
Anton Yartsev [Thu, 6 Oct 2016 21:42:21 +0000 (21:42 +0000)]
[analyzer] Add explanation why analyzer report is not generated (fix for PR12421).

Currently if the path diagnostic consumer (e.g HTMLDiagnostics and PlistDiagnostics) do not support cross file diagnostics then the path diagnostic report is silently omitted in the case of cross file diagnostics. The patch adds a little verbosity to Clang in this case.
The patch also adds help entry for the "--analyzer-output" driver option.

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

7 years agoAdd another .def file to module map to fix modules buildbot's displeasure.
Richard Smith [Thu, 6 Oct 2016 21:31:04 +0000 (21:31 +0000)]
Add another .def file to module map to fix modules buildbot's displeasure.

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

7 years ago[coroutines] Fix co_return statement for initializer list arguments
Eric Fiselier [Thu, 6 Oct 2016 21:23:38 +0000 (21:23 +0000)]
[coroutines] Fix co_return statement for initializer list arguments

Summary:
Previously the statement `co_return {42}` would be transformed into `P.return_void()`, since the type of `{42}` is represented as `void` by Clang.

This patch fixes the bug by checking for `InitListExpr` arguments and transforming them accordingly.

Reviewers: majnemer, GorNishanov, rsmith

Subscribers: mehdi_amini, cfe-commits

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

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

7 years ago[modules] Be sure to emit local specializations of imported templates, even if
Richard Smith [Thu, 6 Oct 2016 20:30:51 +0000 (20:30 +0000)]
[modules] Be sure to emit local specializations of imported templates, even if
the resulting specialization is not referenced by the rest of the AST. This
both avoids performing unnecessary reinstantiations in downstream users of the
AST file and fixes a bug (breaking modules self-host right now) where we would
sometimes fail to emit a definition of a class template specialization if we
imported just a declaration of it from elsewhere (see new testcase for reduced
example).

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

7 years ago[Sema] Replace smart quote with "'" in comment.
Justin Lebar [Thu, 6 Oct 2016 19:47:56 +0000 (19:47 +0000)]
[Sema] Replace smart quote with "'" in comment.

Looks like the smart quote was copy/pasted from the C++ standard.

The smart quote was not encoded as valid UTF-8 (?), even though vim was
detecting the file as UTF-8.  This broke the clang-format Python script,
which tried to read the file using the same encoding as vim detected.

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

7 years ago[OpenMP] Check if the template specialization is mappable instead of specialized...
David Sheinkman [Thu, 6 Oct 2016 15:47:36 +0000 (15:47 +0000)]
[OpenMP] Check if the template specialization is mappable instead of specialized template Differential Revision: https://reviews.llvm.org/D25252

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

7 years agoAllocate after the early exit checks. NFC.
Vassil Vassilev [Thu, 6 Oct 2016 13:18:06 +0000 (13:18 +0000)]
Allocate after the early exit checks. NFC.

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

7 years ago[modules] Allow VarDecls with initializers to use special var abbrev.
Vassil Vassilev [Thu, 6 Oct 2016 13:04:54 +0000 (13:04 +0000)]
[modules] Allow VarDecls with initializers to use special var abbrev.

Update storage sizes to fit the (past) changes in the VarDecl's data model.
Update some comments.

Patch partially reviewed by Richard Smith as part of https://reviews.llvm.org/D24508

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

7 years ago[Sema] Fix PR30520: Handle incomplete field types in transparent_union unions
Alex Lorenz [Thu, 6 Oct 2016 09:47:29 +0000 (09:47 +0000)]
[Sema] Fix PR30520: Handle incomplete field types in transparent_union unions

This commit fixes a crash that happens when clang is analyzing a
transparent_union attribute on a union which has a field with incomplete type.

rdar://28630028

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

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

7 years agoAdd missing -no-canonical-prefixes.
Benjamin Kramer [Thu, 6 Oct 2016 09:40:37 +0000 (09:40 +0000)]
Add missing -no-canonical-prefixes.

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

7 years agoFix PR30440: Initialize FunctionTypeDepth in CXXNameMangler
Alex Lorenz [Thu, 6 Oct 2016 09:37:15 +0000 (09:37 +0000)]
Fix PR30440: Initialize FunctionTypeDepth in CXXNameMangler

This commit fixes PR 30440 by initializing CXXNameMangler's FunctionTypeDepth
in the two constructors added in r274222 (The commit that caused this
regression).

rdar://28455269

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

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

7 years ago[Driver] Add driver support for Fuchsia
Petr Hosek [Thu, 6 Oct 2016 06:08:09 +0000 (06:08 +0000)]
[Driver] Add driver support for Fuchsia

Provide toolchain and tool support for Fuchsia operating system.
Fuchsia uses compiler-rt as the runtime library and libc++, libc++abi
and libunwind as the C++ standard library. lld is used as a default
linker.

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

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

7 years agoTaking StringRef in Driver.h APIs instead of raw pointers (NFC)
Mehdi Amini [Thu, 6 Oct 2016 05:11:48 +0000 (05:11 +0000)]
Taking StringRef in Driver.h APIs instead of raw pointers (NFC)

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

7 years agoUse llvm::raw_string_ostream instead of std::stringstream (NFC)
Mehdi Amini [Thu, 6 Oct 2016 04:26:16 +0000 (04:26 +0000)]
Use llvm::raw_string_ostream instead of std::stringstream (NFC)

As a side effect, this avoid having to call .data() on the StringRef.

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

7 years agoPR22924, PR22845, some of CWG1464: When checking the initializer for an array
Richard Smith [Wed, 5 Oct 2016 22:41:02 +0000 (22:41 +0000)]
PR22924, PR22845, some of CWG1464: When checking the initializer for an array
new expression, distinguish between the case of a constant and non-constant
initializer. In the former case, if the bound is erroneous (too many
initializer elements, bound is negative, or allocated size overflows), reject,
and take the bound into account when determining whether we need to
default-construct any elements. In the remanining cases, move the logic to
check for default-constructibility of trailing elements into the initialization
code rather than inventing a bogus array bound, to cope with cases where the
number of initialized elements is not the same as the number of initializer
list elements (this can happen due to string literal initialization or brace
elision).

This also fixes rejects-valid and crash-on-valid errors when initializing a
new'd array of character type from a braced string literal.

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

7 years agoRemoving optimization from the RUN lines and adjusting the checks
Nemanja Ivanovic [Wed, 5 Oct 2016 19:11:36 +0000 (19:11 +0000)]
Removing optimization from the RUN lines and adjusting the checks
to not rely on optimization.

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

7 years agoMake DeletedLines local variables in checkEmptyNamespace.
Eric Liu [Wed, 5 Oct 2016 15:49:01 +0000 (15:49 +0000)]
Make DeletedLines local variables in checkEmptyNamespace.

Summary: Patch by Sam McCall!

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[clang-format] append newline after code when inserting new headers at the end of...
Eric Liu [Wed, 5 Oct 2016 15:42:19 +0000 (15:42 +0000)]
[clang-format] append newline after code when inserting new headers at the end of the code which does not end with newline.

Summary:
append newline after code when inserting new headers at the end of the
code which does not end with newline.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang
Michael Zuckerman [Wed, 5 Oct 2016 12:56:06 +0000 (12:56 +0000)]
[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang

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

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

7 years ago[Sema] Packed member warning: Use the typedef name for anonymous structures
Alex Lorenz [Wed, 5 Oct 2016 09:27:48 +0000 (09:27 +0000)]
[Sema] Packed member warning: Use the typedef name for anonymous structures

This commit improves the packed member warning by showing the name of the
anonymous structure/union when it was defined within a typedef declaration.

rdar://28498901

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

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

7 years ago[analyzer] Squash a compile error in r283301.
Artem Dergachev [Wed, 5 Oct 2016 08:47:31 +0000 (08:47 +0000)]
[analyzer] Squash a compile error in r283301.

The constexpr string literal trick isn't supported in MSVC2013.

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

7 years ago[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.
Artem Dergachev [Wed, 5 Oct 2016 08:28:25 +0000 (08:28 +0000)]
[analyzer] Improve "Assuming..." diagnostic pieces for logical operators.

Logical short-circuit operators now act like other branch conditions.

If the symbolic value of the left-hand side is not known to be true or false
(based on the previous execution path), the "Assuming" event piece is added
in order to explain that the analyzer is adding a new assumption.

Additionally, when the assumption is made against the right-hand side of
the logical operator (i.e. when the operator itself acts as a condition
in another CFG terminator), the "Assuming..." piece is written out for the
right-hand side of the operator rather than for the whole operator.
This allows expression-specific diagnostic message text to be constructed.

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

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

7 years ago[analyzer] Add "Assuming..." diagnostic pieces for unsupported conditions.
Artem Dergachev [Wed, 5 Oct 2016 08:19:49 +0000 (08:19 +0000)]
[analyzer] Add "Assuming..." diagnostic pieces for unsupported conditions.

In the analyzer's path-sensitive reports, when a report goes through a branch
and the branch condition cannot be decided to be definitely true or false
(based on the previous execution path), an event piece is added that tells the
user that a new assumption is added upon the symbolic value of the branch
condition. For example, "Assuming 'a' is equal to 3".

The text of the assumption is hand-crafted in various manners depending on
the AST expression. If the AST expression is too complex and the text of
the assumption fails to be constructed, the event piece is omitted.
This causes loss of information and misunderstanding of the report.

Do not omit the event piece even if the expression is too complex;
add a piece with a generic text instead.

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

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

7 years ago[CUDA] Add missing ':' to noexcept.cu test.
Justin Lebar [Wed, 5 Oct 2016 00:27:38 +0000 (00:27 +0000)]
[CUDA] Add missing ':' to noexcept.cu test.

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

7 years ago[CUDA] Mark device functions as nounwind.
Justin Lebar [Tue, 4 Oct 2016 23:41:49 +0000 (23:41 +0000)]
[CUDA] Mark device functions as nounwind.

Summary:
This prevents clang from emitting 'invoke's and catch statements.

Things previously mostly worked thanks to TryToMarkNoThrow() in
CodeGenFunction.  But this is not a proper IPO, and it doesn't properly
handle cases like mutual recursion.

Fixes bug 30593.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnos...
Justin Lebar [Tue, 4 Oct 2016 23:41:45 +0000 (23:41 +0000)]
[CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

Summary:
This will let us (in a separate patch) allocate deferred diagnostics in
the ASTContext's PartialDiagnostic arena.

Reviewers: rnk

Subscribers: cfe-commits

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

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

7 years agoSeparate builtins for x84-64 and i386; implement __mulh and __umulh
Albert Gutowski [Tue, 4 Oct 2016 22:29:49 +0000 (22:29 +0000)]
Separate builtins for x84-64 and i386; implement __mulh and __umulh

Summary: We need x86-64-specific builtins if we want to implement some of the MS intrinsics - winnt.h contains definitions of some functions for i386, but not for x86-64 (for example _InterlockedOr64), which means that we cannot treat them as builtins for both i386 and x86-64, because then we have definitions of builtin functions in winnt.h on i386.

Reviewers: thakis, majnemer, hans, rnk

Subscribers: cfe-commits

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

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

7 years agoclang-cl: Make /Fo apply also when using -flto
Hans Wennborg [Tue, 4 Oct 2016 21:01:04 +0000 (21:01 +0000)]
clang-cl: Make /Fo apply also when using -flto

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

7 years agoclang-cl: Use the .obj file extension also in LTO mode
Hans Wennborg [Tue, 4 Oct 2016 21:01:02 +0000 (21:01 +0000)]
clang-cl: Use the .obj file extension also in LTO mode

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

7 years agoclang-cl: expose the -fuse-ld option
Hans Wennborg [Tue, 4 Oct 2016 21:01:00 +0000 (21:01 +0000)]
clang-cl: expose the -fuse-ld option

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

7 years agoclang-cl: Expose the -flto option
Hans Wennborg [Tue, 4 Oct 2016 21:00:57 +0000 (21:00 +0000)]
clang-cl: Expose the -flto option

We could hook up /GL as an alias for -flto, but that might be
confusing, as clang-cl in that mode would not be drop-in compatible
with cl.exe /GL, as it requires the linker to be lld.

Exposing -flto seems like a less confusing way to expose this
functionality.

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

7 years ago[analyzer] Add PostStmt callback for ArraySubscriptExpr
Anna Zaks [Tue, 4 Oct 2016 20:49:31 +0000 (20:49 +0000)]
[analyzer] Add PostStmt callback for ArraySubscriptExpr

A patch by Jan Smets!

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

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

7 years ago[clang] make reciprocal estimate codegen a function attribute
Sanjay Patel [Tue, 4 Oct 2016 20:44:05 +0000 (20:44 +0000)]
[clang] make reciprocal estimate codegen a function attribute

The motivation for the change is that we can't have pseudo-global settings
for codegen living in TargetOptions because that doesn't work with LTO.

Ideally, these reciprocal attributes will be moved to the instruction-level
via FMF, metadata, or something else. But making them function attributes is
at least an improvement over the current state.

I'm committing this patch ahead of the related LLVM patch to avoid bot failures,
but if that patch needs to be reverted, then this should be reverted too.

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

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

7 years ago[ubsan] Disable bounds-check for flexible array ivars
Vedant Kumar [Tue, 4 Oct 2016 20:36:04 +0000 (20:36 +0000)]
[ubsan] Disable bounds-check for flexible array ivars

This eliminates a class of false positives for -fsanitize=array-bounds
on instrumented ObjC projects.

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

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

7 years agoclang-format: Fix bad multi-variable for-loop formatting.
Daniel Jasper [Tue, 4 Oct 2016 20:18:25 +0000 (20:18 +0000)]
clang-format: Fix bad multi-variable for-loop formatting.

Before:
  for (int*p, *q; p != q; p = p->next) {

After:
  for (int *p, *q; p != q; p = p->next) {

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

7 years ago[sancov] documentation update after r283241
Mike Aizatsky [Tue, 4 Oct 2016 19:19:16 +0000 (19:19 +0000)]
[sancov] documentation update after r283241

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

7 years agoTest what happens when tag lookup and redeclaration lookup disagree
Reid Kleckner [Tue, 4 Oct 2016 18:10:23 +0000 (18:10 +0000)]
Test what happens when tag lookup and redeclaration lookup disagree

Clang has a diagnostic for the what happens when an elaborated type
implicitly creates a tag declaration and the initial tag lookup fails,
but the redeclaration lookup succeeds and finds a non-tag type. However,
it wasn't tested, and looked like dead code. After much staring, we
discovered how to exercise it, and are now committing the test for
posterity.

In this example, the tag lookup will not find A, but then when we go to
insert a declaration of A at global scope, we discover the template
friend, which is not a tag type.

  struct C {
    template <typename> friend struct A;
  };
  struct B {
    struct A *p;
  };

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

7 years ago[Sema] Format a comment line so that it fits 80 columns. NFC
Alex Lorenz [Tue, 4 Oct 2016 16:06:37 +0000 (16:06 +0000)]
[Sema] Format a comment line so that it fits 80 columns. NFC

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

7 years ago[MS] Move hex long long sign compat hack to -fms-compatibility
Reid Kleckner [Tue, 4 Oct 2016 15:57:49 +0000 (15:57 +0000)]
[MS] Move hex long long sign compat hack to -fms-compatibility

Treating large 0x*LL literals as signed instead of unsigned is not a
conforming language extension, so move it out of -fms-extensions.

Came up in PR30605

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

7 years ago[OpenMP] fix segfault when a variable referenced in reduction clause is a reference...
David Sheinkman [Tue, 4 Oct 2016 14:41:36 +0000 (14:41 +0000)]
[OpenMP] fix segfault when a variable referenced in reduction clause is a reference parameter\nDifferential Revision: http://reviews.llvm.org/D24524

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

7 years ago[ThinLTO] Spell `llvm-ar` correctly.
Davide Italiano [Tue, 4 Oct 2016 13:16:00 +0000 (13:16 +0000)]
[ThinLTO] Spell `llvm-ar` correctly.

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

7 years agoDo not find friend function definitions inside non-instantiated class.
Serge Pavlov [Tue, 4 Oct 2016 10:11:43 +0000 (10:11 +0000)]
Do not find friend function definitions inside non-instantiated class.

Previously if a file-level function was defined inside befriending
template class, it always was treated as defined. For instance, the code like:
```
  int func(int x);
  template<typename T> class C1 {
    friend int func(int x) { return x; }
  };
  template<typename T> class C2 {
    friend int func(int x) { return x; }
  };
```
could not be compiled due to function redefinition, although not of the templates
is instantiated. Moreover, the body of friend function can contain use of template
parameters, attempt to get definition of such function outside any instantiation
causes compiler abnormal termination.

Other compilers (gcc, icc) follow viewpoint that the body of the function defined
in friend declaration becomes available when corresponding class is instantiated.
This patch implements this viewpoint in clang.

Definitions introduced by friend declarations in template classes are not added
to the redeclaration chain of corresponding function. Only when the template is
instantiated, instantiation of the function definition is placed to the chain.

The fix was made in collaboration with Richard Smith.

This change fixes PR8035, PR17923, PR22307 and PR25848.

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

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

7 years agoMinor cleanups in clang-format.el.
Manuel Klimek [Tue, 4 Oct 2016 09:53:04 +0000 (09:53 +0000)]
Minor cleanups in clang-format.el.

- Enable lexical binding
- Formatting
- Enable file name completion for the clang-format-executable variable
- Add a missing docstring
- When available, use bufferpos-to-filepos and filepos-to-bufferpos. These functions given more precise mapping than byte-to-position and position-bytes.
- Rename arguments of clang-format-region to match the docstring
- Instead of binding local variables to nil and then assigning them, bind them directly to their values
- Make use of the fact that insert-file-contents returns the number of characters it inserted
- Use cl-destructuring-bind to make the code a bit shorter
- Use standard iteration (dolist) instead of mapc with a lambda, which is more common and shorter
- Remove a message that was most likely only present for debugging purposes

Patch by Philipp Stephani.

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

7 years agoRevert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument...
Dean Michael Berris [Tue, 4 Oct 2016 08:54:51 +0000 (08:54 +0000)]
Revert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed"

This reverts 283193 -- broke the build.

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

7 years agoRevert r283106, "Wdocumentation fix"
NAKAMURA Takumi [Tue, 4 Oct 2016 08:32:33 +0000 (08:32 +0000)]
Revert r283106, "Wdocumentation fix"

It should depend on r283094 and r283182.

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

7 years ago[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is...
Dean Michael Berris [Tue, 4 Oct 2016 08:22:47 +0000 (08:22 +0000)]
[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed

Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Author: rSerge

Reviewers: dberris, rsmith, aaron.ballman, rnk

Subscribers: cfe-commits, iid_iunknown

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

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

7 years agoRevert "[analyzer] Improve CloneChecker diagnostics" as its depends on reverted r283092
Vitaly Buka [Tue, 4 Oct 2016 02:40:35 +0000 (02:40 +0000)]
Revert "[analyzer] Improve CloneChecker diagnostics" as its depends on reverted r283092

This reverts commit r283094.

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

7 years agoRevert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on reverted...
Vitaly Buka [Tue, 4 Oct 2016 02:36:58 +0000 (02:36 +0000)]
Revert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on reverted r283092

This reverts commit r283093.

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

7 years agoRevert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.
Vitaly Buka [Tue, 4 Oct 2016 02:19:17 +0000 (02:19 +0000)]
Revert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.

This reverts commit r283092.

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

7 years agoRevert "[analyzer] A blind attempt to fix a buildbot" as it does not help.
Vitaly Buka [Tue, 4 Oct 2016 02:19:12 +0000 (02:19 +0000)]
Revert "[analyzer] A blind attempt to fix a buildbot" as it does not help.

This reverts commit r283141.

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

7 years ago[coroutines] Switch to using std::experimental namespace per P0057R5
Gor Nishanov [Tue, 4 Oct 2016 00:31:16 +0000 (00:31 +0000)]
[coroutines] Switch to using std::experimental namespace per P0057R5

Summary:
Look for coroutine_traits and friends in std::experimental namespace.
Patch (mostly) by EricWF.

Reviewers: cfe-commits, EricWF, rsmith

Subscribers: majnemer, mehdi_amini

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

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

7 years ago[coroutines] Adding builtins for coroutine intrinsics and backendutil support.
Gor Nishanov [Mon, 3 Oct 2016 22:44:48 +0000 (22:44 +0000)]
[coroutines] Adding builtins for coroutine intrinsics and backendutil support.

Summary:
With this commit simple coroutines can be created in plain C using coroutine builtins.

Reviewers: rnk, EricWF, rsmith

Subscribers: modocache, mgorny, mehdi_amini, beanz, cfe-commits

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

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

7 years agoObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.
Manman Ren [Mon, 3 Oct 2016 21:26:46 +0000 (21:26 +0000)]
ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.

The deserialization of redeclartion can cause seg fault since getCanonicalDecl
of the redeclaration returns the lookup result on the ObjCContainerDecl,
which can be null if FindExternalVisibleDeclsByName is not done updating
the lookup results.

The fix is to return the redeclaration itself as the canonical decl. Note that
the handling for redeclaration of ObjCMethodDecl is not in line with other
redeclarables.

rdar://28488466

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

7 years ago[analyzer] A blind attempt to fix a buildbot after r283092.
Artem Dergachev [Mon, 3 Oct 2016 20:12:12 +0000 (20:12 +0000)]
[analyzer] A blind attempt to fix a buildbot after r283092.

The msvc compiler seems to crash compiling the BugReport class.

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

7 years agoAdded more comments to tooling::Replacements.
Eric Liu [Mon, 3 Oct 2016 19:14:30 +0000 (19:14 +0000)]
Added more comments to tooling::Replacements.

Summary: Also test phabricator commit processing.

Subscribers: klimek, cfe-commits

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

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

7 years agoFactor out a diagnostic kind enum for use in two %select expressions
Reid Kleckner [Mon, 3 Oct 2016 18:34:23 +0000 (18:34 +0000)]
Factor out a diagnostic kind enum for use in two %select expressions

NFC

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

7 years ago[CUDA] Clean up some comments in Sema::IsOverload. NFC
Justin Lebar [Mon, 3 Oct 2016 16:48:27 +0000 (16:48 +0000)]
[CUDA] Clean up some comments in Sema::IsOverload.  NFC

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

7 years ago[CUDA] Disallow overloading destructors.
Justin Lebar [Mon, 3 Oct 2016 16:48:23 +0000 (16:48 +0000)]
[CUDA] Disallow overloading destructors.

Summary:
We'd attempted to allow this, but turns out we were doing a very bad
job.  :)

Making this work properly would be a giant change in clang.  For
example, we'd need to make CXXRecordDecl::getDestructor()
context-sensitive, because the destructor you end up with depends on
where you're calling it from.

For now (and hopefully for ever), just disallow overloading of
destructors in CUDA.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

7 years ago[ARC] Ignore qualifiers in copy-restore expressions
Vedant Kumar [Mon, 3 Oct 2016 15:29:22 +0000 (15:29 +0000)]
[ARC] Ignore qualifiers in copy-restore expressions

When ARC is enabled, an ObjCIndirectCopyRestoreExpr models the passing
of a function argument s.t:

  * The argument is copied into a temporary,
  * The temporary is passed into the function, and
  * After the function call completes, the temporary is move-assigned
    back to the original location of the argument.

The argument type and the parameter type must agree "except possibly in
qualification". This commit weakens an assertion in EmitCallArg() to
actually reflect that.

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

7 years ago[OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructions
Yaxun Liu [Mon, 3 Oct 2016 14:41:50 +0000 (14:41 +0000)]
[OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructions

__builtin_astype is used to cast OpenCL opaque types to other types, as such, it needs to be able to handle casting from and to pointer types correctly.

Current it cannot handle 1) casting between pointers of different addr spaces 2) casting between pointer type and non-pointer types.

This patch fixes that.

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

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

7 years agoThis adds a separate file for the fp denormal regression tests. NFC.
Sjoerd Meijer [Mon, 3 Oct 2016 13:13:50 +0000 (13:13 +0000)]
This adds a separate file for the fp denormal regression tests. NFC.
I forgot to svn add the new file in my previous commit.

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

7 years agoThis adds a separate file for the fp denormal regression tests. NFC.
Sjoerd Meijer [Mon, 3 Oct 2016 13:12:20 +0000 (13:12 +0000)]
This adds a separate file for the fp denormal regression tests. NFC.

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

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

7 years agoWdocumentation fix
Simon Pilgrim [Mon, 3 Oct 2016 12:37:08 +0000 (12:37 +0000)]
Wdocumentation fix

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

7 years agoFix PR 28885: Fix AST Printer output for the inherited constructor using
Alex Lorenz [Mon, 3 Oct 2016 12:22:17 +0000 (12:22 +0000)]
Fix PR 28885: Fix AST Printer output for the inherited constructor using
declarations.

This commit ensures that the correct record type is printed out for the
using declarations that represent C++ inherited constructors.
It fixes a regression introduced in r274049 which changed the name that's
stored in the using declarations that correspond to inherited constructors.

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

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

7 years agoRevert r283102 (Typo in the phabricator link)
Alex Lorenz [Mon, 3 Oct 2016 12:17:56 +0000 (12:17 +0000)]
Revert r283102 (Typo in the phabricator link)

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

7 years agoFix PR 28885: Fix AST Printer output for the inherited constructor using
Alex Lorenz [Mon, 3 Oct 2016 12:12:03 +0000 (12:12 +0000)]
Fix PR 28885: Fix AST Printer output for the inherited constructor using
declarations.

This commit ensures that the correct record type is printed out for the
using declarations that represent C++ inherited constructors.
It fixes a regression introduced in r274049 which changed the name that's
stored in the using declarations that correspond to inherited constructors.

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

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

7 years ago[StaticAnalyser] Add test case to ensure that unreachable code is found.
Daniel Marjamaki [Mon, 3 Oct 2016 09:45:35 +0000 (09:45 +0000)]
[StaticAnalyser] Add test case to ensure that unreachable code is found.

https://reviews.llvm.org/D24905

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

7 years ago[StaticAnalyzer] Fix UnreachableCode false positives.
Daniel Marjamaki [Mon, 3 Oct 2016 08:28:51 +0000 (08:28 +0000)]
[StaticAnalyzer] Fix UnreachableCode false positives.

When there is 'do { } while (0);' in the code the ExplodedGraph and UnoptimizedCFG did not match.

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

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

7 years ago[analyzer] Improve CloneChecker diagnostics
Artem Dergachev [Mon, 3 Oct 2016 08:11:50 +0000 (08:11 +0000)]
[analyzer] Improve CloneChecker diagnostics

Highlight code clones referenced by the warning message with the help of
the extra notes feature recently introduced in r283092.

Change warning text to more clang-ish. Remove suggestions from the copy-paste
error checker diagnostics, because currently our suggestions are strictly 50%
wrong (we do not know which of the two code clones contains the error), and
for that reason we should not sound as if we're actually suggesting this.
Hopefully a better solution would bring them back.

Make sure the suspicious clone pair structure always mentions
the correct variable for the second clone.

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

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

7 years ago[analyzer] Add extra notes to ObjCDeallocChecker
Artem Dergachev [Mon, 3 Oct 2016 08:03:51 +0000 (08:03 +0000)]
[analyzer] Add extra notes to ObjCDeallocChecker

The report is now highlighting instance variables and properties
referenced by the warning message with the help of the
extra notes feature recently introduced in r283092.

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

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

7 years ago[analyzer] Extend bug reports with extra notes
Artem Dergachev [Mon, 3 Oct 2016 07:58:26 +0000 (07:58 +0000)]
[analyzer] Extend bug reports with extra notes

These diagnostics are separate from the path-sensitive engine's path notes,
and can be added manually on top of path-sensitive or path-insensitive reports.

The new note diagnostics would appear as note:-diagnostic on console and
as blue bubbles in scan-build. In plist files they currently do not appear,
because format needs to be discussed with plist file users.

The analyzer option "-analyzer-config notes-as-events=true" would convert
notes to normal path notes, and put them at the beginning of the path.
This is a temporary hack to show the new notes in plist files.

A few checkers would be updated in subsequent commits,
including tests for this new feature.

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

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

7 years agoKeep the test only for Itanium abi
Aditya Kumar [Mon, 3 Oct 2016 02:36:33 +0000 (02:36 +0000)]
Keep the test only for Itanium abi

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

7 years ago[cmake] Install 'clang-cpp' symlink
Michal Gorny [Sun, 2 Oct 2016 19:28:57 +0000 (19:28 +0000)]
[cmake] Install 'clang-cpp' symlink

Install the 'clang-cpp' symlink used to spawn the preprocessor. The code
handling this suffix is already included in Driver. FreeBSD is already
creating such a symlink in ports, and a similar one was requested
by Gentoo/FreeBSD team. The goal is to handle software that takes a C
preprocessor via a variable but does not handle passing options
correctly (i.e. 'clang -E' does not work).

Bug: https://bugs.gentoo.org/478810

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

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

7 years ago[AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics when...
Craig Topper [Sun, 2 Oct 2016 17:43:00 +0000 (17:43 +0000)]
[AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics when rounding mode isn't used.

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