SuccessChanges

Summary

  1. [lldb][NFC] Make CompilerDeclContext construction type safe (details)
  2. [lldb][NFC] Document CompilerDeclContext constructors (details)
  3. [NFC] Style cleanups (details)
  4. [lldb] Add a SubsystemRAII that takes care of calling Initialize and (details)
  5. [lldb][NFC] Simplify ClangASTContext::GetTranslationUnitDecl (details)
  6. [lldb/lua] Fix bindings.test for lua-5.1 (details)
  7. [lldb] Fix a -Wreturn-type gcc warning in ScriptInterpreter.cpp (details)
  8. [llvm-readobj][test] - Stop using Inputs/trivial.obj.elf-x86-64. (details)
  9. [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on (details)
  10. [ARM] [Windows] Use COFF stubs for calls to extern_weak functions (details)
  11. [AArch64] [Windows] Use COFF stubs for calls to extern_weak functions (details)
Commit 42ec584a8b4e604360b7a4d45a65c570d58b1bf9 by Raphael Isemann
[lldb][NFC] Make CompilerDeclContext construction type safe
The CompilerDeclContext constructor takes a void* pointer which means
that all callers of this constructor need to first explicitly convert
all pointers to clang::DeclContext*. This causes that we for example
can't just pass a TranslationUnitDecl* to the constructor without first
casting it to its parent class (as it inherits from both Decl and
DeclContext so the void* pointer is actually a Decl*).
This patch introduces a utility function in the ClangASTContext which
gets rid of the requirement to cast all pointers to clang::DeclContext.
Also moves all constructor calls to use this function instead which is
NFC (beside the change in DWARFASTParserClangTests.cpp).
The file was modifiedlldb/include/lldb/Symbol/ClangASTContext.h
The file was modifiedlldb/source/Symbol/ClangASTContext.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
The file was modifiedlldb/unittests/Symbol/TestClangASTContext.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
The file was modifiedlldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Commit 6df6edfd0a0b50195d56124b9e43bb7c29843b7f by Raphael Isemann
[lldb][NFC] Document CompilerDeclContext constructors
The file was modifiedlldb/include/lldb/Symbol/CompilerDeclContext.h
Commit 70fa4c4f88609044dd0cd9671139d02d578d0df9 by shengchen.kan
[NFC] Style cleanups
1. Remove duplicate function for class name at the beginning of the
comment. 2. Use auto where the type is already obvious from the context.
The file was modifiedllvm/include/llvm/MC/MCFragment.h
The file was modifiedllvm/lib/MC/MCFragment.cpp
The file was modifiedllvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
Commit 5dca0596a959217a1c18858a62ed35245a4c42b4 by Raphael Isemann
[lldb] Add a SubsystemRAII that takes care of calling Initialize and
Terminate in the unit tests
Summary: Many of our tests need to initialize certain subsystems/plugins
of LLDB such as
`FileSystem` or `HostInfo` by calling their static `Initialize`
functions before the test starts and then calling `::Terminate` after
the test is done (in reverse order). This adds a lot of error-prone
boilerplate code to our testing code.
This patch adds a RAII called SubsystemRAII that ensures that we always
call
::Initialize and then call ::Terminate after the test is done (and that
the Terminate calls are always in the reverse order of the ::Initialize
calls). It also gets rid of all of the boilerplate that we had for these
calls.
Per-fixture initialization is still not very nice with this approach as
it would require some kind of static unique_ptr that gets manually
assigned/reseted from the gtest SetUpTestCase/TearDownTestCase
functions. Because of that I changed all per-fixture setup to now do
per-test setup which can be done by just having the SubsystemRAII as a
member of the test fixture. This change doesn't influence our normal
test runtime as LIT anyway runs each test case separately
(and the Initialize/Terminate calls are anyway not very expensive). It
will however make running all tests in a single executable slightly
slower.
Reviewers: labath, JDevlieghere, martong, espindola, shafik
Reviewed By: labath
Subscribers: mgorny, rnkovacs, emaste, MaskRay, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71630
The file was modifiedlldb/unittests/Target/ModuleCacheTest.cpp
The file was modifiedlldb/unittests/Interpreter/TestCompletion.cpp
The file was modifiedlldb/unittests/Symbol/TestClangASTImporter.cpp
The file was addedlldb/unittests/Utility/SubsystemRAIITest.cpp
The file was modifiedlldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
The file was modifiedlldb/unittests/Editline/EditlineTest.cpp
The file was modifiedlldb/unittests/Utility/CMakeLists.txt
The file was modifiedlldb/unittests/Process/minidump/MinidumpParserTest.cpp
The file was modifiedlldb/unittests/Host/SocketAddressTest.cpp
The file was modifiedlldb/unittests/Expression/ClangExpressionDeclMapTest.cpp
The file was modifiedlldb/unittests/Expression/DWARFExpressionTest.cpp
The file was modifiedlldb/unittests/Expression/ClangParserTest.cpp
The file was modifiedlldb/unittests/ObjectFile/PECOFF/TestPECallFrameInfo.cpp
The file was modifiedlldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
The file was modifiedlldb/unittests/Host/ConnectionFileDescriptorTest.cpp
The file was modifiedlldb/unittests/Symbol/LocateSymbolFileTest.cpp
The file was modifiedlldb/unittests/Host/SocketTest.cpp
The file was modifiedlldb/unittests/Host/HostInfoTest.cpp
The file was modifiedlldb/unittests/Symbol/TestLineEntry.cpp
The file was modifiedlldb/unittests/Core/MangledTest.cpp
The file was modifiedlldb/unittests/Host/MainLoopTest.cpp
The file was addedlldb/unittests/TestingSupport/SubsystemRAII.h
The file was modifiedlldb/unittests/Expression/CppModuleConfigurationTest.cpp
The file was modifiedlldb/unittests/Symbol/TestClangASTContext.cpp
The file was modifiedlldb/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp
The file was modifiedlldb/unittests/Language/Highlighting/HighlighterTest.cpp
The file was modifiedlldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
Commit fecb122cca254f565050559b349c8ff309194554 by Raphael Isemann
[lldb][NFC] Simplify ClangASTContext::GetTranslationUnitDecl
These two functions are just calling their equivalent function in
ASTContext and implicitly convert the result to a DeclContext* (a parent
class of TranslationUnitDecl). This leads to the absurd situation that
we had to cast the result of GetTranslationUnitDecl to a
TranslationUnitDecl*. The only reason we did this implicit conversion to
the parent class was that the void* conversion for the
CompilerDeclContext constructor was sound (which otherwise would receive
a Decl* pointer when called with a TranslationUnitDecl*).
Now that the CompilerDeclContext constructor is type safe we can
properly implement these functions by actually returning the right type.
Also deletes the static inconvenience method that was not used anywhere.
The file was modifiedlldb/source/Symbol/ClangASTContext.cpp
The file was modifiedlldb/include/lldb/Symbol/ClangASTContext.h
Commit 12a3d97cf68389a025b8a75b8ea660b11401a3c8 by pavel
[lldb/lua] Fix bindings.test for lua-5.1
string.format("%s", true) only works since lua-5.2. Make the print
statement more portable.
The file was modifiedlldb/test/Shell/ScriptInterpreter/Lua/bindings.test
Commit fbccef6b2553a3e6a7183e259f5a911885d0ddea by pavel
[lldb] Fix a -Wreturn-type gcc warning in ScriptInterpreter.cpp
The file was modifiedlldb/source/Interpreter/ScriptInterpreter.cpp
Commit cc522bc4e3e5e3c46ef34c94c64980957880f738 by grimar
[llvm-readobj][test] - Stop using Inputs/trivial.obj.elf-x86-64.
This rewrites a few tests to stop using the trivial.obj.elf-x86-64
precompiled object and removes it.
Differential revision: https://reviews.llvm.org/D71662
The file was modifiedllvm/test/tools/llvm-readobj/ELF/Inputs/trivial.ll
The file was modifiedllvm/test/tools/llvm-readobj/ELF/gnu-file-headers.test
The file was modifiedllvm/test/tools/llvm-readobj/ELF/hex-dump.test
The file was modifiedllvm/test/tools/llvm-readobj/ELF/gnu-section-mapping-no-phdrs.test
The file was modifiedllvm/test/tools/llvm-readobj/ELF/thin-archive-paths.test
The file was removedllvm/test/tools/llvm-readobj/ELF/Inputs/trivial.obj.elf-x86-64
Commit 86c9831bb40d2c50c36b748b08a75860c4640875 by martin
[ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on
windows
Since 6bf108d77a3c, we try to not mark extern_weak symbols as dso_local,
to allow using COFF stubs for references to those symbols
(as the symbol may be missing, resolving to an absolute address zero,
outside of the current DSO).
Differential Revision: https://reviews.llvm.org/D71716
The file was modifiedclang/lib/CodeGen/ItaniumCXXABI.cpp
The file was addedclang/test/CodeGenCXX/mingw-thread-local.cpp
Commit b774aa1011a031b225624277178382bb2db7e26a by martin
[ARM] [Windows] Use COFF stubs for calls to extern_weak functions
As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).
Instead check the shouldAssumeDSOLocal method and load the address from
a COFF stub.
This matches what was done for X86 in 6bf108d77a3c.
Differential Revision: https://reviews.llvm.org/D71720
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
The file was modifiedllvm/test/CodeGen/ARM/tail-call-weak.ll
Commit 5a751e747dbf2c267e944aa961e21de7a815e7eb by martin
[AArch64] [Windows] Use COFF stubs for calls to extern_weak functions
As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).
Improve the classifyGlobalFunctionReference method to set
MO_DLLIMPORT/MO_COFFSTUB, and simplify the existing code in
AArch64TargetLowering::LowerCall to use the return value from
classifyGlobalFunctionReference for these cases.
Add code in both AArch64FastISel and GlobalISel/IRTranslator to bail out
for function calls to extern weak functions on windows, to let
SelectionDAG handle them.
This matches what was done for X86 in 6bf108d77a3c.
Differential Revision: https://reviews.llvm.org/D71721
The file was modifiedllvm/lib/Target/AArch64/AArch64FastISel.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call-weak.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
The file was addedllvm/test/CodeGen/AArch64/windows-extern-weak.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64Subtarget.cpp