Commit Graph

621 Commits

Author SHA1 Message Date
Fariborz Jahanian 745bf62d21 doce parsing: adding few more headerdoc tags.
// rdar://12379114

llvm-svn: 178903
2013-04-05 19:40:53 +00:00
Jordan Rose 10ad081fc6 [analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks).
As mentioned in the previous commit message, the use-after-free and
double-free warnings for 'delete' are worth enabling even while the
leak warnings still have false positives.

llvm-svn: 178891
2013-04-05 17:55:07 +00:00
Anton Yartsev 01acbcebbb [analyzer] Moving cplusplus.NewDelete to alpha.* for now.
llvm-svn: 178529
2013-04-02 05:59:24 +00:00
Reid Kleckner 6a476082a6 [ms-cxxabi] Give the MS inheritance attributes a base class
Required making a handful of changes to the table generator.  Also adds
an unspecified inheritance attribute.  This opens the path for us to
apply these attributes to C++ records implicitly.

llvm-svn: 178054
2013-03-26 18:30:28 +00:00
Anton Yartsev 13df03624b [analyzer] Adds cplusplus.NewDelete checker that check for memory leaks, double free, and use-after-free problems of memory managed by new/delete.
llvm-svn: 177849
2013-03-25 01:35:45 +00:00
Jordan Rose b042cc7822 [analyzer] CmpRuns.py: Accept single files as input.
This allows us to compare two direct invocations of the analyzer on a
single source file without having to wrap the output plists in their
own directories.

llvm-svn: 177804
2013-03-23 01:21:26 +00:00
Fariborz Jahanian cfbac5d317 Documentation parsing. Some refactoring and code
improvements per Dmtiri's comments. // rdar://12379114

llvm-svn: 176739
2013-03-08 23:59:23 +00:00
Fariborz Jahanian a649eee9e8 HeaderDoc: Support more of HeaderDoc documentation
commands; top level tags such as @interface and
their 2nd level tags such as @coclass, etc.
// rdar://12379114

llvm-svn: 176667
2013-03-07 23:33:11 +00:00
Fariborz Jahanian 8a7a59226d doc parsing. We want to issue a strong warning when
an @function comment is not followed by a function decl.
// rdar://13094352

llvm-svn: 176468
2013-03-05 01:05:07 +00:00
Ted Kremenek 0332558894 Strip 'llvm' from 'llvm::Optional' uses.
llvm-svn: 175701
2013-02-21 01:29:01 +00:00
Dmitri Gribenko 2e72dd4a43 Comment parsing: improve the fidelity of XML output for many block commands
This change introduces a 'kind' attribute for the <Para> tag, that captures the
kind of the parent block command.

For example:

\todo Meow.

used to be just <Para>Meow.</Para>, but now it is
<Para kind="todo">Meow.</Para>

llvm-svn: 174216
2013-02-01 20:23:57 +00:00
Michael Han af02bbe84f [Sema][Attr]Fix alignment attribute printing.
Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should
only model those appear in source code. Introduce attribute Accessor, and teach TableGen
to generate syntax kind accessors for Align attribute, and use those accessors to decide
if an alignment attribute is a declspec attribute.

llvm-svn: 174133
2013-02-01 01:19:17 +00:00
Fariborz Jahanian 1a0cf80533 [Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511

llvm-svn: 174109
2013-01-31 23:12:39 +00:00
Richard Trieu de5cc7d3d8 Add indents to AST dumping and removed parenthesis from AST nodes.
Indents were given the color blue when outputting with color.
AST dumping now looks like this:

Node
|-Node
| `-Node
`-Node
  `-Node

Compared to the previous:

(Node
  (Node
    (Node))
  (Node
    (Node)))

llvm-svn: 174022
2013-01-31 01:44:26 +00:00
Dmitri Gribenko 6b11fca83a TableGen backends: use emitSourceFileHeader() to emit the warning about
file contents being autogenerated

llvm-svn: 173979
2013-01-30 21:54:20 +00:00
Dmitri Gribenko 28800da1b3 Comment parsing: resolve more named character references
This reimplements r173850 with a better approach:
(1) use a TableGen-generated matcher instead of doing a linear search;
(2) avoid allocations for new strings by converting code points to string
    iterals with TableGen.

llvm-svn: 173931
2013-01-30 14:29:28 +00:00
Richard Smith a5aaca9295 Propagate the spelling list index for an attribute across template instantiation.
llvm-svn: 173768
2013-01-29 04:21:28 +00:00
Richard Smith 0cdcc98200 Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelled
as a keyword. Rationalize existing attributes to use it as appropriate, and to
not lie about some __declspec attributes being GNU attributes. In passing,
remove a gross hack which was discarding attributes which we could handle. This
results in us actually respecting the __pascal keyword again.

llvm-svn: 173746
2013-01-29 01:24:26 +00:00
Michael Han 38d96ab6f5 Add the missing line return to align parameters of printPretty.
llvm-svn: 173597
2013-01-27 00:06:24 +00:00
Daniel Dunbar 96568f91cd [utils] Kill another no-longer-useful utility script.
- We are long past the days of getting clang to fail in mass on swaths of code,
   fortunately.

llvm-svn: 173523
2013-01-25 23:12:17 +00:00
Daniel Dunbar 23af2b1a2c [utils] Remove the OptionalTests subdir no one runs.
llvm-svn: 173491
2013-01-25 21:12:20 +00:00
Daniel Dunbar e462e0f665 [utils] Remove C++Tests that I don't think anyone uses anymore.
llvm-svn: 173490
2013-01-25 21:12:17 +00:00
Jordan Rose b18179da33 scan-build: Add a --keep-empty option for better testing.
SATestBuild expects to compare output directories for each invocation of
scan-build that it runs, but scan-build clears out empty directories by
default. We were coincidentally not getting that behavior until r173294.

llvm-svn: 173383
2013-01-24 23:07:59 +00:00
Michael Han 9931593299 PR14922: when printing an attribute, use the real syntax of the attribute (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax.
Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. 
This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute.
When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and
name, then passed to Attr that will use the index to print itself. 

Thanks to Richard Smith for the idea and review.

llvm-svn: 173358
2013-01-24 16:46:58 +00:00
NAKAMURA Takumi a34792085c clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp: Add /usr/bin/cmp.
FIXME: It could be removed if;

  - check-all included llvm/valgrind/supp, too.
  - clang-vg didn't use "check-all".

llvm-svn: 172982
2013-01-20 15:30:41 +00:00
Benjamin Kramer e2e6e6a3d5 Turns out there is a simpler way of getting a set difference in bash than parsing diff output.
llvm-svn: 172420
2013-01-14 15:00:48 +00:00
Benjamin Kramer 6590abb384 Speed up find-unused-diagnostics. Now runs in less than a second instead of more than a minute.
llvm-svn: 172330
2013-01-12 21:39:06 +00:00
Dmitri Gribenko f857950d39 Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h

llvm-svn: 172323
2013-01-12 19:30:44 +00:00
Jordan Rose c3b23aa848 Error if an anonymous DiagGroup is referenced multiple times.
Not only is this inefficient for TableGen, it's annoying for maintenance
when renaming warning flags (unusual) or adding those flags to a group
(more likely).

This uses the new fix-it infrastructure for LLVM's SourceMgr/SMDiagnostic,
as well as a few changes to TableGen to track more source information.

llvm-svn: 172087
2013-01-10 18:50:46 +00:00
Argyrios Kyrtzidis 9f89bffc25 [utils/ClangDataFormat.py] Don't use lldb.frame directly, get the frame from the value.
Some lldb changes made lldb.frame not set until a script is invoked, which made the
formatters not working after a restart.

llvm-svn: 172017
2013-01-09 23:22:08 +00:00
Alexander Kornienko 9569c7625a Fixed a number of -Wcovered-switch-default diagnostics in tools/clang/include/clang/AST/AttrDump.inc
llvm-svn: 171768
2013-01-07 19:09:15 +00:00
Alexander Kornienko 5bc364eb05 Implement Attr dumping for -ast-dump.
http://llvm-reviews.chandlerc.com/D234

Patch by Philip Craig!

llvm-svn: 171760
2013-01-07 17:53:08 +00:00
Chandler Carruth 59ff16cf74 Sort the #include lines under utils/...
llvm-svn: 169245
2012-12-04 09:53:39 +00:00
Jordan Rose 64e4cf001b [analyzer] SATestBuild.py: allow make builds to disable parallelization
Before, SATestBuild unilaterally added '-j<n>' to every project built with
'make'. Now, we check and see if there's a -j option already specified, which
allows a project to explicitly be marked '-j1'.

llvm-svn: 168603
2012-11-26 19:59:57 +00:00
Jordan Rose 8832924acb [analyzer] SATestBuild.py: fix broken string concatenation
This has been broken for a while, but the branch was never being taken.
(We were trying to do 'str + floatVal'; now we do 'str % intVal' and use
the '%d' format.)

llvm-svn: 168174
2012-11-16 17:41:21 +00:00
Argyrios Kyrtzidis 71c81b63bc [ClangDataFormat.py] Add summary for QualType.
llvm-svn: 168117
2012-11-16 00:25:26 +00:00
Anna Zaks fab9bb6890 [analyzer] CmpRuns: move the clang_version info into the run (out of
report)

llvm-svn: 168105
2012-11-15 22:42:44 +00:00
Jordan Rose f477505d03 [analyzer] SATestBuild.py: correctly add -j option for projects using make.
llvm-svn: 168099
2012-11-15 22:03:53 +00:00
Argyrios Kyrtzidis ec1594a7b5 [utils/ClangDataFormat.py] For invalid source locations just return
"<invalid loc>" for summary.

llvm-svn: 168087
2012-11-15 20:59:00 +00:00
Argyrios Kyrtzidis a660ae4421 [PCH] Reading expressions from attributes should be done using ReadExpr(),
not ReadExpr().

Also add a test case making sure the thread safety attributes work as expected
when they come from a PCH.

Fixes rdar://12584141 & http://llvm.org/PR13982

llvm-svn: 168017
2012-11-15 01:31:39 +00:00
Argyrios Kyrtzidis a19a126ee3 [utils/ClangDataFormat.py] Add data formatter for StringRef.
llvm-svn: 168003
2012-11-14 23:52:19 +00:00
Argyrios Kyrtzidis a3caaf3a05 [utils/ClangDataFormat.py] In the summary of SourceLocation, include whether it is
local or loaded.

llvm-svn: 168002
2012-11-14 23:52:11 +00:00
Eric Christopher fd081ca50a Remove the cellspu port.
Approved by Chris Lattner.

llvm-svn: 167983
2012-11-14 22:08:59 +00:00
Anna Zaks 9821e57c09 [analyzer] Ensure that CmpRuns recursively walks the output directory.
llvm-svn: 167981
2012-11-14 21:32:16 +00:00
Argyrios Kyrtzidis 069a2df6fd Remove leftover code.
llvm-svn: 167641
2012-11-09 23:02:10 +00:00
Argyrios Kyrtzidis 32f1764d65 Add lldb data formatters for clang classes, starting with SourceLocation.
When installed, instead of getting this:

(lldb) p Tok.Loc
(clang::SourceLocation) $0 = {
  (unsigned int) ID = 123582
}

you'll get:

(lldb) p Tok.Loc
(clang::SourceLocation) $4 = "/usr/include/i386/_types.h:37:1" (offset: 123582, file)

This depends on r167629.

llvm-svn: 167640
2012-11-09 22:59:01 +00:00
Anna Zaks 69e2bf9e0c [analyzer] Test SimpleStream on the buildbot.
llvm-svn: 167317
2012-11-02 21:30:07 +00:00
Joerg Sonnenberger ee1f31ebea Don't require exception handling for clang-tblgen.
llvm-svn: 166713
2012-10-25 20:34:00 +00:00
Joerg Sonnenberger 691a16b444 Don't throw exceptions in clang-tblgen by switching to PrintFatalError.
Add locations in a number of places, where they are available for free.

llvm-svn: 166691
2012-10-25 16:37:08 +00:00
Michael J. Spencer 929fccd476 [Options] Add prefixes to options.
Each option has a set of prefixes. When matching an argument such as
-funroll-loops. First the leading - is removed as it is a prefix. Then
a lower_bound search for "funroll-loops" is done against the option table by
option name. From there each option prefix + option name combination is tested
against the argument.

This allows us to support Microsoft style options where both / and - are valid
prefixes. It also simplifies the cases we already have where options come in
both - and -- forms. Almost every option for gnu-ld happens to have this form.

llvm-svn: 166444
2012-10-22 22:13:48 +00:00