Граф коммитов

549 Коммитов

Автор SHA1 Сообщение Дата
Anna Zaks 210f5a2822 [analyzer] More internal stats collection.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27 18:38:32 +00:00
Anna Zaks 44cceb96ea [analyzer] Ted fixed the plist-html issue, so the assert can go away.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162598 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24 21:07:49 +00:00
Anna Zaks b81a9adc24 [analyzer] Unbreak the static analyzer buildbot.
We no longer associate the correct HTML file with plist diagnostic.
Fall out from r162028.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17 01:09:13 +00:00
Richard Smith 0dae729a69 Don't constant-fold when pretty-printing alignment attribute. This fixes a
potential crasher -- Context is sometimes a null reference (!!) here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16 02:43:29 +00:00
Richard Smith b27660a733 Placate the mingw32 buildbot by suffixing 64-bit constants with ULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161831 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14 03:55:16 +00:00
Richard Smith f8ee6bc1ef 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161827 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14 01:28:02 +00:00
Ted Kremenek bb5185c0ca 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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161695 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 20:50:00 +00:00
Joerg Sonnenberger 7094dee95f Add missing cctype includes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161660 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 10:58:18 +00:00
Ted Kremenek 4a535368eb 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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161389 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 05:01:49 +00:00
Jim Grosbach 66981c7ca1 TableGen: Remove extraneous \ character from arm_neon.h definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-03 17:30:46 +00:00
Anna Zaks 2a84b8bd10 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-02 00:41:40 +00:00
Jordan Rose dba417ce68 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160821 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 22:31:59 +00:00
Jordan Rose ac57d47546 Un-break standalone invocations of CmpRuns.py.
Fallout from CmpRuns.py API changes in r160314.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160800 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-26 20:03:51 +00:00
Michael Han cc4748a0cb Remove an unused header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160492 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 04:10:19 +00:00
Anna Zaks 7acc407240 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160314 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 20:21:42 +00:00
Ted Kremenek e8cf7d1434 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 05:53:30 +00:00
NAKAMURA Takumi 3b4c532596 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-07 02:48:02 +00:00
Ted Kremenek 25570a94ca 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159875 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 23:07:31 +00:00
Dmitri Gribenko 8d3ba23f2d 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06 00:28:32 +00:00
Anna Zaks 84c1f4b1ed [analyzer] Add a statistic for maximum CFG size and a script to summarize analyzer stats from scan-build output.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159776 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 20:44:02 +00:00
NAKAMURA Takumi 41de13b3b6 clang/utils/TableGen/ClangAttrEmitter.cpp: Fix abuse of StringRef (from getValueAsString()).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159662 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 14:45:09 +00:00
Sean Hunt 8571897a79 Fix a thinko and a stray debugging hunk in my attributes patch. Thanks to Jordan
Rose and Richard Smith for catching these.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 16:05:42 +00:00
Sean Hunt 8e083e71d4 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158767 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 23:57:03 +00:00
Jakob Stoklund Olesen 3532936f4f 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158749 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 21:48:43 +00:00
Sean Hunt b5aa17c5a1 Remove redundant uses of SmallString
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158731 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 18:12:18 +00:00
Sean Hunt c20c4e79ae 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158716 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 13:36:02 +00:00
Sean Hunt bfcb037a34 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158700 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19 03:39:03 +00:00
Sean Hunt 93f95f2a2c 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158661 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-18 16:13:52 +00:00
Jakob Stoklund Olesen 3cc509b5ac 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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158388 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-13 05:12:41 +00:00
Anna Zaks 19b17cb57a [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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158187 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08 01:50:49 +00:00
Douglas Gregor 3f1a5a2553 Minor comments and changes to clang-completion-mode.el, from David Wood!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158174 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07 22:33:29 +00:00
Jordan Rose 04bc014dfd [analyzer] SATestBuild should execute SVN updates even if Verbose is off.
Also, re-use glob results when looking for failure logs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157817 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 16:24:43 +00:00
Jordan Rose 6d7e372799 [analyzer] Fix SATestAdd to work with SATestBuild.
Also, eliminate global 'IsReferenceBuild' in SATestBuild. It doesn't get
passed around that much.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 16:24:38 +00:00
Aaron Ballman 46eb6ca7f2 Updating the visualizers to include more datatypes. Patch thanks to Jay Blanchard.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157763 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 19:27:30 +00:00
Jim Grosbach b4a542549c TableGen: Remove extraneous '\' at EOL in generated tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157700 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:18:29 +00:00
Ted Kremenek 7c45163d4d Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157229 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22 00:54:40 +00:00
Ted Kremenek 86674ec4bf Use Perl prototypes instead of shift.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157228 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22 00:52:49 +00:00
Ted Kremenek 3a46530395 Add basic delta-debugging script used for reducing analyzer crasher test cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21 23:29:01 +00:00
David Blaikie c4968d67b4 SmallString Visual Studio visualizer by Will Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156959 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-16 22:28:47 +00:00
Rafael Espindola 31c195ac0f 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156821 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15 14:09:55 +00:00
Douglas Gregor 703d412d19 Teach the parser to deal with multiple spellings for the same
attribute, rather than requiring multiple cases in consumers of this
information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-11 23:37:49 +00:00
Jim Grosbach 667381b21f ARM: Support marking intrinsic definitions as 'unavailable'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156490 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-09 18:17:30 +00:00
Richard Smith 46484770fe Remove DiagGroups from notes, and add a TableGen assertion to catch them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156192 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-04 19:05:50 +00:00
Douglas Gregor 0c19b3c38e 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!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 17:33:51 +00:00
Douglas Gregor 331d2ec7cd Introduce the notion of 'ignored' attributes, so that all attributes
we accept are not modeled somehow via Attr.td.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 16:18:45 +00:00
Douglas Gregor 3e7d31aa60 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 15:56:52 +00:00
Douglas Gregor d6268ffe94 Revert my optimization to AttributeList::getKind() in r155987;
Benjamin has suggested a better approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 14:50:50 +00:00
Douglas Gregor b6dd6055a4 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>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155987 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 14:24:30 +00:00
Gabor Greif e47398abd3 Add a FIXME for uncomplete comment
fix a typo
add punctuation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155443 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-24 15:42:03 +00:00
David Blaikie 789acdd196 Add SmallVectorImpl Visual Studio visualizer. Patch by Nikola Smiljanic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155140 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 17:26:49 +00:00