Commit Graph

42880 Commits

Author SHA1 Message Date
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
NAKAMURA Takumi a589b96041 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.

llvm-svn: 172980
2013-01-20 14:53:49 +00:00
Alexey Samsonov 29524a9871 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.
llvm-svn: 172974
2013-01-20 13:12:12 +00:00
Guy Benyei 1b4fb3e08b Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)
llvm-svn: 172973
2013-01-20 12:31:11 +00:00
Chris Lattner 0e6c940d2c update to use the new BitcodeCursor readRecord that takes a StringRef blob parameter,
and adopt "advance" in more places.

llvm-svn: 172951
2013-01-20 02:38:54 +00:00
Sean Silva f1b49e237f 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.

llvm-svn: 172945
2013-01-20 01:58:28 +00:00
Sean Silva 2118a5cd2b 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.

llvm-svn: 172944
2013-01-20 01:58:26 +00:00
David Blaikie d42917f01c The last of PR14471: Debug info support for inline in-class initializer for float static members
llvm-svn: 172942
2013-01-20 01:19:17 +00:00
Michael Gottesman bf0fd39e54 Fixed trailing whitespace.
llvm-svn: 172939
2013-01-20 01:04:14 +00:00
Chris Lattner 91f373ee8d add back a #include needed on some builders.
llvm-svn: 172938
2013-01-20 00:57:52 +00:00
Chris Lattner 7fb3bef13e finish converting the normal cases in ASTReader to use the new BitstreamCursor APIs.
llvm-svn: 172937
2013-01-20 00:56:42 +00:00
Tobias Grosser 44d7b4f6bf [cindex.py]: Use spaces instead of tabs
The tabs slipped in accidentally.

llvm-svn: 172934
2013-01-20 00:42:16 +00:00
Chris Lattner efa77170b5 convert some more stuff over to use new cursor APIs.
llvm-svn: 172932
2013-01-20 00:00:22 +00:00
Dmitri Gribenko 5fc79a415a Actually update the test, fixup for r172923
llvm-svn: 172925
2013-01-19 22:11:28 +00:00
Dmitri Gribenko b2e5482bd1 Use llvm::hexDigitValue in comment lexer
llvm-svn: 172924
2013-01-19 22:06:05 +00:00
Dmitri Gribenko c137ec8b70 Comment parsing: add more tests for html character references
llvm-svn: 172923
2013-01-19 22:04:44 +00:00
Chris Lattner e7b154bcf8 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.

llvm-svn: 172922
2013-01-19 21:39:22 +00:00
Chris Lattner c79fcfaf8e random tidying
llvm-svn: 172920
2013-01-19 21:35:35 +00:00
Jordan Rose d8876a7450 [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.

llvm-svn: 172915
2013-01-19 19:52:57 +00:00
David Blaikie 2c705ca98d 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.

llvm-svn: 172911
2013-01-19 19:20:56 +00:00
Benjamin Kramer f23bf14ee4 libclangSerialization also depends on the bitreader.
llvm-svn: 172910
2013-01-19 19:10:12 +00:00
Chris Lattner 5b25f0b7a9 update header comment.
llvm-svn: 172909
2013-01-19 18:47:35 +00:00
Chris Lattner e8d968f31b fix the unit tests too.
llvm-svn: 172907
2013-01-19 18:30:39 +00:00
Chris Lattner 779fe3315f these now depend on the bitcode reader too.
llvm-svn: 172906
2013-01-19 18:28:24 +00:00
Chris Lattner 5b313e7b2a this depends on the bitcode reader, since it is using it.
llvm-svn: 172905
2013-01-19 18:24:13 +00:00
Tobias Grosser a8ceb7a801 [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

llvm-svn: 172901
2013-01-19 11:03:44 +00:00
Tobias Grosser 2f1328b35b [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.

llvm-svn: 172900
2013-01-19 11:03:42 +00:00
Tobias Grosser 055f4b4d00 [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.

llvm-svn: 172899
2013-01-19 11:03:40 +00:00
Chandler Carruth 4b41745e05 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.

llvm-svn: 172892
2013-01-19 08:09:44 +00:00
Chandler Carruth a2bb7f9d30 Move an input header file under an Inputs directory to be consistent
with other auxilliary test inputs and simplify the identification of
inputs to tests.

llvm-svn: 172890
2013-01-19 06:31:24 +00:00
Ted Kremenek a83b407c51 Reapply r172878 with test case.
llvm-svn: 172888
2013-01-19 04:33:14 +00:00
Richard Smith 1ac67d1530 Fix five more cases of tokens which can legally follow a type specifier.
llvm-svn: 172886
2013-01-19 03:48:05 +00:00
Argyrios Kyrtzidis 719736c581 [PCH/Modules] Revert r172843, it caused a module to fail building.
llvm-svn: 172884
2013-01-19 03:14:56 +00:00
Anna Zaks 7d9ce53124 [analyzer] Suppress warnings coming out of macros defined in sys/queue.h
Suppress the warning by just not emitting the report. The sink node
would get generated, which is fine since we did reach a bad state.

Motivation

Due to the way code is structured in some of these macros, we do not
reason correctly about it and report false positives. Specifically, the
following loop reports a use-after-free. Because of the way the code is
structured inside of the macro, the analyzer assumes that the list can
have cycles, so you end up with use-after-free in the loop, that is
safely deleting elements of the list. (The user does not have a way to
teach the analyzer about shape of data structures.)

SLIST_FOREACH_SAFE(item, &ctx->example_list, example_le, tmpitem) {
			if (item->index == 3) { // if you remove each time, no complaints
				assert((&ctx->example_list)->slh_first == item);
				SLIST_REMOVE(&ctx->example_list, item, example_s, example_le);
				free(item);
			}
		}

llvm-svn: 172883
2013-01-19 02:18:15 +00:00
NAKAMURA Takumi 3fef3ef91d Whitespace.
llvm-svn: 172881
2013-01-19 01:54:35 +00:00
NAKAMURA Takumi 97e77abf83 Revert r172878, "Reword warning about using a *static* variable within its own initialization."
It broke, at least, linux, msvc and mingw bots.

llvm-svn: 172879
2013-01-19 01:47:46 +00:00
Ted Kremenek e07d167a50 Reword warning about using a *static* variable within its own initialization.
The warning is still under -Wuninitialized (although technically this
is defined behavior), but under a subgroup -Wstatic-self-init.

This addresses PR 10265.

llvm-svn: 172878
2013-01-19 00:49:00 +00:00
Ted Kremenek 7ba78c679c -Wuninitialized: warn about uninitialized values resulting from ?: that evaluate to lvalues (in C++).
llvm-svn: 172875
2013-01-19 00:25:06 +00:00
David Blaikie 68f71a3a78 Remove windows line endings.
llvm-svn: 172865
2013-01-18 23:03:15 +00:00
Matt Beaumont-Gay 21c6c959ec Remove unused variable
llvm-svn: 172862
2013-01-18 22:34:17 +00:00
Jordan Rose 78ed86a7e5 Adopt llvm::hexDigitValue.
llvm-svn: 172861
2013-01-18 22:33:58 +00:00
Jordan Rose 668a433723 Fix mismatched #endif.
llvm-svn: 172860
2013-01-18 22:33:54 +00:00
Douglas Gregor caddba9f00 Once we've collected the template arguments for a
partially-substituted parameter pack in a template, forget about the
partially-substituted parameter pack: it is now completed. Fixes
<rdar://problem/12176336>.

llvm-svn: 172859
2013-01-18 22:27:09 +00:00
DeLesley Hutchins 9fa426a666 Thread-safety analysis: ignore edges from throw expressions in CFG.
llvm-svn: 172858
2013-01-18 22:15:45 +00:00
Richard Smith f75c8b3c8d Include ubsan runtime even when building a shared library. We don't require the executable to be linked with UBSan.
llvm-svn: 172856
2013-01-18 22:09:26 +00:00
Akira Hatanaka b2206e71e1 [mips] Enable inlining of atomic ops on mips32 and mips64.
llvm-svn: 172855
2013-01-18 21:58:11 +00:00
Bill Wendling 63ffde573e Use the AttributeSet query method instead of the Attribute method.
llvm-svn: 172849
2013-01-18 21:26:07 +00:00
Argyrios Kyrtzidis 8bee90d5f3 [PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!
Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once.
Unfortunately I couldn't get a reduced test case.

rdar://13016031

llvm-svn: 172843
2013-01-18 20:59:01 +00:00
Nico Weber 0bba2d11d0 Fix parsing of class specifiers before '\n' 'operator'.
r159549 / r159164 regressed clang to reject

  struct s {};
  struct s
  operator++(struct s a)
  { return a; }

This fixes the regression. Richard, pleas check if this looks right.

llvm-svn: 172834
2013-01-18 18:41:42 +00:00
Jordan Rose 1dc3940383 [analyzer] Special path notes for C++ special member functions.
Examples:
  Calling implicit default constructor for Foo
  Calling defaulted move constructor for Foo
  Calling copy constructor for Foo
  Calling implicit destructor for Foo
  Calling defaulted move assignment operator for Foo
  Calling copy assignment operator for Foo

llvm-svn: 172833
2013-01-18 18:27:21 +00:00