- Apr 28, 2015
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235957 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
the active module macros at the point of definition, rather than reconstructing it from the macro history. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235941 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 23, 2015
-
-
Richard Smith authored
Previously we'd defer this determination until writing the AST, which doesn't allow us to use this information when building other submodules of the same module. This change also allows us to use a uniform mechanism for writing module macro records, independent of whether they are local or imported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235614 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 04, 2015
-
-
Argyrios Kyrtzidis authored
Macro names that got undefined inside a module may not have their MacroInfo set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231251 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 10, 2014
-
-
Sean Callanan authored
in debugger mode) to accept @import declarations and pass them to the debugger. In the preprocessor, accept import declarations if the debugger is enabled, but don't actually load the module, just pass the import path on to the preprocessor callbacks. In the Objective-C parser, if it sees an import declaration in statement context (usual for LLDB), ignore it and return a NullStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223855 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 02, 2014
-
-
Richard Smith authored
rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223095 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 18, 2014
-
-
Argyrios Kyrtzidis authored
[libclang] If the code-completion point is inside the preamble, adjust the position at the beginning of the file after the preamble. Otherwise we will not hit the code-completion point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220136 91177308-0d34-0410-b5e6-96231b3b80d8
-
Argyrios Kyrtzidis authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220135 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 15, 2014
-
-
David Blaikie authored
Follow up to r217656 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217829 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 12, 2014
-
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217656 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 10, 2014
-
-
Craig Topper authored
Unique_ptr creation stil needs to be moved earlier at some of the call sites. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217474 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 29, 2014
-
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216756 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216715 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 27, 2014
-
-
David Blaikie authored
Overload SourceManager::overrideFileContents so that unconditionally passing ownership is explicitly done using unique_ptr. Only those callers who are dynamically passing ownership should need the 3 argument form. Those accepting the default ("do pass ownership") should do so explicitly with a unique_ptr now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216614 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rafael Espindola authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216585 91177308-0d34-0410-b5e6-96231b3b80d8
-
Ted Kremenek authored
Add support for the static analyzer to synthesize function implementations from external model files. Currently the analyzer lazily models some functions using 'BodyFarm', which constructs a fake function implementation that the analyzer can simulate that approximates the semantics of the function when it is called. BodyFarm does this by constructing the AST for such definitions on-the-fly. One strength of BodyFarm is that all symbols and types referenced by synthesized function bodies are contextual adapted to the containing translation unit. The downside is that these ASTs are hardcoded in Clang's own source code. A more scalable model is to allow these models to be defined as source code in separate "model" files and have the analyzer use those definitions lazily when a function body is needed. Among other things, it will allow more customization of the analyzer for specific APIs and platforms. This patch provides the initial infrastructure for this feature. It extends BodyFarm to use an abstract API 'CodeInjector' that can be used to synthesize function bodies. That 'CodeInjector' is implemented using a new 'ModelInjector' in libFrontend, which lazily parses a model file and injects the ASTs into the current translation unit. Models are currently found by specifying a 'model-path' as an analyzer option; if no path is specified the CodeInjector is not used, thus defaulting to the current behavior in the analyzer. Models currently contain a single function definition, and can be found by finding the file <function name>.model. This is an initial starting point for something more rich, but it bootstraps this feature for future evolution. This patch was contributed by Gábor Horváth as part of his Google Summer of Code project. Some notes: - This introduces the notion of a "model file" into FrontendAction and the Preprocessor. This nomenclature is specific to the static analyzer, but possibly could be generalized. Essentially these are sources pulled in exogenously from the principal translation. Preprocessor gets a 'InitializeForModelFile' and 'FinalizeForModelFile' which could possibly be hoisted out of Preprocessor if Preprocessor exposed a new API to change the PragmaHandlers and some other internal pieces. This can be revisited. FrontendAction gets a 'isModelParsingAction()' predicate function used to allow a new FrontendAction to recycle the Preprocessor and ASTContext. This name could probably be made something more general (i.e., not tied to 'model files') at the expense of losing the intent of why it exists. This can be revisited. - This is a moderate sized patch; it has gone through some amount of offline code review. Most of the changes to the non-analyzer parts are fairly small, and would make little sense without the analyzer changes. - Most of the analyzer changes are plumbing, with the interesting behavior being introduced by ModelInjector.cpp and ModelConsumer.cpp. - The new functionality introduced by this change is off-by-default. It requires an analyzer config option to enable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216550 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 11, 2014
-
-
David Blaikie authored
And in the process, discover that FileManager::removeStatCache had a double-delete when removing an element from the middle of the list (at the beginning or the end of the list, there was no problem) and add a unit test to exercise the code path (which successfully crashed when run (with modifications to match the old API) without this patch applied) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215388 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 24, 2014
-
-
Richard Smith authored
to destroy one of these. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213837 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
Remove pointless MICache: it only ever contained up to 1 object, and was only non-empty when recovering from an error. There's no performance or memory win from maintaining this cache. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213825 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 26, 2014
-
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211763 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 09, 2014
-
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210448 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 18, 2014
-
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209083 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 17, 2014
-
-
Alp Toker authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209061 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 16, 2014
-
-
Alp Toker authored
It makes more sense to just overload createFileID(). Gardening only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209002 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 09, 2014
-
-
Nico Weber authored
MacroArgs are owned by TokenLexer, and when a TokenLexer is destroyed, it'll call its MacroArgs's destroy() method. destroy() only appends the MacroArg to Preprocessor's MacroArgCache list, and Preprocessor's destructor then calls deallocate() on all MacroArgs in that list. This method then ends up freeing the MacroArgs's memory. In a code completion context, Parser::cutOffParsing() gets called when a code completion token is hit, which changes the type of the current token to tok::eof. eof tokens aren't always ConsumeToken()ed, so Preprocessor::HandleEndOfFile() isn't always called, and that function is responsible for popping the macro stack. Due to this, Preprocessor::CurTokenLexer can be non-NULL when ~Preprocessor runs. It's a unique_ptr, so it ended up being destructed after ~Preprocessor completed, and its MacroArgs thus got added to the freelist after the code freeing things on the freelist had already completed. The fix is to explicitly call reset() before the freelist processing happens. (See the bug for more notes.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208438 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 02, 2014
-
-
Alp Toker authored
Landing this separately to make the previous commits easy to follow at home. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207826 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alp Toker authored
The Preprocessor::Initialize() function already offers a clear interface to achieve this, further reducing the confusing number of states a newly constructed preprocessor can have. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207825 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alp Toker authored
Preprocessor::enableIncrementalProcessing() provides a consistent interface to enable the feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207824 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 15, 2014
-
-
Benjamin Kramer authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204007 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 07, 2014
-
-
Argyrios Kyrtzidis authored
avoid warning for unused macros. rdar://15034698 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203213 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 24, 2014
-
-
Alp Toker authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202006 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 17, 2014
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201532 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 13, 2014
-
-
Reid Kleckner authored
These features are new in VS 2013 and are necessary in order to layout std::ostream correctly. Currently we have an ABI incompatibility when self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper in gtest. This change adds another implicit attribute, MSVtorDispAttr, because implicit attributes are currently the best way to make sure the information stays on class templates through instantiation. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2746 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201274 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 31, 2014
-
-
Richard Smith authored
just storing a flag indicating if there was one), and include it in the 'end of module' annotation. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200573 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 07, 2014
-
-
Chandler Carruth authored
encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 23, 2013
-
-
Richard Smith authored
module. Use the marker to diagnose cases where we try to transition between submodules when not at the top level (most likely because a closing brace was missing at the end of a header file, but is also possible if submodule headers attempt to do something fundamentally non-modular, like our .def files). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195543 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 07, 2013
-
-
Douglas Gregor authored
The preprocessor currently recognizes module declarations to load a module based on seeing the 'import' keyword followed by an identifier. This sequence is fairly unlikely in C (one would need a type named 'import'), but is more common in Objective-C (where a variable named 'import' can cause problems). Since import declarations currently require a leading '@', recognize that in the preprocessor as well. Fixes <rdar://problem/15084587>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194225 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 19, 2013
-
-
Eli Friedman authored
Before this patch, Lex() would recurse whenever the current lexer changed (e.g. upon entry into a macro). This patch turns the recursion into a loop: the various lex routines now don't return a token when the current lexer changes, and at the top level Preprocessor::Lex() now loops until it finds a token. Normally, the recursion wouldn't end up being very deep, but the recursion depth can explode in edge cases like a bunch of consecutive macros which expand to nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this patch). <rdar://problem/14569770> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190980 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 05, 2013
-
-
Daniel Jasper authored
This patch was created by Lawrence Crowl and reviewed in: http://llvm-reviews.chandlerc.com/D963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187738 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 04, 2013
-
-
Argyrios Kyrtzidis authored
[Preprocessor] For the MacroExpands preprocessor callback, also pass the MacroArgs object that provides information about the argument tokens for a function macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181065 91177308-0d34-0410-b5e6-96231b3b80d8
-