Commit
7f6bc84a97f617f9cf148a96ce72567cfa6066f9
by yhs[BPF] Fix a bug for __builtin_preserve_field_info() processing
Andrii discovered a problem where a simple case similar to below will generate wrong relocation kind: enum { FIELD_EXISTENCE = 2, }; struct s1 { int a1; }; int test() { struct s1 *v = 0; return __builtin_preserve_field_info(v[0], FIELD_EXISTENCE); } The expected relocation kind should be FIELD_EXISTENCE, but recorded reloc kind in the final object file is FIELD_BYTE_OFFSET, which is incorrect.
This exposed a bug in generating access strings from intrinsics. The current access string generation has two steps: step 1: find the base struct/union type, step 2: traverse members in the base type.
The current implementation relies on at lease one member access in step 2 to get the correct relocation kind, which is true in typical cases. But if there is no member accesses, the current implementation falls to the default info kind FIELD_BYTE_OFFSET. This is incorrect, we should still record the reloc kind based on the user input. This patch fixed this issue by properly recording the reloc kind in such cases.
Differential Revision: https://reviews.llvm.org/D82932
|
 | llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp |
 | llvm/test/CodeGen/BPF/CORE/intrinsic-array-2.ll |
Commit
71c6a36018dd3e3a8f709d4a6f81a6d3ce56d780
by adam.balogh[AMDGPU][NFC] Remove redundant condition
Condition `LiteralCount` is checked both in an outer and in an inner `if` statement in `SIInstrInfo::verifyInstruction()`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82555
|
 | llvm/lib/Target/AMDGPU/SIInstrInfo.cpp |
Commit
ec5ba353fab79d2201f63485117682756da31d46
by adam.balogh[Hexagon][NFC] Remove redundant condition
Condition `secondReg` is checked both in an outer and in an inner `if` statement in static function `canCompareBeNewValueJump()` in file `HexagonNewValueJump.cpp`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82556
|
 | llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp |
Commit
1b2d2d70e1ec161878a78d880fb8972550b88185
by adam.balogh[LLDB][NFC] Remove redundant condition
Condition `auto_advance_pc` is checked both in an outer and in an inner `if` statement in `EmulateInstructionARM::EvaluateInstruction()`, `EmulateInstructionARM64::EvaluateInstruction()` and `EmulateInstructionPPC64::EvaluateInstruction()`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82558
|
 | lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp |
 | lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp |
 | lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp |
Commit
ff2d09148c91784c35b43c52f14b1501f38dd4c5
by adam.balogh[LLDB][Clang Integration][NFC] Remove redundant condition
Condition `omit_empty_base_classes` is checked both in an outer and in an inner `if` statement in `TypeSystemClang::GetNumBaseClasses()`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82559
|
 | lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp |
Commit
40c50bdee443dd48424ac7d724ced8874c40ee33
by adam.balogh[Sema][NFC] Remove Redundant Condition
Condition `TypeQuals` is checked both in an outer and in an inner `if` statement in static function `ConvertDeclSpecToType()` in file `SemaType.cpp`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82563
|
 | clang/lib/Sema/SemaType.cpp |
Commit
4da65c2920b68a1cf47054a7d655cc2a19a4aa28
by adam.balogh[clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop`
Function `hasPtrOrReferenceInfFunc()` of `bugprone-infinite-loop` is a generic function which could be reused in another checks. This patch moves this function into a newly created utility module.
Differential Revision: https://reviews.llvm.org/D81396
|
 | clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp |
 | clang-tools-extra/clang-tidy/utils/Aliasing.h |
 | clang-tools-extra/clang-tidy/utils/CMakeLists.txt |
 | clang-tools-extra/clang-tidy/utils/Aliasing.cpp |
Commit
ea563daae5232a03e08e43e68da813f76548f36a
by adam.balogh[Analyzer] Fix errors in iterator modeling
There is major a bug found in iterator modeling: upon adding a value to or subtracting a value from an iterator the position of the original iterator is also changed beside the result. This patch fixes this bug.
To catch such bugs in the future we also changed the tests to look for regular expressions including an end-of-line symbol (`$`) so we can prevent false matches where only the tested prefix matches.
Another minor bug is that when printing the state, all the iterator positions are printed in a single line. This patch also fixes this.
Differential Revision: https://reviews.llvm.org/D82385
|
 | clang/test/Analysis/iterator-modeling.cpp |
 | clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp |
Commit
9e63b190af76c798b06b1e3b75216abfdeb1bce3
by adam.balogh[Analyzer] Handle pointer implemented as iterators in iterator checkers
Iterators are an abstraction of pointers and in some data structures iterators may be implemented by pointers. This patch adds support for iterators implemented as pointers in all the iterator checkers (including iterator modeling).
Differential Revision: https://reviews.llvm.org/D82185
|
 | clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp |
 | clang/lib/StaticAnalyzer/Checkers/Iterator.cpp |
 | clang/test/Analysis/iterator-modeling.cpp |
 | clang/lib/StaticAnalyzer/Checkers/Iterator.h |
 | clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp |
 | clang/test/Analysis/invalidated-iterator.cpp |
 | clang/test/Analysis/iterator-range.cpp |
 | clang/lib/StaticAnalyzer/Checkers/InvalidatedIteratorChecker.cpp |
 | clang/lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp |
 | clang/test/Analysis/mismatched-iterator.cpp |
Commit
52e0582440c134fc8ac59e82fe05bb9baef96a66
by llvmgnsyncbot[gn build] Port 4da65c2920b
|
 | llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/utils/BUILD.gn |
Commit
f3b34466104877b024e168cac054bded6b9279a0
by 1.int32[clang][CrossTU] Invalidate parent map after get cross TU definition.
Summary: Parent map of ASTContext is built once. If this happens and later the TU is modified by getCrossTUDefinition the parent map does not contain the newly imported objects and has to be re-created.
Invalidation of the parent map is added to the CrossTranslationUnitContext. It could be added to ASTImporter as well but for now this task remains the responsibility of the user of ASTImporter. Reason for this is mostly that ASTImporter calls itself recursively.
Reviewers: gamesh411, martong
Reviewed By: gamesh411
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82568
|
 | clang/lib/CrossTU/CrossTranslationUnit.cpp |
 | clang/unittests/CrossTU/CrossTranslationUnitTest.cpp |
Commit
28de229bc63489b9346558f4f3a57b024b53962a
by gchatelet[Alignment][NFC] Migrate MachineFrameInfo::CreateStackObject to Align
This patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82894
|
 | llvm/include/llvm/CodeGen/MachineFrameInfo.h |
 | llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp |
 | llvm/lib/Target/Mips/MipsSEFrameLowering.cpp |
 | llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp |
 | llvm/lib/Target/RISCV/RISCVFrameLowering.cpp |
 | llvm/lib/Target/AMDGPU/SIFrameLowering.cpp |
 | llvm/lib/Target/X86/X86ISelLowering.cpp |
 | llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h |
 | llvm/lib/Target/PowerPC/PPCFastISel.cpp |
 | llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp |
 | llvm/lib/Target/X86/X86FastISel.cpp |
 | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp |
 | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp |
 | llvm/lib/Target/Mips/MipsMachineFunction.cpp |
 | llvm/lib/Target/ARC/ARCFrameLowering.cpp |
 | llvm/lib/Target/Sparc/SparcISelLowering.cpp |
 | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp |
 | llvm/lib/Target/ARM/ARMISelLowering.cpp |
 | llvm/lib/Target/PowerPC/PPCISelLowering.cpp |