Commit Graph

201253 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 91e7a18e57 MC: Make MCSymbolData::Symbol private
Make the back-pointer from `MCSymbolData` to `MCSymbol` private,
preparing to remove the back pointer entirely.  I've already updated all
the users, although for now it's still used to indicate whether
`MCSymbol::Data` has been initialized.

llvm-svn: 237868
2015-05-21 00:49:09 +00:00
Duncan P. N. Exon Smith 24f4775f71 MC: Remove last use of MCSymbolData::getSymbol(), NFC
Remove the last use of `MCSymbolData::getSymbol()`.  There's some
*really* hairy stuff going on in `MachObjectWriter::WriteNList()` that I
want to come back to.  In particular, it updates `Symbol` to point at
its aliasee (if any), but leaves `Data` behind, and it's not clear
whether everything makes sense there.

For now I've left the logic unchanged by adding `OrigSymbol` and moving
the FIXME from r237750 up a bit higher.  I've filed PR23598 to track
looking into this.

llvm-svn: 237867
2015-05-21 00:39:24 +00:00
Jim Ingham 7ac5c86ba9 Fix the logic in DynamicLoaderMacOSXDYLD::Clear that would only remove the old dyld notification
breakpoint only  if the process it was for is still alive.  We need to always remove this because
it has a pointer to the old loader, and    if we ever hit it we will crash.  I also put in a sanity
check in the callback function to make sure we don't invoke it if the process is wrong.

<rdar://problem/21006189>

llvm-svn: 237866
2015-05-21 00:27:01 +00:00
Greg Clayton 07b5899367 Fixed an issue with expressions that define types in the expression. We must currently touch the members of the struct in the right order or our ClangASTImporter::DeportType() will copy the resulting type into the target AST incorrectly. This is a work around for <rdar://problem/21049838> which the copy type issue so that it doesn't happen.
<rdar://problem/20902950>

llvm-svn: 237865
2015-05-21 00:26:58 +00:00
Chaoren Lin 36758cf16a Using -pthread instead of -lpthread to appease GCC.
llvm-svn: 237864
2015-05-21 00:19:15 +00:00
Reid Kleckner 012665e16b Rename a helper template function to 'bytes' to avoid a C++17 STL conflict
MSVC 2015 includes the std::data() template function added to C++17. ADL
causes both cl.exe and clang-cl to prefer std::data over our static
helper here, and we get errors about converting int64_t* to StringRef.
Renaming it to bytes avoids the ambiguity.

llvm-svn: 237863
2015-05-21 00:13:09 +00:00
Reid Kleckner b4a26ed58e Work around overloading bug in MSVC 2015
MSVC 2015 appears to be unable to find the correct operator== here. I
haven't yet filed a bug with Microsoft as I've been unable to create a
reduced test case.

llvm-svn: 237862
2015-05-21 00:12:53 +00:00
Ahmed Bougacha 0541c67ae7 [MemCpyOpt] Pass Instruction to IRBuilder, no need for NextNode. NFC.
We're erasing the instructions anyway.

llvm-svn: 237861
2015-05-21 00:08:35 +00:00
David Blaikie f87cc6d3ab [opaque pointer type] Pass explicit pointee type in another case of GEP constant folding
llvm-svn: 237860
2015-05-21 00:06:38 +00:00
Andrew Kaylor cafb89df1e Fix build error
llvm-svn: 237859
2015-05-20 23:58:44 +00:00
Ahmed Bougacha 5e0f425c27 [MemCpyOpt] Don't move the memset when optimizing memset+memcpy.
Fixes PR23599, another miscompile introduced by r235232: when there is
another dependency on the destination of the created memset (i.e., the
part of the original destination that the memcpy doesn't depend on)
between the memcpy and the original memset, we would insert the created
memset after the memcpy, and thus after the other dependency.

Instead, insert the created memset right after the old one.

llvm-svn: 237858
2015-05-20 23:55:16 +00:00
Lang Hames b103c0321f [LLD] Make lastOrdinal atomic to avoid race conditions.
No test case: We don't have a good way to test race conditions.

llvm-svn: 237857
2015-05-20 23:44:37 +00:00
Richard Trieu cbab79a4f8 Check for bool-like conversion in conditional expressions.
Add a check for bool-like conversions for the condition expression of
conditional operators.  This is similiar to the checking of condition
expressions of if statements, for-loops, while-loops, and do-while loops.
Specificially, this is to fix the problem of assert("message") not triggering
-Wstring-conversion when the assert macro uses a conditional operator.

llvm-svn: 237856
2015-05-20 23:29:18 +00:00
Andrew Kaylor 69fc4418ab Fix build warning
llvm-svn: 237855
2015-05-20 23:28:03 +00:00
Andrew Kaylor a6c5b9682e [WinEH] C++ EH state numbering fixes
Differential Revision: http://reviews.llvm.org/D9787

llvm-svn: 237854
2015-05-20 23:22:24 +00:00
Reid Kleckner 2632f0df48 [WinEH] Store pointers to the LSDA in the exception registration object
We aren't yet emitting the LSDA yet, so this will still fail to
assemble.

llvm-svn: 237852
2015-05-20 23:08:04 +00:00
Pete Cooper a05c082866 Don't generate comments in the DebugLocStream unless required. NFC.
The ByteStreamer here wasn't taking account of whether the asm streamer was text based and verbose.  Only with that combination should we emit comments.

This change makes sure that we only actually convert a Twine to a string using Twine::str() if we need the comment.  This saves about 10000 small allocations on a test case involving the verify-use_list-order bitcode going through llc with debug info.

Note, this is NFC as the comments would ultimately never be emitted unless required.

Reviewed by Duncan Exon Smith and David Blaikie.

llvm-svn: 237851
2015-05-20 22:51:27 +00:00
Richard Smith 31d1de2229 [OpenMP] Make default OpenMP library (the one selected with just -fopenmp)
configurable in the CMake build. There shouldn't be any change in default
behavior.

Derived from a patch by Daniel Jasper!

llvm-svn: 237850
2015-05-20 22:48:44 +00:00
Pete Cooper 477300d333 Revert "Add bool to DebugLocDwarfExpression to control emitting comments."
This reverts commit 0037b6bcbc874aa1b93d7ce3ad8dba3753ee2d9d (r237827).

David Blaikie suggested some alternatives to this which are better.  Reverting to apply a better solution later.

llvm-svn: 237849
2015-05-20 22:37:48 +00:00
Nick Kledzik 506813892e [darwin] fix libcompiler_rt.dylib build
The dylib build of compiler-rt has been broken on darwin since the
directory restructuring to push some things down into /builtins/.

llvm-svn: 237848
2015-05-20 22:37:46 +00:00
Lang Hames 2a10996706 [LLD] Fix an out-of-order-initialization bug that was introduced in r237841 by
moving a field in MachOLinkingContext.

llvm-svn: 237847
2015-05-20 22:35:20 +00:00
Lang Hames d48be84032 [LLD] Revert r237842 - it went in without a proper commit message.
llvm-svn: 237846
2015-05-20 22:33:34 +00:00
Jonathan Peyton 7979a07611 Change CMake variable prefix to LIBOMP
Cached CMake variables need to have a prefix so they don't collide with other
projects. This change (a lot of simple changes) simply prefixes cached variables
with LIBOMP_ and sets all of these variables to UPPERCASE which is convention.
e.g., os => LIBOMP_OS, ompt_support => LIBOMP_OMPT_SUPPORT.

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

llvm-svn: 237845
2015-05-20 22:33:24 +00:00
Adrian McCarthy 58443f2429 Have TestNumThreads use std::thread instead of pthreads so that it can work cross-platform.
llvm-svn: 237844
2015-05-20 22:32:44 +00:00
Hans Wennborg a8f8df5dd2 Revert r237828 "[X86] Remove unused node after morphing it from shr to and."
This caused assertions during DAG combine: PR23601.

llvm-svn: 237843
2015-05-20 22:31:55 +00:00
Lang Hames d39a6d20c2 y
llvm-svn: 237842
2015-05-20 22:26:06 +00:00
Lang Hames 65a64c9c29 [LLD] Add support for the -stack_size option to Darwin ld.
llvm-svn: 237841
2015-05-20 22:10:50 +00:00
Nick Kledzik 267d31e137 [doc] Update Lexicon with C++ unwinder acronyms
llvm-svn: 237840
2015-05-20 22:04:06 +00:00
Reid Kleckner 892bb0cace Evaluate union cast subexpressions when the cast value is unused
Fixes PR23597.

llvm-svn: 237839
2015-05-20 21:59:25 +00:00
David Blaikie 0c28fd7fda [opaque pointer type] Pass explicit type to Load instruction creation in AutoUpgrade
llvm-svn: 237838
2015-05-20 21:46:30 +00:00
Davide Italiano 141b2891cb [Target/ARM] Only enable OptimizeBarrierPass at -O1 and above.
Ideally this is going to be and LLVM IR pass (shared, among others
with AArch64), but for the time being just enable it if consumers
ask us for optimization and not unconditionally.

Discussed with Tim Northover on IRC.

llvm-svn: 237837
2015-05-20 21:40:38 +00:00
Kostya Serebryany 2adfa3be0a [lib/Fuzzer] more docs
llvm-svn: 237836
2015-05-20 21:03:03 +00:00
Aaron Ballman 068aa51dae Refactored some common functionality into MaybeParseMicrosoftDeclSpecs; NFC.
llvm-svn: 237835
2015-05-20 20:58:33 +00:00
Reid Kleckner 5959176069 [lld] Use lit's shell to run tests on Windows by default
It's a lot faster than bash.

Also use FileCheck instead of grep to search through a binary file.
Cygwin's grep isn't working here for unknown reasons that probably
aren't worth investigating.

llvm-svn: 237834
2015-05-20 20:41:45 +00:00
Alex Lorenz c6277793dd AsmParser: Require a terminating null character when creating memory buffer.
This commit modifies the memory buffer creation in the AsmParser library so 
that it requires a terminating null character. The LLLexer in the AsmParser
library checks for EOF only when it sees a null character, thus it would
be best to require it when creating a memory buffer so that the memory
buffer constructor can verify that a terminating null character is indeed
present.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun

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

llvm-svn: 237833
2015-05-20 20:41:27 +00:00
Reid Kleckner 558850ac59 Copy lit shell changes from clang to clang-tools-extra, excluding some failing tests
llvm-svn: 237832
2015-05-20 20:33:18 +00:00
Chaoren Lin 2bf454021c Default dst value for platform put-file.
Summary: It should default to working-dir/src-filename if dst is not specified.

Reviewers: clayborg, flackr

Reviewed By: flackr

Subscribers: lldb-commits

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

llvm-svn: 237831
2015-05-20 20:23:23 +00:00
David Blaikie 79009f88b4 [opaque pointer type] LoadInst: assert that the explicit type matches the implicit one
llvm-svn: 237830
2015-05-20 20:22:31 +00:00
Duncan P. N. Exon Smith 92a699c50e MC: Remove most remaining uses of MCSymbolData::getSymbol(), NFC
Remove most remaining calls to `MCSymbolData::getSymbol()`, instead
using the already available `MCSymbol` directly.

llvm-svn: 237829
2015-05-20 20:18:16 +00:00
Benjamin Kramer a74480d1eb [X86] Remove unused node after morphing it from shr to and.
In some cases it won't get cleaned up properly leading to crashes
downstream. PR23353.

Based on a patch by Davide Italiano.

llvm-svn: 237828
2015-05-20 20:10:26 +00:00
Pete Cooper 35522001fa Add bool to DebugLocDwarfExpression to control emitting comments.
DebugLocDwarfExpression::EmitOp was creating temporary strings by concatenating Twine's.

When emitting to object files, these comments are thrown away.

This commit adds a boolean to the constructor of the DwarfExpression to control whether it will actually emit
any comments.  This prevents it from even generating the temporary comments which would have been thrown away anyway.

llvm-svn: 237827
2015-05-20 19:50:03 +00:00
Duncan P. N. Exon Smith e8fb3a220a MC: Stop using MCSymbolData::getSymbol() in WinCOFF, NFC
Move APIs over from `MCSymbolData` to `MCSymbol`.

llvm-svn: 237826
2015-05-20 19:34:08 +00:00
Jim Ingham 40d66e6108 Since the asan report function doesn't gather bp or sp,
don't put those values in the Structured Data we make up
from the report.

<rdar://problem/21038887>

llvm-svn: 237824
2015-05-20 19:15:43 +00:00
Pete Cooper b78008171b Use a SmallString buffer instead of a std::string for debug info path lookup. NFC.
This code appends the filename to the directory then looks that up in a StringMap.  We should be using the existing Twine::toStringRef method instead of Twine::str() as most times we'll succeed in the lookup.

Its possible that we should also consider allowing StringMap to lookup a key using a Twine in addition to a StringRef but that would complicate the code with little known benefit above and beyond this change.

This saves 170k temporary allocations when running llc on the verify_use_list_order bitcode with debug info for x86.

llvm-svn: 237823
2015-05-20 19:12:14 +00:00
Matthias Braun 56a781495a DAGCombiner: Continue combining if FoldConstantArithmetic() fails.
DAG.FoldConstantArithmetic() can fail even though both operands are
Constants if OpaqueConstants are involved. Continue trying other combine
possibilities in tis case.

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

Somewhat related to PR21801 / rdar://19211454

llvm-svn: 237822
2015-05-20 18:54:02 +00:00
James Molloy 2b21a7cf36 Reapply r237539 with a fix for the Chromium build.
Make sure if we're truncating a constant that would then be sign extended
that the sign extension of the truncated constant is the same as the
original constant.

> Canonicalize min/max expressions correctly.
>
> This patch introduces a canonical form for min/max idioms where one operand
> is extended or truncated. This often happens when the other operand is a
> constant. For example:
>
> %1 = icmp slt i32 %a, i32 0
> %2 = sext i32 %a to i64
> %3 = select i1 %1, i64 %2, i64 0
>
> Would now be canonicalized into:
>
> %1 = icmp slt i32 %a, i32 0
> %2 = select i1 %1, i32 %a, i32 0
> %3 = sext i32 %2 to i64
>
> This builds upon a patch posted by David Majenemer
> (https://www.marc.info/?l=llvm-commits&m=143008038714141&w=2). That pass
> passively stopped instcombine from ruining canonical patterns. This
> patch additionally actively makes instcombine canonicalize too.
>
> Canonicalization of expressions involving a change in type from int->fp
> or fp->int are not yet implemented.

llvm-svn: 237821
2015-05-20 18:41:25 +00:00
Matthias Braun 6091208331 ARM: Fix comment and make it slightly more readable
llvm-svn: 237820
2015-05-20 18:40:06 +00:00
Reid Kleckner 868a6c3023 Revert some of "Silence some CMake 3.3 dev warnings in compiler-rt"
This reverts part of r237808.

The CMP0057 warnings came from an old development build of CMake that
nobody else has. We don't need the cruft.

llvm-svn: 237819
2015-05-20 18:39:59 +00:00
Ahmed Bougacha 71185aca7e [CodeGen] Check x86_64-arguments.c tests on AVX as well. NFC.
We used to only check the differing tests on AVX, but we might
as well check all of them.

llvm-svn: 237818
2015-05-20 18:39:16 +00:00
Zachary Turner c62733b0de Implement attach to process on Windows.
Differential Revision: http://reviews.llvm.org/D9801
Reviewed by: Adrian McCarthy

llvm-svn: 237817
2015-05-20 18:31:17 +00:00