platform/upstream/llvm.git
9 years agollvm/test/Transforms/GCOVProfiling: Avoid to parse backslashes in MDString. Use ...
NAKAMURA Takumi [Wed, 5 Nov 2014 06:29:05 +0000 (06:29 +0000)]
llvm/test/Transforms/GCOVProfiling: Avoid to parse backslashes in MDString. Use %/T instead of %T.

LLVM Parser decodes "\bb" as hex in "C:\bb-win7\buildername\build...", with MDString.

See also, http://llvm.org/docs/LangRef.html#metadata-nodes-and-metadata-strings

This reverts r221270, "Disable 3 tests in llvm/test/Transforms/GCOVProfiling/ for now. Investigating."

FIXME: Please check EC in GCOVProfiler::emitProfileNotes().
llvm-svn: 221334

9 years agollvm-readobj: Add support for dumping the DOS header in PE files
David Majnemer [Wed, 5 Nov 2014 06:24:35 +0000 (06:24 +0000)]
llvm-readobj: Add support for dumping the DOS header in PE files

llvm-svn: 221333

9 years agoMark darwin-debug-flags.c as REQUIRES:shell, due to quoting issue.
NAKAMURA Takumi [Wed, 5 Nov 2014 05:04:00 +0000 (05:04 +0000)]
Mark darwin-debug-flags.c as REQUIRES:shell, due to quoting issue.

llvm-svn: 221332

9 years agoRevert 220932.
Jiangning Liu [Wed, 5 Nov 2014 04:44:31 +0000 (04:44 +0000)]
Revert 220932.

Commit 220932 caused crash when building clang-tblgen on aarch64 debian target,
so it's blocking all daily tests.

The std::call_once implementation in pthread has bug for aarch64 debian.

llvm-svn: 221331

9 years agoclang-format: Make it possible to (require 'clang-format)
Justin Bogner [Wed, 5 Nov 2014 04:32:54 +0000 (04:32 +0000)]
clang-format: Make it possible to (require 'clang-format)

This makes the emacs integration ``provide`` a clang-format feature,
so that a .emacs can ``require`` it.

llvm-svn: 221330

9 years ago[PECOFF] Do not skip COMDAT section symbols.
Rui Ueyama [Wed, 5 Nov 2014 02:21:39 +0000 (02:21 +0000)]
[PECOFF] Do not skip COMDAT section symbols.

LLD skipped COMDAT section symbols when reading them because
I thought we don't want to have symbols with the same name.
But they are actually needed because relocations may refer to
the section symbols. So we shoulnd't skip them.

llvm-svn: 221329

9 years agoIR: Metadata: Remove unnecessary dyn_cast
Duncan P. N. Exon Smith [Wed, 5 Nov 2014 01:55:06 +0000 (01:55 +0000)]
IR: Metadata: Remove unnecessary dyn_cast

llvm-svn: 221328

9 years agoFix broken C++ mode comment
Matt Arsenault [Wed, 5 Nov 2014 01:36:22 +0000 (01:36 +0000)]
Fix broken C++ mode comment

llvm-svn: 221327

9 years agoDebug info: Emit the correct type for the __FuncPtr field in a block
Adrian Prantl [Wed, 5 Nov 2014 01:01:30 +0000 (01:01 +0000)]
Debug info: Emit the correct type for the __FuncPtr field in a block
descriptor.

rdar://problem/15984431

llvm-svn: 221326

9 years agoInstSimplify: Exact shifts of X by Y are X if X has the lsb set
David Majnemer [Wed, 5 Nov 2014 00:59:59 +0000 (00:59 +0000)]
InstSimplify: Exact shifts of X by Y are X if X has the lsb set

Exact shifts may not shift out any non-zero bits. Use computeKnownBits
to determine when this occurs and just return the left hand side.

This fixes PR21477.

llvm-svn: 221325

9 years agofor Oleksiy Vyalov - Redirect stdin, stdout and stderr to /dev/null when launching...
Shawn Best [Wed, 5 Nov 2014 00:58:55 +0000 (00:58 +0000)]
for Oleksiy Vyalov - Redirect stdin, stdout and stderr to /dev/null when launching LLGS process. Differential Revision: reviews.llvm.org/D6105

llvm-svn: 221324

9 years agoAdd a check for misbehaving -Wcomment from gcc-4.7 and add
Eric Christopher [Wed, 5 Nov 2014 00:35:15 +0000 (00:35 +0000)]
Add a check for misbehaving -Wcomment from gcc-4.7 and add
-Wno-comment to the compilation flags if so.

Patch by Filipe Cabecinhas, configure regenerated by me.

llvm-svn: 221323

9 years agoRename some classes in ProcessWindows.
Zachary Turner [Wed, 5 Nov 2014 00:33:28 +0000 (00:33 +0000)]
Rename some classes in ProcessWindows.

Renamed monitor -> driver, to make clear that the implementation here
is in no way related to that of other process plugins which have also
implemented classes with similar names such as DebugMonitor.

Also created a DebugEventHandler interface, which will be used by
implementors to get notified when debugging events happen in the
inferiors.

llvm-svn: 221322

9 years agoARM: try to add extra CS-register whenever stack alignment >= 8.
Tim Northover [Wed, 5 Nov 2014 00:27:20 +0000 (00:27 +0000)]
ARM: try to add extra CS-register whenever stack alignment >= 8.

We currently try to push an even number of registers to preserve 8-byte
alignment during a function's prologue, but only when the stack alignment is
prcisely 8. Many of the reasons for doing it apply also when that alignment > 8
(the extra store is often free, and can save another stack adjustment, though
less frequently for 16-byte stack alignment).

llvm-svn: 221321

9 years agoARM/Dwarf: correctly align stack before callee-saved VPRs
Tim Northover [Wed, 5 Nov 2014 00:27:13 +0000 (00:27 +0000)]
ARM/Dwarf: correctly align stack before callee-saved VPRs

We were making an attempt to do this by adding an extra callee-saved GPR (so
that there was an even number in the list), but when that failed we went ahead
and pushed anyway.

This had a couple of potential issues:
  + The .cfi directives we emit misplaced dN because they were based on
    PrologEpilogInserter's calculation.
  + Unaligned stores can be less efficient.
  + Unaligned stores can actually fault (likely only an issue in niche cases,
    but possible).

This adds a final explicit stack adjustment if all other options fail, so that
the actual locations of the registers match up with where they should be.

llvm-svn: 221320

9 years agoFilter out non-static class members when correcting non-member-references.
Kaelyn Takata [Wed, 5 Nov 2014 00:09:29 +0000 (00:09 +0000)]
Filter out non-static class members when correcting non-member-references.

llvm-svn: 221319

9 years agoAnalysis: Make isSafeToSpeculativelyExecute fire less for divides
David Majnemer [Tue, 4 Nov 2014 23:49:08 +0000 (23:49 +0000)]
Analysis: Make isSafeToSpeculativelyExecute fire less for divides

Divides and remainder operations do not behave like other operations
when they are given poison: they turn into undefined behavior.

It's really hard to know if the operands going into a div are or are not
poison.  Because of this, we should only choose to speculate if there
are constant operands which we can easily reason about.

This fixes PR21412.

llvm-svn: 221318

9 years agoRevert "[Reassociate] Canonicalize negative constants out of expressions."
Reid Kleckner [Tue, 4 Nov 2014 23:42:45 +0000 (23:42 +0000)]
Revert "[Reassociate] Canonicalize negative constants out of expressions."

This reverts commit r221171.

It performs this invalid transformation:
-  %div.i = urem i64 -1, %add
-  %sub.i = sub i64 -2, %div.i
+  %div.i = urem i64 1, %add
+  %sub.i1 = add i64 %div.i, -2

llvm-svn: 221317

9 years agoFix the test failure on Windows introduced by r221279.
Kuba Brecka [Tue, 4 Nov 2014 23:38:57 +0000 (23:38 +0000)]
Fix the test failure on Windows introduced by r221279.

http://reviews.llvm.org/D6018

llvm-svn: 221316

9 years agoAvoid building lldb-mi when --enable-werror is set
Eric Christopher [Tue, 4 Nov 2014 23:30:30 +0000 (23:30 +0000)]
Avoid building lldb-mi when --enable-werror is set
as it doesn't build and is optional.

llvm-svn: 221315

9 years agoUse LLVMLIBS here since these are produced by the
Eric Christopher [Tue, 4 Nov 2014 23:27:52 +0000 (23:27 +0000)]
Use LLVMLIBS here since these are produced by the
llvm build and not supposed to be resident on
the system.

llvm-svn: 221314

9 years ago[X86][SSE] Enable commutation for SSE immediate blend instructions
Simon Pilgrim [Tue, 4 Nov 2014 23:25:08 +0000 (23:25 +0000)]
[X86][SSE] Enable commutation for SSE immediate blend instructions

Patch to allow (v)blendps, (v)blendpd, (v)pblendw and vpblendd instructions to be commuted - swaps the src registers and inverts the blend mask.

This is primarily to improve memory folding (see new tests), but it also improves the quality of shuffles (see modified tests).

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

llvm-svn: 221313

9 years agoFix an [-Werror,-Winconsistent-missing-override] error.
Eric Christopher [Tue, 4 Nov 2014 23:21:07 +0000 (23:21 +0000)]
Fix an [-Werror,-Winconsistent-missing-override] error.

llvm-svn: 221312

9 years agoRevert earlier change removing setPreservesCFG from instcombine (r221223) and
Mark Heffernan [Tue, 4 Nov 2014 23:02:09 +0000 (23:02 +0000)]
Revert earlier change removing setPreservesCFG from instcombine (r221223) and
change LoopSimplifyPass to be !isCFGOnly.  The motivation for the earlier patch
(r221223) was that LoopSimplify is not preserved by instcombine though
setPreservesCFG indicates that it is.  This change fixes the issue
by making setPreservesCFG no longer imply LoopSimplifyPass, and is therefore less
invasive.

llvm-svn: 221311

9 years agofor Siva Chandra: Fix compilation of StringPrinter.cpp with GCC. Differential Revisio...
Shawn Best [Tue, 4 Nov 2014 22:43:34 +0000 (22:43 +0000)]
for Siva Chandra: Fix compilation of StringPrinter.cpp with GCC. Differential Revision:  reviews.llvm.org/D6122

llvm-svn: 221310

9 years agoUse backslashes to escape spaces and other backslashes in -dwarf-debug-flags.
Bob Wilson [Tue, 4 Nov 2014 22:28:48 +0000 (22:28 +0000)]
Use backslashes to escape spaces and other backslashes in -dwarf-debug-flags.

The command line options are specified in a space-separated list that is an
argument to -dwarf-debug-flags, so that breaks if there are spaces in the
options. This feature came from Apple's internal version of GCC, so I went back
to check how llvm-gcc handled this and matched that behavior.
rdar://problem/18775420

llvm-svn: 221309

9 years ago[AArch64] Use the correct register class for ORR.
Juergen Ributzka [Tue, 4 Nov 2014 22:20:07 +0000 (22:20 +0000)]
[AArch64] Use the correct register class for ORR.

While fixing up the register classes in the machine combiner in a previous
commit I missed one.

This fixes the last one and adds a test case.

llvm-svn: 221308

9 years agoRevert "[mips] Add names and tests for the hardware registers"
Rafael Espindola [Tue, 4 Nov 2014 22:15:05 +0000 (22:15 +0000)]
Revert "[mips] Add names and tests for the hardware registers"

This reverts commit r221299.

The tests

    LLVM :: MC/Disassembler/Mips/mips32.txt
    LLVM :: MC/Disassembler/Mips/mips32_le.txt

were failing.

llvm-svn: 221307

9 years agoProvide gmlt-like inline scope information in the skeleton CU to facilitate symbolica...
David Blaikie [Tue, 4 Nov 2014 22:12:25 +0000 (22:12 +0000)]
Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files

Clang -gsplit-dwarf self-host -O0, binary increases by 0.0005%, -O2,
binary increases by 25%.

A large binary inside Google, split-dwarf, -O0, and other internal flags
(GDB index, etc) increases by 1.8%, optimized build is 35%.

The size impact may be somewhat greater in .o files (I haven't measured
that much - since the linked executable -O0 numbers seemed low enough)
due to relocations. These relocations could be removed if we taught the
llvm-symbolizer to handle indexed addressing in the .o file (GDB can't
cope with this just yet, but GDB won't be reading this info anyway).
Also debug_ranges could be shared between .o and .dwo, though ideally
debug_ranges would get a schema that could used index(+offset)
addressing, and move to the .dwo file, then we'd be back to sharing
addresses in the address pool again.

But for now, these sizes seem small enough to go ahead with this.

Verified that no other DW_TAGs are produced into the .o file other than
subprograms and inlined_subroutines.

llvm-svn: 221306

9 years agoMove cross-unit DIE caching to the DwarfFile level, so it doesn't interfere with...
David Blaikie [Tue, 4 Nov 2014 22:12:18 +0000 (22:12 +0000)]
Move cross-unit DIE caching to the DwarfFile level, so it doesn't interfere with fission-gmlt data and produce skeleton<>full unit cross referencing.

llvm-svn: 221305

9 years agoDon't produce relocations for a difference in a section with no symbols.
Rafael Espindola [Tue, 4 Nov 2014 22:10:33 +0000 (22:10 +0000)]
Don't produce relocations for a difference in a section with no symbols.

We were producing a relocation for
----------------
.section foo,bar
La:
Lb:
 .long   La-Lb
--------------

but not for

---------------------
  .section foo,bar
zed:
La:
Lb:
 .long   La-Lb
----------------

This patch handles the case where both fragments are part of the first atom
in a section and there is no corresponding symbol to that atom.

This fixes pr21328.

llvm-svn: 221304

9 years ago[PECOFF] Fix symbols in module-definition file.
Rui Ueyama [Tue, 4 Nov 2014 22:09:13 +0000 (22:09 +0000)]
[PECOFF] Fix symbols in module-definition file.

llvm-svn: 221303

9 years ago[TSan] Refactor/simplify ReportLocation structure.
Alexey Samsonov [Tue, 4 Nov 2014 22:07:57 +0000 (22:07 +0000)]
[TSan] Refactor/simplify ReportLocation structure.

  # Make DataInfo (describing a global) a member of ReportLocation
    to avoid unnecessary copies and allocations.
  # Introduce a constructor and a factory method, so that
    all structure users don't have to go to internal allocator directly.
  # Remove unused fields (file/line).

No functionality change.

llvm-svn: 221302

9 years ago[mach-o] remove __compact_unwind atoms once __unwind_info has been generated
Tim Northover [Tue, 4 Nov 2014 21:57:32 +0000 (21:57 +0000)]
[mach-o] remove __compact_unwind atoms once __unwind_info has been generated

The job of the CompactUnwind pass is to turn __compact_unwind data (and
__eh_frame) into the compressed final form in __unwind_info. After it's done,
the original atoms are no longer relevant and should be deleted (they cause
problems during actual execution, quite apart from the fact that they're not
needed).

llvm-svn: 221301

9 years ago[mips] Move COP2 & COP3 load/store instructions from MipsInstrFPU.td to MipsInstrInfo...
Vasileios Kalintiris [Tue, 4 Nov 2014 21:45:16 +0000 (21:45 +0000)]
[mips] Move COP2 & COP3 load/store instructions from MipsInstrFPU.td to MipsInstrInfo.td. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 221300

9 years ago[mips] Add names and tests for the hardware registers
Vasileios Kalintiris [Tue, 4 Nov 2014 21:30:44 +0000 (21:30 +0000)]
[mips] Add names and tests for the hardware registers

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 221299

9 years agoFix a problem where ValueObjectVariable was not correctly setting its 'has value...
Enrico Granata [Tue, 4 Nov 2014 21:28:50 +0000 (21:28 +0000)]
Fix a problem where ValueObjectVariable was not correctly setting its 'has value changed' flag for scalar valued variables. This fixes rdar://17851144

llvm-svn: 221298

9 years agoCorrect the usage of DataInfo structure in TSan
Alexey Samsonov [Tue, 4 Nov 2014 21:26:56 +0000 (21:26 +0000)]
Correct the usage of DataInfo structure in TSan

llvm-svn: 221297

9 years ago[X86] Add 'FeatureSlowSHLD' to cpu 'bdver3'. Also explicit set FeatureAVX and Feature...
Andrea Di Biagio [Tue, 4 Nov 2014 21:18:09 +0000 (21:18 +0000)]
[X86] Add 'FeatureSlowSHLD' to cpu 'bdver3'. Also explicit set FeatureAVX and FeatureSSE4A for all the bdver* cpus.

This patch adds 'FeatureSlowSHLD' to 'bdver3'.
According to the official AMD optimization guide for amdfam15: "Using
alternative code in place of SHLD achieves lower overall latency and
requires fewer execution resources. The 32-bit and 64-bit forms of
ADD, ADC, SHR, and LEA (except 16-bit form) are DirectPath
instructions, while SHLD is a VectorPath instruction."

This patch also explicitly sets feature AVX and SSE4A for all the bdver*
cpus. This part of the patch is a non-functional change and it is mainly
done for clarity reasons (Both XOP and FMA4 already imply AVX and SSE4A).

llvm-svn: 221296

9 years agoErrorOr: Be more explicit in the implicit conversion to bool docs
Justin Bogner [Tue, 4 Nov 2014 21:01:48 +0000 (21:01 +0000)]
ErrorOr: Be more explicit in the implicit conversion to bool docs

llvm-svn: 221295

9 years ago[TSan] Make ReportStack contain __sanitizer::AddressInfo object.
Alexey Samsonov [Tue, 4 Nov 2014 20:52:37 +0000 (20:52 +0000)]
[TSan] Make ReportStack contain __sanitizer::AddressInfo object.

AddressInfo contains the results of symbolization. Store this object
directly in the symbolized stack, instead of copying data around and
making unnecessary memory allocations.

No functionality change.

llvm-svn: 221294

9 years ago[PBQP] Callee saved regs should have a higher cost than scratch regs
Arnaud A. de Grandmaison [Tue, 4 Nov 2014 20:51:29 +0000 (20:51 +0000)]
[PBQP] Callee saved regs should have a higher cost than scratch regs

Registers are not all equal. Some are not allocatable (infinite cost),
some have to be preserved but can be used, and some others are just free
to use.

Ensure there is a cost hierarchy reflecting this fact, so that the
allocator will favor scratch registers over callee-saved registers.

llvm-svn: 221293

9 years ago[PBQP] Tweak spill costs and coalescing benefits
Arnaud A. de Grandmaison [Tue, 4 Nov 2014 20:51:24 +0000 (20:51 +0000)]
[PBQP] Tweak spill costs and coalescing benefits

This patch improves how the different costs (register, interference, spill
and coalescing) relates together. The assumption is now that:
 - coalescing (or any other "side effect" of reg alloc) is negative, and
   instead of being derived from a spill cost, they use the block
   frequency info.
 - spill costs are in the [MinSpillCost:+inf( range
 - register or interference costs are in [0.0:MinSpillCost( or +inf

The current MinSpillCost is set to 10.0, which is a random value high
enough that the current constraint builders do not need to worry about
when settings costs. It would however be worth adding a normalization
step for register and interference costs as the last step in the
constraint builder chain to ensure they are not greater than SpillMinCost
(unless this has some sense for some architectures). This would work well
with the current builder pipeline, where all costs are tweaked relatively
to each others, but could grow above MinSpillCost if the pipeline is
deep enough.

The current heuristic is tuned to depend rather on the number of uses of
a live interval rather than a density of uses, as used by the greedy
allocator. This heuristic provides a few percent improvement on a number
of benchmarks (eembc, spec, ...) and will definitely need to change once
spill placement is implemented: the current spill placement is really
ineficient, so making the cost proportionnal to the number of use is a
clear win.

llvm-svn: 221292

9 years agoR600/SI: Rename div_scale dest operands to match documentation
Matt Arsenault [Tue, 4 Nov 2014 20:29:20 +0000 (20:29 +0000)]
R600/SI: Rename div_scale dest operands to match documentation

llvm-svn: 221291

9 years agoMake helper function static. NFC.
Benjamin Kramer [Tue, 4 Nov 2014 20:26:01 +0000 (20:26 +0000)]
Make helper function static. NFC.

llvm-svn: 221290

9 years agoAArch64: Pattern match integer vector abs like we do on ARM.
Benjamin Kramer [Tue, 4 Nov 2014 20:10:06 +0000 (20:10 +0000)]
AArch64: Pattern match integer vector abs like we do on ARM.

This kind of pattern is emitted by the loop vectorizer.

llvm-svn: 221289

9 years ago[asan] [mips] changed ShadowOffset32 for systems having 16kb PageSize; patch by Kumar...
Kostya Serebryany [Tue, 4 Nov 2014 19:46:15 +0000 (19:46 +0000)]
[asan] [mips] changed ShadowOffset32 for systems having 16kb PageSize; patch by Kumar Sukhani

llvm-svn: 221288

9 years ago[Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.
Alexey Samsonov [Tue, 4 Nov 2014 19:34:29 +0000 (19:34 +0000)]
[Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.

llvm-svn: 221287

9 years agoFix the build for LLVM changes
Enrico Granata [Tue, 4 Nov 2014 19:33:45 +0000 (19:33 +0000)]
Fix the build for LLVM changes

llvm-svn: 221286

9 years agoSince the file has both ppc and ppc64 tests in it rename it.
Roman Divacky [Tue, 4 Nov 2014 18:49:15 +0000 (18:49 +0000)]
Since the file has both ppc and ppc64 tests in it rename it.

llvm-svn: 221285

9 years agoRewrite the test to not require asserts.
Roman Divacky [Tue, 4 Nov 2014 18:48:20 +0000 (18:48 +0000)]
Rewrite the test to not require asserts.

llvm-svn: 221284

9 years ago[TSan] Keep original function and filename in ReportStack.
Alexey Samsonov [Tue, 4 Nov 2014 18:41:38 +0000 (18:41 +0000)]
[TSan] Keep original function and filename in ReportStack.

TSan used to do the following transformations with data obtained
from the symbolizer:
1) Strip "__interceptor_" prefix from function name.
2) Use "strip_path_prefix" runtime flag to strip filepath.

Now these transformations are performed right before the stack trace
is printed, and ReportStack structure contains original information.

This seems like a right thing to do - stripping is a detail of report
formatting implementation, and should belong there. We should, for
example, use original path to source file when we apply suppressions.

This change also make "strip_path_prefix" flag behavior in TSan
consistent with all the other sanitizers - now it should actually
match *the prefix* of path, not some substring. E.g. earlier TSan
would turn "/usr/lib/libfoo.so" into "libfoo.so" even if strip_path_prefix
was "/lib/".

Finally, strings obtained from symbolizer come from internal allocator,
and "stripping" them early by incrementing a "char*" ensures they can
never be properly deallocated, which is a bug.

llvm-svn: 221283

9 years agoRemove unused DisableRedZone option.
Rafael Espindola [Tue, 4 Nov 2014 18:18:52 +0000 (18:18 +0000)]
Remove unused DisableRedZone option.

Patch by Steve King.

llvm-svn: 221282

9 years agoInstSimplify: Fold a hasNoSignedWrap() call into a match() expression
David Majnemer [Tue, 4 Nov 2014 17:47:13 +0000 (17:47 +0000)]
InstSimplify: Fold a hasNoSignedWrap() call into a match() expression

No functionality change intended, it's just a little more concise.

llvm-svn: 221281

9 years agoInstSimplify: Fold a hasNoUnsignedWrap() call into a match() expression
David Majnemer [Tue, 4 Nov 2014 17:38:50 +0000 (17:38 +0000)]
InstSimplify: Fold a hasNoUnsignedWrap() call into a match() expression

No functionality change intended, it's just a little more concise.

llvm-svn: 221280

9 years agoUse @rpath as LC_ID_DYLIB for ASan dylib on OS X
Kuba Brecka [Tue, 4 Nov 2014 17:35:17 +0000 (17:35 +0000)]
Use @rpath as LC_ID_DYLIB for ASan dylib on OS X

Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library.

Reviewed at http://reviews.llvm.org/D6018

llvm-svn: 221279

9 years agoUse @rpath as LC_ID_DYLIB for ASan dylib on OS X
Kuba Brecka [Tue, 4 Nov 2014 17:34:50 +0000 (17:34 +0000)]
Use @rpath as LC_ID_DYLIB for ASan dylib on OS X

Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library.

Reviewed at http://reviews.llvm.org/D6018

llvm-svn: 221278

9 years ago[mips] Improve support for the .set mips16/nomips16 assembler directives.
Toma Tabacu [Tue, 4 Nov 2014 17:18:07 +0000 (17:18 +0000)]
[mips] Improve support for the .set mips16/nomips16 assembler directives.

Summary:
Appropriately set/clear the FeatureBit for Mips16 when these assembler directives are used and also emit ".set nomips16" (previously, only ".set mips16" was being emitted).

These improvements allow for better testing of the .cpload/.cprestore assembler directives (which are not supposed to work when Mips16 is enabled).

Test Plan: The test is bare-bones because there are no MC tests for Mips16 instructions (there's only one, which checks that the Mips16 ELF header flag gets set), and that suggests to me that it has not been implemented yet in the IAS.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 221277

9 years ago[Stackmaps] Make test less fragile. NFC.
Juergen Ributzka [Tue, 4 Nov 2014 17:11:00 +0000 (17:11 +0000)]
[Stackmaps] Make test less fragile. NFC.

llvm-svn: 221276

9 years agoMark another test as UNSUPPORTED with ASAN and MSAN
Eric Fiselier [Tue, 4 Nov 2014 17:03:47 +0000 (17:03 +0000)]
Mark another test as UNSUPPORTED with ASAN and MSAN

llvm-svn: 221275

9 years agoremove function names from comments; NFC
Sanjay Patel [Tue, 4 Nov 2014 16:27:42 +0000 (16:27 +0000)]
remove function names from comments; NFC

llvm-svn: 221274

9 years agofix typo in comment
Sanjay Patel [Tue, 4 Nov 2014 16:09:50 +0000 (16:09 +0000)]
fix typo in comment

llvm-svn: 221273

9 years ago[clang-tidy] Don't print a message if there's no error.
Alexander Kornienko [Tue, 4 Nov 2014 15:25:22 +0000 (15:25 +0000)]
[clang-tidy] Don't print a message if there's no error.

llvm-svn: 221272

9 years agoRe-enable this test on Windows since it passes with GnuWin32 env.exe.
Yaron Keren [Tue, 4 Nov 2014 14:54:37 +0000 (14:54 +0000)]
Re-enable this test on Windows since it passes with GnuWin32 env.exe.

llvm-svn: 221271

9 years agoDisable 3 tests in llvm/test/Transforms/GCOVProfiling/ for now. Investigating.
NAKAMURA Takumi [Tue, 4 Nov 2014 14:41:53 +0000 (14:41 +0000)]
Disable 3 tests in llvm/test/Transforms/GCOVProfiling/ for now. Investigating.

llvm-svn: 221270

9 years agoRemove "REQUIRES:shell" from tests. They work for me.
NAKAMURA Takumi [Tue, 4 Nov 2014 13:41:33 +0000 (13:41 +0000)]
Remove "REQUIRES:shell" from tests. They work for me.

llvm-svn: 221269

9 years ago[yaml2obj] Allow yaml2obj tool to recognize EF_MIPS_NAN2008 flag
Simon Atanasyan [Tue, 4 Nov 2014 13:33:36 +0000 (13:33 +0000)]
[yaml2obj] Allow yaml2obj tool to recognize EF_MIPS_NAN2008 flag

llvm-svn: 221268

9 years agoclang/test/Tooling: Remove mention to PR15590 out of a couple of tests. They are...
NAKAMURA Takumi [Tue, 4 Nov 2014 13:32:29 +0000 (13:32 +0000)]
clang/test/Tooling: Remove mention to PR15590 out of a couple of tests. They are suppressed with another issue.

llvm-svn: 221267

9 years agoclang/test/Tooling: [PR15590] Avoid backslashes in JSON. Should work on win32.
NAKAMURA Takumi [Tue, 4 Nov 2014 13:32:17 +0000 (13:32 +0000)]
clang/test/Tooling: [PR15590] Avoid backslashes in JSON. Should work on win32.

llvm-svn: 221266

9 years agoRe-enable tests in llvm/test/Object, corresponding to line_iterator's
NAKAMURA Takumi [Tue, 4 Nov 2014 13:19:29 +0000 (13:19 +0000)]
Re-enable tests in llvm/test/Object, corresponding to line_iterator's
change in r221153.

llvm-svn: 221265

9 years agoclang/test/VFS/umbrella-mismatch.m: Let it work on win32 to avoid backslashes in...
NAKAMURA Takumi [Tue, 4 Nov 2014 13:05:23 +0000 (13:05 +0000)]
clang/test/VFS/umbrella-mismatch.m: Let it work on win32 to avoid backslashes in yaml.

FIXME: Is it intentional? s;OUT_DIR;%/S/Inputs;
llvm-svn: 221264

9 years agoclang/test/Coverage/html-diagnostics.c: Use find(1) to avoid globbing.
NAKAMURA Takumi [Tue, 4 Nov 2014 13:05:10 +0000 (13:05 +0000)]
clang/test/Coverage/html-diagnostics.c: Use find(1) to avoid globbing.

llvm-svn: 221263

9 years agollvm/test/Transforms/GCOVProfiling/linezero.ll: Use %/T instead of %T in regex. This...
NAKAMURA Takumi [Tue, 4 Nov 2014 13:00:48 +0000 (13:00 +0000)]
llvm/test/Transforms/GCOVProfiling/linezero.ll: Use %/T instead of %T in regex. This works on win32.

llvm-svn: 221262

9 years agoclang/test/Modules: Remove "REQUIRES:shell" since they work for me.
NAKAMURA Takumi [Tue, 4 Nov 2014 12:59:18 +0000 (12:59 +0000)]
clang/test/Modules: Remove "REQUIRES:shell" since they work for me.

llvm-svn: 221261

9 years agoUse findProgramByName. NFC.
Rafael Espindola [Tue, 4 Nov 2014 12:48:22 +0000 (12:48 +0000)]
Use findProgramByName. NFC.

llvm-svn: 221260

9 years agoclang-format: Use identifier table for keywords in other languages.
Daniel Jasper [Tue, 4 Nov 2014 12:41:02 +0000 (12:41 +0000)]
clang-format: Use identifier table for keywords in other languages.

Slightly easier to write, more efficient and prevents bugs by
misspelling them.

No functional changes intended.

llvm-svn: 221259

9 years agoRemove FindProgramByName. NFC.
Rafael Espindola [Tue, 4 Nov 2014 12:35:47 +0000 (12:35 +0000)]
Remove FindProgramByName. NFC.

llvm-svn: 221258

9 years agoUse llvm::sys::findProgramByName. NFC.
Rafael Espindola [Tue, 4 Nov 2014 12:34:32 +0000 (12:34 +0000)]
Use llvm::sys::findProgramByName. NFC.

llvm-svn: 221257

9 years agoclang-format: [Java] Fix class declaration line breaks.
Daniel Jasper [Tue, 4 Nov 2014 10:53:14 +0000 (10:53 +0000)]
clang-format: [Java] Fix class declaration line breaks.

Before:
  @SomeAnnotation()
  abstract
      class aaaaaaaaa<a> extends bbbbbbbbbbbb<b> implements cccccccccccc {
  }

After:
  @SomeAnnotation()
  abstract class aaaaaaaaa<a> extends bbbbbbbbbbbb<b>
      implements cccccccccccc {
  }

llvm-svn: 221256

9 years agoclang-format: Fix vim integration if g:clang_format_binary doesn't exist
Daniel Jasper [Tue, 4 Nov 2014 10:40:26 +0000 (10:40 +0000)]
clang-format: Fix vim integration if g:clang_format_binary doesn't exist

llvm-svn: 221254

9 years agoFix Visual C++ warning, Program.inc(85): warning C4018: '<' : signed/unsigned mismatch.
Yaron Keren [Tue, 4 Nov 2014 09:22:41 +0000 (09:22 +0000)]
Fix Visual C++ warning, Program.inc(85): warning C4018: '<' : signed/unsigned mismatch.

llvm-svn: 221252

9 years agoUse argument type directly from fflush if available in translation unit
Tobias Grosser [Tue, 4 Nov 2014 09:18:24 +0000 (09:18 +0000)]
Use argument type directly from fflush if available in translation unit

When our RuntimeDebugBuilder calles fflush(NULL) to flush all output streams, it
is important that the types we use in the call match the ones used in a
declaration of fflush possible already available in the translation unit.

As we just pass on a NULL pointer, the type of the pointer value does not really
matter. However, as LLVM complains in case of mismatched types, we make sure
to create a NULL pointer of identical type.

No test case, as RuntimeDebugBuilder is not permanently used in Polly. Calls to
it are until now only used to add informative output during debugging sessions.

llvm-svn: 221251

9 years agoAdd missing tests for build attribute encodings in object files.
Charlie Turner [Tue, 4 Nov 2014 09:07:40 +0000 (09:07 +0000)]
Add missing tests for build attribute encodings in object files.

test/MC/ARM/directive-eabi_attribute.s was missing several tests of object file
encodings relative to the existing tests for assembly file encodings. This
commit adds the missing tests.

Change-Id: Ie110ca02b65e8f4d4c77f437bd09d03607fa5c0d
llvm-svn: 221250

9 years agoDriver: Pass some std::strings by reference instead of value
David Majnemer [Tue, 4 Nov 2014 08:55:13 +0000 (08:55 +0000)]
Driver: Pass some std::strings by reference instead of value

No functional change intended. This fixes PR21463.

llvm-svn: 221249

9 years ago[clang-tidy] Move -extra-arg handling to CommonOptionsProvider
Alexander Kornienko [Tue, 4 Nov 2014 08:51:24 +0000 (08:51 +0000)]
[clang-tidy] Move -extra-arg handling to CommonOptionsProvider

Summary:
Handle -extra-arg and -extra-arg-before options in the
CommonOptionsProvider so they can be used in all clang tools. Adjust arguments
in a CompilationDatabase wrapper instead of adding ArgumentsAdjuster to the
tool.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 221248

9 years agollvm-objdump: Pass DiceTableEntry by reference
David Majnemer [Tue, 4 Nov 2014 08:41:48 +0000 (08:41 +0000)]
llvm-objdump: Pass DiceTableEntry by reference

DiceTableEntry is 24 bytes on my machine, it's probably better to pass
them by reference.

This fixes PR21464.

llvm-svn: 221247

9 years agosys::findProgramByName(): [Win32] Tweak to pass lowercase .exe to SearchPath() to...
NAKAMURA Takumi [Tue, 4 Nov 2014 08:17:15 +0000 (08:17 +0000)]
sys::findProgramByName(): [Win32] Tweak to pass lowercase .exe to SearchPath() to appease clang Driver's tests.

It seems SearchPath() doesn't show actual extension on the filesystem.

FIXME: Shall we use FindFirstFile() here?
llvm-svn: 221246

9 years agoCodeGen: Enable DWARF emission for MS ABI targets
David Majnemer [Tue, 4 Nov 2014 08:03:31 +0000 (08:03 +0000)]
CodeGen: Enable DWARF emission for MS ABI targets

This is experimental, just barely enough to get things to not
immediately combust.

A note for those who are curious:
Only lld can successfully link the object files, other linkers truncate
the section names making the debug sections illegible to debuggers.

Even with this in mind, we believe we are having trouble with SECREL
relocations.

llvm-svn: 221245

9 years ago#include <winbase.h> is not enough for Visual C++ 2013, it errors:
Yaron Keren [Tue, 4 Nov 2014 07:53:30 +0000 (07:53 +0000)]
#include <winbase.h> is not enough for Visual C++ 2013, it errors:

1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46):
error C2146: syntax error : missing ';' before identifier 'nLength'
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46):
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...

including <windows.h> is actually required.

llvm-svn: 221244

9 years agotest: Restore llvm-lit (at least for my machine)
David Majnemer [Tue, 4 Nov 2014 05:54:50 +0000 (05:54 +0000)]
test: Restore llvm-lit (at least for my machine)

r221137 feeds None into os.path.join which is not valid.

llvm-svn: 221242

9 years agoAdd recognition for another x86 epilogue sequence (ret followed by
Jason Molenda [Tue, 4 Nov 2014 05:48:11 +0000 (05:48 +0000)]
Add recognition for another x86 epilogue sequence (ret followed by
a nop).  Fixes an instruction stepping problem when trying to step
over the final instructions of an epilogue.
<rdar://problem/18068877>

llvm-svn: 221241

9 years agoActually mark the tests an unsupported with MSAN (not just ASAN)
Eric Fiselier [Tue, 4 Nov 2014 05:36:15 +0000 (05:36 +0000)]
Actually mark the tests an unsupported with MSAN (not just ASAN)

llvm-svn: 221240

9 years agoAdd one extra sanity check to RegisterContextLLDB::TryFallbackUnwindPlan
Jason Molenda [Tue, 4 Nov 2014 05:35:32 +0000 (05:35 +0000)]
Add one extra sanity check to RegisterContextLLDB::TryFallbackUnwindPlan
so it doesn't try the arch default if a comiler-generated (eh_frame,
compact unwind info) based unwind plan has failed.

llvm-svn: 221239

9 years agoBack out r221229 -- instead of trying to identify the end of the unwind,
Jason Molenda [Tue, 4 Nov 2014 05:28:40 +0000 (05:28 +0000)]
Back out r221229 -- instead of trying to identify the end of the unwind,
let's let lldb try the arch default unwind every time but not destructively --
it doesn't permanently replace the main unwind method for that function from
now on.

This fix is for <rdar://problem/18683658>.

I tested it against Ryan Brown's go program test case and also a
collection of core files of tricky unwind scenarios
<rdar://problem/15664282> <rdar://problem/15835846>
<rdar://problem/15982682> <rdar://problem/16099440>
<rdar://problem/17364005> <rdar://problem/18556719>
that I've fixed over the last 6-9 months.

llvm-svn: 221238

9 years agoMinimize test case further
David Majnemer [Tue, 4 Nov 2014 05:17:58 +0000 (05:17 +0000)]
Minimize test case further

No functional change intended.

llvm-svn: 221237

9 years agoMark tests that replace operator new/delete as UNSUPPORTED with ASAN and MSAN.
Eric Fiselier [Tue, 4 Nov 2014 05:11:41 +0000 (05:11 +0000)]
Mark tests that replace operator new/delete as UNSUPPORTED with ASAN and MSAN.

tests that replace operator new/delete won't link when using ASAN and MSAN
because these sanitizers also replace new/delete.

llvm-svn: 221236

9 years ago[ELF] Update TODO
Shankar Easwaran [Tue, 4 Nov 2014 04:50:58 +0000 (04:50 +0000)]
[ELF] Update TODO

llvm-svn: 221235

9 years ago[ELF] Fix MSVC buildbot.
Shankar Easwaran [Tue, 4 Nov 2014 04:25:00 +0000 (04:25 +0000)]
[ELF] Fix MSVC buildbot.

For some reason, MSVC doesnot like the style.

Checking to make sure this fixes the problem with the build.

llvm-svn: 221234

9 years ago[ELF] Fix program headers.
Shankar Easwaran [Tue, 4 Nov 2014 03:57:04 +0000 (03:57 +0000)]
[ELF] Fix program headers.

The ELF writer creates a invalid binary for few cases with large filesize and
memory size for segments. This patch addresses the functionality and updates the
test. This patch also cleans up parts of the ELF writer for future enhancements
to support Linker scripts.

llvm-svn: 221233

9 years agoFix one more [-Werror,-Winconsistent-missing-override] error.
Eric Christopher [Tue, 4 Nov 2014 03:14:57 +0000 (03:14 +0000)]
Fix one more [-Werror,-Winconsistent-missing-override] error.

llvm-svn: 221232