summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizerJames Henderson2019-02-016-19/+22
| | | | | | | | | | | | | | | | | | | | Prior to this change, there are a few tests called llvm-symbolizer* in the DebugInfo test area. These really were testing either the DebugInfo or Symbolizer library, rather than the llvm-symbolizer tool itself, so this patch renames them to be clearer that they aren't explicitly tests for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer). This patch also reinstates the copying of a DWO file, removed previously in r352752. The test needs this so that it could possibly fail. Finally, some of the tests have been simplified slightly by removing unnecessary switches and/or unused check-prefixes. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57518 llvm-svn: 352847
* [doc]Update String Error documentation in Programmer ManualJames Henderson2019-02-011-4/+14
| | | | | | | | | | | | | A while back, createStringError was added to provide easier construction of StringError instances, especially with formatting options. Prior to this patch, that the documentation only mentions the standard method of using it. Since createStringError is slightly shorter to type, and also provides the formatting options, this patch updates the Programmer's Manual to use the new function in its examples, and to mention the printf formatting options. It also fixes a small typo in one of the examples and removes the unnecessary make_error_code call. llvm-svn: 352846
* [PDB] Fix location retrieval for function local variables and arguments that areAleksandr Urakov2019-02-0122-929/+1514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | stored relative to VFRAME Summary: This patch makes LLDB able to retrieve proper values for function arguments and local variables stored in PDB relative to VFRAME register. Patch contains retrieval of corresponding FPO table entries from PDB and a generic translator from FPO programs to DWARF expressions to get correct VFRAME value. Patch also improves variables-locations.test and makes this test passable on x86. Patch By: leonid.mashinsky Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov Reviewed By: zturner Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D55122 llvm-svn: 352845
* [CodeGen] Don't scavenge non-saved regs in exception throwing functionsOliver Stannard2019-02-012-7/+56
| | | | | | | | | | | | | | | | Previously, LiveRegUnits was assuming that if a block has no successors and does not return, then no registers are live at the end of it (because the end of the block is unreachable). This was causing the register scavenger to use callee-saved registers to materialise stack frame addresses without saving them in the prologue. This would normally be fine, because the end of the block is unreachable, but this is not legal if the block ends by throwing a C++ exception. If this happens, the scratch register will be modified, but its previous value won't be preserved, so it doesn't get restored by the exception unwinder. Differential revision: https://reviews.llvm.org/D57381 llvm-svn: 352844
* [clangd] clangDaemonTweaks - fix -DBUILD_SHARED_LIBS=ON buildRoman Lebedev2019-02-011-0/+9
| | | | | | Followup for rL352841. llvm-svn: 352843
* Test commit: fix typoSergi Mateo Bellido2019-02-011-1/+1
| | | | llvm-svn: 352842
* [clangd] Fix -DBUILD_SHARED_LIBS=ON build - SwapIfBranches needs clangAST.Roman Lebedev2019-02-011-0/+1
| | | | | | | | | | | | | | | Else, fails with: [1/2] Linking CXX executable bin/clangd FAILED: bin/clangd : && /usr/bin/g++ -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -pipe -O2 -g0 -UNDEBUG -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined -Wl,-O3 -Wl,--gc-sections tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o tools/clang/tools/extra/clangd/tool/CMakeFiles/clangd.dir/ClangdMain.cpp.o -o bin/clangd -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.so.9svn -lpthread lib/libclangBasic.so.9svn lib/libclangTidy.so.9svn lib/libclangDaemon.so.9svn lib/libclangFormat.so.9svn lib/libclangFrontend.so.9svn lib/libclangSema.so.9svn lib/libclangTooling.so.9svn lib/libclangToolingCore.so.9svn && : ld.lld: error: undefined symbol: clang::FunctionDecl::getBody(clang::FunctionDecl const*&) const >>> referenced by SwapIfBranches.cpp >>> tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o:(clang::FunctionDecl::getBody() const) and so on. llvm-svn: 352841
* [obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.George Rimar2019-02-011-49/+25
| | | | | | | | These methods are very similar, patch merge them into one. Differential revision: https://reviews.llvm.org/D57461 llvm-svn: 352840
* [SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.Yevgeny Rouban2019-02-011-27/+18
| | | | | | | | Indices are checked as they are generated. No need to fill the whole array of indices. Differential Revision: https://reviews.llvm.org/D57144 llvm-svn: 352839
* Fix isInSystemMacro to handle pasted macrosSerge Guelton2019-02-015-1/+64
| | | | | | | | | | | | | Token pasted by the preprocessor (through ##) have a Spelling pointing to scratch buffer. As a result they are not recognized at system macro, even though the pasting happened in a system macro. Fix that by looking into the parent macro if the original lookup finds a scratch buffer. Differential Revision: https://reviews.llvm.org/D55782 This effectively fixes https://bugs.llvm.org/show_bug.cgi?id=35268, llvm-svn: 352838
* [clangd] Fix crash in applyTweak, remove TweakID alias.Sam McCall2019-02-016-25/+19
| | | | | | | Strings are complicated, giving them opaque names makes us forget they're complicated. llvm-svn: 352837
* Revert "Bump minimum toolchain version"JF Bastien2019-02-014-94/+40
| | | | | | Looks like we still have a few bots that are sad. Let try to get them fixed! llvm-svn: 352835
* Bump minimum toolchain versionJF Bastien2019-02-014-40/+94
| | | | | | | | | | | | | | | Summary: The RFC on moving past C++11 got good traction: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html This patch therefore bumps the toolchain versions according to our policy: llvm.org/docs/DeveloperPolicy.html#toolchain Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane Differential Revision: https://reviews.llvm.org/D57264 llvm-svn: 352834
* [RISCV] Implement RV64D codegenAlex Bradbury2019-02-0113-4/+1513
| | | | | | | | | | | | This patch: * Adds necessary RV64D codegen patterns * Modifies CC_RISCV so it will properly handle f64 types (with soft float ABI) Note that in general there is no reason to try to select fcvt.w[u].d rather than fcvt.l[u].d for i32 conversions because fptosi/fptoui produce poison if the input won't fit into the target type. Differential Revision: https://reviews.llvm.org/D53237 llvm-svn: 352833
* [SelectionDAG] Support promotion of the FPOWI integer operandAlex Bradbury2019-02-014-1/+229
| | | | | | | | | | | | | | For targets where i32 is not a legal type (e.g. 64-bit RISC-V), LegalizeIntegerTypes must promote the integer operand of ISD::FPOWI. As this is a signed value, this should be sign-extended. This patch enables all tests in test/CodeGen/RISCVfloat-intrinsics.ll for RV64, as prior to this patch that file couldn't be compiled for RV64 due to an assertion when performing codegen for fpowi. Differential Revision: https://reviews.llvm.org/D54574 llvm-svn: 352832
* [SemaCXX] Param diagnostic matches overload logicBrian Gesiak2019-02-012-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Given the following test program: ``` class C { public: int A(int a, int& b); }; int C::A(const int a, int b) { return a * b; } ``` Clang would produce an error message that correctly diagnosed the redeclaration of `C::A` to not match the original declaration (the parameters to the two declarations do not match -- the original takes an `int &` as its 2nd parameter, but the redeclaration takes an `int`). However, it also produced a note diagnostic that inaccurately pointed to the first parameter, claiming that `const int` in the redeclaration did not match the unqualified `int` in the original. The diagnostic is misleading because it has nothing to do with why the program does not compile. The logic for checking for a function overload, in `Sema::FunctionParamTypesAreEqual`, discards cv-qualifiers before checking whether the types are equal. Do the same when producing the overload diagnostic. Reviewers: rsmith Reviewed By: rsmith Subscribers: cpplearner, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57032 llvm-svn: 352831
* Fix compilation of examples after 13680223b9d8 / r352827James Y Knight2019-02-014-14/+18
| | | | | | Who knew...they're not built by default or as part of the tests. llvm-svn: 352830
* [Sanitizers] UBSan unreachable incompatible with ASan in the presence of ↵Julian Lettner2019-02-014-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `noreturn` calls Summary: UBSan wants to detect when unreachable code is actually reached, so it adds instrumentation before every unreachable instruction. However, the optimizer will remove code after calls to functions marked with noreturn. To avoid this UBSan removes noreturn from both the call instruction as well as from the function itself. Unfortunately, ASan relies on this annotation to unpoison the stack by inserting calls to _asan_handle_no_return before noreturn functions. This is important for functions that do not return but access the the stack memory, e.g., unwinder functions *like* longjmp (longjmp itself is actually "double-proofed" via its interceptor). The result is that when ASan and UBSan are combined, the noreturn attributes are missing and ASan cannot unpoison the stack, so it has false positives when stack unwinding is used. Changes: Clang-CodeGen now directly insert calls to `__asan_handle_no_return` when a call to a noreturn function is encountered and both UBsan-unreachable and ASan are enabled. This allows UBSan to continue removing the noreturn attribute from functions without any changes to the ASan pass. Previously generated code: ``` call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable ``` Generated code (for now): ``` call void @__asan_handle_no_return call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable ``` rdar://problem/40723397 Reviewers: delcypher, eugenis, vsk Differential Revision: https://reviews.llvm.org/D57278 > llvm-svn: 352690 llvm-svn: 352829
* [WebAssembly] Support imports from custom module namesSam Clegg2019-02-019-14/+48
| | | | | | | | | | | | | Fixes: https://bugs.llvm.org/show_bug.cgi?id=37168 This is only a first pass at supporting these custom import modules. In the long run we most likely want to treat these kinds of symbols very differently. For example, it should not be possible to resolve such as symbol at static link type. Differential Revision: https://reviews.llvm.org/D45796 llvm-svn: 352828
* [opaque pointer types] Add a FunctionCallee wrapper type, and use it.James Y Knight2019-02-0170-897/+864
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc doesn't choke on it, hopefully. Original Message: The FunctionCallee type is effectively a {FunctionType*,Value*} pair, and is a useful convenience to enable code to continue passing the result of getOrInsertFunction() through to EmitCall, even once pointer types lose their pointee-type. Then: - update the CallInst/InvokeInst instruction creation functions to take a Callee, - modify getOrInsertFunction to return FunctionCallee, and - update all callers appropriately. One area of particular note is the change to the sanitizer code. Previously, they had been casting the result of `getOrInsertFunction` to a `Function*` via `checkSanitizerInterfaceFunction`, and storing that. That would report an error if someone had already inserted a function declaraction with a mismatching signature. However, in general, LLVM allows for such mismatches, as `getOrInsertFunction` will automatically insert a bitcast if needed. As part of this cleanup, cause the sanitizer code to do the same. (It will call its functions using the expected signature, however they may have been declared.) Finally, in a small number of locations, callers of `getOrInsertFunction` actually were expecting/requiring that a brand new function was being created. In such cases, I've switched them to Function::Create instead. Differential Revision: https://reviews.llvm.org/D57315 llvm-svn: 352827
* [ELF] Support --{,no-}allow-shlib-undefinedFangrui Song2019-02-019-26/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In ld.bfd/gold, --no-allow-shlib-undefined is the default when linking an executable. This patch implements a check to error on undefined symbols in a shared object, if all of its DT_NEEDED entries are seen. Our approach resembles the one used in gold, achieves a good balance to be useful but not too smart (ld.bfd traces all DSOs and emulates the behavior of a dynamic linker to catch more cases). The error is issued based on the symbol table, different from undefined reference errors issued for relocations. It is most effective when there are DSOs that were not linked with -z defs (e.g. when static sanitizers runtime is used). gold has a comment that some system libraries on GNU/Linux may have spurious undefined references and thus system libraries should be excluded (https://sourceware.org/bugzilla/show_bug.cgi?id=6811). The story may have changed now but we make --allow-shlib-undefined the default for now. Its interaction with -shared can be discussed in the future. Reviewers: ruiu, grimar, pcc, espindola Reviewed By: ruiu Subscribers: joerg, emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D57385 llvm-svn: 352826
* Fix names of functions in TargetOptionsCommandFlags.h. NFC.Sam Clegg2019-02-015-18/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D57555 llvm-svn: 352825
* [analyzer] [RetainCountChecker] Fix object type for CF/Obj-C bridged castsGeorge Karpenkov2019-02-012-2/+24
| | | | | | | | | | | | Having an incorrect type for a cast causes the checker to incorrectly dismiss the operation under ARC, leading to a false positive use-after-release on the test. rdar://47709885 Differential Revision: https://reviews.llvm.org/D57557 llvm-svn: 352824
* Mark __rela_iplt_{start,end} as weak.Peter Collingbourne2019-02-011-1/+1
| | | | | | Should fix non-lld links. llvm-svn: 352823
* Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed"Akira Hatanaka2019-02-012-20/+2
| | | | | | | | | | | This reverts commit r350920 as it is not clear whether we should force a class to be returned in registers when copy and move constructors are both deleted. For more background, see the following discussion: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190128/259907.html llvm-svn: 352822
* [x86] adjust test to show both add/inc options; NFCSanjay Patel2019-02-011-2/+4
| | | | | | | | If we're optimizing for size, that overrides the subtarget feature, so we would always produce 'inc' if we matched this pattern. llvm-svn: 352821
* [x86] add test for missed opportunity to use 'inc'; NFCSanjay Patel2019-01-311-0/+43
| | | | | | Another pattern exposed in D57516. llvm-svn: 352820
* [libFuzzer] make a test for exploding dfsan labels more agressiveKostya Serebryany2019-01-311-0/+2
| | | | llvm-svn: 352819
* [sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions ↵Kostya Serebryany2019-01-313-2/+69
| | | | | | that feed into the backedge branch. Instrumenting these CMP instructions is almost always useless (and harmful) for fuzzing llvm-svn: 352818
* GlobalISel: Fix MMO creation with non-power-of-2 mem sizeMatt Arsenault2019-01-312-4/+14
| | | | | | | It should probably just be mandatory for getTgtMemIntrinsic to return the alignment. llvm-svn: 352817
* hwasan: Add __hwasan_init_static() function.Peter Collingbourne2019-01-319-23/+72
| | | | | | | | | | | This function initializes enough of the runtime to be able to run instrumented code in a statically linked executable. It replaces __hwasan_shadow_init() which wasn't doing enough initialization for instrumented code that uses either TLS or IFUNC to work. Differential Revision: https://reviews.llvm.org/D57490 llvm-svn: 352816
* [libFuzzer][Windows] Temporarily disable value-profile-cmp2.test on WinJonathan Metzman2019-01-311-0/+2
| | | | | | | | | | | | | | | | | | | | Summary: Temporarily disable value-profile-cmp2.test on Win. https://reviews.llvm.org/D57465 causes the test to fail on Win. However, it seems that the behavior of libFuzzer on Win was broken before that patch. It crashes in the exit handler when not used with ASAN. Prior to the patch, the crash handler would run, tricking the test into thinking libFuzzer on Win had exited properly. Reviewers: morehouse, vitalybuka Reviewed By: morehouse Subscribers: yln Differential Revision: https://reviews.llvm.org/D57551 llvm-svn: 352815
* Revert "Bump minimum toolchain version"JF Bastien2019-01-314-91/+40
| | | | | | | | A handful of bots are still breaking, either because I missed them in my audit, they were offline, or something else. I'm contacting their authors, but I'll revert for now and re-commit later. llvm-svn: 352814
* [WebAssembly] Fix a regression selecting negative build_vector lanesThomas Lively2019-01-312-3/+3
| | | | | | | | | | | | | | | | Summary: The custom lowering introduced in rL352592 creates build_vector nodes with negative i32 operands, but these operands did not meet the value range constraints necessary to match build_vector nodes. This CL fixes the issue by removing the unnecessary constraints. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish Differential Revision: https://reviews.llvm.org/D57481 llvm-svn: 352813
* DeveloperPolicy: update toolchain with sample RFC / patchJF Bastien2019-01-311-0/+3
| | | | | | As was suggested when the policy originally went in. llvm-svn: 352812
* Bump minimum toolchain versionJF Bastien2019-01-314-40/+91
| | | | | | | | | | | | | | | Summary: The RFC on moving past C++11 got good traction: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html This patch therefore bumps the toolchain versions according to our policy: llvm.org/docs/DeveloperPolicy.html#toolchain Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane Differential Revision: https://reviews.llvm.org/D57264 llvm-svn: 352811
* Fixed hasLinkerPrivateGlobalPrefix treating StringRef as C String.Wouter van Oortmerssen2019-01-311-1/+1
| | | | | | | | | | Reviewers: jgravelle-google, sbc100 Subscribers: aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D57545 llvm-svn: 352810
* Re-disable pch-from-libclang.c after 352803, some buildbots are still unhappyNico Weber2019-01-311-0/+3
| | | | llvm-svn: 352809
* [RISCV] Add RV64F codegen supportAlex Bradbury2019-01-3113-2/+1466
| | | | | | | | | | | | | This requires a little extra work due tothe fact i32 is not a legal type. When call lowering happens post-legalisation (e.g. when an intrinsic was inserted during legalisation). A bitcast from f32 to i32 can't be introduced. This is similar to the challenges with RV32D. To handle this, we introduce target-specific DAG nodes that perform bitcast+anyext for f32->i64 and trunc+bitcast for i64->f32. Differential Revision: https://reviews.llvm.org/D53235 llvm-svn: 352807
* [WebAssembly] MC: Fix for outputing wasm object to /dev/nullSam Clegg2019-01-312-1/+17
| | | | | | | | Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D57479 llvm-svn: 352806
* [x86] add test for missed opportunity to use 'inc'; NFCSanjay Patel2019-01-311-0/+30
| | | | llvm-svn: 352805
* [ASTDump] Make template specialization tests more exactStephen Kelly2019-01-311-112/+307
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D57502 llvm-svn: 352804
* Make clang/test/Index/pch-from-libclang.c pass in more placesNico Weber2019-01-315-30/+46
| | | | | | | | | | | | | | | - fixes the test on macOS with LLVM_ENABLE_PIC=OFF - together with D57343, gets the test to pass on Windows - makes it run everywhere (it seems to just pass on Linux) The main change is to pull out the resource directory computation into a function shared by all 3 places that do it. In CIndexer.cpp, this now works no matter if libclang is in lib/ or bin/ or statically linked to a binary in bin/. Differential Revision: https://reviews.llvm.org/D57345 llvm-svn: 352803
* [Hexagon] Rename textually included file from .h to .incRichard Trieu2019-01-312-1/+1
| | | | llvm-svn: 352802
* Do not copy long double and 128-bit fp format from aux target for AMDGPUYaxun Liu2019-01-312-0/+21
| | | | | | | | | | | | | | | rC352620 caused regressions because it copied floating point format from aux target. floating point format decides whether extended long double is supported. It is x86_fp80 on x86 but IEEE double on amdgcn. Document usage of long doubel type in HIP programming guide https://github.com/ROCm-Developer-Tools/HIP/pull/890 Differential Revision: https://reviews.llvm.org/D57527 llvm-svn: 352801
* Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it."James Y Knight2019-01-3170-865/+897
| | | | | | | | | This reverts commit f47d6b38c7a61d50db4566b02719de05492dcef1 (r352791). Seems to run into compilation failures with GCC (but not clang, where I tested it). Reverting while I investigate. llvm-svn: 352800
* [CUDA] add support for the new kernel launch API in CUDA-9.2+.Artem Belevich2019-01-3114-46/+250
| | | | | | | | | | | | | Instead of calling CUDA runtime to arrange function arguments, the new API constructs arguments in a local array and the kernels are launched with __cudaLaunchKernel(). The old API has been deprecated and is expected to go away in the next CUDA release. Differential Revision: https://reviews.llvm.org/D57488 llvm-svn: 352799
* [CUDA] Propagate detected version of CUDA to cc1Artem Belevich2019-01-316-6/+104
| | | | | | | | | | | | | ..and use it to control that parts of CUDA compilation that depend on the specific version of CUDA SDK. This patch has a placeholder for a 'new launch API' support which is in a separate patch. The list will be further extended in the upcoming patch to support CUDA-10.1. Differential Revision: https://reviews.llvm.org/D57487 llvm-svn: 352798
* [clangd] A code action to swap branches of an if statementIlya Biryukov2019-01-317-13/+401
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: llvm-commits, mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56611 llvm-svn: 352796
* Fix compilation error with GCC after r352791.James Y Knight2019-01-311-1/+1
| | | | llvm-svn: 352795
OpenPOWER on IntegriCloud