[Linux] Import some LLVM fixes for GCC warnings - #3794
Merged
Conversation
../lib/DxcSupport/dxcmem.cpp:46:55: warning: ISO C++ requires the name after '::~' to be found in the same scope as the name before '::~' [-Wdtor-name]
g_ThreadMallocTls->llvm::sys::ThreadLocal<IMalloc>::~ThreadLocal();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
::ThreadLocal
Reviewers: dblaikie, dexonsmith Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D50296 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339367 91177308-0d34-0410-b5e6-96231b3b80d8 Picked from: https://github.com/llvm-project/llvm/commit/425788d8b599aef1e77092228423e0bb641df359.patch
Summary: This is a new warning which fires when one stores a reference to the initializer_list contents in a way which may outlive the initializer_list which it came from. In llvm this warning is triggered whenever someone uses the initializer_list ArrayRef constructor. This is indeed a dangerous thing to do (I myself was bitten by that at least once), but it is not more dangerous than calling other ArrayRef constructors with temporary objects -- something which we are used to and have accepted as a tradeoff for ArrayRef's efficiency. Currently, this warnings generates so much output that it completely obscures any actionable warnings, so this patch disables it. Reviewers: rnk, aaron.ballman Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70122 Picked from: https://github.com/llvm/llvm-project/commit/6c2151bf4c829958891e65a4cc396daa6d308eb0.patch
Jaebaek Seo (jaebaek)
approved these changes
May 25, 2021
Jaebaek Seo (jaebaek)
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. Thanks!
Gregory Roth (pow2clk)
approved these changes
May 27, 2021
Gregory Roth (pow2clk)
left a comment
Collaborator
There was a problem hiding this comment.
Looks good! We often add // HLSL Change comments to changes in LLVM files, but since these are drawn from upstream LLVM, it's not really applicable here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
And a small clang warning.
Came across these again while testing #3793, having already imported the fixes prior - better to just submit them instead of rotting away on a local branch. They don't nearly cover them all, but especially the
memcpyis extremely verbose and makes reading the logs unbearable (though, so is-Wimplicit-fallthrough=and-Woverloaded-virtual).