SuccessChanges

Summary

  1. [X86] Add the rest of the ADC and SBB instructions to isDefConvertible. I don't know if this really affects anything. Just thought it was weird that we had all of the ADD/SUB/AND/OR/XOR instructions.
  2. [InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC
  3. Attempt #2 to appease buildbots "error: unable to create target: 'No available targets are compatible with this triple.'"
  4. Attempt to appease msc buildbot It was timing out on this test, but for reasons unrelated to the specific bug it was testing for. Randomly breaking in gdb with `clang -target i686-windows -fmsc-version=1700` reveals *many* frames from MicrosoftCXXNameMangler. So, it would seem that some caching is needed there, as well... Fingers crossed that specifying a triple is sufficient to work around this.
  5. [ImplicitNullCheck] Fix the bug when dependent instruction accesses memory It is possible that dependent instruction may access memory. In this case we must reject optimization because the memory change will be visible in null handler basic block. So we will execute an instruction which we must not execute if check fails. Reviewers: sanjoy, reames Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36392
  6. Fix broken pdb test. For some reason I didn't see this failure the first time. The output format changed slightly, so we just have to update the test for the new format.
  7. [clang-fuzzer] Resolve proto dependencies
  8. Fix -Wreorder-fields warning.
  9. [PDB] Fix an issue writing the publics stream. In the refactor to merge the publics and globals stream, a bug was introduced that wrote the wrong value for one of the fields of the PublicsStreamHeader. This caused debugging in WinDbg to break. We had no way of dumping any of these fields, so in addition to fixing the bug I've added dumping support for them along with a test that verifies the correct value is written.
  10. [PDB] Merge Global and Publics Builders. The publics stream and globals stream are very similar. They both contain a list of hash buckets that refer into a single shared stream, the symbol record stream. Because of the need for each builder to manage both an independent hash stream as well as a single shared record stream, making the two builders be independent entities is not the right design. This patch merges them into a single class, of which only a single instance is needed to create all 3 streams. PublicsStreamBuilder and GlobalsStreamBuilder are now merged into the single GSIStreamBuilder class, which writes all 3 streams at once. Note that this patch does not contain any functionality change. So we're still not yet writing any records to the globals stream. All we're doing is making it so that when we do start writing records to the globals, this refactor won't have to be part of that patch. Differential Revision: https://reviews.llvm.org/D36489
  11. [AST] Cache intermediate visibility/linkage results This is a follow-up to r310436 with actual functional changes. Please see that commit message for a description of why a cache is appearing here. Suggestions for less-bad ways of testing this are appreciated. :) This fixes PR29160.
  12. [AST] Move visibility computations into a class; NFC This is patch 1 in a 2 patch series that aims to fix PR29160. Its goal is to cache decl visibility/linkage for the duration of each visibility+linkage query. The simplest way I can see to do this is to put the visibility calculation code that needs to (transitively) access this cache into a class, which is what this patch does. Actual caching will come in patch 2. (Another way would be to keep the cache in ASTContext + manually invalidate it or something, but that felt way too subtle to me.) Caching visibility results across multiple queries seems a bit tricky, since the user can add visibility attributes ~whenever they want, and these attributes can apparently have far-reaching effects (e.g. class visibility extends to its members, ...). Because a cache that's dropped at the end of each top-level query seems to work nearly as well and doesn't require any eviction logic, I opted for that design.
Revision 310447 by ctopper:
[X86] Add the rest of the ADC and SBB instructions to isDefConvertible.

I don't know if this really affects anything. Just thought it was weird that we had all of the ADD/SUB/AND/OR/XOR instructions.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/X86/X86InstrInfo.cppllvm.src/lib/Target/X86/X86InstrInfo.cpp
Revision 310446 by ctopper:
[InstCombine] Use regular dyn_cast instead of a matcher for a simple case. NFC
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cppllvm.src/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Revision 310445 by George Burgess IV:
Attempt #2 to appease buildbots

"error: unable to create target: 'No available targets are compatible
with this triple.'"
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/test/CodeGenCXX/pr29160.cppclang.src/test/CodeGenCXX/pr29160.cpp
Revision 310444 by George Burgess IV:
Attempt to appease msc buildbot

It was timing out on this test, but for reasons unrelated to the
specific bug it was testing for. Randomly breaking in gdb with `clang
-target i686-windows -fmsc-version=1700` reveals *many* frames from
MicrosoftCXXNameMangler. So, it would seem that some caching is needed
there, as well...

Fingers crossed that specifying a triple is sufficient to work around
this.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/test/CodeGenCXX/pr29160.cppclang.src/test/CodeGenCXX/pr29160.cpp
Revision 310443 by skatkov:
[ImplicitNullCheck] Fix the bug when dependent instruction accesses memory

It is possible that dependent instruction may access memory.
In this case we must reject optimization because the memory change will
be visible in null handler basic block. So we will execute an instruction which
we must not execute if check fails.

Reviewers: sanjoy, reames
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36392
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/CodeGen/ImplicitNullChecks.cppllvm.src/lib/CodeGen/ImplicitNullChecks.cpp
The file was modified/llvm/trunk/test/CodeGen/X86/implicit-null-checks.mirllvm.src/test/CodeGen/X86/implicit-null-checks.mir
Revision 310442 by zturner:
Fix broken pdb test.

For some reason I didn't see this failure the first time.  The
output format changed slightly, so we just have to update the
test for the new format.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.testllvm.src/test/DebugInfo/PDB/pdbdump-headers.test
Revision 310441 by Vitaly Buka:
[clang-fuzzer] Resolve proto dependencies
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/tools/clang-fuzzer/proto-to-cxx/CMakeLists.txtclang.src/tools/clang-fuzzer/proto-to-cxx/CMakeLists.txt
Revision 310440 by zturner:
Fix -Wreorder-fields warning.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.hllvm.src/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
Revision 310439 by zturner:
[PDB] Fix an issue writing the publics stream.

In the refactor to merge the publics and globals stream, a bug
was introduced that wrote the wrong value for one of the fields
of the PublicsStreamHeader.  This caused debugging in WinDbg
to break.

We had no way of dumping any of these fields, so in addition to
fixing the bug I've added dumping support for them along with a
test that verifies the correct value is written.
Change TypePath in RepositoryPath in Workspace
The file was modified/lld/trunk/test/COFF/pdb-publics-import.testN/A
The file was modified/lld/trunk/test/COFF/pdb.testN/A
The file was modified/llvm/trunk/include/llvm/DebugInfo/PDB/Native/GlobalsStream.hllvm.src/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
The file was modified/llvm/trunk/include/llvm/DebugInfo/PDB/Native/PublicsStream.hllvm.src/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
The file was modified/llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
The file was modified/llvm/trunk/lib/DebugInfo/PDB/Native/PublicsStream.cppllvm.src/lib/DebugInfo/PDB/Native/PublicsStream.cpp
The file was modified/llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cppllvm.src/tools/llvm-pdbutil/DumpOutputStyle.cpp
Revision 310438 by zturner:
[PDB] Merge Global and Publics Builders.

The publics stream and globals stream are very similar. They both
contain a list of hash buckets that refer into a single shared stream,
the symbol record stream. Because of the need for each builder to manage
both an independent hash stream as well as a single shared record
stream, making the two builders be independent entities is not the right
design. This patch merges them into a single class, of which only a
single instance is needed to create all 3 streams.  PublicsStreamBuilder
and GlobalsStreamBuilder are now merged into the single GSIStreamBuilder
class, which writes all 3 streams at once.

Note that this patch does not contain any functionality change. So we're
still not yet writing any records to the globals stream. All we're doing
is making it so that when we do start writing records to the globals,
this refactor won't have to be part of that patch.

Differential Revision: https://reviews.llvm.org/D36489
Change TypePath in RepositoryPath in Workspace
The file was modified/lld/trunk/COFF/PDB.cppN/A
The file was modified/lld/trunk/test/COFF/pdb-diff.testN/A
The file was modified/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.hllvm.src/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
The file was added/llvm/trunk/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.hllvm.src/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
The file was removed/llvm/trunk/include/llvm/DebugInfo/PDB/Native/GlobalsStreamBuilder.hllvm.src/include/llvm/DebugInfo/PDB/Native/GlobalsStreamBuilder.h
The file was modified/llvm/trunk/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.hllvm.src/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
The file was removed/llvm/trunk/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.hllvm.src/include/llvm/DebugInfo/PDB/Native/PublicsStreamBuilder.h
The file was modified/llvm/trunk/lib/DebugInfo/PDB/CMakeLists.txtllvm.src/lib/DebugInfo/PDB/CMakeLists.txt
The file was modified/llvm/trunk/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
The file was added/llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
The file was removed/llvm/trunk/lib/DebugInfo/PDB/Native/GlobalsStreamBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/GlobalsStreamBuilder.cpp
The file was modified/llvm/trunk/lib/DebugInfo/PDB/Native/PDBFileBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
The file was removed/llvm/trunk/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cppllvm.src/lib/DebugInfo/PDB/Native/PublicsStreamBuilder.cpp
Revision 310437 by George Burgess IV:
[AST] Cache intermediate visibility/linkage results

This is a follow-up to r310436 with actual functional changes. Please
see that commit message for a description of why a cache is appearing
here.

Suggestions for less-bad ways of testing this are appreciated. :)

This fixes PR29160.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/AST/Decl.cppclang.src/lib/AST/Decl.cpp
The file was modified/cfe/trunk/lib/AST/Linkage.hclang.src/lib/AST/Linkage.h
The file was modified/cfe/trunk/lib/AST/Type.cppclang.src/lib/AST/Type.cpp
The file was added/cfe/trunk/test/CodeGenCXX/pr29160.cppclang.src/test/CodeGenCXX/pr29160.cpp
Revision 310436 by George Burgess IV:
[AST] Move visibility computations into a class; NFC

This is patch 1 in a 2 patch series that aims to fix PR29160. Its goal
is to cache decl visibility/linkage for the duration of each
visibility+linkage query.

The simplest way I can see to do this is to put the visibility
calculation code that needs to (transitively) access this cache into a
class, which is what this patch does. Actual caching will come in patch
2. (Another way would be to keep the cache in ASTContext + manually
invalidate it or something, but that felt way too subtle to me.)

Caching visibility results across multiple queries seems a bit tricky,
since the user can add visibility attributes ~whenever they want, and
these attributes can apparently have far-reaching effects (e.g. class
visibility extends to its members, ...). Because a cache that's dropped
at the end of each top-level query seems to work nearly as well and
doesn't require any eviction logic, I opted for that design.
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/AST/Decl.cppclang.src/lib/AST/Decl.cpp
The file was added/cfe/trunk/lib/AST/Linkage.hclang.src/lib/AST/Linkage.h
The file was modified/cfe/trunk/lib/AST/Type.cppclang.src/lib/AST/Type.cpp