summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Implement P1301R4, which allows specifying an optional message on the ↵Aaron Ballman2019-07-2010-22/+90
| | | | | | | | [[nodiscard]] attribute. This also bumps the attribute feature test value and introduces the notion of a C++2a extension warning. llvm-svn: 366626
* [WebAssembly] Compute and export TLS block alignmentGuanzhong Chen2019-07-193-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add immutable WASM global `__tls_align` which stores the alignment requirements of the TLS segment. Add `__builtin_wasm_tls_align()` intrinsic to get this alignment in Clang. The expected usage has now changed to: __wasm_init_tls(memalign(__builtin_wasm_tls_align(), __builtin_wasm_tls_size())); Reviewers: tlively, aheejin, sbc100, sunfish, alexcrichton Reviewed By: tlively Subscribers: dschuff, jgravelle-google, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65028 llvm-svn: 366624
* [LTO] Always mark regular LTO units with EnableSplitLTOUnit=1Teresa Johnson2019-07-192-1/+13
| | | | | | | | | | | | | | | | | | | Summary: Regular LTO modules do not need LTO Unit splitting, only ThinLTO does (they must be consistently split into regular and Thin units for optimizations such as whole program devirtualization and lower type tests). In order to avoid spurious errors from LTO when combining with split ThinLTO modules, always set this flag for regular LTO modules. Reviewers: pcc Subscribers: mehdi_amini, Prazek, inglorion, steven_wu, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65009 llvm-svn: 366623
* [NFC] Remove unused variableDenis Bakhvalov2019-07-191-1/+1
| | | | | Change-Id: I5aee24dcdf6eebfbf788e52be22463387f23d927 llvm-svn: 366620
* Disallow most calling convention attributes on PS4Sunil Srivastava2019-07-196-0/+57
| | | | | | | | PS4 now only allows "cdecl", and its equivalent on PS4, "sysv_abi". Differential Revision: https://reviews.llvm.org/D64780 llvm-svn: 366617
* [Format/ObjC] Avoid breaking between unary operators and operandsBen Hamilton2019-07-192-0/+14
| | | | | | | | | | | | | | | | | | | | Summary: Test Plan: New tests added. Ran tests with: % ninja FormatTests && ./tools/clang/unittests/Format/FormatTests Confirmed tests failed before change and passed after change. Reviewers: krasimir, djasper, sammccall, klimek Reviewed By: sammccall Subscribers: klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64775 llvm-svn: 366592
* [OpenCL] Define CLK_NULL_EVENT without castSven van Haastregt2019-07-192-2/+3
| | | | | | | | | | | | | | Defining CLK_NULL_EVENT with a `(void*)` cast has the (unintended?) side-effect that the address space will be fixed (as generic in OpenCL 2.0 mode). The consequence is that any target specific address space for the clk_event_t type will not be applied. It is not clear why the void pointer cast was needed in the first place, and it seems we can do without it. Differential Revision: https://reviews.llvm.org/D63876 llvm-svn: 366546
* [sanitizers] Use covering ObjectFormatType switchesHubert Tong2019-07-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes the `default` case from some switches on `llvm::Triple::ObjectFormatType`, and cases for the missing enumerators (`UnknownObjectFormat`, `Wasm`, and `XCOFF`) are then added. For `UnknownObjectFormat`, the effect of the action for the `default` case is maintained; otherwise, where `llvm_unreachable` is called, `report_fatal_error` is used instead. Where the `default` case returns a default value, `report_fatal_error` is used for XCOFF as a placeholder. For `Wasm`, the effect of the action for the `default` case in maintained. The code is structured to avoid strongly implying that the `Wasm` case is present for any reason other than to make the switch cover all `ObjectFormatType` enumerator values. Reviewers: sfertile, jasonliu, daltenty Reviewed By: sfertile Subscribers: hiraditya, aheejin, sunfish, llvm-commits, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D64222 llvm-svn: 366544
* Fix formatting of inline argument comments. NFC.Sam Clegg2019-07-191-7/+6
| | | | | | | | | Also, remove the final arg from ItaniumCXXABI in the PNaCl case since its not needed. Differential Revision: https://reviews.llvm.org/D64955 llvm-svn: 366518
* Update the SimpleJIT class in the clang-interpreter example to use ORCv2.Lang Hames2019-07-181-44/+53
| | | | | | This will remove the ORCv1 deprecation warnings. llvm-svn: 366511
* [clang-scan-deps] Dependency directives source minimizer: handle #pragma onceAlex Lorenz2019-07-183-1/+40
| | | | | | | | | We should re-emit `#pragma once` to ensure the preprocessor will still honor it when running on minimized sources. Differential Revision: https://reviews.llvm.org/D64945 llvm-svn: 366509
* [WebAssembly] Fix __builtin_wasm_tls_base intrinsicGuanzhong Chen2019-07-181-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Properly generate the outchain for the `__builtin_wasm_tls_base` intrinsic. Also marked the intrinsic pure, per @sunfish's suggestion. Reviewers: tlively, aheejin, sbc100, sunfish Reviewed By: tlively Subscribers: dschuff, jgravelle-google, hiraditya, cfe-commits, llvm-commits, sunfish Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D64949 llvm-svn: 366499
* [OPENMP]Fix sharing of threadprivate variables with TLS support.Alexey Bataev2019-07-182-4/+30
| | | | | | | | | If the threadprivate variable is used in the copyin clause on inner parallel directive with TLS support, we capture this variable in all outer OpenMP scopes. It leads to the fact that in all scopes we're working with the original variable, not the threadprivate copies. llvm-svn: 366483
* [RISCV] Hard float ABI supportAlex Bradbury2019-07-1814-33/+1474
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The RISC-V hard float calling convention requires the frontend to: * Detect cases where, once "flattened", a struct can be passed using int+fp or fp+fp registers under the hard float ABI and coerce to the appropriate type(s) * Track usage of GPRs and FPRs in order to gate the above, and to determine when signext/zeroext attributes must be added to integer scalars This patch attempts to do this in compliance with the documented ABI, and uses ABIArgInfo::CoerceAndExpand in order to do this. @rjmccall, as author of that code I've tagged you as reviewer for initial feedback on my usage. Note that a previous version of the ABI indicated that when passing an int+fp struct using a GPR+FPR, the int would need to be sign or zero-extended appropriately. GCC never did this and the ABI was changed, which makes life easier as ABIArgInfo::CoerceAndExpand can't currently handle sign/zero-extension attributes. Re-landed after backing out 366450 due to missed hunks. Differential Revision: https://reviews.llvm.org/D60456 llvm-svn: 366480
* [WebAssembly] Implement __builtin_wasm_tls_base intrinsicGuanzhong Chen2019-07-183-0/+10
| | | | | | | | | | | | | | | | Summary: Add `__builtin_wasm_tls_base` so that LeakSanitizer can find the thread-local block and scan through it for memory leaks. Reviewers: tlively, aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D64900 llvm-svn: 366475
* [OPENMP]Provide correct data sharing attributes for loop controlAlexey Bataev2019-07-1821-105/+130
| | | | | | | | | | | | variables. Loop control variables are private in loop-based constructs and we shall take this into account when generate the code for inner constructs. Currently, those variables are reported as shared in many cases. Moved the analysis of the data-sharing attributes of the loop control variable to an early semantic stage to correctly handle their attributes. llvm-svn: 366474
* [LibTooling] Relax Transformer to allow rewriting macro expansionsYitzhak Mandelbaum2019-07-182-56/+108
| | | | | | | | | | | | | | | | | | | | Summary: Currently, Transformer rejects any changes to source locations inside macro expansions. This change relaxes that constraint to allow rewrites when the entirety of the expansion is replaced, since that can be mapped to replacing the entirety of the expansion range in the file source. This change makes Transformer consistent with the handling of edit ranges in `clang::edit::Commit` (which is used, for example, for applying `FixItHint`s from diagnostics). Reviewers: ilya-biryukov Subscribers: gribozavr, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64518 llvm-svn: 366473
* [LibTooling] Add function to translate and validate source range for editingYitzhak Mandelbaum2019-07-183-2/+155
| | | | | | | | | | | | | | | | | Summary: Adds the function `getRangeForEdit` to validate that a given source range is editable and, if needed, translate it into a range in the source file (for example, if it's sourced in macro expansions). Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64924 llvm-svn: 366469
* [ASTUnit] Attempt to unbreak Windows buildbots after r366448Ilya Biryukov2019-07-181-2/+2
| | | | llvm-svn: 366457
* Revert "[RISCV] Hard float ABI support" r366450Alex Bradbury2019-07-1813-1462/+21
| | | | | | The commit was missing a few hunks. Will fix and recommit. llvm-svn: 366454
* Revert r366449: [CrossTU] Add a function to retrieve original source location.Ilya Biryukov2019-07-186-162/+25
| | | | | | | | Reason: the commit breaks layering by adding a dependency on ASTUnit (which is inside clangFrontend) from the ASTImporter (which is inside clangAST). llvm-svn: 366453
* [RISCV] Hard float ABI supportAlex Bradbury2019-07-1813-21/+1462
| | | | | | | | | | | | | | | | | | | | | | | | | | The RISC-V hard float calling convention requires the frontend to: * Detect cases where, once "flattened", a struct can be passed using int+fp or fp+fp registers under the hard float ABI and coerce to the appropriate type(s) * Track usage of GPRs and FPRs in order to gate the above, and to determine when signext/zeroext attributes must be added to integer scalars This patch attempts to do this in compliance with the documented ABI, and uses ABIArgInfo::CoerceAndExpand in order to do this. @rjmccall, as author of that code I've tagged you as reviewer for initial feedback on my usage. Note that a previous version of the ABI indicated that when passing an int+fp struct using a GPR+FPR, the int would need to be sign or zero-extended appropriately. GCC never did this and the ABI was changed, which makes life easier as ABIArgInfo::CoerceAndExpand can't currently handle sign/zero-extension attributes. Differential Revision: https://reviews.llvm.org/D60456 llvm-svn: 366450
* [CrossTU] Add a function to retrieve original source location.Balazs Keri2019-07-186-25/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A new function will be added to get the original SourceLocation for a SourceLocation that was imported as result of getCrossTUDefinition. The returned SourceLocation is in the context of the (original) SourceManager for the original source file. Additionally the ASTUnit object for that source file is returned. This is needed to get a SourceManager to operate on with the returned source location. The new function works if multiple different source files are loaded with the same CrossTU context. This patch can be treated as part of a bigger change that is needed to improve macro expansion handliong at plist generation. Reviewers: martong, shafik, a_sidorin, xazax.hun Reviewed By: martong Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64554 llvm-svn: 366449
* [ASTUnit] Fix a regression in cached completionsIlya Biryukov2019-07-182-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After r345152 cached completions started adding namespaces after nested name specifiers, e.g. in `some_name::^` The CCC_Symbol indicates the completed item cannot be a namespace (it is described as being "a type, a function or a variable" in the comments). Therefore, 'nested specifier' completions should only be added from cache when the context is CCC_SymbolOrNewName (which roughly seems to indicate that a nested name specifier is allowed). Fixes https://bugs.llvm.org/show_bug.cgi?id=42646 Reviewers: kadircet, sammccall Reviewed By: kadircet, sammccall Subscribers: arphaman, nik, sammccall, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64918 llvm-svn: 366448
* [CMake] Don't set Python_ADDITIONAL_VERSIONSJonas Devlieghere2019-07-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's Python support to 2.7. Now that both LLVM and LLDB both support Python 3, there's no longer a need to put an arbitrary limit on this. However, instead of removing the variable, r365692 expanded the list, which has the (presumably unintentional) side-effect of expression preference for Python 3. Instead, as Michal proposed in the original code review, we should just not set the list at all, and let CMake pick whatever Python interpreter you have in your path. This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm, clang and lld. I've also updated the docs with the default behavior and how to force a different Python version to be used. Differential revision: https://reviews.llvm.org/D64894 llvm-svn: 366447
* [analyzer] Add CTU user docsGabor Marton2019-07-182-0/+207
| | | | | | | | | | | | Reviewers: dkrupp, a_sidorin, Szelethus, NoQ Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, gamesh411, Charusso, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64801 llvm-svn: 366439
* [OPENMP][NVPTX]Mark barrier functions calls as convergent.Alexey Bataev2019-07-182-6/+9
| | | | | | | Added convergent attribute to the barrier functions calls for correct optimizations. llvm-svn: 366437
* Revert r366422: [OpenCL] Improve destructor support in C++ for OpenCLIlya Biryukov2019-07-1814-234/+113
| | | | | | | | Reason: this commit causes crashes in the clang compiler when building LLVM Support with libc++, see https://bugs.llvm.org/show_bug.cgi?id=42665 for details. llvm-svn: 366429
* Bump the trunk version to 10.0.0svnHans Wennborg2019-07-182-53/+18
| | | | | | and clear the release notes. llvm-svn: 366427
* [OpenCL] Improve destructor support in C++ for OpenCLMarco Antognini2019-07-1814-113/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch does mainly three things: 1. It fixes a false positive error detection in Sema that is similar to D62156. The error happens when explicitly calling an overloaded destructor for different address spaces. 2. It selects the correct destructor when multiple overloads for address spaces are available. 3. It inserts the expected address space cast when invoking a destructor, if needed, and therefore fixes a crash due to the unmet assertion in llvm::CastInst::Create. The following is a reproducer of the three issues: struct MyType { ~MyType() {} ~MyType() __constant {} }; __constant MyType myGlobal{}; kernel void foo() { myGlobal.~MyType(); // 1 and 2. // 1. error: cannot initialize object parameter of type // '__generic MyType' with an expression of type '__constant MyType' // 2. error: no matching member function for call to '~MyType' } kernel void bar() { // 3. The implicit call to the destructor crashes due to: // Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed. // in llvm::CastInst::Create. MyType myLocal; } The added test depends on D62413 and covers a few more things than the above reproducer. Subscribers: yaxunl, Anastasia, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64569 llvm-svn: 366422
* [OpenCL] Update comments/diagnostics to refer to C++ for OpenCLAnastasia Stulova2019-07-1817-45/+43
| | | | | | | | | Clang doesn't implement OpenCL C++, change the comments to reflect that. Differential Revision: https://reviews.llvm.org/D64867 llvm-svn: 366421
* [OpenCL][PR42033] Fix addr space deduction with template parametersAnastasia Stulova2019-07-185-10/+23
| | | | | | | | | | | | | | | If dependent types appear in pointers or references we allow addr space deduction because the addr space in template argument will belong to the pointee and not the pointer or reference itself. We also don't diagnose addr space on a function return type after template instantiation. If any addr space for the return type was provided on a template parameter this will be diagnosed during the parsing of template definition. Differential Revision: https://reviews.llvm.org/D62584 llvm-svn: 366417
* [CodeComplete] Fix ASTUnit cached completion of macros from preamble, broken ↵Sam McCall2019-07-183-4/+6
| | | | | | | | | | | | | | | | | | in r342528 Summary: The problem is the default LoadExternal with no completer, which happens when loading global results. Reviewers: ilya-biryukov, nik Subscribers: arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64864 llvm-svn: 366409
* [PowerPC][Clang] Remove use of malloc in mm_mallocQiu Chaofan2019-07-183-44/+8
| | | | | | | | | | | Remove dependency of malloc in implementation of mm_malloc function in PowerPC intrinsics and alignment assumption on glibc. Reviewed By: Hal Finkel Differential Revision: https://reviews.llvm.org/D64850 llvm-svn: 366406
* [analyzer] MallocChecker: Prevent Integer Set Library false positivesCsaba Dabis2019-07-182-1/+75
| | | | | | | | | | | | | | Summary: Integer Set Library using retain-count based allocation which is not modeled in MallocChecker. Reviewed By: NoQ Tags: #clang Differential Revision: https://reviews.llvm.org/D64680 llvm-svn: 366391
* hwasan: Initialize the pass only once.Peter Collingbourne2019-07-171-28/+10
| | | | | | | | | | This will let us instrument globals during initialization. This required making the new PM pass a module pass, which should still provide access to analyses via the ModuleAnalysisManager. Differential Revision: https://reviews.llvm.org/D64843 llvm-svn: 366379
* Renamed and changed the wording of warn_cconv_ignoredSunil Srivastava2019-07-1717-65/+65
| | | | | | | | As discussed in D64780 the wording of this warning message is being changed to say 'is not supported' instead of 'ignored', and the diag ID itself is being changed to warn_cconv_not_supported. llvm-svn: 366368
* [OPENMP]Fix PR42632: crash on the analysis of the OpenMP constructs.Alexey Bataev2019-07-172-0/+16
| | | | | | | Fixed processing of the CapturedStmt children to fix the crash of the OpenMP constructs during analysis. llvm-svn: 366357
* Revert [AArch64] Add support for Transactional Memory Extension (TME)Momchil Velikov2019-07-1710-99/+1
| | | | | | This reverts r366322 (git commit 4b8da3a503e434ddbc08ecf66582475765f449bc) llvm-svn: 366355
* [Docs][OpenCL] Documentation of C++ for OpenCL modeAnastasia Stulova2019-07-172-1/+310
| | | | | | | | | Added documentation of C++ for OpenCL mode into Clang User Manual and Language Extensions document. Differential Revision: https://reviews.llvm.org/D64418 llvm-svn: 366351
* [OPENMP]Fix crash in LoopCounterRefChecker when MemberExpr is not Var or FieldMike Rice2019-07-172-1/+10
| | | | | | | | | | checkDecl is only valid for VarDecls or FieldDecls, since getCanonicalDecl expects only these. Prevent other Decl kinds (such as CXXMethodDecls and EnumConstantDecls) from entering and asserting. Differential Revision: https://reviews.llvm.org/D64842 llvm-svn: 366336
* [ASTImporter] Fix structural eq of lambdasGabor Marton2019-07-173-0/+88
| | | | | | | | | | | | | | | | | | Summary: The structural equivalence check reported false eq between lambda classes with different parameters in their call signature. The solution is to check the methods for equality too in case of lambda classes. Reviewers: a_sidorin, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64075 llvm-svn: 366332
* [ASTImporter] Fix LLDB lookup in transparent ctx and with ext srcGabor Marton2019-07-172-7/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With LLDB we use localUncachedLookup(), however, that fails to find Decls when a transparent context is involved and the given DC has external lexical storage. The solution is to use noload_lookup, which works well with transparent contexts. But, we cannot use only the noload_lookup since the slow case of localUncachedLookup is still needed in some other cases. These other cases are handled in ASTImporterLookupTable, but we cannot use that with LLDB since that traverses through the AST which initiates the load of external decls again via DC::decls(). We must avoid loading external decls during the import becuase ExternalASTSource is implemented with ASTImporter, so external loads during import results in uncontrolled and faulty import. Reviewers: shafik, teemperor, jingham, clayborg, a_sidorin, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits, lldb-commits Tags: #clang, #lldb Differential Revision: https://reviews.llvm.org/D61333 llvm-svn: 366325
* [AArch64] Add support for Transactional Memory Extension (TME)Momchil Velikov2019-07-1710-1/+99
| | | | | | | | | | | | | | | | | | | | | | | TME is a future architecture technology, documented in https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools https://developer.arm.com/docs/ddi0601/a More about the future architectures: https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/new-technologies-for-the-arm-a-profile-architecture This patch adds support for the TME instructions TSTART, TTEST, TCOMMIT, and TCANCEL and the target feature/arch extension "tme". It also implements TME builtin functions, defined in ACLE Q2 2019 (https://developer.arm.com/docs/101028/latest) Patch by Javed Absar and Momchil Velikov Differential Revision: https://reviews.llvm.org/D64416 llvm-svn: 366322
* [AArch64] Consistent types and naming for AArch64 target features (NFC)Momchil Velikov2019-07-172-24/+25
| | | | | | | | Differential Revision: https://reviews.llvm.org/D64415 Committed as obvious. llvm-svn: 366315
* [OpenCL][Sema] Minor refactoring and constraint checkingMarco Antognini2019-07-171-9/+4
| | | | | | | | | | | | | | Summary: Simplify code a bit and add assertion to address post-landing comments from D64083. Subscribers: yaxunl, Anastasia, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64804 llvm-svn: 366306
* [Driver] Enable __cxa_atexit on SolarisRainer Orth2019-07-173-3/+2
| | | | | | | | | | | | | | | | | | | Starting with Solaris 11.4 (which is now the required minimal version), Solaris does support __cxa_atexit. This patch reflects that. One might consider removing the affected tests altogether instead of inverting them, as is done on other targets. Besides, this lets two ASan tests PASS: AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64491 llvm-svn: 366305
* AMDGPU: Add some missing builtinsMatt Arsenault2019-07-176-0/+144
| | | | llvm-svn: 366286
* Fix OpenCLCXX test on 32-bit Windows where thiscall is presentReid Kleckner2019-07-161-6/+6
| | | | llvm-svn: 366284
* Fix darwin-ld.c if dsymutil.exe exists on PATHReid Kleckner2019-07-161-2/+2
| | | | llvm-svn: 366282
OpenPOWER on IntegriCloud