Граф коммитов

110 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 6f46be279f insert macro expansions into floating divs. For now, they are always displayed,
but we want some javascript or something toggle their display.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 00:40:45 +00:00
Chris Lattner 5deb96d065 correctly hilight multi-line macro definitions and other
preprocessor directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 23:21:17 +00:00
Chris Lattner 9402b57a0d Make HighlightRange correctly handle multi-line ranges. This causes us to
correctly handle multi-line comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 23:06:45 +00:00
Chris Lattner 5ef3e2c45f add a new HighlightRange API, it doesn't handle multiline ranges
yet, but it will soon...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 22:45:51 +00:00
Chris Lattner 678c6358c8 reenable highlighting of (the first line of) comments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 20:54:51 +00:00
Chris Lattner a745e8c528 switch from relexing with the preprocessor to do syntax highlighting to relexing
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49815 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 20:51:51 +00:00
Chris Lattner 74ea3e5c57 Take a stab at highlighting #defines and #includes. This doesn't work yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 06:53:09 +00:00
Chris Lattner c4586c234e Syntax highlight keywords. I assume someone else will pick less appaling colors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 06:35:07 +00:00
Chris Lattner c54d50a418 split syntax highlighting of macros from keywords and comments,
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 06:32:08 +00:00
Chris Lattner 3245a0a1c7 Add a mode of hackily syntax highlighting comments. This has a number of
problems, including the fact that it doesn't work well with multi-line 
comments due to Ted's crazy table.  However, that could be fixed, and it
does work with single-line ones :).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 06:11:58 +00:00
Chris Lattner 8570f0b0fd Switch AddLineNumbers to hack on a rewritebuffer instead of on a
rewriter, getting sourcelocations out of the picture.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:37:29 +00:00
Chris Lattner 735271479a In html::EscapeText, instead of going through the rewriter with
a SourceLocation to get a RewriteBuffer, poke the RewriteBuffer
with an offset directly.  THis is no faster, but results in 
cleaner code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:33:23 +00:00
Chris Lattner 57df3b9500 switch AddLineNumber to use a SmallString instead of sstream. This
speeds up -emit-html on ted's testcase by 29% (.138 -> 0.107s) in a
release build.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49767 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:11:35 +00:00
Ted Kremenek 4b0f81323b For HTML diagnostics, output more information about a bug report.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 21:25:08 +00:00
Chris Lattner b9b3094813 finish commenting RewriteRope
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49712 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 06:37:11 +00:00
Chris Lattner 53f9e203c1 Fix a corner case that ted hit in -emit-html, rdar://5863212
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 02:26:21 +00:00
Chris Lattner bf26856c21 simplify the implementation of the insert/split operation to return
the new RHS directly instead of indirecting through the 'InsertResult'
struct.  This eliminates InsertResult.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49694 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 22:10:58 +00:00
Chris Lattner 5618d88b93 Add a bunch of comments, move RewriteRope::MakeRopeString out of line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 21:41:00 +00:00
Chris Lattner 70778c8582 fix more uninit ivars, who wrote this junk? :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49679 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 20:07:03 +00:00
Chris Lattner b442e21970 Fix an assertion ted was hitting, due to an uninitialized variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 20:05:32 +00:00
Chris Lattner 5fd3e2673a move a ton of code out of line, from RewriteRope.h -> RewriteRope.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 17:54:23 +00:00
Chris Lattner e5cd857f7e remove ifdefs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 17:12:49 +00:00
Chris Lattner febe719596 Change the RewriteRope::Chunks data structure from an std::list into
a nice shiny B+ Tree variant.  This fixes the last of the known algorithmic
issues with the rewriter, allowing a significant speedup.  For example,
-emit-html on Ted's 500K .i file speeds up from 26.8s -> 0.64s in a 
debug build (41x!) and 5.475s -> 0.132s (41x!) in an optimized build.

This code is functional but needs to be cleaned up, ifdefs removed, better
commented, and moved to a .cpp file.  I plan to do this tomorrow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 07:17:29 +00:00
Chris Lattner 3b7ff0d143 Change the btree algorithm to split nodes bottom-up instead of top-down.
This results in an (IMO) simpler algorithm, results in fewer splits, and
is more amenable to delta handling (there is no reason to mutate the tree
at all when adding a delta to a position that already exists in the tree).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49609 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 08:52:45 +00:00
Chris Lattner b169e903c5 split node splitting from interior node restructuring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49608 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 08:22:30 +00:00
Chris Lattner 22cb282b29 final cleanup, the code is now in a reviewable state.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 22:04:18 +00:00
Chris Lattner 8100d74951 move the DeltaTree implementation out of line, remove debugging printfs etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 22:00:40 +00:00
Chris Lattner 77257889f5 remove ifdefs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 20:34:05 +00:00
Chris Lattner 5c9dc5ac75 Do an initial hack at replacing one of the incredibly inefficient
(but simple!) datastructures in the rewriter with a more complex but
more efficient one.

This replaces the Deltas vector with a specialized BTree that makes
delta lookups much more efficient.  This speeds up -emit-html on a 500K
.i file from 157.154 to 27.127 seconds on my machine (5.8x).

While this code is functional, it isn't very pretty, I have much 
refactoring planned for it, and will remove the USE_VECTOR ifdef.
Stay tuned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 20:28:24 +00:00
Ted Kremenek 70bcba6030 Micro-optimization: Don't use ostringstream when using a C-string literal
will work just fine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49427 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:40:40 +00:00
Ted Kremenek fa5be36172 Don't expand tabs in EscapeText, but rather expand them when writing out
the HTML file.  This should reduce the amount of memory pressure on the
rewriter for files that have a lot of tabs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:37:58 +00:00
Ted Kremenek 4ce32cb52b When substituting tabs during HTMLification, only add " " when we are
"escaping" spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:28:15 +00:00
Ted Kremenek 356708cb33 Add ids for line numbers, allowing us to jump to arbitrary line numbers within
an HTMLified source file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:53:30 +00:00
Ted Kremenek 7e54eede40 Tweak message bubble color (gold)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:43:44 +00:00
Chris Lattner 6ccb91abc3 fix css font name, patch by Cédric Venet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49260 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:37:21 +00:00
Ted Kremenek 49cd6354d5 Some cleanups in EscapeText and AddLineNumbers. Still investigating performance
issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 07:12:29 +00:00
Ted Kremenek 9e628a02f4 CSS tweaking on blue boxes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 22:50:50 +00:00
Ted Kremenek f23621f1fc Blue diagnostic boxes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 21:14:04 +00:00
Ted Kremenek 718ceb13e0 Added path sequence numbers in HTML output of PathDiagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49116 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 21:04:20 +00:00
Ted Kremenek 8fb001684f Better handling for tabs with message bubbles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 23:14:05 +00:00
Ted Kremenek 487f827a7f Minor CSS tweaking (smaller h1 tags).
Bug fix in EscapeText (for std::string) where spaces were not properly emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:28:58 +00:00
Ted Kremenek 053ef593fa Add html::EscapeText for std::string; use this function to escape text in message bubbles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:15:29 +00:00
Ted Kremenek 2e93981a62 Added <h3> tag in HTML file output that contains the name of the source file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:35:49 +00:00
Ted Kremenek 9d4e659fce Minor CSS tweaking: use webkit style CSS properties for shadows/rounded edges
for message bubbles.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 23:38:32 +00:00
Ted Kremenek 0f1b67bc25 Added HTML highlighting for ranges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 23:55:53 +00:00
Ted Kremenek eeacc5203a Change colors of HTML message bubble.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 22:44:21 +00:00
Ted Kremenek db87ca09df More CSS enhancements to HTML code printing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 22:06:25 +00:00
Ted Kremenek e8e019ede1 Misc. cleanups to HTML printing: make code rendered using tables; add
better div positioning for messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 21:59:05 +00:00
Ted Kremenek 13e479b2b7 Initial experimentation with adding boxed "annotations" to HTMLized source.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 07:53:42 +00:00
Ted Kremenek ad0a203130 Moved generation of html header/footer with builtin CSS to the rewriter library.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 06:14:37 +00:00
Ted Kremenek d6c1360c2b More cleanups to the HTML rewriter (with line formatting), with better
pretty-printing of line numbers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 05:07:26 +00:00
Ted Kremenek f7768bc7a3 Change "style" to "class" in HTML output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48525 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 01:44:27 +00:00
Ted Kremenek f830997de6 More cleanups to HTML rewriter API: remove the InsertTag method; was too complicated
and clients can achieve a cleaner design just by inserting tags directly.  Reserve
the "html" namespace for meta-level operations (e.g., escaping text, etc.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 01:30:02 +00:00
Ted Kremenek 1b3188cfc2 More HTML rewriter cleanups. Preliminary CSS support in code pretty-printing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 23:55:46 +00:00
Ted Kremenek b485cd1e0a Some cleanups to the HTMLRewrite API. Added support for printing out line
numbers (more work to be done on aesthetics).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 23:08:51 +00:00
Ted Kremenek c22efea6f9 Modified "InsertTag" (HTML rewriter) to have an optional "OutermostTag" flag to
indicate whether or not the new tag should be the outermost tag at the specified
location (in the case that other tags have been inserted at the same spot).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:26:34 +00:00
Ted Kremenek 6a34083e9f Added the beginning of a set of rewriter functions for pretty-printing source
code as HTML.  Added a new driver option "--emit-html" to dump the source
of the main input file as HTML.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:19:49 +00:00
Ted Kremenek 886c8db545 Added variant of "InsertText" in the Rewriter to support inserting text both
*before* and after a specific location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:17:59 +00:00
Ted Kremenek 88ad97f177 Bug fix in RewriteBuffer::getMappedOffset: potentially multiple deltas
need to be skipped over when AfterInserts == true, as multiple deltas
may share the same FileLoc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:00:57 +00:00
Chris Lattner bda0b626e7 Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00