summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/HTMLRewrite.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-71/+71
| | | | llvm-svn: 81346
* 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-191-21/+18
| | | | | | | - 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
* Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner2009-04-141-1/+1
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 69099
* fix PR3798 by ignoring all diagnostics generated while repreprocessing a ↵Chris Lattner2009-03-131-0/+22
| | | | | | file in rewrite macros. llvm-svn: 66961
* Adjust HTML diagnostics CSS to not use "smaller" for font size and instead useTed Kremenek2009-03-101-2/+2
| | | | | | specific point sizes. llvm-svn: 66523
* Tighten message bubble height.Ted Kremenek2009-03-031-2/+3
| | | | | | Make bubble number decoration look more like circles than ovals. llvm-svn: 65921
* Adjust CSS to make message bubble numbers less gaudy.Ted Kremenek2009-03-021-4/+3
| | | | llvm-svn: 65903
* Adjust HTML message bubbles to utilize information from ↵Ted Kremenek2009-03-021-3/+8
| | | | | | PathDiagnosticPiece::Kind. llvm-svn: 65891
* Update HTML diagnostics to honor the different between 'event' and ↵Ted Kremenek2009-03-021-2/+3
| | | | | | 'control-flow' diagnostics. llvm-svn: 65877
* Introduce code modification hints into the diagnostics system. When weDouglas Gregor2009-02-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | know how to recover from an error, we can attach a hint to the diagnostic that states how to modify the code, which can be one of: - Insert some new code (a text string) at a particular source location - Remove the code within a given range - Replace the code within a given range with some new code (a text string) Right now, we use these hints to annotate diagnostic information. For example, if one uses the '>>' in a template argument in C++98, as in this code: template<int I> class B { }; B<1000 >> 2> *b1; we'll warn that the behavior will change in C++0x. The fix is to insert parenthese, so we use code insertion annotations to illustrate where the parentheses go: test.cpp:10:10: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++0x B<1000 >> 2> *b1; ^ ( ) Use of these annotations is partially implemented for HTML diagnostics, but it's not (yet) producing valid HTML, which may be related to PR2386, so it has been #if 0'd out. In this future, we could consider hooking this mechanism up to the rewriter to actually try to fix these problems during compilation (or, after a compilation whose only errors have fixes). For now, however, I suggest that we use these code modification hints whenever we can, so that we get better diagnostics now and will have better coverage when we find better ways to use this information. This also fixes PR3410 by placing the complaint about missing tokens just after the previous token (rather than at the location of the next token). llvm-svn: 65570
* Fix PR3635 by handling ## magicallyChris Lattner2009-02-241-0/+5
| | | | llvm-svn: 65374
* simplify this code and make it use highlight range. ThisChris Lattner2009-02-171-19/+8
| | | | | | | | | | | | | makes -emit-html do nice things for code like: #define FOO(X) y int FOO(4 ); highlighting the FOO instance as well as the ) on the next line properly. llvm-svn: 64710
* fix a fixme in -emit-html output: highlight the entire range of a macroChris Lattner2009-02-151-17/+21
| | | | | | | instantiation, which highlights the arguments of a function like macro as well as its identifier. llvm-svn: 64607
* Fix rdar://6562329, a static analyzer crash Ted noticed on Chris Lattner2009-02-131-13/+45
| | | | | | | | | | | | | | wine sources. This was happening because HighlightMacros was calling EnterMainFile multiple times on the same preprocessor object and getting an assert due to the new #line stuff (the file in question was bison output with #line directives). The fix for this is to not reenter the file. Instead, relex the tokens in raw mode, swizzle them a bit and repreprocess the token stream. An added bonus of this is that rewrite macros will now hilight the macro definition as well as its uses. Woo. llvm-svn: 64480
* make "floating macro bubble" output of -emit-html much prettier: Chris Lattner2009-02-131-1/+14
| | | | | | | | only insert spaces between tokens if the code had them or if they are actually required to avoid pasting. This reuses the same logic as -E mode. llvm-svn: 64421
* rename getFullFilePos -> getFileOffset.Chris Lattner2009-01-271-4/+4
| | | | llvm-svn: 63097
* Check in the long promised SourceLocation rewrite. This lays theChris Lattner2009-01-261-2/+1
| | | | | | | | | | ground work for implementing #line, and fixes the "out of macro ID's" problem. There is nothing particularly tricky about the code, other than the very performance sensitive SourceManager::getFileID() method. llvm-svn: 62978
* Rename SourceManager::getCanonicalFileID -> getFileID. There isChris Lattner2009-01-191-2/+2
| | | | | | no longer such thing as a non-canonical FileID. llvm-svn: 62499
* add a simplified lexer ctor that sets up the lexer to raw-lex anChris Lattner2009-01-171-5/+2
| | | | | | entire file. llvm-svn: 62414
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-171-25/+25
| | | | | | | | | | | | | | | "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. llvm-svn: 62407
* more SourceLocation lexicon change: instead of referring to theChris Lattner2009-01-161-5/+5
| | | | | | "logical" location, refer to the "instantiation" location. llvm-svn: 62316
* Change how raw lexers are handled: instead of creating them and thenChris Lattner2008-10-121-4/+4
| | | | | | | | | | | using LexRawToken, create one and use LexFromRawLexer. This avoids twiddling the RawLexer flag around and simplifies some code (even speeding raw lexing up a tiny bit). This change also improves the token paster to use a Lexer on the stack instead of new/deleting it. llvm-svn: 57393
* Patch by Csaba Hruska!Ted Kremenek2008-09-131-3/+5
| | | | | | | "Here is a patch what replaces std::ostream with llvm::raw_ostream. This patch covers the AST library, but ignores Analysis lib." llvm-svn: 56185
* Patch by Kovarththanan Rajaratnam!Ted Kremenek2008-08-311-0/+10
| | | | | | "This minor patch adds markup of string literals with a red colour." llvm-svn: 55589
* honor EscapeSpaces in 2nd overload of EscapeText()Nico Weber2008-08-161-3/+8
| | | | llvm-svn: 54854
* Add CSS for word wrapping of long message bubbles.Ted Kremenek2008-07-111-0/+1
| | | | llvm-svn: 53492
* In a report-XXXXX.html, make the title include the name of the file with the ↵Ted Kremenek2008-07-071-7/+13
| | | | | | | | bug. Patch by Jean-Daniel Dupas! http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-July/002166.html llvm-svn: 53184
* replace form feeds with an <hr> tag.Chris Lattner2008-04-191-1/+5
| | | | llvm-svn: 49975
* Provide a version of html::HighlightMacros that takes a Preprocessor&.Ted Kremenek2008-04-181-16/+17
| | | | llvm-svn: 49896
* Make tab insertion really right: the number of spaces insertedChris Lattner2008-04-181-7/+17
| | | | | | depends on the column number of the start of the tab. llvm-svn: 49891
* Use HTML5 doctype when generating HTML.Ted Kremenek2008-04-181-3/+2
| | | | llvm-svn: 49888
* Updated CSS colors. Patch by Cedric Venet!Ted Kremenek2008-04-181-5/+5
| | | | llvm-svn: 49886
* Fix a problem noticed by Nuno, where we wouldn't escape characters in Chris Lattner2008-04-171-2/+3
| | | | | | macro expansions. llvm-svn: 49877
* class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its ↵Ted Kremenek2008-04-171-11/+18
| | | | | | | | | | | | | | | | | dstor. clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and passes it to the preprocessor object. clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main(). html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new Preprocessor to highlight macros. class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros(). Updated clients of HTMLDiagnostics to use this new interface. llvm-svn: 49875
* don't give macros a backgroundChris Lattner2008-04-171-2/+2
| | | | llvm-svn: 49871
* Make sure popup is on top over other spans. wrap long line.Chris Lattner2008-04-171-2/+3
| | | | llvm-svn: 49870
* Add support in HTML macro expansion for hovering over a macro and automaticallyTed Kremenek2008-04-171-3/+6
| | | | | | | | | | expanding its definition. This is a pure CSS solution. Tested on IE7, Firefox 3b4, and Safari 3.1. Patch by Cedric Venet! llvm-svn: 49865
* insert macro expansions into floating divs. For now, they are always displayed,Chris Lattner2008-04-171-4/+29
| | | | | | but we want some javascript or something toggle their display. llvm-svn: 49836
* correctly hilight multi-line macro definitions and otherChris Lattner2008-04-161-12/+20
| | | | | | preprocessor directives. llvm-svn: 49828
* Make HighlightRange correctly handle multi-line ranges. This causes us to Chris Lattner2008-04-161-0/+42
| | | | | | correctly handle multi-line comments. llvm-svn: 49827
* add a new HighlightRange API, it doesn't handle multiline rangesChris Lattner2008-04-161-12/+40
| | | | | | yet, but it will soon... llvm-svn: 49825
* reenable highlighting of (the first line of) commentsChris Lattner2008-04-161-1/+1
| | | | llvm-svn: 49816
* switch from relexing with the preprocessor to do syntax highlighting to relexingChris Lattner2008-04-161-20/+19
| | | | | | | | with the Lexer. This is cheaper and gives us some advantages. For now we start highlighting preprocessor directives (which need improvement), and disable comments. Comments to be restored later. llvm-svn: 49815
* Take a stab at highlighting #defines and #includes. This doesn't work yet.Chris Lattner2008-04-161-11/+30
| | | | llvm-svn: 49781
* Syntax highlight keywords. I assume someone else will pick less appaling ↵Chris Lattner2008-04-161-3/+10
| | | | | | colors. llvm-svn: 49780
* split syntax highlighting of macros from keywords and comments,Chris Lattner2008-04-161-3/+69
| | | | | | | | | allowing us to use a cheaper means to highlight keywords and making it so that comments won't foul up macro expansions. Start highlighting macro expansions. llvm-svn: 49779
OpenPOWER on IntegriCloud