summaryrefslogtreecommitdiffstats
path: root/clang/include
Commit message (Collapse)AuthorAgeFilesLines
* [CLANG][AVX512][BUILTIN] movddup{128|256|512}Michael Zuckerman2016-03-031-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D17826 llvm-svn: 262617
* [OpenCL] Apply missing restrictions for Blocks in OpenCL v2.0Anastasia Stulova2016-03-031-4/+12
| | | | | | | | | | | | | | Applying the following restrictions for block types in OpenCL (v2.0 s6.12.5): - __block storage class is disallowed - every block declaration must be const qualified and initialized - a block can't be used as a return type of a function - a blocks can't be used to declare a structure or union field - extern speficier is disallowed Corrected image and sampler types diagnostics with struct and unions. Review: http://reviews.llvm.org/D16928 llvm-svn: 262616
* [CLANG][AVX512][BUILTIN] movdqu{qi|hi} {128|256|512}Michael Zuckerman2016-03-031-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D17814 llvm-svn: 262609
* [CLANG][AVX512][BUILTIN] movdqa{32|64}{load|store|}{128|256|512}Michael Zuckerman2016-03-031-0/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D17812 llvm-svn: 262598
* [Clang][AVX512][BUILTIN] Adding PSRL{W|WI}{128|256|512}Michael Zuckerman2016-03-031-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D17754 llvm-svn: 262593
* Semantic analysis for the swiftcall calling convention.John McCall2016-03-038-2/+263
| | | | | | | I've tried to keep the infrastructure behind parameter ABI treatments fairly general. llvm-svn: 262587
* [OPENMP 4.0] Initial support for 'omp declare reduction' construct.Alexey Bataev2016-03-0312-7/+148
| | | | | | | | | | | | | | | | | Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct. User-defined reductions are defined as #pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )] These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting combined value after executing the combiner. As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced. Differential Revision: http://reviews.llvm.org/D11182 llvm-svn: 262582
* [OPENMP 4.5] Initial support for data members in 'linear' clause.Alexey Bataev2016-03-031-0/+7
| | | | | | | | OpenMP 4.5 allows to privatize data members of current class in member functions. Patch adds initial support for privatization of data members in 'linear' clause, no codegen support. llvm-svn: 262578
* Serialize `pragma pointers_to_members` state.Nico Weber2016-03-033-1/+9
| | | | | | Like r262539, but for pointers_to_members. llvm-svn: 262552
* Improve some infrastructure for extended parameter infos andJohn McCall2016-03-033-9/+33
| | | | | | | fix a bug with the instantiation of ns_consumed parameter attributes in ARC. llvm-svn: 262551
* Serialize `pragma ms_struct` state.Nico Weber2016-03-025-6/+13
| | | | | | | | | | | pragma ms_struct has an effect on struct decls, and the effect is serialized correctly already. But the "is ms_struct currently on" state wasn't before this change. This uses the same approach as `pragma clang optimize`: When writing a module, the state isn't serialized, only when writing a pch file. llvm-svn: 262539
* clang-format: [JS] Optionally re-quote string literals.Daniel Jasper2016-03-021-1/+16
| | | | | | | | | | | | | | | | | | | | | Turns "foo" into 'foo' (or vice versa, depending on configuration). This makes it more convenient to follow the Google JavaScript style guide: https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings This functionality is behind the option "JavaScriptQuotes", which can be: * "leave" (no re-quoting) * "single" (change to single quotes) * "double" (change to double quotes) This also changes single quoted JavaScript string literals to be treated as tok::string_literal, not tok::char_literal, which fixes two unrelated tests. Patch by Martin Probst. Thank you. llvm-svn: 262534
* [PGO] Change profile use cc1 option to handle IR level profilesRong Xu2016-03-024-2/+17
| | | | | | | | | | | | | | | | | | 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-027-10/+41
| | | | | | | 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
* Serialize `#pragma comment`.Nico Weber2016-03-028-23/+70
| | | | | | | | | | | | | | `#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-021-0/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D17706 llvm-svn: 262481
* [CLANG] [AVX512] [BUILTIN] Adding PSRAVMichael Zuckerman2016-03-021-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D17699 llvm-svn: 262471
* [OPENMP 4.5] Codegen for data members in 'reduction' clause.Alexey Bataev2016-03-023-3/+13
| | | | | | | | 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-018-8/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtinMichael Zuckerman2016-03-011-0/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D17714 llvm-svn: 262355
* [CLANG][AVX512][BUILTIN] Adding PSRLV builtin Michael Zuckerman2016-03-011-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D17718 llvm-svn: 262326
* Add functions to apply replacements and reformat them.Manuel Klimek2016-03-012-0/+29
| | | | | | | | | | | | | | | | 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-011-1/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D17693 llvm-svn: 262321
* Optionally demote fatal errors to non-fatal errors.Manuel Klimek2016-03-012-1/+19
| | | | | | | | | | | | | | | | | | 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
* Better comments for ExtParameterInfo.John McCall2016-03-012-2/+33
| | | | llvm-svn: 262308
* Fix the template instantiation of ExtParameterInfos; tests to follow.John McCall2016-03-012-1/+28
| | | | llvm-svn: 262289
* Introduce -fembed-bitcode driver optionSteven Wu2016-03-014-1/+23
| | | | | | | | | | | | | | | | | | | | | 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-012-25/+87
| | | | | | | | | 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
* Infrastructure improvements to Clang attribute TableGen.John McCall2016-03-012-7/+7
| | | | | | This should make it easier to add new Attr subclasses. llvm-svn: 262275
* [PGO] clang cc1 option change to enable IR level instrumentationRong Xu2016-02-293-5/+11
| | | | | | | | | | | 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-39/+0
| | | | | | | | replacements." This reverts commit r262232. llvm-svn: 262234
* Implement new interfaces for code-formatting when applying replacements.Manuel Klimek2016-02-291-0/+39
| | | | | | Patch by Eric Liu. llvm-svn: 262232
* [index] Add a caller relation for a call reference.Argyrios Kyrtzidis2016-02-291-1/+2
| | | | llvm-svn: 262207
* [AST/RecursiveASTVisitor] Correction so that dataTraverseStmtPost will get ↵Argyrios Kyrtzidis2016-02-291-9/+20
| | | | | | | | called after the statement has been visited. Fixes the indexing client of this. llvm-svn: 262206
* [X86] Disabling avx512f should also disable avx512vbmi and avx512ifma. ↵Craig Topper2016-02-291-0/+4
| | | | | | Enabling avx512vbmi or avx512ifma should enable avx512f. Add command line switches and header defines for avx512ifma and avx512vbmi. llvm-svn: 262201
* [CLANG] [AVX512] [BUILTIN] Adding PSLL{V|W|Wi}{128|256|512} builtinMichael Zuckerman2016-02-281-0/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D17685 llvm-svn: 262177
* Workaround doxygen bug https://bugzilla.gnome.org/show_bug.cgi?id=506243Alexander Kornienko2016-02-271-1/+1
| | | | llvm-svn: 262138
* Correcting indentation for an RST code block.Aaron Ballman2016-02-271-3/+4
| | | | llvm-svn: 262136
* AMDGPU: Add builtins for recently added intrinsicsMatt Arsenault2016-02-271-0/+10
| | | | llvm-svn: 262126
* Add __builtin_canonicalizeMatt Arsenault2016-02-271-0/+5
| | | | llvm-svn: 262122
* [dllexport] Sort out emission order of delayed exported classesReid Kleckner2016-02-261-0/+7
| | | | | | | | | | | | | | | | Relands r260194 with a fix. If we have a template that transitions from an extern template to an explicitly instantiated dllexport template, we would add that class to the delayed exported class list without flushing it. For explicit instantiations, we can just flush the list of delayed classes immediately. We don't have to worry about the bug fixed in r260194 in this case because explicit instantiations can only occur at file and namespace scope. Fixes PR26490. llvm-svn: 262056
* Fixing an issue with the code block so that it does not appear as a list.Aaron Ballman2016-02-261-9/+5
| | | | llvm-svn: 262013
* Giving this attribute documentation group a heading; fixes a documentation ↵Aaron Ballman2016-02-261-3/+7
| | | | | | generation error. llvm-svn: 262012
* OpenMPClause.h: Fix typo in \param. [-Wdocumentation]NAKAMURA Takumi2016-02-261-1/+1
| | | | llvm-svn: 261962
* [OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttrXiuli Pan2016-02-263-2/+36
| | | | | | | | | | | | | | | Summary: OpenCL access qualifiers are now not only used for image types, refine it to avoid misleading, Add semacheck for OpenCL access qualifier as well as test caees. Reviewers: pekka.jaaskelainen, Anastasia, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D16040 llvm-svn: 261961
* Replace a compiler-specific approach to determining the presence of a ↵Aaron Ballman2016-02-251-25/+14
| | | | | | getDecl() member function with one that does not require compiler-specific workarounds; NFC. llvm-svn: 261872
* [OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.Alexey Bataev2016-02-252-4/+44
| | | | | | | | | OpenMP 4.5 allows to privatize non-static member decls in non-static member functions. Patch captures such decls by reference in general (for bitfields, by value) and then operates with this capture. For bitfields, at the end of codegen for lastprivates original bitfield is updated with the value of captured copy. llvm-svn: 261824
* [OpenCL] Add Sema checks for typesXiuli Pan2016-02-251-0/+4
| | | | | | | | | | | | | | Summary: Add Sema checks for opencl type: image, pipe.... This patch is partitioned from http://reviews.llvm.org/D16047 Reviewers: Anastasia, yaxunl Subscribers: pekka.jaaskelainen, cfe-commits Differential Revision: http://reviews.llvm.org/D17437 llvm-svn: 261818
* Fix rejects-valid caused by r261297.Nico Weber2016-02-241-1/+6
| | | | | | | | | | | | | | | | r261297 called hasUserProvidedDefaultConstructor() to check if defining a const object is ok. This is incorrect for this example: struct X { template<typename ...T> X(T...); int n; }; const X x; // formerly OK, now bogus error Instead, track if a class has a defaulted default constructor, and disallow a const object for classes that either have defaulted default constructors or if they need an implicit constructor. Bug report and fix approach by Richard Smith, thanks! llvm-svn: 261770
* Add whole-program vtable optimization feature to Clang.Peter Collingbourne2016-02-243-0/+13
| | | | | | | | | This patch introduces the -fwhole-program-vtables flag, which enables the whole-program vtable optimization feature (D16795) in Clang. Differential Revision: http://reviews.llvm.org/D16821 llvm-svn: 261767
OpenPOWER on IntegriCloud