Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
933 commits
Select commit Hold shift + click to select a range
3fa632a
[X86] Updated shift-mask test targets for D61830
RKSimon May 11, 2019
605a840
[DAG] Add SimplifyDemandedBits support for BITREVERSE
RKSimon May 11, 2019
fda6bff
[X86][SSE] SimplifyDemandedBits - call PEXTRB/PEXTRW SimplifyDemanded…
RKSimon May 11, 2019
91ab86f
[utils] update_test_checks.py: allow opt-8, opt-9
MaskRay May 12, 2019
d3d6f4f
Fix handling of objects under construction during constant expression
zygoloid May 12, 2019
debad64
Reject attempts to call non-static member functions on objects outside
zygoloid May 12, 2019
ab8cde4
make -ftime-trace also print template arguments
llunak May 12, 2019
de7a30c
[clang-tidy] new check: bugprone-unhandled-self-assignment
tzolnai May 12, 2019
a09e686
[DAGCombiner] try to move bitcast after extract_subvector
rotateright May 12, 2019
2de6190
[LoopVectorizer] add tests for FP minmax; NFC
rotateright May 12, 2019
a7fc763
[X86][AVX] Split VZEXT_MOVL ymm/zmm if the upper elements are not dem…
RKSimon May 12, 2019
69aec05
Fix for P41852 where builtin attributes were being caught by FindLocs…
PiJoules May 12, 2019
3109836
[clang] Regenerate AST matcher docs 📖
stephanemoore May 12, 2019
27415e7
[ORC] Fix some typos.
lhames May 12, 2019
23085ec
[JITLink] Add a test for zero-filled content.
lhames May 12, 2019
4235a4e
Fix test to use -cc1.
PiJoules May 12, 2019
d1059e3
gn build: Merge r360540
nico May 12, 2019
a263aa2
[WebAssembly] Move InstPrinter files to MCTargetDesc. NFC
dlj-NaN May 13, 2019
3e6d690
gn build: merge r360550
dlj-NaN May 13, 2019
61e556d
Recommit r358887 "[TargetLowering][AMDGPU][X86] Improve SimplifyDeman…
topperc May 13, 2019
f9180b5
gn build: support host build on ppc64 (a.k.a. powerpc64le)
dlj-NaN May 13, 2019
b0e54cb
Fix file names in file headers. NFC
MaskRay May 13, 2019
4513929
[JITLink] Track section alignment and make sure it is respected durin…
lhames May 13, 2019
98fe9c9
[BPF] emit BTF sections only if debuginfo available
yonghong-song May 13, 2019
89b35d9
[CMake] Add lli to LLDB_TEST_DEPS
MaskRay May 13, 2019
f3be557
[WebAssembly] Add dependency on WebAssemblyDesc to fix BUILD_SHARED_L…
MaskRay May 13, 2019
5c5be6b
[c++20] P1064R0: Allow virtual function calls in constant expression
zygoloid May 13, 2019
dab287b
PR41854: Don't assert when constant-evaluating a member function call…
zygoloid May 13, 2019
c4e37fd
[DAGCombiner][NFC] Commit test to show fix in D61846.
legrosbuffle May 13, 2019
1effa6c
Remove declaratons of deleted structs/classes
MaskRay May 13, 2019
c7214f6
PR41845: Detect and reject mismatched inner/outer pack expansion sizes
zygoloid May 13, 2019
33fdaed
@skipIfLinux flaky lldb-mi tests
labath May 13, 2019
381ba9a
[DWARF] Use sequential integers for the IDs of the SymbolFileDWOs
labath May 13, 2019
9afc476
[DAGCombiner] Fix invalid alias analysis.
legrosbuffle May 13, 2019
a33e311
[ARM][ParallelDSP] Relax alias checks
sparker-arm May 13, 2019
0fab8b6
minidump: Use yaml instead of checked-in binaries for ThreadList tests
labath May 13, 2019
869f934
[NativePDB] Support member function types in PdbAstBuilder
May 13, 2019
8e42f6d
[SystemZ] Model floating-point control register
uweigand May 13, 2019
7e8be13
Fix flakiness in lldb lit test
weliveindetail May 13, 2019
3c72fe1
[ASTImporter] Separate unittest files
martong May 13, 2019
6dcef8f
[AArch64][SVE2] Add SVE2 target features to backend and TargetParser
c-rhodes May 13, 2019
1211baa
Breakpad: Generate unwind plans from STACK CFI records
labath May 13, 2019
2cabb4d
Simplify llvm-cat help
May 13, 2019
9cba2c9
Add REQUIRES: windows to NativePDB/stack_unwinding01.cpp
labath May 13, 2019
053c6fc
[ThinLTO] Don't internalize weak writeable variables
eleviant May 13, 2019
e47362c
FileCheck [5/12]: Introduce regular numeric variables
May 13, 2019
d845bc3
TargetLowering::SimplifyDemandedBits - early-out for UNDEF ops. NFCI.
RKSimon May 13, 2019
d5fb162
Revert r360559 "[c++20] P1064R0: Allow virtual function calls in cons…
zmodem May 13, 2019
5987749
Add constrained fptrunc and fpext intrinsics.
kpneal May 13, 2019
83e61bc
[x86] add test for insert/extract binop; NFC
rotateright May 13, 2019
b1e28d9
DWARF/DIERef: remove non-const operator<
labath May 13, 2019
f9e00db
[OPENMP][NVPTX]Simplify handling of thread limit, NFC.
alexey-bataev May 13, 2019
05dafb1
[DAGCombiner] narrow vector binop with inserts/extract
rotateright May 13, 2019
98c7c4f
Add a test for LWG#3204 and mark it as complete. Reviewed as https://…
mclow May 13, 2019
7f5318c
[NativePDB] Fix tests after r360569
May 13, 2019
d9aa928
[X86] Add SimplifyDemandedBits support for PEXTRB/PEXTRW (PR39709)
RKSimon May 13, 2019
e5248e6
Revert "[LSR] Tweak setup cost depth threshold to 10."
aemerson May 13, 2019
9423ba8
[libcxx] teach type_traits test about long uint32_t
androm3da May 13, 2019
c6a6c10
[X86] Add test case for mask register variant of PR41619 which should…
topperc May 13, 2019
d3cedee
[TargetLowering] Add SimplifyDemandedBits support for ZERO_EXTEND_VEC…
RKSimon May 13, 2019
4e21c77
[ELF] Full support for -n (--nmagic) and -N (--omagic) via common page
smithp35 May 13, 2019
cf5a8eb
[X86][SSE] Relax use limits for lowerAddSubToHorizontalOp (PR32433)
RKSimon May 13, 2019
7f63e8c
Fixed creation of aliases in Windows build.
AndreyChurbanov May 13, 2019
73aee29
[X86][SSE] LowerBuildVectorv4x32 - don't insert MOVQ for undef elts
RKSimon May 13, 2019
eadbde3
gn build: Merge r360572
nico May 13, 2019
0b13ca2
[WebAssembly] Refactor relocation processing. NFC.
sbc100 May 13, 2019
9acaceb
[DataFormatters] FindLibCppStdFunctionCallableInfo() currently uses F…
shafik May 13, 2019
69a3f9e
gn build: Fewer dependencies in llvm/lib/Target
nico May 13, 2019
cb8957f
[InstCombine] add tests for rotates with narrow shift amount (PR20750…
rotateright May 13, 2019
1aaf2a3
fixed typo made by commit r360595
AndreyChurbanov May 13, 2019
b38e4b2
Stop defining negative versions of some lit feature keywords:
pogo59 May 13, 2019
c33f754
[TargetLowering] Handle multi depth GEPs w/ inline asm constraints
nickdesaulniers May 13, 2019
760f61a
[InstCombine] try harder to form rotate (funnel shift) (PR20750)
rotateright May 13, 2019
91a9d4e
Revert [X86] Avoid SFB - Fix inconsistent codegen with/without debug …
May 13, 2019
1652d81
[clang][ASTContext] Call setAttached for comments attached to a decla…
jkorous-apple May 13, 2019
2108863
[AMDGPU] Remove now unused V2FP16_ONE constant def. NFC.
rampitec May 13, 2019
79b2828
[AMDGPU] Reorder includes per coding standard. NFC.
rampitec May 13, 2019
7981a28
Add a new LIBUNWIND_WEAK_PTHREAD Cmake option to force
Sterling-Augustine May 13, 2019
6c86f7d
Remove commented-out code
JDevlieghere May 13, 2019
ae54fc9
Merge target and launch info environments
JDevlieghere May 13, 2019
5f9afe9
[clang-tidy] readability-redundant-declaration: fix false positive wi…
mgehre May 13, 2019
ce78105
Make more friendly with unions. Reviewed as https://reviews.llvm.org…
mclow May 13, 2019
d9930d4
[AMDGPU] gfx1010 tests. NFC.
rampitec May 13, 2019
323dc63
[WebAssembly] Don't assume that zext/sext result is i32/i64 in fast i…
nikic May 13, 2019
3cce237
[Support] Ensure redirected outputs don't contain output from previou…
dlj-NaN May 13, 2019
56baade
[JITLink][MachO] Honor the no-dead-strip flag on nlist entries.
lhames May 13, 2019
5f999c2
[X86] Various type corrections to the code that creates LOCK_OR32mi8/…
topperc May 13, 2019
1d66231
[Pass Pipeline][NFC] Add a test prior to committing D61726
nemanjai May 13, 2019
aeeeb37
[CMake] Simplify lldb-server handling
JDevlieghere May 13, 2019
2ce598a
Introduce the ability to dump the AST to JSON.
AaronBallman May 13, 2019
ec42fc1
[AMDGPU] gfx1010 SearchableTableEmitter patch for NSA
rampitec May 13, 2019
b40284d
Disable TestEnvironment on Windows
JDevlieghere May 13, 2019
44a7abe
Make language option `GNUAsm` discoverable with `__has_extension` macro.
vsapsai May 13, 2019
9469571
[OpenMP][Clang][BugFix] Split declares and math functions inclusion.
doru1004 May 13, 2019
e296647
[X86] Use ISD::MERGE_VALUES to return from lowerAtomicArith instead o…
topperc May 13, 2019
3fdd2b1
Removing an unused member variable; NFC.
AaronBallman May 13, 2019
5f245bf
[gn] Fix build
vitalybuka May 13, 2019
51e79f0
[X86] Make `x86intrin.h`, `immintrin.h` includable with `-fno-gnu-inl…
vsapsai May 13, 2019
1d8b2a0
[CMake] Reinstate LLDB_CAN_USE_LLDB_SERVER
JDevlieghere May 13, 2019
42d65c5
[Docs] Fix code formattign in variable.rst
JDevlieghere May 13, 2019
91792f1
[AMDGPU] gfx1010 clang target
rampitec May 13, 2019
921f132
[c++20] P1064R0: Allow virtual function calls in constant expression
zygoloid May 13, 2019
d64455c
[coroutines] Fix spills of static array allocas
GorNishanov May 13, 2019
3bde7bf
PR41817: Fix regression in r359260 that caused the MS compatibility
zygoloid May 14, 2019
a2ad769
[Docs] Differentiate between public and private API
JDevlieghere May 14, 2019
3a13d97
[SDAG, x86] allow targets to override test for binop opcodes
rotateright May 14, 2019
99d6420
[SDAG] fix unused variable warning and unneeded indirection; NFC
rotateright May 14, 2019
39084ce
LLDB website: Change the title back to "The LLDB Debugger"
adrian-prantl May 14, 2019
cc761e6
[X86] Use X86 instead of X32 as a check prefix in atomic-idempotent.l…
topperc May 14, 2019
b7b3d86
[PowerPC][NFC] Fix typos in triples
May 14, 2019
500a6db
gn build: add Lanai target
dlj-NaN May 14, 2019
4fb6fca
gn build: add Sparc target
dlj-NaN May 14, 2019
6c780b6
ARMDefines.h: fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=…
MaskRay May 14, 2019
fe1aec0
gn build: add Hexagon target
dlj-NaN May 14, 2019
e1cb2c0
[Object] Change ObjectFile::getSectionContents to return Expected<Arr…
MaskRay May 14, 2019
3098e44
[X86] Prefer locked stack op over mfence for seq_cst 64-bit stores on…
preames May 14, 2019
c5c9ca0
Add guidelines/recommendations for organizers of LLVM Socials
AlexDenisov May 14, 2019
56f9afa
[CMake] Correctly reinstate LLDB_CAN_USE_LLDB_SERVER
labath May 14, 2019
0043936
Revert "FileCheck [5/12]: Introduce regular numeric variables"
May 14, 2019
efe8e7e
typedef enum -> enum
MaskRay May 14, 2019
b1f213c
TestMinidumpNew.py: Use yaml2obj where possible
labath May 14, 2019
a568222
[IRTranslator] Don't hardcode GEP index type
rovka May 14, 2019
b0dbc96
Revert r360637 "PR41817: Fix regression in r359260 that caused the MS…
zmodem May 14, 2019
1584213
[MemorySanitizer] getMMXVectorTy - assert valid element size. NFCI.
RKSimon May 14, 2019
ce0da8b
[test]Make test work on Windows
jh7370 May 14, 2019
9df3883
[llvm-objcopy] Cache gnu_debuglink's target CRC
jh7370 May 14, 2019
ed9117f
GlobalOpt: do not promote globals used atomically to constants.
TNorthover May 14, 2019
ff6875a
AArch64: support binutils-like things on arm64_32.
TNorthover May 14, 2019
2747ee2
[X86] X86TargetLowering::LowerINTRINSIC_WO_CHAIN - ensure rounding co…
RKSimon May 14, 2019
7b4ecdd
Reinstate "FileCheck [5/12]: Introduce regular numeric variables"
May 14, 2019
2dd5283
Move SymbolTable::addFile to InputFiles.cpp.
rui314 May 14, 2019
d06f391
Add a new language mode for C2x; enable [[attribute]] support by defa…
AaronBallman May 14, 2019
2e9591c
Make getObjCEncodingForTypeImpl() take a bitmask instead of 8 bools
nico May 14, 2019
62f5b59
DWARF/NFC: Centralize DIERef conversions
labath May 14, 2019
717b62a
TableGen: support #ifndef in addition to #ifdef.
TNorthover May 14, 2019
37b7922
Save the induction binary operator in IVDescriptors for non FP induct…
kitbarton May 14, 2019
fe4f6d5
[lit][tests]Add feature libcxx-used and use it in llvm-*-fuzzer tests
xingxue-ibm May 14, 2019
87ae6bf
[libc++] [test] Use std::nextafter() instead of std::nexttoward()
mgorny May 14, 2019
7a9ccf8
[Driver][Windows] Add dependent lib argument for profile instr generate
rgal May 14, 2019
9fd3be2
[APFloat] APFloat::Storage::Storage - fix use after move
RKSimon May 14, 2019
9e88a26
[llvm-readobj] - Apply clang format. NFC.
May 14, 2019
2256197
[PowerPC] Custom lower known CR bit spills
lei137 May 14, 2019
2f6ef2f
DWARF v5: emit DW_AT_addr_base if DW_AT_low_pc references .debug_addr
MaskRay May 14, 2019
ed4dbe6
[ELF] --gdb-index: fix SIGSEGV when a DWARFAddressRange has invalid S…
MaskRay May 14, 2019
ac2f5a6
Replace lit feature keyword 'not_COFF' with 'uses_COFF'.
pogo59 May 14, 2019
728ffd0
[Sema] CodeSynthesisContext - add missing variable initialization to …
RKSimon May 14, 2019
e029da4
[AArch64][SVE2] Asm: add integer multiply-add/subtract (indexed) inst…
c-rhodes May 14, 2019
3b91701
[AArch64][SVE2] Asm: add SQRDMLAH/SQRDMLSH instructions
c-rhodes May 14, 2019
c2d9cfd
[X86] Disable shouldFoldConstantShiftPairToMask for scalar shifts on …
RKSimon May 14, 2019
e041d15
[LLD][ELF] Add the -z ifunc-noplt option
MaskRay May 14, 2019
7b20032
[AMDGPU] gfx1010 Strengthen some SMEM WAR hazard unit tests. NFC.
rampitec May 14, 2019
7955e38
[ARM][CMSE] Add cmse intrinsics for TT instructions
javedabsar May 14, 2019
33cb8f5
[AMDGPU] Fixed +DumpCode
May 14, 2019
05791d9
[AMDGPU] Fixed handling of imemdiate i1 literals
rampitec May 14, 2019
bbe4ff1
[Test] Autogen a test for ease of later changing
preames May 14, 2019
19ae9d0
Rename MacOS X -> macOS where applicable.
adrian-prantl May 14, 2019
7c5c0c9
Support FNeg in SpeculativeExecution pass
mcinally May 14, 2019
1362905
lldb-server: rename `llgs::terminate` (NFC)
compnerd May 14, 2019
bd8d309
[IndVars] Extend reasoning about loop invariant exits to non-header b…
preames May 14, 2019
1acec2b
build: use the correct variable
compnerd May 14, 2019
75ad8c5
Fix a release mode warning introduced in r360694
preames May 14, 2019
80c6e79
[MemorySSA] LoopSimplify preserves MemorySSA only when flag is flipped.
alinas May 14, 2019
094584c
[clang-tidy] Fix invalid fixit for readability-static-accessed-throug…
mgehre May 14, 2019
0333dd9
Restore test files accidentally deleted in r354839
rnk May 14, 2019
48c4e4f
[LVI][CVP] Add support for abs/nabs select pattern flavor
nikic May 14, 2019
2423b7d
Update ASTMerge FileCheck test expectations
rnk May 14, 2019
ee51d85
[AMDGPU][GFX8][GFX9] Corrected predicate of v_*_co_u32 aliases
dpreobra May 14, 2019
030b17d
Temporarily revert "Change -gz and -Wa,--compress-debug-sections to u…
echristo May 14, 2019
53c9d58
[LICM] Allow AliasSetMap to contain top-level loops.
fhahn May 14, 2019
dc2f5f9
Fix ASTMerge/namespace/test.cpp after r360701
rnk May 14, 2019
7baf528
[NFC][CodeGen][X86][AArch64] Add and-const-mask + const-shift pattern…
LebedevRI May 14, 2019
0cdd3b1
[NewPM] Port HWASan and Kernel HWASan
PiJoules May 14, 2019
9b234b3
[Polly] Don't crash on invalid delinearization result.
efriedma-quic May 14, 2019
b26592e
[AArch64] Create a TargetInfo header. NFC
Weverything May 14, 2019
c9dd299
[GWP-ASan] Initial build files, implementation of PRNG [1].
hctim May 14, 2019
025df3b
[OpenMP][AArch64] Fix compile with LLVM trunk.
efriedma-quic May 14, 2019
27d22b6
[libFuzzer] reimplement DFT's collect_data_flow inside libFuzzer so t…
kcc May 14, 2019
8ce2ee9
[AMDGPU] Create a TargetInfo header. NFC
Weverything May 14, 2019
1e8104d
[libFuzzer] #include <string_view>, hopefully should fix the windows …
kcc May 14, 2019
7f9a008
[ARC] Create a TargetInfo header. NFC
Weverything May 14, 2019
2e2dfe2
[libFuzzer] replace string_view with string to fix the bots. This is …
kcc May 14, 2019
f3011b9
[ARM] Create a TargetInfo header. NFC
Weverything May 14, 2019
445f942
Use an offset from TOS for idempotent rmw locked op lowering
preames May 14, 2019
048a97b
Fix bots by adding target triple to test.
PiJoules May 14, 2019
e982b42
[AVR] Create a TargetInfo header. NFC
Weverything May 14, 2019
a68ee93
[BPF] Create a TargetInfo header. NFC
Weverything May 14, 2019
a0de66d
[polly] Fix non-determinism in IslNodeBuilder.
efriedma-quic May 14, 2019
7ef1729
[Hexagon] Create a TargetInfo header. NFC
Weverything May 14, 2019
092f85a
[lit/Register] Fix matching of the output.
dcci May 14, 2019
2e50dc7
[Lanai] Create a TargetInfo header. NFC
Weverything May 14, 2019
313b781
[Mips] Create a TargetInfo header. NFC
Weverything May 14, 2019
a57ce32
[MSP430] Create a TargetInfo header. NFC
Weverything May 14, 2019
e8f83be
[NVPTX] Create a TargetInfo header. NFC
Weverything May 14, 2019
7d7b788
Make SBDebugger.RunCommandInterpreter callable from Python.
jimingham May 15, 2019
ee6ced1
[PowerPC] Create a TargetInfo header. NFC
Weverything May 15, 2019
51fc56d
[RISCV] Create a TargetInfo header. NFC
Weverything May 15, 2019
cf82d4a
[Sparc] Create a TargetInfo header. NFC
Weverything May 15, 2019
1e6f98b
[SystemZ] Create a TargetInfo header. NFC
Weverything May 15, 2019
c6c4213
[WebAssembly] Create a TargetInfo header. NFC
Weverything May 15, 2019
0116385
[X86] Create a TargetInfo header. NFC
Weverything May 15, 2019
70b654f
[analyzer] MIGChecker: Add support for os_ref_retain().
haoNoQ May 15, 2019
5f7d4ab
[XCore] Create a TargetInfo header. NFC
Weverything May 15, 2019
e41ae14
[analyzer] MIGChecker: Fix redundant semicolon.
haoNoQ May 15, 2019
658cad1
[NFC] Reuse a helper function to eliminate duplicate code
preames May 15, 2019
bd3adfe
[Target] Generalize some behavior in Thread
bulbazord May 15, 2019
f4dfd63
[IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field …
MaskRay May 15, 2019
5296e28
Fix 2-field llvm.global_ctors `REQUIRES: asserts` tests after rL360742
MaskRay May 15, 2019
3bdbd97
[lldb] [lit] Fix whitespace in matches for remaining AVX512 tests
mgorny May 15, 2019
a23cc72
Revert "build: use the correct variable"
compnerd May 15, 2019
384d46c
[X86] Use OR32mi8Locked instead of LOCK_OR32mi8 in emitLockedStackOp.
topperc May 15, 2019
c31a45e
[Docs] Document lldb-dotest
JDevlieghere May 15, 2019
c187409
Mark private unimplemented functions as deleted
JDevlieghere May 15, 2019
4c1d6ee
Replace assert with static_assert here applicable.
JDevlieghere May 15, 2019
041f40e
DWARF: s/CompileUnit/Unit/ in DWARFFormValue
labath May 15, 2019
d9d0665
[[DAGCombiner][NFC] Add a comment.
legrosbuffle May 15, 2019
a5588c4
[CMake] Add error to clarify that lldb requires libcxx
weliveindetail May 15, 2019
de1becf
Group forward declarations in one namespace lldb_private {}
MaskRay May 15, 2019
9e778e6
[LV] Move getScalarizationOverhead and vector call cost computations …
fhahn May 15, 2019
da08fae
[NFC][InstCombine] Regenerate trunc.ll test
LebedevRI May 15, 2019
5ac6d49
[ASTImporter] Use llvm::Expected and Error in the importer API
martong May 15, 2019
9de9b5e
[lldb] [lit] Pass --mode=compile to fix compiler-full-path.test
mgorny May 15, 2019
71a4422
Delete unnecessary copy ctors/copy assignment operators
MaskRay May 15, 2019
3588a74
arm64_32: add some unittests that were in the wrong commit.
TNorthover May 15, 2019
0a5efc2
gn build: Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.p…
nico May 15, 2019
4c68c5a
[mips] LLVM and GAS now use same instructions for CFA Definition. NFCI
atanasyan May 15, 2019
dbc01b4
gn build: Merge r360671
nico May 15, 2019
9c7188a
[lldb] [test] Mark frequently failing flaky tests skipped on NetBSD
mgorny May 15, 2019
d2d0f46
[ARM] Cortex-M4 schedule
davemgreen May 15, 2019
0582b22
[ARM] Don't use the Machine Scheduler for cortex-m at minsize
davemgreen May 15, 2019
2dd6a0c
Revert rL360675 : [APFloat] APFloat::Storage::Storage - fix use after…
RKSimon May 15, 2019
157ae63
[MergeICmps] Simplify the code.
legrosbuffle May 15, 2019
17dd4d7
[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_…
SLTozer May 15, 2019
0d02f2f
Revert "[Salvage] Change salvage debug info implementation to use DW_…
SLTozer May 15, 2019
22405f3
Introduce new OpenMP 5.0 depend object type.
AndreyChurbanov May 15, 2019
0d071be
[MergeICmps] Fix r360771.
legrosbuffle May 15, 2019
eaf4413
Revert r360771 "[MergeICmps] Simplify the code."
legrosbuffle May 15, 2019
0c82d9b
Teach InstSimplify -X + X --> 0.0 about unary FNeg
mcinally May 15, 2019
29257eb
[AMDGPU] Increases available SGPR for Calling Convention
May 15, 2019
7f7dd09
[clang-tidy] new check: bugprone-branch-clone
May 15, 2019
7dfd087
[JumpThreading] A bug fix for stale loop info after unfold select
hjyamauchi May 15, 2019
5c15dba
[FileCheck] Fix sphinx error: Make input be gas block
May 15, 2019
697f214
[WebAssembly] LTO: Honor comdat groups when loading bitcode files
sbc100 May 15, 2019
ad08ea2
Test commit
kpet May 15, 2019
6ebb785
Fixed https://bugs.llvm.org/show_bug.cgi?id=41584.
AndreyChurbanov May 15, 2019
42d28be
[clang-tidy] modernize-loop-convert: impl const cast iter
donhinton May 15, 2019
664ceed
RegAlloc: try to fail more gracefully when out of registers
nhaehnle May 15, 2019
4ecb581
Revert [clang-tidy] modernize-loop-convert: impl const cast iter
donhinton May 15, 2019
4c50e64
[clang-tidy] Recommit r360785 "modernize-loop-convert: impl const cas…
donhinton May 15, 2019
f672b61
[MachineOperand] Add a ChangeToGA method
nhaehnle May 15, 2019
1db4a5d
Merge branch 'master' into intel
MrSidims May 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 8 additions & 1 deletion clang-tools-extra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(CMakeDependentOption)

add_subdirectory(clang-apply-replacements)
add_subdirectory(clang-reorder-fields)
add_subdirectory(modularize)
Expand All @@ -9,7 +11,6 @@ add_subdirectory(clang-doc)
add_subdirectory(clang-include-fixer)
add_subdirectory(clang-move)
add_subdirectory(clang-query)
add_subdirectory(clangd)
add_subdirectory(pp-trace)
add_subdirectory(tool-template)

Expand All @@ -25,3 +26,9 @@ if( CLANG_TOOLS_EXTRA_INCLUDE_DOCS )
add_subdirectory(docs)
endif()

# clangd has its own CMake tree. It requires threads.
CMAKE_DEPENDENT_OPTION(CLANG_ENABLE_CLANGD "Build clangd language server" ON
"LLVM_ENABLE_THREADS" OFF)
if (CLANG_ENABLE_CLANGD)
add_subdirectory(clangd)
endif()
29 changes: 19 additions & 10 deletions clang-tools-extra/clang-tidy/add_new_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def adapt_cmake(module_path, check_name_camel):


# Adds a header for the new check.
def write_header(module_path, module, check_name, check_name_camel):
def write_header(module_path, module, namespace, check_name, check_name_camel):
check_name_dashes = module + '-' + check_name
filename = os.path.join(module_path, check_name_camel) + '.h'
print('Creating %s...' % filename)
Expand All @@ -73,7 +73,7 @@ def write_header(module_path, module, check_name, check_name_camel):

namespace clang {
namespace tidy {
namespace %(module)s {
namespace %(namespace)s {

/// FIXME: Write a short description.
///
Expand All @@ -87,19 +87,20 @@ class %(check_name)s : public ClangTidyCheck {
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};

} // namespace %(module)s
} // namespace %(namespace)s
} // namespace tidy
} // namespace clang

#endif // %(header_guard)s
""" % {'header_guard': header_guard,
'check_name': check_name_camel,
'check_name_dashes': check_name_dashes,
'module': module})
'module': module,
'namespace': namespace})


# Adds the implementation of the new check.
def write_implementation(module_path, module, check_name_camel):
def write_implementation(module_path, module, namespace, check_name_camel):
filename = os.path.join(module_path, check_name_camel) + '.cpp'
print('Creating %s...' % filename)
with open(filename, 'w') as f:
Expand All @@ -124,7 +125,7 @@ def write_implementation(module_path, module, check_name_camel):

namespace clang {
namespace tidy {
namespace %(module)s {
namespace %(namespace)s {

void %(check_name)s::registerMatchers(MatchFinder *Finder) {
// FIXME: Add matchers.
Expand All @@ -142,11 +143,12 @@ def write_implementation(module_path, module, check_name_camel):
<< FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");
}

} // namespace %(module)s
} // namespace %(namespace)s
} // namespace tidy
} // namespace clang
""" % {'check_name': check_name_camel,
'module': module})
'module': module,
'namespace': namespace})


# Modifies the module to include the new check.
Expand Down Expand Up @@ -375,8 +377,15 @@ def main():

if not adapt_cmake(module_path, check_name_camel):
return
write_header(module_path, module, check_name, check_name_camel)
write_implementation(module_path, module, check_name_camel)

# Map module names to namespace names that don't conflict with widely used top-level namespaces.
if module == 'llvm':
namespace = module + '_check'
else:
namespace = module

write_header(module_path, module, namespace, check_name, check_name_camel)
write_implementation(module_path, module, namespace, check_name_camel)
adapt_module(module_path, module, check_name, check_name_camel)
add_release_notes(module_path, module, check_name)
test_extension = language_to_extension.get(args.language)
Expand Down
226 changes: 226 additions & 0 deletions clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
//===--- BranchCloneCheck.cpp - clang-tidy --------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "BranchCloneCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Analysis/CloneDetection.h"
#include "llvm/Support/Casting.h"

using namespace clang;
using namespace clang::ast_matchers;

/// Returns true when the statements are Type I clones of each other.
static bool areStatementsIdentical(const Stmt *LHS, const Stmt *RHS,
const ASTContext &Context) {
llvm::FoldingSetNodeID DataLHS, DataRHS;
LHS->Profile(DataLHS, Context, false);
RHS->Profile(DataRHS, Context, false);
return (DataLHS == DataRHS);
}

namespace {
/// A branch in a switch may consist of several statements; while a branch in
/// an if/else if/else chain is one statement (which may be a CompoundStmt).
using SwitchBranch = llvm::SmallVector<const Stmt *, 2>;
} // anonymous namespace

/// Determines if the bodies of two branches in a switch statements are Type I
/// clones of each other. This function only examines the body of the branch
/// and ignores the `case X:` or `default:` at the start of the branch.
static bool areSwitchBranchesIdentical(const SwitchBranch LHS,
const SwitchBranch RHS,
const ASTContext &Context) {
if (LHS.size() != RHS.size())
return false;

for (size_t i = 0, Size = LHS.size(); i < Size; i++) {
// NOTE: We strip goto labels and annotations in addition to stripping
// the `case X:` or `default:` labels, but it is very unlikely that this
// would casue false positives in real-world code.
if (!areStatementsIdentical(LHS[i]->stripLabelLikeStatements(),
RHS[i]->stripLabelLikeStatements(), Context)) {
return false;
}
}

return true;
}

namespace clang {
namespace tidy {
namespace bugprone {

void BranchCloneCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
ifStmt(stmt().bind("if"),
hasParent(stmt(unless(ifStmt(hasElse(equalsBoundNode("if")))))),
hasElse(stmt().bind("else"))),
this);
Finder->addMatcher(switchStmt().bind("switch"), this);
Finder->addMatcher(conditionalOperator().bind("condOp"), this);
}

void BranchCloneCheck::check(const MatchFinder::MatchResult &Result) {
const ASTContext &Context = *Result.Context;

if (const auto *IS = Result.Nodes.getNodeAs<IfStmt>("if")) {
const Stmt *Then = IS->getThen();
assert(Then && "An IfStmt must have a `then` branch!");

const Stmt *Else = Result.Nodes.getNodeAs<Stmt>("else");
assert(Else && "We only look for `if` statements with an `else` branch!");

if (!isa<IfStmt>(Else)) {
// Just a simple if with no `else if` branch.
if (areStatementsIdentical(Then->IgnoreContainers(),
Else->IgnoreContainers(), Context)) {
diag(IS->getBeginLoc(), "if with identical then and else branches");
diag(IS->getElseLoc(), "else branch starts here", DiagnosticIDs::Note);
}
return;
}

// This is the complicated case when we start an if/else if/else chain.
// To find all the duplicates, we collect all the branches into a vector.
llvm::SmallVector<const Stmt *, 4> Branches;
const IfStmt *Cur = IS;
while (true) {
// Store the `then` branch.
Branches.push_back(Cur->getThen());

Else = Cur->getElse();
// The chain ends if there is no `else` branch.
if (!Else)
break;

// Check if there is another `else if`...
Cur = dyn_cast<IfStmt>(Else);
if (!Cur) {
// ...this is just a plain `else` branch at the end of the chain.
Branches.push_back(Else);
break;
}
}

size_t N = Branches.size();
llvm::BitVector KnownAsClone(N);

for (size_t i = 0; i + 1 < N; i++) {
// We have already seen Branches[i] as a clone of an earlier branch.
if (KnownAsClone[i])
continue;

int NumCopies = 1;

for (size_t j = i + 1; j < N; j++) {
if (KnownAsClone[j] ||
!areStatementsIdentical(Branches[i]->IgnoreContainers(),
Branches[j]->IgnoreContainers(), Context))
continue;

NumCopies++;
KnownAsClone[j] = true;

if (NumCopies == 2) {
// We report the first occurence only when we find the second one.
diag(Branches[i]->getBeginLoc(),
"repeated branch in conditional chain");
diag(Lexer::getLocForEndOfToken(Branches[i]->getEndLoc(), 0,
*Result.SourceManager, getLangOpts()),
"end of the original", DiagnosticIDs::Note);
}

diag(Branches[j]->getBeginLoc(), "clone %0 starts here",
DiagnosticIDs::Note)
<< (NumCopies - 1);
}
}
return;
}

if (const auto *CO = Result.Nodes.getNodeAs<ConditionalOperator>("condOp")) {
// We do not try to detect chains of ?: operators.
if (areStatementsIdentical(CO->getTrueExpr(), CO->getFalseExpr(), Context))
diag(CO->getQuestionLoc(),
"conditional operator with identical true and false expressions");

return;
}

if (const auto *SS = Result.Nodes.getNodeAs<SwitchStmt>("switch")) {
const CompoundStmt *Body = dyn_cast_or_null<CompoundStmt>(SS->getBody());

// Code like
// switch (x) case 0: case 1: foobar();
// is legal and calls foobar() if and only if x is either 0 or 1;
// but we do not try to distinguish branches in such code.
if (!Body)
return;

// We will first collect the branches of the switch statements. For the
// sake of simplicity we say that branches are delimited by the SwitchCase
// (`case:` or `default:`) children of Body; that is, we ignore `case:` or
// `default:` labels embedded inside other statements and we do not follow
// the effects of `break` and other manipulation of the control-flow.
llvm::SmallVector<SwitchBranch, 4> Branches;
for (const Stmt *S : Body->body()) {
// If this is a `case` or `default`, we start a new, empty branch.
if (isa<SwitchCase>(S))
Branches.emplace_back();

// There may be code before the first branch (which can be dead code
// and can be code reached either through goto or through case labels
// that are embedded inside e.g. inner compound statements); we do not
// store those statements in branches.
if (!Branches.empty())
Branches.back().push_back(S);
}

auto End = Branches.end();
auto BeginCurrent = Branches.begin();
while (BeginCurrent < End) {
auto EndCurrent = BeginCurrent + 1;
while (EndCurrent < End &&
areSwitchBranchesIdentical(*BeginCurrent, *EndCurrent, Context)) {
++EndCurrent;
}
// At this point the iterator range {BeginCurrent, EndCurrent} contains a
// complete family of consecutive identical branches.
if (EndCurrent > BeginCurrent + 1) {
diag(BeginCurrent->front()->getBeginLoc(),
"switch has %0 consecutive identical branches")
<< static_cast<int>(std::distance(BeginCurrent, EndCurrent));

SourceLocation EndLoc = (EndCurrent - 1)->back()->getEndLoc();
// If the case statement is generated from a macro, it's SourceLocation
// may be invalid, resuling in an assertation failure down the line.
// While not optimal, try the begin location in this case, it's still
// better then nothing.
if (EndLoc.isInvalid())
EndLoc = (EndCurrent - 1)->back()->getBeginLoc();

if (EndLoc.isMacroID())
EndLoc = Context.getSourceManager().getExpansionLoc(EndLoc);

diag(Lexer::getLocForEndOfToken(EndLoc, 0, *Result.SourceManager,
getLangOpts()),
"last of these clones ends here", DiagnosticIDs::Note);
}
BeginCurrent = EndCurrent;
}
return;
}

llvm_unreachable("No if statement and no switch statement.");
}

} // namespace bugprone
} // namespace tidy
} // namespace clang
39 changes: 39 additions & 0 deletions clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//===--- BranchCloneCheck.h - clang-tidy ------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BRANCHCLONECHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BRANCHCLONECHECK_H

#include "../ClangTidy.h"

namespace clang {
namespace tidy {
namespace bugprone {

/// A check for detecting if/else if/else chains where two or more branches are
/// Type I clones of each other (that is, they contain identical code), for
/// detecting switch statements where two or more consecutive branches are
/// Type I clones of each other, and for detecting conditional operators where
/// the true and false expressions are Type I clones of each other.
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-branch-clone.html
class BranchCloneCheck : public ClangTidyCheck {
public:
BranchCloneCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};

} // namespace bugprone
} // namespace tidy
} // namespace clang

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_BRANCHCLONECHECK_H
Loading