summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[Modules] Prevent #import to reenter header if not building a module."Bruno Cardoso Lopes2017-08-121-1/+1
| | | | | | | This reverts commit r310605. Richard pointed out a better way to achieve this, which I'll post a patch for soon. llvm-svn: 310775
* Add -fsanitize=fuzzer-no-link flag to the driver.George Karpenkov2017-08-113-2/+7
| | | | | | | | | | | The flag will perform instrumentation necessary to the fuzzing, but will NOT link libLLVMFuzzer.a library. Necessary when modifying CFLAGS for projects which may produce executables as well as a fuzzable target. Differential Revision: https://reviews.llvm.org/D36600 llvm-svn: 310733
* [OpenMP] Enable previously successful offloading tests.Gheorghe-Teodor Bercea2017-08-112-1/+14
| | | | | | | | | | | | Create a separate test file to contain all tests for OpenMP offloading to GPUs. Make libdevice checking more robust by accounting for the case in which no libdevice is found. This changes are in connrection with diff: D29660 llvm-svn: 310718
* [mips] Support implicit gpopt with N64 when using -fno-picSimon Dardis2017-08-111-0/+13
| | | | | | | | | | | As clang defaults to -mno-abicalls when using -fno-pic for N64, implicitly use -mgpopt in that case. Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D36315 llvm-svn: 310714
* [modules] Set the lexical DC for dummy tag decls that refer to hiddenAlex Lorenz2017-08-111-0/+1
| | | | | | | | | | | | | | declarations that are made visible after the dummy is parsed and ODR verified Prior to this commit the "(getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one.")," assertion failure was triggered during semantic analysis of the dummy tag declaration that was declared in another tag declaration because its lexical context did not point to the outer tag decl. rdar://32292196 llvm-svn: 310706
* Revert r302670 for the upcoming 5.0.0 releaseStefan Maksimovic2017-08-111-8/+0
| | | | | | | | | | This is causing failures when compiling clang with -O3 as one of the structures used by clang is passed by value and uses the fastcc calling convention. Faliures manifest for stage2 mips build. llvm-svn: 310704
* Revert r310057Stefan Maksimovic2017-08-113-1/+9
| | | | | | | | Bring back changes which r304953 introduced since they were in fact not the cause of failures described in r310057 commit message. llvm-svn: 310702
* Revert "Thread Safety Analysis: warn on nonsensical attributes."Josh Gao2017-08-111-46/+11
| | | | | | | This reverts commit rL310403, which caused spurious warnings in libc++, because it didn't properly handle templated scoped lockable types. llvm-svn: 310698
* Implement latest feature test macro recommendations, P0096R4.Richard Smith2017-08-111-2/+3
| | | | llvm-svn: 310694
* PR33489: A function-style cast to a deduced class template specialization ↵Richard Smith2017-08-111-1/+3
| | | | | | type is type-dependent if it can't be resolved due to a type-dependent argument. llvm-svn: 310691
* [Sema][ObjC] Fix spurious -Wcast-qual warnings.Akira Hatanaka2017-08-111-1/+8
| | | | | | | | | | We do not meaningfully track object const-ness of Objective-C object types. Silence the -Wcast-qual warning that is issued when casting to or from Objective-C object types results in losing const qualification. rdar://problem/33807915 llvm-svn: 310672
* [X86] Implement __builtin_cpu_isCraig Topper2017-08-104-0/+180
| | | | | | | | This patch adds support for __builtin_cpu_is. I've tried to match the strings supported to the latest version of gcc. Differential Revision: https://reviews.llvm.org/D35449 llvm-svn: 310657
* Enable bunch of sanitizers on NetBSD/X86 and X86_64Kamil Rytarowski2017-08-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable more sanitizers: - i386 and amd64: * SanitizerKind::Vptr; * SanitizerKind::Leak; * SanitizerKind::SafeStack; * SanitizerKind::Function; - amd64 only: * SanitizerKind::Thread; These sanitizers are in the process of upstreaming to LLVM projects. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dim, vitalybuka, kcc, filcab, fjricci Reviewed By: vitalybuka Subscribers: #sanitizers, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36482 llvm-svn: 310649
* [OpenMP] Delete tests in openmp-offload.c which cuase failuresGheorghe-Teodor Bercea2017-08-102-3/+18
| | | | | | | | until a better way to perform these tests is figured out. Change connected to diff: D29654 llvm-svn: 310625
* Fixed a race condition in PrecompiledPreamble.Ilya Biryukov2017-08-101-1/+9
| | | | | | | | | | | | | | | | Summary: Two PrecompiledPreambles, used in parallel on separate threads, could be writing preamble to the same temporary file. Reviewers: bkramer, krasimir, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36529 llvm-svn: 310618
* Place implictly declared functions at block scopeMomchil Velikov2017-08-1011-33/+54
| | | | | | | | | | | | Such implicitly declared functions behave as if the enclosing block contained the declaration extern int name() (C90, 6.3.3.2 Function calls), thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers). This patch fixes https://bugs.llvm.org/show_bug.cgi?id=33224 Differential Revision: https://reviews.llvm.org/D33676 llvm-svn: 310616
* [mips] Show warning in case of mixing -mlong-calls and -mabicalls optionsSimon Atanasyan2017-08-101-2/+10
| | | | | | | | | | While we do not support `-mshared / -mno-shared` properly, show warning and ignore `-mlong-calls` option in case of implicitly or explicitly provided `-mabicalls` option. Differential revision: https://reviews.llvm.org/D36551 llvm-svn: 310614
* [mips] Notify user that `-mabicalls` is ignored on non-PIC N64 ABISimon Atanasyan2017-08-101-3/+15
| | | | | | | | | | The -mabicalls option does not make sense in the case of non position independent code for the N64 ABI. After this change the driver shows a warning that -mabicalls is ignored in that case. Differential revision: https://reviews.llvm.org/D36550 llvm-svn: 310613
* [Modules] Prevent #import to reenter header if not building a module.Bruno Cardoso Lopes2017-08-101-1/+1
| | | | | | | | | | When non-modular headers are imported while not building a module but in -fmodules mode, be conservative and preserve the default #import semantic: do not reenter headers. rdar://problem/33745031 llvm-svn: 310605
* Revert r310489 and follow-up commits r310505, r310519, r310537 and r310549Alex Lorenz2017-08-102-25/+4
| | | | | | | | | | Commit r310489 caused 'openmp-offload.c' test failures on Darwin and other platforms: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/39230/testReport/junit/Clang/Driver/openmp_offload_c/ The follow-up commits tried to fix the test, but the test is still failing. llvm-svn: 310580
* [Lexer] Finding beginning of token with escaped new lineAlexander Kornienko2017-08-101-28/+44
| | | | | | | | | | | | | | | | | | | | Summary: Lexer::GetBeginningOfToken produced invalid location when backtracking across escaped new lines. This fixes PR26228 Reviewers: akyrtzi, alexfh, rsmith, doug.gregor Reviewed By: alexfh Subscribers: alexfh, cfe-commits Patch by Paweł Żukowski! Differential Revision: https://reviews.llvm.org/D30748 llvm-svn: 310576
* [OpenMP] Provide a default GPU arch that is supported byGheorghe-Teodor Bercea2017-08-102-3/+18
| | | | | | | | the underlying hardware. This fixes a bug triggered by diff: D29660 llvm-svn: 310549
* [Driver] Search compiler-rt paths in -print-file-name=Petr Hosek2017-08-102-4/+14
| | | | | | | | | | | This makes it possible to print the name of compiler-rt libraries by using simply clang -print-file-name=libclang_rt.${runtime}-${arch}.so same as other libraries, without having to know the details of the resource directory organization. Differential Revision: https://reviews.llvm.org/D35820 llvm-svn: 310548
* [clang-format] let PointerAlignment dictate spacing of function ref qualifiersJacob Bandes-Storch2017-08-101-2/+1
| | | | | | | | | | | | | | Summary: The original changes for ref qualifiers in rL272537 and rL272548 allowed function const+ref qualifier spacing to diverge from the spacing used for variables. It seems more consistent for `T const& x;` to match `void foo() const&;`. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34324 llvm-svn: 310544
* Remove unused functionMatt Arsenault2017-08-101-9/+0
| | | | llvm-svn: 310540
* clang-format: Fix bug with ENAS_DontAlign and empty linesJacob Bandes-Storch2017-08-102-12/+14
| | | | | | | | This fixes a bug in `ENAS_DontAlign` (introduced in D32733) where blank lines had an EscapedNewlineColumn of 0, causing a subtraction to overflow when converted back to unsigned and leading to runaway memory allocation. Differential Revision: https://reviews.llvm.org/D36019 llvm-svn: 310539
* AMDGPU: Use direct struct returns and argumentsMatt Arsenault2017-08-091-17/+190
| | | | | | | | | | | | | | | | This is an improvement over always using byval for structs. This will use registers until ~16 are used, and then switch back to byval. This needs more work, since I'm not sure it ever really makes sense to use byval. If the register limit is exceeded, the arguments still end up passed on the stack, but with a different ABI. It also may make sense to base this on number of registers used for non-struct arguments, rather than just arguments that appear first in the argument list. llvm-svn: 310527
* Use unsigned instead of an enum for map keysGeorge Burgess IV2017-08-091-23/+12
| | | | | | | ubsan's enum sanitizer doesn't like the latter, and we had to have out-of-bounds values for DenseMapInfo's tombstone/empty keys. llvm-svn: 310523
* [Sema] Assign new flag -Wenum-compare-switch to switch-related parts of ↵Gabor Horvath2017-08-091-1/+1
| | | | | | | | | | -Wenum-compare Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D36526 llvm-svn: 310521
* [OpenMP] Enable executable lookup into driver directory.Gheorghe-Teodor Bercea2017-08-091-0/+3
| | | | | | | | | | | | | | Summary: Invoking the compiler inside a script causes the clang-offload-bundler executable to not be found. This patch enables the lookup for executables in the driver directory where the clang-offload-bundler resides. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, ABataev, caomhin Reviewed By: hfinkel Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36537 llvm-svn: 310513
* [OPENMP] Emit non-debug version of outlined functions with originalAlexey Bataev2017-08-091-16/+15
| | | | | | | | | | | name. If the host code is compiled with the debug info, while the target without, there is a problem that the compiler is unable to find the debug wrapper. Patch fixes this problem by emitting special name for the debug version of the code. llvm-svn: 310511
* [OpenMP] Add flag for overwriting default PTX version for OpenMP targetsGheorghe-Teodor Bercea2017-08-091-1/+7
| | | | | | | | | | | | | | | | | Summary: This flag "--fopenmp-ptx=" enables the overwriting of the default PTX version used for GPU offloaded OpenMP target regions: "+ptx42". Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: ABataev Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29660 llvm-svn: 310489
* [OpenMP] Add flag for disabling the default generation of relocatable OpenMP ↵Gheorghe-Teodor Bercea2017-08-091-1/+4
| | | | | | | | | | | | | | | | target code for NVIDIA GPUs. Summary: Previously we have added the "-c" flag which gets passed to PTXAS by default to generate relocatable OpenMP target code by default. This set of flags exposes control over this behaviour. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: ABataev Subscribers: Hahnfeld, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29659 llvm-svn: 310484
* Fix broken getAttributeSpellingListIndex for pragma attributesErich Keane2017-08-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | We noticed when implementing a new pragma that the TableGen-generated function getAttributeSpellingListIndex() did not work for pragma attributes. It relies on the values in the enum AttributeList::Syntax and a new value AS_ContextSensitiveKeyword was added changing the value for AS_Pragma. Apparently no tests failed since no pragmas currently make use of the generated function. To fix this we can move AS_Pragma back to the value that TableGen code expects. Also to prevent changes in the enum from breaking that routine again I added calls to getAttributeSpellingListIndex() in the unroll pragma code. That will cause some lit test failures if the order is changed. I added a comment to remind of this issue in the future. This assumes we don’t need/want full TableGen support for AS_ContextSensitiveKeyword. It currently only appears in getAttrKind and no other TableGen-generated routines. Patch by: mikerice Differential Revision: https://reviews.llvm.org/D36473 llvm-svn: 310483
* clang-format: [JS] detect ASI after closing parens.Martin Probst2017-08-091-1/+2
| | | | | | | | | | | | Summary: A closing parenthesis followed by a declaration or statement should always terminate the current statement. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D36491 llvm-svn: 310482
* [OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by defaultGheorghe-Teodor Bercea2017-08-091-0/+4
| | | | | | | | | Original Diff: D29642 This patch was previously reverted due to an error with patch D29654 that this depends on. llvm-svn: 310479
* Reapply Sema: allow imaginary constants via GNU extension if UDL overloads ↵Tim Northover2017-08-093-38/+47
| | | | | | | | | | | | | | | | | | not present. C++14 added user-defined literal support for complex numbers so that you can write something like "complex<double> val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. (We now have more robust diagnostics for implicit conversions so the libc++ test that caused the original revert still passes). llvm-svn: 310478
* [OpenCL] Minor refactoring to reduce copy/pasted codeJoey Gouly2017-08-091-8/+5
| | | | | | | Set the type of TheCall inside SemaBuiltinReserveRWPipe to reduce duplicated code. llvm-svn: 310477
* [X86][Ms-InlineAsm] Extend MS Dot operator to accept "this" + struct/class ↵Coby Tayree2017-08-091-8/+19
| | | | | | | | | | | pointers aliases MS InlineAsm Dot operator accepts "Bases" such as "this" (cpp) and class/struct pointer typedef. This patch enhance its implementation with this behavior. Differential Revision: https://reviews.llvm.org/D36450 llvm-svn: 310472
* [Sema] -Wenum-compare no longer warn on anonymous enums in switch statementsGabor Horvath2017-08-091-0/+6
| | | | | | Patch by: Reka Nikolett Kovacs llvm-svn: 310468
* Revert "PR19668, PR23034: Fix handling of move constructors and deleted copy ↵Diana Picus2017-08-098-127/+73
| | | | | | | | | constructors when deciding whether classes should be passed indirectly." This reverts commit r310401 because it seems to have broken some ARM bot(s). llvm-svn: 310464
* [clang-format] Put '/**' and '*/' on own lines in jsdocs ending in comment ↵Krasimir Georgiev2017-08-093-12/+18
| | | | | | | | | | | | | | | | | | pragmas Summary: This handles a case where the trailing '*/' of a multiline jsdoc eding in a comment pragma wouldn't be put on a new line. Reviewers: mprobst Reviewed By: mprobst Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D36359 llvm-svn: 310458
* [Sema] Extend -Wenum-compare to handle mixed enum comparisons in switch ↵Gabor Horvath2017-08-091-8/+28
| | | | | | | | | | statements Patch by: Reka Nikolett Kovacs Differential Revision: https://reviews.llvm.org/D36407 llvm-svn: 310449
* [AST] Cache intermediate visibility/linkage resultsGeorge Burgess IV2017-08-093-6/+53
| | | | | | | | | | | | This is a follow-up to r310436 with actual functional changes. Please see that commit message for a description of why a cache is appearing here. Suggestions for less-bad ways of testing this are appreciated. :) This fixes PR29160. llvm-svn: 310437
* [AST] Move visibility computations into a class; NFCGeorge Burgess IV2017-08-093-143/+218
| | | | | | | | | | | | | | | | | | | | | This is patch 1 in a 2 patch series that aims to fix PR29160. Its goal is to cache decl visibility/linkage for the duration of each visibility+linkage query. The simplest way I can see to do this is to put the visibility calculation code that needs to (transitively) access this cache into a class, which is what this patch does. Actual caching will come in patch 2. (Another way would be to keep the cache in ASTContext + manually invalidate it or something, but that felt way too subtle to me.) Caching visibility results across multiple queries seems a bit tricky, since the user can add visibility attributes ~whenever they want, and these attributes can apparently have far-reaching effects (e.g. class visibility extends to its members, ...). Because a cache that's dropped at the end of each top-level query seems to work nearly as well and doesn't require any eviction logic, I opted for that design. llvm-svn: 310436
* Allow operator delete to be an invalid Decl.Richard Trieu2017-08-091-3/+0
| | | | | | | | Do not discard invalid Decl when searching for the operator delete function. The lookup for this function always expects to find a result, so sometimes the invalid Decl is the only choice possible. This fixes PR34109. llvm-svn: 310435
* [OpenMP] Fix bug regarding cubin integration into host binaryGheorghe-Teodor Bercea2017-08-092-3/+5
| | | | | | | | | | when a BindArchAction is used. This is not a functional change. Original Diff: D29654 llvm-svn: 310433
* Sema: disable implicit conversion from _Complex to real types in C++.Tim Northover2017-08-082-2/+11
| | | | | | | | | | | Converting a _Complex type to a real one simply discards the imaginary part. This can easily lead to loss of information so for safety (and GCC compatibility) this patch disallows that when the conversion would be implicit. The one exception is bool, which actually compares both real and imaginary parts and so is safe. llvm-svn: 310427
* Revert "Lexer: always allow imaginary constants in GNU mode."Tim Northover2017-08-081-1/+1
| | | | | | | This reverts r310423. It was committed by mistake, I intended to commit the improved diagnostics for implicit conversions instead. llvm-svn: 310426
* Lexer: always allow imaginary constants in GNU mode.Tim Northover2017-08-081-1/+1
| | | | llvm-svn: 310423
OpenPOWER on IntegriCloud