]> granicus.if.org Git - clang/log
clang
5 years ago[WebAssembly] Remove old builtins
Dan Gohman [Mon, 14 Jan 2019 18:28:10 +0000 (18:28 +0000)]
[WebAssembly] Remove old builtins

This removes the old grow_memory and mem.grow-style builtins, leaving just
the memory.grow-style builtins.

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

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

5 years ago[Sema] Expose a control flag for integer to pointer ext warning
Kristina Brooks [Mon, 14 Jan 2019 18:16:51 +0000 (18:16 +0000)]
[Sema] Expose a control flag for integer to pointer ext warning

While building openJDK11u, it seems that some of the code in the
native core libraries make liberal use of integer to pointer
comparisons. We currently have no flag to disabled this warning.
This add such a flag.

Patch by Kader (abdoul-kader keita)

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

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

5 years ago[AST] Fix double-traversal of code in top-level lambdas in RAV(implicit = yes).
Sam McCall [Mon, 14 Jan 2019 17:16:00 +0000 (17:16 +0000)]
[AST] Fix double-traversal of code in top-level lambdas in RAV(implicit = yes).

Summary:
Prior to r351069, lambda classes were traversed or not depending on the
{Function, Class, Namespace, TU} DeclContext containing them.
If it was a function (common case) they were not traversed.
If it was a namespace or TU (top-level lambda) they were traversed as part of
that DeclContext traversal.

r351069 "fixed" RAV to traverse these as part of the LambdaExpr, which is the
right place. But top-level lambdas are now traversed twice.
We fix that as blocks and block captures were apparently fixed in the past.

Maybe it would be nicer to avoid adding the lambda classes to the DeclContext
in the first place, but I can't work out the implications of that.

Reviewers: bkramer, klimek

Subscribers: cfe-commits

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

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

5 years agoclang-cl: Fix help text for /O<flags>: '/O2y-' means '/O2 /Oy-', not '/O2 /y-'
Nico Weber [Mon, 14 Jan 2019 12:42:35 +0000 (12:42 +0000)]
clang-cl: Fix help text for /O<flags>: '/O2y-' means '/O2 /Oy-', not '/O2 /y-'

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

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

5 years agoclang-cl: Align help texts for /O1 and O2
Nico Weber [Mon, 14 Jan 2019 12:41:13 +0000 (12:41 +0000)]
clang-cl: Align help texts for /O1 and O2

Makes it a bit easier to see what exactly the difference is.

Also use "same as" instead of "equivalent to", because that's faster to read.

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

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

5 years ago[OpenCL] Set generic addr space of 'this' in special class members.
Anastasia Stulova [Mon, 14 Jan 2019 11:44:22 +0000 (11:44 +0000)]
[OpenCL] Set generic addr space of 'this' in special class members.

Set address spaces of 'this' param correctly for implicit special
class members.

This also changes initialization conversion sequence to separate
address space conversion from other qualifiers in case of binding
reference to a temporary. In this case address space conversion
should happen after the binding (unlike for other quals). This is
needed to materialize it correctly in the alloca address space.

Initial patch by Mikael Nilssoni!

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

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

5 years ago[AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.
Sam McCall [Mon, 14 Jan 2019 10:31:42 +0000 (10:31 +0000)]
[AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.

Summary:
This fixes ASTContext's parent map for nodes in such classes (e.g. operator()).
https://bugs.llvm.org/show_bug.cgi?id=39949

This also changes the observed shape of the AST for implicit RAVs.
- this includes AST MatchFinder: cxxRecordDecl() now matches lambda classes,
functionDecl() matches the call operator, and the parent chain is body -> call
operator -> lambda class -> lambdaexpr rather than body -> lambdaexpr.
- this appears not to matter for the ASTImporterLookupTable builder
- this doesn't matter for the other RAVs in-tree.

In order to do this, we remove the TraverseLambdaBody hook. The problem is it's
hard/weird to ensure this hook is called when traversing via the implicit class.
There were just two users of this hook in-tree, who use it to skip bodies.
I replaced these with explicitly traversing the captures only. Another approach
would be recording the bodies when the lambda is visited, and then recognizing
them later.
I'd be open to suggestion on how to preserve this hook, instead.

Reviewers: aaron.ballman, JonasToth

Subscribers: cfe-commits, rsmith, jdennett

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

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

5 years ago[X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select in IR...
Craig Topper [Mon, 14 Jan 2019 08:46:51 +0000 (08:46 +0000)]
[X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select in IR instead.

Fixes PR40259

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

5 years ago[X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a vXi1...
Craig Topper [Mon, 14 Jan 2019 00:03:55 +0000 (00:03 +0000)]
[X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a vXi1 vector.

We'll do the scalar<->vXi1 conversions with bitcasts in IR.

Fixes PR40258

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

5 years agoNFC: Make utility private
Stephen Kelly [Sat, 12 Jan 2019 17:07:05 +0000 (17:07 +0000)]
NFC: Make utility private

No callers are external to the class anymore.

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

5 years ago[ASTDump] NFC: Move dump of individual Stmts to TextNodeDumper
Stephen Kelly [Sat, 12 Jan 2019 16:53:27 +0000 (16:53 +0000)]
[ASTDump] NFC: Move dump of individual Stmts to TextNodeDumper

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years agoImplement TemplateArgument dumping in terms of Visitor
Stephen Kelly [Sat, 12 Jan 2019 16:35:37 +0000 (16:35 +0000)]
Implement TemplateArgument dumping in terms of Visitor

Summary: Split the output streaming from the traversal to other AST nodes.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[ASTDump] Change parameter to StringRef
Stephen Kelly [Sat, 12 Jan 2019 15:45:05 +0000 (15:45 +0000)]
[ASTDump] Change parameter to StringRef

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

5 years ago[analyzer] Fix unused variable warnings in Release builds
Benjamin Kramer [Sat, 12 Jan 2019 12:43:53 +0000 (12:43 +0000)]
[analyzer] Fix unused variable warnings in Release builds

This was just an inlined version of isa<CXXConstructExpr>. NFC.

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

5 years ago[NetBSD] Enable additional sanitizer types
Michal Gorny [Sat, 12 Jan 2019 11:18:35 +0000 (11:18 +0000)]
[NetBSD] Enable additional sanitizer types

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

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

5 years agoNFC: Port loop to cxx_range_for
Stephen Kelly [Sat, 12 Jan 2019 00:42:59 +0000 (00:42 +0000)]
NFC: Port loop to cxx_range_for

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

5 years ago[analyzer] Support for OSObjects out parameters in RetainCountChecker
George Karpenkov [Fri, 11 Jan 2019 23:35:17 +0000 (23:35 +0000)]
[analyzer] Support for OSObjects out parameters in RetainCountChecker

rdar://46357478
rdar://47121327

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

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

5 years ago[analyzer] Introduce a convenience method for getting a CallEvent from an arbitrary...
George Karpenkov [Fri, 11 Jan 2019 23:35:04 +0000 (23:35 +0000)]
[analyzer] Introduce a convenience method for getting a CallEvent from an arbitrary Stmt

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

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

5 years ago[Darwin][Driver] Don't pass a file as object_path_lto during ThinLTO
Steven Wu [Fri, 11 Jan 2019 21:16:04 +0000 (21:16 +0000)]
[Darwin][Driver] Don't pass a file as object_path_lto during ThinLTO

Summary:
After r327851, Driver::GetTemporaryPath will create the file rather than
just create a potientially unqine filename. If clang driver pass the
file as parameter as -object_path_lto, ld64 will pass it back to libLTO
as GeneratedObjectsDirectory, which is going to cause a LLVM ERROR if it
is not a directory.
Now during thinLTO, pass a temp directory path to linker instread.

rdar://problem/47194182

Reviewers: arphaman, dexonsmith

Reviewed By: arphaman

Subscribers: mehdi_amini, inglorion, jkorous, cfe-commits

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

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

5 years agoImplement Attr dumping in terms of visitors
Stephen Kelly [Fri, 11 Jan 2019 19:16:01 +0000 (19:16 +0000)]
Implement Attr dumping in terms of visitors

Remove now-vestigial dumpType and dumpBareDeclRef methods. The old
tablegen generated code used to expect them to be present, but the new
generated code has no such requirement.

Reviewers: aaron.ballman

Subscribers: mgorny, cfe-commits

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

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

5 years ago[ASTDump] Add utility for dumping a label with child nodes
Stephen Kelly [Fri, 11 Jan 2019 19:11:17 +0000 (19:11 +0000)]
[ASTDump] Add utility for dumping a label with child nodes

Summary:
Use it to add optional label nodes to Stmt dumps.  This preserves
behavior of InitExprList dump:

// CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]'
// CHECK-NEXT:   |-array_filler: InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int'
// CHECK-NEXT:   `-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int'
// CHECK-NEXT:     `-IntegerLiteral {{.+}} <col:14> 'int' 1

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[Bug 39548][Clang] PGO bootstrap fails with python3: errors in perf-helper.py
Serge Guelton [Fri, 11 Jan 2019 19:04:48 +0000 (19:04 +0000)]
[Bug 39548][Clang] PGO bootstrap fails with python3: errors in perf-helper.py

Current clang fail to bootstrap in PGO mode when only python3 is available,
because perf-helper.py is not compatible with python3.

Commited on behalf of  Romain Geissler.

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

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

5 years ago[test] Update support for Exynos M4 (NFC)
Evandro Menezes [Fri, 11 Jan 2019 18:54:41 +0000 (18:54 +0000)]
[test] Update support for Exynos M4 (NFC)

Update test cases for Exynos M4.

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

5 years ago[MergeFunc] Update clang test for r350939
Vedant Kumar [Fri, 11 Jan 2019 18:51:02 +0000 (18:51 +0000)]
[MergeFunc] Update clang test for r350939

In r350939, the MergeFunc pass learned to erase duplicate functions
which are discardable if unused.

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

5 years ago[LTO] Add option to enable LTOUnit splitting, and disable unless needed
Teresa Johnson [Fri, 11 Jan 2019 18:32:07 +0000 (18:32 +0000)]
[LTO] Add option to enable LTOUnit splitting, and disable unless needed

Summary:
Adds a new -f[no]split-lto-unit flag that is disabled by default to
control module splitting during ThinLTO. It is automatically enabled
for -fsanitize=cfi and -fwhole-program-vtables.

The new EnableSplitLTOUnit codegen flag is passed down to llvm
via a new module flag of the same name.

Depends on D53890.

Reviewers: pcc

Subscribers: ormris, mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits, llvm-commits

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

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

5 years ago[analyzer] [NFC] Fix the FIXME in tests
George Karpenkov [Fri, 11 Jan 2019 18:12:49 +0000 (18:12 +0000)]
[analyzer] [NFC] Fix the FIXME in tests

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

5 years ago[attributes] Extend os_returns_(not_?)_retained attributes to parameters
George Karpenkov [Fri, 11 Jan 2019 18:02:08 +0000 (18:02 +0000)]
[attributes] Extend os_returns_(not_?)_retained attributes to parameters

When applied to out-parameters, the attributes specify the expected lifetime of the written-into object.

Additionally, introduce OSReturnsRetainedOn(Non)Zero attributes, which
specify that an ownership transfer happens depending on a return code.

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

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

5 years agoFix a pair of Wfallthrough warnings in ScanfFormatString.
Erich Keane [Fri, 11 Jan 2019 18:01:40 +0000 (18:01 +0000)]
Fix a pair of Wfallthrough warnings in ScanfFormatString.

Change-Id: Ia73a34fdd93fc974224583505f9e6432493cb0da

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

5 years agoImplementation Feature Test Macros for P0722R3
Chris Kennelly [Fri, 11 Jan 2019 17:09:22 +0000 (17:09 +0000)]
Implementation Feature Test Macros for P0722R3

Summary:
P1353R0, adopted in San Diego, specified an implementation feature test macro for destroying delete (P0722R3).

The implementation of the feature (https://reviews.llvm.org/rL315662) is not guarded behind a flag, so the macro is not conditional on language version.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

5 years agoSilence -Wsign-compare in unittests
Bjorn Pettersson [Fri, 11 Jan 2019 16:53:45 +0000 (16:53 +0000)]
Silence -Wsign-compare in unittests

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

5 years ago[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed
Akira Hatanaka [Fri, 11 Jan 2019 07:06:38 +0000 (07:06 +0000)]
[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed
to it is a trivial_abi class.

A class that has all of its copy and move constructors deleted can still
be passed or returned in registers if the class is annotated with
trivial_abi.

This fixes PR39683.

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

5 years ago[Sema] If CheckPlaceholderExpr rewrites the initializer of an auto
Akira Hatanaka [Fri, 11 Jan 2019 04:57:34 +0000 (04:57 +0000)]
[Sema] If CheckPlaceholderExpr rewrites the initializer of an auto
variable during auto type deduction, use the rewritten initializer when
performing initialization of the variable.

This silences spurious -Warc-repeated-use-of-weak warnings that are
issued when the initializer uses a weak ObjC pointer.

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

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

5 years agoRemember to instantiate explicit template argument lists in a friend
Richard Smith [Fri, 11 Jan 2019 01:59:33 +0000 (01:59 +0000)]
Remember to instantiate explicit template argument lists in a friend
function declaration.

We'd previously often just drop these on the floor, and friend
redeclaration matching would usually (but not always) figure out the
right redeclaration anyway.

Also, don't try to match a dependent friend function template
specialization to a template until instantiation, and don't forget to
reject qualified friend declarations in dependent contexts that don't
name an already-declared entity.

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

5 years ago[AST] Remove ASTContext from getThisType (NFC)
Brian Gesiak [Fri, 11 Jan 2019 01:54:53 +0000 (01:54 +0000)]
[AST] Remove ASTContext from getThisType (NFC)

Summary:
https://reviews.llvm.org/D54862 removed the usages of `ASTContext&` from
within the `CXXMethodDecl::getThisType` method. Remove the parameter
altogether, as well as all usages of it. This does not result in any
functional change because the parameter was unused since
https://reviews.llvm.org/D54862.

Test Plan: check-clang

Reviewers: akyrtzi, mikael

Reviewed By: mikael

Subscribers: mehdi_amini, dexonsmith, cfe-commits

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

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

5 years agoFix header issues.
Richard Trieu [Fri, 11 Jan 2019 01:32:35 +0000 (01:32 +0000)]
Fix header issues.

Several headers would fail to compile if other headers were not previously
included.  The usual issue is that a class is forward declared, but the
full definition is needed.  The requirement for the definition is use of
isa/dyn_cast or calling functions of pointer-packed data types such as
DenseMap or PointerIntPair.  Add missing includes to these headers.

SVals.h required an out-of-line method definition in the .cpp file to avoid
circular inclusion of headers with BasicValueFactory.h

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

5 years agoAdd an explicit initializer to silence a -Wmissing-field-initializers diagnostic...
Aaron Ballman [Fri, 11 Jan 2019 00:13:57 +0000 (00:13 +0000)]
Add an explicit initializer to silence a -Wmissing-field-initializers diagnostic; NFC.

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

5 years ago[WebAssembly] Add unimplemented-simd128 feature, gate builtins
Thomas Lively [Thu, 10 Jan 2019 23:49:00 +0000 (23:49 +0000)]
[WebAssembly] Add unimplemented-simd128 feature, gate builtins

Summary: Depends on D56501. Also adds a macro define
`__wasm_unimplemented_simd128__` for feature detection of
unimplemented SIMD builtins.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits, rrwinterton

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

5 years ago[analyzer] pr38838, pr39976: Fix crash on diagnosing before implicit destructor.
Artem Dergachev [Thu, 10 Jan 2019 23:44:44 +0000 (23:44 +0000)]
[analyzer] pr38838, pr39976: Fix crash on diagnosing before implicit destructor.

We need to be able to emit the diagnostic at PreImplicitCall,
and the patch implements this functionality.

However, for now the need for emitting such diagnostics is not all that great:
it is only necessary to not crash when emitting a false positive due to an
unrelated issue of having dead symbol collection not working properly.

Coming up with a non-false-positive test seems impossible with the current
set of checkers, though it is likely to be needed for good things as well
in the future.

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

rdar://problem/46911462

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

5 years agoProperly support -shared-libgcc.
Sterling Augustine [Thu, 10 Jan 2019 22:25:58 +0000 (22:25 +0000)]
Properly support -shared-libgcc.
This revision was revied in D55016.

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

5 years agoCorrect the source range returned from preprocessor callbacks.
Aaron Ballman [Thu, 10 Jan 2019 21:22:13 +0000 (21:22 +0000)]
Correct the source range returned from preprocessor callbacks.

This adjusts the source range passed in to the preprocessor callbacks to only include the condition range itself, rather than all of the conditionally skipped tokens.

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

5 years agoNFC: Change case of identifiers
Stephen Kelly [Thu, 10 Jan 2019 20:58:21 +0000 (20:58 +0000)]
NFC: Change case of identifiers

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

5 years ago[Sema] Call CheckPlaceholderExpr to resolve typeof or decltype
Akira Hatanaka [Thu, 10 Jan 2019 20:12:16 +0000 (20:12 +0000)]
[Sema] Call CheckPlaceholderExpr to resolve typeof or decltype
placeholder expressions while an unevaluated context is still on the
expression evaluation context stack.

This prevents recordUseOfWeek from being called when a weak variable is
used as an operand of a decltype or a typeof expression and fixes
spurious -Warc-repeated-use-of-weak warnings.

rdar://problem/45742525

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

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

5 years ago[HIP] Use nul instead of /dev/null when running on windows
Yaxun Liu [Thu, 10 Jan 2019 20:09:52 +0000 (20:09 +0000)]
[HIP] Use nul instead of /dev/null when running on windows

When clang is running on windows, /dev/null is not available. Use nul as empty input file instead.

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

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

5 years agofixup: sphinx warning
Nick Desaulniers [Thu, 10 Jan 2019 19:26:35 +0000 (19:26 +0000)]
fixup: sphinx warning

Fixes the sphinx warning:
tools/clang/docs/DiagnosticsReference.rst:7889: WARNING: Title underline
too short.

That I just introduced in r350877.

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

5 years ago[SemaCXX] add -Woverride-init alias to -Winitializer-overrides
Nick Desaulniers [Thu, 10 Jan 2019 19:12:39 +0000 (19:12 +0000)]
[SemaCXX] add -Woverride-init alias to -Winitializer-overrides

Summary:
https://bugs.llvm.org/show_bug.cgi?id=40251
https://github.com/ClangBuiltLinux/linux/issues/307

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, nathanchance, srhines

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

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

5 years agoFix false positive unsequenced access and modification warning in array subscript...
Nicolas Lesser [Thu, 10 Jan 2019 19:03:33 +0000 (19:03 +0000)]
Fix false positive unsequenced access and modification warning in array subscript expression.

Summary: In the [expr.sub] p1, we can read that for a given E1[E2], E1 is sequenced before E2.

Patch by Mateusz Janek.

Reviewers: rsmith, Rakete1111

Reviewed By: rsmith, Rakete1111

Subscribers: riccibruno, lebedev.ri, Rakete1111, hiraditya, cfe-commits

Tags: #clang

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

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

5 years ago[analyzer] [hotfix] Fix the tests
George Karpenkov [Thu, 10 Jan 2019 18:28:10 +0000 (18:28 +0000)]
[analyzer] [hotfix] Fix the tests

The error must have crept during the cherry-pick.

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

5 years ago[analyzer] Update the category name for RetainCountChecker reports
George Karpenkov [Thu, 10 Jan 2019 18:16:25 +0000 (18:16 +0000)]
[analyzer] Update the category name for RetainCountChecker reports

..now that it includes OSObjects

rdar://46509986

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

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

5 years ago[analyzer] [NFC] [RetainCountChecker] Remove dead unused map
George Karpenkov [Thu, 10 Jan 2019 18:16:10 +0000 (18:16 +0000)]
[analyzer] [NFC] [RetainCountChecker] Remove dead unused map

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

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

5 years ago[analyzer] Quote the type of the leaked/problematic object in diagnostics for readability
George Karpenkov [Thu, 10 Jan 2019 18:15:57 +0000 (18:15 +0000)]
[analyzer] Quote the type of the leaked/problematic object in diagnostics for readability

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

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

5 years ago[analyzer] [NFC] Reverse the argument order for "diff" in tests
George Karpenkov [Thu, 10 Jan 2019 18:15:44 +0000 (18:15 +0000)]
[analyzer] [NFC] Reverse the argument order for "diff" in tests

The current argument order has "expected" and "actual" the wrong way around,
so that the diff shows the change from expected to actual, not from actual to expected.

Namely, if the expected diagnostics contains the string "foo", but the analyzer emits "bar",
we really want to see:

```
- foo
+ bar
```

not

```
- bar
+ foo
```

since adapting to most changes would require applying that diff to the expected output.

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

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

5 years ago[analyzer] [NFC] Reduce redundancy in RetainSummaryManager by using a function
George Karpenkov [Thu, 10 Jan 2019 18:15:30 +0000 (18:15 +0000)]
[analyzer] [NFC] Reduce redundancy in RetainSummaryManager by using a function

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

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

5 years ago[analyzer] [RetainCountChecker] [NFC] Remove SummaryLog
George Karpenkov [Thu, 10 Jan 2019 18:15:17 +0000 (18:15 +0000)]
[analyzer] [RetainCountChecker] [NFC] Remove SummaryLog

The complicated machinery for passing the summary log around is actually
only used for one thing! To figure out whether the "dealloc" message was
sent.

Since I have tried to extend it for other uses and failed (it's actually
very hard to use), I think it's much better to simply use a tag and
remove the summary log altogether.

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

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

5 years ago[analyzer] [RetainCountChecker] [NFC] Another minor cleanup
George Karpenkov [Thu, 10 Jan 2019 18:15:04 +0000 (18:15 +0000)]
[analyzer] [RetainCountChecker] [NFC] Another minor cleanup

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

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

5 years ago[analyzer] [RetainCountChecker] [NFC] Refactor the way attributes are handled
George Karpenkov [Thu, 10 Jan 2019 18:14:51 +0000 (18:14 +0000)]
[analyzer] [RetainCountChecker] [NFC] Refactor the way attributes are handled

Make sure all checks for attributes go through a centralized function,
which checks whether attribute handling is enabled, and performs
validation.  The type of the attribute is returned.

Sadly, metaprogramming is required as attributes have no sensible static
getters.

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

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

5 years ago[analyzer] [RetainCountChecker] Remove redundant enum UnarySummaryKind
George Karpenkov [Thu, 10 Jan 2019 18:14:38 +0000 (18:14 +0000)]
[analyzer] [RetainCountChecker] Remove redundant enum UnarySummaryKind

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

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

5 years ago[analyzer] [RetainCountChecker] Remove obsolete "MakeCollectable" enum value
George Karpenkov [Thu, 10 Jan 2019 18:14:25 +0000 (18:14 +0000)]
[analyzer] [RetainCountChecker] Remove obsolete "MakeCollectable" enum value

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

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

5 years ago[analyzer] [RetainCountChecker] [NFC] Remove redundant enum items *Msg, as the object...
George Karpenkov [Thu, 10 Jan 2019 18:14:12 +0000 (18:14 +0000)]
[analyzer] [RetainCountChecker] [NFC] Remove redundant enum items *Msg, as the object type is already communicated by a separate field

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

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

5 years ago[analyzer] [NFC] Track object type with ArgEffect in RetainCountChecker.
George Karpenkov [Thu, 10 Jan 2019 18:13:59 +0000 (18:13 +0000)]
[analyzer] [NFC] Track object type with ArgEffect in RetainCountChecker.

This would be needed in the future.

https://reviews.llvm.org/D56040

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

5 years ago[analyzer] [NFC] Move ObjKind into a separate top-level enum in RetainSummaryManager.
George Karpenkov [Thu, 10 Jan 2019 18:13:46 +0000 (18:13 +0000)]
[analyzer] [NFC] Move ObjKind into a separate top-level enum in RetainSummaryManager.

Allows using it in future outside of RetEffect.

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

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

5 years agoSplit -Wdelete-non-virtual-dtor into two groups
Erik Pilkington [Thu, 10 Jan 2019 18:03:07 +0000 (18:03 +0000)]
Split -Wdelete-non-virtual-dtor into two groups

This group controls two diagnostics: deleting an abstract class with
a non-virtual dtor, which is a guaranteed crash, and deleting a
non-abstract polymorphic class with a non-virtual dtor, which is just
suspicious.

rdar://40380564

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

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

5 years ago[analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions
Rafael Stahl [Thu, 10 Jan 2019 17:44:04 +0000 (17:44 +0000)]
[analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions

Summary: This is just changing naming and documentation to be general about external definitions that can be imported for cross translation unit analysis. There is at least a plan to add VarDecls: D46421

Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, serge-sans-paille

Reviewed By: xazax.hun, martong

Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

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

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

5 years agoCorrect the spelling of helpURI to helpUri.
Aaron Ballman [Thu, 10 Jan 2019 13:19:48 +0000 (13:19 +0000)]
Correct the spelling of helpURI to helpUri.

JSON is case sensitive and the SARIF spec uses the corrected spelling.

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

5 years ago[libclang] Fix clang_Cursor_isAnonymous
Ivan Donchevskii [Thu, 10 Jan 2019 09:34:44 +0000 (09:34 +0000)]
[libclang] Fix clang_Cursor_isAnonymous

Use the same logic as in TypePrinter::printTag to determine that the tag is anonymous and the separate check for namespaces.

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

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

5 years ago[AMDGPU] Separate feature dot-insts
Stanislav Mekhanoshin [Thu, 10 Jan 2019 03:25:47 +0000 (03:25 +0000)]
[AMDGPU] Separate feature dot-insts

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

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

5 years agoRefactor declarations of ASTContext allocate functions into its own header.
Richard Trieu [Thu, 10 Jan 2019 03:23:25 +0000 (03:23 +0000)]
Refactor declarations of ASTContext allocate functions into its own header.

Forward declarations of the allocate functions combine with the forward
declaration of the ASTContext class is enough information for some headers
without pulling in ASTContext.h in its entirety.  Pull the existing
declarations from AttrIterator.h into a new header.  Also place the default
alignment size into this header.  Previously, new had its default in
AttrIterator.h while new[] had its default in ASTContext.h.  Add new header
includes where it is needed.  Specifically to ASTVector.h to make it a
standalone header, unlike previously which it was standalone as long as
none of its functions were called.

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

5 years ago[X86] Really make the pointer arguments to avx512 gather/scatter intrinsics 'void...
Craig Topper [Thu, 10 Jan 2019 00:47:25 +0000 (00:47 +0000)]
[X86] Really make the pointer arguments to avx512 gather/scatter intrinsics 'void*' to match gcc and Intel's documentation.

The avx2 gather intrinsics are documented to use 'int', 'long long', 'float', or 'double' *. So I'm leaving those. This matches gcc.

I tried to do this in r350696, but I only updated the header not the builtin definition.

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

5 years agoIn nothrow new-expressions, null-check the result if we're going to
Richard Smith [Thu, 10 Jan 2019 00:03:29 +0000 (00:03 +0000)]
In nothrow new-expressions, null-check the result if we're going to
apply sanitizers to it.

This avoids a sanitizer false positive that we are initializing a null
pointer.

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

5 years ago[Sema] Mark target of __attribute__((alias("target"))) used for C
Nick Desaulniers [Wed, 9 Jan 2019 23:54:55 +0000 (23:54 +0000)]
[Sema] Mark target of __attribute__((alias("target"))) used for C

Summary:
Prevents -Wunneeded-internal-delcaration warnings when the target has no
other references. This occurs frequently in device drivers in the Linux
kernel.

Sema would need to invoke the demangler on the target, since in C++ the
target name is mangled:

int f() { return 42; }
int g() __attribute__((alias("_Z1fv")));

Sema does not have the ability to demangle names at this time.

https://bugs.llvm.org/show_bug.cgi?id=39088
https://github.com/ClangBuiltLinux/linux/issues/232

Reviewers: rsmith, rjmccall

Reviewed By: rsmith

Subscribers: erik.pilkington, cfe-commits, pirama, srhines

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

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

5 years ago[ObjC] Allow the use of implemented unavailable methods from within
Alex Lorenz [Wed, 9 Jan 2019 22:31:37 +0000 (22:31 +0000)]
[ObjC] Allow the use of implemented unavailable methods from within
the @implementation context

In Objective-C, it's common for some frameworks to mark some methods like init
as unavailable in the @interface to prohibit their usage. However, these
frameworks then often implemented said method and refer to it in another method
that acts as a factory for that object. The recent change to how messages to
self are type checked in clang (r349841) introduced a regression which started
to prohibit this pattern with an X is unavailable error. This commit addresses
the aforementioned regression.

rdar://47134898

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

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

5 years ago[OpenMP] Avoid remainder operations for loop index values on a collapsed loop nest.
Gheorghe-Teodor Bercea [Wed, 9 Jan 2019 20:45:26 +0000 (20:45 +0000)]
[OpenMP] Avoid remainder operations for loop index values on a collapsed loop nest.

Summary: Change the strategy for computing loop index variables after collapsing a loop nest via the collapse clause by replacing the expensive remainder operation with multiplications and additions.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: guansong, arphaman, cfe-commits

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

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

5 years ago[OpenMP] Add flag for preventing the extension to 64 bits for the collapse loop counter
Gheorghe-Teodor Bercea [Wed, 9 Jan 2019 20:38:35 +0000 (20:38 +0000)]
[OpenMP] Add flag for preventing the extension to 64 bits for the collapse loop counter

Summary: Introduce a compiler flag for cases when the user knows that the collapsed loop counter can be safely represented using at most 32 bits. This will prevent the emission of expensive mathematical operations (such as the div operation) on the iteration variable using 64 bits where 32 bit operations are sufficient.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: hfinkel, kkwli0, guansong, cfe-commits

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

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

5 years ago[OPENMP][DOCS]Release notes/OpenMP support updates, NFC.
Alexey Bataev [Wed, 9 Jan 2019 20:32:56 +0000 (20:32 +0000)]
[OPENMP][DOCS]Release notes/OpenMP support updates, NFC.

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

5 years agoRemoving an include that was not necessary; NFC.
Aaron Ballman [Wed, 9 Jan 2019 20:15:10 +0000 (20:15 +0000)]
Removing an include that was not necessary; NFC.

The include also had a using namespace llvm in it, so this adds qualifiers where needed as well.

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

5 years ago[CodeGen] Clarify comment about COFF common symbol alignment
Shoaib Meenai [Wed, 9 Jan 2019 20:05:16 +0000 (20:05 +0000)]
[CodeGen] Clarify comment about COFF common symbol alignment

After a discussion on the commit thread, it seems the 32 byte alignment
limitation is an MSVC toolchain artifact, not an inherent COFF
restriction. Clarify the comment accordingly, since saying COFF in the
comment but using isKnownWindowsMSVCEnvironment in the conditional is
confusing. Also add a newline before the comment, which is consistent
with the local style.

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

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

5 years ago[AST] Move back BasePathSize to the bit-fields of CastExpr
Bruno Ricci [Wed, 9 Jan 2019 16:41:33 +0000 (16:41 +0000)]
[AST] Move back BasePathSize to the bit-fields of CastExpr

The number of trailing CXXBaseSpecifiers in CastExpr was moved from
CastExprBitfields to a trailing object in r338489 (D50050). At this time these
bit-fields classes were only 32 bits wide. However later r345459 widened these
bit-field classes to 64 bits.

The reason for this change was that on 64 bit archs alignment requirements
caused 4 bytes of padding after the Stmt sub-object in nearly all expression
classes. Reusing this padding yielded an >10% reduction in the size used by all
statement/expressions when parsing all of Boost (on a 64 bit arch). This
increased the size of statement/expressions for 32 bits archs, but this can be
mitigated by moving more data to the bit-fields of Stmt (and moreover most
people now care about 64 bits archs as a host).

Therefore move back the number of CXXBaseSpecifiers in CastExpr to the
bit-fields of Stmt. This in effect mostly revert r338489 while keeping the
added test.

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

Reviewed By: lebedev.ri

Reviewers: lebedev.ri, rjmccall

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

5 years agoIncorrect implicit data-sharing for nested tasks
Alexey Bataev [Wed, 9 Jan 2019 15:58:05 +0000 (15:58 +0000)]
Incorrect implicit data-sharing for nested tasks

Summary:
There is a minor issue in how the implicit data-sharings for nested tasks are computed.

For the following example:
```
int x;
#pragma omp task shared(x)
#pragma omp task
x++;
```
We compute an implicit data-sharing of shared for `x` in the second task although I think that it should be firstprivate. Below you can find the part of the OpenMP spec that covers this example:
- // In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above and that in the enclosing context is determined to be shared by all implicit tasks bound to the current team is shared.//
- //In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivate.//

Since each implicit-task has its own copy of `x`, we shouldn't apply the first rule.

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: cfe-commits, rogfer01

Tags: #openmp

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

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

5 years ago[AST] Store the results in OverloadExpr in a trailing array
Bruno Ricci [Wed, 9 Jan 2019 15:43:19 +0000 (15:43 +0000)]
[AST] Store the results in OverloadExpr in a trailing array

Use the newly available space in the bit-fields of Stmt to pack
OverloadExpr, UnresolvedLookupExpr and UnresolvedMemberExpr.

Additionally store the results in the overload set in a trailing array.
This saves 1 pointer + 8 bytes per UnresolvedLookupExpr and
UnresolvedMemberExpr.

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

Reviewed By: rjmccall

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

5 years agoRemove dependency-related arguments in clang-check.
Alexander Kornienko [Wed, 9 Jan 2019 15:00:06 +0000 (15:00 +0000)]
Remove dependency-related arguments in clang-check.

This is the default behavior of clang tools, but clang-check overrides default
argument adjusters for some reason.

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

5 years agoFix typo in comment
Nico Weber [Wed, 9 Jan 2019 14:19:16 +0000 (14:19 +0000)]
Fix typo in comment

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

5 years agoRevert r350648: "Fix clang for r350647: Missed a function rename"
Florian Hahn [Wed, 9 Jan 2019 13:30:47 +0000 (13:30 +0000)]
Revert r350648: "Fix clang for r350647: Missed a function rename"

The related commit r350647 breaks thread sanitizer on some macOS builders, e.g.
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52725/

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

5 years ago[Driver] Fix libcxx detection on Darwin with clang run as ./clang
Ilya Biryukov [Wed, 9 Jan 2019 13:08:11 +0000 (13:08 +0000)]
[Driver] Fix libcxx detection on Darwin with clang run as ./clang

Summary:
By using '..' instead of fs::parent_path.

The intention of the code was to go from 'path/to/clang/bin' to
'path/to/clang/include'. In most cases parent_path works, however it
would fail when clang is run as './clang'.

This was noticed in Chromium's bug tracker, see
https://bugs.chromium.org/p/chromium/issues/detail?id=919761

Reviewers: arphaman, thakis, EricWF

Reviewed By: arphaman, thakis

Subscribers: christof, cfe-commits

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

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

5 years agoUse DeclSpec for quals in DeclaratorChunk::FunctionTypeInfo.
Anastasia Stulova [Wed, 9 Jan 2019 11:25:09 +0000 (11:25 +0000)]
Use DeclSpec for quals in DeclaratorChunk::FunctionTypeInfo.

Rather than duplicating data fields, use DeclSpec directly to store
the qualifiers for the functions/methods. This change doesn't handle
attributes yet and has to be extended further.

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

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

5 years ago[X86] Make the pointer arguments to avx512 gather/scatter intrinsics 'void*' to match...
Craig Topper [Wed, 9 Jan 2019 07:36:01 +0000 (07:36 +0000)]
[X86] Make the pointer arguments to avx512 gather/scatter intrinsics 'void*' to match gcc and Intel's documentation.

The avx2 gather intrinsics are documented to use 'int', 'long long', 'float', or 'double' *. So I'm leaving those. This matches gcc.

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

5 years ago[libclang] Fix the mismatched delete operator for ExprEvalResult
Alex Lorenz [Tue, 8 Jan 2019 23:28:37 +0000 (23:28 +0000)]
[libclang] Fix the mismatched delete operator for ExprEvalResult

The '.stringVal' field in ExprEvalResult is allocated using new[],
but was freed using a regular delete. That caused memory leaks in
the test from r350666.

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

5 years ago[ASTDump] NFC: Move dumpDeclRef to NodeDumper
Stephen Kelly [Tue, 8 Jan 2019 23:11:24 +0000 (23:11 +0000)]
[ASTDump] NFC: Move dumpDeclRef to NodeDumper

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[Driver] Default to -fno-addrsig on Android.
Dan Albert [Tue, 8 Jan 2019 22:33:59 +0000 (22:33 +0000)]
[Driver] Default to -fno-addrsig on Android.

Summary: The Android NDK still uses GNU binutils by default.

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: cfe-commits

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

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

5 years ago[libclang] Recommit r336590 with a fix for the memory leak in the test
Alex Lorenz [Tue, 8 Jan 2019 22:32:51 +0000 (22:32 +0000)]
[libclang] Recommit r336590 with a fix for the memory leak in the test

The original commit had a memory leak in the test has a leak as it doesn't
dispose of the evaluated cursor result.

This also contains the follow-up NFC refactoring commit r336591.

rdar://45893054

Original commit message:

[libclang] evalute compound statement cursors before trying to evaluate
the cursor like a declaration

This change fixes a bug in libclang in which it tries to evaluate a statement
cursor as a declaration cursor, because that statement still has a pointer to
the declaration parent.

rdar://38888477

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

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

5 years agoImplement the TreeStructure interface through the TextNodeDumper
Stephen Kelly [Tue, 8 Jan 2019 22:32:48 +0000 (22:32 +0000)]
Implement the TreeStructure interface through the TextNodeDumper

Summary:
This way, when the generic ASTTraverser is extracted from ASTDumper,
there can't be any problem related to ordering of class members, a
concern that was raised in https://reviews.llvm.org/D55337.

This will also preserve the property that the generic traverser does not
enforce any coupling between the NodeDumper and the TreeStructure.

 https://godbolt.org/z/PEtT1_

Reviewers: aaron.ballman, erichkeane

Subscribers: cfe-commits

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

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

5 years agoAndroid is not GNU, so don't claim that it is.
Dan Albert [Tue, 8 Jan 2019 22:31:19 +0000 (22:31 +0000)]
Android is not GNU, so don't claim that it is.

Reviewers: pirama, srhines

Reviewed By: srhines

Subscribers: kristina, cfe-commits

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

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

5 years ago[Sema] Teach Clang that aligned allocation is not supported with macosx10.13
Louis Dionne [Tue, 8 Jan 2019 20:26:56 +0000 (20:26 +0000)]
[Sema] Teach Clang that aligned allocation is not supported with macosx10.13

Summary:
r306722 added diagnostics when aligned allocation is used with deployment
targets that do not support it, but the first macosx supporting aligned
allocation was incorrectly set to 10.13. In reality, the dylib shipped
with macosx10.13 does not support aligned allocation, but the dylib
shipped with macosx10.14 does.

Reviewers: ahatanak

Subscribers: christof, jkorous, dexonsmith, cfe-commits

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

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

5 years agoFix clang for r350647: Missed a function rename
Philip Pfaffe [Tue, 8 Jan 2019 20:00:55 +0000 (20:00 +0000)]
Fix clang for r350647: Missed a function rename

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

5 years agoFix opencl test broken on windows by r350643.
Erich Keane [Tue, 8 Jan 2019 19:10:43 +0000 (19:10 +0000)]
Fix opencl test broken on windows by r350643.

Windows doesn't allow common with alignment >32 bits, so these tests
were broken in windows mode.  This patch makes 'common' optional in
these cases.

Change-Id: I4d5fdd07ecdafc3570ef9b09cd816c2e5e4ed15e

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

5 years ago[NFC] Don't over-eagerly check block alignment
JF Bastien [Tue, 8 Jan 2019 18:51:38 +0000 (18:51 +0000)]
[NFC] Don't over-eagerly check block alignment

Alignment of __block isn't relevant to this test, remove its checking.

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

5 years agoLimit COFF 'common' emission to <=32 alignment types.
Erich Keane [Tue, 8 Jan 2019 18:44:22 +0000 (18:44 +0000)]
Limit COFF 'common' emission to <=32 alignment types.

As reported in PR33035, LLVM crashes if given a common object with an
alignment of greater than 32 bits. This is because the COFF file format
does not support these alignments, so emitting them is broken anyway.

This patch changes any global definitions greater than 32 bit alignment
to no longer be in 'common'.

https://bugs.llvm.org/show_bug.cgi?id=33035

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

Change-Id: I48609289753b7f3b58c5e2bc1712756750fbd45a

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

5 years ago__has_feature(pragma_clang_attribute_namespaces) should be __has_extension
Erik Pilkington [Tue, 8 Jan 2019 18:24:39 +0000 (18:24 +0000)]
__has_feature(pragma_clang_attribute_namespaces) should be __has_extension

Thanks to Richard Smith for pointing this out.

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

5 years agoRename DIFlagFixedEnum to DIFlagEnumClass. NFC
Paul Robinson [Tue, 8 Jan 2019 17:52:29 +0000 (17:52 +0000)]
Rename DIFlagFixedEnum to DIFlagEnumClass. NFC

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

5 years agoRevert "Split -Wdelete-non-virtual-dtor into -Wdelete-abstract-non-virtual-dtor"
Erik Pilkington [Tue, 8 Jan 2019 17:04:38 +0000 (17:04 +0000)]
Revert "Split -Wdelete-non-virtual-dtor into -Wdelete-abstract-non-virtual-dtor"

This reverts commit r350585. There was some late post-commit review
on phab.

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

5 years agoFix use-after-free bug in Tooling.
Alexander Kornienko [Tue, 8 Jan 2019 16:55:13 +0000 (16:55 +0000)]
Fix use-after-free bug in Tooling.

Summary:
`buildASTFromCodeWithArgs()` was creating a memory buffer referencing a
stack-allocated string.  This diff changes the implementation to copy the code
string into the memory buffer so that said buffer owns the memory.

Patch by Yitzhak Mandelbaum.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: cfe-commits, EricWF

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

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

5 years agoDon't emit DW_AT_enum_class unless it's actually an 'enum class'.
Paul Robinson [Tue, 8 Jan 2019 16:28:11 +0000 (16:28 +0000)]
Don't emit DW_AT_enum_class unless it's actually an 'enum class'.

Finishes off the functional part of PR36168.

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

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