summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy doc: unbreak the CISylvestre Ledru2020-01-101-0/+2
|
* [TargetLowering] Use SelectionDAG::getSetCC and remove a repeated call to ↵Craig Topper2020-01-101-8/+4
| | | | getSetCCResultType in softenSetCCOperands. NFCI
* clang-tidy doc: Refresh the list of checkers and polish the scriptSylvestre Ledru2020-01-102-33/+28
|
* MakeUniqueCheck.cpp: explicit the fact that there is an autofix for this checkerSylvestre Ledru2020-01-101-0/+2
|
* Implement new AST matcher hasAnyCapture to match on LambdaExpr captures.Reid2020-01-104-0/+97
| | | | Accepts child matchers cxxThisExpr to match on capture of this and also on varDecl.
* [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in ↵Raphael Isemann2020-01-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Debug builds Summary: In Debug builds we call VerifyDecl in ClangASTContext::CreateFunctionDeclaration which in turn calls `getAccess` on the created FunctionDecl. As we passed in a RecordDecl as the DeclContext for the FunctionDecl, we end up hitting the assert in `getAccess` that checks that we never have a Decl inside a Record without a valid AccessSpecifier. FunctionDecls are never in RecordDecls (that would be a CXXMethodDecl) so setting a access specifier would not be the correct way to fix this. Instead this patch does the same thing that DWARFASTParserClang::ParseSubroutine is doing: We pass in the FunctionDecl with the TranslationUnit as the DeclContext. That's not ideal but it is how we currently do it when creating our debug info AST, so the unit test should do the same. Reviewers: shafik Reviewed By: shafik Subscribers: aprantl, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72359
* [lldb] Make CompleteTagDeclsScope completion order deterministicRaphael Isemann2020-01-101-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We iterate over `m_decls_to_complete` to complete declarations. As `m_decls_to_complete` is a set the iteration order can be non-deterministic. The order is currently only non-deterministic when we have a large set of decls that need to be completed (i.e. more than 32 decls, as otherwise the SmallPtrSet is just a linear-searched list). This doesn't really fix any specific bug or has any really observable change in behavior as the order in which we import should not influence any semantics. However the order we create decls/types is now always deterministic which should make debugging easier. Reviewers: labath, mib, shafik, davide Reviewed By: shafik, davide Subscribers: davide, abidh, JDevlieghere, lldb-commits, mgrang Tags: #lldb Differential Revision: https://reviews.llvm.org/D72495
* [Tests] Precommit tests showing default branch padding on skylakePhilip Reames2020-01-102-0/+75
| | | | A follow up patch will change the default for the compiler, but not the assembler, just making sure we have testing for each in place.
* [ASTMatchers] Make test more clear about what it is verifyingStephen Kelly2020-01-101-2/+5
|
* [Driver][PowerPC] Move powerpcspe logic from cc1 to DriverFangrui Song2020-01-104-4/+8
| | | | | | | | | Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433
* [clang] Fix out-of-bounds memory access in ComputeLineNumbersJan Korous2020-01-102-13/+32
| | | | Differential Revision: https://reviews.llvm.org/D72409
* [CMake] Fix modules build after DWARFLinker reorganizationJonas Devlieghere2020-01-102-0/+9
| | | | | Create a dedicate module for the DWARFLinker and make it depend on intrinsics gen.
* [lld][WebAssembly] Add libcall symbols to the link when LTO is being used.Sam Clegg2020-01-106-0/+74
| | | | | | | | | | | | | | | This code is copied almost verbatim from the equivalent change to the ELF linker: - https://reviews.llvm.org/D50017 - https://reviews.llvm.org/D50475 The upshot is that libraries containing libcall (such as compiler-rt and libc) can be compiled with LTO. Fixes PR41384 Differential Revision: https://reviews.llvm.org/D71738
* [TargetLowering][ARM][X86] Change softenSetCCOperands handling of ONE to ↵Craig Topper2020-01-105-35/+36
| | | | | | | | | | | | avoid spurious exceptions for QNANs with strict FP quiet compares ONE is currently softened to OGT | OLT. But the libcalls for OGT and OLT libcalls will trigger an exception for QNAN. At least for X86 with libgcc. UEQ on the other hand uses UO | OEQ. The UO and OEQ libcalls will not trigger an exception for QNAN. This patch changes ONE to use the inverse of the UEQ lowering. So we now produce O & UNE. Technically the existing behavior was correct for a signalling ONE, but since I don't know how to generate one of those from clang that seemed like something we can deal with later as we would need to fix other predicates as well. Also removing spurious exceptions seemed better than missing an exception. There are also problems with quiet OGT/OLT/OLE/OGE, but those are harder to fix. Differential Revision: https://reviews.llvm.org/D72477
* [analyzer] Move PlacementNewChecker to alphaGabor Marton2020-01-103-8/+8
|
* Update the attribution policy to use the 'Author' property of a git commitDaniel Sanders2020-01-101-7/+19
| | | | | | | | | | | | | | | Summary: The older method of adding 'Patch by John Doe' is documented in the `Attribution of Changes` section to support correct attribution of commits that pre-date the adoption of git. Reviewers: hfinkel, aaron.ballman, mehdi_amini Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72468
* [lldb/Lua] Support loading Lua modulesJonas Devlieghere2020-01-106-0/+69
| | | | | | Implements the command script import command for Lua. Differential revision: https://reviews.llvm.org/D71825
* [lldb] Remove FieldDecl stealing hack by rerouting indirect imports to the ↵Raphael Isemann2020-01-102-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | original AST Summary: This is a port of D67803 that was about preventing indirect importing to our scratch context when evaluating expressions. D67803 already has a pretty long explanation of how this works, but the idea is that instead of importing declarations indirectly over the expression AST (i.e., Debug info AST -> Expression AST -> scratch AST) we instead directly import the declaration from the debug info AST to the scratch AST. The difference from D67803 is that here we have to do this in the ASTImporterDelegate (which is our ASTImporter subclass we use in LLDB). It has the same information as the ExternalASTMerger in D67803 as it can access the ClangASTImporter (which also keeps track of where Decls originally came from). With this patch we can also delete the FieldDecl stealing hack in the ClangASTSource (this was only necessary as the indirect imports caused the creation of duplicate Record declarations but we needed the fields in the Record decl we originally found in the scratch ASTContext). This also fixes the current gmodules failures where we fail to find std::vector fields after an indirect import over the expression AST (where it seems even our FieldDecl stealing hack can't save us from). Reviewers: shafik, aprantl Reviewed By: shafik Subscribers: JDevlieghere, lldb-commits, mib, labath, friss Tags: #lldb Differential Revision: https://reviews.llvm.org/D72507
* [LegalizeVectorOps] Improve handling of multi-result operations.Craig Topper2020-01-102-173/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This system wasn't very well designed for multi-result nodes. As a consequence they weren't consistently registered in the LegalizedNodes map leading to nodes being revisited for different results. I've removed the "Result" variable from the main LegalizeOp method and used a SDNode* instead. The result number from the incoming Op SDValue is only used for deciding which result to return to the caller. When LegalizeOp is called it should always register a legalized result for all of its results. Future calls for any other result should be pulled for the LegalizedNodes map. Legal nodes will now register all of their results in the map instead of just the one we were called for. The Expand and Promote handling to use a vector of results similar to LegalizeDAG. Each of the new results is then re-legalized and logged in the LegalizedNodes map for all of the Results for the node being legalized. None of the handles register their own results now. And none call ReplaceAllUsesOfValueWith now. Custom handling now always passes result number 0 to LowerOperation. This matches what LegalizeDAG does. Since the introduction of STRICT nodes, I've encountered several issues with X86's custom handling being called with an SDValue pointing at the chain and our custom handlers using that to get a VT instead of result 0. This should prevent us from having any more of those issues. On return we will update the LegalizedNodes map for all results so we shouldn't call the custom handler again for each result number. I want to push SDNode* further into the Expand and Promote handlers, but I've left that for a follow to keep this patch size down. I've created a dummy SDValue(Node, 0) to keep the handlers working. Differential Revision: https://reviews.llvm.org/D72224
* [ELF] Make TargetInfo::writeIgotPlt a no-opFangrui Song2020-01-104-9/+5
| | | | | | | | | | | | | | RELA targets don't read initial .got.plt entries. REL targets (ARM, x86-32) write the address of the IFUNC resolver to the entry (`write32le(buf, s.getVA())`). The default writeIgotPlt() is not meaningful. Make it a no-op. AArch64 and x86-64 will have 0 as initial .got.plt entries associated with IFUNC. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D72474
* [Driver][CodeGen] Add -fpatchable-function-entry=N[,0]Fangrui Song2020-01-109-0/+58
| | | | | | | | | | | In the backend, this feature is implemented with the function attribute "patchable-function-entry". Both the attribute and XRay use TargetOpcode::PATCHABLE_FUNCTION_ENTER, so the two features are incompatible. Reviewed By: ostannard, MaskRay Differential Revision: https://reviews.llvm.org/D72222
* Support function attribute patchable_function_entryFangrui Song2020-01-108-1/+99
| | | | | | | | | This feature is generic. Make it applicable for AArch64 and X86 because the backend has only implemented NOP insertion for AArch64 and X86. Reviewed By: nickdesaulniers, aaron.ballman Differential Revision: https://reviews.llvm.org/D72221
* [X86] Support function attribute "patchable-function-entry"Fangrui Song2020-01-102-3/+73
| | | | | | | For x86-64, we diverge from GCC -fpatchable-function-entry in that we emit multi-byte NOPs. Differential Revision: https://reviews.llvm.org/D72220
* [AArch64] Add function attribute "patchable-function-entry" to add NOPs at ↵Fangrui Song2020-01-107-2/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function entry The Linux kernel uses -fpatchable-function-entry to implement DYNAMIC_FTRACE_WITH_REGS for arm64 and parisc. GCC 8 implemented -fpatchable-function-entry, which can be seen as a generalized form of -mnop-mcount. The N,M form (function entry points before the Mth NOP) is currently only used by parisc. This patch adds N,0 support to AArch64 codegen. N is represented as the function attribute "patchable-function-entry". We will use a different function attribute for M, if we decide to implement it. The patch reuses the existing patchable-function pass, and TargetOpcode::PATCHABLE_FUNCTION_ENTER which is currently used by XRay. When the integrated assembler is used, __patchable_function_entries will be created for each text section with the SHF_LINK_ORDER flag to prevent --gc-sections (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93197) and COMDAT (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93195) issues. Retrospectively, __patchable_function_entries should use a PC-relative relocation type to avoid the SHF_WRITE flag and dynamic relocations. "patchable-function-entry"'s interaction with Branch Target Identification is still unclear (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 for GCC discussions). Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D72215
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-101-1/+1
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
* [AIX] Allow vararg calls when all arguments reside in registersjasonliu2020-01-103-24/+376
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch pushes the AIX vararg unimplemented error diagnostic later and allows vararg calls so long as all the arguments can be passed in register. This patch extends the AIX calling convention implementation to initialize GPR(s) for vararg float arguments. On AIX, both GPR(s) and FPR are allocated for floating point arguments. The GPR(s) are only initialized for vararg calls, otherwise the callee is expected to retrieve the float argument in the FPR. f64 in AIX PPC32 requires special handling in order to allocated and initialize 2 GPRs. This is performed with bitcast, SRL, truncation to initialize one GPR for the MSW and bitcast, truncations to initialize the other GPR for the LSW. A future patch will follow to add support for arguments passed on the stack. Patch provided by: cebowleratibm Reviewers: sfertile, ZarkoCA, hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D71013
* [examples] Add missing dependency in llvm examplesHiroshi Inoue2020-01-113-0/+3
| | | | To fix build failure with BUILD_SHARED_LIBS=ON
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-101-1/+1
| | | | Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
* Fix "pointer is null" static analyzer warning. NFCI.Simon Pilgrim2020-01-101-1/+1
| | | | Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately).
* [X86][AVX] lowerShuffleAsLanePermuteAndShuffle - consistently normalize ↵Simon Pilgrim2020-01-101-2/+2
| | | | | | | | multi-input shuffle elements We only use lowerShuffleAsLanePermuteAndShuffle for unary shuffles at the moment, but we should consistently handle lane index calculations for multiple inputs in both the AVX1 and AVX2 paths. Minor (almost NFC) tidyup as I'm hoping to use lowerShuffleAsLanePermuteAndShuffle for binary shuffles soon.
* [gn build] Port 5e7beb0a414LLVM GN Syncbot2020-01-101-0/+1
|
* [clangd] Fix targetDecl() on certain usage of ObjC properties.Sam McCall2020-01-102-6/+12
| | | | | | | | | | | | | | | Summary: In particular there's a common chain: OpaqueValueExpr->PseudoObjectExpr->ObjCPropertyRefExpr->ObjCPropertyDecl and we weren't handling the first two edges Reviewers: dgoldman, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72494
* [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcsYonghong Song2020-01-1036-142/+381
| | | | | | | | | | | | | | Previously extern function is added as BTF_KIND_VAR. This does not work well with existing BTF infrastructure as function expected to use BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO. This patch added extern function to BTF_KIND_FUNC. The two bits 0:1 of btf_type.info are used to indicate what kind of function it is: 0: static 1: global 2: extern Differential Revision: https://reviews.llvm.org/D71638
* [InstCombine] add tests for fsub; NFCSanjay Patel2020-01-101-0/+135
| | | | | Conflicting/missing canonicalizations are visible in PR44509: https://bugs.llvm.org/show_bug.cgi?id=44509
* [mlir][spirv] Fix typos related to (de)serialization.Denis Khalikov2020-01-102-5/+5
| | | | | | Fix typos related to (de)serialization of spv.selection. Differential Revision: https://reviews.llvm.org/D72503
* [analyzer] Add PlacementNewCheckerGabor Marton2020-01-106-0/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker verifies if default placement new is provided with pointers to sufficient storage capacity. Noncompliant Code Example: #include <new> void f() { short s; long *lp = ::new (&s) long; } Based on SEI CERT rule MEM54-CPP https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM54-CPP.+Provide+placement+new+with+properly+aligned+pointe This patch does not implement checking of the alignment. Reviewers: NoQ, xazax.hun Subscribers: mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat Tags: #clang Differential Revision: https://reviews.llvm.org/D71612
* Add missing nullptr checks.Adrian Prantl2020-01-108-29/+42
| | | | | | | | | | GetPersistentExpressionStateForLanguage() can return a nullptr if it cannot construct a typesystem. This patch adds missing nullptr checks at all uses. Inspired by rdar://problem/58317195 Differential Revision: https://reviews.llvm.org/D72413
* Add support for __declspec(guard(nocf))Andrew Paverd2020-01-1011-28/+252
| | | | | | | | | | | | | | | | | | Summary: Avoid using the `nocf_check` attribute with Control Flow Guard. Instead, use a new `"guard_nocf"` function attribute to indicate that checks should not be added on indirect calls within that function. Add support for `__declspec(guard(nocf))` following the same syntax as MSVC. Reviewers: rnk, dmajor, pcc, hans, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, tomrittervg, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72167
* [PowerPC] Handle constant zero bits in BitPermutationSelectorNemanja Ivanovic2020-01-102-4/+148
| | | | | | | | | | We currently crash when analyzing an AssertZExt node that has some bits that are constant zeros (i.e. as a result of an and with a constant). This issue was reported in https://bugs.llvm.org/show_bug.cgi?id=41088 and this patch fixes that. Differential revision: https://reviews.llvm.org/D72038
* [NFC] format unittest for ExprMutAnalyzerJonas Toth2020-01-101-29/+24
| | | | | | This formatting is a preparation for review in https://reviews.llvm.org/D54943 to separate pure formatting changes from actual testing changes.
* [DebugInfo][NFC] Remove unused variable/fix variable namingJames Henderson2020-01-101-1181/+1179
| | | | | | Reviewed by: MaskRay Differential Revision: https://reviews.llvm.org/D72159
* [DebugInfo] Improve error message textJames Henderson2020-01-104-766/+770
| | | | | | | | | | Unlike most of our errors in the debug line parser, the "no end of sequence" message was missing any reference to which line table it refererred to. This change adds the offset to this message. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D72443
* [LIBOMPTARGET]Ignore empty target descriptors.Alexey Bataev2020-01-102-0/+21
| | | | | | | | | | | | | | | | | | Summary: If the dynamically loaded module has been compiled with -fopenmp-targets and has no target regions, it has empty target descriptor. It leads to a crash at the runtime if another module has at least one target region and at least one entry in its descriptor. The runtime library is unable to load the empty binary descriptor and terminates the execution. Caused by a clang-offload-wrapper. Reviewers: grokos, jdoerfert Subscribers: caomhin, kkwli0, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72472
* AMDGPU/GlobalISel: Clamp G_ZEXT source sizesMatt Arsenault2020-01-108-240/+970
| | | | | Also clamps G_SEXT/G_ANYEXT, but the implementation is more limited so fewer cases actually work.
* [lldb][tests] Make it possible to expect failure for a whole categoryTatyana Krasnukha2020-01-104-4/+24
| | | | | | | | | | | | | There already are decorators and "--excluded" option to mark test-cases/files as expected to fail. However, when a new test file is added and it which relates to a feature that a target doesn't support, this requires either adding decorators to that file or modifying the file provided as "--excluded" option value. The purpose of this patch is to avoid any modifications in such cases. E.g. if a target doesn't support "watchpoints" and passes "--xfail-category watchpoint" to dotest, a testing job will not fail after a new watchpoint-related test file is added. Differential Revision: https://reviews.llvm.org/D71906
* [lldb][tests][NFC] Unify variable naming conventionTatyana Krasnukha2020-01-105-45/+45
|
* [FPEnv] Invert sense of MIFlag::FPExcept flagUlrich Weigand2020-01-1013-106/+130
| | | | | | | | | | | | | | | | | | In D71841 we inverted the sense of the SDNode-level flag to ensure all nodes default to potentially raising FP exceptions unless otherwise specified -- i.e. if we forget to propagate the flag somewhere, the effect is now only lost performance, not incorrect code. However, the related flag at the MI level still defaults to nodes not raising FP exceptions unless otherwise specified. To be fully on the (conservatively) safe side, we should invert that flag as well. This patch does so by replacing MIFlag::FPExcept with MIFlag::NoFPExcept. (Note that this does also introduce an incompatible change in the MIR format.) Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D72466
* [ARM][MVE] Tail predicate VMAX,VMAXA,VMIN,VMINASam Parker2020-01-102-0/+20
| | | | | | | Add the MVE min and max instructions to our tail predication whitelist. Differential Revision: https://reviews.llvm.org/D72502
* RangeDataVector: Support custom sorting for D63540Jan Kratochvil2020-01-102-23/+54
| | | | | | | | | | | As suggested by @labath extended RangeDataVector so that user can provide custom sorting of the Entry's `data' field for D63540. https://reviews.llvm.org/D63540 RangeData functions were used just by RangeDataVector (=after I removed them LLDB still builds fine) which no longer uses them so I removed them. Differential revision: https://reviews.llvm.org/D72460
* ARMLowOverheadLoops: a few more dbg msgs to better trace rejected TP loops. NFC.Sjoerd Meijer2020-01-101-7/+16
|
OpenPOWER on IntegriCloud