summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-6/+6
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* No longer defining GNUC mode when compiling for Microsoft compatibility. ↵Aaron Ballman2012-03-101-5/+8
| | | | | | This allows people's cross-platform compiler-specific macros to work properly. llvm-svn: 152512
* [Basic] Rename LangOptions::NoInline to NoInlineDefine, to make things a bitDaniel Dunbar2012-03-091-1/+1
| | | | | | more obvious. llvm-svn: 152408
* Implement #pragma redefine_extname.David Chisnall2012-02-181-0/+3
| | | | | | This fixes PR5172 and allows clang to compile C++ programs on Solaris using the system headers. llvm-svn: 150881
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-161-0/+8
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* Add a "Modules" language option, which subsumes the previousDouglas Gregor2012-01-031-4/+0
| | | | | | "AutoModuleImport" preprocessor option and is tied to -fmodules. llvm-svn: 147448
* Teach the frontend to provide the builtin preprocessor defines forChandler Carruth2012-01-031-0/+3
| | | | | | -ffast-math. llvm-svn: 147440
* Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 ↵Benjamin Kramer2011-12-281-1/+1
| | | | | | | | | with sse disabled. x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD to "2". llvm-svn: 147311
* Give C11's __STDC_VERSION__ the final value.Benjamin Kramer2011-12-231-4/+1
| | | | llvm-svn: 147222
* Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" ↵Benjamin Kramer2011-12-231-1/+1
| | | | | | | | so this patch is surprisingly small. Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility. llvm-svn: 147221
* Move a free function from the Frontend library into the Lex library asChandler Carruth2011-12-091-24/+5
| | | | | | | | part of HeaderSearch. This function just normalizes filenames for use inside of a synthetic include directive, but it is used in both the Frontend and Serialization libraries so it needs a common home. llvm-svn: 146227
* Give __STDC_VERSION__ the value 201001L when we're in C1x mode. TheDouglas Gregor2011-10-281-1/+6
| | | | | | | committee hasn't set a value for __STDC_VERSION__ yet, so this is a placeholder. But at least it's > 199901L. llvm-svn: 143245
* Define __STDC__ in -fms-extensions mode; defining it is consistent with gcc, ↵Eli Friedman2011-10-191-1/+1
| | | | | | and not defining it causes the system headers on multiple platforms to break with -fms-extensions because they assume the lack of a definition of __STDC__ implies a traditional (pre-ANSI) preprocessor. PR10324 and <rdar://problem/10313809> . llvm-svn: 142554
* Remove the egregious hack that made Objective-C++ ARC work with olderDouglas Gregor2011-09-271-70/+1
| | | | | | | versions of libc++. Newer versions of libc++ know how to deal with ARC properly. Fixes <rdar://problem/10062179>. llvm-svn: 140651
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+2
| | | | llvm-svn: 140478
* Remove __WCHAR_UNSIGNED__ and anything that used it.Eric Christopher2011-09-201-3/+0
| | | | llvm-svn: 140155
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-2/+2
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Add an experimental flag -fauto-module-import that automatically turnsDouglas Gregor2011-09-151-1/+5
| | | | | | | #include or #import direcctives of framework headers into module imports of the corresponding framework module. llvm-svn: 139860
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-3/+3
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.Douglas Gregor2011-09-121-2/+4
| | | | | | | Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C exceptions are turned on. Fixes PR10910. llvm-svn: 139496
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-39/+39
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN andAlexis Hunt2011-07-191-0/+3
| | | | | | | WCHAR_MAX in limits.h, thus solving the problem where the system header thinks it knows better. llvm-svn: 135455
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-061-2/+2
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* Don't define __CONSTANT_CFSTRINGS__ with -fno-constant-cfstrings issue.Fariborz Jahanian2011-07-051-1/+2
| | | | | | Patch by Jean-Daniel Dupas. llvm-svn: 134414
* Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis2011-06-241-13/+13
| | | | | | | | 'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
* Define __cplusplus to 201103L when in (non-GNU) C++0x mode.Douglas Gregor2011-06-201-3/+10
| | | | llvm-svn: 133437
* Unconditionally #define the ARC ownership qualifiers, instead of #definingJohn McCall2011-06-161-0/+9
| | | | | | them only on Darwin tool chains. llvm-svn: 133112
* Automatic Reference Counting.John McCall2011-06-151-4/+141
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* __OBJC__ is also a standard predefined macro.Nick Lewycky2011-06-101-1/+3
| | | | llvm-svn: 132855
* The macros defined by the language standard are still available even when theNick Lewycky2011-06-071-26/+37
| | | | | | | -undef flag is passed in. Also __ASSEMBLER__ with -x assembler-with-cpp. (Don't ask.) llvm-svn: 132708
* Add a FIXME.Francois Pichet2011-05-091-0/+1
| | | | llvm-svn: 131108
* Temporary preprocessor hack to get around the Microsoft __identifier(x) ↵Francois Pichet2011-05-071-0/+1
| | | | | | | | | | | extension. http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx Microsoft doc claims this is a C++/CLI feature but it is really always enabled. This removes 2 error when parsing MFC code with clang. llvm-svn: 131051
* Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin ↵Francois Pichet2011-04-281-6/+0
| | | | | | | | | | | | | | defines to real types. Otherwise statements like: __int64 var = __int64(0); would be expanded to: long long var = long long(0); and fail to compile. llvm-svn: 130369
* Move all of the logic for __DEPRECATED to the driver based on commentsChandler Carruth2011-04-231-2/+3
| | | | | | from dgregor. llvm-svn: 130066
* Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. ThisChandler Carruth2011-04-231-1/+2
| | | | | | | | | | | | | | | | | | matches GCC behavior which libstdc++ uses to limit #warning-based messages about deprecation. The machinery involves threading this through a new '-fdeprecated-macro' flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We turn the flag off in the driver when the warning is turned off (modulo matching some GCC bugs). We record this as a language option, and key the preprocessor on the option when introducing the define. A separate flag rather than a '-D' flag allows us to properly represent the difference between C and C++ builds (only C++ receives the define), and it allows the specific behavior of following -Wdeprecated without potentially impacting the set of user-provided macro flags. llvm-svn: 130055
* PR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.Eli Friedman2011-04-211-0/+3
| | | | llvm-svn: 129907
* Change Clang's __VERSION__ to include the same basic info as in clang -v.Daniel Dunbar2011-03-311-1/+6
| | | | | | - Please never ever ever ever write a tool that sniffs this. llvm-svn: 128599
* Preprocessor: Don't define __STDC__ in -traditional-cpp mode.Daniel Dunbar2011-03-191-1/+1
| | | | llvm-svn: 127933
* Add 'OverridenFilesKeepOriginalName' field in SourceManager which if true ↵Argyrios Kyrtzidis2011-03-081-11/+4
| | | | | | | | | | | the SourceManager should report the original file name for contents of files that were overriden by other files, otherwise it should report the name of the new file. Default is true. Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine. llvm-svn: 127289
* Reimplement DefineTypeSize in terms of APInt. This eliminates someChris Lattner2011-02-241-9/+4
| | | | | | | magic integer arithmetic and allows it to work with types larger than 64 bits. llvm-svn: 126365
* Preserve what the user passed to -include when emitting .d files. Fixes PR8974!Nick Lewycky2011-02-231-9/+15
| | | | llvm-svn: 126334
* Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.Michael J. Spencer2010-12-211-3/+5
| | | | llvm-svn: 122340
* Implement -cl-fast-relaxed-mathPeter Collingbourne2010-12-041-0/+3
| | | | llvm-svn: 120880
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120297
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-231-8/+5
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* Implement -working-directory.Argyrios Kyrtzidis2010-11-031-5/+7
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Tell the VS headers that char16_t and char32_t are keywords, so yvals.h ↵Steven Watanabe2010-09-051-0/+4
| | | | | | doesn't try to define them as typedefs. llvm-svn: 113126
* First test commit by Francois Pichet. _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES ↵Francois Pichet2010-09-031-3/+0
| | | | | | is not a predefined macro, remove it. llvm-svn: 112953
* Predeclare class type_info in Microsoft mode, from Francois Pichet!Douglas Gregor2010-08-301-0/+1
| | | | llvm-svn: 112478
OpenPOWER on IntegriCloud