summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [mips] Removing __SIZEOF_INT128__ macro for MIPS64Simon Atanasyan2014-12-101-1/+6
| | | | | | | | | | | | | This is a temporary workaround while MIPS64 has not yet fully supported 128-bit integers. But declaration of int128 type is necessary even though `__SIZEOF_INT128__` is undefined because c++ standard header files like `limits` throw error message if `__int128` is not available. Patch by Sagar Thakur. Differential Revision: http://reviews.llvm.org/D6402 llvm-svn: 223927
* CUDA host device code with two code pathsReid Kleckner2014-12-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: Allow CUDA host device functions with two code paths using __CUDA_ARCH__ to differentiate between code path being compiled. For example: __host__ __device__ void host_device_function(void) { #ifdef __CUDA_ARCH__ device_only_function(); #else host_only_function(); #endif } Patch by Jacques Pienaar. Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D6457 llvm-svn: 223271
* Remove -fseh-exceptions in favor of checking the tripleReid Kleckner2014-11-141-2/+0
| | | | | | | | | This option was misleading because it looked like it enabled the language feature of SEH (__try / __except), when this option was really controlling which EH personality function to use. Mingw only supports SEH and SjLj EH on x86_64, so we can simply do away with this flag. llvm-svn: 221963
* Update Clang's SD-6 support to match N4200 (except for __has_cpp_attribute,Richard Smith2014-11-121-0/+16
| | | | | | which we don't yet implement). llvm-svn: 221816
* Frontend: Define __EXCEPTIONS if -fexceptions is passedDavid Majnemer2014-10-271-1/+1
| | | | | | | | | GCC defines __EXCEPTIONS, regardless of language mode, if -fexceptions is passed. We should do the same. This fixes PR21358. llvm-svn: 220714
* Follow-up commit to r211657 which introduced these macros, but not for MSVC. ↵Aaron Ballman2014-10-211-54/+48
| | | | | | This turns out to break our freestanding tests on Windows when compiling in MSVC-compatible mode. It was decided (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141020/116942.html is the start of the thread) to support this as part of Clang's interface on all platforms. llvm-svn: 220312
* Add -fseh-exceptions for MinGW-w64Reid Kleckner2014-09-151-0/+2
| | | | | | | | | | | | | | This adds a flag called -fseh-exceptions that uses the native Windows .pdata and .xdata unwind mechanism to throw exceptions. The other EH possibilities are DWARF and SJLJ exceptions. Patch by Martell Malone! Reviewed By: asl, rnk Differential Revision: http://reviews.llvm.org/D3419 llvm-svn: 217790
* C++1y is now C++14!Aaron Ballman2014-08-191-3/+3
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Correctly implement -include search logic.Manuel Klimek2014-08-121-14/+10
| | | | | | | | | | | | | | | According to the gcc docs, -include uses the current working directory for the lookup instead of the main source file. This patch gets rid of NormalizeIncludePath (which relied on an implementation detail of FileManager / FileEntry for the include path logic to work), and instead hands the correct lookup information down to LookupFile. This will allow us to change the FileEntry's behavior regarding its Name caching. llvm-svn: 215433
* Predefine IB_DESIGNABLE and IBInspectable macros. <rdar://problem/17441860>Bob Wilson2014-08-081-0/+2
| | | | | | | | | These macros are used as markers for Interface Builder and need to be defined to empty strings since they have no impact on the code. Patch by Ted Kremenek. llvm-svn: 215259
* If char/short are shorter than int, do not use U as suffix forJoerg Sonnenberger2014-07-171-3/+3
| | | | | | | | constants. Comparing int against a constant of the given type like UINT8_MAX will otherwise force a promotion to unsigned int, which is typically not expected. llvm-svn: 213301
* Always set the C suffix macro, even if it is empty.Joerg Sonnenberger2014-07-171-6/+2
| | | | llvm-svn: 213299
* Provide __SIG_ATOMIC_MAX__ next to __SIG_ATOMIC_WIDTH__.Joerg Sonnenberger2014-07-171-0/+1
| | | | llvm-svn: 213289
* Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.Joerg Sonnenberger2014-07-151-0/+4
| | | | llvm-svn: 213097
* Don't create non-temporary twines.Joerg Sonnenberger2014-07-151-3/+2
| | | | llvm-svn: 213066
* Make sure int64_t and uint64_t are consistent.Joerg Sonnenberger2014-07-151-2/+2
| | | | llvm-svn: 213065
* Provide builtin macros as template for PRIab and SCNab, matching theJoerg Sonnenberger2014-07-151-0/+22
| | | | | | underlaying types. llvm-svn: 213063
* [x32] Add __ILP32__ macro for ILP32 platformsPavel Chupin2014-07-141-0/+6
| | | | | | | | | | | | | | | | Summary: Add __ILP32__ and _ILP32 macro for corresponding platforms. Cover x86_64-*-*-gnux32 with test. Test Plan: test added Reviewers: chandlerc, atanasyan Subscribers: cfe-commits, dschuff, zinovy.nis Differential Revision: http://reviews.llvm.org/D4473 llvm-svn: 212931
* Avoid definining more GCC specific predefined macros in clang-clEhsan Akhgari2014-07-101-29/+31
| | | | | | | | | | Reviewers: hansw, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4419 llvm-svn: 212753
* Turn some Twine locals into const char * variables.Benjamin Kramer2014-07-081-4/+4
| | | | | | | No functionality change, just stylistic cleanup. Change made by clang-tidy and clang-format. llvm-svn: 212544
* Fix layering of file remapping and header search initializationAlp Toker2014-07-071-71/+0
| | | | | | | | These two functions initialize the source manager and header search objects and shouldn't be in InitPreprocessor which is concerned with priming the preprocessor itself and predefining macros. llvm-svn: 212434
* Do not define __STRICT_ANSI__ in clang-clEhsan Akhgari2014-06-301-1/+1
| | | | llvm-svn: 212066
* Implement predefined stdint macrosJF Bastien2014-06-251-8/+114
| | | | | | | | | | | | Add predefined stdint macros that match the given patterns: U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE} U?INT{PTR,MAX}_{MAX,TYPE} http://reviews.llvm.org/D4141 Author: binji llvm-svn: 211657
* Add -std=c++1z flag for C++17 features.Richard Smith2014-06-161-1/+4
| | | | llvm-svn: 211030
* Do not predefine __EXCEPTIONS in clang-cl (PR19977)Hans Wennborg2014-06-101-1/+1
| | | | | | | | Patch by Ehsan Akhgari! (Test tweak by me.) Differential Revision: http://reviews.llvm.org/D4065 llvm-svn: 210582
* [C++11] Use 'nullptr'. Frontend edition.Craig Topper2014-05-221-1/+1
| | | | llvm-svn: 209389
* Revert "Move -fms-extensions predefined macros into InitPreprocessor"Reid Kleckner2014-04-161-12/+0
| | | | | | | | | | This reverts commit r206413. This was proposed before, but it's not clear if this is really a good idea: http://reviews.llvm.org/D3034 llvm-svn: 206415
* Move -fms-extensions predefined macros into InitPreprocessorReid Kleckner2014-04-161-0/+12
| | | | | | | If someone on Linux asks for -fms-extensions, there's no reason not to define the feature test macros that MSVC defines. llvm-svn: 206413
* -fms-extensions: Don't define __PRETTY_FUNCTION__ to __FUNCTION__Reid Kleckner2014-04-071-4/+0
| | | | | | | This reverts r90596 from 2009. Having this macro definition makes Clang strictly less useful with -fms-extensions. llvm-svn: 205729
* Implement the MS extension __identifier properly: take a token and strip it ofRichard Smith2014-03-151-4/+0
| | | | | | its keywordliness. llvm-svn: 203987
* Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacrosRobert Lytton2014-03-101-3/+5
| | | | llvm-svn: 203455
* [OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp ↵Alexey Bataev2014-03-061-2/+2
| | | | | | simd' support) llvm-svn: 203114
* Revert "Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__"David Majnemer2014-03-021-3/+0
| | | | | | | This commit reverts r201037, it's functionality is not needed given the definition of std::max_align_t in libcxx circa r201843. llvm-svn: 202667
* Update __cplusplus to match the value in the C++14 DIS preview (D3937).Richard Smith2014-02-241-3/+5
| | | | llvm-svn: 202003
* [stackprotector] Add command line option -fstack-protector-strongJosh Magee2014-02-111-1/+3
| | | | | | | | | | This option has the following effects: * It adds the sspstrong IR attribute to each function within the CU. * It defines the macro __SSP_STRONG__ with the value of 2. Differential Revision: http://llvm-reviews.chandlerc.com/D2717 llvm-svn: 201120
* Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__David Majnemer2014-02-091-0/+3
| | | | | | | | | | TargetInfo::getSuitableAlign() was introduced in r146762 and is defined as alignof(std::max_align_t). Introduce __ALIGNOF_MAX_ALIGN_T__ which exposes getSuitableAlign() so that libc++ may take advantage of it. llvm-svn: 201037
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. llvm-svn: 199209
* Move MS predefined type_info out of InitializePredefinedMacrosAlp Toker2014-01-041-1/+0
| | | | | | | | | | | Instead of keeping it in amongst the macros, build the declaration at Sema init the same way we do with other predeclared and builtin types. In practice this means the declaration is marked implicit and therefore won't show up as an unwanted user-declared type in tooling which has been a frequently reported issue (though I haven't been able to cook up a test). llvm-svn: 198497
* Add support for C++'s SD6 feature test macros.Richard Smith2013-11-271-0/+35
| | | | llvm-svn: 195888
* Add character set related __STDC_* definitions.Ed Schouten2013-09-291-0/+8
| | | | | | | | | | | | | Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's exclusively. This means that we can define __STDC_UTF_16__ and __STDC_UTF_32__ unconditionally. While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's wchar_t's don't encode characters as ISO-10646; the encoding depends on the locale used. Because the character set used might not be a superset of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__. llvm-svn: 191631
* Add a define for the ObjFW runtime ABI version.Benjamin Kramer2013-09-161-0/+16
| | | | | | | | | This removes __has_feature(objc_msg_lookup_stret), as it is not required anymore after this patch. Patch by Jonathan Schleifer! llvm-svn: 190791
* Add new methods for TargetInfo:Stepan Dyatkovskiy2013-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | getRealTypeByWidth and getIntTypeByWidth for ASTContext names are almost same(invokes new methods from TargetInfo): getIntTypeForBitwidth and getRealTypeForBitwidth. As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly Description: Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp). For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only. Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct. Please consider the next solution: 1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here. 2. Fix handleModeAttr according to new methods in TargetInfo. This approach is implemented in the patch attached to this post. Fixes: 1st Commit (Current): Add new methods for TargetInfo: getRealTypeByWidth and getIntTypeByWidth for ASTContext names are almost same(invokes new methods from TargetInfo): getIntTypeForBitwidth and getRealTypeForBitwidth 2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function. llvm-svn: 190044
* Handle -D arguments ending in a backslash.Eli Friedman2013-08-281-1/+14
| | | | | | | | | | We translate these into #define directives; to preserve gcc-compatible semantics (where the expanded macro includes the backslash), we add an extra "\\\n" to the end of the synthesized "#define". <rdar://problem/14810220> llvm-svn: 189511
* C++1y: Update __cplusplus to temporary value 201305L to allow detection of ↵Richard Smith2013-05-071-3/+4
| | | | | | | | | provisional C++1y support. Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from the C++ features study group), and update documentation to match. llvm-svn: 181342
* Define __SIZE_MAX__ preprocessor macro.Evgeniy Stepanov2013-03-281-0/+1
| | | | llvm-svn: 178226
* [frontend] Don't put a PCH/PTH filename into the set of includes in the ↵Argyrios Kyrtzidis2013-02-051-6/+7
| | | | | | | | | | | | | preprocessor options; since only one of them is allowed in command-line, process them separately. Otherwise, if more than one is specified in the command-line, one is processed normally and the others are going to be treated and included as header files. Related to radar://13140508 llvm-svn: 174385
* Add -fopenmp -cc1 option and wire it up to define _OPENMP, from Alexey Bataev!Douglas Gregor2013-01-151-0/+10
| | | | llvm-svn: 172509
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-2/+2
| | | | llvm-svn: 171367
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Reject uses of __int128 on platforms that don't support it. Also move the uglyRichard Smith2012-11-291-0/+2
| | | | | | | 'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be properly cleaned up. llvm-svn: 168856
OpenPOWER on IntegriCloud