Commit Graph

570 Commits

Author SHA1 Message Date
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