Lang Hames [Sat, 12 Nov 2016 02:19:31 +0000 (02:19 +0000)]
[ORC] Add a WrappedHandlerReturn type to map handler return types onto error
return types.
This class allows user provided handlers to return either error-wrapped types
or plain types. In the latter case, the plain type is wrapped with a success
value of Error or Expected<T> type to fit it into the rest of the serialization
machinery.
This patch allows us to remove the RPC unit-test workaround added in r286646.
llvm-svn: 286701
Devin Coughlin [Sat, 12 Nov 2016 01:50:04 +0000 (01:50 +0000)]
[analyzer] Update 'Automated' to 'Automatic' from r286694.
ARC is 'Automatic Reference Counting' and not 'Automated Reference Counting'.
llvm-svn: 286700
Richard Smith [Sat, 12 Nov 2016 01:39:56 +0000 (01:39 +0000)]
[c++1z] Support constant folding for __builtin_strchr and __builtin_memchr.
llvm-svn: 286699
Rui Ueyama [Sat, 12 Nov 2016 01:32:34 +0000 (01:32 +0000)]
Remove dead code.
llvm-svn: 286698
Devin Coughlin [Sat, 12 Nov 2016 01:23:01 +0000 (01:23 +0000)]
[analyzer] Fix copy-pasta in NullableReturnedFromNonnullChecker checker name.
The name of the NullableReturnedFromNonnullChecker in Checkers.td
was accidentally "NullablePassedToNonnull", which made it impossible
to explicitly turn the checker on.
rdar://problem/
28354459
llvm-svn: 286697
Mehdi Amini [Sat, 12 Nov 2016 01:18:17 +0000 (01:18 +0000)]
Add instructions in clang get_started page about working with a monorepo
llvm-svn: 286696
Mehdi Amini [Sat, 12 Nov 2016 01:17:59 +0000 (01:17 +0000)]
Improve `git llvm push` to suggest `git pull` when applying patch fails
Differential Revision: https://reviews.llvm.org/D26565
llvm-svn: 286695
Devin Coughlin [Sat, 12 Nov 2016 01:03:06 +0000 (01:03 +0000)]
[analyzer] Improve misleading RetainCountChcker diagnostic under ARC
Under automated reference counting the analyzer treats a methods -- even those
starting with 'copy' and friends -- as returning an unowned value. This is
because ownership of CoreFoundation objects must be transferred to ARC
with __bridge_transfer or CFBridgingRelease() before being returned as
ARC-managed bridged objects.
Unfortunately this could lead to a poor diagnostic inside copy methods under
ARC where the analyzer would complain about a leak of a returned CF value inside
a method "whose name does not start with 'copy'" -- even though the name did
start with 'copy'.
This commit improves the diagnostic under ARC to say inside a method "returned
from a method managed by Automated Reference Counting".
rdar://problem/
28849667
llvm-svn: 286694
Anna Zaks [Sat, 12 Nov 2016 00:46:07 +0000 (00:46 +0000)]
[tsan] Test that false races from ObjC's dealloc, .cxx_destruct, and initialize are ignored
Differential Revision: https://reviews.llvm.org/D26228
llvm-svn: 286693
Zachary Turner [Sat, 12 Nov 2016 00:35:58 +0000 (00:35 +0000)]
One more set of changes to fix formatv() on linux.
llvm-svn: 286692
Zachary Turner [Sat, 12 Nov 2016 00:30:37 +0000 (00:30 +0000)]
Add missing #include.
llvm-svn: 286691
Zachary Turner [Sat, 12 Nov 2016 00:28:10 +0000 (00:28 +0000)]
Fix another problem with formatv().
llvm-svn: 286690
Kostya Serebryany [Sat, 12 Nov 2016 00:24:35 +0000 (00:24 +0000)]
[libFuzzer] use less stack
llvm-svn: 286689
Rui Ueyama [Sat, 12 Nov 2016 00:23:32 +0000 (00:23 +0000)]
Remove extra semicolon.
llvm-svn: 286688
Tom Stellard [Sat, 12 Nov 2016 00:19:11 +0000 (00:19 +0000)]
AMDGPU/SI: Promote i16 = fp_[us]int f32 for VI
Summary: This fixes a regression caused by r286464.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D26570
llvm-svn: 286687
Zachary Turner [Sat, 12 Nov 2016 00:18:42 +0000 (00:18 +0000)]
Try to fix build after llvm::formatv() patch.
llvm-svn: 286686
Richard Smith [Sat, 12 Nov 2016 00:15:24 +0000 (00:15 +0000)]
[c++1z] std::byte didn't make it
llvm-svn: 286685
Rui Ueyama [Sat, 12 Nov 2016 00:00:51 +0000 (00:00 +0000)]
Emit Section Contributions.
Differential Revision: https://reviews.llvm.org/D26211
llvm-svn: 286684
Zachary Turner [Fri, 11 Nov 2016 23:58:11 +0000 (23:58 +0000)]
Fix -Werror build with clang-cl.
llvm-svn: 286683
Zachary Turner [Fri, 11 Nov 2016 23:57:40 +0000 (23:57 +0000)]
[Support] Introduce llvm::formatv() function.
This introduces a new type-safe general purpose formatting
library. It provides compile-time type safety, does not require
a format specifier (since the type is deduced), and provides
mechanisms for extending the format capability to user defined
types, and overriding the formatting behavior for existing types.
This patch additionally adds documentation for the API to the
LLVM programmer's manual.
Mailing List Thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html
Differential Revision: https://reviews.llvm.org/D25587
llvm-svn: 286682
Richard Smith [Fri, 11 Nov 2016 23:51:47 +0000 (23:51 +0000)]
[c++1z] Two more features have been accepted.
llvm-svn: 286681
Argyrios Kyrtzidis [Fri, 11 Nov 2016 23:49:55 +0000 (23:49 +0000)]
[index] Rename SymbolSubKind -> SymbolProperty, NFC.
This better reflects what it represents.
llvm-svn: 286680
Richard Smith [Fri, 11 Nov 2016 23:46:25 +0000 (23:46 +0000)]
[c++1z] p0522 is approved.
llvm-svn: 286679
Richard Smith [Fri, 11 Nov 2016 23:43:35 +0000 (23:43 +0000)]
[c++1z] Add constant-folding support for strcmp, strncmp, and memcmp, to
support constexpr char_traits.
llvm-svn: 286678
Rui Ueyama [Fri, 11 Nov 2016 23:41:13 +0000 (23:41 +0000)]
Define DbiStreamBuilder::addSectionContribs.
This patch defines a new function to add a SectionContribs stream
to a PDB file. Unlike SectionMap, SectionContribs contains a list
of input sections as opposed to output sections.
Note that this patch needs improving because currently we do not
set Module field in SectionContribs entries. In a follow-up patch,
I'll add Modules and then fix it after that.
Differential Revision: https://reviews.llvm.org/D26210
llvm-svn: 286677
Tom Stellard [Fri, 11 Nov 2016 23:35:42 +0000 (23:35 +0000)]
AMDGPU/SI: Fix visit order assumption in SIFixSGPRCopies
Summary:
This pass was assuming that when a PHI instruction defined a register
used by another PHI instruction that the defining insstruction would
be legalized before the using instruction.
This assumption was causing the pass to not legalize some PHI nodes
within divergent flow-control.
This fixes a bug that was uncovered by r285762.
Reviewers: nhaehnle, arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D26303
llvm-svn: 286676
Richard Trieu [Fri, 11 Nov 2016 23:26:28 +0000 (23:26 +0000)]
Print correct directory in merge script.
When providing the project directory to the merge script, print it out in the
commit instructions instead of the default project directory.
llvm-svn: 286675
Evgeniy Stepanov [Fri, 11 Nov 2016 23:25:09 +0000 (23:25 +0000)]
[tsan] Fix typo in test.
llvm-svn: 286674
Reid Kleckner [Fri, 11 Nov 2016 23:23:33 +0000 (23:23 +0000)]
Disable a test using posix_spawn on Android
llvm-svn: 286673
Anna Zaks [Fri, 11 Nov 2016 23:22:44 +0000 (23:22 +0000)]
[tsan][clang] Introduce a function attribute to disable TSan checking at run time
This introduces a function annotation that disables TSan checking for the
function at run time. The benefit over attribute((no_sanitize("thread")))
is that the accesses within the callees will also be suppressed.
The motivation for this attribute is a guarantee given by the objective C
language that the calls to the reference count decrement and object
deallocation will be synchronized. To model this properly, we would need to
intercept all ref count decrement calls (which are very common in ObjC due
to use of ARC) and also every single message send. Instead, we propose to
just ignore all accesses made from within dealloc at run time. The main
downside is that this still does not introduce any synchronization, which
means we might still report false positives if the code that relies on this
synchronization is not executed from within dealloc. However, we have not
seen this in practice so far and think these cases will be very rare.
(This problem is similar in nature to https://reviews.llvm.org/D21609;
unfortunately, the same solution does not apply here.)
Differential Revision: https://reviews.llvm.org/D25857
llvm-svn: 286672
Sanjay Patel [Fri, 11 Nov 2016 23:20:01 +0000 (23:20 +0000)]
[InstCombine] use dyn_cast rather isa+cast; NFC
Follow-up to r286664 cleanup as suggested by Eli. Thanks!
llvm-svn: 286671
Evgeniy Stepanov [Fri, 11 Nov 2016 23:17:49 +0000 (23:17 +0000)]
Tread TSan LLVM flags to driver: unit tests.
Summary: Unit tests for the new clang flags.
Reviewers: eugenis, dvyukov
Subscribers: kubabrecka, llvm-commits
Patch by Alex Shlyapnikov.
Differential Revision: https://reviews.llvm.org/D26462
llvm-svn: 286670
Evgeniy Stepanov [Fri, 11 Nov 2016 23:17:36 +0000 (23:17 +0000)]
Tread TSan LLVM flags to driver: add TSan controlling flags to clang.
Summary:
New clang flags, all default to true:
-f[no-]sanitize-thread-data-races
-f[no-]sanitize-thread-stack-traces
-f[no-]sanitize-thread-atomics
Reviewers: dvyukov, pcc, eugenis
Subscribers: pcc, cfe-commits
Patch by Alex Shlyapnikov.
Differential Revision: https://reviews.llvm.org/D26461
llvm-svn: 286669
Sanjay Patel [Fri, 11 Nov 2016 23:12:46 +0000 (23:12 +0000)]
[InstCombine] update test to use FileCheck; NFC
llvm-svn: 286668
Rafael Espindola [Fri, 11 Nov 2016 23:10:22 +0000 (23:10 +0000)]
Add missing REQUIRES.
llvm-svn: 286666
Kostya Serebryany [Fri, 11 Nov 2016 23:06:53 +0000 (23:06 +0000)]
[libFuzzer] do not initialize parts of TracePC -- let them be initialized by the linker. Add no-msan attribute to the memcmp hook.
llvm-svn: 286665
Sanjay Patel [Fri, 11 Nov 2016 23:01:20 +0000 (23:01 +0000)]
[InstCombine] clean up foldSelectOpOp(); NFC
llvm-svn: 286664
Anna Zaks [Fri, 11 Nov 2016 23:01:02 +0000 (23:01 +0000)]
[tsan][llvm] Implement the function attribute to disable TSan checking at run time
This implements a function annotation that disables TSan checking for the
function at run time. The benefit over attribute((no_sanitize("thread")))
is that the accesses within the callees will also be suppressed.
The motivation for this attribute is a guarantee given by the objective C
language that the calls to the reference count decrement and object
deallocation will be synchronized. To model this properly, we would need
to intercept all ref count decrement calls (which are very common in ObjC
due to use of ARC) and also every single message send. Instead, we propose
to just ignore all accesses made from within dealloc at run time. The main
downside is that this still does not introduce any synchronization, which
means we might still report false positives if the code that relies on this
synchronization is not executed from within dealloc. However, we have not seen
this in practice so far and think these cases will be very rare.
Differential Revision: https://reviews.llvm.org/D25858
llvm-svn: 286663
Adam Nemet [Fri, 11 Nov 2016 22:51:46 +0000 (22:51 +0000)]
[LV] Stop saying "use -Rpass-analysis=loop-vectorize"
This is PR28376.
Unfortunately given the current structure of optimization diagnostics we
lack the capability to tell whether the user has
passed -Rpass-analysis=loop-vectorize since this is local to the
front-end (BackendConsumer::OptimizationRemarkHandler).
So rather than printing this even if the user has already
passed -Rpass-analysis, this patch just punts and stops recommending
this option. I don't think that getting this right is worth the
complexity.
Differential Revision: https://reviews.llvm.org/D26563
llvm-svn: 286662
Lang Hames [Fri, 11 Nov 2016 22:50:16 +0000 (22:50 +0000)]
[RPC] Add const qualifier to MemberFnWrapper to make buildbots happy.
This is a temporary fix: The right solution is to make sure addHandler can
support mutable lambdas. I'll add that in a follow-up patch.
llvm-svn: 286661
Richard Smith [Fri, 11 Nov 2016 22:48:43 +0000 (22:48 +0000)]
[cxx_status] Prepare features list for WG21 motions.
llvm-svn: 286660
Rafael Espindola [Fri, 11 Nov 2016 22:43:27 +0000 (22:43 +0000)]
Don't sort sections in -r links.
Unlike gold, bfd, gas or MC we were putting exidx sections first since
they are ro.
The spec doesn't explicitly say that they must come after, but it is
definitely more convenient for the consumer, matches other producers
and matches other areas in ELF (like SHT_GROUP) where sections are
ordered in a natural way.
llvm-svn: 286659
Anna Zaks [Fri, 11 Nov 2016 22:43:12 +0000 (22:43 +0000)]
[tsan] Expose __tsan_ignore_thread_begin and __tsan_ignore_thread_end in TSan interface
This patch is needed to implement the function attribute that disable TSan checking at run time.
Differential Revision: https://reviews.llvm.org/D25859
llvm-svn: 286658
Rui Ueyama [Fri, 11 Nov 2016 22:41:47 +0000 (22:41 +0000)]
Fix typo in comment.
llvm-svn: 286657
Matthias Braun [Fri, 11 Nov 2016 22:39:50 +0000 (22:39 +0000)]
Revert "(origin/master, origin/HEAD) MachineScheduler/ScheduleDAG: Add support to skipping a node."
Revert accidentally committed change.
This reverts commit r286655.
llvm-svn: 286656
Matthias Braun [Fri, 11 Nov 2016 22:37:34 +0000 (22:37 +0000)]
MachineScheduler/ScheduleDAG: Add support to skipping a node.
The DAG mutators in the scheduler cannot really remove DAG nodes as
additional anlysis information such as ScheduleDAGToplogicalSort are
already computed at this point and rely on a fixed number of DAG nodes.
Alleviate the missing removal with a new flag: Setting the new skip
flag on a node ignores it during scheduling.
llvm-svn: 286655
Matthias Braun [Fri, 11 Nov 2016 22:37:31 +0000 (22:37 +0000)]
ScheduleDAGInstrs: Move VRegUses to ScheduleDAGMILive; NFCI
Push VRegUses/collectVRegUses() down the class hierarchy towards its
only user ScheduleDAGMILive.
NFCI: The initialization of the map happens at a later point but that
should not matter.
This is in preparation to allow DAG mutators to merge nodes, which
relies on this map getting computed later.
llvm-svn: 286654
Matthias Braun [Fri, 11 Nov 2016 22:37:28 +0000 (22:37 +0000)]
MachineScheduler: Dump EntrySU/ExitSU if possible
llvm-svn: 286653
Matthias Braun [Fri, 11 Nov 2016 22:37:26 +0000 (22:37 +0000)]
ScheduleDAG: Identify EntrySU/ExitSU when dumping node ids
llvm-svn: 286652
Artem Dergachev [Fri, 11 Nov 2016 22:34:53 +0000 (22:34 +0000)]
[ASTMatchers] Fix a typo in cStyleCastExpr() HTML docs as well. NFC.
llvm-svn: 286651
Nemanja Ivanovic [Fri, 11 Nov 2016 22:34:44 +0000 (22:34 +0000)]
[PowerPC] Implement remaining permute builtins in altivec.h - Clang portion
This patch corresponds to review:
https://reviews.llvm.org/D26479
It adds the remaining vector permute/rotate builtins to altivec.h.
llvm-svn: 286650
Mehdi Amini [Fri, 11 Nov 2016 22:28:19 +0000 (22:28 +0000)]
Fix wrong formatting in lld introduced in r286561 (NFC)
Pointed out by Davide.
llvm-svn: 286649
Erik Eckstein [Fri, 11 Nov 2016 22:21:39 +0000 (22:21 +0000)]
FunctionComparator: don't rely on argument evaluation order.
This is a follow-up on the recent refactoring of the FunctionMerge pass.
It should fix a fail of the new FunctionComparator unittest whe compiling with MSVC.
llvm-svn: 286648
Mehdi Amini [Fri, 11 Nov 2016 22:18:42 +0000 (22:18 +0000)]
Fix static initialization order fiasco in MCTests
Reported by Kostya on llvm-dev, uncovered by an ASAN bot
llvm-svn: 286647
Lang Hames [Fri, 11 Nov 2016 22:16:10 +0000 (22:16 +0000)]
[ORC] Temporarily fix the RPCUtils unit test by explicitly specifying a handler
return type.
This should be fixed permanently by having the RPCUtils header recognize the
ErrorSuccess type. I'll commit that in a follow up patch.
llvm-svn: 286646
Piotr Padlewski [Fri, 11 Nov 2016 22:12:15 +0000 (22:12 +0000)]
NFC ProgrammersManual fix
llvm-svn: 286645
Adrian Prantl [Fri, 11 Nov 2016 22:09:25 +0000 (22:09 +0000)]
Simplify code and address review comments (NFC)
llvm-svn: 286644
Rafael Espindola [Fri, 11 Nov 2016 22:07:15 +0000 (22:07 +0000)]
Make test more strict. NFC.
It was non-obvious that a CHECK was not matching the following section.
llvm-svn: 286643
Lang Hames [Fri, 11 Nov 2016 21:55:25 +0000 (21:55 +0000)]
[Orc] Update the BuildingAJIT Chapter 5 server class for the recent RPC changes.
llvm-svn: 286642
Richard Trieu [Fri, 11 Nov 2016 21:50:39 +0000 (21:50 +0000)]
Remove double setting of invalid flag.
In r286630, Decl::setInvalidDecl will automatically set the invalid flag for
BindingDecl for children in invalid DecompositionDecl. It no longer is
necessary to do a separate setInvalidDecl when finalizing a BindingDecl.
llvm-svn: 286641
Adrian Prantl [Fri, 11 Nov 2016 21:48:09 +0000 (21:48 +0000)]
Fix a reference-to-temporary introduced in r286607.
llvm-svn: 286640
Lang Hames [Fri, 11 Nov 2016 21:42:09 +0000 (21:42 +0000)]
[ORC] Re-apply 286620 with fixes for the ErrorSuccess class.
llvm-svn: 286639
Nemanja Ivanovic [Fri, 11 Nov 2016 21:42:01 +0000 (21:42 +0000)]
[PowerPC] Add remaining vector permute builtins in altivec.h - LLVM portion
This patch corresponds to review:
https://reviews.llvm.org/D26480
Adds all the intrinsics used for various permute builtins that will
be added to altivec.h.
llvm-svn: 286638
Evgeniy Stepanov [Fri, 11 Nov 2016 21:39:35 +0000 (21:39 +0000)]
[cfi] Test case for weak symbol handling.
llvm-svn: 286637
Evgeniy Stepanov [Fri, 11 Nov 2016 21:39:26 +0000 (21:39 +0000)]
[cfi] Fix weak functions handling.
When a function pointer is replaced with a jumptable pointer, special
case is needed to preserve the semantics of extern_weak functions.
Since a jumptable entry can not be extern_weak, we emulate that
behaviour by replacing all references to F (the extern_weak function)
with the following expression: F != nullptr ? JumpTablePtr : nullptr.
Extra special care is needed for global initializers, since most (or
probably all) backends can not lower an initializer that includes
this kind of constant expression. Initializers like that are replaced
with a global constructor (i.e. a runtime initializer).
llvm-svn: 286636
Rafael Espindola [Fri, 11 Nov 2016 21:36:25 +0000 (21:36 +0000)]
Avoid a crash with -r and .comment.
We would create a MergeInputSection for the synthetic .comment and
crash trying to add it to a regular output section.
With this we just don't add the synthetic section with -r. That is
consistent with gold that doesn't create .note.gnu.gold-version with
-r.
llvm-svn: 286635
Tom Stellard [Fri, 11 Nov 2016 21:34:47 +0000 (21:34 +0000)]
Fix build since llvm r286566 and require at least llvm 4.0
llvm-svn: 286634
Devin Coughlin [Fri, 11 Nov 2016 21:31:38 +0000 (21:31 +0000)]
[analyzer] Teach RetainCountChecker about VTCompressionSessionEncodeFrame()
The context argument passed to VideoToolbox's
VTCompressionSessionEncodeFrame() function is ultimately passed to a callback
supplied when creating the compression session and so may be freed by that
callback. To suppress false positives in this case, teach the retain count
checker to stop tracking that argument.
This isn't suppressed by the usual callback context mechanism because the call
to VTCompressionSessionEncodeFrame() doesn't include the callback itself.
rdar://problem/
27685213
llvm-svn: 286633
Erik Eckstein [Fri, 11 Nov 2016 21:15:13 +0000 (21:15 +0000)]
Make the FunctionComparator of the MergeFunctions pass a stand-alone utility.
This is pure refactoring. NFC.
This change moves the FunctionComparator (together with the GlobalNumberState
utility) in to a separate file so that it can be used by other passes.
For example, the SwiftMergeFunctions pass in the Swift compiler:
https://github.com/apple/swift/blob/master/lib/LLVMPasses/LLVMMergeFunctions.cpp
Details of the change:
*) The big part is just moving code out of MergeFunctions.cpp into FunctionComparator.h/cpp
*) Make FunctionComparator member functions protected (instead of private)
so that a derived comparator class can use them.
Following refactoring helps to share code between the base FunctionComparator
class and a derived class:
*) Add a beginCompare() function
*) Move some basic function property comparisons into a separate function compareSignature()
*) Do the GEP comparison inside cmpOperations() which now has a new
needToCmpOperands reference parameter
https://reviews.llvm.org/D25385
llvm-svn: 286632
Todd Fiala [Fri, 11 Nov 2016 21:06:40 +0000 (21:06 +0000)]
Remove weak-linked symbols for SBBreakpointListImpl
Summary:
Similar to SBStructuredData's Impl class, SBBreakpointListImpl was
getting weak-link exported in the lldb namespace. This change list fixes
that by moving out of the lldb public namespace, which removes it from
public export visibility.
Fixes:
rdar://
28960344
Reviewers: jingham
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D26553
llvm-svn: 286631
Richard Trieu [Fri, 11 Nov 2016 20:51:04 +0000 (20:51 +0000)]
When a DecompositionDecl is marked invalid, also set the child BindingDecl's to
invalid.
llvm-svn: 286630
Rui Ueyama [Fri, 11 Nov 2016 20:39:02 +0000 (20:39 +0000)]
Fix -Wpessimizing-move warning.
llvm-svn: 286629
Artem Dergachev [Fri, 11 Nov 2016 20:29:59 +0000 (20:29 +0000)]
[ASTMatchers] Fix a typo in cStyleCastExpr() docs. NFC.
llvm-svn: 286628
Nemanja Ivanovic [Fri, 11 Nov 2016 19:56:17 +0000 (19:56 +0000)]
[PowerPC] Add vector conversion builtins to altivec.h - clang portion
This patch corresponds to review:
https://reviews.llvm.org/D26308
It adds a number of vector type conversion builtins to altivec.h.
llvm-svn: 286627
Vyacheslav Klochkov [Fri, 11 Nov 2016 19:55:29 +0000 (19:55 +0000)]
Fixed the lost FastMathFlags for FCmp operations in SLPVectorizer.
Reviewer: Michael Zolotukhin.
Differential Revision: https://reviews.llvm.org/D26543
llvm-svn: 286626
Chad Rosier [Fri, 11 Nov 2016 19:52:45 +0000 (19:52 +0000)]
[AArch64] Update a FIXME comment to reflect current state. NFC.
llvm-svn: 286625
Peter Collingbourne [Fri, 11 Nov 2016 19:50:39 +0000 (19:50 +0000)]
Bitcode: Change getModuleSummaryIndex() to return an llvm::Expected.
Differential Revision: https://reviews.llvm.org/D26539
llvm-svn: 286624
Peter Collingbourne [Fri, 11 Nov 2016 19:50:24 +0000 (19:50 +0000)]
Bitcode: Clean up error handling for certain bitcode query functions.
The functions getBitcodeTargetTriple(), isBitcodeContainingObjCCategory(),
getBitcodeProducerString() and hasGlobalValueSummary() now return errors
via their return value rather than via the diagnostic handler.
To make this work, re-implement these functions using non-member functions
so that they can be used without the LLVMContext required by BitcodeReader.
Differential Revision: https://reviews.llvm.org/D26532
llvm-svn: 286623
Peter Collingbourne [Fri, 11 Nov 2016 19:50:10 +0000 (19:50 +0000)]
Bitcode: Prepare to move bitcode readers to free functions.
Make initStream() a free function, and change BitcodeReaderBase ctor to take
a BitstreamCursor.
llvm-svn: 286622
Lang Hames [Fri, 11 Nov 2016 19:46:46 +0000 (19:46 +0000)]
[ORC] Revert r286620 while I investigate a bot failure.
llvm-svn: 286621
Lang Hames [Fri, 11 Nov 2016 19:42:44 +0000 (19:42 +0000)]
[ORC] Refactor the ORC RPC utilities to add some new features.
(1) Add support for function key negotiation.
The previous version of the RPC required both sides to maintain the same
enumeration for functions in the API. This means that any version skew between
the client and server would result in communication failure.
With this version of the patch functions (and serializable types) are defined
with string names, and the derived function signature strings are used to
negotiate the actual function keys (which are used for efficient call
serialization). This allows clients to connect to any server that supports a
superset of the API (based on the function signatures it supports).
(2) Add a callAsync primitive.
The callAsync primitive can be used to install a return value handler that will
run as soon as the RPC function's return value is sent back from the remote.
(3) Launch policies for RPC function handlers.
The new addHandler method, which installs handlers for RPC functions, takes two
arguments: (1) the handler itself, and (2) an optional "launch policy". When the
RPC function is called, the launch policy (if present) is invoked to actually
launch the handler. This allows the handler to be spawned on a background
thread, or added to a work list. If no launch policy is used, the handler is run
on the server thread itself. This should only be used for short-running
handlers, or entirely synchronous RPC APIs.
(4) Zero cost cross type serialization.
You can now define serialization from any type to a different "wire" type. For
example, this allows you to call an RPC function that's defined to take a
std::string while passing a StringRef argument. If a serializer from StringRef
to std::string has been defined for the channel type this will be used to
serialize the argument without having to construct a std::string instance.
This allows buffer reference types to be used as arguments to RPC calls without
requiring a copy of the buffer to be made.
llvm-svn: 286620
Sanjay Patel [Fri, 11 Nov 2016 19:37:54 +0000 (19:37 +0000)]
[InstCombine] add tests to show size-increasing select transforms
llvm-svn: 286619
Reid Kleckner [Fri, 11 Nov 2016 19:27:52 +0000 (19:27 +0000)]
Add a test that uses coverage and printf from a DLL
This test fails without LLVM r286615
llvm-svn: 286618
Chad Rosier [Fri, 11 Nov 2016 19:25:48 +0000 (19:25 +0000)]
[AArch64] Add test to show narrow zero store merging is disabled with strict align. NFC.
llvm-svn: 286617
Geoff Berry [Fri, 11 Nov 2016 19:25:20 +0000 (19:25 +0000)]
[AArch64] Fix bugs in isel lowering replaceSplatVectorStore.
Summary:
Fix off-by-one indexing error in loop checking that inserted value was a
splat vector.
Add code to check that INSERT_VECTOR_ELT nodes constructing the splat
vector have the expected constant index values.
Reviewers: t.p.northover, jmolloy, mcrosier
Subscribers: aemerson, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D26409
llvm-svn: 286616
Reid Kleckner [Fri, 11 Nov 2016 19:18:45 +0000 (19:18 +0000)]
[sancov] Don't instrument MSVC CRT stdio config helpers
They get called before initialization, which is a problem for winasan.
Test coming in compiler-rt.
llvm-svn: 286615
Petr Hosek [Fri, 11 Nov 2016 19:12:58 +0000 (19:12 +0000)]
[CMake] Check runtimes subdir when looking for libcxx and libuwind
The runtimes subdir is the new location for runtimes, we should
include it when looking for libcxx and libunwind headers.
Differential Revision: https://reviews.llvm.org/D26362
llvm-svn: 286614
Evgeniy Stepanov [Fri, 11 Nov 2016 18:49:49 +0000 (18:49 +0000)]
[cfi] Enable cfi-icall on ARM and AArch64.
llvm-svn: 286613
Evgeniy Stepanov [Fri, 11 Nov 2016 18:49:15 +0000 (18:49 +0000)]
[cfi] Tweak a test for the cfi-icall change.
llvm-svn: 286612
Evgeniy Stepanov [Fri, 11 Nov 2016 18:49:09 +0000 (18:49 +0000)]
[cfi] Implement cfi-icall using inline assembly.
The current implementation is emitting a global constant that happens
to evaluate to the same bytes + relocation as a jump instruction on
X86. This does not work for PIE executables and shared libraries
though, because we end up with a wrong relocation type. And it has no
chance of working on ARM/AArch64 which use different relocation types
for jump instructions (R_ARM_JUMP24) that is never generated for
data.
This change replaces the constant with module-level inline assembly
followed by a hidden declaration of the jump table. Works fine for
ARM/AArch64, but has some drawbacks.
* Extra symbols are added to the static symbol table, which inflate
the size of the unstripped binary a little. Stripped binaries are not
affected. This happens because jump table declarations must be
external (because their body is in the inline asm).
* Original functions that were anonymous are now named
<original name>.cfi, and it affects symbolization sometimes. This is
necessary because the only user of these functions is the (inline
asm) jump table, so they had to be added to @llvm.used, which does
not allow unnamed functions.
llvm-svn: 286611
Adrian Prantl [Fri, 11 Nov 2016 18:22:51 +0000 (18:22 +0000)]
Fix comments according to the LLVM coding guidelines.
llvm-svn: 286610
Reid Kleckner [Fri, 11 Nov 2016 18:11:33 +0000 (18:11 +0000)]
Add missing %run to test to fix AArch64 buildbot
llvm-svn: 286609
Reid Kleckner [Fri, 11 Nov 2016 17:51:51 +0000 (17:51 +0000)]
[asan/win] Fix wrong TerminateProcess exit code
Add a test for it.
llvm-svn: 286608
Adrian Prantl [Fri, 11 Nov 2016 17:50:09 +0000 (17:50 +0000)]
Revert "Use private linkage for MergedGlobals variables" on Darwin.
This is a partial revert of r244615 (http://reviews.llvm.org/D11942),
which caused a major regression in debug info quality.
Turning the artificial __MergedGlobal symbols into private symbols
(l__MergedGlobal) means that the linker will not include them in the
symbol table of the final executable. Without a symbol table entry
dsymutil is not be able to process the debug info for any of the
merged globals and thus drops the debug info for all of them.
This patch is enabling the old behavior for all MachO targets while
leaving all other targets unaffected.
rdar://problem/
29160481
https://reviews.llvm.org/D26531
llvm-svn: 286607
Chad Rosier [Fri, 11 Nov 2016 17:49:34 +0000 (17:49 +0000)]
[AArch64] Remove lots of redundant code. NFC.
llvm-svn: 286606
Sylvestre Ledru [Fri, 11 Nov 2016 17:46:51 +0000 (17:46 +0000)]
Force the locale when executing ld gold
Summary:
If run with other locales (like French),
the decode operation might fail
This is the same change as in r246421 for llvm.
llvm-svn: 286605
Sanjay Patel [Fri, 11 Nov 2016 17:42:16 +0000 (17:42 +0000)]
[InstCombine] fix formatting of FoldOpIntoSelect(); NFCI
llvm-svn: 286604
Greg Clayton [Fri, 11 Nov 2016 17:38:14 +0000 (17:38 +0000)]
Fixed issues found by Paul Robinson with my patch for:
https://reviews.llvm.org/D26526
- Fixed DW_FORM_strp to be correctly sized and extracted for DWARF64
- Added some missing strp variants as well
- Fixed comment typo
llvm-svn: 286603
Sylvestre Ledru [Fri, 11 Nov 2016 17:29:56 +0000 (17:29 +0000)]
Add a new optimization option -Og
Summary:
Just like gcc, we should have the -Og option as more and more software are using it:
https://llvm.org/bugs/show_bug.cgi?id=20765
Reviewers: echristo, dberlin, dblaikie, keith.walker.arm, rengolin
Subscribers: aprantl, friss, mehdi_amini, RKSimon, probinson, majnemer, cfe-commits
Differential Revision: https://reviews.llvm.org/D24998
llvm-svn: 286602
Chad Rosier [Fri, 11 Nov 2016 17:07:37 +0000 (17:07 +0000)]
[AArch64] Early return and minor renaming/refactoring to ease code review. NFC.
llvm-svn: 286601