Commit Graph

331504 Commits

Author SHA1 Message Date
Simon Pilgrim b0d0928241 YAMLParser - fix SimpleKey uninitialized variable warnings. NFCI. 2019-11-09 22:11:50 +00:00
Simon Pilgrim 58236e6fa6 Reduce scope of variable to silence cppcheck warning. NFC 2019-11-09 22:10:09 +00:00
Simon Pilgrim 6976a0e826 RegisterCoalescer - remove duplicate variable to fix Wshadow warning. NFCI. 2019-11-09 20:10:12 +00:00
Simon Pilgrim f092e80939 RegisterCoalescer - fix uninitialized variables. NFCI. 2019-11-09 20:10:11 +00:00
Gil Rapaport 7f152543e4 [LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)
This recommits 11ed1c0239 (reverted in
9f08ce0d21 for failing an assert) with a fix:
tryToWidenMemory() now first checks if the widening decision is to interleave,
thus maintaining previous behavior where tryToInterleaveMemory() was called
first, giving priority to interleave decisions over widening/scalarization. This
commit adds the test case that exposed this bug as a LIT.
2019-11-09 20:52:25 +02:00
Michał Górny 0ac296322f [lldb] [test] Un-XFAIL tests that work on NetBSD 9 2019-11-09 19:40:31 +01:00
Simon Pilgrim c2fca2d9af Fix variable ‘LookedUpGetterSetter’ set but not used warning. NFCI. 2019-11-09 17:40:49 +00:00
Dávid Bolvanský e24e6ae7a0 Fixed dia file 2019-11-09 18:31:17 +01:00
Dávid Bolvanský 5deb289f49 Fixed c-index test 2019-11-09 18:26:21 +01:00
Dávid Bolvanský 5c50109bb5 Fixed more -Wreturn-type tests 2019-11-09 18:13:51 +01:00
Simon Pilgrim 612810e333 Fix uninitialized variable warnings. NFCI. 2019-11-09 17:03:21 +00:00
Simon Pilgrim 3c37981bb3 Fix shadow variable warning with llvm::SrcMgr. NFCI. 2019-11-09 17:03:21 +00:00
Simon Pilgrim 7f8488eeb4 Fix operator precedence warning. NFC. 2019-11-09 17:03:21 +00:00
Dávid Bolvanský 1da13237a4 [Diagnostics] Try to improve warning message for -Wreturn-type
Summary: I agree with https://easyaspi314.github.io/gcc-vs-clang.html?fbclid=IwAR1VA0qxiWVUusOQUv5z7JESS7ZpeJy-UqAI5mnJscofGLqXcqeErIUB2gU, current warning message is not very good. We should try to improve it..

Reviewers: rsmith, aaron.ballman, easyaspi314

Reviewed By: aaron.ballman

Subscribers: arphaman, Quuxplusone, mehdi_amini, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69762
2019-11-09 17:54:58 +01:00
Yonghong Song 9434360401 Revert "[BPF] Add preserve_access_index attribute for record definition"
This reverts commit 4a5aa1a7bf.

There are some other test failures. Investigate them first.
2019-11-09 08:32:44 -08:00
Yonghong Song 4a5aa1a7bf [BPF] Add preserve_access_index attribute for record definition
This patch introduced a new bpf specific attribute which can
be added to struct or union definition. For example,
  struct s { ... } __attribute__((preserve_access_index));
  union u { ... } __attribute__((preserve_access_index));
The goal is to simplify user codes for cases
where preserve access index happens for certain struct/union,
so user does not need to use clang __builtin_preserve_access_index
for every members.

The attribute has no effect if -g is not specified.

When the attribute is specified and -g is specified, any member
access defined by that structure or union, including array subscript
access and inner records, will be preserved through
  __builtin_preserve_{array,struct,union}_access_index()
IR intrinsics, which will enable relocation generation
in bpf backend.

The following is an example to illustrate the usage:
  -bash-4.4$ cat t.c
  #define __reloc__ __attribute__((preserve_access_index))
  struct s1 {
    int c;
  } __reloc__;

  struct s2 {
    union {
      struct s1 b[3];
    };
  } __reloc__;

  struct s3 {
    struct s2 a;
  } __reloc__;

  int test(struct s3 *arg) {
    return arg->a.b[2].c;
  }
  -bash-4.4$ clang -target bpf -g -S -O2 t.c

A relocation with access string "0:0:0:0:2:0" will be generated
representing access offset of arg->a.b[2].c.

forward declaration with attribute is also handled properly such
that the attribute is copied and populated in real record definition.

Differential Revision: https://reviews.llvm.org/D69759
2019-11-09 08:17:12 -08:00
Mark de Wever 27c4eaac8c [libc++] Validate the entire regex is consumed
This change would have warned about the bug found in D62451.
No unit tests since the exception should never throw.

Differential Revision: https://reviews.llvm.org/D62452
2019-11-09 17:01:37 +01:00
Mark de Wever b9be5ce8f3 [Parser] Warn when ScopeDepthOrObjCQuals overflows
Before when the overflow occured an assertion was triggered. Now check
whether the maximum has been reached and warn properly.

This patch fixes the original submission of PR19607.

Differential Revision: https://reviews.llvm.org/D63975
2019-11-09 15:33:01 +01:00
Richard Smith 56b5eab129 [NFC] Supress GCC "Bitfield too small to hold all values of enum" warning.
Patch by Wang Tianqing!

Differential Revision: https://reviews.llvm.org/D69792
2019-11-09 05:56:51 -08:00
Simon Pilgrim 2fb9d72c77 Fix builds where LLVM_ENABLE_STATS is disabled
Missed Stats->EnableStats rename in rG3fb832fe8bdc317687d5a4d2ca20f5f73b089341
2019-11-09 13:47:53 +00:00
Simon Pilgrim aedb528d43 llvm-exegesis - fix shadow variable warnings. NFCI. 2019-11-09 13:43:09 +00:00
Simon Pilgrim 56a725ae5e Remarks - fix static analyzer warnings. NFCI.
- Fix uninitialized variable warnings.
 - Reuse BitstreamEntry iterator to avoid Wshadow warning.
 - Match declaration + definition arg names in BitstreamRemarkParser::processCommonMeta
 - Make BitstreamRemarkParser(StringRef) constructor explicit
2019-11-09 13:01:05 +00:00
Simon Pilgrim dda8015434 Remove duplicate MemVT to fix shadow variable warning. NFCI. 2019-11-09 13:01:04 +00:00
Simon Pilgrim 3fb832fe8b Statistic - Fix shadow variable warning. NFCI.
Rename option 'Stats' to 'EnableStats' and prevent clash with StatisticInfo::Stats member
2019-11-09 13:01:04 +00:00
Simon Pilgrim a35a44fd4b Remove superfluous break after return. NFC. 2019-11-09 13:01:03 +00:00
Simon Pilgrim 59a14f9d4b Fix shadow variable warning by reducing scope of CC/InverseCC CondCodes. NFCI. 2019-11-09 13:01:03 +00:00
Simon Pilgrim 0d5ad57ae3 Remarks - fix shadow variable warnings. NFCI.
Avoid conflict with llvm::remarks::Magic global variable.
2019-11-09 13:01:03 +00:00
Richard Smith 092577e317 [cxx_status] Update with Belfast motions. 2019-11-09 03:13:21 -08:00
Jay Foad d162e02cee Refactor SimplifySelectsFeedingBinaryOp for D64713. NFC. 2019-11-09 09:28:22 +00:00
Dávid Bolvanský 312c6f699d [Diagnostics] Fixed crash with non pointer type (PR43950) 2019-11-09 09:02:40 +01:00
Artem Dergachev e4da37e8a0 [analyzer] Fix skipping the call during inlined defensive check suppression.
When bugreporter::trackExpressionValue() is invoked on a DeclRefExpr,
it tries to do most of its computations over the node in which
this DeclRefExpr is computed, rather than on the error node (or whatever node
is stuffed into it). One reason why we can't simply use the error node is
that the binding to that variable might have already disappeared from the state
by the time the bug is found.

In case of the inlined defensive checks visitor, the DeclRefExpr node
is in fact sometimes too *early*: the call in which the inlined defensive check
has happened might have not been entered yet.

Change the visitor to be fine with tracking dead symbols (which it is totally
capable of - the collapse point for the symbol is still well-defined), and fire
it up directly on the error node. Keep using "LVState" to find out which value
should we be tracking, so that there weren't any problems with accidentally
loading an ill-formed value from a dead variable.

Differential Revision: https://reviews.llvm.org/D67932
2019-11-08 18:27:14 -08:00
Artem Dergachev 57adc37fe5 [analyzer] Nullability: Don't infer nullable when passing as nullable parameter.
You can't really infer anything from that.
2019-11-08 18:27:14 -08:00
Jason Molenda 60ab30ebce Temporarily change the default for use-g-packet-for-reading to false,
until we can automatically fall back to p/P if g/G are not supported;
it looks like there is a bug in debugserver's g/G packets taht needs
to be fixed, or debugserver should stop supporting g/G until that bug
is fixed.  But we need lldb to be able to fall back to p/P correctly
for that to be a viable workaround.
2019-11-08 18:21:57 -08:00
Jonas Devlieghere 441a78533e Revert "Add a testcase for .dSYM path remapping dictionaries."
This reverts commit 2bbc4fdd8f.
2019-11-08 18:16:44 -08:00
Puyan Lotfi 1257146eb4 [clang][IFS][test] Fixing buildbot test fails for clang-ifs.
Checking for the exact triple fails on many bots. Leaving the triple
check blank.
2019-11-08 21:06:23 -05:00
Puyan Lotfi 79e345fbcc [clang][IFS] Adds support for more decl types in clang interface stubs.
Adding support for processing the following Decls: NonTypeTemplateParmDecl,
CXXConversionDecl, UnresolvedUsingValueDecl, UsingDecl, UsingShadowDecl,
TypeAliasTemplateDecl, TypeAliasDecl, VarTemplateDecl,
VarTemplateSpecializationDecl, UsingDirectiveDecl, TemplateTemplateParmDecl,
ClassTemplatePartialSpecializationDecl, IndirectFieldDecl.

Also, this allows for processing NamedDecls that don't have an identifier and
skips over VarDecls that are dependent on template types.

Differential Revision: https://reviews.llvm.org/D69995
2019-11-08 20:27:25 -05:00
Teresa Johnson b11391bb47 ThinLTO : Import always_inline functions irrespective of the threshold
Summary: A user can force a function to be inlined by specifying the always_inline attribute. Currently, thinlto implementation is not aware of always_inline functions and does not guarantee import of such functions, which in turn can prevent inlining of such functions.

Patch by Bharathi Seshadri <bseshadr@cisco.com>

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70014
2019-11-08 17:02:01 -08:00
Jason Molenda 1478f36f27 Test case to verify that lldb falls back to p/P if g is unsupported
and that lldb uses the expedited register values in the ? packet
aka stop packet (T11 etc) and does not re-fetch them with the p packet.

This test is currently failing from the "[lldb-server] Add setting to
force 'g' packet use" commit; I'm marking it as @expectedFailureAll
until we can get this fixed.
2019-11-08 15:57:54 -08:00
David Blaikie db797bfb2b DebugInfo: Remove redundant conditionals/checks from macro info emission
These checks fall out naturally from the current implementation without
needing to be explicitly considered anymore.
2019-11-08 15:31:15 -08:00
David Blaikie 736273c7fe DebugInfo: Do not create a debug_macinfo section if no CUs have associated macros
Patch based on Sourabh Singh's D69839 patch.
2019-11-08 15:30:11 -08:00
Sam Clegg 6278fba9b1 llvm-ranlib/nm: Don't print usage message except for usage errors
Also, fix a bug in ranlib where it didn't correctly detect being run
without any argument and would try to operate on the empty string.

Differential Revision: https://reviews.llvm.org/D70021
2019-11-08 15:17:07 -08:00
David Blaikie 3951245c38 NVPTX: Don't insert an extra empty line at the end of the last section.
This was arbitrarily appearing in only the last section emitted - which
made tests more sensitive than they needed to be (removing the last
section - like the macinfo section change that's coming after this)
would, surprisingly, move the blank line to the previous section.
2019-11-08 15:16:04 -08:00
Adrian Prantl 901cc4a4bc Debug Info: Nest Objective-C property function decls inside their container.
This has the nice side-effect of also fixing a crash in Clang.

Starting with DWARF 5 we are emitting ObjC method declarations as
children of their containing entity. This worked for interfaces, but
didn't consider the case of synthessized properties. When a property
of a protocol is synthesized in an interface implementation the
ObjCMethodDecl that was passed to CGF::StartFunction was the property
*declaration* which obviously couldn't have a containing
interface. This patch passes the containing interface all the way
through to CGDebugInfo, so the function declaration can be created
with the correct parent (= the class implementing the protocol).

rdar://problem/53782400

Differential Revision: https://reviews.llvm.org/D66121
2019-11-08 15:14:00 -08:00
Alex Lorenz e1b07aac3d [clangd] NFC, reuse the source manager variable in the RawStringLiteral apply method
Differential Revision: https://reviews.llvm.org/D69544
2019-11-08 14:50:54 -08:00
Fangrui Song 8f089f2099 [MC] Emit unused undefined symbol even if its binding is not set
Recommit r373168, which was reverted by r373242. This actually exposed a
boringssl bug which has been fixed for more than one month.

For the following two cases, we currently suppress the symbols. This
patch emits them (compatible with GNU as).

* `test2_a = undef`: if `undef` is otherwise unused.
* `.hidden hidden`: if `hidden` is unused. This is the main point of the
  patch, because omitting the symbol would cause a linker semantic
  difference.

It causes a behavior change that is not compatible with GNU as:

.weakref foo1, bar1

When neither foo1 nor bar1 is used, we now emit bar1, which is arguably
more consistent.

Another change is that we will emit .TOC. for .TOC.@tocbase .  For this
directive, suppressing .TOC. can be seen as a size optimization, but we
choose to drop it for simplicity and consistency.
2019-11-08 14:47:48 -08:00
Stephan T. Lavavej 3a7a22445e [www] More HTTPS and outdated link fixes.
Resolves D69981.
2019-11-08 14:41:27 -08:00
Sylvestre Ledru 3a3255a223 clang-format: refresh the list of options 2019-11-08 23:40:16 +01:00
Jan Korous 99e2cba219 Reland "[compiler-rt] Fix tests after 03b84e4f6d0"
This reverts commit d6be9273c6.
2019-11-08 14:28:32 -08:00
Jan Korous d52cff8836 Revert "Reland "[clang] Report sanitizer blacklist as a dependency in cc1""
This reverts commit cae4a28864.
2019-11-08 14:28:30 -08:00
Sylvestre Ledru 4c44fd3de3 clang-format: Add to the release notes the new --dry-run/-n option 2019-11-08 23:26:44 +01:00