summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite
Commit message (Collapse)AuthorAgeFilesLines
...
* StringRef'ication of lots stuff, patch by Peter Davies!Daniel Dunbar2010-08-171-52/+52
| | | | llvm-svn: 111314
* Make the FixItOptions object required instead of optional.Nick Lewycky2010-08-152-5/+9
| | | | llvm-svn: 111105
* Remove dead code, caught by unused function warnings.Argyrios Kyrtzidis2010-08-151-63/+0
| | | | llvm-svn: 111091
* Remember that FixItOptions* is optional and don't crash when it's not provided.Nick Lewycky2010-08-141-1/+1
| | | | llvm-svn: 111084
* Add a new cc1 option -fix-what-you-can which when combined with the fix-it modeNick Lewycky2010-08-132-12/+15
| | | | | | will apply all fixes even when there were other errors in the file. llvm-svn: 111020
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-5/+4
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Initialize block's imported variable(s) in Fariborz Jahanian2010-07-281-19/+30
| | | | | | | block's synthesized constructor initalizer list. Fixes radar 8240371. llvm-svn: 109698
* Fix source location of the initializer in Fariborz Jahanian2010-07-211-8/+0
| | | | | | | a copy initialization. Back out hack in objc rewriter. fixes radar 8213998. llvm-svn: 109024
* Fix a rewriter bug which originates in SemaInit involvingFariborz Jahanian2010-07-211-4/+11
| | | | | | | Constructor Initialization which computes Source Location differently now. Fixes radar 8213998. llvm-svn: 109018
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-2/+4
| | | | llvm-svn: 108807
* BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner2010-07-181-1/+0
| | | | llvm-svn: 108633
* Pass StringRefs by value.Benjamin Kramer2010-07-141-4/+4
| | | | llvm-svn: 108375
* When forming a function call or message send expression, be sure toDouglas Gregor2010-07-131-2/+2
| | | | | | | | | | | | | | | | | strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234
* Remove Decl::getCompoundBody().Argyrios Kyrtzidis2010-07-071-1/+1
| | | | | | | | This has 2 (slight) advantages: -Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt. -Better tracking of Decl::getBody()'s callsites. llvm-svn: 107771
* Rewriter: Use the appropriate printing context instead of the defaultDaniel Dunbar2010-06-301-16/+23
| | | | | | constructed one -- this is necessary to ensure types get printed correctly. llvm-svn: 107312
* introduce a new CharSourceRange class, and enhance the diagnostics routinesChris Lattner2010-06-181-3/+9
| | | | | | | | | | | | | | | 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) llvm-svn: 106338
* Break Frontend's dependency on Rewrite, Checker and CodeGen in shared ↵Daniel Dunbar2010-06-157-0/+6407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 106010
* Fix:Chris Lattner2010-06-141-1/+1
| | | | | | | | | | | | Decl.cpp:716:28: warning: initialization of pointer of type 'clang::VarDecl *' from literal 'false' [-Wbool-conversions] VarDecl *LastTentative = false; ^ RewriteRope.cpp:535:12: warning: initialization of pointer of type '<anonymous>::RopePieceBTreeNode *' from literal 'false' [-Wbool-conversions] return false; ^ llvm-svn: 105946
* Makefiles: Set Clang CPP compiler flags in a single location, instead of ↵Daniel Dunbar2010-06-081-2/+0
| | | | | | scattered throughout the project Makefiles. llvm-svn: 105638
* Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.Daniel Dunbar2010-06-081-2/+2
| | | | | | - This eliminates most dependencies on how Clang is installed relative to LLVM. llvm-svn: 105637
* Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficientNick Lewycky2010-04-161-2/+6
| | | | | | | implementation today but is the right place if we want to make it faster some day. llvm-svn: 101521
* make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner2010-04-141-1/+3
| | | | | | when avoiding paste. Patch by David Peixotto! llvm-svn: 101218
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-162-3/+3
| | | | | | const char*. llvm-svn: 98630
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-162-21/+4
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Add some <cstdio> includes to unbreak the buildbotsDouglas Gregor2010-03-152-0/+2
| | | | llvm-svn: 98591
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-152-2/+22
| | | | | | | | | | | | | | SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface. Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()). llvm-svn: 98585
* Allow users to set CPPFLAGS and CXXFLAGS on the make command line.Jeffrey Yasskin2010-03-121-1/+1
| | | | | Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test) llvm-svn: 98399
* Some clean up of replacement text API no longer needed byFariborz Jahanian2010-02-051-3/+2
| | | | | | my recent changes. llvm-svn: 95391
* Fixes a rewrite bug rewriting nested ivars reference.Fariborz Jahanian2010-01-281-2/+3
| | | | | | (Radar 7583971). llvm-svn: 94724
* -fno-rtti is now the default.Chris Lattner2010-01-241-1/+0
| | | | llvm-svn: 94379
* reduce redundant are'sChris Lattner2010-01-201-1/+1
| | | | llvm-svn: 94009
* Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().Ted Kremenek2010-01-071-2/+2
| | | | llvm-svn: 92922
* Fix PR5633 by making the preprocessor handle the case where we canChris Lattner2009-11-302-3/+6
| | | | | | | | | | stat a file but where mmaping it fails. In this case, we emit an error like: t.c:1:10: fatal error: error opening file '../../foo.h' instead of "cannot find file". llvm-svn: 90110
* Be more careful with anonymous namespaces, since Clang diagnoses the ↵Douglas Gregor2009-11-171-19/+9
| | | | | | ambiguity here llvm-svn: 89054
* Make html::{SyntaxHighlight,HighlightMacros} take a const Preprocessor.Daniel Dunbar2009-11-051-16/+21
| | | | | | | | | 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. llvm-svn: 86107
* Kill PreprocessorFactory, which was both morally repugnant and totally unused.Daniel Dunbar2009-11-041-7/+0
| | | | llvm-svn: 86076
* Call 'clear()' in ~RopePieceBTreeLeaf(), decrementing the referenceTed Kremenek2009-10-201-0/+1
| | | | | | | | counts of the bufffers referened by the RopePieces in RopePieceBTreeLeaf. This (I believe) corrently fixes the leak I meant to fix in r84601 (which ended up causing an overrelease). llvm-svn: 84615
* Revert 84601. Looks like it was causing failures on some systems.Ted Kremenek2009-10-201-2/+3
| | | | llvm-svn: 84610
* Fix a reference count imbalance in RewriteRope::MakeRopeString().Ted Kremenek2009-10-201-3/+2
| | | | | | | This was causing a ton of memory to be leaked when using HTML diagnostics with the static analyzer (on large files with many errors). llvm-svn: 84601
* Installation of Clang libraries and headers, from Axel Naumann!Douglas Gregor2009-10-081-3/+0
| | | | llvm-svn: 83582
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-095-248/+248
| | | | llvm-svn: 81346
* Don't install Clang libraries.Douglas Gregor2009-08-231-0/+3
| | | | llvm-svn: 79824
* Remove now unnecessary helper methods.Daniel Dunbar2009-08-191-2/+2
| | | | llvm-svn: 79460
* Convert parts of Rewriter to StringRef based API.Daniel Dunbar2009-08-192-37/+32
| | | | | | | - Please accept my sincere apologies for the gratuitous elimination of code duplication, manual string length counting, unnecessary strlen calls, etc. llvm-svn: 79448
* Use raw_svector_ostream for string concatenation.Daniel Dunbar2009-08-191-7/+9
| | | | llvm-svn: 79444
* adjust indentation.Zhongxing Xu2009-08-171-15/+15
| | | | llvm-svn: 79236
* Patch by Stefan Bühler: Escape text in macro expansion when emitting HTML ↵Ted Kremenek2009-07-211-1/+1
| | | | | | | | in the HTMLRewriter. This fixes PR 4602. llvm-svn: 76647
* Lexically order files in CMakeLists.txt files.Ted Kremenek2009-07-151-1/+1
| | | | llvm-svn: 75832
* Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.Chris Lattner2009-06-301-1/+1
| | | | | | | | | | | | This is simple enough, but then I thought it would be nice to make PrintingPolicy get a LangOptions so that various things can key off "bool" and "C++" independently. This spiraled out of control. There are many fixme's, but I think things are slightly better than they were before. One thing that can be improved: CFG should probably have an ASTContext pointer in it, which would simplify its clients. llvm-svn: 74493
* Fix for PR2386: distinguish between insertion and replacements in the Eli Friedman2009-05-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 72000
OpenPOWER on IntegriCloud