History log of /llvm-project/clang/lib/Rewrite/HTMLRewrite.cpp (Results 76 – 100 of 145)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 87f95b0a 26-Feb-2009 Douglas Gregor <dgregor@apple.com>

Introduce code modification hints into the diagnostics system. When we
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 o

Introduce code modification hints into the diagnostics system. When we
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

show more ...


# 59da7396 24-Feb-2009 Chris Lattner <sabre@nondot.org>

Fix PR3635 by handling ## magically

llvm-svn: 65374


# 8cad67b8 17-Feb-2009 Chris Lattner <sabre@nondot.org>

simplify this code and make it use highlight range. This
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 li

simplify this code and make it use highlight range. This
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

show more ...


# 20cf4301 15-Feb-2009 Chris Lattner <sabre@nondot.org>

fix a fixme in -emit-html output: highlight the entire range of a macro
instantiation, which highlights the arguments of a function like macro
as well as its identifier.

llvm-svn: 64607


# 9ef847be 13-Feb-2009 Chris Lattner <sabre@nondot.org>

Fix rdar://6562329, a static analyzer crash Ted noticed on
wine sources. This was happening because HighlightMacros was
calling EnterMainFile multiple times on the same preprocessor
object and get

Fix rdar://6562329, a static analyzer crash Ted noticed on
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

show more ...


# 837b990c 13-Feb-2009 Chris Lattner <sabre@nondot.org>

make "floating macro bubble" output of -emit-html much prettier:
only insert spaces between tokens if the code had them or if they
are actually required to avoid pasting. This reuses the same
logi

make "floating macro bubble" output of -emit-html much prettier:
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

show more ...


# c360bf2e 27-Jan-2009 Chris Lattner <sabre@nondot.org>

rename getFullFilePos -> getFileOffset.

llvm-svn: 63097


# 4fa23625 26-Jan-2009 Chris Lattner <sabre@nondot.org>

Check in the long promised SourceLocation rewrite. This lays the
ground work for implementing #line, and fixes the "out of macro ID's"
problem.

There is nothing particularly tricky about the code,

Check in the long promised SourceLocation rewrite. This lays the
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

show more ...


# cbc35ecb 19-Jan-2009 Chris Lattner <sabre@nondot.org>

Rename SourceManager::getCanonicalFileID -> getFileID. There is
no longer such thing as a non-canonical FileID.

llvm-svn: 62499


# 08354fef 17-Jan-2009 Chris Lattner <sabre@nondot.org>

add a simplified lexer ctor that sets up the lexer to raw-lex an
entire file.

llvm-svn: 62414


# d32480d3 17-Jan-2009 Chris Lattner <sabre@nondot.org>

this massive patch introduces a simple new abstraction: it makes
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.

This i

this massive patch introduces a simple new abstraction: it makes
"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

show more ...


# 8a42586c 16-Jan-2009 Chris Lattner <sabre@nondot.org>

more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.

llvm-svn: 62316


Revision tags: llvmorg-2.4.0
# 50c90500 12-Oct-2008 Chris Lattner <sabre@nondot.org>

Change how raw lexers are handled: instead of creating them and then
using LexRawToken, create one and use LexFromRawLexer. This avoids
twiddling the RawLexer flag around and simplifies some code (e

Change how raw lexers are handled: instead of creating them and then
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

show more ...


# 2d470fc0 13-Sep-2008 Ted Kremenek <kremenek@apple.com>

Patch by Csaba Hruska!

"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


# afe2a9fe 31-Aug-2008 Ted Kremenek <kremenek@apple.com>

Patch by Kovarththanan Rajaratnam!

"This minor patch adds markup of string literals with a red colour."

llvm-svn: 55589


# 0b79bfe5 16-Aug-2008 Nico Weber <nicolasweber@gmx.de>

honor EscapeSpaces in 2nd overload of EscapeText()

llvm-svn: 54854


# ba119629 11-Jul-2008 Ted Kremenek <kremenek@apple.com>

Add CSS for word wrapping of long message bubbles.

llvm-svn: 53492


# 79ab0fa9 07-Jul-2008 Ted Kremenek <kremenek@apple.com>

In a report-XXXXX.html, make the title include the name of the file with the bug. Patch by Jean-Daniel Dupas!

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-July/002166.html

llvm-svn: 53184


Revision tags: llvmorg-2.3.0
# 1e517a78 19-Apr-2008 Chris Lattner <sabre@nondot.org>

replace form feeds with an <hr> tag.

llvm-svn: 49975


# a960be4b 18-Apr-2008 Ted Kremenek <kremenek@apple.com>

Provide a version of html::HighlightMacros that takes a Preprocessor&.

llvm-svn: 49896


# 4bbd164a 18-Apr-2008 Chris Lattner <sabre@nondot.org>

Make tab insertion really right: the number of spaces inserted
depends on the column number of the start of the tab.

llvm-svn: 49891


# a3d02636 18-Apr-2008 Ted Kremenek <kremenek@apple.com>

Use HTML5 doctype when generating HTML.

llvm-svn: 49888


# a821e087 18-Apr-2008 Ted Kremenek <kremenek@apple.com>

Updated CSS colors. Patch by Cedric Venet!

llvm-svn: 49886


# 54349c5f 17-Apr-2008 Chris Lattner <sabre@nondot.org>

Fix a problem noticed by Nuno, where we wouldn't escape characters in
macro expansions.

llvm-svn: 49877


# f42f3fb4 17-Apr-2008 Ted Kremenek <kremenek@apple.com>

class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor.

clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and
passes it to the prep

class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its 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

show more ...


123456