summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Implement various matchers around template argument handling.Manuel Klimek2014-10-091-13/+18
| | | | llvm-svn: 219408
* clang-format: Add option to control call argument bin-packing separatelyDaniel Jasper2014-10-092-5/+9
| | | | | | | This is desirable for the Chromium style guide: http://www.chromium.org/developers/coding-style llvm-svn: 219400
* Fix for bug http://llvm.org/PR17427.Alexey Bataev2014-10-0912-127/+122
| | | | | | | | Assertion failed: "Computed __func__ length differs from type!" Reworked PredefinedExpr representation with internal StringLiteral field for function declaration. Differential Revision: http://reviews.llvm.org/D5365 llvm-svn: 219393
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-0913-8/+236
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219385
* Replace a destructor of EHCleanupScope with a Destroy() method to reflect ↵Kostya Serebryany2014-10-082-2/+4
| | | | | | | | | | | | | | | | | | | | | the current usage. Summary: The current code uses memset to re-initialize EHCleanupScope objects with breaks the assumptions of the upcoming asan's intra-object-overflow checker. If there is no DTOR, the new checker will refuse to work. Test Plan: bootstrap with asan Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5656 llvm-svn: 219331
* Added new headers to CMakeLists.txt.Robert Khasanov2014-10-081-0/+3
| | | | | | Fix for rev219319 llvm-svn: 219325
* ms-inline-asm: Correctly mark MS inline ASM labels as usedEhsan Akhgari2014-10-081-1/+4
| | | | | | | | | | | | | | Summary: This fixes PR21155. Test Plan: The patch includes a test. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5619 llvm-svn: 219322
* [AVX512] Added VPCMPEQ intrinisics to headers.Robert Khasanov2014-10-085-0/+264
| | | | | | | | Added tests. Patch by Maxim Blumenthal <maxim.blumenthal@intel.com> llvm-svn: 219319
* Revert "Remove threshold on object size for inserting lifetime begin / end"Arnaud A. de Grandmaison2014-10-081-9/+18
| | | | | | Revert this patch while I investigate some sanitizer failures off-line. llvm-svn: 219307
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-0810-144/+401
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219306
* Remove threshold on object size for inserting lifetime begin / endArnaud A. de Grandmaison2014-10-081-18/+9
| | | | | | | | | Boostrapping LLVM+Clang+LLDB without threshold on object size for lifetime markers insertion has shown there was no significant change in compile time, so let the stack slot colorizer do its optimization for all slots. llvm-svn: 219303
* Revert commit r219297.Alexey Bataev2014-10-0810-401/+144
| | | | | | Still troubles with OpenMP/parallel_firstprivate_codegen.cpp (now in ARM buildbots). llvm-svn: 219298
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-0810-144/+401
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219297
* Revert back r219295.Alexey Bataev2014-10-0810-401/+144
| | | | | | To fix issues with test OpenMP/parallel_firstprivate_codegen.cpp llvm-svn: 219296
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-0810-144/+401
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219295
* Revert "[OPENMP] 'omp teams' directive basic support. Includes parsing and ↵Renato Golin2014-10-0813-236/+8
| | | | | | | | | semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive." This reverts commit r219197 because it broke ARM self-hosting buildbots with segmentation fault errors in many tests. llvm-svn: 219289
* AST: Fix a typo (NFC)Justin Bogner2014-10-081-1/+1
| | | | llvm-svn: 219279
* Disallow using function parameters in extended asm inputs or outputs in ↵Hans Wennborg2014-10-081-11/+36
| | | | | | | | | | | | | | naked functions (PR21178) Clang won't emit any prologues for such functions, so it would assert trying to codegen the parameter references. This patch makes Clang check the extended asm inputs and outputs for references to function parameters. Differential Revision: http://reviews.llvm.org/D5640 llvm-svn: 219272
* Fix IRGen for referencing a static local before emitting its declReid Kleckner2014-10-085-45/+74
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously CodeGen assumed that static locals were emitted before they could be accessed, which is true for automatic storage duration locals. However, it is possible to have CodeGen emit a nested function that uses a static local before emitting the function that defines the static local, breaking that assumption. Fix it by creating the static local upon access and ensuring that the deferred function body gets emitted. We may not be able to emit the initializer properly from outside the function body, so don't try. Fixes PR18020. See also previous attempts to fix static locals in PR6769 and PR7101. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4787 llvm-svn: 219265
* Avoid code duplication by calling setAliasAttributes in EmitAliasDefinition.Rafael Espindola2014-10-081-12/+3
| | | | llvm-svn: 219258
* Objective-C SDK modernization. When modernizing toFariborz Jahanian2014-10-071-7/+25
| | | | | | | | use NS_ENUM/NS_OPTIONS macros, add an import of Foundation.h (or its module) as necessary. rdar://18498550 llvm-svn: 219225
* Emit diagnostic for -munaligned-access on v6mJonathan Roelofs2014-10-071-2/+1
| | | | | | Patch by: Charlie Turner <charlie.turner@arm.com> llvm-svn: 219211
* clang-format: Fix bug with comments between non-trival parameters.Daniel Jasper2014-10-071-3/+4
| | | | | | | | | | | | | | Before: SomeFunction(a, a, // comment b + x); After: SomeFunction(a, a, // comment b + x); llvm-svn: 219209
* Allow dllexport alias to base destructors.Rafael Espindola2014-10-071-5/+1
| | | | | | | | | | | We used to avoid these, but it looks like we did so just because we were not handling dllexport alias correctly. Dario Domizioli fixed that, so allow these aliases. Based on a patch by Dario Domizioli! llvm-svn: 219206
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-0713-8/+236
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219197
* [OPENMP] Small refactoring of EmitOMPSimdLoop helper routine.Alexander Musman2014-10-072-17/+18
| | | | | | | | | No functional changes intended. Renamed EmitOMPSimdLoop to EmitOMPInnerLoop, I plan to re-use it to emit inner loop in the future patches for CodeGen of the worksharing loop directives (omp for, omp for simd). llvm-svn: 219195
* Objective-C SDK modernizer. Patch to support modernizationFariborz Jahanian2014-10-062-16/+53
| | | | | | | | to NS_ENUM/NS_OPTION macros when typedef names are other than NSInteger/NSUInteger (int8_t, etc.). rdar://18532199 llvm-svn: 219173
* [PATCH][Power] Fix (and deprecate) vec_lvsl and vec_lvsr for little endianBill Schmidt2014-10-061-0/+182
| | | | | | | | | | | | | | | | | | | | | The use of the vec_lvsl and vec_lvsr interfaces are discouraged for little endian targets since Power8 hardware is a minimum requirement, and Power8 provides reasonable performance for unaligned vector loads and stores. Up till now we have not provided "correct" (i.e., big- endian-compatible) code generation for these interfaces, as to do so produces poorly performing code. However, this has become the source of too many questions. With this patch, LLVM will now produce compatible code for these interfaces, but will also produce a deprecation warning message for PPC64LE when one of them is used. This should make the porting direction clearer to programmers. A similar patch has recently been committed to GCC. This patch includes a test for the warning message. There is a companion patch that adds two unit tests to projects/test-suite. llvm-svn: 219137
* Remove cases that are now handled by the parent class implementation.Rafael Espindola2014-10-061-3/+0
| | | | llvm-svn: 219132
* Turn on the integrated assembler by default for ppc64 andEric Christopher2014-10-061-1/+3
| | | | | | | | ppc64le. Reviewed by Hal Finkel and Bill Schmidt. llvm-svn: 219129
* Patch to wrap up '_' as separator in version numbersFariborz Jahanian2014-10-063-7/+13
| | | | | | | | | in availability attribute by preserving this info. in VersionTuple and using it in pretty printing of attributes and yet using '.' as separator when diagnosing unavailable message calls. rdar://18490958 llvm-svn: 219124
* clang-format: If in doubt, assume '+' is a binary operator.Daniel Jasper2014-10-061-2/+3
| | | | | | | | | | Before: #define LENGTH(x, y) (x) - (y)+1 After: #define LENGTH(x, y) (x) - (y) + 1 llvm-svn: 219119
* Fix bug in DynTypedMatcher::constructVariadic() that would cause false ↵Samuel Benzaquen2014-10-062-24/+20
| | | | | | | | | | | | | | | | | | | negatives. Summary: DynTypedMatcher::constructVariadic() where the restrict kind of the different matchers are not related causes the matcher to have a "None" restrict kind. This causes false negatives for anyOf and eachOf. Change the logic to get a common ancestor if there is one. Also added regression tests that fail without the fix. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5580 llvm-svn: 219118
* Using an explicit cast to work around MSVC 2013 not picking the conversion ↵Aaron Ballman2014-10-061-1/+1
| | | | | | operator as expected. NFC, should fix the MSVC build bots. llvm-svn: 219116
* [OPENMP] Limit the loop counters to 64 bits for the worksharing loopsAlexander Musman2014-10-061-3/+26
| | | | llvm-svn: 219113
* Add FIXME/notes to the future.David Blaikie2014-10-061-0/+5
| | | | llvm-svn: 219104
* DebugInfo: Don't include implicit special members in the list of class membersDavid Blaikie2014-10-061-18/+17
| | | | | | | | By leaving these members out of the member list, we avoid them being emitted into type unit definitions - while still allowing the definition/declaration to be injected into the compile unit as expected. llvm-svn: 219101
* DebugInfo: Don't include member function template specializations in the ↵David Blaikie2014-10-061-10/+0
| | | | | | | | | | list of class members By leaving these members out of the member list, we avoid them being emitted into type unit definitions - while still allowing the definition/declaration to be injected into the compile unit as expected. llvm-svn: 219100
* MS ABI: Make comment more accurateDavid Majnemer2014-10-051-1/+1
| | | | | | The ABI for function-scope statics changed in VS "14", not MSVC 2013. llvm-svn: 219076
* MS ABI: Use '1' (instead of '0') relative scope discriminatorsDavid Majnemer2014-10-051-1/+1
| | | | | | | | This changes the scope discriminator's behavior to start at '1' instead of '0'. Symbol table diffing, for ABI compatibility testing, kept finding these as false positives. llvm-svn: 219075
* MS ABI: Implement thread_local for global variablesDavid Majnemer2014-10-058-98/+194
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This add support for the C++11 feature, thread_local global variables. The ABI Clang implements is an improvement of the MSVC ABI. Sadly, further improvements could be made but not without sacrificing ABI compatibility. The feature is implemented as follows: - All thread_local initialization routines are pointed to from the .CRT$XDU section. - All non-weak thread_local variables have their initialization routines call from a single function instead of getting their own .CRT$XDU section entry. This is done to open up optimization opportunities to the compiler. - All weak thread_local variables have their own .CRT$XDU section entry. This entry is in a COMDAT with the global variable it is initializing; this ensures that we will initialize the global exactly once. - Destructors are registered in the initialization function using __tlregdtor. Differential Revision: http://reviews.llvm.org/D5597 llvm-svn: 219074
* Return a reference instead of vector copy for parentmap queries.Benjamin Kramer2014-10-042-32/+29
| | | | | | | The map is immutable until the whole ASTContext dies. While there movify a couple of copies in ASTMatchFinder away. NFC. llvm-svn: 219062
* Emit @llvm.assume for non-parameter lvalue align_value-attribute loadsHal Finkel2014-10-041-3/+41
| | | | | | | | | | | | | | | | | | | | | We already add the align parameter attribute for function parameters that have the align_value attribute (or those with a typedef type having that attribute), which is an important special case, but does not handle pointers with value alignment assumptions that come into scope in any other way. To handle the general case, emit an @llvm.assume-based alignment assumption whenever we load the pointer-typed lvalue of an align_value-attributed variable (except for function parameters, which we already deal with at entry). I'll also note that this is more general than Intel's described support in: https://software.intel.com/en-us/articles/data-alignment-to-assist-vectorization which states that the compiler inserts __assume_aligned directives in response to align_value-attributed variables only for function parameters and for the initializers of local variables. I think that we can make the optimizer deal with this more-general scheme (which could lead to a lot of calls to @llvm.assume inside of loop bodies, for example), but if not, I'll rework this to be less aggressive. llvm-svn: 219052
* -ms-extensions: Allow __super in return stements.Nikola Smiljanic2014-10-042-7/+12
| | | | llvm-svn: 219050
* MS ABI: Disallow dllimported/exported variables from having TLSDavid Majnemer2014-10-041-1/+12
| | | | | | | | | | | | | | | | | | | Windows TLS relies on indexing through a tls_index in order to get at the DLL's thread local variables. However, this index is not exported along with the variable: it is assumed that all accesses to thread local variables are inside the same module which created the variable in the first place. While there are several implementation techniques we could adopt to fix this (notably, the Itanium ABI gets this for free), it is not worth the heroics. Instead, let's just ban this combination. We could revisit this in the future if we need to. This fixes PR21111. llvm-svn: 219049
* Sema: Simplify checkAttributesAfterMergingDavid Majnemer2014-10-041-8/+1
| | | | | | Use getDLLAttr to factor out some common dllimport/dllexport code. llvm-svn: 219048
* PR20991: ::decltype is not valid.Richard Smith2014-10-041-1/+2
| | | | llvm-svn: 219043
* Remove stray enum keywords. MSVC sees this as a redeclaration at global scope.Benjamin Kramer2014-10-031-2/+2
| | | | llvm-svn: 219031
* CFE Knob for: Add a thread-model knob for lowering atomics on baremetal & ↵Jonathan Roelofs2014-10-035-5/+43
| | | | | | | | single threaded systems http://reviews.llvm.org/D4985 llvm-svn: 219027
* [analyzer] Refactor and cleanup IsCompleteTypeAnna Zaks2014-10-033-37/+4
| | | | | | | | | | There are three copies of IsCompleteType(...) functions in CSA and all of them are incomplete (I experienced crashes in some CSA's test cases). I have replaced these function calls with Type::isIncompleteType() calls. A patch by Aleksei Sidorin! llvm-svn: 219026
OpenPOWER on IntegriCloud