summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
...
* Reverting Neon vector type 64-alignment fixJaved Absar2017-05-301-5/+0
| | | | | | | The patch caused ABI breaks on darwin/others. Reverting to come back with a more restrictive patch. llvm-svn: 304220
* [ARM] Fix Neon vector type alignment to 64-bitJaved Absar2017-05-301-0/+5
| | | | | | | | | | | The maximum alignment for ARM NEON data types should be 64-bits as specified in ARM procedure call standard document Sec. A.2 Notes. This patch fixes it from its current larger natural default values, except for Android (so as not to break existing ABI). Reviewed by: Stephen Hines, Renato Golin. Differential Revision: https://reviews.llvm.org/D33205 llvm-svn: 304201
* [coroutines] Support "coroutines" feature in module map requires clauseEric Fiselier2017-05-281-0/+1
| | | | | | | | | | | | | | Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 llvm-svn: 304107
* Revert "[coroutines] Support "coroutines" feature in module map requires clause"Eric Fiselier2017-05-271-1/+0
| | | | | | This reverts commit r304054. llvm-svn: 304057
* [coroutines] Support "coroutines" feature in module map requires clauseEric Fiselier2017-05-271-0/+1
| | | | | | | | | | | | | | Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 llvm-svn: 304054
* Only define __SIZEOF_FLOAT128__ on x86 as intended in r304012Reid Kleckner2017-05-261-0/+3
| | | | | | GCC only defines it on x86. llvm-svn: 304013
* Enable __float128 for mingw for GCC compatibility and define ↵Reid Kleckner2017-05-261-1/+4
| | | | | | | | | | | | __SIZEOF_FLOAT128__ on x86 GCC defines __FLOAT128__ on Power and __SIZEOF_FLOAT128__ on x86. We're just following the inconsistency for now so users have some way to test. Effectively merges this patch as requested by Martell Malone: https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-clang/0107-enable-__float128-for-X86-MinGW.patch llvm-svn: 304012
* [X86] Adding avx512_vpopcntdq feature set and its intrinsicsOren Ben Simhon2017-05-251-4/+12
| | | | | | | | | | AVX512_VPOPCNTDQ is a new feature set that was published by Intel. The patch represents the Clang side of the addition of six intrinsics for two new machine instructions (vpopcntd and vpopcntq). It also includes the addition of the new feature set. Differential Revision: https://reviews.llvm.org/D33170 llvm-svn: 303857
* Basic: fix whitespace in file header (NFC)Saleem Abdulrasool2017-05-241-1/+1
| | | | llvm-svn: 303804
* [XRay][clang] Allow imbuing arg1 logging attribute via -fxray-always-instrument=Dean Michael Berris2017-05-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This change allows us to add arg1 logging support to functions through the special case list provided through -fxray-always-instrument=. This is useful for adding arg1 logging to functions that are either in headers that users don't have control over (i.e. cannot change the source) or would rather not do. It only takes effect when the pattern is matched through the "fun:" special case, as a category. As in: fun:*pattern=arg1 Reviewers: pelikan, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33392 llvm-svn: 303719
* Removed fallthrough annotation which does not directly precede switch label.Galina Kistanova2017-05-231-2/+0
| | | | llvm-svn: 303653
* Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.Galina Kistanova2017-05-231-1/+45
| | | | llvm-svn: 303649
* [AMDGPU] Do not require opencl triple environment for OpenCLYaxun Liu2017-05-231-6/+11
| | | | | | | | | | | | A recent change requires opencl triple environment for compiling OpenCL program, which causes regressions in libclc. This patch fixes that. Instead of deducing language based on triple environment, it checks LangOptions. Differential Revision: https://reviews.llvm.org/D33445 llvm-svn: 303644
* Give files from #line the characteristics of the current fileReid Kleckner2017-05-221-77/+16
| | | | | | | | | | This allows #line directives to appear in system headers that have code that clang would normally warn on. This is compatible with GCC, which is easy to test by running `gcc -E`. Fixes PR30752 llvm-svn: 303582
* CodeGen: Cast alloca to expected address spaceYaxun Liu2017-05-181-20/+44
| | | | | | | | | | | Alloca always returns a pointer in alloca address space, which may be different from the type defined by the language. For example, in C++ the auto variables are in the default address space. Therefore cast alloca to the expected address space when necessary. Differential Revision: https://reviews.llvm.org/D32248 llvm-svn: 303370
* [SPARC] Support 'f' and 'e' inline asm constraints.James Y Knight2017-05-121-0/+5
| | | | | | | | Patch by Patrick Boettcher. Differential Revision: https://reviews.llvm.org/D29117 llvm-svn: 302913
* [X86][LWP] Add clang support for LWP instructions.Simon Pilgrim2017-05-081-0/+8
| | | | | | | | This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4). Differential Revision: https://reviews.llvm.org/D32770 llvm-svn: 302418
* [ARM] Limit the diagnose when an ISR calls a regular functionWeiming Zhao2017-05-051-0/+1
| | | | | | | | | | | | | | | | Summary: When the function is compiled with soft-float or on CPU with no FPU, we don't need to diagnose for a call from an ISR to a regular function. Reviewers: jroelofs, eli.friedman Reviewed By: jroelofs Subscribers: aemerson, rengolin, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D32918 llvm-svn: 302274
* DiagnosticsEngine should clear DelayedDiagID before reporting theAlex Lorenz2017-05-042-5/+7
| | | | | | | | | | | | | | | | | | | | | delayed diagnostic This fix avoids an infinite recursion that was uncovered in one of our internal tests by r301992. The testcase is the most reduced version of that auto-generated test. This is an improved version of the reverted commit r302037. The previous fix actually managed to expose another subtle bug whereby `fatal_too_many_errors` error was reported twice, with the second report setting the `FatalErrorOccurred` flag. That prevented the notes that followed the diagnostic the caused `fatal_too_many_errors` to be emitted. This commit ensures that notes that follow `fatal_too_many_errors` but that belong to the diagnostic that caused `fatal_too_many_errors` won't be emitted by setting the `FatalErrorOccurred` when emitting `fatal_too_many_errors`. rdar://31962618 llvm-svn: 302151
* Revert r302037Alex Lorenz2017-05-031-2/+1
| | | | | | | | | The commit caused the following two buildbot failures: Clang :: Misc/error-limit-multiple-notes.cpp Clang :: Misc/error-limit.c llvm-svn: 302046
* DiagnosticsEngine should clear DelayedDiagID before reporting theAlex Lorenz2017-05-031-1/+2
| | | | | | | | | | | | delayed diagnostic This avoids an infinite loop that was uncovered in one of our internal tests by r301992. The testcase is the most reduced version of that auto-generated test. rdar://31962618 llvm-svn: 302037
* [modules] Round-trip -Werror flag through explicit module build.Richard Smith2017-05-032-22/+12
| | | | | | | | | | | | | | | The intent for an explicit module build is that the diagnostics produced within the module are those that were configured when the module was built, not those that are enabled within a user of the module. This includes diagnostics that don't actually show up until the module is used (for instance, diagnostics produced during template instantiation and weird cases like -Wpadded). We serialized and restored the diagnostic state for individual warning groups, but previously did not track the state for flags like -Werror and -Weverything, which are implemented as separate bits rather than as part of the diagnostics mapping information. llvm-svn: 301992
* Darwin: Define __STDC_NO_THREADS__ on Darwin targetsDuncan P. N. Exon Smith2017-04-271-0/+1
| | | | | | | | | Darwin doesn't support C11 threads.h. Define `__STDC_NO_THREADS__` so that users can check for it. rdar://problem/18461003 llvm-svn: 301508
* [OpenMP] Prepare sema to support combined constructs with omp distribute and ↵Carlo Bertolli2017-04-201-5/+1
| | | | | | | | | | omp for https://reviews.llvm.org/D32237 This patch prepares sema with additional fields to support all those composite and combined constructs of OpenMP that include pragma 'distribute' and 'for', such as 'distribute parallel for'. It also extends the regression tests for 'distribute parallel for' and adds a new one. llvm-svn: 300802
* Add #pragma clang attributeAlex Lorenz2017-04-181-0/+11
| | | | | | | | | | | | | | | | | This is a recommit of r300539 that was reverted in r300543 due to test failures. The original commit message is displayed below: The new '#pragma clang attribute' directive can be used to apply attributes to multiple declarations. An attribute must satisfy the following conditions to be supported by the pragma: - It must have a subject list that's defined in the TableGen file. - It must be documented. - It must not be late parsed. - It must have a GNU/C++11 spelling. Differential Revision: https://reviews.llvm.org/D30009 llvm-svn: 300556
* [ARM,AArch64] Define __ELF__ for arm-none-eabihf and AArch64Oliver Stannard2017-04-181-1/+8
| | | | | | | This macro is defined for arm-none-eabi as of r266625, but it should also be defined for eabihf and aarch64. llvm-svn: 300549
* Revert r300539 - Add #pragma clang attributeAlex Lorenz2017-04-181-11/+0
| | | | | | | Some tests fail on the Windows buildbots. I will have to investigate more. This commit reverts r300539, r300540 and r300542. llvm-svn: 300543
* Add #pragma clang attributeAlex Lorenz2017-04-181-0/+11
| | | | | | | | | | | | | | The new '#pragma clang attribute' directive can be used to apply attributes to multiple declarations. An attribute must satisfy the following conditions to be supported by the pragma: - It must have a subject list that's defined in the TableGen file. - It must be documented. - It must not be late parsed. - It must have a GNU/C++11 spelling. Differential Revision: https://reviews.llvm.org/D30009 llvm-svn: 300539
* When we turn on vsx it should also turn on altivec explicitly, sameEric Christopher2017-04-151-19/+21
| | | | | | | | | with disabling it as well as disabling all vsx specific features when turning off altivec. Fixes PR32663. llvm-svn: 300395
* [AMDGPU][GFX9] Set +fp32-denormals for >=gfx900 unless -cl-denorms-are-zero ↵Konstantin Zhuravlyov2017-04-141-3/+6
| | | | | | | | is set Differential Revision: https://reviews.llvm.org/D31482 llvm-svn: 300306
* Serialization: Simulate -Werror settings in implicit modulesDuncan P. N. Exon Smith2017-04-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r293123 started serializing diagnostic pragma state for modules. This makes the serialization work properly for implicit modules. An implicit module build (using Clang's internal build system) uses the same PCM file location for different `-Werror` levels. E.g., if a TU has `-Werror=format` and tries to load a PCM built without `-Werror=format`, a new PCM will be built in its place (and the new PCM should have the same signature, since r297655). In the other direction, if a TU does not have `-Werror=format` and tries to load a PCM built with `-Werror=format`, it should "just work". The idea is to evolve the PCM toward the strictest -Werror flags that anyone tries. r293123 started serializing the diagnostic pragma state for each PCM. Since this encodes the -Werror settings at module-build time, it breaks the implicit build model. This commit filters the diagnostic state in order to simulate the current compilation's diagnostic settings. Firstly, it ignores the module's serialized first diagnostic state, replacing it with the state from this compilation's command-line. Secondly, if a pragma warning was upgraded to error/fatal when generating the PCM (e.g., due to `-Werror` on the command-line), it checks whether it should still be upgraded in its current context. llvm-svn: 300025
* Modular Codegen: Add/use a bit in serialized function definitions to track ↵David Blaikie2017-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | whether they are the subject of modular codegen Some decls are created not where they are written, but in other module files/users (implicit special members and function template implicit specializations). To correctly identify them, use a bit next to the definition to track the modular codegen property. Discussed whether the module file bit could be omitted in favor of reconstituting from the modular codegen decls list - best guess today is that the efficiency improvement of not having to deserialize the whole list whenever any function is queried by a module user is worth it for the small size increase of this redundant (list + bit-on-def) representation. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D29901 llvm-svn: 299982
* [OpenCL] Map default address space to alloca address spaceYaxun Liu2017-04-111-1/+7
| | | | | | | | | | | | | | For OpenCL, the private address space qualifier is 0 in AST. Before this change, 0 address space qualifier is always mapped to target address space 0. As now target private address space is specified by alloca address space in data layout, address space qualifier 0 needs to be mapped to alloca addr space specified by the data layout. This change has no impact on targets whose alloca addr space is 0. With contributions from Matt Arsenault, Tony Tye and Wen-Heng (Jack) Chung Differential Revision: https://reviews.llvm.org/D31404 llvm-svn: 299965
* [Parser][ObjC++] Improve diagnostics and recovery when C++ keywords are usedAlex Lorenz2017-04-111-1/+14
| | | | | | | | | | | | | | | | as identifiers in Objective-C++ This commit improves the 'expected identifier' errors that are presented when a C++ keyword is used as an identifier in Objective-C++ by mentioning that this is a C++ keyword in the diagnostic message. It also improves the error recovery: the parser will now treat the C++ keywords as identifiers to prevent unrelated parsing errors. rdar://20626062 Differential Revision: https://reviews.llvm.org/D26503 llvm-svn: 299950
* [AMDGPU] Temporarily change constant address space from 4 to 2 for the new ↵Yaxun Liu2017-04-061-4/+4
| | | | | | | | | | address space mapping Change constant address space from 4 to 2 for the new address space mapping in Clang. Differential Revision: https://reviews.llvm.org/D31771 llvm-svn: 299691
* [Basic] getColumnNumber returns location of CR+LF on WindowsChih-Hung Hsieh2017-04-061-2/+11
| | | | | | | | | | | | When fixing a Clang-Tidy bug in D31406, reuse of FileID enabled the missing highlightRange function. Assertion in highlightRange failed because the end-of-range column number was 2 + the last column of a line on Windows. This fix is required to enable D31406. Differential Revision: https://reviews.llvm.org/D31713 llvm-svn: 299681
* [XRay] Add -fxray-{always,never}-instrument= flags to clangDean Michael Berris2017-03-303-0/+56
| | | | | | | | | | | | | | | | | | | | | | Summary: The -fxray-always-instrument= and -fxray-never-instrument= flags take filenames that are used to imbue the XRay instrumentation attributes using a whitelist mechanism (similar to the sanitizer special cases list). We use the same syntax and semantics as the sanitizer blacklists files in the implementation. As implemented, we respect the attributes that are already defined in the source file (i.e. those that have the [[clang::xray_{always,never}_instrument]] attributes) before applying the always/never instrument lists. Reviewers: rsmith, chandlerc Subscribers: jfb, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30388 llvm-svn: 299041
* Default enable the rtm feature only on skylake and later for now because ↵Eric Christopher2017-03-281-1/+1
| | | | | | | | | | Intel disabled the feature on some haswell and broadwell processors: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf the -mrtm option will still work normally. llvm-svn: 298956
* FileManager: mark virtual file entries as valid entriesErik Verbruggen2017-03-281-0/+1
| | | | | | | | | | | | | | | | | | The getVirtualFile method would create entries for e.g. libclang's CXUnsavedFile but not mark them as valid. The effect is that a lookup through getFile where the file name is not exactly matching the virtual file (e.g. through mixing slashes and backslashes on Windows) would result in a normal file "lookup", and re-using the file entry found by using the UniqueID, and overwrite the file entry fields. Because the lookup involves opening the file, and moving it into the file entry, the file is now open. The SourceManager keys its buffers on the UniqueID (which is still the same), so it will find an already loaded buffer. Because only the loading a buffer from disk will close the file, the FileEntry will hold on to an open file for as long as the FileManager is around. As the FileManager will only get destroyed at a reparse, you can't safe to the "leaked" and locked file on Windows. llvm-svn: 298905
* _CALL_LINUX is only defined on 64-bit ppc linux platforms, not 32-bit.Eric Christopher2017-03-251-3/+3
| | | | | | Adjust and add a test for the 32-bit side. llvm-svn: 298778
* [AMDGPU] Make AMDGPUTargetInfo::AS privateYaxun Liu2017-03-251-2/+1
| | | | llvm-svn: 298773
* Update the comment on not yet generated preprocessor defines to remove ↵Eric Christopher2017-03-251-1/+0
| | | | | | __LONGDOUBLE128. llvm-svn: 298771
* Add the __LONGDOUBLE128 define for ppc targets that have 128 bit long doubles.Eric Christopher2017-03-251-1/+3
| | | | llvm-svn: 298770
* Define __HAVE_BSWAP__ on ppc to match gcc since we support both builtins as ↵Eric Christopher2017-03-251-1/+3
| | | | | | well. llvm-svn: 298769
* [AMDGPU] Switch address space mapping by triple environment amdgizYaxun Liu2017-03-251-26/+66
| | | | | | | | For target environment amdgiz and amdgizcl (giz means Generic Is Zero), AMDGPU will use new address space mapping where generic address space is 0 and private address space is 5. The data layout is also changed correspondingly. Differential Revision: https://reviews.llvm.org/D31210 llvm-svn: 298767
* Add the _CALL_LINUX preprocessor define for ppc linux platforms.Eric Christopher2017-03-251-0/+6
| | | | | | | | This typically is only for a new enough linker (bfd >= 2.16.2 or gold), but our ppc suppport post-dates this and it should work on all linux platforms. It is guaranteed to work on all elfv2 platforms. llvm-svn: 298765
* __BIGGEST_ALIGNMENT__ has always been 16 on all power platforms ratherEric Christopher2017-03-251-2/+1
| | | | | | than the default of 8 in clang, fix and update tests accordingly. llvm-svn: 298761
* Add preprocessor defines for a bare powerpc64le triple/cpu.Eric Christopher2017-03-251-62/+72
| | | | | | | The le triple didn't exist until power8, so use that as a default (this also matches what gcc does). llvm-svn: 298759
* Move setting of LangOpts based on target flags out of CompilerInstanceEric Christopher2017-03-222-2/+10
| | | | | | | | | and into TargetInfo::adjust so that it gets called in more places throughout the compiler (AST serialization in particular). Should fix PPC modules after removing of faltivec. llvm-svn: 298487
* Remove the -faltivec alias option and replace it with -maltivec everywhere.Eric Christopher2017-03-211-19/+22
| | | | | | | | | | | The alias was only ever used on darwin and had some issues there, and isn't used in practice much. Also fixes a problem with -mno-altivec not turning off -maltivec. Also add a diagnostic for faltivec/fno-altivec that directs users to use maltivec options and include the altivec.h file explicitly. llvm-svn: 298449
OpenPOWER on IntegriCloud