summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Driver: remove `SupportsObjCGC` (NFC)Saleem Abdulrasool2017-11-197-15/+0
| | | | | | This option is not used in the frontend. Remove the method. llvm-svn: 318609
* [Driver] add initial support for alpine linuxMartell Malone2017-11-194-3/+32
| | | | | | | | | | | | set -pie as default for musl linux targets add detection of alpine linux append appropriate compile flags for alpine Reviewers: rnk Differential Revision: https://reviews.llvm.org/D39588 llvm-svn: 318608
* [OpenMP] Show error if VLAs are not supportedJonas Hahnfeld2017-11-189-13/+248
| | | | | | | | | | | | | | Some target devices (e.g. Nvidia GPUs) don't support dynamic stack allocation and hence no VLAs. Print errors with description instead of failing in the backend or generating code that doesn't work. This patch handles explicit uses of VLAs (local variable in target or declare target region) or implicitly generated (private) VLAs for reductions on VLAs or on array sections with non-constant size. Differential Revision: https://reviews.llvm.org/D39505 llvm-svn: 318601
* [CodeGen] change const-ness of complex callsSanjay Patel2017-11-184-224/+224
| | | | | | | | | | | | | | | | | After clarification about the C standard, POSIX, and implementations: The C standard allows errno-setting, and it's (unfortunately for optimization) even more clearly stated in the newer additions to the standards. We can leave these functions as always constant ('c') because they don't actually do any math and therefore won't set errno: cimag ( http://en.cppreference.com/w/c/numeric/complex/cimag ) creal ( http://en.cppreference.com/w/c/numeric/complex/creal ) cproj ( http://en.cppreference.com/w/c/numeric/complex/cproj ) conj (http://en.cppreference.com/w/c/numeric/complex/conj ) Differential Revision: https://reviews.llvm.org/D39611 llvm-svn: 318598
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-182-503/+611
| | | | | | minor fixes (NFC). llvm-svn: 318582
* Fix some -Wunused-variable warningsHans Wennborg2017-11-183-3/+0
| | | | llvm-svn: 318578
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-172-489/+733
| | | | | | minor fixes (NFC). llvm-svn: 318570
* Change code owner for Clang Static Analyzer to Devin Coughlin.Anna Zaks2017-11-171-4/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D39964 llvm-svn: 318567
* [cmake] Use llvm-lit directory when provided for stand-alone buildMichal Gorny2017-11-171-0/+3
| | | | | | | | | | | | | | | After the recent lit test changes, clang attempts to run its tests via llvm-lit by default. However, the llvm-lit binary is not present when performing stand-alone build resulting in a failure out of the box. To solve that, add the llvm-lit directory to CMake when performing a stand-alone build and LLVM sources are provided. This includes the CMake rules generating the llvm-lit binary and effectively makes it possible for clang to use it. Differential Revision: https://reviews.llvm.org/D40142 llvm-svn: 318562
* Fix coverage test on Windows botReid Kleckner2017-11-171-1/+1
| | | | llvm-svn: 318559
* Loosen -Wempty-body warningReid Kleckner2017-11-175-3/+18
| | | | | | | | | | | | | | | | | | | | Do not show it when `if` or `else` come from macros. E.g., #define USED(A) if (A); else #define SOME_IF(A) if (A) void test() { // No warnings are shown in those cases now. USED(0); SOME_IF(0); } Patch by Ilya Biryukov! Differential Revision: https://reviews.llvm.org/D40185 llvm-svn: 318556
* [ObjC][ARC] Honor noescape attribute for -Warc-retain-cyclesAlex Lorenz2017-11-172-2/+20
| | | | | | | | rdar://35409566 Differential Revision: https://reviews.llvm.org/D40141 llvm-svn: 318552
* [CodeGen] Compute the objc EH vtable address point using inbounds GEP.Ahmed Bougacha2017-11-172-6/+7
| | | | | | | | | | | | | | | | The object is provided by the objc runtime and is never visible in the module itself, but even so, the address point we compute points into it, and "+16" is guaranteed not to overflow. This matches the c++ vtable IRGen. Note that I'm not entirely convinced the 'i8*' type is correct here: at the IR level, we're accessing memory that's outside the global object. But we don't control the allocation, so it's not obviously wrong either. But either way, this is only in a global initializer, so I don't think it's going to be mucked with. Filed PR35352 to discuss that. llvm-svn: 318545
* [AST] Partially revert r318341 to fix two broken tests on ↵Eugene Zelenko2017-11-172-478/+293
| | | | | | llvm-clang-x86_64-expensive-checks-win (NFC). llvm-svn: 318538
* clang-format: remove trailing lines in lamdas and arrow functions.Martin Probst2017-11-174-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: clang-format already removes empty lines at the beginning & end of blocks: int x() { foo(); // lines before and after will be removed. } However because lamdas and arrow functions are parsed as expressions, the existing logic to remove empty lines in UnwrappedLineFormatter doesn't handle them. This change special cases arrow functions in ContinuationIndenter to remove empty lines: x = []() { foo(); // lines before and after will now be removed. }; Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D40178 llvm-svn: 318537
* [OPENMP] Codegen for `target simd` construct.Alexey Bataev2017-11-178-86/+1323
| | | | | | Added codegen support for `target simd` directive. llvm-svn: 318536
* Indent code blocks so they are actually treated as suchStephan Bergmann2017-11-171-9/+9
| | | | llvm-svn: 318530
* Fix skipping of flags in getClangStripDependencyFileAdjusterDave Lee2017-11-172-5/+36
| | | | | | | | | | | | | | | | | | Summary: The ArgumentsAdjuster returned from `getClangStripDependencyFileAdjuster` will skip dependency flags, and also their associated values for those flags that take an argument. This change corrects the handling of the `-MD` and `-MMD` flags, which do not take an argument. Reviewers: saugustine, klimek, alexshap Reviewed By: alexshap Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40024 llvm-svn: 318529
* [clang-format] Add text proto filename detectionKrasimir Georgiev2017-11-171-0/+5
| | | | | | | | | | | | | | Summary: Adds text proto filename detection. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40120 llvm-svn: 318525
* Implement more accurate penalty & trade-offs while breaking protruding tokens.Manuel Klimek2017-11-175-39/+233
| | | | | | | | For each line that we break in a protruding token, compute whether the penalty of breaking is actually larger than the penalty of the excess characters. Only break if that is the case. llvm-svn: 318515
* Use llvm-config.h instead of config.hIlya Biryukov2017-11-171-1/+1
| | | | | | To fix standalone builds broken by r318411 (config.h is private to llvm). llvm-svn: 318514
* [MinGW] Define __ARM_DWARF_EH__ for MinGW/ARMMartin Storsjo2017-11-172-0/+5
| | | | | | | | | Since SVN r318510, the MinGW/ARM configuration defaults to dwarf exception handling. Differential Revision: https://reviews.llvm.org/D39533 llvm-svn: 318511
* Change path used in a test from r318503 to work on windowsBruno Cardoso Lopes2017-11-171-1/+1
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13565 llvm-svn: 318507
* [PCH+Modules] Improve diagnosticts to help out users pass an extra header ↵Bruno Cardoso Lopes2017-11-173-2/+28
| | | | | | | | | | | | | | | search path When mixing PCH and Implicit Modules, missing a header search path can lead to the implicit built PCM to complaint about not finding its matching module map. Instead of adding more magic to implicit modules engine, add a note to help the user add the appropriate path. rdar://problem/33388847 llvm-svn: 318503
* [CUDA] Remove implementations of nexttoward.Justin Lebar2017-11-172-23/+8
| | | | | | | | | | | | | | | | | | Summary: __builtin_nexttoward lowers to a libcall, e.g. nexttowardf(), that CUDA does not have. Rather than try to implement it, we simply remove these functions -- nvcc doesn't support them either, and nextafter, which does work, does essentially the same thing on GPUs, because GPUs don't have long double. Reviewers: tra Subscribers: cfe-commits, sanjoy Differential Revision: https://reviews.llvm.org/D40152 llvm-svn: 318494
* Update for layering fix in LLVM CodeGen<>TargetDavid Blaikie2017-11-171-1/+1
| | | | llvm-svn: 318491
* Re-revert "Refactor debuginfo-tests"Zachary Turner2017-11-172-7/+2
| | | | | | | | | | | | | | | | | | | | | | This is still broken because it causes certain tests to be run twice with slightly different configurations, which is wrong in some cases. You can observe this by running: ninja -nv check-all | grep debuginfo-tests And seeing that it passes clang/test and clang/test/debuginfo-tests to lit, which causes it to run debuginfo-tests twice. The fix is going to involve either: a) figuring out that we're running in this "deprecated" configuration, and then deleting the clang/test/debuginfo-tests path, which should cause it to behave identically to before, or: b) make lit smart enough that it doesn't descend into a sub-suite if that sub-suite already has a lit.cfg file. llvm-svn: 318486
* PR22763: if a defaulted (non-user-provided) special member function isRichard Smith2017-11-164-2/+33
| | | | | | | | | | | | | | | | explicitly instantiated, still emit it with each use. We don't emit a definition of the member with an explicit instantiation definition (and indeed it appears that we're not allowed to, since an explicit instantiation definition does not constitute an odr-use and only odr-use permits definition for defaulted special members). So we still need to emit a weak definition with each use. This also makes defaulted-in-class declarations behave more like implicitly-declared special members, which matches their design intent. And it matches the way this problem was solved in GCC. llvm-svn: 318474
* Issue -Wempty-body warnings for else blocksReid Kleckner2017-11-163-1/+25
| | | | | | | | This looks like it was just an oversight. Fixes http://llvm.org/pr35319 llvm-svn: 318456
* [VirtualFileSystem] Support creating directories then adding files insideBen Hamilton2017-11-163-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In https://reviews.llvm.org/D39572 , I added support for specifying `Type` when invoking `InMemoryFileSystem::addFile()`. However, I didn't account for the fact that when `Type` is `directory_file`, we need to construct an `InMemoryDirectory`, not an `InMemoryFile`, or else clients cannot create files inside that directory. This diff fixes the bug and adds a test. Test Plan: New test added. Ran test with: % make -j12 check-clang-tools Reviewers: bkramer, hokein Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40140 llvm-svn: 318445
* [MS] Apply adjustments after storing 'this'Reid Kleckner2017-11-169-114/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The MS ABI convention is that the 'this' pointer on entry is the address of the vfptr that was used to make the virtual method call. In other words, the pointer on entry always points to the base subobject that introduced the virtual method. Consider this hierarchy: struct A { virtual void f() = 0; }; struct B { virtual void g() = 0; }; struct C : A, B { void f() override; void g() override; }; On entry to C::g, [ER]CX will contain the address of C's B subobject, and C::g will have to subtract sizeof(A) to recover a pointer to C. Before this change, we applied this adjustment in the prologue and stored the new value into the "this" local variable alloca used for debug info. However, MSVC does not do this, presumably because it is often profitable to fold the adjustment into later field accesses. This creates a problem, because the debugger expects the variable to be unadjusted. Unfortunately, CodeView doesn't have anything like DWARF expressions for computing variables that aren't in the program anymore, so we have to declare 'this' to be the unadjusted value if we want the debugger to see the right value. This has the side benefit that, in optimized builds, the 'this' pointer will usually be available on function entry because it doesn't require any adjustment. Reviewers: hans Subscribers: aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D40109 llvm-svn: 318440
* Resubmit "Refactor debuginfo-tests"Zachary Turner2017-11-162-2/+7
| | | | | | | | | | This was reverted due to some failures on specific darwin buildbots, the issue being that the new lit configuration was not setting the SDKROOT environment variable. We've tested a fix locally and confirmed that it works, so this patch resubmits everything with the fix applied. llvm-svn: 318435
* [OPENMP] Add support for cancelling inside target parallel forAlexey Bataev2017-11-164-15/+21
| | | | | | | | directive. Added missed support for cancelling of target parallel for construct. llvm-svn: 318434
* Update tests for llvm.invariant.group.barrier becoming mangledYaxun Liu2017-11-162-30/+30
| | | | | | Differential Revision: https://reviews.llvm.org/D40062 llvm-svn: 318414
* Allow to store precompiled preambles in memory.Ilya Biryukov2017-11-165-93/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These preambles are built by ASTUnit and clangd. Previously, preambles were always stored on disk. In-memory preambles are routed back to the compiler as virtual files in a custom VFS. Interface of ASTUnit does not allow to use in-memory preambles, as ASTUnit::CodeComplete receives FileManager as a parameter, so we can't change VFS used by the compiler inside the CodeComplete method. A follow-up commit will update clangd in clang-tools-extra to use in-memory preambles. Reviewers: klimek, sammccall, bkramer Reviewed By: klimek Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D39842 llvm-svn: 318411
* Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function ↵Eric Christopher2017-11-162-1/+4
| | | | | | warnings. llvm-svn: 318371
* [DeclPrinter] Extract function PrintConstructorInitializers, NFCAlex Lorenz2017-11-161-64/+69
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40066 llvm-svn: 318367
* [DeclPrinter] Honor TerseOutput for constructorsAlex Lorenz2017-11-163-73/+104
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D39957 llvm-svn: 318365
* clang/module.modulemap: clang/Basic/X86Target.def may be textual header.NAKAMURA Takumi2017-11-151-0/+1
| | | | llvm-svn: 318347
* Add X86Target.def that was forgotten in r30734Erich Keane2017-11-151-0/+228
| | | | llvm-svn: 318345
* Split x86 "Processor" info into its own def file. [NFC]Erich Keane2017-11-152-281/+9
| | | | | | | | | | | A first step toward removing the repetition of features/CPU info in the x86 target info, this patch pulls all the processor information out into its own .def file. Differential Revision: https://reviews.llvm.org/D40093 llvm-svn: 318343
* [AST, Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-11-153-467/+753
| | | | | | other minor fixes (NFC). llvm-svn: 318341
* Try to fix test/SemaCXX/deleted-operator.cpp after r318309Hans Wennborg2017-11-151-2/+2
| | | | | | | The number of 'built-in candidate' notes now varies since __float128 may or may not be a candidate depending on the target. llvm-svn: 318314
* BuiltinOperatorOverloadBuilder: Don't consider types that are unavailable on ↵Hans Wennborg2017-11-152-71/+104
| | | | | | | | | | | | | the target (PR35174) In the PR, Clang ended up in a situation where it tried to mangle the __float128 type, which isn't supported when targetingt MSVC, because Clang instantiated a variable template with that type when searching for a conversion to use in an arithmetic expression. Differential revision: https://reviews.llvm.org/D39579 llvm-svn: 318309
* ASTMatchers.h: Fix ODR violations by avoiding internal linkage variables in ↵David Blaikie2017-11-152-328/+559
| | | | | | | | | | | | | | headers Internal linkage variables ODR referenced from inline functions create ODR violations (the same inline function ends up having different definitions in each TU, since it references different variables - rather than one definition). This also happens to break modular code generation - so this is the last fix to allow clang to compile with modular code generation. llvm-svn: 318304
* [libclang] Fix cursors for in-class initializer of field declarationsBenjamin Kramer2017-11-152-0/+11
| | | | | | | | | | Fixes PR33745. Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40027 llvm-svn: 318292
* [OpenCL] Fix code generation of function-scope constant samplers.Alexey Bader2017-11-153-26/+23
| | | | | | | | | | | | | | | | | Summary: Constant samplers are handled as static variables and clang's code generation library, which leads to llvm::unreachable. We bypass emitting sampler variable as static since it's translated to a function call later. Reviewers: yaxunl, Anastasia Reviewed By: yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34342 llvm-svn: 318290
* [clang] Expose orderedString from CodeCompletionResult. NFCSam McCall2017-11-152-16/+18
| | | | llvm-svn: 318286
* ASTMatchers.h: Avoid warnings due to "@throw". [-Wdocumentation]NAKAMURA Takumi2017-11-151-2/+2
| | | | llvm-svn: 318274
* PR35214: don't crash if we see an array of unknown bound added to an empty ↵Richard Smith2017-11-152-4/+13
| | | | | | but invalid designator. llvm-svn: 318258
OpenPOWER on IntegriCloud