Commit Graph

50260 Commits

Author SHA1 Message Date
Aaron Ballman 83f197b613 Since Visual Studio 2012 is the minimum version of MSVC we support, the old-style visualizers are being removed. Adding a Natvis replacement for the debugging visualizers.
llvm-svn: 200032
2014-01-24 19:46:45 +00:00
Yunzhong Gao 063763ea42 Fixing PR18510 by checking whether the non-virtual base of the derived class
might have a smaller size as compared to the stand-alone type of the base class.
This is possible when the derived class is packed and hence might have smaller
alignment requirement than the base class.

Differential Revision: http://llvm-reviews.chandlerc.com/D2599

llvm-svn: 200031
2014-01-24 19:28:24 +00:00
Amara Emerson 05d816d0e2 [AArch64] Replace underscores with dashes in -mgeneral_regs_only.
This should now match the equivalent gcc option.

llvm-svn: 200008
2014-01-24 15:15:27 +00:00
Aaron Ballman cc396f85d9 Adding a new diagnostics group (-Wattributes) which covers both UnknownAttributes and IgnoredAttributes.
llvm-svn: 200004
2014-01-24 14:16:23 +00:00
NAKAMURA Takumi 518490b949 [CMake] libclang: Update GENERATED_HEADERS with actually used.
+  ClangAttrVisitor
+  ClangCommentCommandList

llvm-svn: 199999
2014-01-24 13:40:37 +00:00
Ismail Pazarbasi df1a280526 Added missing StandardConversionSequence initialization
This is the second msan failure where UserDefinedConversion does not initialize
its `Before` member as identity conversion.

llvm-svn: 199997
2014-01-24 13:16:17 +00:00
Eric Christopher 439137ea32 Add missing intrinsics, fix a couple of typos in intrinsic names,
and remove duplicate declarations.

llvm-svn: 199992
2014-01-24 12:13:47 +00:00
Artyom Skrobov 9f2134402c Combine the checks for returns_nonnull and for operator new returning null, in Sema::CheckReturnValExpr. Add the missing handling of value-dependent expressions for returns_nonnull.
llvm-svn: 199989
2014-01-24 11:10:39 +00:00
Ismail Pazarbasi 99afd96703 Initialize StandardConversionSequence correctly
MSAN detected a path that leaves DeprecatedStringLiteralToCharPtr uninitialized.
UserDefinedConversionSequence::First is a StandardConversionSequence that must
be initialized with setAsIdentityConversion.

llvm-svn: 199988
2014-01-24 10:54:12 +00:00
Manuel Klimek 421147ec65 Get rid of special parsing for return statements.
This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not necessary any more.

llvm-svn: 199982
2014-01-24 09:25:23 +00:00
Richard Smith 0e50a883ff Update page on clang diagnostics to contrast to GCC 4.9 instead of 4.2. A lot
of the differences we identified here have been fixed by improvements in GCC.

llvm-svn: 199970
2014-01-24 03:13:34 +00:00
Richard Smith 81830b204b Remove outdated documentation suggesting we don't support the C++1y lambda extensions.
llvm-svn: 199964
2014-01-24 02:12:28 +00:00
Richard Smith 7ff2bcb814 PR18560: When switching to a new context, don't just save and restore an
override for the type of 'this', also clear it out (unless we're entering the
context of a lambda-expression, where it should be inherited).

llvm-svn: 199962
2014-01-24 01:54:52 +00:00
Hans Wennborg 74ca0c4105 Add implementations of __readfs{byte,word,dword,qword} to Intrin.h
Differential Revision: http://llvm-reviews.chandlerc.com/D2606

llvm-svn: 199958
2014-01-24 00:52:39 +00:00
Richard Smith 72553fc19b Factor out repeated parsing of a member-declarator when parsing a
member-declaration. In the process, fix a couple of bugs that had crept in
where we would parse the first and subsequent member-declarators differently
(in particular, we didn't accept an asm-label on a member function definition
within a class, and we would accept virt-specifiers and attributes in the wrong
order on the first declarator but not on subsequent ones).

llvm-svn: 199957
2014-01-23 23:53:27 +00:00
Peter Collingbourne 50b75dbf1a Fix debug build.
llvm-svn: 199956
2014-01-23 23:15:58 +00:00
Peter Collingbourne d32e28c87a Introduce Registry::getCompletions.
This returns a list of valid (and useful) completions for a context (a list
of outer matchers), ordered by decreasing relevance then alphabetically. It
will be used by the matcher parser to implement completion.

Differential Revision: http://llvm-reviews.chandlerc.com/D2210

llvm-svn: 199950
2014-01-23 22:48:38 +00:00
DeLesley Hutchins 8a7117d4c8 Thread safety analysis: handle duplicate assert_lock attributes.
llvm-svn: 199949
2014-01-23 22:35:26 +00:00
Hans Wennborg 2ed8880346 Intrin.h: fix definitions of _Interlocked{In,De}crement16
The declarations seem correct, but the definitions were using
chars instead of shorts.

llvm-svn: 199923
2014-01-23 19:15:39 +00:00
Justin Bogner d8740b6e72 test/CodeGen: Finish fixing the typo in r199862
llvm-svn: 199910
2014-01-23 17:34:24 +00:00
Pekka Jaaskelainen 17b91897e9 Allow clang to compile the "extern" storage class in OpenCL 1.2.
The tests (forgot to svn add, sorry!).

Patch from Fraser Cormack!

llvm-svn: 199907
2014-01-23 16:36:09 +00:00
Pekka Jaaskelainen b3cdee01e9 Allow clang to compile the "extern" storage class in OpenCL 1.2.
Patch from Fraser Cormack!

llvm-svn: 199906
2014-01-23 16:21:02 +00:00
Amara Emerson 04e2ecfda2 [AArch64] Add -mgeneral_regs_only option.
llvm-svn: 199904
2014-01-23 15:48:30 +00:00
NAKAMURA Takumi 742b90c3ed [CMake] Move LIBCLANG_BUILD_STATIC above. NFC.
llvm-svn: 199903
2014-01-23 15:33:50 +00:00
NAKAMURA Takumi ac3ff26885 [CMake] Parameterize MODULE and SHARED in add_clang_library().
llvm-svn: 199902
2014-01-23 15:33:44 +00:00
NAKAMURA Takumi 5383113296 [CMake] Migrate LLVMParseArguments to CMakeParseArguments.
llvm-svn: 199901
2014-01-23 15:33:35 +00:00
Serge Pavlov 09f9924acf Fix to PR8880 (clang dies processing a for loop)
Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside
its body, for example:

    for ( ; ({ if (first) { first = 0; continue; } 0; }); )

This code is rejected by GCC if compiled in C mode but is accepted in C++
code. GCC bug 44715 tracks this discrepancy. Clang used code generation
that differs from GCC in both modes: only statement of the third
expression of 'for' behaves as if it was inside loop body.

This change makes code generation more close to GCC, considering 'break'
or 'continue' statement in condition and increment expressions of a
loop as it was inside the loop body. It also adds error for the cases
when 'break'/'continue' appear outside loop due to this syntax. If
code generation differ from GCC, warning is issued.

Differential Revision: http://llvm-reviews.chandlerc.com/D2518

llvm-svn: 199897
2014-01-23 15:05:00 +00:00
Tim Northover 5a68c4b287 MachO embedded: default to soft float without issuing warning
This is a simpler rule, broadly in line with previous Darwin (which chose
between "soft" and "softfp") but probably safer. In practice the only real
reason for "softfp" is ABI compatibility, not usually an issue on limited chips
like these, so anyone who wanted hard-float should already be saying so.

That's my story and I'm sticking to it.

rdar://problem/15887493

llvm-svn: 199896
2014-01-23 15:00:01 +00:00
David Woodhouse ddf8985325 Add documentation for -m16 option on X86, fix typo
llvm-svn: 199894
2014-01-23 14:32:46 +00:00
Anton Yartsev 0cb7c8abc1 [analyzer] Strip trailing whitespace characters from input.
More universal way of removing trailing whitespace characters then 'chomp' does. Chomp "removes any trailing string that corresponds to the current value of $/" (quote from perldoc). In my case an input ended with '\r\r\n', chomp left '\r' at the end of input and the script ended up with an error "Use of uninitialized value in concatenation (.) or string"

llvm-svn: 199892
2014-01-23 14:12:48 +00:00
Alexey Bataev cf7ae30135 Improve x86 android support, add x86_64 android target
llvm-svn: 199875
2014-01-23 09:08:32 +00:00
Justin Bogner 49e453fe24 test/CodeGenCXX: Be less strict about return types
Some ABIs have different return types for constructors and
destructors, and we're just looking for the end of the function
here. Loosen up the regex.

llvm-svn: 199870
2014-01-23 04:41:06 +00:00
Jordan Rose ddf1966cc3 [analyzer] Tighten up sanity checks on Objective-C property getter synthesis.
If there are non-trivially-copyable types /other/ than C++ records, we
won't have a synthesized copy expression, but we can't just use a simple
load/return.

Also, add comments and shore up tests, making sure to test in both ARC
and non-ARC.

llvm-svn: 199869
2014-01-23 03:59:10 +00:00
Jordan Rose 6adadb9bc2 [analyzer] Future-proof MallocChecker CFG dumping.
Now we'll get a warning if we miss a case. Refinement of r199800.

llvm-svn: 199868
2014-01-23 03:59:01 +00:00
Richard Trieu 7d2cfd71a2 Change an absolute value function in a test from floating to integer to
match argument type.

llvm-svn: 199867
2014-01-23 03:51:55 +00:00
Kevin Qin ce1f0e85ba [AArch64 NEON] Fix a bug about vcles_f32 and vcled_f64.
As vcles_f32() and vcled_f64 are implemented by FCMGE, operands
should make a swap.

llvm-svn: 199866
2014-01-23 03:42:06 +00:00
Justin Bogner be614c735c CodeGen: Fix tracking of PGO counters for the logical or operator
This adds tests for both logical or and for logical and, which was
already correct.

llvm-svn: 199865
2014-01-23 02:54:30 +00:00
Justin Bogner 81c22c2fae CodeGen: Handle PGO counters for constructors and destructors
llvm-svn: 199864
2014-01-23 02:54:27 +00:00
Justin Bogner 0960d091a9 test/CodeGenCXX: Give instr-profile exception tests their own file
This test requires asserts for now, and exception handling has an
awkward structure that leads to extra run lines. Because of this, the
test file's not a great place for other C++ PGO tests, but
instr-profile.cpp is obviously the better name for them.

llvm-svn: 199863
2014-01-23 02:54:23 +00:00
Justin Bogner fdac0cad1f test/CodeGen: Fix a typo
llvm-svn: 199862
2014-01-23 02:54:20 +00:00
Ben Langmuir 9eb229bfe5 Require a module.map file to load a module
Removes some old code that allowed a module to be loaded from a pcm file
even if the module.map could not be found.  Also update a number of
tests that relied on the old behavior.

llvm-svn: 199852
2014-01-22 23:19:39 +00:00
Richard Smith 8c7bd6ac1a Don't forget about a builtin if we're about to redeclare it and we couldn't
create an implicit declaration of it (because some type it depends on is
unavailable). This had the effect of causing us to not implicitly give it the
right attributes. It turns out that glibc's __sigsetjmp is declared before
sigjmp_buf is declared, and this resulted in us not implicitly giving it
__attribute__((returns_twice)), which in turn resulted in miscompiles in any C
code calling glibc's sigsetjmp.

(See also the vaguely-related sourceware.org/PR4662.)

llvm-svn: 199850
2014-01-22 23:07:19 +00:00
Aaron Ballman bc909618f2 If an attribute has a semantically meaningful spelling (such as ArgumentWithTypeTagAttr or MSInheritanceAttr), display the spelling used for the attribute as part of the AST dump. This should ease debugging the AST for these attributes. Attributes without semantically meaningful spelling variations are not affected.
llvm-svn: 199834
2014-01-22 21:51:20 +00:00
Mark Seaborn 74020868ee Handle va_arg on struct types for the le32 target (PNaCl and Emscripten)
PNaCl and Emscripten can both handle va_arg IR instructions with
struct type.

Also add a test to cover generating a va_arg IR instruction from
va_arg in C on le32 (as already handled by VisitVAArgExpr() in
CGExprScalar.cpp), which was not covered by a test before.

(This fixes https://code.google.com/p/nativeclient/issues/detail?id=2381)

Differential Revision: http://llvm-reviews.chandlerc.com/D2539

llvm-svn: 199830
2014-01-22 20:11:01 +00:00
Richard Smith 566184ac75 When a special member is explicitly defaulted outside its class, and we reject
the defaulting because it would delete the member, produce additional notes
explaining why the member is implicitly deleted.

llvm-svn: 199829
2014-01-22 20:09:10 +00:00
Hans Wennborg 80429048db clang-cl: Expose the -ferror-limit= option
llvm-svn: 199828
2014-01-22 20:06:53 +00:00
David Blaikie ec59e75ef2 Driver: Suppression support for -Wa,--compress-debug-sections
(to go with existing suppression of -Wa,-compress-debug-sections)

llvm-svn: 199822
2014-01-22 19:22:21 +00:00
Fariborz Jahanian dad9630398 ObjectiveC. When issuing property implementation is
not using backing ivar warning, ignore when
property is not being synthesized (user declared its
implementation @dynamic). // rdar://1583425

llvm-svn: 199820
2014-01-22 19:02:20 +00:00
Weiming Zhao fb5c21a70b PR18465: [Thumbv8] add predefined macros
currently, for thumbv8, two predefined macros are missing:
 define __THUMB_INTERWORK__ 1
 define __THUMB_INTERWORK__ 1

This patch adds them for thumbv8.

llvm-svn: 199819
2014-01-22 18:42:13 +00:00
Daniel Jasper 6b70ec0d46 clang-format: Fix incorrect lambda recognition.
Before:
  std::unique_ptr<int[]> foo() {}

After:
  std::unique_ptr<int []> foo() {}

Also, the formatting could go severely wrong after such a function
before.

llvm-svn: 199817
2014-01-22 17:01:47 +00:00