summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* When instantiating a friend function template, don't forget to inherit ↵Richard Smith2017-05-102-0/+29
| | | | | | default template arguments from other declarations. llvm-svn: 302603
* [ubsan] Mark overflow checks with !nosanitizeVedant Kumar2017-05-092-6/+6
| | | | | | | | | Sanitizer instrumentation generally needs to be marked with !nosanitize, but we're not doing this properly for ubsan's overflow checks. r213291 has more information about why this is needed. llvm-svn: 302598
* Don't mark a member as a member specialization until we know we're keeping ↵Richard Smith2017-05-096-52/+107
| | | | | | | | | | | | | | | | | | | | | | | | | the specialization. This improves our behavior in a few ways: * We now guarantee that if a member is marked as being a member specialization, there will actually be a member specialization declaration somewhere on its redeclaration chain. This fixes a crash in modules builds where we would try to check that there was a visible declaration of the member specialization and be surprised to not find any declaration of it at all. * We don't set the source location of the in-class declaration of the member specialization to the out-of-line declaration's location until we have actually finished merging them. This fixes some very silly looking diagnostics, where we'd point a "previous declaration is here" note at the same declaration we're complaining about. Ideally we wouldn't mess with the prior declaration's location at all, but too much code assumes that the first declaration of an entity is a reasonable thing to use as an indication of where it was declared, and that's not really true for a member specialization unless we fake it like this. llvm-svn: 302596
* Fix clang_cl argument in fsanitize.c driver test.Evgeniy Stepanov2017-05-091-2/+2
| | | | llvm-svn: 302594
* [Sema] Implement Core 2094: Trivial copy/move constructor for class with ↵Eric Fiselier2017-05-095-12/+38
| | | | | | | | | | | | | | | | volatile member Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32984 llvm-svn: 302593
* Update Clang C++ DR documentation for new issue listEric Fiselier2017-05-091-324/+360
| | | | llvm-svn: 302592
* [asan] A clang flag to enable ELF globals-gc.Evgeniy Stepanov2017-05-098-2/+40
| | | | | | | | | | | | This feature is subtly broken when the linker is gold 2.26 or earlier. See the following bug for details: https://sourceware.org/bugzilla/show_bug.cgi?id=19002 Since the decision needs to be made at compilation time, we can not test the linker version. The flag is off by default on ELF targets, and on otherwise. llvm-svn: 302591
* Remove unnecessary calls to MakeArgString.Evgeniy Stepanov2017-05-092-14/+14
| | | | llvm-svn: 302590
* Fix CGObjCGNU::init bug introduced by r302572Serge Guelton2017-05-091-2/+7
| | | | llvm-svn: 302588
* clang-format: [JS] Don't indent JavaScript IIFEs.Martin Probst2017-05-092-4/+42
| | | | | | | | | | | | | | | | Because IIFEs[1] are often used like an anonymous namespace around large sections of JavaScript code, it's useful not to indent to them (which effectively reduces the column limit by the indent amount needlessly). It's also common for developers to wrap these around entire files or libraries. When adopting clang-format, changing the indent entire file can reduce the usefulness of the blame annotations. Patch by danbeam, thanks! Differential Revision: https://reviews.llvm.org/D32989 llvm-svn: 302580
* Update testcase for upstream LLVM changes (r302469).Adrian Prantl2017-05-091-2/+4
| | | | llvm-svn: 302577
* Suppress all uses of LLVM_END_WITH_NULL. NFC.Serge Guelton2017-05-0918-298/+204
| | | | | | | | | | Use variadic templates instead of relying on <cstdarg> + sentinel. This enforces better type checking and makes code more readable. Differential revision: https://reviews.llvm.org/D32550 llvm-svn: 302572
* [WebAssembly] Fix failing wasm-toolchain testSam Clegg2017-05-091-3/+3
| | | | | | | | This test was broken in r302558. Differential Revision: https://reviews.llvm.org/D33015 llvm-svn: 302569
* [X86][LWP] Remove MSVC LWP intrinsics stubs.Simon Pilgrim2017-05-091-6/+0
| | | | | | Now provided in lwpintrin.h llvm-svn: 302559
* [WebAssembly] Fix location and -flavor when running lldSam Clegg2017-05-091-1/+4
| | | | | | | | | | | | | Add the toolchain installation directory to the program path so that lld can be found. Change -flavor to wasm. Although this new flavor hasn't yet landed in upstream lld yet there are no point in passing wasm objects the gnu flavor. Differential Revision: https://reviews.llvm.org/D32976 llvm-svn: 302558
* [X86][LWP] Removing LWP todo comment. NFCI.Simon Pilgrim2017-05-091-2/+0
| | | | | | LWP / lwpintrin.h is now supported llvm-svn: 302557
* Build the Apple-style stage2 with modulesAdrian Prantl2017-05-091-0/+1
| | | | | | | | | | | | | | | Green dragon had a green stage2 modules bot for a long time now[1] and it is time to retire it and make a modules build the default for Apple-style stage2 builds. This patch turns on LLVM_ENABLE_MODULES. [1] http://green.lab.llvm.org/green/job/clang-stage2-cmake-modulesRDA_build/ rdar://problem/28672159 Differential Revision: https://reviews.llvm.org/D32603 llvm-svn: 302556
* Revert r302547 ([mips] Impose a threshold for coercion of aggregates)Petar Jovanovic2017-05-092-46/+0
| | | | | | | | | | Reverting Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate structures only if the size of said aggregate is less than 16/64 bytes, depending on the ABI. as it broke clang-with-lto-ubuntu builder. llvm-svn: 302555
* [mips] Impose a threshold for coercion of aggregatesPetar Jovanovic2017-05-092-0/+46
| | | | | | | | | | | | Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate structures only if the size of said aggregate is less than 16/64 bytes, depending on the ABI. Patch by Stefan Maksimovic. Differential Revision: https://reviews.llvm.org/D32900 llvm-svn: 302547
* [CodeCompletion] Complete platform names in @available expressionsAlex Lorenz2017-05-094-0/+43
| | | | | | rdar://32074504 llvm-svn: 302545
* Revert r302476 "Update testcase for upstream LLVM changes."Hans Wennborg2017-05-091-4/+2
| | | | | | That test update was for r302469, which was reverted in r302533 due to PR32977. llvm-svn: 302542
* Add support for pretty platform names to `@available`/Alex Lorenz2017-05-097-27/+61
| | | | | | | | | | | | | `__builtin_available` This commit allows us to use the macOS/iOS/tvOS/watchOS platform names in `@available`/`__builtin_available`. rdar://32067795 Differential Revision: https://reviews.llvm.org/D33000 llvm-svn: 302540
* clang-format: [JS] keep triple slash directives intact.Martin Probst2017-05-092-3/+5
| | | | | | | | | | | | | | | | | | | Summary: TypeScript uses triple slash directives of the form: /// <reference path="..."/> For various non-source instructions that should not be wrapped. Reference: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32997 llvm-svn: 302523
* PR5935: Adjust documentation.Vassil Vassilev2017-05-091-2/+1
| | | | | | | | https://reviews.llvm.org/D31867 Patch by Johannes Altmanninger! llvm-svn: 302521
* Reland "Warn about unused static file scope function template declarations."Vassil Vassilev2017-05-095-13/+50
| | | | | | | This patch reinstates r299930, reverted in r299956, as a separate diagnostic option (-Wunused-template). llvm-svn: 302518
* Fix PR32638 : Make sure we switch Sema's CurContext to the substituted ↵Faisal Vali2017-05-092-0/+8
| | | | | | | | | | | | | | | | | | | FunctionDecl when instantiating the exception specification. This fixes the bug: https://bugs.llvm.org/show_bug.cgi?id=32638 int main() { [](auto x) noexcept(noexcept(x)) { } (0); } In the above code, prior to this patch, when substituting into the noexcept expression, i.e. transforming the DeclRefExpr that represents 'x' - clang attempts to capture 'x' because Sema's CurContext is still pointing to the pattern FunctionDecl (i.e. the templated-decl set in FinishTemplateArgumentDeduction) which does not match the substituted 'x's DeclContext, which leads to an attempt to capture and an assertion failure. We fix this by adjusting Sema's CurContext to point to the substituted FunctionDecl under which the noexcept specifier's argument should be transformed, and so the ParmVarDecl that 'x' refers to has the same declcontext and no capture is attempted. I briefly investigated whether the SwitchContext should occur right after VisitMethodDecl creates the new substituted FunctionDecl, instead of only during instantiating the exception specification - but seeing no other code that seemed to rely on that, I decided to leave it just for the duration of the exception specification instantiation. llvm-svn: 302507
* [Sema] Make typeof(OverloadedFunctionName) not a pointer.George Burgess IV2017-05-095-5/+36
| | | | | | | | | | | | | | | | We were sometimes doing a function->pointer conversion in Sema::CheckPlaceholderExpr, which isn't the job of CheckPlaceholderExpr. So, when we saw typeof(OverloadedFunctionName), where OverloadedFunctionName referenced a name with only one function that could have its address taken, we'd give back a function pointer type instead of a function type. This is incorrect. I kept the logic for doing the function pointer conversion in resolveAndFixAddressOfOnlyViableOverloadCandidate because it was more consistent with existing ResolveAndFix* methods. llvm-svn: 302506
* [ODRHash] Loosen checks on typedefs.Richard Trieu2017-05-092-1/+34
| | | | | | | When a type in a class is from a typedef, only check the canonical type. Skip checking the intermediate underlying types. This is in response to PR 32965 llvm-svn: 302505
* [Sema][ObjC] Clean up possible null dereference.Akira Hatanaka2017-05-091-2/+1
| | | | | | | | | | | | It appears that the code is actually dead since unbridged-cast placeholder types are created by calling CastOperation::complete and ImplicitCastExprs are never passed to it. Spotted by Vedant Kumar. rdar://problem/31542226 llvm-svn: 302503
* docs: Fix Sphinx detection with out-of-tree buildsTom Stellard2017-05-091-1/+1
| | | | | | Adapt to changes made in r302499. llvm-svn: 302500
* [CodeGen][ObjC] Emit @objc_retain at -O0 for variables captured byAkira Hatanaka2017-05-093-3/+16
| | | | | | | | | | | blocks. r302270 made changes to avoid emitting clang.arc.use at -O0 and instead emit @objc_release. We also have to emit @objc_retain for the captured variable at -O0 to match the @objc_release instead of just storing the pointer to the capture field. llvm-svn: 302495
* [XRay] Add __xray_customeevent(...) as a clang-supported builtinDean Michael Berris2017-05-093-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We define the `__xray_customeevent` builtin that gets translated to IR calls to the correct intrinsic. The default implementation of this is a no-op function. The codegen side of this follows the following logic: - When `-fxray-instrument` is not provided in the driver, we elide all calls to `__xray_customevent`. - When `-fxray-instrument` is enabled and a function is marked as "never instrumented", we elide all calls to `__xray_customevent` in that function; if either marked as "always instrumented" or subject to threshold-based instrumentation, we emit a call to the `llvm.xray.customevent` intrinsic from LLVM for each `__xray_customevent` occurrence in the function. This change depends on D27503 (to land in LLVM first). Reviewers: echristo, rsmith Subscribers: mehdi_amini, pelikan, lrl, cfe-commits Differential Revision: https://reviews.llvm.org/D30018 llvm-svn: 302492
* [Modules] Allow umbrella frameworks to define private submodules for ↵Bruno Cardoso Lopes2017-05-0912-3/+50
| | | | | | | | | | | | subframeworks In r298391 we fixed the umbrella framework model to work when submodules named "Private" are used. This complements the work by allowing the umbrella framework model to work in general. rdar://problem/31790067 llvm-svn: 302491
* Rename a method. NFC.Vedant Kumar2017-05-091-3/+3
| | | | llvm-svn: 302490
* Update testcase for upstream LLVM changes.Adrian Prantl2017-05-081-2/+4
| | | | llvm-svn: 302476
* [Driver] Don't enable -fsanitize-use-after-scope when ASan is disabledVedant Kumar2017-05-082-7/+6
| | | | | | | | | | | | When enabling any sanitizer, -fsanitize-use-after-scope is enabled by default. This doesn't actually turn ASan on, because we've been getting lucky and there are extra checks in BackendUtil that stop this from happening. However, this has been causing a behavior change: extra lifetime markers are emitted in some cases where they aren't needed or expected. llvm-svn: 302468
* If we are building a module, and we read a second description of the sameRichard Smith2017-05-082-1/+18
| | | | | | | | module from a different module map, ignore it. This happens during builds of preprocessed modules (where it is harmless). llvm-svn: 302463
* [X86][LWP] Add __LWP__ macro testsSimon Pilgrim2017-05-082-0/+16
| | | | | | | | Missed in rL302418 Differential Revision: https://reviews.llvm.org/D32770 llvm-svn: 302445
* Fix grammar in comment. NFCJonathan Roelofs2017-05-081-2/+2
| | | | llvm-svn: 302443
* [AST] Fix copy&paste error in comment. NFC.Malcolm Parsons2017-05-081-1/+1
| | | | llvm-svn: 302440
* [Sema] Fix typos handling in an overloadable call.Anastasia Stulova2017-05-082-0/+10
| | | | | | | | | | | | | | | | In C typos in arguments in a call of an overloadable function lead to a failure of construction of CallExpr and following recovery does not handle created delayed typos. This causes an assertion fail in Sema::~Sema since Sema::DelayedTypos remains not empty. The patch fixes that behavior by handling a call with arguments having dependant types in the way that C++ does. Differential Revision: https://reviews.llvm.org/D31764 Patch by Dmitry Borisenkov! llvm-svn: 302435
* [clang-format] Convert AlignEscapedNewlinesLeft to an enum, addingDaniel Jasper2017-05-086-49/+130
| | | | | | | | | | | | | | | | | | | | DontAlign This converts the clang-format option AlignEscapedNewlinesLeft from a boolean to an enum, named AlignEscapedNewlines, with options Left (prev. true), Right (prev. false), and a new option DontAlign. When set to DontAlign, the backslashes are placed just after the last token in each line: #define EXAMPLE \ do { \ int x = aaaaa; \ int b; \ int dddddddddd; \ } while (0) Patch by jtbandes. Thank you! llvm-svn: 302428
* [clang-format] Don’t propagate AvoidBinPacking into argumentDaniel Jasper2017-05-082-0/+58
| | | | | | | | | | | | subexpressions This is an attempt to fix the issue described in a recent email: http://lists.llvm.org/pipermail/cfe-dev/2017-April/053632.html Patch by jtbandes. Thank you! Review: https://reviews.llvm.org/D32475 llvm-svn: 302427
* Correct the attribute spelling for guarded_var and pt_guarded_var.Aaron Ballman2017-05-081-2/+2
| | | | | | Patch by Roman Lebedev. llvm-svn: 302419
* [X86][LWP] Add clang support for LWP instructions.Simon Pilgrim2017-05-088-0/+212
| | | | | | | | This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4). Differential Revision: https://reviews.llvm.org/D32770 llvm-svn: 302418
* [OpenCL] Check that global samplers are constSven van Haastregt2017-05-083-7/+27
| | | | | | | | Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D32856 llvm-svn: 302411
* Update LanguageExtensions doc to refer to C++14 instead of C++1yEric Fiselier2017-05-061-16/+16
| | | | llvm-svn: 302364
* [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a ↵Kostya Serebryany2017-05-057-3/+17
| | | | | | hidden -mllvm flag. clang part. llvm-svn: 302320
* AArch64: fix weird edge case in ABI.Tim Northover2017-05-052-4/+76
| | | | | | | | | | | | | | | | | It turns out there are some sort-of-but-not-quite empty structs that break all the rules. For example: struct SuperEmpty { int arr[0]; }; struct SortOfEmpty { struct SuperEmpty e; }; Both of these have sizeof == 0, even in C++ mode, for GCC compatibility. The first one also doesn't occupy a register when passed by value in GNU C++ mode, unlike everything else. On Darwin, we want to ignore the lot (and especially don't want to try to use an i0 as we were). llvm-svn: 302313
* Permit keywords in module names in #pragma clang module *.Richard Smith2017-05-052-5/+6
| | | | | | | This is necessary to be able to build a libc++ module from preprocessed source (due to the submodule std.new). llvm-svn: 302312
OpenPOWER on IntegriCloud