summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Use MacroBuilder for TargetDefines instead of std::vector.Benjamin Kramer2010-01-091-3/+1
| | | | llvm-svn: 93058
* Move MacroBuilder into Frontend/Utils.h and clean it up a bit.Benjamin Kramer2010-01-091-127/+89
| | | | llvm-svn: 93057
* Rework InitPreprocessor to use a MacroBuilder class instead of pushing aroundBenjamin Kramer2010-01-091-248/+208
| | | | | | | | | | | | std::vectors. - MacroBuilder wraps a raw_ostream so it can easily write to any buffer supported by raw_ostream. - MacroBuilder's method take Twines for easy string concatenation (this was done with sprintf and temporary buffers before). - Targets still use std::vector as they don't have access to the builder. llvm-svn: 93051
* Switch UndefineBuiltinMacro() over to using StringRefKovarththanan Rajaratnam2010-01-091-2/+2
| | | | llvm-svn: 93049
* Switch DefineBuiltinMacro() over to using StringRefKovarththanan Rajaratnam2010-01-091-8/+12
| | | | llvm-svn: 93048
* Convert from char pointer to char arrayKovarththanan Rajaratnam2010-01-071-6/+6
| | | | llvm-svn: 92923
* Tigthen scope of local char arrayKovarththanan Rajaratnam2010-01-071-1/+1
| | | | llvm-svn: 92917
* Integrate the following from the 'objective-rewrite' branch:Steve Naroff2009-12-041-0/+3
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=70926 llvm-svn: 90596
* Fix two more diagnostic-on-stderr instances that thought they could hide ↵Daniel Dunbar2009-12-031-10/+10
| | | | | | from me -- they thought wrong. llvm-svn: 90442
* Extend -remap-file=from;to to permit mapping from a non-existentDouglas Gregor2009-12-021-4/+5
| | | | | | | | | | | | file. This is accomplished by introducing the notion of a "virtual" file into the file manager, which provides a FileEntry* for a named file whose size and modification time are known but which may not exist on disk. Added a cute little test that remaps both a .c file and a .h file it includes to alternative files. llvm-svn: 90329
* Move file-remapping logic into InitPreprocesor. No functionality changeDouglas Gregor2009-12-021-0/+53
| | | | llvm-svn: 90322
OpenPOWER on IntegriCloud