Commit graph

311537 commits

Author SHA1 Message Date
Jonas Devlieghere 0ccc0b1a5f [Reproducers] Disable registering lldb::thread_t everywhere
As discussed on the mailing list, default serialization for thread ids
is not correct, even if they're represented as basic types. I'm
purposely leaving the corresponding record macros in place so that we
don't break the API boundary detection.

llvm-svn: 355610
2019-03-07 17:27:33 +00:00
Anastasia Stulova 6f7c536e08 [Sema] Change addr space diagnostics in casts to follow C++ style.
This change adds a new diagnostic for mismatching address spaces
to be used for C++ casts (only enabled in C style cast for now,
the rest will follow!).

The change extends C-style cast rules to account for address spaces.
It also adds a separate function for address space cast checking that
can be used to map from a separate address space cast operator
addrspace_cast (to be added as a follow up patch).

Note, that after this change clang will no longer allows arbitrary
address space conversions in reinterpret_casts because they can lead
to accidental errors. The implicit safe conversions would still be
allowed.

Differential Revision: https://reviews.llvm.org/D58346

llvm-svn: 355609
2019-03-07 17:06:30 +00:00
Anastasia Stulova 27e5c212ee [PR40778][Sema] Adjust addr space of operands in builtin operators.
Adjust address space for references and pointer operands of builtin operators.

Currently this change only fixes addr space in assignment (= and |=) operator,
that is needed for the test case reported in the bug. Wider support for all
other operations will follow.

Differential Revision: https://reviews.llvm.org/D58719

llvm-svn: 355608
2019-03-07 16:43:41 +00:00
Petar Jovanovic 95817d3641 [DebugInfo] Fix the type of the formated variable
Change the format type of *Personality and *LSDAAddress to PRIx64 since
they are of type uint64_t.
The problem was detected on mips builds, where it was printing junk values
and causing test failure.

Patch by Milos Stojanovic.

Differential Revision: https://reviews.llvm.org/D58451

llvm-svn: 355607
2019-03-07 16:31:08 +00:00
Anastasia Stulova 9404955416 [PR40778] Preserve addr space in Derived to Base cast.
The address space for the Base class pointer when up-casting
from Derived should be taken from the Derived class pointer.

Differential Revision: https://reviews.llvm.org/D53818

llvm-svn: 355606
2019-03-07 16:23:15 +00:00
Petar Jovanovic eb39991c8b [analyzer] handle modification of vars inside an expr with comma operator
We should track mutation of a variable within a comma operator expression.
Current code in ExprMutationAnalyzer does not handle it.

This will handle cases like:

(a, b) ++ < == b is modified
(a, b) = c < == b is modifed


Patch by Djordje Todorovic.

Differential Revision: https://reviews.llvm.org/D58894

llvm-svn: 355605
2019-03-07 15:50:52 +00:00
Nico Weber a92711404c gn build: Port r342002
I had hoped we could remove the dependency on shell32.lib from lib/Support
(there isn't much depending on it), but looks like this will take a while. So
for now, port this over.

Differential Revision: https://reviews.llvm.org/D58925

llvm-svn: 355604
2019-03-07 15:44:59 +00:00
Nico Weber 5a0006d770 gn build: Merge r355522
llvm-svn: 355603
2019-03-07 15:43:14 +00:00
Alexandre Ganea a5ecceed1f [LLD][COFF] Restrict the failifmismatch test to x86_64-windows-msvc because the ELF container doesn't support llvm.linker.options meta-data with only one operand.
llvm-svn: 355602
2019-03-07 15:07:55 +00:00
Aaron Ballman 7eb66ba14a expected-no-diagnostics@ does not make sense, switching to a more idiomatic form; NFC.
llvm-svn: 355601
2019-03-07 15:03:06 +00:00
Xing GUO eee6226c21 [llvm-readobj] Dump DT_USED value as string like GNU readelf does
Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59089

llvm-svn: 355600
2019-03-07 14:53:10 +00:00
Haojian Wu ea18b36a6d [clangd] Strip plugin arguments in clangd-indexer.
Summary: This would allow clangd-indexer runs on chromium repo.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59022

llvm-svn: 355599
2019-03-07 14:47:17 +00:00
Balazs Keri e2ddb2ad1d [ASTImporter] Changed use of Import to Import_New in ASTImporter.
Reviewers: a.sidorin, shafik, a_sidorin, martong

Reviewed By: a_sidorin

Subscribers: rnkovacs, jdoerfert, davide, aprantl, llvm-commits, gamesh411, a_sidorin, dkrupp, martong, Szelethus, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D53818

llvm-svn: 355598
2019-03-07 14:09:18 +00:00
David Green ffc922ec35 [LSR] Attempt to increase the accuracy of LSR's setup cost
In some loops, we end up generating loop induction variables that look like:
  {(-1 * (zext i16 (%i0 * %i1) to i32))<nsw>,+,1}
As opposed to the simpler:
  {(zext i16 (%i0 * %i1) to i32),+,-1}
i.e we count up from -limit to 0, not the simpler counting down from limit to
0. This is because the scores, as LSR calculates them, are the same and the
second is filtered in place of the first. We end up with a redundant SUB from 0
in the code.

This patch tries to make the calculation of the setup cost a little more
thoroughly, recursing into the scev members to better approximate the setup
required. The cost function for comparing LSR costs is:

return std::tie(C1.NumRegs, C1.AddRecCost, C1.NumIVMuls, C1.NumBaseAdds,
                C1.ScaleCost, C1.ImmCost, C1.SetupCost) <
       std::tie(C2.NumRegs, C2.AddRecCost, C2.NumIVMuls, C2.NumBaseAdds,
                C2.ScaleCost, C2.ImmCost, C2.SetupCost);
So this will only alter results if none of the other variables turn out to be
different.

Differential Revision: https://reviews.llvm.org/D58770

llvm-svn: 355597
2019-03-07 13:44:40 +00:00
Gabor Marton 5caba3069e [ASTImporter] Import member expr with explicit template args
Summary:
Member expressions with explicit template arguments were not imported
correctly: the DeclRefExpr was missing. This patch fixes.

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58830

llvm-svn: 355596
2019-03-07 13:38:20 +00:00
Alexandre Ganea e7ec39c123 [LLD][COFF] Attempt fix for failifmismatch test on aarch64-only builder.
Shall fix: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/6150

llvm-svn: 355595
2019-03-07 13:32:29 +00:00
Petar Avramovic 3d3120dc9a [MIPS GlobalISel] Fix mul operands
Unsigned mul high for MIPS32 is selected into two PseudoInstructions:
PseudoMULTu and PseudoMFHI that use accumulator register class ACC64 for
some of its operands. Registers in this class have appropriate hi and lo
register as subregisters: $lo0 and $hi0 are subregisters of $ac0 etc.
mul instruction implicit-defs $lo0 and $hi0 according to MipsInstrInfo.td.
In functions where mul and PseudoMULTu are present fastRegisterAllocator
will "run out of registers during register allocation" because
'calcSpillCost' for $ac0 will return spillImpossible because subregisters
$lo0 and $hi0 of $ac0 are reserved by mul instruction above. A solution is
to mark implicit-defs of $lo0 and $hi0 as dead in mul instruction.

Differential Revision: https://reviews.llvm.org/D58715

llvm-svn: 355594
2019-03-07 13:28:29 +00:00
Gabor Marton 16d98c206b [ASTImporter] Handle redecl chain of FunctionTemplateDecls
Summary:
Redecl chains of function templates are not handled well currently. We
want to handle them similarly to functions, i.e. try to keep the
structure of the original AST as much as possible. The aim is to not
squash a prototype with a definition, rather we create both and put them
in a redecl chain.

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58494

llvm-svn: 355593
2019-03-07 13:01:51 +00:00
David Stenberg 27ed855a6e [analyzer] Handle comparison between non-default AS symbol and constant
Summary:
When comparing a symbolic region and a constant, the constant would be
widened or truncated to the width of a void pointer, meaning that the
constant could be incorrectly truncated when handling symbols for
non-default address spaces. In the attached test case this resulted in a
false positive since the constant was truncated to zero. To fix this,
widen/truncate the constant to the width of the symbol expression's
type.

This commit does not consider non-symbolic regions as I'm not sure how
to generalize getting the type there.

This fixes PR40814.

Reviewers: NoQ, zaks.anna, george.karpenkov

Reviewed By: NoQ

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, jdoerfert, Charusso, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58665

llvm-svn: 355592
2019-03-07 13:01:17 +00:00
George Rimar a5a0a0f049 [yaml2obj] - Allow producing ELFDATANONE ELFs
I need this to remove a binary from LLD test suite.
The patch also simplifies the code a bit.

Differential revision: https://reviews.llvm.org/D59082

llvm-svn: 355591
2019-03-07 12:09:19 +00:00
Michael Platings cfd3255251 Fix & re-enable test that intermittently failed in debug mode.
The Value class and derivates will have uninitialized member variables if not created via operator new.

llvm-svn: 355590
2019-03-07 11:55:26 +00:00
Fangrui Song 9ade843ccb [IDF] Delete a redundant J-edge test
In the DJ-graph based computation of iterated dominance frontiers,
SuccNode->getIDom() == Node is one of the tests to check if (Node,Succ)
is a J-edge. If it is true, since Node is dominated by Root,

  SuccLevel = level(Node)+1 > RootLevel

which means the next test SuccLevel > RootLevel will also be true. test
the check is redundant and can be deleted as it also involves one
indirection and provides no speed-up.

llvm-svn: 355589
2019-03-07 11:42:59 +00:00
Michael Platings ffab84c7df Temporarily disable newly added test that fails in debug mode.
llvm-svn: 355588
2019-03-07 10:27:10 +00:00
Kristof Beyls 730ecf8fd5 Add newline to interpreter debugging output
When running lli --debug --force-interpreter=true the executed instructions are
printed but are missing newlines. This commit adds the missing newlines.

Patch by Andrew Brown.

Differential Revision: https://reviews.llvm.org/D57806

llvm-svn: 355587
2019-03-07 10:14:38 +00:00
Ivan Donchevskii 878271b294 [libclang] Fix CXTranslationUnit_KeepGoing
Since
  commit 56f548bbbb7e4387a69708f70724d00e9e076153
  [modules] Round-trip -Werror flag through explicit module build.
the behavior of CXTranslationUnit_KeepGoing changed:
Unresolved #includes are fatal errors again. As a consequence, some
templates are not instantiated and lead to confusing errors.

Revert to the old behavior: With CXTranslationUnit_KeepGoing fatal
errors are mapped to errors.

Patch by Nikolai Kosjar.

Differential Revision: https://reviews.llvm.org/D58501

llvm-svn: 355586
2019-03-07 10:13:50 +00:00
Michael Platings fd4156ed4d [IR][ARM] Add function pointer alignment to datalayout
Use this feature to fix a bug on ARM where 4 byte alignment is
incorrectly assumed.

Differential Revision: https://reviews.llvm.org/D57335

llvm-svn: 355585
2019-03-07 09:15:23 +00:00
Fangrui Song b0f764c737 [BDCE] Optimize find+insert with early insert
llvm-svn: 355583
2019-03-07 06:38:03 +00:00
Craig Topper 3acc4236b8 [X86] Enable combineFMinNumFMaxNum for 512 bit vectors when AVX512 is enabled.
Simplified by just checking if the vector type is legal rather than listing all combinations of types and features.

Fixes PR40984.

llvm-svn: 355582
2019-03-07 06:30:19 +00:00
Craig Topper a0dd6e9a08 [X86] Add 512-bit fminnum/maxnum test cases for PR40984. Also add v8f32 minnum/maxnum tests. NFC
llvm-svn: 355581
2019-03-07 05:56:52 +00:00
Sam Clegg 9361217ea2 [WebAssembly] Fix build after rL355577
Turns own that IsUsedInRegularObject is set for lazy (archive) symbols.

Differential Revision: https://reviews.llvm.org/D59074

llvm-svn: 355580
2019-03-07 04:20:04 +00:00
Jan Kratochvil 67fb9b4a31 Skip TestGdbserverPort.test on Windows
lldb/cmake/modules/LLDBConfig.cmake does not build lldb-server on Windows:
if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
    set(LLDB_CAN_USE_LLDB_SERVER 1)

Also do not append 'platform' parameter twice - although that was quietly
ignored.

llvm-svn: 355579
2019-03-07 03:41:00 +00:00
Jason Molenda a583486065 When disassembling Aarch64 target and vendor Apple, set the cpu to
"apple-latest" which llvm uses to indicate the newest supported ISA.
Add a unit test; I'm only testing an armv8.1 instruction in this
unit test which would already be disassembled correctly because we
set the disassembler to ARM v8.2 mode, but it ensures that nothing
has been broken by adding this cpu spec.

<rdar://problem/38714781> 

llvm-svn: 355578
2019-03-07 03:16:45 +00:00
Sam Clegg 815a05ca6b [WebAssembly] LTO: Don't include bitcode-only symbols in the symtab
Fixes https://bugs.llvm.org/show_bug.cgi?id=40654

Differential Revision: https://reviews.llvm.org/D59012

llvm-svn: 355577
2019-03-07 02:43:19 +00:00
Florian Hahn 22ac7bf49e [InterleavedAccessAnalysis] Use fixed size integers for InterleaveGroup.
Reviewers: Ayal, hsaito, anna, efriedma, dorit

Reviewed By: efriedma

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58889

llvm-svn: 355576
2019-03-07 02:19:11 +00:00
Alex Langford 03df653f71 Repair the build when LLDB_DISABLE_PYTHON is set
Summary:
If LLDB_DISABLE_PYTHON is set, some functions are unavailable but
SBReproducer assumes they are. Let's conditionally register those functions
since they are conditionally declared.

Differential Revision: https://reviews.llvm.org/D59056

llvm-svn: 355575
2019-03-07 01:02:55 +00:00
Aakanksha Patil c56d2afc63 AMDGPU: Handle "uniform-work-group-size" attribute (fix for RADV)
A previous patch for "uniform-work-group-size" attribute was found to break
some RADV and possibly radeon SI tests and had to be retracted.
This patch fixes that.

Differential Revision: http://reviews.llvm.org/D58993

llvm-svn: 355574
2019-03-07 00:54:04 +00:00
Adrian Prantl db5a779f2f Avoid using -S in combination with "script"; it's unreliable.
llvm-svn: 355573
2019-03-07 00:46:56 +00:00
Adrian Prantl f4d2fa3fa0 crashlog.py: Catch exception from subprocess.
llvm-svn: 355572
2019-03-07 00:41:51 +00:00
Adrian Prantl 59a94225c9 Relax testcase.
Recent versions of llvm monorepo builds build libc++abi.dylib as libc++abi.1.dylib.
This accespts both variants.

llvm-svn: 355571
2019-03-07 00:34:13 +00:00
Jonas Devlieghere ae5d62585e [Reproducers] Add tests for different types of functionality
This patch adds test that check that functionality in lldb continues to
work when replaying a reproducer.

 - Entries in image list are identical.
 - That stepping behaves the same.
 - That the data formatters behave the same.

Differential revision: https://reviews.llvm.org/D55626

llvm-svn: 355570
2019-03-07 00:24:44 +00:00
Adrian Prantl 28f7466f4e Promote more debug-only assertions to regular assertions.
llvm-svn: 355569
2019-03-07 00:14:20 +00:00
Adrian Prantl 1dfba3cfba Promote more debug-only assertions to regular assertions.
llvm-svn: 355568
2019-03-07 00:10:11 +00:00
Davide Italiano 9a8e777f8c [Python] Unbreak the recently modified tests for python 2.
llvm-svn: 355566
2019-03-06 23:50:36 +00:00
Jason Molenda 2d6e6cbacc Remove the warning in
DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule
which would list every kext that failed to load when doing kernel
debugging.  Instead, in DynamicLoaderDarwinKernel::ParseKextSummaries,
print a summary of how many kexts lldb was unable to load at the end.

I want to reduce the amount of output at the start of kernel debug
sessions a bit; we'll see if anyone really wanted to see the list of
which kexts specifically were unable to be loaded.

No functional change, only changing lldb's output at the start of
a kernel debug session.

<rdar://problem/48654569> 

llvm-svn: 355565
2019-03-06 23:47:52 +00:00
Nick Desaulniers 212c8ac23f [LoopRotate] fix crash encountered with callbr
Summary:
While implementing inlining support for callbr
(https://bugs.llvm.org/show_bug.cgi?id=40722), I hit a crash in Loop
Rotation when trying to build the entire x86 Linux kernel
(drivers/char/random.c). This is a small fix up to r353563.

Test case is drivers/char/random.c (with callbr's inlined), then ran
through creduce, then `opt -opt-bisect-limit=<limit>`, then bugpoint.

Thanks to Craig Topper for immediately spotting the fix, and teaching me
how to fish.

Reviewers: craig.topper, jyknight

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58929

llvm-svn: 355564
2019-03-06 23:04:40 +00:00
Rong Xu 10454dcc6a [PGO] Re-submit: Clang part of change for context-sensitive PGO (part2)
Part 2 of CSPGO change in Clang: Add test cases.

Differential Revision: https://reviews.llvm.org/D54176

llvm-svn: 355563
2019-03-06 23:00:38 +00:00
Davide Italiano a658ab9f55 [testsuite] Port crashlog to python 3, second attempt.
llvm-svn: 355562
2019-03-06 22:54:11 +00:00
Jim Ingham 798174455f Fix Cmake files for ExpressionSourceCode.cpp -> ClangExpressionSourceCode.cpp.
llvm-svn: 355561
2019-03-06 22:53:38 +00:00
Jim Ingham ea401ec7f4 Factor the clang specific parts of ExpressionSourceCode.{h,cpp} into the clang plugin.
NFC

Differential Revision: https://reviews.llvm.org/D59040

llvm-svn: 355560
2019-03-06 22:43:25 +00:00
Zachary Turner 2157f57d2d Pass /bigobj for SBReproducer.cpp with MSVC
/BIGOBJ is used to bypass certain COFF file format
limitations and is used with, unsurprisingly, very big
object files.  This file has grown large enough that it
needs this flag in order to compile successfully.

llvm-svn: 355559
2019-03-06 22:42:34 +00:00