- Mar 03, 2022
-
-
Kristóf Umann authored
The problem with leak bug reports is that the most interesting event in the code is likely the one that did not happen -- lack of ownership change and lack of deallocation, which is often present within the same function that the analyzer inlined anyway, but not on the path of execution on which the bug occured. We struggle to understand that a function was responsible for freeing the memory, but failed. D105819 added a new visitor to improve memory leak bug reports. In addition to inspecting the ExplodedNodes of the bug pat, the visitor tries to guess whether the function was supposed to free memory, but failed to. Initially (in D108753), this was done by checking whether a CXXDeleteExpr is present in the function. If so, we assume that the function was at least party responsible, and prevent the analyzer from pruning bug report notes in it. This patch improves this heuristic by recognizing all deallocator functions that MallocChecker itself recognizes, by reusing MallocChecker::isFreeingCall. Differential Revision: https://reviews.llvm.org/D118880
-
Nikita Popov authored
To make this actually trigger, we also need to check whether the function types differ, which is a hidden cast under opaque pointers. The transform is somewhat less relevant there because it is primarily about pointer bitcasts, but it can also happen with other bit- or pointer-castable types. Byval handling is easier with opaque pointers because there is no need to adjust the byval type, we only need to make sure that it's still a pointer.
-
David Spickett authored
Somehow we ended up with catcH/throW.
-
Nikita Popov authored
The logic for handling this was fixed in 8d7f118a, but the check for byval on the callee was retained. This resulted in a weird situation where the transform would work depending on whether the byval was only on the call or on both the call and the function.
-
Nikita Popov authored
Same as the existing test, but the callee also has a byval attribute.
-
Cullen Rhodes authored
Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D118562
-
Cullen Rhodes authored
The compiler currently crashes for scalable types when compiling with +sme, e.g. define <vscale x 4 x i32> @foo(<vscale x 4 x i32> %a) { ret <vscale x 4 x i32> %a } since it doesn't know how to legalize the types. SME implies a subset of SVE (+streaming-sve), the hasSVE predication in the backend needs extending to consider types/operations that are legal in Streaming SVE. This is the first patch adding legal types <-> register classes. Before making the change +sve(2) was temporarily replaced with +sme in all the intrinsics tests to see what failed, and again after making the change. For all the tests that passed after adding the legal types another RUN line has been added for +streaming-sve. More patches to follow. Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D118561
-
Haojian Wu authored
Previously, we didin't build a DeclRefExpr which refers to an invalid declaration. In this patch, we handle this case by building an empty RecoveryExpr, which will preserve more broken code (AST parent nodes that contain the RecoveryExpr is preserved in the AST). Differential Revision: https://reviews.llvm.org/D120812
-
Nikita Popov authored
Pass through the load/store type to the Scatterer instead.
-
serge-sans-paille authored
This is a follow-up to 59630917
-
Jean Perier authored
This patches modifies PDT runtime type info generation so that it is easier to handle derived type descriptor in lowering. It changes three aspects: 1. The symbol name suffix of runtime type info for PDT instantiation is changed from a serial number unrelated to the types to an encoding of the instantiated KIND parameters. 2. New runtime type info is not created for each instantiation of PDT without KIND parameters (only length parameters). Instead, the runtime type info of the type definition is always used. It is updated to contain the component descriptions. 3. Runtime type info of PDT instantiation is now always generated in the scope where the type is defined. If several PDT type instantiation are made in different scope with the same kind parameters, they will use the same runtime type info. Rational of the change: In lowering, derived type descriptors are not mapped when instantiating derived type objects. They are mapped later when symbol knowledge is not available anymore. This mapping is based on the FIR representation of derived types. For PDT, the FIR type information does not allow deducing the instantiation scope, it only allows retrieving the type name, the type _definition_ scope, and the kind parameter values. Therefore, in order to be able to retrieve the derived type descriptor from a FIR type, the derived type descriptor must be generated in the definition scope and must reflect the kind parameters. This justifies the need for changes 1. and 3. above (suffix and scope change). Changes 2. comes from the fact that all runtime type info of type without kind parameters can be generated from the type definition, and that because of the suffix change, the symbol name for type definition and type instantiation are the same. Although this change is first motivated by how lowering handles derived types, I believe it is also an improvement from a functional point of view since this change will allow reducing the number of generated runtime type info for PDTs, since redundant information (different instantiations with same kind parameters) will only be generated once. Differential Revision: https://reviews.llvm.org/D120801
-
Jean Perier authored
The TARGET argument of ASSOCIATED may be dynamically optional, in which case ASSOCIATED(POINTER, TARGET) is equal to ASSOCIATED(TARGET). Make the runtime argument a pointer so that it can detect and handle arguments that are dynamically optional. Also fix the runtime to check if TARGET base address is not null and if its element size is not null to match the requirement of ASSOCIATED regarding TARGET: - if TARGET is an object: true iff [..] TARGET is not a zerosized storage sequence - if TARGET is a POINTER: true iff [..] POINTER and TARGET are associated Not that ASSOCIATED will also returns false if TARGET is an unallocated allocatable. This is not described in the standard, but is a unanimous behaviour of existing compilers. Differential Revision: https://reviews.llvm.org/D120835
-
Jean Perier authored
This change updates the mapping of derived types and type descriptor object names to support kind parametrized derived types (PDT). It moves the custom name mapping to the internal name utility. To improve robustness and error reporting, type descriptors are also now required to be generated in all compilation unit that manipulates derived types. The previous codegen relied on the fact that descriptors not defined in the current FIR module were available externally. Errors with missing type descriptors were only caught at link time. This patch makes derived type definition mandatory, except if the derived types are expected to not have derived type descriptors (builtin types), or if the newly added debug switch `--ignore-missing-type-desc` is set. In those cases, a null pointer is used as type descriptor pointer. The debug switch intends to help testing FIR to LLVM passes without having to bother providing type descriptor data structures that are normally built by the front-end. Differential Revision: https://reviews.llvm.org/D120804
-
Nikita Popov authored
With opaque pointers, generate the load/store type independently of the pointer type.
-
Nikita Popov authored
There is a general WalkerStepLimit adjustment higher up in the loop, and I don't see any reason why this particular case would need additional adjustment. Furthermore, this could underflow.
-
jacquesguan authored
This patch support the FP part of D109482. Differential Revision: https://reviews.llvm.org/D120235
-
Martin Storsjö authored
The old expected behaviour was specific to Apple platforms, while Glibc, Windows and FreeBSD collate differently (ignoring case). Make the old tested behaviour a special case for Apple platforms, and make the default case the one used by the other three. In clang-cl/DLL configurations, the test is hit by https://llvm.org/PR41018 (making the test fail to link). Differential Revision: https://reviews.llvm.org/D120797
-
Martin Storsjö authored
So far, we sort all discardable sections at the end, with only some extra logic to make sure that the .reloc section is at the start of that group of sections. But if there are other discardable sections, other than .reloc, they must also be ordered before .debug_* sections, to avoid leaving gaps if the executable is stripped. (Stripping executables doesn't remove all discardable sections, only the ones named .debug_*). Rust binaries seem to include a .rmeta section, which is marked discardable. This fixes stripping such binaries if built with dwarf debug info included. This fixes issues observed in MSYS2 in https://github.com/msys2/MINGW-packages/pull/10555. Differential Revision: https://reviews.llvm.org/D120805
-
Peixin-Qiao authored
The loopInfos gets invalidated after collapsing nested loops. Use the saved afterIP since the returned afterIP by applyDynamicWorkshareLoop may be not valid. Reviewed By: shraiysh Differential Revision: https://reviews.llvm.org/D120294
-
serge-sans-paille authored
Estimated impact on preprocessor output line: before: 1062981579 after: 1062494547 Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D120817
-
serge-sans-paille authored
This reverts commit eeaca53d. It's a duplicate of https://reviews.llvm.org/rG50874a188b94a25827963956887b878d3701509a
-
Jonas Devlieghere authored
Remove the reproducer bot and the fedora bot.
-
Jonas Devlieghere authored
Update TestBasicEntryValues.py for 15983c28 which changes the output for `image lookup -v`. This should fix the debian and macos build bots.
-
Danila Malyutin authored
Add detecton for lse, sve and sve2 on linux Differential Revision: https://reviews.llvm.org/D119435
-
Dominic Chen authored
Fix exceptions encountered while debugging gdb protocol Differential Revision: https://reviews.llvm.org/D120792
-
Kai Luo authored
-
David Blaikie authored
-
Jonas Devlieghere authored
The check for the prompt isn't essential for this test. The check fail on the lldb-arm-ubuntu because of what appears to be a missing space after the prompt. Rather than disabling the test, let's see if we can get it to pass without it.
-
David Blaikie authored
-
Peter Klausler authored
Add new IsCompatibleWith() member functions to many classes in evaluate::characteristics that apply more nuanced compatibility checking for function results, dummy arguments, and procedure interfaces than the previous tests for complete equivalence. Use IsCompatibleWith() in semantics for call checking. Differential Revision: https://reviews.llvm.org/D120844
-
Jonas Devlieghere authored
Update TestMemoryHistory.py for daba8236 which changes the CommandObject & Disassemble error messages .
-
Jonas Devlieghere authored
There are no implementations overriding these methods. Differential revision: https://reviews.llvm.org/D120766
-
Jonas Devlieghere authored
This patch fixes a data race in IOHandlerProcessSTDIO. The race is happens between the main thread and the event handling thread. The main thread is running the IOHandler (IOHandlerProcessSTDIO::Run()) when an event comes in that makes us pop the process IO handler which involves cancelling the IOHandler (IOHandlerProcessSTDIO::Cancel). The latter calls SetIsDone(true) which modifies m_is_done. At the same time, we have the main thread reading the variable through GetIsDone(). This patch avoids the race by using a mutex to synchronize the two threads. On the event thread, in IOHandlerProcessSTDIO ::Cancel method, we obtain the lock before changing the value of m_is_done. On the main thread, in IOHandlerProcessSTDIO::Run(), we obtain the lock before reading the value of m_is_done. Additionally, we delay calling SetIsDone until after the loop exists, to avoid a potential race between the two writes. Write of size 1 at 0x00010b66bb68 by thread T7 (mutexes: write M2862, write M718324145051843688): #0 lldb_private::IOHandler::SetIsDone(bool) IOHandler.h:90 (liblldb.15.0.0git.dylib:arm64+0x971d84) #1 IOHandlerProcessSTDIO::Cancel() Process.cpp:4382 (liblldb.15.0.0git.dylib:arm64+0x5ddfec) #2 lldb_private::Debugger::PopIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1156 (liblldb.15.0.0git.dylib:arm64+0x3cb2a8) #3 lldb_private::Debugger::RemoveIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1063 (liblldb.15.0.0git.dylib:arm64+0x3cbd2c) #4 lldb_private::Process::PopProcessIOHandler() Process.cpp:4487 (liblldb.15.0.0git.dylib:arm64+0x5c583c) #5 lldb_private::Debugger::HandleProcessEvent(std::__1::shared_ptr<lldb_private::Event> const&) Debugger.cpp:1549 (liblldb.15.0.0git.dylib:arm64+0x3ceabc) #6 lldb_private::Debugger::DefaultEventHandler() Debugger.cpp:1622 (liblldb.15.0.0git.dylib:arm64+0x3cf2c0) #7 std::__1::__function::__func<lldb_private::Debugger::StartEventHandlerThread()::$_2, std::__1::allocator<lldb_private::Debugger::StartEventHandlerThread()::$_2>, void* ()>::operator()() function.h:352 (liblldb.15.0.0git.dylib:arm64+0x3d1bd8) #8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) HostNativeThreadBase.cpp:62 (liblldb.15.0.0git.dylib:arm64+0x4c71ac) #9 lldb_private::HostThreadMacOSX::ThreadCreateTrampoline(void*) HostThreadMacOSX.mm:18 (liblldb.15.0.0git.dylib:arm64+0x29ef544) Previous read of size 1 at 0x00010b66bb68 by main thread: #0 lldb_private::IOHandler::GetIsDone() IOHandler.h:92 (liblldb.15.0.0git.dylib:arm64+0x971db8) #1 IOHandlerProcessSTDIO::Run() Process.cpp:4339 (liblldb.15.0.0git.dylib:arm64+0x5ddc7c) #2 lldb_private::Debugger::RunIOHandlers() Debugger.cpp:982 (liblldb.15.0.0git.dylib:arm64+0x3cb48c) #3 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) CommandInterpreter.cpp:3298 (liblldb.15.0.0git.dylib:arm64+0x506478) #4 lldb::SBDebugger::RunCommandInterpreter(bool, bool) SBDebugger.cpp:1166 (liblldb.15.0.0git.dylib:arm64+0x53604) #5 Driver::MainLoop() Driver.cpp:634 (lldb:arm64+0x100006294) #6 main Driver.cpp:853 (lldb:arm64+0x100007344) Differential revision: https://reviews.llvm.org/D120762
-
Stanislav Mekhanoshin authored
Handling of big endian was fixed in D88858.
-
Aakanksha authored
Differential Revision: https://reviews.llvm.org/D120846
-
Peter Klausler authored
Suffix() can be called from AllSources::IntersectionWithSourceFiles() when a contiguous range of source provenance overlaps a macro expansion. It skips over the macro expansion and recurses on the remainder of the range, which might end with a bit that does overlap with a source file. However, in the case where the original range is entirely within the expanded macro, Suffix() crashes when called with a skip offset greater than the size of the range. Rather than add logic around this and other calls to Suffix() to avoid passing an out-of-range skip, it's better to accommodate it in Suffix() and return an empty result. Differential Revision: https://reviews.llvm.org/D120843
-
Peter Klausler authored
And expand common::BitSet from 64 to 128 maximum elements. Differential Revision: https://reviews.llvm.org/D120848
-
- Mar 02, 2022
-
-
Stanislav Mekhanoshin authored
Image instructions are now not available for all targets anymore, so a generic target cannot use it.
-
Arthur O'Dwyer authored
This is just getting some non-functional cleanups out of the way prior to the meat of the change in D120417.
-
Zequan Wu authored
-