Repository navigation
[linux-port] Fix DiagnosticPrinter use of std::hex - #179
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
Well I signed the CLA. Hopefully it'll kick in. If not, I can upload again. |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
@googlebot is confusing me. Is it upset about the throwaway email address generated for the commit? |
|
❌ Build DirectXShaderCompiler 1.0.18 failed (commit 4a0122db65 by @) |
|
CLAs look good, thanks! |
|
❌ Build DirectXShaderCompiler 1.0.31 failed (commit e5bd60b2b0 by @pow2clk) |
|
❌ Build DirectXShaderCompiler 1.0.33 failed (commit 24c8c5f86c by @pow2clk) |
|
If I'm reading the results correctly, the only failure is on a Windows test suite: CompilerTest::CompileWhenNoMemThenOOM. I've tried unsuccessfully to reproduce this locally on my Windows build. The only effect I can see this having on memory allocation is that I increased the size of raw_ostream objects by 4 bytes because I added an integer member variable. That doesn't seem likely to cause a failure. |
|
The only remaining failure in the automated tests is the Windows failure acknowledged by the latest comment in #177. I think this is good to go barring any review feedback. |
antiagainst
left a comment
There was a problem hiding this comment.
Thanks for the fix! Generally it looks good to me. A few nits inlined.
There was a problem hiding this comment.
The convention is to wrap changes to existing LLVM code base with // HLSL Change.
Applies to the following cases.
There was a problem hiding this comment.
Hmm. There are some clear cases where I missed this, but it might get a bit ridiculous if I go too far with it. Should I put it on every line I changed and around multiline changes including those I just added something to or should I presume that certain corresponding changes can be inferred?
For example, if I comment that the new member variable is an HLSL addition, do I still need to mark every reference of it? Or can it be considered a given?
Happy to go either way. Just don't want to do too much or too little.
There was a problem hiding this comment.
Yeah. Microsoft does not give clear criteria on how this should be done. My understanding is that we need to wrap whatever code we've changed in existing LLVM/Clang codebase (no need for completely new source files). For single line code change, just use // HLSL Change. For multiple lines of code change, use // HLSL Change Starts and // HLSL Change Ends like /* and */.
We normally don't introduce new changes to existing LLVM/Clang code base; most of the time we are just changing what Microsoft had already touched. So it's a little bit hassle to have these markers, but I'd expect they don't occur that much.
There was a problem hiding this comment.
Yeah. I was going to fix them if I had to fix something else. So it looks like I am.
DiagnosticPrinter doesn't support io manipulators like std::hex, in spite of that, they were included in some invocations of it. MSVC seemed to allow this because it interpretted std::hex as a void pointer, which is supported. This adds support of std::hex and similar manipulators by adding an overloaded operator<< that takes the type of std::hex and its friends and sets a base number which is used when the base is not 10 to print numbers in the specified base, which can only be 8 or 16 according to what is passed in. Also while I was changing things in raw_ostream.h I added a missing override keyword that produced a lot of warnings on clang. Fixes google#170
|
❌ Build DirectXShaderCompiler 1.0.38 failed (commit 5c79651546 by @pow2clk) |
DiagnosticPrinter doesn't support io manipulators like std::hex,
in spite of that, including them in the output stream with MSVC
succeeded because it interpretted std::hex as a void pointer, which
is supported.
This adds support of it by adding an overloaded operator<< that takes
the type of std::hex and its friends and sets a base number which is
used when the base is not 10 to print numbers in the specified base,
which can only be 8 or 16 according to what is passed in.
Fixes #170