summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
...
* [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE Simon Pilgrim2016-03-051-1/+0
| | | | | | | | btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17682 llvm-svn: 262772
* Make TargetInfo store an actual DataLayout instead of a string.James Y Knight2016-03-042-129/+95
| | | | | | | | | | | | | | Use it to calculate UserLabelPrefix, instead of specifying it (often incorrectly). Note that the *actual* user label prefix has always come from the DataLayout, and is handled within LLVM. The main thing clang's TargetInfo::UserLabelPrefix did was to set the #define value. Having these be different from each-other is just silly. Differential Revision: http://reviews.llvm.org/D17183 llvm-svn: 262737
* [MIPS] initFeatureMap() to handle empty string argumentBhushan D. Attarde2016-03-041-0/+2
| | | | | | | | | | | SUMMARY: This patch sets CPU string to its default value when it is not supplied by caller. Reviewers: vkalintiris, dsanders Subscribers: mohit.bhakkad, sagar, jaydeep, cfe-commits Differential Revision: http://reviews.llvm.org/D16139 llvm-svn: 262691
* [VFS] Switch from close to SafelyCloseFileDescriptorDavid Majnemer2016-03-041-13/+3
| | | | | | | | The SafelyCloseFileDescriptor machinery does the right thing in the face of signals while close will do something platform specific which results in the FD potentially getting leaked. llvm-svn: 262687
* [ARM] Add Clang targeting for ARMv8-M Baseline/MainlineBradley Smith2016-03-031-7/+13
| | | | llvm-svn: 262619
* Semantic analysis for the swiftcall calling convention.John McCall2016-03-031-13/+42
| | | | | | | 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-031-0/+1
| | | | | | | | | | | | | | | | | 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
* 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
* 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
* [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
* AMDGPU: Fix broken/confusing predefined macroMatt Arsenault2016-02-271-1/+5
| | | | | | amdgcn should not be defining __R600__ llvm-svn: 262124
* AMDGPU: Fix inconsistent register name for flat_scratchMatt Arsenault2016-02-271-2/+2
| | | | llvm-svn: 262123
* Basic: fix __USER_LABEL_PREFIX__ on CygwinSaleem Abdulrasool2016-02-261-0/+1
| | | | | | | | Adjust the user label prefix for cygwin x86_64. Resolves PR26744. llvm-svn: 262030
* Revert "[VFS] Add support for handling path traversals"Bruno Cardoso Lopes2016-02-231-39/+15
| | | | | | | | | | | | | | This reverts commit r261551 due to failing tests in windows bots: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10054 Failing Tests (4): Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName llvm-svn: 261654
* Revert "[VFS] Add 'overlay-relative' field to YAML files" and "[VFS] Fix ↵Bruno Cardoso Lopes2016-02-231-98/+19
| | | | | | | | | | | | | | | call to getVFSFromYAML in unittests" This reverts commit r261552 and r261556 because of failing unittests on windows: Failing Tests (4): Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName llvm-svn: 261613
* [VFS] Add 'overlay-relative' field to YAML filesBruno Cardoso Lopes2016-02-221-19/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 llvm-svn: 261552
* [VFS] Add support for handling path traversalsBruno Cardoso Lopes2016-02-221-15/+39
| | | | | | | | | | | | | | | | | | | | | | Handle ".", ".." and "./" with trailing slashes while collecting files to be dumped into the vfs overlay directory. Include the support for symlinks into components. Given the path: /install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin" component is a symlink, it's not safe to use `path::remove_dots` here, and `realpath` is used to get the right answer. Since `realpath` is expensive, we only do it at collecting time (which only happens during the crash reproducer) and cache the base directory for fast lookups. Overall, this makes the input to the VFS YAML file to be canonicalized to never contain traversal components. Differential Revision: http://reviews.llvm.org/D17104 rdar://problem/24499339 llvm-svn: 261551
* Added SKL and CNL processors and features to ClangElena Demikhovsky2016-02-211-14/+81
| | | | | | Differential Revision: http://reviews.llvm.org/D16756 llvm-svn: 261467
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-191-1/+0
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* ARM: fix VFP asm constraintsJF Bastien2016-02-191-2/+2
| | | | | | | | | | | | | | | Summary: Rich Felker was sad that clang used 'w' and 'P' for VFP constraints when GCC documents them as 't' and 'w': https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html This was added way back in 2008: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20080421/005393.html Subscribers: aemerson, rengolin, cfe-commits Differential Revision: http://reviews.llvm.org/D17349 llvm-svn: 261309
* Remove use of builtin comma operator.Richard Trieu2016-02-181-4/+8
| | | | | | Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261271
* [Hexagon] Specify vector alignment in DataLayout stringKrzysztof Parzyszek2016-02-121-3/+6
| | | | | | | | | | | The DataLayout can calculate alignment of vectors based on the alignment of the element type and the number of elements. In fact, it is the product of these two values. The problem is that for vectors of N x i1, this will return the alignment of N bytes, since the alignment of i1 is 8 bits. The vector types of vNi1 should be aligned to N bits instead. Provide explicit alignment for HVX vectors to avoid such complications. llvm-svn: 260680
* [Driver] Add support for Qualcomm's Kryo CPU.Chad Rosier2016-02-111-0/+1
| | | | | | http://reviews.llvm.org/D17124 llvm-svn: 260555
* [Modules] Don't infinite recurse on implicit import of circular modules in ↵Ben Langmuir2016-02-111-0/+1
| | | | | | | | | | | | | | preamble Update the Preprocessor's VisibleModuleSet when typo-correction creates an implicit module import so that we won't accidentally write an invalid SourceLocation into the preamble AST. This would later lead to infinite recursion when loading the preamble AST because we use the value in ImportLocs to prevent visiting a module twice. rdar://problem/24440990 llvm-svn: 260543
* [ARM] Add command-line options for ARMv8.2-AOliver Stannard2016-02-111-0/+2
| | | | | | | | | | | | | | | | | This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a). The FP16 extension can be enabled with the "+fp16" suffix to the -march or -mcpu option. This is consistent with the AArch64 option, rather than the usual ARM option of -mfpu. We have agreed with the team which will be upstreaming this to GCC that we want to use this new option format for new architecture extensions for both ARM and AArch64. Most of the work for this was done by the TargetParser patch in llvm. Differential Revision: http://reviews.llvm.org/D15040 llvm-svn: 260533
* Reapply the patch of r260376.Andrey Turetskiy2016-02-101-2/+2
| | | | llvm-svn: 260379
* [X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.Andrey Turetskiy2016-02-101-0/+9
| | | | | | | | This patch fixes stack alignments for MCU (should be aligned to 4 bytes). Differential Revision: http://reviews.llvm.org/D15647 llvm-svn: 260376
* [SystemZ] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macrosUlrich Weigand2016-02-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248] macros on SystemZ. This fixes a miscompile of GCC C++11 standard library headers due to use of those macros in an ABI-changing manner. See e.g. /usr/include/c++/4.8.5/ext/concurrence.h: // Compile time constant that indicates prefered locking policy in // the current configuration. static const _Lock_policy __default_lock_policy = #ifdef __GTHREADS #if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \ && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) _S_atomic; #else _S_mutex; #endif #else _S_single; #endif A different choice of __default_lock_policy causes different sizes of several of the C++11 data structures, which are then incompatible when inlined in clang-compiled code with what the (GCC-compiled) external library expects. This in turn leads to various crashes when using std::thread in code compiled with clang, as see e.g. via the ThreadPool unit tests. See PR 26473 for an example. llvm-svn: 259931
* Do not honor explicit alignment attribute on fields for PS4.Sunil Srivastava2016-02-052-0/+5
| | | | | | | | This change reverts r257462 for PS4 triple. Differential Revision: http://reviews.llvm.org/D16788 llvm-svn: 259916
* [modules] Separately track whether an identifier's preprocessor information andRichard Smith2016-02-051-0/+1
| | | | | | | | | | name lookup information have changed since deserialization. For a C++ modules build, we do not need to re-emit the identifier into the serialized identifier table if only the name lookup information has changed (and in all cases, we don't need to re-emit the macro information if only the name lookup information has changed). llvm-svn: 259901
* [x86] Correct setting of WIntType for MCU targetAndrey Bokhanko2016-02-041-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D16626 llvm-svn: 259780
* Basic: mark TLS as supported on Windows on ARMSaleem Abdulrasool2016-02-041-1/+0
| | | | | | | LLVM can now lower TLS access as per the MS ABI on ARM. This enables the generation of TLS access for Windows on ARM. llvm-svn: 259751
* [OpenMP] Parsing + sema for target parallel for directive.Arpith Chacko Jacob2016-02-031-9/+20
| | | | | | | | | | | Summary: This patch adds parsing + sema for the target parallel for directive along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16759 llvm-svn: 259654
* [OpenCL] Adding reserved operator logical xor for OpenCLAnastasia Stulova2016-02-031-0/+1
| | | | | | | | | | | | | | | | | | This patch adds the reserved operator ^^ when compiling for OpenCL (spec v1.1 s6.3.g), which results in a more meaningful error message. Patch by Neil Hickey! Review: http://reviews.llvm.org/D13280 M test/SemaOpenCL/unsupported.cl M include/clang/Basic/TokenKinds.def M include/clang/Basic/DiagnosticParseKinds.td M lib/Basic/OperatorPrecedence.cpp M lib/Lex/Lexer.cpp M lib/Parse/ParseExpr.cpp llvm-svn: 259651
* -inline-asm][X86] Add ability to use AVX512 in MS inline asmMarina Yatsina2016-02-031-0/+8
| | | | | | | | | Defined the new AVX512 registers in clang inline asm. Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information. Differential Revision: http://reviews.llvm.org/D16757 llvm-svn: 259639
* [OpenMP] Prevent nesting of target constructs within target code execution ↵Arpith Chacko Jacob2016-02-021-2/+9
| | | | | | | | | | | | | | | | | | regions. Summary: This patch enhances Sema to check for the following restriction: OpenMP 4.5 [2.17 Nesting of Regions] If a target, target update, target data, target enter data, or target exit data construct is encountered during execution of a target region, the behavior is unspecified. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16758 llvm-svn: 259464
* Undoing commit r259366 to debug buildbot failure.Arpith Chacko Jacob2016-02-011-9/+2
| | | | | | > http://reviews.llvm.org/D16758 llvm-svn: 259418
* Fix attribute((mode([word|unwind_word]))) for x32Reid Kleckner2016-02-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by H.J. Lu ``` typedef unsigned int gcc_word __attribute__((mode(word))); ``` and ``` typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word))); ``` define the largest unsigned integer types which can be stored in a general purpose register, which may not be the pointer type. For x32, they aren't pointer nor unsigned long. We should 1. Make getUnwindWordWidth and getRegisterWidth virtual, 2. Override them for x32, similar to hasInt128Type. 3. Use getRegisterWidth for __attribute__((mode(word))); This fixes PR 24706. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D16779 llvm-svn: 259383
* [OpenMP] Prevent nesting of target constructs within target code execution ↵Arpith Chacko Jacob2016-02-011-2/+9
| | | | | | | | | | | | | | | | | | regions. Summary: This patch enhances Sema to check for the following restriction: OpenMP 4.5 [2.17 Nesting of Regions] If a target, target update, target data, target enter data, or target exit data construct is encountered during execution of a target region, the behavior is unspecified. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16758 llvm-svn: 259366
* Remove the egregious PCHContainer layering hack that doesn't seem to be ↵Benjamin Kramer2016-02-011-5/+0
| | | | | | necessary anymore. llvm-svn: 259355
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-291-1/+1
| | | | | | r259192 post commit comment. llvm-svn: 259232
* Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.Yury Gribov2016-01-281-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D15804 llvm-svn: 259031
* Small refactor in isBeforeInTranslationUnit.Yury Gribov2016-01-281-6/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D15804 llvm-svn: 259030
* ARMv7k: select ABI based on v7k Arch rather than watchos OS.Tim Northover2016-01-271-5/+5
| | | | | | | | Various bits we'd like to use the new ABI actually compile with "-arch armv7k -miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how slices work. llvm-svn: 258976
* Revert "Change of UserLabelPrefix default value from "_" to """James Y Knight2016-01-272-23/+32
| | | | | | | | | | | | | This reverts commit r258504. This commit breaks (at least) sparc-rtems -- the OS (RTEMS) used to override UserLabelPrefix to "", despite the arch (SPARC) having set it to "_". Now, the OS doesn't override anymore, but the arch sets it to "_", resulting in the wrong value. I expect this probably breaks other OSes that overrode to "" before, as well. (Clearly we have some missing test cases, here...) llvm-svn: 258894
* Remove autoconf supportChris Bieneman2016-01-261-40/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* [OpenMP] Parsing + sema for target parallel directive.Arpith Chacko Jacob2016-01-261-1/+12
| | | | | | | | | | | | | Summary: This patch adds parsing + sema for the target parallel directive and its clauses along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16553 Rebased to current trunk and updated test cases. llvm-svn: 258832
* [OpenMP] Parsing + sema for defaultmap clause.Arpith Chacko Jacob2016-01-261-0/+22
| | | | | | | | | | | Summary: This patch adds parsing + sema for the defaultmap clause associated with the target directive (among others). Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16527 llvm-svn: 258817
* Recommit: R258773 [OpenCL] Pipe builtin functionsXiuli Pan2016-01-261-1/+2
| | | | | | | | | | | | | | | | | Fix arc patch fuzz error. Summary: Support for the pipe built-in functions for OpenCL 2.0. The pipe builtin functions may have infinite kinds of element types, one approach would be to just generate calls that would always use generic types such as void*. This patch is based on bader's opencl support patch on SPIR-V branch. Reviewers: Anastasia, pekka.jaaskelainen Subscribers: keryell, bader, cfe-commits Differential Revision: http://reviews.llvm.org/D15914 llvm-svn: 258782
OpenPOWER on IntegriCloud