aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Rewrite
AgeCommit message (Collapse)Author
2013-05-03Remove DiagnosticConsumer::clone(), a bad idea that is now unused.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181070 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08objective-C modern translator. Generate #lineFariborz Jahanian
info in the translated code under -g only. // rdar://13138170 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174684 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11Allow RefactoringTool to write to memory instead of always to diskEdwin Vane
RefactoringTool::run() always writes the result of rewrites to disk. Instead, make this optional and provide a method for getting the refactoring results in a memory buffer instead. Also made ClangTool polymorphic so RefactoringTool could inherit from it to properly express the IS-A relationship. This change also provides access to ClangTool's public interface, e.g. mapVirtualFile() which is important once refactored buffers start living in memory instead of on disk. Reviewers: klimek git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04Sort #include lines for all files under include/...Chandler Carruth
This is a simpler sort, entirely automatic with the help of llvm/utils/sort_includes.py -- no manual edits here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169238 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14This function isn't called SaveFiles any more.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167901 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163983 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Fix Doxygen misuse: refer to parameter names in paragraphs correctly (\arg isDmitri Gribenko
not what most people want -- it starts a new paragraph). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-01Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek
This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162430 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14Rename -rewrite-includes to -frewrite-includes.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158458 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Add a -rewrite-includes option, which is similar to -rewrite-macros, but ↵David Blaikie
only expands #include directives. Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22Adds a method overwriteChangedFiles to the Rewriter. This is implemented byManuel Klimek
first writing the changed files to a temporary location and then overwriting the original files atomically. Also adds a RewriterTestContext to aid unit testing rewrting logic in general. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157260 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02Don't try to instantiate std::list at an incomplete type; it's notJohn McCall
allowed, and it'll blow up in unfortunate ways when using a proper C++11 library. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06Add new code migrator support for migrating existing Objective-C code to useTed Kremenek
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07objc rewriter: start supporting modern objective-c abiFariborz Jahanian
in objective-c rewriter. wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05Basic: import OwningPtr<> into clang namespaceDylan Noblesmith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04Remove unused field from FixItRecompile.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149762 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26In FixItRewriteToTemp::RewriteFilename don't try to close the file descriptorArgyrios Kyrtzidis
with close(); return it instead. Fixes mingw build and eliminates possible racing issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26Introduce 3 new fixit options:Argyrios Kyrtzidis
-fixit-recompile applies fixits and recompiles the result -fixit-to-temporary applies fixits to temporary files -fix-only-warnings">, applies fixits for warnings only, not errors Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits without touching the original sources. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149027 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29Introduce a pure virtual clone() method to DiagnosticConsumer, so thatDouglas Gregor
we have the ability to create a new, distict diagnostic consumer when we go off and build a module. This avoids the currently horribleness where the same diagnostic consumer sees diagnostics for multiple translation units (and multiple SourceManagers!) causing all sorts of havok. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140493 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-25Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140479 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-25Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20remove some now-redundant forward declarations.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135578 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20now that we have a centralized place to do so, add some using declarations forChris Lattner
some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20Remove more unnecessary #include <llvm/ADT/SmallVector.h>Francois Pichet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133418 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15Automatic Reference Counting.John McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23Remove unused STL header includes.Jay Foad
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-16Introduce Rewriter::IncreaseIndentation() which increase indentations for ↵Argyrios Kyrtzidis
the lines between the given source range. To determine what the indentation should be, a SourceLocation 'parentIndent' parameter is used that should be at a source location with an indentation one degree lower than the given range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129628 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13Collect the options applicable to the Rewriter methods into a ↵Argyrios Kyrtzidis
RewriterOptions struct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11Typo.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129301 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11Fixup more objc rwriter bug having to do withFariborz Jahanian
rewriting of blocks which have objective-c stuff which need be rewritten as well. // rdar://9254348 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129300 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07Enhance the Rewriter.Argyrios Kyrtzidis
-Allow removing a line completely if it ends up empty -Provide more control on what should be removed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18Refactoring of Diagnostic class.Argyrios Kyrtzidis
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31Fix typo spotted by Nico Weber.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13Add a new cc1 option -fix-what-you-can which when combined with the fix-it modeNick Lewycky
will apply all fixes even when there were other errors in the file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Pass StringRefs by value.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18introduce a new CharSourceRange class, and enhance the diagnostics routinesChris Lattner
to use them instead of SourceRange. CharSourceRange is just a SourceRange plus a bool that indicates whether the range has the end character resolved or whether the end location is the start of the end token. While most of the compiler wants to think of ranges that have ends that are the start of the end token, the printf diagnostic stuff wants to highlight ranges within tokens. This is transparent to the diagnostic stuff. To start taking advantage of the new capabilities, you can do something like this: Diag(..) << CharSourceRange::getCharRange(Begin,End) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15Break Frontend's dependency on Rewrite, Checker and CodeGen in shared ↵Daniel Dunbar
library configuration Currently, all AST consumers are located in the Frontend library, meaning that in a shared library configuration, Frontend has a dependency on Rewrite, Checker and CodeGen. This is suboptimal for clients which only wish to make use of the frontend. CodeGen in particular introduces a large number of unwanted dependencies. This patch breaks the dependency by moving all AST consumers with dependencies on Rewrite, Checker and/or CodeGen to their respective libraries. The patch therefore introduces dependencies in the other direction (i.e. from Rewrite, Checker and CodeGen to Frontend). After applying this patch, Clang builds correctly using CMake and shared libraries ("cmake -DBUILD_SHARED_LIBS=ON"). N.B. This patch includes file renames which are indicated in the patch body. Changes in this revision of the patch: - Fixed some copy-paste mistakes in the header files - Modified certain aspects of the coding to comply with the LLVM Coding Standards git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15Add <cstddef> include to get ptrdiff_t, for gcc-4.6; patch by Dimitry Andric.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficientNick Lewycky
implementation today but is the right place if we want to make it faster some day. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15Teach -fixit to modify all of its inputs instead of just the main file, unlessNick Lewycky
-fixit-at specified a particular fixit to fix, or the -o flag was used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05Some clean up of replacement text API no longer needed byFariborz Jahanian
my recent changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Fixes a rewrite bug rewriting nested ivars reference.Fariborz Jahanian
(Radar 7583971). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20reduce redundant are'sChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05Make html::{SyntaxHighlight,HighlightMacros} take a const Preprocessor.Daniel Dunbar
This is conceptually correct, but adds a huge hack to HighlightMacros which is in fact doing all sorts of mutation to the Preprocessor. See FIXME. Chris, please review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04Kill PreprocessorFactory, which was both morally repugnant and totally unused.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8