summaryrefslogtreecommitdiff
path: root/lib/Basic/IdentifierTable.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Sema][ObjC] Fix a -Wformat false positive with localizedStringForKeyErik Pilkington2019-08-141-0/+15
| | | | | | | | | | | | Only honour format_arg attributes on -[NSBundle localizedStringForKey] when its argument has a format specifier in it, otherwise its likely to just be a key to fetch localized strings. Fixes rdar://23622446 Differential revision: https://reviews.llvm.org/D27165 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368878 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++20] Implement context-sensitive header-name lexing and pp-import parsing ↵Richard Smith2019-04-111-1/+1
| | | | | | in the preprocessor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358231 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable coroutines under -std=c++2a.Richard Smith2019-02-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354736 91177308-0d34-0410-b5e6-96231b3b80d8
* [MSVC] Recognize `static_assert` keyword in C and C++98Reid Kleckner2019-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main effect is that clang now accepts the following conforming C11 code with MSVC headers: #include <assert.h> static_assert(1, "true"); This is a non-conforming extension (the keyword is outside the implementer's namespace), so it is placed under -fms-compatibility instead of -fms-extensions like most MSVC-specific keyword extensions. Normally, in C11, the compiler is supposed to provide the _Static_assert keyword, and assert.h should define static_assert to _Static_assert. However, that is not what MSVC does, and MSVC doesn't even provide _Static_assert. This also has the less important side effect of enabling static_assert in C++98 mode with -fms-compatibility. It's exceptionally difficult to use modern MSVC headers without C++14 even, so this is relatively unimportant. Fixes PR26672 Patch by Andrey Bokhanko! Reviewers: rsmith, thakis Subscribers: cfe-commits, STL_MSFT Differential Revision: https://reviews.llvm.org/D17444 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354162 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* [Basic] Cleanups in IdentifierInfo following the removal of PTHBruno Ricci2018-12-051-22/+0
| | | | | | | | | | | | | | | | | | | The Entry pointer in IdentifierInfo was only null for IdentifierInfo created from a PTH. Now that PTH support has been removed we can remove some PTH specific code in IdentifierInfo::getLength and IdentifierInfo::getNameStart. Also make the constructor of IdentifierInfo private to make sure that they are only created by IdentifierTable, and move it to the header so that it can be inlined in IdentifierTable::get and IdentifierTable::getOwn. Differential Revision: https://reviews.llvm.org/D54866 Reviewed By: erichkeane git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348384 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345882 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Merge KEYOBJC and KEYARCErik Pilkington2018-10-301-25/+23
| | | | | | | We used to only define ARC keywords in -fobjc-arc mode, but now that we define them in ObjC mode, there isn't any reason to keep them seperate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345646 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)Erik Pilkington2018-10-301-8/+5
| | | | | | | | | | We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC. Differential revision: https://reviews.llvm.org/D53547 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345637 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Actually enable -mzvector keywordsUlrich Weigand2018-10-161-0/+1
| | | | | | | | | | | | | | | | It appears when initially committing the support for the IBM Z vector extension language, one critical line was lost, causing the specific keywords __vector, __bool, and vec_step to not actually be enabled. (Note that this does not affect "vector" and "bool"!) Unfortunately, this was not caught by any tests either. (All existing Z vector tests just use the regular "vector" and "bool" keywords ...) Fixed by adding the missing line and updating the tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344611 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Various optimizations + refactoring in DeclarationName(Table)Bruno Ricci2018-09-211-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the following optimizations in DeclarationName(Table): 1. Store common kinds inline in DeclarationName instead of DeclarationNameExtra. Currently the kind of C++ constructor, destructor, conversion function and overloaded operator names is stored in DeclarationNameExtra. Instead store it inline in DeclarationName. To do this align IdentifierInfo, CXXSpecialName, DeclarationNameExtra and CXXOperatorIdName to 8 bytes so that we can use the lower 3 bits of DeclarationName::Ptr. This is already the case on 64 bits archs anyway. This also allow us to remove DeclarationNameExtra from CXXSpecialName and CXXOperatorIdName, which shave off a pointer from CXXSpecialName. 2. Synchronize the enumerations DeclarationName::NameKind, DeclarationName::StoredNameKind and Selector::IdentifierInfoFlag. This makes DeclarationName::getNameKind much more efficient since we can replace the switch table by a single comparison and an addition. 3. Put the overloaded operator names inline in DeclarationNameTable to remove an indirection. This increase the size of DeclarationNameTable a little bit but this is not important since it is only used in ASTContext, and never copied nor moved from. This also get rid of the last dynamic allocation in DeclarationNameTable. Altogether these optimizations cut the run time of parsing all of Boost by about 0.8%. While we are at it, do the following NFC modifications: 1. Put the internal classes CXXSpecialName, CXXDeductionGuideNameExtra, CXXOperatorIdName, CXXLiteralOperatorIdName and DeclarationNameExtra in a namespace detail since these classes are only meant to be used by DeclarationName and DeclarationNameTable. Make this more explicit by making the members of these classes private and friending DeclarationName(Table). 2. Make DeclarationName::getFETokenInfo a non-template since every users are using it to get a void *. It was supposed to be used with a type to avoid a subsequent static_cast. 3. Change the internal functions DeclarationName::getAs* to castAs* since when we use them we already know the correct kind. This has no external impact since all of these are private. Reviewed By: erichkeane, rjmccall Differential Revision: https://reviews.llvm.org/D52267 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342729 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-301-9/+9
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* Add dump method for selectorsAditya Kumar2018-05-311-0/+2
| | | | | | | Differential Revision: https://reviews.llvm.org/D45935 Reviewers: compnerd git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333657 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST][ObjC] Print implicit property expression that only has a setter ↵Alex Lorenz2018-05-231-0/+6
| | | | | | | | | without crashing rdar://40447209 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333046 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Restrict various keywords in OpenCL C++ modeSven van Haastregt2018-05-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Restrict the following keywords in the OpenCL C++ language mode, according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification. - dynamic_cast - typeid - register (already restricted in OpenCL C, update the diagnostic) - thread_local - exceptions (try/catch/throw) - access qualifiers read_only, write_only, read_write Support the `__global`, `__local`, `__constant`, `__private`, and `__generic` keywords in OpenCL C++. Leave the unprefixed address space qualifiers such as global available, i.e., do not mark them as reserved keywords in OpenCL C++. libclcxx provides explicit address space pointer classes such as `global_ptr` and `global<T>` that are implemented using the `__`-prefixed qualifiers. Differential Revision: https://reviews.llvm.org/D46022 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331874 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-6/+6
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-011-7/+9
| | | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331244 91177308-0d34-0410-b5e6-96231b3b80d8
* Defer adding keywords to the identifier table until after the language ↵Aaron Ballman2018-04-161-6/+9
| | | | | | | | | | options have been loaded from the AST file. This fixes issues with "class" being reported as an identifier in "enum class" because the construct is not present when using default language options. Patch by Johann Klähn. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330159 91177308-0d34-0410-b5e6-96231b3b80d8
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-11-031-25/+43
| | | | | | other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317381 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for ↵Richard Smith2017-08-131-2/+6
| | | | | | C++17 and before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310803 91177308-0d34-0410-b5e6-96231b3b80d8
* Added missing break.Galina Kistanova2017-06-031-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304653 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299950 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][ObjC] Warn about 'performSelector' calls with selectorsAlex Lorenz2017-03-061-2/+4
| | | | | | | | | | | | | | | | | | | | that return record or vector types The performSelector family of methods from Foundation use objc_msgSend to dispatch the selector invocations to objects. However, method calls to methods that return record types might have to use the objc_msgSend_stret as the return value won't find into the register. This is also supported by this sentence from performSelector documentation: "The method should not have a significant return value and should take a single argument of type id, or no arguments". This commit adds a new warning that warns when a selector which corresponds to a method that returns a record type is passed into performSelector. rdar://12056271 Differential Revision: https://reviews.llvm.org/D30174 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297019 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some more asserts to clearly indicate that there are special casesChandler Carruth2016-11-041-2/+4
| | | | | | | | | | | | | | | | | which guarantee pointers are not null. These all seem to have useful properties and correlations to document, in one case we even had it in a comment but now it will also be an assert. This should prevent PVS-Studio from incorrectly claiming that there are a bunch of potential bugs here. But I feel really strongly that the PVS-Studio warnings that pointed at this code have a far too high false-positive rate to be entirely useful. These are just places where there did seem to be a useful invariant to document and verify with an assert. Several other places in the code were already correct and already have perfectly clear code documenting and validating their invariants, but still ran afoul of PVS-Studio. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285985 91177308-0d34-0410-b5e6-96231b3b80d8
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-2/+2
| | | | | | No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284730 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Rename driver flag -fcoroutines to -fcoroutines-tsGor Nishanov2016-10-021-1/+1
| | | | | | | | | | | | | | | Summary: Also makes -fcoroutines_ts to be both a Driver and CC1 flag. Patch mostly by EricWF. Reviewers: rnk, cfe-commits, rsmith, EricWF Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D25130 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283064 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and markRichard Smith2016-07-231-2/+4
| | | | | | | 'module' and 'import' as keywords when the flag is specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276508 91177308-0d34-0410-b5e6-96231b3b80d8
* [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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259901 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Add lexer support for co_await, co_yield, and co_return keywords.Richard Smith2015-10-221-1/+3
| | | | | | | | Add -fcoroutines flag (just for -cc1 for now) to enable the feature. Early indications are that this will be part of -std=c++1z. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250980 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll-back r250822.Angel Garcia Gomez2015-10-201-2/+2
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250827 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-2/+2
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250822 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -f[no-]declspec to control recognition of __declspec as a keywordSaleem Abdulrasool2015-10-041-4/+1
| | | | | | | | | | | | | | | In versions of clang prior to r238238, __declspec was recognized as a keyword in all modes. It was then changed to only be enabled when Microsoft or Borland extensions were enabled (and for CUDA, as a temporary measure). There is a desire to support __declspec in Playstation code, and possibly other environments. This commit adds a command-line switch to allow explicit enabling/disabling of the recognition of __declspec as a keyword. Recognition is enabled by default in Microsoft, Borland, CUDA, and PS4 environments, and disabled in all other environments. Patch by Warren Ristow! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249279 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for System z vector language extensionsUlrich Weigand2015-07-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The z13 vector facility has an associated language extension, closely modeled on AltiVec/VSX. The main differences are: - vector long, vector float and vector pixel are not supported - vector long long and vector double are supported (like VSX) - comparison operators return a vector rather than a scalar integer - shift operators behave like the OpenCL shift operators - vector bool is only supported as argument to certain operators; some operators allow mixing a bool with a non-bool vector This patch adds clang support for the extension. It is closely modelled on the AltiVec support. Similarly to the -faltivec option, there's a new -fzvector option to enable the extensions (as well as an -mzvector alias for compatibility with GCC). There's also a separate LangOpt. The extension as implemented here is intended to be compatible with the -mzvector extension recently implemented by GCC. Based on a patch by Richard Sandiford. Differential Revision: http://reviews.llvm.org/D11001 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243642 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the Objective-C __kindof type qualifier.Douglas Gregor2015-07-071-1/+3
| | | | | | | | | | The __kindof type qualifier can be applied to Objective-C object (pointer) types to indicate id-like behavior, which includes implicit "downcasting" of __kindof types to subclasses and id-like message-send behavior. __kindof types provide better type bounds for substitutions into unspecified generic types, which preserves more type information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241548 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Before checking whether the controlling macro of a header is defined,Richard Smith2015-07-011-2/+0
| | | | | | | | | | | | update the identifier in case we've imported a definition of the macro (and thus the contents of the header) from a module. Also fold ExternalIdentifierLookup into ExternalPreprocessorSource; it no longer makes sense to keep these separate now that the only user of the former also needs the latter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241137 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace __double_underscored type nullability qualifiers with ↵Douglas Gregor2015-06-241-4/+5
| | | | | | | | | | | | | | | | _Uppercase_underscored Addresses a conflict with glibc's __nonnull macro by renaming the type nullability qualifiers as follows: __nonnull -> _Nonnull __nullable -> _Nullable __null_unspecified -> _Null_unspecified This is the major part of rdar://problem/21530726, but does not yet provide the Darwin-specific behavior for the old names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240596 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress bogus gcc -Wreturn-type warnings.Nico Weber2015-06-201-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240199 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend type nullability qualifiers for Objective-C.Douglas Gregor2015-06-191-0/+14
| | | | | | | | | | | | | | | Introduce context-sensitive, non-underscored nullability specifiers (nonnull, nullable, null_unspecified) for Objective-C method return types, method parameter types, and properties. Introduce Objective-C-specific semantics, including computation of the nullability of the result of a message send, merging of nullability information from the @interface of a class into its @implementation, etc . This is the Objective-C part of rdar://problem/18868820. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240154 91177308-0d34-0410-b5e6-96231b3b80d8
* [Concepts] lex keywords: concept and requiresHubert Tong2015-06-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch enables lexing of `concept` and `requires` as keywords. Further changes which add messages for future keyword compat are to follow. Test Plan: Testing of C++14 + Concepts TS mode is added to `test/Lexer/keywords_test.cpp`, which expects that the new keywords are enabled under said mode. Reviewers: faisalv, fraggamuffin, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10233 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239128 91177308-0d34-0410-b5e6-96231b3b80d8
* __declspec is not a core Clang language extension. Instead, require ↵Aaron Ballman2015-05-261-0/+6
| | | | | | | | -fms-extensions or -fborland to enable the language extension. Note: __declspec is also temporarily enabled when compiling for a CUDA target because there are implementation details relying on __declspec(property) support currently. When those details change, __declspec should be disabled for CUDA targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238238 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize future keyword compat diagnostics.Richard Smith2015-05-141-2/+2
| | | | | | | | | | | | | This, in preparation for the introduction of more new keywords in the implementation of the C++ language, generalizes the support for future keyword compat diagnostics (e.g., diag::warn_cxx11_keyword) by extending the applicability of the relevant property in IdentifierTable with appropriate renaming. Patch by Hubert Tong! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237332 91177308-0d34-0410-b5e6-96231b3b80d8
* Give isCompatibleWithMSVC a better interfaceDavid Majnemer2015-05-111-1/+1
| | | | | | | We now use an enum which maps the marketing name (almost always a year) to the major version number. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236967 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL: CL2.0 atomic typesAnastasia Stulova2015-03-181-4/+11
| | | | | | | | | | | | | | OpenCL C Spec v2.0 Section 6.13.11 - Made c11 _Atomic being not accepted for OpenCL - Implemented CL2.0 atomics by aliasing them to the corresponding c11 atomic types using implicit typedef - Added diagnostics for atomics Khronos extension enabling git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232631 91177308-0d34-0410-b5e6-96231b3b80d8
* MSVC Compat: Permit char16_t, char32_t and _Atomic when targeting > 2013David Majnemer2015-03-181-3/+4
| | | | | | | | We disabled support for _Atomic because the STL had name conflicts, they've been resolved in 2015. Similarly, reenable char16_t and char32_t. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232611 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-111-2/+27
| | | | | | | | Recommit of r223114, reverted in r223120. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224012 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.Serge Pavlov2014-12-021-27/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223120 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-021-2/+27
| | | | | | | | | | | | | | | | | | | | | | Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223114 91177308-0d34-0410-b5e6-96231b3b80d8
* Use enumerators instead of hardcoded integers when we decide if keyword is ↵Serge Pavlov2014-10-291-28/+38
| | | | | | enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220849 91177308-0d34-0410-b5e6-96231b3b80d8