aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Rewrite/HTMLRewrite.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-06-03Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova1-0/+1
llvm-svn: 304647
2016-10-07[analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)Artem Dergachev1-2/+7
The problem that caused the msvc crash has been indentified and fixed in the previous commit. This patch contains the rest of r283092. llvm-svn: 283584
2016-10-07Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"Artem Dergachev1-7/+2
Vector of smart pointers wasn't the thing that caused msvc crash. llvm-svn: 283537
2016-10-07[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"Artem Dergachev1-2/+7
Replace SmallVector<IntrusiveRefCntPtr> with a vector of plain pointers. Would insignificantly increase memory usage. llvm-svn: 283536
2016-10-04Revert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.Vitaly Buka1-7/+2
This reverts commit r283092. llvm-svn: 283180
2016-10-03[analyzer] Extend bug reports with extra notesArtem Dergachev1-2/+7
These diagnostics are separate from the path-sensitive engine's path notes, and can be added manually on top of path-sensitive or path-insensitive reports. The new note diagnostics would appear as note:-diagnostic on console and as blue bubbles in scan-build. In plist files they currently do not appear, because format needs to be discussed with plist file users. The analyzer option "-analyzer-config notes-as-events=true" would convert notes to normal path notes, and put them at the beginning of the path. This is a temporary hack to show the new notes in plist files. A few checkers would be updated in subsequent commits, including tests for this new feature. Differential Revision: https://reviews.llvm.org/D24278 llvm-svn: 283092
2016-10-01Use StringRef for MemoryBuffer identifier API (NFC)Mehdi Amini1-3/+3
llvm-svn: 283043
2016-09-15[analyzer] Fix HTMLRewriter style sheets to support non-webkit browsers.Artem Dergachev1-0/+4
This fixes rounded corners and shadows of analyzer diagnostic pieces in browsers such as Firefox. Differential Revision: https://reviews.llvm.org/D23272 llvm-svn: 281625
2016-02-09Simplify EnterTokenStream API to make it more robust for memory managementDavid Blaikie1-1/+1
While this won't help fix things like the bug that r260219 addressed, it seems like good tidy up to have anyway. (it might be nice if "makeArrayRef" always produced a MutableArrayRef & let it decay to an ArrayRef when needed - then I'd use that for the MutableArrayRefs in this patch) If we had std::dynarray I'd use that instead of unique_ptr+size_t, ideally (but then it'd have to be threaded down through the Preprocessor all the way - no idea how painful that would be) llvm-svn: 260246
2014-07-16Make clang's rewrite engine a core featureAlp Toker1-0/+582
The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
2012-09-01Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek1-583/+0
This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
2012-08-02[analyzer] Add Prev/Next links to the HTML output.Jordan Rose1-1/+2
llvm-svn: 161153
2012-06-08Disable _Pragma during HTML macro rewriting to keep from crashing.Jordan Rose1-1/+7
The preprocessor's handling of diagnostic push/pops is stateful, so encountering pragmas during a re-parse causes problems. HTMLRewrite already filters out normal # directives including #pragma, so it's clear it's not expected to be interpreting pragmas in this mode. This fix adds a flag to Preprocessor to explicitly disable pragmas. The "right" fix might be to separate pragma lexing from pragma parsing so that we can throw away pragmas like we do preprocessor directives, but right now it's important to get the fix in. Note that this has nothing to do with the "hack" of re-using the input preprocessor in HTMLRewrite. Even if we someday copy the preprocessor instead of re-using it, the copy would (and should) include the diagnostic level tables and have the same problems. llvm-svn: 158214
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-2/+2
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-03-06User-defined literals: reject string and character UDLs in all places where theRichard Smith1-0/+1
grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
2012-02-07Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer1-1/+0
operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. llvm-svn: 150006
2012-02-05Basic: import SmallString<> into clang namespaceDylan Noblesmith1-1/+1
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
2012-02-04Remove Diagnostic.h include from Preprocessor.h.Benjamin Kramer1-0/+1
- Move the offending methods out of line and fix transitive includers. - This required changing an enum in the PPCallback API into an unsigned. llvm-svn: 149782
2012-01-20Per PR 11814, use Monospace instead of Andale Mono.Ted Kremenek1-1/+1
llvm-svn: 148567
2012-01-17Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie1-1/+0
appropriate or when GCC requires it) llvm-svn: 148292
2011-09-29Introduce a pure virtual clone() method to DiagnosticConsumer, so thatDouglas Gregor1-11/+0
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. llvm-svn: 140743
2011-09-26Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie1-1/+1
llvm-svn: 140493
2011-09-25Rename IgnoringDiagClient to IgnoringDiagConsumer as per issue 5397David Blaikie1-3/+3
llvm-svn: 140480
2011-09-25Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie1-1/+1
llvm-svn: 140479
2011-09-25Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie1-3/+3
llvm-svn: 140478
2011-09-19Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis1-1/+1
It already works (and is useful with) macro locs as well. llvm-svn: 140057
2011-07-27Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor1-1/+8
llvm-svn: 136210
2011-07-25Rename SourceManager::getInstantiationRange to getExpansionRange.Chandler Carruth1-1/+1
llvm-svn: 135915
2011-07-25Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth1-3/+3
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-2/+2
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-07-15Switch a comment in Rewrite from 'instantiation' to 'expansion'.Chandler Carruth1-1/+1
llvm-svn: 135226
2010-12-22Introduced raw_identifier token kind.Abramo Bagnara1-11/+11
llvm-svn: 122394
2010-11-18Refactoring of Diagnostic class.Argyrios Kyrtzidis1-1/+2
-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. llvm-svn: 119730
2010-08-18Fix crasher with IgnoringDiagClientDouglas Gregor1-2/+1
llvm-svn: 111447
2010-04-14make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."Chris Lattner1-1/+3
when avoiding paste. Patch by David Peixotto! llvm-svn: 101218
2010-03-16Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer1-1/+1
const char*. llvm-svn: 98630
2010-03-16Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor1-9/+3
and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
2010-03-15Add some <cstdio> includes to unbreak the buildbotsDouglas Gregor1-0/+1
llvm-svn: 98591
2010-03-15Introduce a new BufferResult class to act as the return type ofDouglas Gregor1-1/+11
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
2009-11-30Fix PR5633 by making the preprocessor handle the case where we canChris Lattner1-2/+4
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
2009-11-05Make html::{SyntaxHighlight,HighlightMacros} take a const Preprocessor.Daniel Dunbar1-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
2009-11-04Kill PreprocessorFactory, which was both morally repugnant and totally unused.Daniel Dunbar1-7/+0
llvm-svn: 86076
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump1-71/+71
llvm-svn: 81346
2009-08-19Remove now unnecessary helper methods.Daniel Dunbar1-2/+2
llvm-svn: 79460
2009-08-19Convert parts of Rewriter to StringRef based API.Daniel Dunbar1-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
2009-08-19Use raw_svector_ostream for string concatenation.Daniel Dunbar1-7/+9
llvm-svn: 79444
2009-08-17adjust indentation.Zhongxing Xu1-15/+15
llvm-svn: 79236
2009-07-21Patch by Stefan Bühler: Escape text in macro expansion when emitting HTML ↵Ted Kremenek1-1/+1
in the HTMLRewriter. This fixes PR 4602. llvm-svn: 76647
2009-04-14Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner1-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
2009-03-13fix PR3798 by ignoring all diagnostics generated while repreprocessing a ↵Chris Lattner1-0/+22
file in rewrite macros. llvm-svn: 66961