summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Move ObjCDeallocChecker out of the alpha package.Devin Coughlin2016-03-021-4/+4
| | | | | | | | It will now be on by default on Darwin. rdar://problem/6927496 llvm-svn: 262524
* [analyzer] Fix capitalization in ObjCSuperDeallocChecker diagnostic.Devin Coughlin2016-03-021-1/+1
| | | | llvm-svn: 262520
* [PGO] Change profile use cc1 option to handle IR level profilesRong Xu2016-03-025-32/+57
| | | | | | | | | | | | | | | | | | This patch changes cc1 option for PGO profile use from -fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>. -fprofile-instr-use=<path> is now a driver only option. In addition to decouple the cc1 option from the driver level option, this patch also enables IR level profile use. cc1 option handling now reads the profile header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM} -- this is a common enum for -fprofile-instrument={}, for the profile instrumentation), and invoke the pipeline to enable the respective PGO use pass. Reviewers: silvas, davidxl Differential Revision: http://reviews.llvm.org/D17737 llvm-svn: 262515
* Serialize `#pragma detect_mismatch`.Nico Weber2016-03-0215-22/+90
| | | | | | | This is like r262493, but for pragma detect_mismatch instead of pragma comment. The two pragmas have similar behavior, so use the same approach for both. llvm-svn: 262506
* [libFuzzer] allow -fsanitize-coverage=0 (disables all coverage)Kostya Serebryany2016-03-021-2/+1
| | | | llvm-svn: 262503
* [CUDA] Do not generate unnecessary runtime init code.Artem Belevich2016-03-021-1/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D17780 llvm-svn: 262499
* [CUDA] Emit host-side 'shadows' for device-side global variablesArtem Belevich2016-03-023-27/+111
| | | | | | | | | | | | | ... and register them with CUDA runtime. This is needed for commonly used cudaMemcpy*() APIs that use address of host-side shadow to access their counterparts on device side. Fixes PR26340 Differential Revision: http://reviews.llvm.org/D17779 llvm-svn: 262498
* Serialize `#pragma comment`.Nico Weber2016-03-0215-57/+118
| | | | | | | | | | | | | | `#pragma comment` was handled by Sema calling a function on ASTConsumer, and CodeGen then implementing this function and writing things to its output. Instead, introduce a PragmaCommentDecl AST node and hang one off the TranslationUnitDecl for every `#pragma comment` line, and then use the regular serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's eagerly deserialized.) http://reviews.llvm.org/D17799 llvm-svn: 262493
* [CLANG] [AVX512] [BUILTIN] Adding PSRA{W|WI}{128|256|512}.Michael Zuckerman2016-03-022-0/+117
| | | | | | Differential Revision: http://reviews.llvm.org/D17706 llvm-svn: 262481
* [CLANG] [AVX512] [BUILTIN] Adding PSRAVMichael Zuckerman2016-03-023-0/+188
| | | | | | Differential Revision: http://reviews.llvm.org/D17699 llvm-svn: 262471
* [Sema] PR26444 fix crash when alignment value is >= 2**16David Majnemer2016-03-021-1/+1
| | | | | | | | | | | Sema allows max values up to 2**28, use unsigned instead of unsiged short to hold values that large. Differential Revision: http://reviews.llvm.org/D17248 Patch by Don Hinton! llvm-svn: 262466
* [modules] addHeaderInclude() can't fail.Davide Italiano2016-03-021-21/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D17794 llvm-svn: 262463
* [OPENMP 4.5] Codegen for data members in 'reduction' clause.Alexey Bataev2016-03-027-22/+115
| | | | | | | | OpenMP 4.5 allows to privatize non-static data members of current class in non-static member functions. Patch supports codegen for non-static data members in 'reduction' clauses. llvm-svn: 262460
* clang-cl: Implement initial limited support for precompiled headers.Nico Weber2016-03-015-6/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the gcc precompiled header model, one explicitly runs clang with `-x c++-header` on a .h file to produce a gch file, and then includes the header with `-include foo.h` and if a .gch file exists for that header it gets used. This is documented at http://clang.llvm.org/docs/UsersManual.html#precompiled-headers cl.exe's model is fairly different, and controlled by the two flags /Yc and /Yu. A pch file is generated as a side effect of a regular compilation when /Ycheader.h is passed. While the compilation is running, the compiler keeps track of #include lines in the main translation unit and writes everything up to an `#include "header.h"` line into a pch file. Conversely, /Yuheader.h tells the compiler to skip all code in the main TU up to and including `#include "header.h"` and instead load header.pch. (It's also possible to use /Yc and /Yu without an argument, in that case a `#pragma hrdstop` takes the role of controlling the point where pch ends and real code begins.) This patch implements limited support for this in that it requires the pch header to be passed as a /FI force include flag – with this restriction, it can be implemented almost completely in the driver with fairly small amounts of code. For /Yu, this is trivial, and for /Yc a separate pch action is added that runs before the actual compilation. After r261774, the first failing command makes a compilation stop – this means if the pch fails to build the main compilation won't run, which is what we want. However, in /fallback builds we need to run the main compilation even if the pch build fails so that the main compilation's fallback can run. To achieve this, add a ForceSuccessCommand that pretends that the pch build always succeeded in /fallback builds (the main compilation will then fail to open the pch and run the fallback cl.exe invocation). If /Yc /Yu are used in a setup that clang-cl doesn't implement yet, clang-cl will now emit a "not implemented yet; flag ignored" warning that can be disabled using -Wno-clang-cl-pch. Since clang-cl doesn't yet serialize some important things (most notably `pragma comment(lib, ...)`, this feature is disabled by default and only enabled by an internal driver flag. Once it's more stable, this internal flag will disappear. (The default stdafx.h setup passes stdafx.h as explicit argument to /Yc but not as /FI – instead every single TU has to `#include <stdafx.h>` as first thing it does. Implementing support for this should be possible with the approach in this patch with minimal frontend changes by passing a --stop-at / --start-at flag from the driver to the frontend. This is left for a follow-up. I don't think we ever want to support `#pragma hdrstop`, and supporting it with this approach isn't easy: This approach relies on the driver knowing the pch filename in advance, and `#pragma hdrstop(out.pch)` can set the output filename, so the driver can't know about it in advance.) clang-cl now also honors /Fp and puts pch files in the same spot that cl.exe would put them, but the pch file format is of course incompatible. This has ramifications on /fallback, so /Yc /Yu aren't passed through to cl.exe in /fallback builds. http://reviews.llvm.org/D17695 llvm-svn: 262420
* Mangle extended qualifiers in the proper order and mangle theJohn McCall2016-03-011-23/+101
| | | | | | | | | | | | | | | | | | | | | | ARC ownership-convention function type modifications. According to the Itanium ABI, vendor extended qualifiers are supposed to be mangled in reverse-alphabetical order before any CVR qualifiers. The ARC function type conventions are plausibly order-significant (they are associated with the function type), which permits us to ignore the need to correctly inter-order them with any other vendor qualifiers on the parameter and return types. Implementing these rules correctly is technically an ABI break. Apple is comfortable with the risk of incompatibility here for the ARC features, and I believe that address-space qualification is still uncommon enough to allow us to adopt the conforming rule without serious risk. Still, targets which make heavy use of address space qualification may want to revert to the non-conforming order. llvm-svn: 262414
* [clang-format] Detect constructor initializers preceded by `noexcept`.Daniel Jasper2016-03-011-1/+1
| | | | | | Patch by Erik Kessler, thank you. llvm-svn: 262402
* This patch adds doxygen comments for the intrinsincs in the header file ↵Ekaterina Romanova2016-03-011-0/+40
| | | | | | | | | | popcntintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics documentation. Differential Revision: http://reviews.llvm.org/D17550 llvm-svn: 262385
* Reword a misleading comment discussing landingpads and SEHReid Kleckner2016-03-011-2/+4
| | | | | | SEH doesn't use landingpads anymore. llvm-svn: 262382
* [MSVC Compat] Correctly handle finallys nested within finallysDavid Majnemer2016-03-013-9/+11
| | | | | | | | | We'd lose track of the parent CodeGenFunction, leading us to get confused with regard to which function a nested finally belonged to. Differential Revision: http://reviews.llvm.org/D17752 llvm-svn: 262379
* [PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and ↵Kit Barton2016-03-011-0/+110
| | | | | | | | | | | | | | | | | | | | vec_vsx_st intrinsics Issue: https://llvm.org/bugs/show_bug.cgi?id=26720 Fix compile error when building ffmpeg for PowerPC64LE because of some vec_vsx_ld/vec_vsx_st intrinsics are not supported by current clang. New added intrinsics: (vector) {signed|unsigned} {short|char} vec_vsx_ld: (total: 8) bool vec_vsx_ld: (total: 1) (vector) {signed|unsigned} {short|char} vec_vsx_st: (total: 8) bool vec_vsx_st: (total: 1) Total: 18 intrinsics Phabricator: http://reviews.llvm.org/D17637 llvm-svn: 262359
* [CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtinMichael Zuckerman2016-03-012-0/+175
| | | | | | Differential Revision: http://reviews.llvm.org/D17714 llvm-svn: 262355
* [CLANG][AVX512][BUILTIN] Adding PSRLV builtin Michael Zuckerman2016-03-013-0/+175
| | | | | | Differential Revision: http://reviews.llvm.org/D17718 llvm-svn: 262326
* Add functions to apply replacements and reformat them.Manuel Klimek2016-03-012-2/+43
| | | | | | | | | | | | | | | | This is a commonly useful feature to have, and we have implemented it multiple times with different kinds of bugs. This implementation centralizes the idea in a set of functions that we can then use from the various tools. Reverts r262234, which is a revert of r262232, and puts the functions into FOrmat.h, as they are closely coupled to clang-format, and we otherwise introduce a cyclic dependency between libFormat and libTooling. Patch by Eric Liu. llvm-svn: 262323
* [CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtinMichael Zuckerman2016-03-012-0/+172
| | | | | | Differential Revision: http://reviews.llvm.org/D17693 llvm-svn: 262321
* Optionally demote fatal errors to non-fatal errors.Manuel Klimek2016-03-012-0/+7
| | | | | | | | | | | | | | | | | | This behavior is enabled when the new CXTranslationUnit_KeepGoing option is passed to clang_parseTranslationUnit{,2}. It is geared towards use by IDEs and similar consumers of the clang-c API where fatal errors may arise when parsing incomplete code mid-edit, or when include paths are not properly configured yet. In such situations one still wants to get as much information as possible about a TU. Previously, the semantic analysis would not instantiate templates or report additional fatal errors after the first fatal error was encountered. Fixes PR24268. Patch by Milian Wolff. llvm-svn: 262318
* clang-format: Correctly apply wrap before multi-line RHS rule toDaniel Jasper2016-03-011-1/+1
| | | | | | | | | | | | | | | ternary expressions. Before: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb + cccccccccccccccc; After: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb + cccccccccccccccc; llvm-svn: 262293
* clang-format: Increase the penalty for breaking between array subscripts.Daniel Jasper2016-03-011-1/+1
| | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa] [a].aaaaaaaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a] .aaaaaaaaaaaaaaaaaaaaaa(); llvm-svn: 262292
* clang-format: [JS] Support quoted object literal keys.Daniel Jasper2016-03-011-1/+2
| | | | | | | | | | | | | | | | | Before: var x = { a: a, b: b, 'c': c, }; After: var x = { a: a, b: b, 'c': c, }; llvm-svn: 262291
* [index] Fix issue where data visitation was disabled with C++ operator call ↵Argyrios Kyrtzidis2016-03-011-2/+2
| | | | | | expressions, during indexing. llvm-svn: 262290
* Fix the template instantiation of ExtParameterInfos; tests to follow.John McCall2016-03-014-19/+69
| | | | llvm-svn: 262289
* Introduce -fembed-bitcode driver optionSteven Wu2016-03-014-10/+65
| | | | | | | | | | | | | | | | | | | | | Summary: This is the clang driver part of the change to embedded bitcode. This includes: 1. -fembed-bitcode option which breaks down the compilation into two stages. The first stage emits optimized bitcode and the second stage compiles bitcode into object file. 2. -fembed-bitcode-marker option which doesn't really break down to two stages to speedup the compilation flow. 3. pass the correct linker flag to darwin linker if tool chains supports embedded bitcode. Reviewers: rsmith, thakis Subscribers: thakis, cfe-commits Differential Revision: http://reviews.llvm.org/D17390 llvm-svn: 262282
* Generalize the consumed-parameter array on FunctionProtoTypeJohn McCall2016-03-016-54/+91
| | | | | | | | | to allow arbitrary data to be associated with a parameter. Also, fix a bug where we apparently haven't been serializing this information for the last N years. llvm-svn: 262278
* [analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.Devin Coughlin2016-03-011-10/+18
| | | | | | | Update the diagnostic for classes missing -dealloc to mention an instance variable that needs to be released. llvm-svn: 262277
* Infrastructure improvements to Clang attribute TableGen.John McCall2016-03-011-2/+0
| | | | | | This should make it easier to add new Attr subclasses. llvm-svn: 262275
* [analyzer] Teach CheckObjCDealloc about Block_release().Devin Coughlin2016-02-291-10/+38
| | | | | | It now treats Block_release(b) as a release in addition to [b release]. llvm-svn: 262272
* [analyzer] Don't treat calls to system headers as escaping in CheckObjCDealloc.Devin Coughlin2016-02-291-21/+96
| | | | | | | | | | | | | | | | | | | This prevents false negatives when a -dealloc method, for example, removes itself as as an observer with [[NSNotificationCenter defaultCenter] removeObserver:self]. It is unlikely that passing 'self' to a system header method will release 'self''s instance variables, so this is unlikely to produce false positives. A challenge here is that while CheckObjCDealloc no longer treats these calls as escaping, the rest of the analyzer still does. In particular, this means that loads from the same instance variable before and after a call to a system header will result in different symbols being loaded by the region store. To account for this, the checker now treats different ivar symbols with the same instance and ivar decl as the same for the purpose of release checking and more eagerly removes a release requirement when an instance variable is assumed to be nil. This was not needed before because when an ivar escaped its release requirement was always removed -- now the requirement is not removed for calls to system headers. llvm-svn: 262261
* [PGO] clang cc1 option change to enable IR level instrumentationRong Xu2016-02-292-2/+13
| | | | | | | | | | | This patch expands cc1 option -fprofile-instrument= with a new value: -fprofile-instrument=llvm which enables IR level PGO instrumentation. Reviewers: davidxl, silvas Differential Revision: http://reviews.llvm.org/D17622 llvm-svn: 262239
* Revert "Implement new interfaces for code-formatting when applying ↵Manuel Klimek2016-02-291-43/+2
| | | | | | | | replacements." This reverts commit r262232. llvm-svn: 262234
* Implement new interfaces for code-formatting when applying replacements.Manuel Klimek2016-02-291-2/+43
| | | | | | Patch by Eric Liu. llvm-svn: 262232
* AMDGPU: Add missing Volcanic Islands targetsTom Stellard2016-02-291-0/+2
| | | | | | | | | | Reviewers: arsenm Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17645 llvm-svn: 262228
* clang-format: Don't format unrelated nested blocks.Daniel Jasper2016-02-291-1/+3
| | | | | | | | | | | | | | | With this change: SomeFunction( [] { int i; return i; // Format this line. }, [] { return 2; // Don't "fix" this. }); llvm-svn: 262216
* [index] Print and test module import references.Argyrios Kyrtzidis2016-02-292-2/+10
| | | | llvm-svn: 262208
* [index] Add a caller relation for a call reference.Argyrios Kyrtzidis2016-02-292-16/+31
| | | | llvm-svn: 262207
* [index] Use ',' to separate symbol roles when printing.Argyrios Kyrtzidis2016-02-291-1/+1
| | | | llvm-svn: 262205
* [X86] Disabling avx512f should also disable avx512vbmi and avx512ifma. ↵Craig Topper2016-02-291-3/+9
| | | | | | Enabling avx512vbmi or avx512ifma should enable avx512f. Add command line switches and header defines for avx512ifma and avx512vbmi. llvm-svn: 262201
* [X86] Enabling xsave should not enable AVX. I seem to have done this, but I ↵Craig Topper2016-02-291-6/+2
| | | | | | don't know why. llvm-svn: 262200
* [OPENMP 4.5] Initial support for data members in 'reduction' clauses.Alexey Bataev2016-02-292-143/+169
| | | | | | | | OpenMP 4.5 allows to privatize non-static data members of current class in non-static member functions. Patch adds initial parsing/semantic analysis for data members support in 'reduction' clauses. llvm-svn: 262199
* [clang-cl] /EHc should not effect functions with explicit exception ↵David Majnemer2016-02-293-9/+14
| | | | | | | | | | specifications Functions with an explicit exception specification have their behavior dictated by the specification. The additional /EHc behavior only comes into play if no exception specification is given. llvm-svn: 262198
* [clang-cl] /EHc should not have an effect on /EHaDavid Majnemer2016-02-291-1/+5
| | | | | | This matches behavior with MSVC. llvm-svn: 262197
* [modules] Prefer more complete array types.Vassil Vassilev2016-02-283-35/+62
| | | | | | | | | | | | | | If we import a module that has a complete array type and one that has an incomplete array type, the declaration found by name lookup might be the one with the incomplete type, possibly resulting in rejects-valid. Now, the name lookup prefers decls with a complete array types. Also, diagnose cases when the redecl chain has array bound, different from the merge candidate. Reviewed by Richard Smith. llvm-svn: 262189
OpenPOWER on IntegriCloud