Commit Graph

294804 Commits

Author SHA1 Message Date
Artem Dergachev 4369add18d [analyzer] Add a no-crash to a recently added test.
No functional change intended.

llvm-svn: 337776
2018-07-23 23:48:13 +00:00
Petr Hosek 2cf5d81f04 [Fuzzer] Update path to libc++ headers
The path to headers which are installed into libc++ build directory
has changed in r337727 which broke the libFuzzer build.

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

llvm-svn: 337775
2018-07-23 23:38:28 +00:00
Jason Molenda b794fc78fc Change sort-pbxproj.rb to find the project.pbxproj in the
most likely locations.  And have it overwrite the original
file with the sorted output.

llvm-svn: 337774
2018-07-23 23:34:50 +00:00
Fangrui Song 5bad9d835a [DWARF] Use deque in place of SmallVector to fix use-after-free issue
Summary: SmallVector's elements are moved when resizing and cause use-after-free.

Reviewers: probinson, dblaikie

Subscribers: JDevlieghere, llvm-commits

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

llvm-svn: 337772
2018-07-23 23:27:45 +00:00
Thomas Anderson 8e8a652c2f Fix typo in test/CodeGen/Mips/dins.ll
Differential Revision: https://reviews.llvm.org/D49704

llvm-svn: 337771
2018-07-23 23:19:53 +00:00
Wolfgang Pieb 790d86cefc Embed a template specialization in a namespace to work around a gcc bug.
llvm-svn: 337770
2018-07-23 23:14:23 +00:00
Artem Dergachev 917111f91e [analyzer] pr38273: Legalize Loc<>NonLoc comparison symbols.
Remove an assertion in RangeConstraintManager that expects such symbols to never
appear, while admitting that the constraint manager doesn't yet handle them.

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

llvm-svn: 337769
2018-07-23 23:09:44 +00:00
Eric Fiselier 54f10f8e68 Handle DT_UNKNOWN correctly during directory iteration.
Unlike stat and lstat, where unknown really means we know it's something weird,
during directory iteration DT_UNKNOWN simply means that the underlying FS doesn't
support the dirent::dt_type field.

This patch fixes libc++ to correctly set the cache to empty when DT_UNKNOWN is reported.

llvm-svn: 337768
2018-07-23 22:58:46 +00:00
Richard Smith f66e4f7dbd Support lifetime-extension of conditional temporaries.
llvm-svn: 337767
2018-07-23 22:56:45 +00:00
Erik Pilkington a3a462e5ca [Sema] Fix crash on BlockExprs in a default member initializers
Clang would crash when instantiating a BlockDecl that appeared in a
default-member-initializer of a class template. Fix this by deferring the
instantiation until we instantate the BlockExpr.

rdar://41200624

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

llvm-svn: 337766
2018-07-23 22:47:37 +00:00
Eric Fiselier f96de02960 Recommit "Use possibly cached directory entry values when performing recursive directory iteration."
The initial patch didn't correctly handle systems when the dirent struct
didn't provide the d_type member. Specifically it set the cache to the incorrect state,
and claimed it was partially populated.

The updated version of this change correctly handles setting up the
cache when the file type is not known (aka file_type::none).

llvm-svn: 337765
2018-07-23 22:40:41 +00:00
Eric Fiselier 82d975afa0 Fix accidentally removed test.
When adding the new tests for the filesystem_error::what method,
I incorrectly removed a test case and replaced it with something else.

This patch restores that test case

llvm-svn: 337764
2018-07-23 22:39:56 +00:00
Wolfgang Pieb 439801ba1d [DWARF v5] Refactor range lists dumping by using a more generic way of handling tables of lists.
The intent is to use it for location list tables as well. Change is almost NFC with the exception
of the spelling of some strings used during dumping (all lowercase now).

Reviewer: JDevlieghere

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

llvm-svn: 337763
2018-07-23 22:37:17 +00:00
Teresa Johnson b963c0b658 [LTO] Handle __imp_ (dllimport) symbols consistently with lld
Summary:
Similar to what lld already does for dllimport symbols which are
prefaced with __imp_ (see lld patch r240620), strip off the __imp_
prefix in LTO. Otherwise we can get 2 separate GlobalResolution for
a single symbol, the dllimport declaration, and the definition, which
leads to incorrect LTO handling.

Fixes PR38105.

Reviewers: pcc

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

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

llvm-svn: 337762
2018-07-23 22:33:57 +00:00
George Karpenkov fc3d72eeea [ASTMatchers] Add an isMain() matcher
Differential Revision: https://reviews.llvm.org/D49615

llvm-svn: 337761
2018-07-23 22:29:35 +00:00
George Karpenkov daac52cabc [ASTMatchers] [NFC] Regenerate HTML docs.
llvm-svn: 337760
2018-07-23 22:29:10 +00:00
Erik Pilkington 28e08a0a61 [demangler] call terminate() if allocation failed
We really should set *status to memory_alloc_failure, but we need to refactor
the demangler a bit to properly propagate the failure up the stack. Until then,
its better to explicitly terminate then rely on a null dereference crash.

rdar://31240372

llvm-svn: 337759
2018-07-23 22:23:04 +00:00
Greg Clayton 247aac81ab Fix Xcode project for unit tests.
llvm-svn: 337758
2018-07-23 22:22:46 +00:00
Martin Storsjo db42d51ee3 [MC] Add a separate flag for skipping comdat constant sections for MinGW. NFC.
This actually has nothing to do with the associative comdat sections
that aren't supported by GNU binutils ld.

Clarify the comments from SVN r335918 and use a separate flag for it.

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

llvm-svn: 337757
2018-07-23 22:15:25 +00:00
Martin Storsjo 100fc97051 [COFF] Fix assembly output of comdat sections without an attached symbol
Since SVN r335286, the .xdata sections are produced without an attached
symbol, which requires using a different syntax when printing assembly
output.

Instead of the usual syntax of '.section <name>,"dr",discard,<symbol>',
use '.section <name>,"dr"' + '.linkonce discard' (which is what GCC
uses for all assembly output).

This fixes PR38254.

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

llvm-svn: 337756
2018-07-23 22:15:19 +00:00
Martin Storsjo c2b701408e [AArch64] Use MCAsmInfoMicrosoft and MCAsmInfoGNUCOFF as base classes
This matches the structure used on X86 and ARM. This requires
a little bit of duplication of the parts that are equal in both
AArch64 COFF variants though.

Before SVN r335286, these classes didn't add anything that MCAsmInfoCOFF
didn't, but now they do.

This makes AArch64 match X86 in how comdat is used for float constants
for MinGW.

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

llvm-svn: 337755
2018-07-23 22:15:14 +00:00
Martin Storsjo 64142ba98b Implement a GCC compatible SEH unwinding personality, __gxx_personality_seh0
This allows handling SEH based exceptions, with unwind functions
provided by libgcc.

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

llvm-svn: 337754
2018-07-23 22:09:23 +00:00
Vedant Kumar 0970e2e34f [utils] Fix the llvm::Optional data formatter
The llvm::Optional data formatter needs to look through the `Storage`
container if it's present.

Before:

   220    if (Op && Op->getOp() != dwarf::DW_OP_LLVM_fragment)
-> 221      HasComplexExpression = true;
   222
   223    // If the register can only be described by a complex expression (i.e.,
   224    // multiple subregisters) it doesn't safely compose with another complex
Target 0: (llc) stopped.
(lldb) p Op
(llvm::Optional<llvm::DIExpression::ExprOperand>) $0 = None

After:

(lldb) p Op
(llvm::Optional<llvm::DIExpression::ExprOperand>) $0 =
(llvm::DIExpression::ExprOperand) storage = {
  Op = 0x000000010603d460
}

llvm-svn: 337752
2018-07-23 21:59:06 +00:00
Vedant Kumar 22bd6f99fa [SelectionDAG] Reduce DanglingDebugInfo memory traffic, NFC
This avoids approx. 2 x 10^5 DenseMap insertions in both non-debug and
debug -O2 builds of the sqlite3 amalgamation.

llvm-svn: 337751
2018-07-23 21:59:04 +00:00
Teresa Johnson e214fdeb69 [ThinLTO] Ensure the TargetLibraryInfo is constructed early enough
Summary:
Without this change, the WholeProgramDevirt pass, which requires the
TargetLibraryInfo, will construct one from the default triple.

Fixes PR38139.

Reviewers: pcc

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

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

llvm-svn: 337750
2018-07-23 21:58:19 +00:00
Eric Fiselier 5a16f861e9 Revert "Use possibly cached directory entry values when performing recursive directory iteration."
This reverts commit 04ce4aef00d3ee508327f6cf7bf1b1d200ab6238.

llvm-svn: 337749
2018-07-23 21:52:29 +00:00
George Burgess IV b00fb46479 [DebugCounters] Keep track of total counts
This patch makes debug counters keep track of the total number of times
we've called `shouldExecute` for each counter, so it's easier to build
automated tooling on top of these.

A patch to print these counts is coming soon.

Patch by Zhizhou Yang!

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

llvm-svn: 337748
2018-07-23 21:49:36 +00:00
Fangrui Song d9c254771d [gdb] Fix SmallVector pretty printer after r337514
llvm-svn: 337747
2018-07-23 21:33:51 +00:00
Reid Kleckner ab77d5eedf [clang-cl] Expose -fblocks and -fno-builtin as driver flags
Users have requested them.

Helps with PR36427.

llvm-svn: 337746
2018-07-23 21:29:43 +00:00
Matthew Voss 1486d5c6e2 Reapply "[XRay] Remove scheduling dependency in fork_basic_logging.cc"
Summary:
Continuation of https://reviews.llvm.org/D49501

Second part of the test has an scheduling order when there shouldn't be.



Reviewers: dberris, ormris

Reviewed By: dberris, ormris

Subscribers: TWeaver

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

llvm-svn: 337745
2018-07-23 21:22:02 +00:00
Richard Smith 6a32c0589c Do not try to perform lifetime-extension through conditional
expressions.

CodeGen can't cope with that yet. Instead, produce a "not supported"
warning for now and don't extend lifetime.

llvm-svn: 337744
2018-07-23 21:21:24 +00:00
Richard Smith afe48f9d68 Fold -Wreturn-stack-address into general initialization lifetime
checking.

llvm-svn: 337743
2018-07-23 21:21:22 +00:00
Manoj Gupta f9f50f634d ConstantFolding: Avoid a crash.
Summary:
Check if the parent basic block and caller exists
before calling CS.getCaller when constant folding
strip.invariant.group instrinsic.

This avoids a crash when the function containing the intrinsic
is being inlined. The instruction is checked for any simplifiction
but has not yet been added to a basic block.

Reviewers: Prazek, rsmith, efriedma

Reviewed By: efriedma

Subscribers: eraman, llvm-commits

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

llvm-svn: 337742
2018-07-23 21:20:00 +00:00
Raphael Isemann 9df80e8248 [cmake] Remove unused ${LLDB_PLUGINS} dependency from our Objective-C++ CMake config
Summary:
LLDB_PLUGINS doesn't exist as a variable, so this line doesn't add any dependencies and is
just confusing. It seems this slipped in from the gdb-remote CMake I was using as a CMake template.

The gdb-remote CMake itself is using a local LLDB_PLUGINS variable, so that code is fine.

Reviewers: davide

Reviewed By: davide

Subscribers: davide, mgorny, lldb-commits

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

llvm-svn: 337741
2018-07-23 21:14:52 +00:00
Reid Kleckner 980c4df037 Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"
Don't try to generate large PIC code for non-ELF targets. Neither COFF
nor MachO have relocations for large position independent code, and
users have been using "large PIC" code models to JIT 64-bit code for a
while now. With this change, if they are generating ELF code, their
JITed code will truly be PIC, but if they target MachO or COFF, it will
contain 64-bit immediates that directly reference external symbols. For
a JIT, that's perfectly fine.

llvm-svn: 337740
2018-07-23 21:14:35 +00:00
Matt Davis 07dee81a68 [llvm-mca][docs] Define IPC where it is first mentioned. NFC.
Expand the abbreviation where it is first used, and use IPC elsewhere.

llvm-svn: 337739
2018-07-23 21:10:50 +00:00
Erich Keane c764e9a87e Update to -r337585, allow scoped enum inits in -pedantic
llvm-svn: 337738
2018-07-23 21:08:13 +00:00
Raphael Isemann 17af5b6e20 [NFC] Minor code refactoring.
Subscribers: lldb-commits

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

llvm-svn: 337737
2018-07-23 20:56:49 +00:00
Aaron Smith 044326c7fc [CodeGen] Record if a C++ record is a trivial type
Summary: This has a dependence on D45122

Reviewers: rnk, zturner, llvm-commits, aleksandr.urakov

Reviewed By: rnk

Subscribers: cfe-commits

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

llvm-svn: 337736
2018-07-23 20:49:07 +00:00
David Greene 4345df3dad Fix RegScavenger::unprocess
RegScavenger::unprocess walks backward, so it should undo the effects
of defs before undoing effects of kills. Previously it did things in
the opposite order, leaving a register apparently unused (dead) in the
case where an instruction both used (killed) and defined a register.

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

llvm-svn: 337735
2018-07-23 20:23:50 +00:00
Nirav Dave 5af81d5bfa Add inline asm aliasing test.
llvm-svn: 337734
2018-07-23 20:19:10 +00:00
Henry Zhu a981a3dd9d Landed XRay patch (D49559) in incorrect directory. Reverting changes.
llvm-svn: 337733
2018-07-23 20:07:18 +00:00
Nico Weber 3239f13a06 [ms] Fix mangling of vector types in QMM_Result contexts.
If QMM_Result is set (which it is for return types, RTTI descriptors, and
exception type descriptors), tag types (structs, enums, classes, unions) get
their qualifiers mangled in.

__m64 and friends is a struct/union thingy in MSVC, but not in clang's headers.
To make mangling work, we call mangleArtificalTagType(TTK_Union/TTK_Struct for
the vector types to mangle them as tag types -- but the isa<TagType> check when
mangling in QMM_Result mode isn't true for these vector types. Add an
isArtificialTagType() function and check for that too. Fixes PR37276 and some
other issues.

I tried to audit all references to TagDecl and TagType in MicrosoftMangle.cpp
to find other places where we need to call mangleArtificalTagType(), but
couldn't find any.

I tried to audit all calls to mangleArtificalTagType() to see if
isArtificialTagType() needs to handle more than just the vector types, but as
far as I can tell all other types we use it for are types that MSVC can't
handle at all (Objective-C types etc).

https://reviews.llvm.org/D49597

llvm-svn: 337732
2018-07-23 20:04:00 +00:00
Michael J. Spencer 384b317c67 Revert "[docs] Add support for Markdown documentation in Sphinx"
Looks like this bot hasn't been updated yet.

llvm-svn: 337731
2018-07-23 20:00:32 +00:00
Michael J. Spencer 61c7ee42e2 [docs] Add support for Markdown documentation in Sphinx
Differential Revision: https://reviews.llvm.org/D44910

llvm-svn: 337730
2018-07-23 19:49:34 +00:00
Peter Collingbourne 00dc23f26e Revert r337638, "ELF: Make sections with KeepUnique bit eligible for ICF."
The gold behaviour with regard to --keep-unique is arguably a bug.
I also noticed a bug in my patch, which is that we mislink the
following program with --icf=safe by merging f3 and f4:

void f1() {}
void f2() {}

__attribute__((weak)) void* f3() { return f1; }
__attribute__((weak)) void* f4() { return f2; }

int main() {
  printf("%p %p\n", f3(), f4());
}

llvm-svn: 337729
2018-07-23 19:36:55 +00:00
Richard Smith 67af95bbe7 Separate out the initialization kind for a statement expression result
from that for a return value.

No functionality change intended: I don't believe any of the diagnostics
affected by this patch are reachable when initializing the result of
statement expression.

llvm-svn: 337728
2018-07-23 19:19:08 +00:00
Heejin Ahn e559401159 [CMake] Fix the setting of LIBCXX_HEADER_DIR
Reviewers: phosek

Subscribers: mgorny, christof, ldionne, cfe-commits

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

llvm-svn: 337727
2018-07-23 18:58:12 +00:00
Richard Smith ca975b2f58 Fold dangling-field warning into general initialization lifetime checks.
This reinstates r337627, reverted in r337671, with a fix to correctly
handle the lvalueness of array subscript expressions on pointers.

llvm-svn: 337726
2018-07-23 18:50:26 +00:00
Paul Semel 1dbbfba888 [yaml2obj] Add default sh_entsize for dynamic sections
Dynamic section holds a table, so the sh_entsize might be set. As the
dynamic section entry size never changes, we can default it to the size
of a dynamic entry.

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

llvm-svn: 337725
2018-07-23 18:49:04 +00:00