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

41972 Коммитов

Автор SHA1 Сообщение Дата
Jordan Rose 187f8bd88b [analyzer] Show notes inside implicit calls at the last explicit call site.
Before:
  struct Wrapper { <-- 2. Calling default constructor for 'NonTrivial'.
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.

After:
  struct Wrapper {
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.
             ^-- 2. Calling default constructor for 'NonTrivial'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:28:30 +00:00
Chris Lattner 125eb3e3b6 ReadSourceManagerBlock is skipping over records that can contain Blobs. Not passing
in a StringRef to bind to them forces them to be unpacked into the Record as individual
bytes.  This is wasteful, but not likely to be measurable in this instance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:28:26 +00:00
Douglas Gregor 8222b8951d Revert r173056; it breaks one of the CodeGen-with-PCH tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173058 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 16:52:34 +00:00
Douglas Gregor c44cc015a8 When loading an identifier from an AST file solely for the purpose of
forming the identifier, e.g., as part of a selector or a declaration
name, don't actually deserialize any information about the
identifier. Instead, simply mark it "out-of-date" and we'll load the
the information on demand. 2% speedup on the modules testcase I'm
looking at; should also help PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173056 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 16:47:11 +00:00
Manuel Klimek 2f1ac41a6d Fixes formatting of empty blocks.
We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement

Note that we usually don't put record definitions into a single line, as
there's usually at least one more token (the semicolon) after the
closing brace. This doesn't hold when we are in a context where there is
no semicolon, like "enum E {}".

There were some missing tests around joining lines around the corner
cases of the allowed number of columns, so this patch adds some.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173055 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 16:42:44 +00:00
Douglas Gregor 9cfdc03fe7 When deserializing a declaration, don't look for redeclarations if its
kind indicates that it can never be redeclared. Good for a 1% speedup,
and redeclaration searching drops off the profile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173054 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 16:16:40 +00:00
Douglas Gregor 5a04f9fc2b Introduce a fast path for the ASTReader's name lookup within a
DeclContext. When the DeclContext is of a kind that can only be
defined once and never updated, we limit the search to the module file
that conatins the lookup table. Provides a 15% speedup in one
modules-heavy source file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173050 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 15:25:38 +00:00
Daniel Jasper 032f253295 Fix parsing of templated declarations.
Before: template <template <typename T>, typename P > class X;
After:  template <template <typename T>, typename P> class X;

More importantly, the token annotations for the second ">" are now computed
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173047 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 14:39:22 +00:00
Manuel Klimek d19dc2ddf3 Fixes indent in linkage specification blocks.
We now indent:
extern "C" {
int a;
}

without additional indent inside the extern "C" block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173045 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 14:32:05 +00:00
Daniel Jasper 9c8c40e733 Fix bug discovered by valgrind.
When trying to merge lines, we should not touch lines that are invalid,
as we don't know how long they might be.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 14:18:28 +00:00
Manuel Klimek 0fbe0087d2 Add regression test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173042 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 14:16:56 +00:00
NAKAMURA Takumi 6de6aab824 AST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 14:15:24 +00:00
Manuel Klimek 3a3408cceb Fixes detection of class template specializations.
Now correctly formats:
template <> class A<int> {} a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173038 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 13:58:54 +00:00
Timur Iskhodzhanov 649c7316aa First step towards vftable generation with -cxx-abi microsoft PR13231
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173035 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 13:02:41 +00:00
Dmitri Gribenko 445743dec7 Add a fixit for _Noreturn main,
add tests for fixits removing static and inline from main


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173024 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 11:25:03 +00:00
NAKAMURA Takumi d24c9ab90b CGDebugInfo.cpp: Fix a warning. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 10:51:28 +00:00
Manuel Klimek 7f5b025e9b Allow for nested name specifiers in record declarations.
Now correctly formats:
class A::B {} n;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173019 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 10:17:14 +00:00
Manuel Klimek c44ee89cb4 Fix parsing of return statements.
Previously, we would not detect brace initializer lists in return
statements, thus:
 return (a)(b) { 1, 2, 3 };
would put the semicolon onto the next line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173017 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 10:07:49 +00:00
Alexey Samsonov 2cb3d300ec Port r172856: 'Include ubsan runtime even when building a shared library. We don't require executable to be linked with UBSan.' to Mac
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173014 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 08:45:02 +00:00
David Blaikie 4b12be6a35 PR14472: Preserve qualifiers while unwrapping types for debug info
Looks like r161368 fixed this for one case but not all. This change generalizes
the solution over all the unwrapping cases. Now that preserving the qualifiers
is done independent of the particular type being unwrapped I won't bother
adding test cases for each one but at least demonstrate that this change was
necessary & sufficient to fix the bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 04:37:12 +00:00
Benjamin Kramer d9e26f59c2 Prune unused diagnostics.
Courtesy of utils/find-unused-diagnostics.sh.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172988 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 19:29:01 +00:00
NAKAMURA Takumi 4867b1bd4b 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".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 15:30:41 +00:00
NAKAMURA Takumi eedba1d620 Add bitreader to LINK_COMPONENTS in users of libclang, c-arcmt-test and c-index-test.
They don't link cygclang.dll, but libclang.a on cygwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172980 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 14:53:49 +00:00
Alexey Samsonov 4bdc60434c Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes AddressSanitizer use bottom of the address space for the shadow memory. On Linux it can be used with -fPIE/-pie to improve performance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172974 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 13:12:12 +00:00
Guy Benyei e6b9d802fb Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 12:31:11 +00:00
Chris Lattner b3ce35764a update to use the new BitcodeCursor readRecord that takes a StringRef blob parameter,
and adopt "advance" in more places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172951 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 02:38:54 +00:00
Sean Silva d47afb96a3 Nuke SetUpBuildDumpLog.
Also, it was the only reason that `argc` and `argv` were being passed
into createDiagnostics, so remove those parameters and clean up callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 01:58:28 +00:00
Sean Silva d2ff76b84c Fix what appears to be a copy-paste error.
This looks like it was copied from SetUpBuildDumpLog, which dumps to the
file `DiagOpts->DumpBuildInformation`. There is another member
`DiagOpts->DiagnosticLogFile` which appears to be unused. The fact that
this feature doesn't even print to the output file specified on the
command line makes me think that it should be ripped out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 01:58:26 +00:00
David Blaikie a89701bb49 The last of PR14471: Debug info support for inline in-class initializer for float static members
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172942 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 01:19:17 +00:00
Michael Gottesman 0116a40116 Fixed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 01:04:14 +00:00
Chris Lattner e4e4a88eb6 add back a #include needed on some builders.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 00:57:52 +00:00
Chris Lattner 8f9a1eb6dd finish converting the normal cases in ASTReader to use the new BitstreamCursor APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172937 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 00:56:42 +00:00
Tobias Grosser bba99ad6e2 [cindex.py]: Use spaces instead of tabs
The tabs slipped in accidentally.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 00:42:16 +00:00
Chris Lattner 99a5af0088 convert some more stuff over to use new cursor APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 00:00:22 +00:00
Dmitri Gribenko 4918c53152 Actually update the test, fixup for r172923
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172925 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 22:11:28 +00:00
Dmitri Gribenko c934dfe950 Use llvm::hexDigitValue in comment lexer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 22:06:05 +00:00
Dmitri Gribenko 44a3ddbf7d Comment parsing: add more tests for html character references
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 22:04:44 +00:00
Chris Lattner 88bde50fa3 switch a bunch of ASTReader to use the new BitstreamCursor::advance* methods,
which hide a bunch of private details of the cursor from clients and simplify
their code.  More to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172922 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 21:39:22 +00:00
Chris Lattner e485f0761a random tidying
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172920 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 21:35:35 +00:00
Jordan Rose 2b9de0bc05 [analyzer] Don't show "Entered 'foo'" if 'foo' is implicit.
Before:
  Calling implicit default constructor for 'Foo'  (where Foo is constructed)
  Entered call from 'test'  (at "=default" or 'Foo' declaration)
  Calling default constructor for 'Bar'  (at "=default" or 'Foo' declaration)

After:
  Calling implicit default constructor for 'Foo'  (where Foo is constructed)
  Calling default constructor for 'Bar'  (at "=default" or 'Foo' declaration)

This only affects the plist diagnostics; this note is never shown in the
other diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 19:52:57 +00:00
David Blaikie e8d7514d6a Emit the function type of member function pointer types the same as member functions.
Adding the pseudo first parameter to a member function pointer's function type
and mark it as artificial.

Combined with a fix to GDB ( http://sourceware.org/bugzilla/show_bug.cgi?id=14998 )
this fixes gdb.cp/member-ptr.exp with Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 19:20:56 +00:00
Benjamin Kramer e38c339ca4 libclangSerialization also depends on the bitreader.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172910 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 19:10:12 +00:00
Chris Lattner 2815bc91cf update header comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172909 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 18:47:35 +00:00
Chris Lattner 3a5fa0383c fix the unit tests too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172907 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 18:30:39 +00:00
Chris Lattner 5975b67a9b these now depend on the bitcode reader too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172906 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 18:28:24 +00:00
Chris Lattner ac179ca12b this depends on the bitcode reader, since it is using it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 18:24:13 +00:00
Tobias Grosser 69a8552f85 [cindex.py] Add cache for CompletionChunk spellings
Most of the CompletionChunks represent braces, colons or other one
character spellings. There is no need to call libclang, to figure out
how to write a colon. Instead we use an internal cache to retrieve the
correct spelling. As function calls from python are very expensive and
this is a performance critical part of auto completion this patch makes
formatting of auto completion results a lot faster.

Formatting time changes from 0.57 to 0.45 seconds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172901 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 11:03:44 +00:00
Tobias Grosser eca36d1ae2 [cindex.py] Replace CachedProperty with our own implementation
This is a very performance critical point for auto completion. The manual
implementation gives a large speedup. As it does not complicate the code a lot,
I figured it is worth the change. If anybody understands why the CachedProperty
is here so much slower, I am very interested in working on an improvement of
CachedProperty.

Formatting time changes from 0.72 to 0.57 seconds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 11:03:42 +00:00
Tobias Grosser e43d3861d9 [cindex.py]: Speed up lookup of the completion kind
We can directly the number of the kind instead of going through the
completionChunkKindMap.

Formatting time changes from 0.84 to 0.72 seconds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172899 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 11:03:40 +00:00
Chandler Carruth b1ba0efc3d Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 08:09:44 +00:00