]> granicus.if.org Git - clang/log
clang
7 years agoRevert "Try to unbreak buildbots after r298913."
Juergen Ributzka [Wed, 29 Mar 2017 00:24:34 +0000 (00:24 +0000)]
Revert "Try to unbreak buildbots after r298913."

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

7 years agoRevert "clangToolingRefactor: Add libdeps upon clangFormat in r298913."
Juergen Ributzka [Wed, 29 Mar 2017 00:24:32 +0000 (00:24 +0000)]
Revert "clangToolingRefactor: Add libdeps upon clangFormat in r298913."

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

7 years agoDefault enable the rtm feature only on skylake and later for now because Intel disabl...
Eric Christopher [Tue, 28 Mar 2017 23:03:19 +0000 (23:03 +0000)]
Default enable the rtm feature only on skylake and later for now because Intel disabled the feature on some haswell and broadwell processors:

http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf

the -mrtm option will still work normally.

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

7 years ago[analyzer] Fix symbolication for unknown unary increment/decrement results.
Artem Dergachev [Tue, 28 Mar 2017 15:57:12 +0000 (15:57 +0000)]
[analyzer] Fix symbolication for unknown unary increment/decrement results.

If the value is known, but we cannot increment it, conjure a symbol to
represent the result of the operation based on the operator expression,
not on the sub-expression.

In particular, no longer crash on comparing a result of a LocAsInteger increment
to a constant integer.

rdar://problem/31067356

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

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

7 years ago[analyzer] When creating a temporary object, properly copy the value into it.
Artem Dergachev [Tue, 28 Mar 2017 15:43:26 +0000 (15:43 +0000)]
[analyzer] When creating a temporary object, properly copy the value into it.

Adjustments should be considered properly; we should copy the unadjusted object
over the whole temporary base region. If the unadjusted object is no longer
available in the Environment, invalidate the temporary base region, and then
copy the adjusted object into the adjusted sub-region of the temporary region.

This fixes a regression introduced by r288263, that caused various
false positives, due to copying only adjusted object into the adjusted region;
the rest of the base region therefore remained undefined.
Before r288263, the adjusted value was copied over the unadjusted region,
which is incorrect, but accidentally worked better due to how region store
disregards compound value bindings to non-base regions.

An additional test machinery is introduced to make sure that despite making
two binds, we only notify checkers once for both of them, without exposing
the partially copied objects.

This fix is a hack over a hack. The proper fix would be to model C++ temporaries
in the CFG, and after that dealing with adjustments would no longer be
necessary, and the values we need would no longer disappear from the
Environment.

rdar://problem/30658168

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

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

7 years agoclangToolingRefactor: Add libdeps upon clangFormat in r298913.
NAKAMURA Takumi [Tue, 28 Mar 2017 14:18:10 +0000 (14:18 +0000)]
clangToolingRefactor: Add libdeps upon clangFormat in r298913.

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

7 years agoTry to unbreak buildbots after r298913.
Eric Liu [Tue, 28 Mar 2017 13:56:19 +0000 (13:56 +0000)]
Try to unbreak buildbots after r298913.

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

7 years agoAdded `applyAtomicChanges` function.
Eric Liu [Tue, 28 Mar 2017 13:05:32 +0000 (13:05 +0000)]
Added `applyAtomicChanges` function.

Summary: ... which applies a set of `AtomicChange`s on code.

Reviewers: klimek, djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

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

7 years ago[ASTMatchers] add typeAliasTemplateDecl matcher.
Eric Liu [Tue, 28 Mar 2017 12:56:47 +0000 (12:56 +0000)]
[ASTMatchers] add typeAliasTemplateDecl matcher.

Reviewers: hokein, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, cfe-commits, klimek

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

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

7 years agoFileManager: mark virtual file entries as valid entries
Erik Verbruggen [Tue, 28 Mar 2017 09:18:05 +0000 (09:18 +0000)]
FileManager: mark virtual file entries as valid entries

The getVirtualFile method would create entries for e.g. libclang's
CXUnsavedFile but not mark them as valid. The effect is that a lookup
through getFile where the file name is not exactly matching the virtual
file (e.g. through mixing slashes and backslashes on Windows) would
result in a normal file "lookup", and re-using the file entry found
by using the UniqueID, and overwrite the file entry fields. Because the
lookup involves opening the file, and moving it into the file entry, the
file is now open. The SourceManager keys its buffers on the UniqueID
(which is still the same), so it will find an already loaded buffer.
Because only the loading a buffer from disk will close the file, the
FileEntry will hold on to an open file for as long as the FileManager
is around. As the FileManager will only get destroyed at a reparse,
you can't safe to the "leaked" and locked file on Windows.

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

7 years ago[libclang] Fix crash in member access code completion with implicit base
Erik Verbruggen [Tue, 28 Mar 2017 07:22:21 +0000 (07:22 +0000)]
[libclang] Fix crash in member access code completion with implicit base

If there is an unresolved member access AST node, and the base is
implicit, do not access/use it for generating candidate overloads for
code completion results.

Fixes PR31093.

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

7 years agoUse BuildReturnStmt in SemaCoroutine to unbreak sanitizer tests.
Gor Nishanov [Tue, 28 Mar 2017 02:51:45 +0000 (02:51 +0000)]
Use BuildReturnStmt in SemaCoroutine to unbreak sanitizer tests.

FIXME: ActOnReturnStmt expects a scope that is inside of the function, due
  to CheckJumpOutOfSEHFinally(*this, ReturnLoc, *CurScope->getFnParent());
  S.getCurScope()->getFnParent() == nullptr at ActOnFinishFunctionBody when
  CoroutineBodyStmt is built. Figure it out and fix it.

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

7 years ago[coroutines] Handle get_return_object_on_allocation_failure
Gor Nishanov [Mon, 27 Mar 2017 23:36:59 +0000 (23:36 +0000)]
[coroutines] Handle get_return_object_on_allocation_failure

Summary:
If promise_type has get_return_object_on_allocation_failure defined,
check if an allocation function returns nullptr, and if so,
return the result of get_return_object_on_allocation_failure().

Reviewers: rsmith, EricWF

Reviewed By: EricWF

Subscribers: mehdi_amini, cfe-commits

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

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

7 years agoAdd [[clang::suppress(rule, ...)]] attribute
Matthias Gehre [Mon, 27 Mar 2017 19:45:24 +0000 (19:45 +0000)]
Add [[clang::suppress(rule, ...)]] attribute

Summary:
This patch implements parsing of [[clang::suppress(rule, ...)]]
and [[gsl::suppress(rule, ...)]] attributes.

C++ Core Guidelines depend heavily on tool support for
rule enforcement. They also propose a way to suppress
warnings [1] which is by annotating any ancestor in AST
with the C++11 attribute [[gsl::suppress(rule1,...)]].
To have a mechanism to suppress non-C++ Core
Guidelines specific, an additional spelling of [[clang::suppress]]
is defined.

For example, to suppress the warning cppcoreguidelines-slicing,
one could do
```
[[clang::suppress("cppcoreguidelines-slicing")]]
void f() { ... code that does slicing ... }
```
or
```
void g() {
  Derived b;
  [[clang::suppress("cppcoreguidelines-slicing")]]
  Base a{b};
  [[clang::suppress("cppcoreguidelines-slicing")]] {
    doSomething();
    Base a2{b};
  }
}
```

This parsing can then be used by clang-tidy, which includes multiple
C++ Core Guidelines rules, to suppress warnings (see
https://reviews.llvm.org/D24888).
For the exact naming of the rule in the attribute, there
are different possibilities, which will be defined in the
corresponding clang-tidy patch.

Currently, clang-tidy supports suppressing of warnings through "//
NOLINT" comments. There are some advantages that the attribute has:
- Suppressing specific warnings instead of all warnings
- Suppressing warnings in a block (namespace, function, compound
  statement)
- Code formatting may split a statement into multiple lines,
  thus a "// NOLINT" comment may be on the wrong line

I'm looking forward to your comments!

[1] https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#inforce-enforcement

Reviewers: alexfh, aaron.ballman, rsmith

Subscribers: cfe-commits

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

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

7 years agoEncapsulate FPOptions and use it consistently
Adam Nemet [Mon, 27 Mar 2017 19:17:25 +0000 (19:17 +0000)]
Encapsulate FPOptions and use it consistently

Sema holds the current FPOptions which is adjusted by 'pragma STDC
FP_CONTRACT'.  This then gets propagated into expression nodes as they are
built.

This encapsulates FPOptions so that this propagation happens opaquely rather
than directly with the fp_contractable on/off bit.  This allows controlled
transitioning of fp_contractable to a ternary value (off, on, fast).  It will
also allow adding more fast-math flags later.

This is toward moving fp-contraction=fast from an LLVM TargetOption to a
FastMathFlag in order to fix PR25721.

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

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

7 years agoLook through CXXBindTemporaryExprs when checking CXXFunctionCastExprs
Daniel Jasper [Mon, 27 Mar 2017 16:29:41 +0000 (16:29 +0000)]
Look through CXXBindTemporaryExprs when checking CXXFunctionCastExprs
for unused values.

This fixes a regression caused by r298676, where constructor calls to
classes with non-trivial dtor were marked as unused if the first
argument is an initializer list. This is inconsistent (as the test
shows) and also warns on a reasonbly common code pattern where people
just call constructors to create and immediately destroy an object.

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

7 years ago[ARM] Add a driver option for +no-neg-immediates
Sanne Wouda [Mon, 27 Mar 2017 15:34:52 +0000 (15:34 +0000)]
[ARM] Add a driver option for +no-neg-immediates

Reviewers: olista01, rengolin, javed.absar, samparker

Reviewed By: samparker

Subscribers: samparker, llvm-commits, aemerson

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

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

7 years agoPublish one more parser RAII for external use.
Vassil Vassilev [Mon, 27 Mar 2017 13:11:32 +0000 (13:11 +0000)]
Publish one more parser RAII for external use.

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

7 years ago[OpenCL] Extended mapping of parcing CodeGen arguments
Egor Churaev [Mon, 27 Mar 2017 10:38:01 +0000 (10:38 +0000)]
[OpenCL] Extended mapping of parcing CodeGen arguments

Summary: Enable cl_mad_enamle and cl_no_signed_zeros options when user turns on cl_unsafe_math_optimizations or cl_fast_relaxed_math options.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[XRay][clang] Remove dependency on libatomic for XRay builds
Dean Michael Berris [Mon, 27 Mar 2017 07:14:11 +0000 (07:14 +0000)]
[XRay][clang] Remove dependency on libatomic for XRay builds

Summary:
This change depends on D31381 where we change the implementation to use
sanitizer_common provided atomic operations library.

Fixes http://llvm.org/PR32274.

Reviewers: pelikan, dblaikie

Subscribers: cfe-commits

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

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

7 years agoRevert r298742 "[ODRHash] Add error messages for mismatched parameters in methods."
Vassil Vassilev [Sun, 26 Mar 2017 21:39:16 +0000 (21:39 +0000)]
Revert r298742 "[ODRHash] Add error messages for mismatched parameters in methods."

I failed to revert this in r298816.

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

7 years agoRevert 298754 and 298742.
Vassil Vassilev [Sun, 26 Mar 2017 18:32:53 +0000 (18:32 +0000)]
Revert 298754 and 298742.

They broke llvm modules builds and our internal modules infrastructure.

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

7 years ago[coroutines] Add codegen for await and yield expressions
Gor Nishanov [Sun, 26 Mar 2017 02:18:05 +0000 (02:18 +0000)]
[coroutines] Add codegen for await and yield expressions

Details:

Emit suspend expression which roughly looks like:

auto && x = CommonExpr();
if (!x.await_ready()) {
   llvm_coro_save();
   x.await_suspend(...);     (*)
   llvm_coro_suspend(); (**)
}
x.await_resume();
where the result of the entire expression is the result of x.await_resume()

(*) If x.await_suspend return type is bool, it allows to veto a suspend:
if (x.await_suspend(...))
   llvm_coro_suspend();
(**) llvm_coro_suspend() encodes three possible continuations as a switch instruction:

%where-to = call i8 @llvm.coro.suspend(...)
switch i8 %where-to, label %coro.ret [ ; jump to epilogue to suspend
  i8 0, label %yield.ready   ; go here when resumed
  i8 1, label %yield.cleanup ; go here when destroyed
]

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

7 years ago_CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit.
Eric Christopher [Sat, 25 Mar 2017 19:26:04 +0000 (19:26 +0000)]
_CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit.
Adjust and add a test for the 32-bit side.

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

7 years ago[AMDGPU] Make AMDGPUTargetInfo::AS private
Yaxun Liu [Sat, 25 Mar 2017 11:34:41 +0000 (11:34 +0000)]
[AMDGPU] Make AMDGPUTargetInfo::AS private

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

7 years agoUpdate the comment on not yet generated preprocessor defines to remove __LONGDOUBLE128.
Eric Christopher [Sat, 25 Mar 2017 06:38:57 +0000 (06:38 +0000)]
Update the comment on not yet generated preprocessor defines to remove __LONGDOUBLE128.

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

7 years agoAdd the __LONGDOUBLE128 define for ppc targets that have 128 bit long doubles.
Eric Christopher [Sat, 25 Mar 2017 06:37:23 +0000 (06:37 +0000)]
Add the __LONGDOUBLE128 define for ppc targets that have 128 bit long doubles.

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

7 years agoDefine __HAVE_BSWAP__ on ppc to match gcc since we support both builtins as well.
Eric Christopher [Sat, 25 Mar 2017 05:40:13 +0000 (05:40 +0000)]
Define __HAVE_BSWAP__ on ppc to match gcc since we support both builtins as well.

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

7 years ago[AMDGPU] Switch address space mapping by triple environment amdgiz
Yaxun Liu [Sat, 25 Mar 2017 03:46:25 +0000 (03:46 +0000)]
[AMDGPU] Switch address space mapping by triple environment amdgiz

For target environment amdgiz and amdgizcl (giz means Generic Is Zero), AMDGPU will use new address space mapping where generic address space is 0 and private address space is 5. The data layout is also changed correspondingly.

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

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

7 years agoAdd the _CALL_LINUX preprocessor define for ppc linux platforms.
Eric Christopher [Sat, 25 Mar 2017 03:33:59 +0000 (03:33 +0000)]
Add the _CALL_LINUX preprocessor define for ppc linux platforms.

This typically is only for a new enough linker (bfd >= 2.16.2 or gold), but
our ppc suppport post-dates this and it should work on all linux platforms. It
is guaranteed to work on all elfv2 platforms.

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

7 years ago__BIGGEST_ALIGNMENT__ has always been 16 on all power platforms rather
Eric Christopher [Sat, 25 Mar 2017 02:55:21 +0000 (02:55 +0000)]
__BIGGEST_ALIGNMENT__ has always been 16 on all power platforms rather
than the default of 8 in clang, fix and update tests accordingly.

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

7 years agoAdd preprocessor defines for a bare powerpc64le triple/cpu.
Eric Christopher [Sat, 25 Mar 2017 02:29:18 +0000 (02:29 +0000)]
Add preprocessor defines for a bare powerpc64le triple/cpu.
The le triple didn't exist until power8, so use that as a default (this
also matches what gcc does).

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

7 years ago[ODRHash] Add support for array and decayed types.
Richard Trieu [Sat, 25 Mar 2017 00:48:52 +0000 (00:48 +0000)]
[ODRHash] Add support for array and decayed types.

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

7 years ago[ODRHash] Add error messages for mismatched parameters in methods.
Richard Trieu [Fri, 24 Mar 2017 21:17:48 +0000 (21:17 +0000)]
[ODRHash] Add error messages for mismatched parameters in methods.

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

7 years agoFix a test so that it actually checks the output.
Peter Collingbourne [Fri, 24 Mar 2017 19:32:20 +0000 (19:32 +0000)]
Fix a test so that it actually checks the output.

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

7 years agoFix MSVC 'not all control paths return a value' warning.
Simon Pilgrim [Fri, 24 Mar 2017 16:59:14 +0000 (16:59 +0000)]
Fix MSVC 'not all control paths return a value' warning.

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

7 years ago[OpenCL][Bug 10573] Don't set CXXOperatorNames flag
Anastasia Stulova [Fri, 24 Mar 2017 16:43:51 +0000 (16:43 +0000)]
[OpenCL][Bug 10573] Don't set CXXOperatorNames flag

The flag CXXOperatorNames was overwritten unconditionally
after being set for OpenCL.

There seems to be no necessity to set it, so removing the line.

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

7 years ago[analyzer] MisusedMovedObject: Remove deprecated callback. NFC
Artem Dergachev [Fri, 24 Mar 2017 10:16:08 +0000 (10:16 +0000)]
[analyzer] MisusedMovedObject: Remove deprecated callback. NFC

wantsRegionChangeUpdate() checker callback is no longer used since recently.

Fixes a buildbot warning.

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

7 years ago[analyzer] Add MisusedMovedObjectChecker for detecting use-after-move errors.
Artem Dergachev [Fri, 24 Mar 2017 09:52:30 +0000 (09:52 +0000)]
[analyzer] Add MisusedMovedObjectChecker for detecting use-after-move errors.

The checker currently warns on copying, moving, or calling methods on an object
that was recently std::move'd from. It understands a set of "state reset"
methods that bring a moved-from object back to a well-specified state.

Patch by Peter Szecsi!

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

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

7 years ago[libclang] Bury dead TemporaryFiles
Krasimir Georgiev [Fri, 24 Mar 2017 09:49:54 +0000 (09:49 +0000)]
[libclang] Bury dead TemporaryFiles

Summary:
AllocatedCXCodeCompleteResults::TemporaryFiles have turned into zombies.
Seven years ago they used to do their job during [[ https://github.com/llvm-mirror/clang/commit/313e26c4e81f0e467490a530548450f4c824a6c4/tools/CIndex/CIndexCodeCompletion.cpp#diff-02d3e692ad507b10af9458b775c5750bL261 | file remapping]], but now they are created just to be torn down in the destructor.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits

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

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

7 years agoRevert r298491 and r298494 which changed Clang's handling of 'nonnull'
Chandler Carruth [Fri, 24 Mar 2017 09:11:57 +0000 (09:11 +0000)]
Revert r298491 and r298494 which changed Clang's handling of 'nonnull'
attributes.

These patches don't work because we can't currently access the parameter
information in a reliable way when building attributes. I thought this
would be relatively straightforward to fix, but it seems not to be the
case. Fixing this will requrie a substantial re-plumbing of machinery to
allow attributes to be handled in this location, and several other fixes
to the attribute machinery should probably be made at the same time. All
of this will make the patch .... substantially more complicated.

Reverting for now as there are active miscompiles caused by the current
version.

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

7 years agoFix handling of initialization from parenthesized initializer list.
Richard Smith [Fri, 24 Mar 2017 01:14:25 +0000 (01:14 +0000)]
Fix handling of initialization from parenthesized initializer list.

This change fixes a crash on initialization of a reference from ({}) during
template instantiation and incidentally improves diagnostics.

This reverts a prior attempt to handle this in r286721. Instead, we teach the
initialization code that initialization cannot be performed if a source type
is required and the initializer is an initializer list (which is not an
expression and does not have a type), and likewise for function-style cast
expressions.

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

7 years ago[XRay] Do not depend on C++ stdlib for XRay builds
Dean Michael Berris [Fri, 24 Mar 2017 00:20:05 +0000 (00:20 +0000)]
[XRay] Do not depend on C++ stdlib for XRay builds

Summary:
Now that XRay doesn't require a runtime dependency on a C++ standard
library, we remove that dependency from the clang linker flags.

Reviewers: saugustine, pelikan

Subscribers: cfe-commits

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

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

7 years agoRemove uses of std::binary_function, removed in C++17.
Richard Smith [Thu, 23 Mar 2017 23:32:03 +0000 (23:32 +0000)]
Remove uses of std::binary_function, removed in C++17.

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

7 years agoRemove all uses of std::mem_fun and std::bind1st removed in C++17.
Richard Smith [Thu, 23 Mar 2017 23:17:58 +0000 (23:17 +0000)]
Remove all uses of std::mem_fun and std::bind1st removed in C++17.

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

7 years agoUpdate the SamplePGO test to verify that unroll/icp is not invoked in thinlto compile...
Dehao Chen [Thu, 23 Mar 2017 21:20:17 +0000 (21:20 +0000)]
Update the SamplePGO test to verify that unroll/icp is not invoked in thinlto compile phase.

Summary: This is the test added for https://reviews.llvm.org/D31217

Reviewers: tejohnson, mehdi_amini

Reviewed By: tejohnson

Subscribers: cfe-commits, Prazek

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

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

7 years ago[ThinLTO] Clang support for emitting minimized bitcode for thin link
Teresa Johnson [Thu, 23 Mar 2017 19:47:49 +0000 (19:47 +0000)]
[ThinLTO] Clang support for emitting minimized bitcode for thin link

Summary:
Clang companion patch to LLVM patch D31027, which adds support
for emitting minimized bitcode file for use in the thin link step.
Add a cc1 option -fthin-link-bitcode=<file> to trigger this behavior.

Depends on D31027.

Reviewers: mehdi_amini, pcc

Subscribers: cfe-commits, Prazek

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

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

7 years agoCorrect class-template deprecation behavior-REDUX
Erich Keane [Thu, 23 Mar 2017 18:51:54 +0000 (18:51 +0000)]
Correct class-template deprecation behavior-REDUX

Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Previous DiffRev: https://reviews.llvm.org/D27486, was reverted.
This patch fixes the issues brought up here by the reverter: https://reviews.llvm.org/rL298410

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

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

7 years ago[index] When indexing system headers make sure to report important reference relations
Argyrios Kyrtzidis [Thu, 23 Mar 2017 16:34:47 +0000 (16:34 +0000)]
[index] When indexing system headers make sure to report important reference relations

Even if we exclude plain reference occurrences, we should include relation-based references, like the 'base' one.

rdar://31010737

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

7 years agoPublish RAIIObjectsForParser.h for external usage.
Vassil Vassilev [Thu, 23 Mar 2017 15:11:07 +0000 (15:11 +0000)]
Publish RAIIObjectsForParser.h for external usage.

Some clients (eg the cling interpreter) need to recover their parser from
errors.

Patch by Axel Naumann (D31190)!

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

7 years agoSupport attributes for Objective-C categories
Alex Lorenz [Thu, 23 Mar 2017 11:44:25 +0000 (11:44 +0000)]
Support attributes for Objective-C categories

rdar://31095315

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

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

7 years ago[CodeGen] Emit a CoreFoundation link guard when @available is used
Alex Lorenz [Thu, 23 Mar 2017 11:14:27 +0000 (11:14 +0000)]
[CodeGen] Emit a CoreFoundation link guard when @available is used

After r297760, __isOSVersionAtLeast in compiler-rt loads the CoreFoundation
symbols at runtime. This means that `@available` will always fail when used in a
binary without a linked CoreFoundation.

This commit forces Clang to emit a reference to a CoreFoundation symbol when
`@available` is used to ensure that linking will fail when CoreFoundation isn't
linked with the build product.

rdar://31039592

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

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

7 years ago[ObjC][ARC] Avoid -Warc-performSelector-leaks for performSelector variations
Alex Lorenz [Thu, 23 Mar 2017 10:46:05 +0000 (10:46 +0000)]
[ObjC][ARC] Avoid -Warc-performSelector-leaks for performSelector variations
that became supported after r297019

The commit r297019 expanded the performSelector ObjC method family heuristic
to ensure that -Wobjc-unsafe-perform-selector covers all performSelector
variations. However, this made the -Warc-performSelector-leaks too noisy, as
that warning produces mostly false positives since the selector is unknown.
This commit reverts the ObjC method family heuristics introduced in r297019.
This ensures that -Warc-performSelector-leaks isn't too noisy. The commit still
preserves the coverage of -Wobjc-unsafe-perform-selector.

rdar://31124629

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

7 years agoFix issues in clang-format's AlignConsecutive modes.
Nikola Smiljanic [Thu, 23 Mar 2017 02:51:25 +0000 (02:51 +0000)]
Fix issues in clang-format's AlignConsecutive modes.

Patch by Ben Harper.

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

7 years ago[coroutines] Implement unhandled_exception changes.
Eric Fiselier [Thu, 23 Mar 2017 00:33:33 +0000 (00:33 +0000)]
[coroutines] Implement unhandled_exception changes.

Summary:
This patch adopts the recent changes that renamed `set_exception(exception_pointer)` to `unhandled_exception()`.

Additionally `unhandled_exception()` is now required, and so an error is emitted when exceptions are enabled but the promise type does not provide the member.
When exceptions are disabled a warning is emitted instead of an error, The warning notes that the `unhandled_exception()` function is required when exceptions are enabled.

Reviewers: rsmith, GorNishanov, aaron.ballman, majnemer

Reviewed By: GorNishanov

Subscribers: mehdi_amini, cfe-commits

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

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

7 years agoActually install scan-build / ccc-analyzer / c++-analyzer on windows
Jonathan Roelofs [Wed, 22 Mar 2017 21:13:49 +0000 (21:13 +0000)]
Actually install scan-build / ccc-analyzer / c++-analyzer on windows

Before, we were only installing the wrappers... oops.

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

7 years ago[X86] Implement __readgsqword (and the rest) as builtins (PR32373)
Hans Wennborg [Wed, 22 Mar 2017 19:13:13 +0000 (19:13 +0000)]
[X86] Implement __readgsqword (and the rest) as builtins (PR32373)

It seems MS headers have started using __readgsqword, and since it's
used in a header that doesn't include intrin.h, we can't implement it as
an inline function anymore.

That was already the case for __readfsdword, which Saleem added support
for in r220859. This patch reuses that codegen to implement all of
__read[fg]s{byte,word,dword,qword}.

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

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

7 years ago[X86][MMX] Add tests for _mm_set*_* intrinsics
Simon Pilgrim [Wed, 22 Mar 2017 14:55:43 +0000 (14:55 +0000)]
[X86][MMX] Add tests for _mm_set*_* intrinsics

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

7 years agoRevert "Correct class-template deprecation behavior"
Martin Bohme [Wed, 22 Mar 2017 13:34:37 +0000 (13:34 +0000)]
Revert "Correct class-template deprecation behavior"

This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).

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

7 years agoRevert "iFix Test deprecation behavior in C89 mode as a result of r298410"
Martin Bohme [Wed, 22 Mar 2017 13:33:03 +0000 (13:33 +0000)]
Revert "iFix Test deprecation behavior in C89 mode as a result of r298410"

This reverts commit r298433. (Required to revert r298410, see comments
there.)

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

7 years agoRemove an overly aggressive assert in r298491 and leave a comment
Chandler Carruth [Wed, 22 Mar 2017 10:38:07 +0000 (10:38 +0000)]
Remove an overly aggressive assert in r298491 and leave a comment
explaining why we have to ignore errors here even though in other parts
of codegen we can be more strict with builtins.

Also add a test case based on the code in a TSan test that found this
issue.

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

7 years ago[Serialization] Serialize DependentSizedExtVectorType
Alex Lorenz [Wed, 22 Mar 2017 10:04:48 +0000 (10:04 +0000)]
[Serialization] Serialize DependentSizedExtVectorType

rdar://30659700

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

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

7 years ago[nonnull] Teach Clang to attach the nonnull LLVM attribute to
Chandler Carruth [Wed, 22 Mar 2017 09:09:13 +0000 (09:09 +0000)]
[nonnull] Teach Clang to attach the nonnull LLVM attribute to
declarations and calls instead of just definitions, and then teach it to
*not* attach such attributes even if the source code contains them.

This follows the design direction discussed on cfe-dev here:
http://lists.llvm.org/pipermail/cfe-dev/2017-January/052066.html

The idea is that for C standard library builtins, even if the library
vendor chooses to annotate their routines with __attribute__((nonnull)),
we will ignore those attributes which pertain to pointer arguments that
have an associated size. This allows the widespread (and seemingly
reasonable) pattern of calling these routines with a null pointer and
a zero size. I have only done this for the library builtins currently
recognized by Clang, but we can now trivially add to this set. This will
be controllable with -fno-builtin if anyone should care to do so.

Note that this does *not* change the AST. As a consequence, warnings,
static analysis, and source code rewriting are not impacted.

This isn't even a regression on any platform as neither Clang nor LLVM
have ever put 'nonnull' onto these arguments for declarations. All this
patch does is enable it on other declarations while preventing us from
ever accidentally enabling it on these libc functions due to a library
vendor.

It will also allow any other libraries using this annotation to gain
optimizations based on the annotation even when only a declaration is
visible.

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

7 years agoAdd LibreOffice Clang plugin to ExternalClangExamples.rst
Stephan Bergmann [Wed, 22 Mar 2017 08:45:49 +0000 (08:45 +0000)]
Add LibreOffice Clang plugin to ExternalClangExamples.rst

Reviewers: rsmith, rizsotto.mailinglist

Subscribers: cfe-commits

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

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

7 years agoMove setting of LangOpts based on target flags out of CompilerInstance
Eric Christopher [Wed, 22 Mar 2017 06:36:09 +0000 (06:36 +0000)]
Move setting of LangOpts based on target flags out of CompilerInstance
and into TargetInfo::adjust so that it gets called in more places
throughout the compiler (AST serialization in particular).

Should fix PPC modules after removing of faltivec.

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

7 years agoSuppress warning on unreachable [[clang::fallthrough]] within a template instantiation.
Richard Smith [Wed, 22 Mar 2017 01:49:19 +0000 (01:49 +0000)]
Suppress warning on unreachable [[clang::fallthrough]] within a template instantiation.

We don't know whether some other instantiation of the template might be able to
reach the annotation, so warning on it has a high chance of false positives.

Patch by Ahmed Asadi!

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

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

7 years agoRemove -ffp-contract=fast from this test
Adam Nemet [Wed, 22 Mar 2017 00:58:18 +0000 (00:58 +0000)]
Remove -ffp-contract=fast from this test

It does not need it and causes mismatch after -ffp-contract=fast is turned
into an FMF.

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

7 years agoChange -ffp-contract=fast test to run on Aarch64
Adam Nemet [Wed, 22 Mar 2017 00:58:15 +0000 (00:58 +0000)]
Change -ffp-contract=fast test to run on Aarch64

(I don't have powerpc enabled in my build and I am changing
how -ffp-contract=fast works.)

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

7 years ago[Modules] Rebuild modules on umbrella header mismatch
Bruno Cardoso Lopes [Wed, 22 Mar 2017 00:11:21 +0000 (00:11 +0000)]
[Modules] Rebuild modules on umbrella header mismatch

This restores behavior pre-r230064 since after PCMCache work (r298278)
we don't reload PCMs from disk within the same compiler invocation.

Testcases from r230064 are still left around since they still guarantee
the correct behavior we're expecting.

rdar://problem/19889777

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

7 years agoRemove the -faltivec alias option and replace it with -maltivec everywhere.
Eric Christopher [Tue, 21 Mar 2017 22:06:18 +0000 (22:06 +0000)]
Remove the -faltivec alias option and replace it with -maltivec everywhere.
The alias was only ever used on darwin and had some issues there,
and isn't used in practice much. Also fixes a problem with -mno-altivec
not turning off -maltivec.

Also add a diagnostic for faltivec/fno-altivec that directs users to use
maltivec options and include the altivec.h file explicitly.

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

7 years agoAdd support for -fno-auto-profile and -fno-profile-sample-use
Dehao Chen [Tue, 21 Mar 2017 21:40:53 +0000 (21:40 +0000)]
Add support for -fno-auto-profile and -fno-profile-sample-use

Summary: We need to be able to disable samplepgo for specific files by supporting -fno-auto-profile and -fno-profile-sample-use

Reviewers: davidxl, dnovillo, echristo

Reviewed By: echristo

Subscribers: echristo, cfe-commits

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

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

7 years agoApply clang-tidy's performance-unnecessary-value-param to parts of clang.
Benjamin Kramer [Tue, 21 Mar 2017 21:35:04 +0000 (21:35 +0000)]
Apply clang-tidy's performance-unnecessary-value-param to parts of clang.

No functionality change intended.

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

7 years ago[c-index-test] Fix memory leak in c-index-test tool.
Argyrios Kyrtzidis [Tue, 21 Mar 2017 21:34:05 +0000 (21:34 +0000)]
[c-index-test] Fix memory leak in c-index-test tool.

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

7 years agoiFix Test deprecation behavior in C89 mode as a result of r298410
Erich Keane [Tue, 21 Mar 2017 20:14:46 +0000 (20:14 +0000)]
iFix Test deprecation behavior in C89 mode as a result of r298410

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

7 years agoLet llvm.objectsize be conservative with null pointers
George Burgess IV [Tue, 21 Mar 2017 20:09:35 +0000 (20:09 +0000)]
Let llvm.objectsize be conservative with null pointers

D28494 adds another parameter to @llvm.objectsize. Clang needs to be
sure to pass that third arg whenever applicable.

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

7 years agoClang change: Do not inline hot callsites for samplepgo in thinlto compile phase.
Dehao Chen [Tue, 21 Mar 2017 19:55:46 +0000 (19:55 +0000)]
Clang change: Do not inline hot callsites for samplepgo in thinlto compile phase.

Summary:
Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro
file, thus we do not want to inline hot callsites in the first phase.

Reviewers: tejohnson, eraman

Reviewed By: tejohnson

Subscribers: mehdi_amini, cfe-commits, Prazek

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

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

7 years ago[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a...
Coby Tayree [Tue, 21 Mar 2017 19:33:32 +0000 (19:33 +0000)]
[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a compound expression

This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions.
Currently - only supported as a stand alone Operand, e.g.:
"TYPE X"
now allowed :
"4 + TYPE X * 128"

LLVM side: https://reviews.llvm.org/D31173
Differential Revision: https://reviews.llvm.org/D31174

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

7 years ago[CMake] fix CLANG_INCLUDE_DIRS CMake export
Guillaume Papin [Tue, 21 Mar 2017 19:17:53 +0000 (19:17 +0000)]
[CMake] fix CLANG_INCLUDE_DIRS CMake export

Summary:
This change should fixes the export of CLANG_INCLUDE_DIRS variable in ClangConfig.cmake.

Unlike for the other variables, CLANG_INSTALL_PREFIX wasn't escaped meaning CLANG_INCLUDE_DIRS
resulting in the path "/include" instead of "${CLANG_INSTALL_PREFIX}/include".

Reviewers: beanz

Subscribers: mgorny

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

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

7 years agoFix array sizes where address space is not yet known
Konstantin Zhuravlyov [Tue, 21 Mar 2017 18:55:39 +0000 (18:55 +0000)]
Fix array sizes where address space is not yet known

For variables in generic address spaces, for example:

```
unsigned char V[6442450944];
...
```

the address space is not yet known when we get into
*getConstantArrayType*, it is 0. AMDGCN target's
address space 0 has 32 bits pointers, so when we
call *getPointerWidth* with 0, the array size is
trimmed to 32 bits, which is not right.

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

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

7 years agoModules: Remove an invalid check in unit tests for r298278
Duncan P. N. Exon Smith [Tue, 21 Mar 2017 18:26:18 +0000 (18:26 +0000)]
Modules: Remove an invalid check in unit tests for r298278

This is a fixup for the unit tests from r298278 (originally r298165).

Since the buffer that RawB2 pointed at was later deleted, a new call to
getBuffer may very well return a buffer at the same/old address.  Which is
fine.  Just delete the spurious check.

A Windows bot was occasionally hitting this in practice:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7086

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

7 years agoCorrect class-template deprecation behavior
Erich Keane [Tue, 21 Mar 2017 17:49:17 +0000 (17:49 +0000)]
Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

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

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

7 years agoUpdate Clang for LLVM rename AttributeSet -> AttributeList
Reid Kleckner [Tue, 21 Mar 2017 16:57:30 +0000 (16:57 +0000)]
Update Clang for LLVM rename AttributeSet -> AttributeList

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

7 years ago[index/AST] Determine if a typedef shares a name and spelling location with its under...
Argyrios Kyrtzidis [Tue, 21 Mar 2017 16:56:02 +0000 (16:56 +0000)]
[index/AST] Determine if a typedef shares a name and spelling location with its underlying tag type

In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent',
meaning we treat its references as symbols of the underlying tag symbol.
Also provide a libclang API to check for such typedefs.

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

7 years ago[Modules] Find PrivateHeaders when looking into subframeworks
Bruno Cardoso Lopes [Tue, 21 Mar 2017 16:43:51 +0000 (16:43 +0000)]
[Modules] Find PrivateHeaders when looking into subframeworks

Fix the current parsing of subframeworks in modulemaps to lookup for
headers based on whether they are frameworks.

rdar://problem/30563982

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

7 years ago[DOXYGEN] Improvements to smmintrin.h and emmintrin.h intrinsics.
Ekaterina Romanova [Tue, 21 Mar 2017 13:34:06 +0000 (13:34 +0000)]
[DOXYGEN] Improvements to smmintrin.h and emmintrin.h intrinsics.

I made some small changes in smmintrin.h and emmintrin.h intrinsics.
 - changed some regular comments '//' into doxygen-style comments '///' where necessary
 - removed some trailing spaces in doxygen comments.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.

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

7 years ago[OpenCL] Added diagnostic for checking length of vector
Egor Churaev [Tue, 21 Mar 2017 13:20:57 +0000 (13:20 +0000)]
[OpenCL] Added diagnostic for checking length of vector

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[OpenCL] Added implicit conversion rank for overloading functions with vector data...
Egor Churaev [Tue, 21 Mar 2017 12:55:55 +0000 (12:55 +0000)]
[OpenCL] Added implicit conversion rank for overloading functions with vector data type in OpenCL

Summary: I added a new rank to ImplicitConversionRank enum to resolve the function overload ambiguity with vector types. Rank of scalar types conversion is lower than vector splat. So, we can choose which function should we call. See test for more details.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[X86][AVX512] Add _mm512_cvtsd_f64 and _mm512_cvtss_f32 intrinsics (PR32305)
Simon Pilgrim [Tue, 21 Mar 2017 12:46:13 +0000 (12:46 +0000)]
[X86][AVX512] Add _mm512_cvtsd_f64 and _mm512_cvtss_f32 intrinsics (PR32305)

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

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

7 years ago[scan-build-py] reuse command line output parameter for report directory
Laszlo Nagy [Tue, 21 Mar 2017 10:15:18 +0000 (10:15 +0000)]
[scan-build-py] reuse command line output parameter for report directory

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

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

7 years agoAdd support for attribute enum_extensibility.
Akira Hatanaka [Tue, 21 Mar 2017 02:23:00 +0000 (02:23 +0000)]
Add support for attribute enum_extensibility.

This commit adds support for a new attribute that will be used to
distinguish between extensible and inextensible enums. There are three
main purposes of this attribute:

1. Give better control over when enum-related warnings are issued.
For example, in the code below, clang will not issue a -Wassign-enum
warning if the enum is marked "open":

enum __attribute__((enum_extensibility(closed))) EnumClosed {
  B0 = 1, B1 = 10
};

enum __attribute__((enum_extensibility(open))) EnumOpen {
  C0 = 1, C1 = 10
};

enum EnumClosed ec = 100; // warning issued
enum EnumOpen eo = 100; // no warning

2. Enable code-completion and debugging tools to offer better
suggestions.

3. Make it easier for swift's clang importer to determine which swift
type an enum should be mapped to.

For more details, see the discussion I started on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2017-February/052748.html

rdar://problem/12764379
rdar://problem/23145650

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

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

7 years agoIRGen: Do not set dllexport on declarations.
Peter Collingbourne [Tue, 21 Mar 2017 02:02:41 +0000 (02:02 +0000)]
IRGen: Do not set dllexport on declarations.

Setting dllexport on a declaration has no effect, as we do not emit export
directives for declarations.

Part of the fix for PR32334.

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

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

7 years agoAdd a function to MD5 a file's contents.
Zachary Turner [Mon, 20 Mar 2017 23:33:18 +0000 (23:33 +0000)]
Add a function to MD5 a file's contents.

In doing so, clean up the MD5 interface a little.  Most
existing users only care about the lower 8 bytes of an MD5,
but for some users that care about the upper and lower,
there wasn't a good interface.  Furthermore, consumers
of the MD5 checksum were required to handle endianness
details on their own, so it seems reasonable to abstract
this into a nicer interface that just gives you the right
value.

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

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

7 years agoFix parsing of htmxlintrin.h in C++ mode
Eric Christopher [Mon, 20 Mar 2017 22:31:33 +0000 (22:31 +0000)]
Fix parsing of htmxlintrin.h in C++ mode
 - Fix a variable naming mismatch
 - Fix gcc extension pointer arithmetic on void to cast to char *.
 - Test that the header (and htmintrin.h) parse.

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

7 years ago[docs] Clarify sanitizer flag behavior
Vedant Kumar [Mon, 20 Mar 2017 21:40:58 +0000 (21:40 +0000)]
[docs] Clarify sanitizer flag behavior

PR32346 suggests that UBSan's docs about the -fsanitize,
-fno-sanitize-recover, and -fsanitize-trap options are not explicit
enough. Try to improve the wording.

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

7 years agoTurn on HTM on power8 and later (including powerpc64le) since it's
Eric Christopher [Mon, 20 Mar 2017 21:12:53 +0000 (21:12 +0000)]
Turn on HTM on power8 and later (including powerpc64le) since it's
available by default on those cpus and configurations.

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

7 years agoProposal: Backward-edge CFI for return statements (RCFI)
Kostya Serebryany [Mon, 20 Mar 2017 20:42:00 +0000 (20:42 +0000)]
Proposal: Backward-edge CFI for return statements (RCFI)

Summary: Proposal: Backward-edge CFI for return statements (RCFI)

Reviewers: pcc, eugenis, krasin

Reviewed By: eugenis

Subscribers: llvm-commits

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

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

7 years agoAvoid these headers looking like the same file on a content-addressed file system.
Richard Smith [Mon, 20 Mar 2017 20:14:03 +0000 (20:14 +0000)]
Avoid these headers looking like the same file on a content-addressed file system.

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

7 years agoBump __cplusplus for C++17 to 201703L per the C++17 DIS.
Richard Smith [Mon, 20 Mar 2017 20:12:48 +0000 (20:12 +0000)]
Bump __cplusplus for C++17 to 201703L per the C++17 DIS.

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

7 years agoReapply "Modules: Cache PCMs in memory and avoid a use-after-free"
Duncan P. N. Exon Smith [Mon, 20 Mar 2017 17:58:26 +0000 (17:58 +0000)]
Reapply "Modules: Cache PCMs in memory and avoid a use-after-free"

This reverts commit r298185, effectively reapplying r298165, after fixing the
new unit tests (PR32338).  The memory buffer generator doesn't null-terminate
the MemoryBuffer it creates; this version of the commit informs getMemBuffer
about that to avoid the assert.

Original commit message follows:

----

Clang's internal build system for implicit modules uses lock files to
ensure that after a process writes a PCM it will read the same one back
in (without contention from other -cc1 commands).  Since PCMs are read
from disk repeatedly while invalidating, building, and importing, the
lock is not released quickly.  Furthermore, the LockFileManager is not
robust in every environment.  Other -cc1 commands can stall until
timeout (after about eight minutes).

This commit changes the lock file from being necessary for correctness
to a (possibly dubious) performance hack.  The remaining benefit is to
reduce duplicate work in competing -cc1 commands which depend on the
same module.  Follow-up commits will change the internal build system to
continue after a timeout, and reduce the timeout.  Perhaps we should
reconsider blocking at all.

This also fixes a use-after-free, when one part of a compilation
validates a PCM and starts using it, and another tries to swap out the
PCM for something new.

The PCMCache is a new type called MemoryBufferCache, which saves memory
buffers based on their filename.  Its ownership is shared by the
CompilerInstance and ModuleManager.

- The ModuleManager stores PCMs there that it loads from disk, never
touching the disk if the cache is hot.

- When modules fail to validate, they're removed from the cache.

- When a CompilerInstance is spawned to build a new module, each
already-loaded PCM is assumed to be valid, and is frozen to avoid
the use-after-free.

- Any newly-built module is written directly to the cache to avoid the
round-trip to the filesystem, making lock files unnecessary for
correctness.

Original patch by Manman Ren; most testcases by Adrian Prantl!

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

7 years agoFix some sphinx -Werror's
Jonathan Roelofs [Mon, 20 Mar 2017 17:07:49 +0000 (17:07 +0000)]
Fix some sphinx -Werror's

... mostly having to do with code blocks which the syntax highlighter chokes on

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