aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Rewrite
AgeCommit message (Collapse)Author
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
2009-08-27restore indentationGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27iterator.h is no more. Be standards compliant.Gabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21Fix commentosDaniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21Fix refacto.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19Remove now unnecessary helper methods.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19Convert parts of Rewriter to StringRef based API.Daniel Dunbar
- Please accept my sincere apologies for the gratuitous elimination of code duplication, manual string length counting, unnecessary strlen calls, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18Fix for PR2386: distinguish between insertion and replacements in the Eli Friedman
delta tree. The issue is roughly a conflict in ReplaceText between two kinds of uses. One, it should be possible to replace a replacement: for example, the ObjC rewriter calls ReplaceStmt for an expression, then replaces the resulting expression with another expression. Two, it should be possible to replace text that already has text inserted before it: for example, the HTML rewriter inserts a bunch of tags at the beginning of the line, then tries to escape the first character on the line. This patch distinguishes the two cases by storing the deltas separately; essentially, replacements and insertions no longer interfere with each other. Another possibility would be to add some sort of flag to ReplaceText, but this seems a bit more intuitive and flexible. There are a few downsides to the current solution: one is that there isn't any way to remove/replace an insertion without touching additional surrounding text; if such an operation turns out to be useful, an additional method or flag can be added. Another is that an insertion and replacing a string of length zero are distinct operations; I'm not sure how to resolve this, or whether it will be confusing in practice. This is relatively sensitive code, so please test and tell me if anything breaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner
This allows it to accurately measure tokens, so that we get: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~~^ instead of the woefully inferior: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ Most of this is just plumbing to push the reference around. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18HTML rewriter: Don't replace tabs with spaces by default.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17this massive patch introduces a simple new abstraction: it makesChris Lattner
"FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12make the -rewrite-test a bit more interesting: it now Chris Lattner
wraps comments in <i> tags. Extend rewrite tokens to support this minimal functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12start implementing a token rewriter. At this point, it just reads in a fileChris Lattner
and lets a client iterate over it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-03add a disclaimerChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57038 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-03add a new Rewriter::getRewritenText method that returns the text for a rangeChris Lattner
that includes any edits in the range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16add missing class declarationNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07In a report-XXXXX.html, make the title include the name of the file with the ↵Ted Kremenek
bug. Patch by Jean-Daniel Dupas! http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-July/002166.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05Fix warningsSeo Sanghyeon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53141 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29Update to follow recent LLVM changesAnton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-28Fix rewrite rope to keep the leaf list up-to-date as it erases leavesChris Lattner
from the rope. rdar://5952468 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51651 91177308-0d34-0410-b5e6-96231b3b80d8