Commit Graph

719 Commits

Author SHA1 Message Date
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
Anna Zaks 639b40484e [analyzer] CmpRuns: cleanup APIs, allow processing of plists with no
clang_version, fix the compare routine.

llvm-svn: 166129
2012-10-17 21:09:26 +00:00
Anna Zaks 93283d0933 [analyzer] Expose clang_version in CmpRuns
llvm-svn: 166048
2012-10-16 19:36:39 +00:00
Anna Zaks c80313b888 [analyzer] CmpRuns - cleaned up the API, added relative path getter
llvm-svn: 165995
2012-10-15 22:48:21 +00:00
Sean Silva e2bb2ff576 Remove pointless classof()'s.
Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

llvm-svn: 165770
2012-10-11 23:31:23 +00:00
Sean Silva 88c42b7cfa tblgen: Build clang-tblgen without RTTI.
clang-tblgen no longer needs RTTI!

llvm-svn: 165650
2012-10-10 20:25:45 +00:00
Sean Silva 1c4aaa8d1c tblgen: Use LLVM-style RTTI in clang-tblgen
llvm-svn: 165649
2012-10-10 20:25:43 +00:00
Sean Silva f85f39df47 tblgen: Migrate clang-tblgen to new TableGenMain API.
llvm-svn: 165167
2012-10-03 21:29:30 +00:00
Dmitri Gribenko 1da8886915 Comment sema: warn when comment has \deprecated but declaration does not have a
deprecation attribute ('deprecated', 'availability' or 'unavailable').

This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it
can be turned off easily while leaving other -Wdocumentation warnings on.

llvm-svn: 164467
2012-09-22 21:47:50 +00:00
Dmitri Gribenko b37d5e8a95 Comment parsing: handle \deprecated command. It is a block command, but it
should be fine to use it without further explanations in the attached
paragraph, so the warning about empty paragraph was turned off for it.

llvm-svn: 163836
2012-09-13 20:36:01 +00:00
Dmitri Gribenko 7acbf00f96 Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.
Now we have a list of all commands.  This is a good thing in itself, but it
also enables us to easily implement typo correction for command names.

With this change we have objects that contain information about each command,
so it makes sense to resolve command name just once during lexing (currently we
store command names as strings and do a linear search every time some property
value is needed).  Thus comment token and AST nodes were changed to contain a
command ID -- index into a tables of builtin and registered commands.  Unknown
commands are registered during parsing and thus are also uniformly assigned an
ID.  Using an ID instead of a StringRef is also a nice memory optimization
since ID is a small integer that fits into a common bitfield in Comment class.

This change implies that to get any information about a command (even a command
name) we need a CommandTraits object to resolve the command ID to CommandInfo*.
Currently a fresh temporary CommandTraits object is created whenever it is
needed since it does not have any state.  But with this change it has state --
new commands can be registered, so a CommandTraits object was added to
ASTContext.

Also, in libclang CXComment has to be expanded to include a CXTranslationUnit
so that all functions working on comment AST nodes can get a CommandTraits
object.  This breaks binary compatibility of CXComment APIs.

Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't
need TU parameter anymore, so it was removed.  This is a source-incompatible
change for this C API.

llvm-svn: 163540
2012-09-10 20:32:42 +00:00
Ted Kremenek dc1f6bc454 Add handy script for updating plist FileCheck expected output for
analyzer tests.

llvm-svn: 163486
2012-09-10 06:19:34 +00:00
Anna Zaks a2f970baa6 [analyzer] testing: add a build mode to allow C++11 testing.
llvm-svn: 163357
2012-09-06 23:30:27 +00:00
Roman Divacky e637711ae0 Dont cast away const needlessly. Found by gcc48 -Wcast-qual.
llvm-svn: 163325
2012-09-06 15:59:27 +00:00
Dmitri Gribenko 3ca956f715 Comment HTML tag name machers: move from StringSwitch to an efficient
TableGen-generated string matcher.

llvm-svn: 162969
2012-08-31 02:21:44 +00:00
Jordan Rose 9858b12381 Revert "[analyzer] Disable diagnostic checking on the buildbot."
This reverts commit befc0f648c83f65e1f3567f2058c7c18b4bc3ad8 now that
plist-html diagnostics are working again.

llvm-svn: 162966
2012-08-31 00:36:30 +00:00
Anna Zaks 5e2f0b2151 [analyzer] Disable diagnostic checking on the buildbot.
Due to recent diagnostic changes, we may generate malformed diagnostics.

llvm-svn: 162940
2012-08-30 21:04:09 +00:00
Anna Zaks 07a821fb17 [analyzer] Fixup 162863.
Thanks Jordan.

llvm-svn: 162875
2012-08-29 23:23:39 +00:00
Anna Zaks f329823dc0 [analyzer]Fix typo, unbreak static analyzer BuildBot (at least
partially).

(Addresses a regression from r162790.)

llvm-svn: 162864
2012-08-29 21:22:40 +00:00
Ted Kremenek f9a539d858 Automatically use more cores when the test build uses 'make'.
llvm-svn: 162790
2012-08-28 20:40:04 +00:00
Ted Kremenek 42c14428d2 Consolidate helper methods and configuration logic. No functionality change.
llvm-svn: 162789
2012-08-28 20:40:02 +00:00
Ted Kremenek 6cb2080e5e Pass --use-analyzer to scan-build when running within the test harness.
llvm-svn: 162783
2012-08-28 20:20:52 +00:00
Ted Kremenek 4220144acb experimental.security.taint is now alpha.security.taint
llvm-svn: 162775
2012-08-28 18:45:22 +00:00
Anna Zaks 7d2babc046 [analyzer] More internal stats collection.
llvm-svn: 162687
2012-08-27 18:38:32 +00:00
Anna Zaks e12365bc27 [analyzer] Ted fixed the plist-html issue, so the assert can go away.
llvm-svn: 162598
2012-08-24 21:07:49 +00:00
Anna Zaks af3ae3cbbd [analyzer] Unbreak the static analyzer buildbot.
We no longer associate the correct HTML file with plist diagnostic.
Fall out from r162028.

llvm-svn: 162071
2012-08-17 01:09:13 +00:00
Richard Smith 52f04a2e8f Don't constant-fold when pretty-printing alignment attribute. This fixes a
potential crasher -- Context is sometimes a null reference (!!) here.

llvm-svn: 162007
2012-08-16 02:43:29 +00:00
Richard Smith f44b8ee52e Placate the mingw32 buildbot by suffixing 64-bit constants with ULL.
llvm-svn: 161831
2012-08-14 03:55:16 +00:00
Richard Smith 7d6d47b862 Fix undefined behavior (and wrong code, as far as I can tell) in NEON builtin
tablegen code, found by -fcatch-undefined-behavior. I would appreciate if
someone more familiar with the NEON code could point me in the direction of how
to write a test for this. We appear to have essentially no test coverage
whatsoever for these builtins.

llvm-svn: 161827
2012-08-14 01:28:02 +00:00
Ted Kremenek 5d858cb916 Fix horrible regression in control of warnings caused by introduction of -Wpedantic.
While -Wpedantic was reasonable, -Wno-pedantic would turn off a bunch of warnings that
are on by default.  This counters the intention of this warning flag.

To fix this, -Wpedantic now includes extentions that are not on by default.  The
remaining warnings will manifest anyway, and won't accidentally get turned off
by -Wno-pedantic.

Fixes <rdar://problem/12076105>

llvm-svn: 161695
2012-08-10 20:50:00 +00:00
Joerg Sonnenberger 42cf26883e Add missing cctype includes.
llvm-svn: 161660
2012-08-10 10:58:18 +00:00
Ted Kremenek 724923945b Enhance ClangDiagnosticsEmitter to reject diagnostics that are errors that are also
included in warning groups.  Warning groups can only contain warnings, because only
warnings can be mapped to errors or ignored.

This caught a few diagnostics that were incorrectly in diagnostic groups, and
could have resulted in a compiler crash when those diagnostic groups were mapped.

Fixes <rdar://problem/12044436>

llvm-svn: 161389
2012-08-07 05:01:49 +00:00
Jim Grosbach cc6b1816fd TableGen: Remove extraneous \ character from arm_neon.h definitions.
llvm-svn: 161244
2012-08-03 17:30:46 +00:00
Anna Zaks 45a992b5f0 [analyzer] CmpRuns should include file name in the issue identifier.
This prevents us from treating the issues from different files with the
same function names and same offsets as the same.

The issue identifier now includes the file name. Also added a way to
strip off the root directories form the source file names.

llvm-svn: 161150
2012-08-02 00:41:40 +00:00
Jordan Rose c2a3223da9 SATestBuild should not ask for non-existent checkers.
- "cocoa" was moved to "osx.cocoa" a long time ago.
- "cplusplus" would be a valid package except we don't have any C++ checkers.

llvm-svn: 160821
2012-07-26 22:31:59 +00:00
Jordan Rose 5920a1bdd1 Un-break standalone invocations of CmpRuns.py.
Fallout from CmpRuns.py API changes in r160314.

llvm-svn: 160800
2012-07-26 20:03:51 +00:00
Michael Han 7973250e33 Remove an unused header
llvm-svn: 160492
2012-07-19 04:10:19 +00:00
Anna Zaks 9b7d7140ef [analyzer] Make CmpRuns external-user friendly.
CmpRuns can be used for static analyzer bug report comparison. However,
we want to make sure external users do not rely on the way bugs are
represented (plist files). Make sure that we have a user
friendly/documented API for CmpRuns script.

llvm-svn: 160314
2012-07-16 20:21:42 +00:00
Ted Kremenek b22ea2acea Re-apply r159875 with fixes.
- Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32
- Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic.

llvm-svn: 159892
2012-07-07 05:53:30 +00:00
NAKAMURA Takumi eec53e4069 Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.
I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test.

> 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp

llvm-svn: 159886
2012-07-07 02:48:02 +00:00
Ted Kremenek 9877f689f2 Implement -Wpedantic and --no-pedantic to complement -Weverything.
This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions.  This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag.  This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic.  Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them.  Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly.  I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports.  It does what it says: cancels out
-pedantic.  One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win).  We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output.  This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings).  That's a 31% reduction.

llvm-svn: 159875
2012-07-06 23:07:31 +00:00
Dmitri Gribenko ec92531c29 Implement AST classes for comments, a real parser for Doxygen comments and a
very simple semantic analysis that just builds the AST; minor changes for lexer
to pick up source locations I didn't think about before.

Comments AST is modelled along the ideas of HTML AST: block and inline content.

* Block content is a paragraph or a command that has a paragraph as an argument
  or verbatim command.
* Inline content is placed within some block.  Inline content includes plain
  text, inline commands and HTML as tag soup.

llvm-svn: 159790
2012-07-06 00:28:32 +00:00
Anna Zaks 40b87fc1f9 [analyzer] Add a statistic for maximum CFG size and a script to summarize analyzer stats from scan-build output.
llvm-svn: 159776
2012-07-05 20:44:02 +00:00
NAKAMURA Takumi da94a2d901 clang/utils/TableGen/ClangAttrEmitter.cpp: Fix abuse of StringRef (from getValueAsString()).
llvm-svn: 159662
2012-07-03 14:45:09 +00:00
Alexis Hunt 6c19063a1c Fix a thinko and a stray debugging hunk in my attributes patch. Thanks to Jordan
Rose and Richard Smith for catching these.

llvm-svn: 158826
2012-06-20 16:05:42 +00:00
Alexis Hunt 3bc72c1ec2 Reapply r158700 and fixup patches, minus one hunk that slipped through and
caused a crash in an obscure case. On the plus side, it caused me to catch
another bug by inspection.

llvm-svn: 158767
2012-06-19 23:57:03 +00:00
Jakob Stoklund Olesen e1c0ae6fda Revert r158700 and dependent patches r158716, r158717, and r158731.
The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

llvm-svn: 158749
2012-06-19 21:48:43 +00:00
Alexis Hunt 6f832c5733 Remove redundant uses of SmallString
llvm-svn: 158731
2012-06-19 18:12:18 +00:00
Alexis Hunt abc99d8d04 Stop abusing StringRef. Fixes the Windows build.
I've also removed the duplicate check for PARSED_ATTR since it seems
unnecessary, and would have made the code more complicated.

llvm-svn: 158716
2012-06-19 13:36:02 +00:00
Alexis Hunt 7b28cdb3da Improve the specification of spellings in Attr.td.
Note that this is mostly a structural patch that handles the change from the old
spelling style to the new one. One consequence of this is that all AT_foo_bar
enum values have changed to not be based off of the first spelling, but rather
off of the class name, so they are now AT_FooBar and the like (a straw poll on
IRC showed support for this). Apologies for code churn.

Most attributes have GNU spellings as a temporary solution until everything else
is sorted out (such as a Keyword spelling, which I intend to add if someone else
doesn't beat me to it). This is definitely a WIP.

I've also killed BaseCheckAttr since it was unused, and I had to go through
every attribute anyway.

llvm-svn: 158700
2012-06-19 03:39:03 +00:00
Alexis Hunt a0e54d453b Handle C++11 attribute namespaces automatically.
Now, as long as the 'Namespaces' variable is correct inside Attr.td, the
generated code will correctly admit a C++11 attribute only when it has the
appropriate namespace(s).

llvm-svn: 158661
2012-06-18 16:13:52 +00:00
Jakob Stoklund Olesen 995e0e13fa Make clang-tblgen backends functions instead of TableGenBackends.
Get rid of a bunch of header files. TableGen output should be unaffected.

Patch by Sean Silva!

llvm-svn: 158388
2012-06-13 05:12:41 +00:00
Anna Zaks d60367b893 [analyzer] Use "issue hash" in CmpRuns; followup on r158180
(For the future: It would be more efficient to produce a hash key with
the embedded function info inside the compiler.)

llvm-svn: 158187
2012-06-08 01:50:49 +00:00
Douglas Gregor cb8cf4916f Minor comments and changes to clang-completion-mode.el, from David Wood!
llvm-svn: 158174
2012-06-07 22:33:29 +00:00
Jordan Rose dc191a184f [analyzer] SATestBuild should execute SVN updates even if Verbose is off.
Also, re-use glob results when looking for failure logs.

llvm-svn: 157817
2012-06-01 16:24:43 +00:00
Jordan Rose 01ac57244c [analyzer] Fix SATestAdd to work with SATestBuild.
Also, eliminate global 'IsReferenceBuild' in SATestBuild. It doesn't get
passed around that much.

llvm-svn: 157816
2012-06-01 16:24:38 +00:00
Aaron Ballman f4f486f732 Updating the visualizers to include more datatypes. Patch thanks to Jay Blanchard.
llvm-svn: 157763
2012-05-31 19:27:30 +00:00
Jim Grosbach 6acd46f5e9 TableGen: Remove extraneous '\' at EOL in generated tests.
llvm-svn: 157700
2012-05-30 18:18:29 +00:00
Ted Kremenek f5958eb2b4 Fix typo.
llvm-svn: 157229
2012-05-22 00:54:40 +00:00
Ted Kremenek c53ed2e158 Use Perl prototypes instead of shift.
llvm-svn: 157228
2012-05-22 00:52:49 +00:00
Ted Kremenek 2fe1ed3e0d Add basic delta-debugging script used for reducing analyzer crasher test cases.
llvm-svn: 157219
2012-05-21 23:29:01 +00:00
David Blaikie 1f05227a3d SmallString Visual Studio visualizer by Will Wilson.
llvm-svn: 156959
2012-05-16 22:28:47 +00:00
Rafael Espindola 7f90b7d4c2 Fix our handling of visibility in explicit template instantiations.
* Don't copy the visibility attribute during instantiations. We have to be able
  to distinguish

 struct HIDDEN foo {};
 template<class T>
 DEFAULT void bar() {}
 template DEFAULT void bar<foo>();

from

 struct HIDDEN foo {};
 template<class T>
 DEFAULT void bar() {}
 template void bar<foo>();

* If an instantiation has an attribute, it takes precedence over an attribute
  in the template.

* With instantiation attributes handled with the above logic, we can now
  select the minimum visibility when looking at template arguments.

llvm-svn: 156821
2012-05-15 14:09:55 +00:00
Douglas Gregor 87a170c1e6 Teach the parser to deal with multiple spellings for the same
attribute, rather than requiring multiple cases in consumers of this
information.

llvm-svn: 156666
2012-05-11 23:37:49 +00:00
Jim Grosbach 6f855e3024 ARM: Support marking intrinsic definitions as 'unavailable'
llvm-svn: 156490
2012-05-09 18:17:30 +00:00
Richard Smith ce52ca178d Remove DiagGroups from notes, and add a TableGen assertion to catch them.
llvm-svn: 156192
2012-05-04 19:05:50 +00:00
Douglas Gregor 377f99bc68 Replace the StringSwitch in AttributeList::getKind() with a
TableGen-generated StringMatcher, for a 1.2% speedup in -fparse-only
time in <rdar://problem/11004361>. Thanks to Benjamin for pointing me
at StringMatcher!

llvm-svn: 156003
2012-05-02 17:33:51 +00:00
Douglas Gregor 19fbb8fa81 Introduce the notion of 'ignored' attributes, so that all attributes
we accept are not modeled somehow via Attr.td.

llvm-svn: 155998
2012-05-02 16:18:45 +00:00
Douglas Gregor b2daf8416e Introduce the notion of an attribute that has no direct representation
as an AST node, and fold a number of such attributes into Attr.td.

llvm-svn: 155995
2012-05-02 15:56:52 +00:00
Douglas Gregor 0191bf8655 Revert my optimization to AttributeList::getKind() in r155987;
Benjamin has suggested a better approach.

llvm-svn: 155989
2012-05-02 14:50:50 +00:00
Douglas Gregor adfe5afe38 Replace the StringSwitch in AttributeList::getKind(const
IdentifierInfo *) with a static StringMap, improving -fsyntax-only
performance by 1% for the example in <rdar://problem/11004361>.

llvm-svn: 155987
2012-05-02 14:24:30 +00:00
Gabor Greif ec1f7e872c Add a FIXME for uncomplete comment
fix a typo
add punctuation

llvm-svn: 155443
2012-04-24 15:42:03 +00:00
David Blaikie 2e3380308e Add SmallVectorImpl Visual Studio visualizer. Patch by Nikola Smiljanic.
llvm-svn: 155140
2012-04-19 17:26:49 +00:00
Eric Christopher aefeaa9873 Remove the vestiges of the C backend.
llvm-svn: 153308
2012-03-23 05:51:52 +00:00
Aaron Ballman fa432f30d4 Adding namespace qualifiers to the visualizers and improving their behavior.
Patch thanks to Nikola Smiljanic

llvm-svn: 152514
2012-03-10 22:28:45 +00:00
Argyrios Kyrtzidis 8b0f3e0525 [utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failure
without reverting the changes.

llvm-svn: 152333
2012-03-08 20:29:39 +00:00
Argyrios Kyrtzidis 941d092933 [utils/FuzzTest] The help message says that if you don't specify --max-tests
"the script will run forever continually picking new tests to run", make it so.

llvm-svn: 152327
2012-03-08 20:11:06 +00:00
Argyrios Kyrtzidis 05d2212db3 [utils/FuzzTest] For --filelist the option type is string, not integer.
llvm-svn: 152324
2012-03-08 18:56:59 +00:00
Daniel Dunbar 1c66a0e1c0 Spelling.
llvm-svn: 152281
2012-03-08 01:54:33 +00:00
Michael Han 4a04517329 Refactor Clang sema attribute handling.
This submission improves Clang sema handling by using Clang tablegen
to generate common boilerplate code. As a start, it implements AttributeList
enumerator generation and case statements for AttributeList::getKind.

A new field "SemaHandler" is introduced in Attr.td and by default set to 1
as most of attributes in Attr.td have semantic checking in Sema. For a small
number of attributes that don't appear in Sema, the value is set to 0.

Also there are a small number of attributes that only appear in Sema but not
in Attr.td. Currently these attributes are still hardcoded in Sema AttributeList.

Reviewed by Delesley Hutchins.

llvm-svn: 152169
2012-03-07 00:12:16 +00:00
Argyrios Kyrtzidis 87acf19a5c [tablegen] Make sure that the code that is determining the order of warning groups
is shared to avoid any "misalignment" if indices.

llvm-svn: 152074
2012-03-06 00:00:38 +00:00
Anna Zaks 6ecb6a6b7f [analyzer] Testing: These checkers are not experimental anymore.
llvm-svn: 150989
2012-02-20 21:10:40 +00:00
Benjamin Kramer a8cafe23e3 Store the warning option corresponding to a diagnostics as an index into the option table instead of storing the name.
Another 8 bytes + relocation removed from every diagnostic on x86_64.

llvm-svn: 150615
2012-02-15 20:57:03 +00:00
Anna Zaks a432feaf26 [analyzer] Add the Malloc checker to the list of tested checkers.
llvm-svn: 150535
2012-02-15 00:19:07 +00:00
Dmitri Gribenko 5dc3a6936d Add a script that produces a list of all diagnostics that are defined in
Diagnostic*.td files but not used in sources.

llvm-svn: 150410
2012-02-13 20:21:52 +00:00
Dylan Noblesmith f1a13f29f2 drop more llvm:: prefixes on SmallString<>
More cleanup after r149799.

llvm-svn: 150380
2012-02-13 12:32:26 +00:00
Daniel Dunbar dc51baade4 Remove stray semi-colon.
llvm-svn: 150231
2012-02-10 06:00:29 +00:00
Benjamin Kramer 3edb3b4ac5 Kill the brief and full explanation fields from StaticDiagInfoRec. They were unused and wasted space for nothing.
- per PR11952.

llvm-svn: 150199
2012-02-09 19:38:26 +00:00
Aaron Ballman abc7c5c5b6 Added MSVC visualizers for PointerIntPair and PointerUnions.
Patch by Nikola Smiljanic

llvm-svn: 149896
2012-02-06 20:47:31 +00:00
Benjamin Kramer bf8da9d706 Move instantiateTemplateAttribute into the sema namespace, make helpers static.
llvm-svn: 149864
2012-02-06 11:13:08 +00:00
Anna Zaks 4c1ef976a8 [analyzer] Testing: add automated reference results reset.
llvm-svn: 149682
2012-02-03 06:35:23 +00:00
Anna Zaks 97981bdeb0 [analyzer] Testing: add 2 new checkers to the buildbot script.
llvm-svn: 149514
2012-02-01 16:46:57 +00:00
Anna Zaks b3d896d333 [analyzer] Add the HTML file to the SATest diagnostic diff.
(Uses the functionality which has been in CmpRuns long before.)

llvm-svn: 148868
2012-01-24 21:57:35 +00:00
Anna Zaks 895c312404 [analyzer] Testing: make diagnostic diffs more informative (add
diagnostic message).

llvm-svn: 148867
2012-01-24 21:57:32 +00:00
Anna Zaks a08c6b7efc [analyzer] Unbreak the static analyzer bot. Regression from r148558.
When we build a single source file, we call clang directly (not though scan-build).

llvm-svn: 148612
2012-01-21 01:11:35 +00:00
DeLesley Hutchins 30398dd410 Delayed template instantiation of late-parsed attributes.
llvm-svn: 148595
2012-01-20 22:50:54 +00:00
DeLesley Hutchins ceec3063e2 Instantiate dependent attributes when instantiating templates.
llvm-svn: 148592
2012-01-20 22:37:06 +00:00
Anna Zaks 7a75cf32a2 [analyzer] Tweak the buildbot script to include the experimental taint checker and correct the checker enabling setting.
llvm-svn: 148558
2012-01-20 19:10:59 +00:00
David Blaikie 8a40f700e6 Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
llvm-svn: 148292
2012-01-17 06:56:22 +00:00
David Blaikie f47fa304a4 Remove unnecessary default cases in switches over enums.
This allows -Wswitch-enum to find switches that need updating when these enums are modified.

llvm-svn: 148281
2012-01-17 02:30:50 +00:00
Jakob Stoklund Olesen 6f2288b67c CodeInit was replaced by StringInit.
llvm-svn: 148095
2012-01-13 04:57:47 +00:00
Anna Zaks de1f7f8bfb [analyzer] Testing infrastructure: Flush output after every print
statement.

llvm-svn: 147862
2012-01-10 18:10:25 +00:00
Benjamin Kramer 4fde7a8007 Remove unused include of VectorExtras.h.
llvm-svn: 147737
2012-01-07 19:41:22 +00:00