- Oct 23, 2020
-
-
Duncan P. N. Exon Smith authored
-
Duncan P. N. Exon Smith authored
`SourceManager::getFileEntryRefForID`'s remaining callers just want the filename component, which is coming from the `FileInfo`. Replace the API with `getNonBuiltinFilenameForID`, which also removes another use of `FileEntryRef::FileEntryRef` outside of `FileManager`. Both callers are collecting file dependencies, and one of them relied on this API to filter out built-ins (as exposed by clang/test/ClangScanDeps/modules-full.cpp). It seems nice to continue providing that service. Differential Revision: https://reviews.llvm.org/D89508
-
Alexander Shaposhnikov authored
LD64 emits string tables which start with a space and a zero byte. This diff adjusts StringTableBuilder for linked Mach-O binaries to match LD64's behavior. Test plan: make check-all Differential revision: https://reviews.llvm.org/D89561
-
David Blaikie authored
*fingers crossed*
-
Arthur Eubanks authored
An alwaysinline function may not get inlined in inliner-wrapper due to the inlining order. Previously for the following, the inliner would first inline @a() into @b(), ``` define void @a() { entry: call void @b() ret void } define void @b() alwaysinline { entry: br label %for.cond for.cond: call void @a() br label %for.cond } ``` making @b() recursive and unable to be inlined into @a(), ending at ``` define void @a() { entry: call void @b() ret void } define void @b() alwaysinline { entry: br label %for.cond for.cond: call void @b() br label %for.cond } ``` Running always-inliner first makes sure that we respect alwaysinline in more cases. Fixes https://bugs.llvm.org/show_bug.cgi?id=46945. Reviewed By: davidxl, rnk Differential Revision: https://reviews.llvm.org/D86988 -
Duncan P. N. Exon Smith authored
`SourceManager::isMainFile` does not use the filename, so it doesn't need the full `FileEntryRef`; in fact, it's misleading to take the name because that makes it look relevant. Simplify the API, and in the process remove some calls to `FileEntryRef::FileEntryRef` in the unit tests (which were blocking making that private to `SourceManager`). Differential Revision: https://reviews.llvm.org/D89507
-
Duncan P. N. Exon Smith authored
Add helpers `getSLocEntryOrNull`, which handles the `Invalid` logic around `getSLocEntry`, and `getSLocEntryForFile`, which also checks for `SLocEntry::isFile`, and use them to reduce repeated code. Differential Revision: https://reviews.llvm.org/D89503
-
Shilei Tian authored
`size_t` has different width on 32- and 64-bit architecture, but the computation to floor to power of two assumed it is 64-bit, which can cause an integer overflow. In this patch, architecture detection is added so that the operation for 64-bit `size_t`. Thank Luke for reporting the issue. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D89878
-
Han Shen authored
This reverts commit adfb5415. This is reverted because it caused an chrome error: https://crbug.com/1140168
-
Richard Smith authored
FieldDecl is an unamed bitfield. Unnamed bitfields aren't non-static data member, so such a bitfield isn't actually the first non-static data member.
-
Nick Desaulniers authored
Forked from review of: https://reviews.llvm.org/D87956
-
Louis Dionne authored
In 5d796645, we stopped looking at the LIBCXXABI_LIBCXX_INCLUDES variable, which broke users of the Standalone build. This patch reinstates that variable, however it must point to the *installed* path of the libc++ headers, not the libc++ headers in the source tree (which has always been the case, but wasn't enforced before). If LIBCXXABI_LIBCXX_INCLUDES points to the libc++ headers in the source tree, the `__config_site` header will fail to be found.
-
Wei Mi authored
to their parent classes. SampleProfileReaderExtBinary/SampleProfileWriterExtBinary specify the typical section layout currently used by SampleFDO. Currently a lot of section reader/writer stay in the two classes. However, as we expect to have more types of SampleFDO profiles, we hope those new types of profiles can share the common sections while configuring their own sections easily with minimal change. That is why I move some common stuff from SampleProfileReaderExtBinary/SampleProfileWriterExtBinary to SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase so new profiles class inheriting from the base class can reuse them. Differential Revision: https://reviews.llvm.org/D89524
-
David Blaikie authored
-
Jessica Paquette authored
Move the code which adjusts the immediate/predicate on a G_ICMP to AArch64PostLegalizerLowering. This - Reduces the number of places we need to test for optimized compares in the selector. We know that the compare should have been simplified by the time it hits the selector, so we can avoid testing this in selects, brconds, etc. - Allows us to potentially fold more compares (previously, this optimization was only done after calling `tryFoldCompare`, this may allow us to hit some more TST cases) - Simplifies the selection code in `emitIntegerCompare` significantly; we can just use an emitSUBS function. - Allows us to avoid checking that the predicate has been updated after `emitIntegerCompare`. Also add a utility header file for things that may be useful in the selector and various combiners. No need for an implementation file at this point, since it's just one constexpr function for now. I've run into a couple cases where having one of these would be handy, so might as well add it here. There are a couple functions in the selector that can probably be factored out into here. Differential Revision: https://reviews.llvm.org/D89823
-
Fangrui Song authored
For a diagnostic `A refers to B` where B refers to a bitcode file, if the symbol gets optimized out, the user may see `A refers to <internal>`; if the symbol is retained, the user may see `A refers to lto.tmp`. Save the reference InputFile * in the DenseMap so that the original filename is available in reportBackrefs().
-
Nico Weber authored
-
Jessica Paquette authored
There are a lot of combines in AArch64PostLegalizerCombiner which exist to facilitate instruction matching in the selector. (E.g. matching for G_ZIP and other shuffle vector pseudos) It still makes sense to select these instructions at -O0. Matching earlier in a combiner can reduce complexity in the selector significantly. For example, a good portion of our selection code for compares would be a lot easier to represent in a combine. This patch moves matching combines into a "AArch64PostLegalizerLowering" combiner which runs at all optimization levels. Also, while we're here, improve the documentation for the AArch64PostLegalizerCombiner, and fix up the filepath in its file comment. And also add a 'r' which somehow got dropped from a bunch of function names. https://reviews.llvm.org/D89820
-
Yitzhak Mandelbaum authored
This functionality is commonly needed in clang tidy checks (based on transformer) that only print warnings, without suggesting any edits. The no-op edit allows the user to associate a diagnostic message with a source location. Differential Revision: https://reviews.llvm.org/D89961
-
Jan Korous authored
Follow-up to e7870223 Differential Revision: https://reviews.llvm.org/D86230
-
LemonBoy authored
Some early errors during the ASTUnit creation were not transferred to the `FailedParseDiagnostic` so when the code in `LoadFromCommandLine` swaps its content with the content of `StoredDiagnostics` they cannot be retrieved by the user in any way. Reviewed By: andrewrk, dblaikie Differential Revision: https://reviews.llvm.org/D78658
-
Louis Dionne authored
-
Alexander Shaposhnikov authored
Virtual sections do not contribute to the final output size. This diff fixes the corresponding calculations in the method MachOWriter::totalSize. Test plan: make check-all Differential revision: https://reviews.llvm.org/D89661
-
Kostya Kortchinsky authored
This is a redo of D89908, which triggered some `-Werror=conversion` errors with GCC due to assignments to the 31-bit variable. This CL adds to the original one a 31-bit mask variable that is used at every assignment to silence the warning. Differential Revision: https://reviews.llvm.org/D89984
-
Nikita Popov authored
Per asbirlea's comment, assert that only instructions, constants and arguments are passed to this API. Simplify returning true would not be correct for special Value subclasses like MemoryAccess.
-
Nikita Popov authored
Visited phi blocks only need to be added for the duration of the recursive alias queries, they should not leak into following code. Once again, while this also improves analysis precision, this is mainly intended to clarify the applicability scope of VisitedPhiBBs.
-
Xiangling Liao authored
1. Emit error for -G driver option on AIX 2. Adjust cmake file to use -Wl,-G instead of -G On AIX, legacy XL compiler uses -G to produce a shared object enabled for use with the run-time linker, which has different meanings from what it is used for in Clang. And in Clang, other targets do not have -G map to another functionality in their legacy compiler. So this error is more important when we are on AIX. Differential Revision: https://reviews.llvm.org/D89897
-
Nikita Popov authored
We only need the VisitedPhiBBs to disambiguate comparisons of values from two different loop iterations. If we're comparing two phis from the same basic block in lock-step, the compared values will always be on the same iteration. While this also increases precision, this is mainly intended to clarify the scope of VisitedPhiBBs.
-
Venkataramanan Kumar authored
Differential Revision: https://reviews.llvm.org/D88154
-
Nikita Popov authored
This reverts commit 9903b058. Causes build failures (on GCC 10.2) with the following error: In file included from /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/combined.h:29, from /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/allocator_config.h:12, from /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/wrappers_cpp.cpp:14: /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/../../gwp_asan/guarded_pool_allocator.h: In member function ‘bool gwp_asan::GuardedPoolAllocator::shouldSample()’: /home/nikic/llvm-project/compiler-rt/lib/scudo/standalone/../../gwp_asan/guarded_pool_allocator.h:82:69: error: conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘unsigned int:31’ may change value [-Werror=conversion] 82 | (getRandomUnsigned32() % (AdjustedSampleRatePlusOne - 1)) + 1; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
-
Nikita Popov authored
-
Kirill Bobyrev authored
Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D89852
-
Jan Korous authored
Differential Revision: https://reviews.llvm.org/D86230
-
Kirill Bobyrev authored
And also introduce Protobuf package versioning, it will help to deal with breaking changes. Inroducing package version itself is a breaking change, clients and servers need to be updated. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D89862
-
Vedant Kumar authored
Add a test to cover the case where an extracted block contains a lifetime marker for a pointer with an opaque type.
-
Vedant Kumar authored
This reverts commit 26ee8aff. It's necessary to insert bitcast the pointer operand of a lifetime marker if it has an opaque pointer type. rdar://70560161
-
Mehdi Amini authored
This reverts commit a8b0ae3b and commit f8fcff5a. The build with SHARED_LIBRARY=ON is broken.
-
Arthur Eubanks authored
Some clang tests use this. Reviewed By: akhuang Differential Revision: https://reviews.llvm.org/D89931
-
David Blaikie authored
Testing reveals that lldb and gdb have some problems with supporting DW_OP_convert - gdb with Split DWARF tries to resolve the CU-relative DIE offset relative to the skeleton DIE. lldb tries to treat the offset as absolute, which judging by the llvm-dsymutil support for DW_OP_convert, I guess works OK in MachO? (though probably llvm-dsymutil is producing invalid DWARF by resolving the relative reference to an absolute one?). Specifically this disables DW_OP_convert usage in DWARFv5 if: * Tuning for GDB and using Split DWARF * Tuning for LLDB and not targeting MachO
-