summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix typo in comment.Michael J. Spencer2010-08-211-1/+1
| | | | llvm-svn: 111729
* PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.Eli Friedman2010-08-031-1/+1
| | | | llvm-svn: 110126
* fix some undefined behavior, PR7779.Chris Lattner2010-08-031-3/+4
| | | | llvm-svn: 110116
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. llvm-svn: 109445
* Basic plumbing for generating a precompiled preamble for anDouglas Gregor2010-07-231-4/+4
| | | | | | | ASTUnit/CXTranslationUnit. We can't actually use this preamble yet, however. llvm-svn: 109202
* Headers: Define __INT64_TYPE__ in terms of getInt64Type(), which isn't alwaysDaniel Dunbar2010-06-301-0/+6
| | | | | | | | 'long'. The practical upshot is so that the uint64_t we define in our stdint.h ends up being compatible with that defined by gcc (at least on Darwin), which otherwise could lead to type incompatibilities with other system headers. llvm-svn: 107255
* Remove state assertion.Ted Kremenek2010-06-281-1/+0
| | | | llvm-svn: 107064
* Don't crash in InitializePreprocessor() when there is no valid PTHManager. ↵Ted Kremenek2010-06-281-1/+2
| | | | | | Fixes <rdar://problem/8098441>. llvm-svn: 107061
* Remove HAS_TLS define.Eric Christopher2010-06-241-4/+0
| | | | llvm-svn: 106786
* More clang support for darwin tls. Add a __has_feature macro andEric Christopher2010-06-241-0/+4
| | | | | | target specific preprocessor define as well. llvm-svn: 106715
* Add several more predefines from modern versions of GCC.Dan Gohman2010-05-281-0/+27
| | | | llvm-svn: 104906
* Predefine the '__clang_analyzer__' macro when using '-analyze'.Ted Kremenek2010-05-261-0/+5
| | | | llvm-svn: 104742
* Add Clang version inspection macros. Fixes PR6681.Douglas Gregor2010-04-301-1/+15
| | | | llvm-svn: 102686
* fix PR6936: don't generate line marker directives when preprocessingChris Lattner2010-04-261-3/+9
| | | | | | | | .S files. "# 123" is passed through as-is, not treated as a line marker in this mode. No testcase, because it would be nasty and isn't worth it. llvm-svn: 102391
* Sink the _GNU_SOURCE definition down into the target configuration,Douglas Gregor2010-04-211-24/+0
| | | | | | | and only define it where we know we need it---Linux and Cygwin. Thanks to Chris for the prodding. llvm-svn: 101989
* Only predefine the macro _GNU_SOURCE in C++ mode when we're on aDouglas Gregor2010-04-161-2/+24
| | | | | | | platform that typically uses glibc. Fixes a Boost.Thread compilation failure. llvm-svn: 101450
* When given unsaved files in clang_createTranslationUnitFromSourceFile,Douglas Gregor2010-02-271-1/+2
| | | | | | | | | | copy the source buffers provided rather than referencing them directly, so that the caller can free those buffers immediately after calling clang_createTranslationUnitFromSourceFile(). Otherwise, we risk hitting those buffers later (when building source ranges, forming diagnostics, etc.). llvm-svn: 97296
* Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixesDaniel Dunbar2010-02-101-0/+2
| | | | | | | calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling, for Darwin ARM. llvm-svn: 95787
* Extend clang_createTranslationUnitFromSourceFile() to support creatingDouglas Gregor2010-01-231-10/+31
| | | | | | translation units that include unsaved files. llvm-svn: 94258
* Move the MacroBuilder utilitiy to its own header. Update references.Chandler Carruth2010-01-201-0/+1
| | | | | | Comments and/or improvements to the documentation are welcome. llvm-svn: 93982
* Fix an invalid Twine use spotty by abbeyj, it isn't safe to use TwineDaniel Dunbar2010-01-201-1/+4
| | | | | | | temporaries (this is one reason I'm nervous about propagating their use beyond particularly performance critical places). llvm-svn: 93981
* Predefine __weak attribute when doing objective-cFariborz Jahanian2010-01-131-2/+7
| | | | | | rewriting for any target. (refixes radar 7530235). llvm-svn: 93331
* Fix PR5982, a refacto in checking for '=' in a -D argument.Daniel Dunbar2010-01-101-8/+5
| | | | llvm-svn: 93088
OpenPOWER on IntegriCloud