summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-033-2/+34
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246755
* [OPENMP 4.1] Codegen for extended format of 'if' clause.Alexey Bataev2015-09-031-4/+12
| | | | | | Fixed codegen for extended format of 'if' clauses with special 'directive-name-modifier' + ast-print tests for extended format of 'if' clause. llvm-svn: 246748
* [OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.Alexey Bataev2015-09-036-75/+256
| | | | | | | | | | | | | | | | | OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause. Format of 'if' clause is as follows: ``` if([ directive-name-modifier :] scalar-logical-expression) ``` The restriction rules are also changed. 1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'. 2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive. 3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive. 'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied. llvm-svn: 246747
* Remove inadvertent debug output from prior change.Douglas Katzman2015-09-021-1/+0
| | | | llvm-svn: 246715
* Use new utility function to clean leading junk from pathnames. NFCDouglas Katzman2015-09-022-18/+4
| | | | llvm-svn: 246714
* Migrate the target attribute parsing code to returning an instanceEric Christopher2015-09-021-11/+11
| | | | | | | | every time it's called rather than attempting to cache the result. It's unlikely to be called frequently and the overhead of using it in the first place is already factored out. llvm-svn: 246706
* Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.Ivan Krasin2015-09-022-3/+12
| | | | | | | | | | | | | | | | | Summary: Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output. Introduce a frontend option -fdepfile-entry, and only insert them for the user-defined sanitizer blacklists. In frontend, grab ExtraDeps from -fdepfile-entry, instead of -fsanitize-blacklist. Reviewers: rsmith, pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12544 llvm-svn: 246700
* add __builtin_unpredictable and convert to metadataSanjay Patel2015-09-023-3/+27
| | | | | | | | | | | | | | | | | | | | | | | This patch depends on r246688 (D12341). The goal is to make LLVM generate different code for these functions for a target that has cheap branches (see PR23827 for more details): int foo(); int normal(int x, int y, int z) { if (x != 0 && y != 0) return foo(); return 1; } int crazy(int x, int y) { if (__builtin_unpredictable(x != 0 && y != 0)) return foo(); return 1; } Differential Revision: http://reviews.llvm.org/D12458 llvm-svn: 246699
* [modules] Don't waste time reading in the names the module file writer gave ↵Richard Smith2015-09-021-7/+1
| | | | | | to blocks. We don't need these names, and decoding the corresponding bitcode has a significant cost. llvm-svn: 246680
* [MS ABI] Number unnamed TagDecls which aren't externally visibleDavid Majnemer2015-09-021-1/+3
| | | | | | | | | | | | TagDecls (structs, enums, etc.) may have the same name for linkage purposes of one another; to disambiguate, we add a number to the mangled named. However, we didn't do this if the TagDecl has a pseudo-name for linkage purposes (it was defined alongside a DeclaratorDecl or a TypeNameDecl). This fixes PR24651. llvm-svn: 246659
* [OpenMP] Make helper functoin static. NFC.Benjamin Kramer2015-09-021-1/+1
| | | | llvm-svn: 246657
* [Shave]: pass through more clang options to moviCompileDouglas Katzman2015-09-021-0/+1
| | | | llvm-svn: 246652
* [Sparc]: GCCInstallationDetector should not care if little-endianDouglas Katzman2015-09-021-1/+1
| | | | llvm-svn: 246650
* Silence a -Wsign-compare warning; NFC.Aaron Ballman2015-09-021-1/+1
| | | | llvm-svn: 246646
* [Sema] Avoid crash on tag-type mismatch (Fixes PR24610)Vedant Kumar2015-09-021-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D12444 llvm-svn: 246618
* Migrate the target attribute parsing code into an extension off ofEric Christopher2015-09-021-29/+8
| | | | | | | | | | the main attribute and cache the results so we don't have to parse a single attribute more than once. This reapplies r246596 with a fix for an uninitialized class member, and a couple of cleanups and formatting changes. llvm-svn: 246610
* Fix assertion failure in TransformOpaqueValueExprHubert Tong2015-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: `OpaqueValueExpr`s may not have a source expression (as in the case when they are created due to a default argument error). This can cause an assertion failure in `TransformOpaqueValueExpr` during template instantiation. This patch fixes the assertion failure. Reviewers: hfinkel, rsmith Subscribers: fraggamuffin, cfe-commits Differential Revision: http://reviews.llvm.org/D11582 Patch by Rachel Craik! llvm-svn: 246600
* Revert "Migrate the target attribute parsing code into an extension off of"Eric Christopher2015-09-011-8/+29
| | | | | | | | This is failing in release mode. Revert while I figure out what's happening. This reverts commit r246596. llvm-svn: 246598
* Migrate the target attribute parsing code into an extension off ofEric Christopher2015-09-011-29/+8
| | | | | | | the main attribute and cache the results so we don't have to parse a single attribute more than once. llvm-svn: 246596
* Use hasAttr, not getAttr if we're just checking for presence.Eric Christopher2015-09-011-1/+1
| | | | llvm-svn: 246595
* [MS ABI] Switch to the CRC implementation in LLVMDavid Majnemer2015-09-011-29/+5
| | | | | | | We now have an implementation of the CRC in LLVM's libSupport. Let's consolidate around that one. llvm-svn: 246591
* Re-commit r246497 (and dependent changes r246524 and r246521), reverted inRichard Smith2015-09-017-231/+523
| | | | | | | | | | | | | | | | | | | r246546, with a workaround for an MSVC 2013 miscompile and an MSVC 2015 rejects-valid. Original commit message: [modules] Rework serialized DeclContext lookup table management. Instead of walking the loaded ModuleFiles looking for lookup tables for the context, store them all in one place, and merge them together if we find we have too many (currently, more than 4). If we do merge, include the merged form in our serialized lookup table, so that downstream readers never need to look at our imports' tables. This gives a huge performance improvement to builds with very large numbers of modules (in some cases, more than a 2x speedup was observed). llvm-svn: 246582
* Pull initFeatureMap out of line now that it's used in multiple places.Eric Christopher2015-09-011-0/+12
| | | | llvm-svn: 246565
* Add a new frontend warning for referencing members from the handler of a ↵Aaron Ballman2015-09-018-33/+65
| | | | | | | | constructor or destructor function-try-block, which is UB in C++. This corresponds to the CERT secure coding rule ERR53-CPP. llvm-svn: 246548
* Reverting r246497 (which requires also reverting r246524 and r246521 to ↵Aaron Ballman2015-09-017-505/+231
| | | | | | | | | | | avoid merge conflicts). It broke the build on MSVC 2015. It also broke an MSVC 2013 bot with testing issues. llvm\tools\clang\lib\serialization\MultiOnDiskHashTable.h(117): error C2065: 'Files': undeclared identifier http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/2917 llvm-svn: 246546
* [modules] When emitting line tables, only emit filenames that are actually ↵Richard Smith2015-09-012-7/+18
| | | | | | referenced by the entries that we emit. llvm-svn: 246534
* Don't use fprintf to emit this diagnostic!Richard Smith2015-09-011-3/+3
| | | | llvm-svn: 246526
* Use a more appropriate way of writing 1.Richard Smith2015-09-011-2/+1
| | | | llvm-svn: 246524
* [MS ABI] Cleanup get*ForUnnamedTagDeclDavid Majnemer2015-09-011-4/+4
| | | | | | | Use "lookup" instead of operator[], it will not perform unnecessary insertions. No functionality change is intended. llvm-svn: 246523
* [modules] Preserve DeclID order when merging lookup tables to give a moreRichard Smith2015-09-013-10/+40
| | | | | | | | predictable diagnostic experience. The hash-of-DeclID order we were using before gave different results on Win32 due to a different predefined declaration of __builtin_va_list. llvm-svn: 246521
* [PowerPC] Support __builtin_ppc_get_timebaseHal Finkel2015-08-311-0/+5
| | | | | | | | | | GCC 4.8+ has a PowerPC-specific intrinsic, __builtin_ppc_get_timebase, to do what Clang's __builtin_readcyclecounter does. For compatibility with code that uses GCC's spelling (including glibc), support it as well. Partially fixes PR23681. llvm-svn: 246510
* Revert "Pull the target attribute parsing out of CGCall and onto TargetInfo."Eric Christopher2015-08-312-56/+35
| | | | | | This reverts commit r246468 while we figure out what to do about Basic and AST. llvm-svn: 246508
* [modules] Add some missing blockinfo records.Richard Smith2015-08-311-2/+31
| | | | llvm-svn: 246504
* [modules] Rework serialized DeclContext lookup table management. Instead ofRichard Smith2015-08-317-231/+476
| | | | | | | | | | | | | walking the loaded ModuleFiles looking for lookup tables for the context, store them all in one place, and merge them together if we find we have too many (currently, more than 4). If we do merge, include the merged form in our serialized lookup table, so that downstream readers never need to look at our imports' tables. This gives a huge performance improvement to builds with very large numbers of modules (in some cases, more than a 2x speedup was observed). llvm-svn: 246497
* Revert r246345 until an assertion is fixed.Gabor Horvath2015-08-312-166/+9
| | | | llvm-svn: 246479
* Stop hardcoding GCC paths in crt/ld.so lookup.Rafael Espindola2015-08-313-43/+123
| | | | | | | | | | This patch refactors the code to use the GCC installation detector (modified so that it works in Solaris), and uses ToolChain::GetFilePath everywhere once it works. Patch by Xan López <xan@igalia.com>! llvm-svn: 246473
* [MS ABI] Correctly mangle classes without names for linkage purposesDavid Majnemer2015-08-3110-39/+122
| | | | | | | | | | | | | | | | A class without a name for linkage purposes gets a name along the lines of <unnamed-type-foo> where foo is either the name of a declarator which defined it (like a variable or field) or a typedef-name (like a typedef or alias-declaration). We handled the declarator case correctly but it would fall down during template instantiation if the declarator didn't share the tag's type. We failed to handle the typedef-name case at all. Instead, keep track of the association between the two and keep it up to date in the face of template instantiation. llvm-svn: 246469
* Pull the target attribute parsing out of CGCall and onto TargetInfo.Eric Christopher2015-08-312-35/+56
| | | | | | | | | Also: - Add a typedef to make working with the result easier. - Update callers to use the new function. - Make initFeatureMap out of line. llvm-svn: 246468
* Pull out the ppc incompatible features check into a separate function.Eric Christopher2015-08-311-27/+36
| | | | llvm-svn: 246467
* [CUDA] fix codegen for __nvvm_atom_min/max_gen_u*Jingyue Wu2015-08-311-2/+6
| | | | | | | | | | | | Summary: Clang should emit "atomicrmw umin/umax" instead of "atomicrmw min/max". Reviewers: eliben, tra Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12487 llvm-svn: 246455
* PR17829: Proper diagnostic of mangled names conflictsAndrey Bokhanko2015-08-314-98/+154
| | | | | | | | | | Proper diagnostic and resolution of mangled names conflicts between C++ methods and C functions. This patch implements support for functions/methods only; support for variables is coming separately. Differential Revision: http://reviews.llvm.org/D11297 llvm-svn: 246438
* [OPENMP 4.0] Codegen for array sections.Alexey Bataev2015-08-313-7/+193
| | | | | | Added codegen for array section in 'depend' clause of 'task' directive. It emits to pointers, one for the begin of array section and another for the end of array section. Size of the section is calculated as (end + 1 - start) * sizeof(basic_element_type). llvm-svn: 246422
* [OpenCL] Improve diagnostics detecting implicit vector conversion.Alexey Bader2015-08-301-0/+12
| | | | | | | | Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12470 llvm-svn: 246393
* [OpenMP] Make the filetered clause iterator a real iterator and type safe.Benjamin Kramer2015-08-303-90/+50
| | | | | | | | | This replaces the filtered generic iterator with a type-specfic one based on dyn_cast instead of comparing the kind enum. This allows us to use range-based for loops and eliminates casts. No functionality change intended. llvm-svn: 246384
* Update for several APIs in LLVM that now use StringRefs rather thanChandler Carruth2015-08-304-23/+17
| | | | | | | | const char pointers. In turn, push this through Clang APIs as well, simplifying a number of bits of code that was handling the oddities of nullptrs. llvm-svn: 246375
* Update for API change in LLVM: ARMTargetParser class is just the ARMChandler Carruth2015-08-303-22/+22
| | | | | | namespace. llvm-svn: 246368
* [AST] Don't crash when comparing incomplete objectDavid Majnemer2015-08-291-1/+7
| | | | | | | | | | We cannot tell if an object is past-the-end if its type is incomplete. Zero sized objects satisfy past-the-end criteria and our object might turn out to be such an object. This fixes PR24622. llvm-svn: 246359
* Follow-up to r246338: use getParentFunctionOrMethodHans Wennborg2015-08-281-1/+1
| | | | llvm-svn: 246348
* PR24612: Don't bail out of checking a constexpr function before checkingRichard Smith2015-08-281-3/+3
| | | | | | | whether it can ever produce a constant expression in the case where it has a void return type and no return statements. llvm-svn: 246347
* Fold TargetInfo::handleUserFeatures into TargetInfo::initFeatureMap.Eric Christopher2015-08-281-44/+38
| | | | llvm-svn: 246346
OpenPOWER on IntegriCloud