summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Populate CUDA flags on FreeBSD too, as many other toolchains do.Dimitry Andric2019-11-183-0/+296
| | | | | | | | | | | | | | | | Summary: This allows `clang` to be used to compile CUDA programs. Compiled simple helloworld.cu with this. Reviewers: dim, emaste, tra, yaxunl, ABataev Reviewed By: tra Subscribers: dim, emaste, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69990
* implement printing out raw section data of xcoff objectfile for llvm-objdumpdiggerlin2019-11-183-8/+107
| | | | | | | | | | | SUMMARY: implement printing out raw section data of xcoff objectfile for llvm-objdump and option -D --disassemble-all option for llvm-objdump Reviewers: Sean Fertile Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D70255
* Fix _LIBCPP_HAS_ definitions for Android.Dan Albert2019-11-188-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Android added quick_exit()/at_quick_exit() in API level 21, aligned_alloc() in API level 28, and timespec_get() in API level 29, but has the other C11 features at all API levels (since they're basically just coming from clang directly). _LIBCPP_HAS_QUICK_EXIT and _LIBCPP_HAS_TIMESPEC_GET already existed, so we can reuse them. (And use _LIBCPP_HAS_TIMESPEC_GET in a few more places where _LIBCPP_HAS_C11_FEATURES has been used as a proxy. This isn't correct for Android.) _LIBCPP_HAS_ALIGNED_ALLOC is added, to cover aligned_alloc() (obviously). Add a missing std:: before aligned_alloc in a cstdlib test, and remove a couple of !defined(_WIN32)s now that we're explicitly testing TEST_HAS_ALIGNED_ALLOC rather than TEST_HAS_C11_FEATURES. Reviewers: danalbert, EricWF, mclow.lists Reviewed By: danalbert Subscribers: srhines, christof, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D69929
* [X86] Add a 'break;' to the end of the last case in a switch to avoid ↵Craig Topper2019-11-181-0/+2
| | | | surprising the next person to add a case after this one. NFC
* [Sema] Fix a -Wobjc-signed-char-bool false-positiveErik Pilkington2019-11-182-0/+62
| | | | | | | Unsigned bit-field flags can only have boolean values, so handle that case in Expr::isKnownToHaveBooleanValue. rdar://56256999
* Update the docs for building libc++.Dan Albert2019-11-181-25/+29
| | | | | | | | | | | | | | | | Summary: Rewrite the in-tree build to be a clearer tl;dr like we have for the out-of-tree build. Reviewers: EricWF, mclow.lists, ldionne Reviewed By: ldionne Subscribers: dexonsmith, christof, ldionne, enh, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D69917
* [ThinLTO] Promotion handling cleanup (NFC)Teresa Johnson2019-11-182-26/+15
| | | | | | | | | | | | | | | | | | | | | Summary: Clean up the code that does GV promotion in the ThinLTO backends. Specifically, we don't need to check whether we are importing since that is already checked and handled correctly in shouldPromoteLocalToGlobal. Simply call shouldPromoteLocalToGlobal, and if it returns true we are guaranteed that we are promoting, whether or not we are importing (or in the exporting module). This also makes the handling in getName() consistent with that in getLinkage(), which checks the DoPromote parameter regardless of whether we are importing or exporting. Reviewers: steven_wu, pcc, evgeny777 Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70327
* [X86] Add AMD Matisse (znver2) model number to getHostCPUName and ↵Craig Topper2019-11-182-4/+4
| | | | | | | | | | compiler-rt's getAMDProcessorTypeAndSubtype. This is the CPUID model used on Ryzen 3000 series (Zen 2/Matisse) CPUs. Patch by Alex James Differential Revision: https://reviews.llvm.org/D70279
* Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))Pierre Habouzit2019-11-1824-50/+1024
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __attribute__((objc_direct)) is an attribute on methods declaration, and __attribute__((objc_direct_members)) on implementation, categories or extensions. A `direct` property specifier is added (@property(direct) type name) These attributes / specifiers cause the method to have no associated Objective-C metadata (for the property or the method itself), and the calling convention to be a direct C function call. The symbol for the method has enforced hidden visibility and such direct calls are hence unreachable cross image. An explicit C function must be made if so desired to wrap them. The implicit `self` and `_cmd` arguments are preserved, however to maintain compatibility with the usual `objc_msgSend` semantics, 3 fundamental precautions are taken: 1) for instance methods, `self` is nil-checked. On arm64 backends this typically adds a single instruction (cbz x0, <closest-ret>) to the codegen, for the vast majority of the cases when the return type is a scalar. 2) for class methods, because the class may not be realized/initialized yet, a call to `[self self]` is emitted. When the proper deployment target is used, this is optimized to `objc_opt_self(self)`. However, long term we might want to emit something better that the optimizer can reason about. When inlining kicks in, these calls aren't optimized away as the optimizer has no idea that a single call is really necessary. 3) the calling convention for the `_cmd` argument is changed: the caller leaves the second argument to the call undefined, and the selector is loaded inside the body when it's referenced only. As far as error reporting goes, the compiler refuses: - making any overloads direct, - making an overload of a direct method, - implementations marked as direct when the declaration in the interface isn't (the other way around is allowed, as the direct attribute is inherited from the declaration), - marking methods required for protocol conformance as direct, - messaging an unqualified `id` with a direct method, - forming any @selector() expression with only direct selectors. As warnings: - any inconsistency of direct-related calling convention when @selector() or messaging is used, - forming any @selector() expression with a possibly direct selector. Lastly an `objc_direct_members` attribute is added that can decorate `@implementation` blocks and causes methods only declared there (and in no `@interface`) to be automatically direct. When decorating an `@interface` then all methods and properties declared in this block are marked direct. Radar-ID: rdar://problem/2684889 Differential Revision: https://reviews.llvm.org/D69991 Reviewed-By: John McCall
* [LegalizeDAG] Convert strict fp nodes to libcalls without losing the chain.Craig Topper2019-11-185-398/+626
| | | | | | | | | | Previously we mutated the node and then converted it to a libcall. But this loses the chain information. This patch keeps the chain, but unfortunately breaks tail call optimization as the functions involved in deciding if a node is in tail call position can't handle the chain. But correct ordering seems more important to be right. Somehow the SystemZ tests improved. I looked at one of them and it seemed that we're handling the split vector elements in a different order and that made the copies work better. Differential Revision: https://reviews.llvm.org/D70334
* [LoopPred/WC] Use a dominating widenable condition to remove analyze loop exitsPhilip Reames2019-11-182-9/+964
| | | | | | | | | | | | This implements a version of the predicateLoopExits transform from IndVarSimplify extended to exploit widenable conditions - and thus be much wider in scope of legality. The code structure ends up being almost entirely different, so I chose to duplicate this into the LoopPredication pass instead of trying to reuse the code in the IndVars. The core notions of the transform are as follows: If we have a widenable condition which controls entry into the loop, we're allowed to widen it arbitrarily. Given that, it's simply a *profitability* question as to what conditions to fold into the widenable branch. To avoid pass ordering issues, we want to avoid widening cases that would otherwise be dischargeable. Or... widen in a form which can still be discharged. Thus, we phrase the transform as selecting one analyzeable exit from the set of analyzeable exits to keep. This avoids creating pass ordering complexities. Since none of the above proves that we actually exit through our analyzeable exits - we might exit through something else entirely - we limit ourselves to cases where a) the latch is analyzeable and b) the latch is predicted taken, and c) the exit being removed is statically cold. Differential Revision: https://reviews.llvm.org/D69830
* Reland: [Remarks][Driver] Use different remark files when targeting multiple ↵Francis Visoiu Mistrih2019-11-182-0/+27
| | | | | | | | | | | | | | | | | | architectures When the driver is targeting multiple architectures at once, for things like Universal Mach-Os, we need to emit different remark files for each cc1 invocation to avoid overwriting the files from a different invocation. For example: $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h will create two remark files: * foo-x86_64.opt.yaml * foo-x86_64h.opt.yaml
* [PowerPC] Test case for vector float gather on ppc64le and ppc64Stefan Pintilie2019-11-181-0/+53
| | | | | | | | | | Test case to verify that the expected code is generated for a vector float gather based on the patterns in tablegen for big and little endian cases. Patch by: Kamau Bridgeman Differential Revision: https://reviews.llvm.org/D69443
* Revert "[Remarks][Driver] Use different remark files when targeting multiple ↵Reid Kleckner2019-11-182-24/+0
| | | | | | | | architectures" This reverts commit b4e2b112b58154a89171df39dae80044865ff4ff. Test doesn't appear to pass on Windows, maybe all non-Mac.
* Temporarily Revert "Add support for options -frounding-math, ftrapping-math, ↵Eric Christopher2019-11-1821-731/+176
| | | | | | | | -ffp-model=, and -ffp-exception-behavior=" and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread. This reverts commits af57dbf12e54f3a8ff48534bf1078f4de104c1cd and e6584b2b7b2de06f1e59aac41971760cac1e1b79
* Allocate builtins table earlier to fix bug found by ubsanReid Kleckner2019-11-181-1/+2
| | | | Follow up to 979da9a4c3ba
* [Remarks][Driver] Use different remark files when targeting multiple ↵Francis Visoiu Mistrih2019-11-182-0/+24
| | | | | | | | | | | | | | | | | | architectures When the driver is targeting multiple architectures at once, for things like Universal Mach-Os, we need to emit different remark files for each cc1 invocation to avoid overwriting the files from a different invocation. For example: $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h will create two remark files: * foo-x86_64.opt.yaml * foo-x86_64h.opt.yaml
* [builtins] Implement rounding mode support for i386/x86_64Yi Kong2019-11-184-2/+44
| | | | Differential Revision: https://reviews.llvm.org/D69870
* [Signal] Allow llvm clients to opt into one-shot SIGPIPE handlingVedant Kumar2019-11-187-30/+63
| | | | | | | | | | | | | | | | | | | | Allow clients of the llvm library to opt-in to one-shot SIGPIPE handling, instead of forcing them to undo llvm's SIGPIPE handler registration (which is brittle). The current behavior is preserved for all llvm-derived tools (except lldb) by means of a default-`true` flag in the InitLLVM constructor. This prevents "IO error" crashes in long-lived processes (lldb is the motivating example) which both a) load llvm as a dynamic library and b) *really* need to ignore SIGPIPE. As llvm signal handlers can be installed when calling into libclang (say, via RemoveFileOnSignal), thereby overriding a previous SIG_IGN for SIGPIPE, there is no clean way to opt-out of "exit-on-SIGPIPE" in the current model. Differential Revision: https://reviews.llvm.org/D70277
* [libomptarget][nfc] Move some source into common from nvptxJon Chesterfield2019-11-1810-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move some source into common from nvptx Moves some source that compiles cleanly under amdgcn into a common subdirectory Includes some non-trivial files and some headers. Keeps the cuda file extension. The build systems for different architectures seem unlikely to have much in common. The idea is therefore to set include paths such that files under common/src compile as if they were under arch/src as the mechanism for sharing. In particular, files under common/src need to be able to include target_impl.h. The corresponding -Icommon is left out in favour of explicit includes on the basis that the it makes it clearer which files under common are used by a given architecture. Reviewers: jdoerfert, ABataev, grokos Reviewed By: ABataev Subscribers: jfb, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D70328
* Fix shared lib build.Michael Liao2019-11-182-2/+4
|
* Replace bitfield in lldb::Type with byte-sized members. (NFC)Adrian Prantl2019-11-185-89/+74
| | | | | | Due to alginment and packing using separate members takes up the same amount of space, but makes it far less cumbersome to deal with it in constructors etc.
* [cmake] Factor out DEFAULT_SANITIZER_MIN_OSX_VERSIONJulian Lettner2019-11-181-6/+8
|
* Bump sanitizer iOS deployment target to 9.0Julian Lettner2019-11-181-1/+1
| | | | | | | | | | | | | Bump default value for `-miphoneos-version-min=x` to 9.0 (from 8.0). TSan tests that use thread local storage `__thread` (e.g., tls_race.cpp) are failing to link for the iOS simulator (arch=x86_64 and -miphoneos-version-min=8.0) on internal/master (will be submitted to Glacier train): ``` ld: targeted OS version does not support use of thread local variables in _main for architecture x86_64 ``` iOS 9.0 was released 2015.
* Bump sanitizer macOS deployment target to 10.10Julian Lettner2019-11-181-4/+4
| | | | | | | | | | | | Bump default value for `SANITIZER_MIN_OSX_VERSION` to 10.10 (from 10.9). TSan does not work on macOS 10.9 and a nice error message is preferable to an "unreferenced symbol" error when loading the TSan runtime. We could try to only bump the deployment target for TSan, but we would have to invest into adding support for this to our CMake build and it does not seem worth it. macOS 10.10 was released in 2014. rdar://31335781
* [Docs] Add Python caveats under the development sectionJonas Devlieghere2019-11-183-0/+43
| | | | | | | | | | | This adds a page named Caveats with a section on some of the things to be aware of related to Python. It's a question we've seen more than once pop up and I think it's good to have it documentation on the website. Even though some of it might be useful to users, I still put it under "development" because it requires some understanding of how LLDB is built. Differential revision: https://reviews.llvm.org/D70252
* [yaml2obj][test] Move tests to binary format specific subdirectoriesFangrui Song2019-11-1886-102/+93
| | | | | | | | | | | | | | | | | | Create COFF/, ELF/, and Minidump and move tests there. Also * Rename `*.test` to `*.yaml` * For yaml2obj RUN lines, use `-o %t` instead of `> %t` for consistency. We still have tests that check stdout is the default output, e.g. multi-doc.test * Update tests to consistently use `##` for comments. `#` is for RUN and CHECK lines. * Merge symboless-relocation.yaml and invalid-symboless-relocation.yaml to ELF/relocation-implicit-symbol-index.test Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D70264
* [Attr] Fix `-ast-print` for `asm` attributeJoel E. Denny2019-11-182-5/+11
| | | | | | | | | | | | | | | | Without this fix, the tests introduced here produce the following assert fail: ``` clang: /home/jdenny/llvm/clang/include/clang/Basic/AttributeCommonInfo.h:163: unsigned int clang::AttributeCommonInfo::getAttributeSpellingListIndex() const: Assertion `(isAttributeSpellingListCalculated() || AttrName) && "Spelling cannot be found"' failed. ``` The bug was introduced by D67368, which caused `AsmLabelAttr`'s spelling index to be set to `SpellingNotCalculated`. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D70349
* [dwarfgen] Fix initialization order error. [NFCI]Francesco Petrogalli2019-11-181-3/+3
| | | | This commit fixes the `-Werror=reorder` builds.
* [OPENMP50]Fix PR44024: runtime assert in distribute construct.Alexey Bataev2019-11-182-1/+18
| | | | | If the code is emitted for distribute construct, the nonmonotonic modifier should not be added.
* [ASan] Mark test as UNSUPPORTED for iOS simulatorJulian Lettner2019-11-181-0/+1
| | | | | | coverage-fork.cpp uses `fork()` which requires additional permissions in the iOS simulator sandbox. We cannot use `sandbox-exec` to grant these permissions since this is a Posix (not Darwin) test.
* gn build: Merge 2054ed052f1LLVM GN Syncbot2019-11-181-0/+1
|
* [clangd] Store xref for Macros in ParsedAST.Utkarsh Saxena2019-11-186-8/+146
| | | | | | | This patch adds the cross references for Macros in the MainFile. We add references for the main file to the ParsedAST. We query the references from it using the SymbolID. Xref outside main file will be added to the index in a separate patch.
* [NFC] Clean up debug-names-verify-completeness.s testPavel Labath2019-11-181-179/+157
| | | | | | | This patch replaces the tabs by spaces and avoid the need for a debug_str section by moving all strings inline. It also removes the hardcoded DIE offsets in the test, which will simplify a follow-up patch.
* [clangd] Implement rename by using SelectionTree and findExplicitReferences.Haojian Wu2019-11-182-46/+462
| | | | | | | | | | | | | | | | | | | | | | | Summary: With the new implemenation, we will have better coverage of various AST nodes, and fix some known/potential bugs. Also added the existing clang-renamae tests. Known changed behavior: - "~Fo^o()" will not trigger the rename, will fix afterwards - references in macro bodies are not renamed now This fixes: - https://github.com/clangd/clangd/issues/167 - https://github.com/clangd/clangd/issues/169 - https://github.com/clangd/clangd/issues/171 Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69934
* [NFC] Fix test reserve_global_reg.ll after 2d739f9Russell Gallop2019-11-181-0/+1
|
* Revert "[DWARF5]Addition of alignment atrribute in typedef DIE."Sam McCall2019-11-189-106/+14
| | | | | This reverts commit 423f541c1a322963cf482683fe9777ef0692082d, which breaks llvm-c ABI.
* arm64_32: support function return in FastISel.Tim Northover2019-11-183-13/+52
|
* Re-commit "DWARF location lists: Add section index dumping"Pavel Labath2019-11-1814-53/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies c0f6ad7d1f3ccb9d0b9ce9ef8dfa06409ccf1b3e with an additional fix in test/DebugInfo/X86/constant-loclist.ll, which had a slightly different output on windows targets. The test now accounts for this difference. The original commit message follows. Summary: As discussed in D70081, this adds the ability to dump section names/indices to the location list dumper. It does this by moving the range specific logic from DWARFDie.cpp:dumpRanges into the DWARFAddressRange class. The trickiest part of this patch is the backflip in the meanings of the two dump flags for the location list sections. The dumping of "raw" location list data is now controlled by "DisplayRawContents" flag. This frees up the "Verbose" flag to be used to control whether we print the section index. Additionally, the DisplayRawContents flag is set for section-based dumps whenever the --verbose option is passed, but this is not done for the "inline" dumps. Also note that the index dumping currently does not work for the DWARF v5 location lists, as the parser does not fill out the appropriate fields. This will be done in a separate patch. Reviewers: dblaikie, probinson, JDevlieghere, SouraVX Subscribers: sdardis, hiraditya, jrtc27, atanasyan, arphaman, aprantl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70227
* [AMDGPU][MC][GFX10] Enabled v_movrel*[sdwa|dpp|dpp8] opcodesDmitry Preobrazhensky2019-11-188-43/+235
| | | | | | | | See https://bugs.llvm.org/show_bug.cgi?id=43712 Reviewers: arsenm, rampitec Differential Revision: https://reviews.llvm.org/D70170
* [clangd] Fix some clang-tidy warnings on SourceCodeTests.cpp, NFC.Haojian Wu2019-11-181-9/+8
|
* [lldb] Fix JSON parser to allow empty arraysAlex Cameron2019-11-184-3/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=39405 ``` alexc@kitty:~/work/wiredtiger/build_posix$ cat breakpoint.json [{"Breakpoint" : {"BKPTOptions" : {"AutoContinue" : false,"ConditionText" : "","EnabledState" : true,"IgnoreCount" : 0,"OneShotState" : false},"BKPTResolver" : {"Options" : {"NameMask" : [56],"Offset" : 0,"SkipPrologue" : true,"SymbolNames" : ["__wt_btcur_search"]},"Type" : "SymbolName"},"Hardware" : false,"SearchFilter" : {"Options" : {},"Type" : "Unconstrained","Foo" : []}}}] ``` **Before** ``` (lldb) breakpoint read --file breakpoint.json error: Invalid JSON from input file: /home/alexc/work/wiredtiger/build_posix/breakpoint.json. ``` **After** ``` (lldb) breakpoint read --file breakpoint.json New breakpoints: Breakpoint 1: where = libwiredtiger-3.2.2.so`__wt_btcur_search + 15 at bt_cursor.c:522:5, address = 0x00007ffff576ab2f ``` Reviewers: xbolva00, davide, labath Reviewed By: davide, labath Subscribers: mgorny, jingham, labath, davide, JDevlieghere, lldb-commits Tags: #llvm, #lldb Differential Revision: https://reviews.llvm.org/D68179
* Remove useless param tag to fix Wdocumentation warning. NFCI.Simon Pilgrim2019-11-181-3/+0
|
* [clangd] Fix diagnostic warnings in the RenameTests, NFC.Haojian Wu2019-11-181-2/+4
|
* Fix cppcheck shadow variable warning. NFC.Simon Pilgrim2019-11-181-3/+3
|
* llvm-objcopy - fix uninitialized variable warnings. NFC.Simon Pilgrim2019-11-182-18/+18
|
* Avoid duplicate exe_path definition on recent FreeBSDEd Maste2019-11-181-1/+0
|
* [OpenMP] Add implementation and tests of Archer toolprotze@itc.rwth-aachen.de2019-11-1838-0/+2551
| | | | | | | | | | The tool provides TSAN annotations for OpenMP synchronization. The tool is activated if no other OMPT tool is loaded. The tool detects whether the application was built with TSan and rejects activation according to the OMPT protocol if there is no TSan-rt. Differential Revision: https://reviews.llvm.org/D45890
* Revert rGc0f6ad7d1f3c : "DWARF location lists: Add section index dumping"Simon Pilgrim2019-11-1813-56/+48
| | | | This reverts commit c0f6ad7d1f3ccb9d0b9ce9ef8dfa06409ccf1b3e to fix the buildbots.
* DwarfGenerator - fix uninitialized variable warnings. NFC.Simon Pilgrim2019-11-181-1/+2
|
OpenPOWER on IntegriCloud