platform/upstream/llvm.git
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

9 years agoFix a bunch of [-Werror,-Winconsistent-missing-override] errors.
Eric Christopher [Tue, 4 Nov 2014 03:13:17 +0000 (03:13 +0000)]
Fix a bunch of [-Werror,-Winconsistent-missing-override] errors.

llvm-svn: 221231

9 years agoRemove virtual from a member function that's not overridden.
Rui Ueyama [Tue, 4 Nov 2014 02:40:55 +0000 (02:40 +0000)]
Remove virtual from a member function that's not overridden.

llvm-svn: 221230

9 years agoAfter we've completed a full backtrace, we'll have one frame which
Jason Molenda [Tue, 4 Nov 2014 02:31:50 +0000 (02:31 +0000)]
After we've completed a full backtrace, we'll have one frame which
is "invalid" -- it is past the end of the stack trace.  Add a new
method IsCompletedStackWalk() so we can tell if an invalid stack
frame is from a complete backtrace or if it might be worth re-trying
the last unwind with a different method.

This fixes the unwinder problems Ryan Brown was having with go
programs.  The unwinder can (under the right circumstances) still
destructively replace unwind plans permanently - I'll work on
that in a different patch.

<rdar://problem/18683658>

llvm-svn: 221229

9 years agoR600/LLVMBuild.txt: Add TransformUtils.
NAKAMURA Takumi [Tue, 4 Nov 2014 02:16:53 +0000 (02:16 +0000)]
R600/LLVMBuild.txt: Add TransformUtils.

llvm-svn: 221228

9 years agoDocs: give binutils/gold instructions for CMake too.
Tim Northover [Tue, 4 Nov 2014 02:16:03 +0000 (02:16 +0000)]
Docs: give binutils/gold instructions for CMake too.

Patch by Steve King.

llvm-svn: 221227

9 years agoRevert "Transforms: reapply SVN r219899"
Reid Kleckner [Tue, 4 Nov 2014 02:02:14 +0000 (02:02 +0000)]
Revert "Transforms: reapply SVN r219899"

This reverts commit r220811 and r220839. It made an incorrect change to
musttail handling.

llvm-svn: 221226

9 years ago[TSan] Don't strip binary/library name until the moment we print it.
Alexey Samsonov [Tue, 4 Nov 2014 01:55:20 +0000 (01:55 +0000)]
[TSan] Don't strip binary/library name until the moment we print it.

This commit changes the place where TSan runtime turns full path
to binary or shared library into its basename
(/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible
(when we obtained the full path from the symbolizer), we now do it as
late as possible (right before printing the error report).

This seems like a right thing to do - stripping to basename is a detail
of report formatting implementation, and should belong there. Also, we
might need the full path at some point - for example, to match the
suppressions.

llvm-svn: 221225

9 years agoAdd test for type properties of std::reference_wrapper
Eric Fiselier [Tue, 4 Nov 2014 01:54:44 +0000 (01:54 +0000)]
Add test for type properties of std::reference_wrapper

llvm-svn: 221224

9 years agoRemove setPreservesCFG from instcombine. The pass, in particular, does not
Mark Heffernan [Tue, 4 Nov 2014 01:51:01 +0000 (01:51 +0000)]
Remove setPreservesCFG from instcombine.  The pass, in particular, does not
preserve LoopSimplify because instcombine may replace branch predicates
with undef which loop simplify then replaces with always exit.  Replace
setPreservesCFG with the more constrained preservation of DomTree and
LoopInfo.

llvm-svn: 221223

9 years ago[llvm-api-change] Use findProgramByName.
Michael J. Spencer [Tue, 4 Nov 2014 01:30:55 +0000 (01:30 +0000)]
[llvm-api-change] Use findProgramByName.

llvm-svn: 221222

9 years agoUse findProgramByName.
Michael J. Spencer [Tue, 4 Nov 2014 01:29:59 +0000 (01:29 +0000)]
Use findProgramByName.

llvm-svn: 221221

9 years ago[Support][Program] Add findProgramByName(Name, OptionalPaths)
Michael J. Spencer [Tue, 4 Nov 2014 01:29:29 +0000 (01:29 +0000)]
[Support][Program] Add findProgramByName(Name, OptionalPaths)

llvm-svn: 221220

9 years agoUse the LLVM_GNUC_PREREQ macro instead of the longhand version check
Reid Kleckner [Tue, 4 Nov 2014 01:28:33 +0000 (01:28 +0000)]
Use the LLVM_GNUC_PREREQ macro instead of the longhand version check

llvm-svn: 221219

9 years agoRemove the END_WITH_NULL macro now that Clang doesn't use it
Reid Kleckner [Tue, 4 Nov 2014 01:15:53 +0000 (01:15 +0000)]
Remove the END_WITH_NULL macro now that Clang doesn't use it

llvm-svn: 221218

9 years agoUse the new LLVM_END_WITH_NULL name
Reid Kleckner [Tue, 4 Nov 2014 01:13:43 +0000 (01:13 +0000)]
Use the new LLVM_END_WITH_NULL name

llvm-svn: 221217

9 years agoRemove the static version of getScatteredRelocationType() now that r221211 added
Kevin Enderby [Tue, 4 Nov 2014 01:12:39 +0000 (01:12 +0000)]
Remove the static version of getScatteredRelocationType() now that r221211 added
a public version MachOObjectFile::getScatteredRelocationType().

This should fix the build bot for the unused function error.

llvm-svn: 221216

9 years agoRename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.h
Reid Kleckner [Tue, 4 Nov 2014 01:12:21 +0000 (01:12 +0000)]
Rename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.h

We shouldn't put this kind of attribute stuff in DataTypes.h.

Leave the END_WITH_NULL name for now so I can update clang without
making build spam.

llvm-svn: 221215

9 years agoThe patchpoint lowering logic would crash with live constants equal to
Sanjoy Das [Tue, 4 Nov 2014 00:59:21 +0000 (00:59 +0000)]
The patchpoint lowering logic would crash with live constants equal to
the tombstone or empty keys of a DenseMap<int64_t, T>.  This patch
fixes the issue (and adds a tests case).

llvm-svn: 221214

9 years agoFixed SBTarget::ReadMemory() to work correctly and the TestTargetAPI.py test case...
Greg Clayton [Tue, 4 Nov 2014 00:56:30 +0000 (00:56 +0000)]
Fixed SBTarget::ReadMemory() to work correctly and the TestTargetAPI.py test case that was reading target memory in TargetAPITestCase.test_read_memory_with_dsym and TargetAPITestCase.test_read_memory_with_dwarf.

The problem was that SBTarget::ReadMemory() was making a new section offset lldb_private::Address by doing:

size_t
SBTarget::ReadMemory (const SBAddress addr,
                      void *buf,
                      size_t size,
                      lldb::SBError &error)
{
        ...
        lldb_private::Address addr_priv(addr.GetFileAddress(), NULL);
        bytes_read = target_sp->ReadMemory(addr_priv, false, buf, size, err_priv);

This is wrong. If you get the file addresss from the "addr" argument and try to read memory using that, it will think the file address is a load address and it will try to resolve it accordingly. This will work fine if your executable is loaded at the same address (no slide), but it won't work if there is a slide.

The fix is to just pass along the "addr.ref()" instead of making a new addr_priv as this will pass along the lldb_private::Address that is inside the SBAddress (which is what we want), and not always change it into something that becomes a load address (if we are running), or abmigious file address (think address zero when you have 150 shared libraries that have sections that start at zero, which one would you pick). The main reason for passing a section offset address to SBTarget::ReadMemory() is so you _can_ read from the actual section + offset that is specified in the SBAddress.

llvm-svn: 221213

9 years agoPECOFF: Use the string table for long section names in EXEs/DLLs
David Majnemer [Tue, 4 Nov 2014 00:53:57 +0000 (00:53 +0000)]
PECOFF: Use the string table for long section names in EXEs/DLLs

Normally, PE files have section names of eight characters or less.
However, this is problematic for DWARF because DWARF section names are
things like .debug_aranges.

Instead of truncating the section name, redirect the section name into
the string table.

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

llvm-svn: 221212

9 years agoAdd the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O symbolizer.
Kevin Enderby [Tue, 4 Nov 2014 00:43:16 +0000 (00:43 +0000)]
Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O symbolizer.

llvm-svn: 221211

9 years ago[Hexagon] Reverting 220584 to address ASAN errors.
Colin LeMahieu [Tue, 4 Nov 2014 00:14:36 +0000 (00:14 +0000)]
[Hexagon] Reverting 220584 to address ASAN errors.

llvm-svn: 221210

9 years agoChange logic in StackMaps::recordStackMapOpers to use the isInt<32>
Sanjoy Das [Tue, 4 Nov 2014 00:06:57 +0000 (00:06 +0000)]
Change logic in StackMaps::recordStackMapOpers to use the isInt<32>
predicate instead of bitwise operations.

This is not a functional change.

llvm-svn: 221209

9 years agoAdded a test case for reading ivars from the
Sean Callanan [Tue, 4 Nov 2014 00:06:34 +0000 (00:06 +0000)]
Added a test case for reading ivars from the
Objective-C runtime.  We'll need to do more
(subclasses, partially-defined classes, etc.)
but this tests that at least the basics work.

llvm-svn: 221208

9 years agoImplement a framework for live debugging on Windows.
Zachary Turner [Tue, 4 Nov 2014 00:00:12 +0000 (00:00 +0000)]
Implement a framework for live debugging on Windows.

When processes are launched for debugging on Windows now, LLDB
will detect changes such as DLL loads and unloads, breakpoints,
thread creation and deletion, etc.

These notifications are not yet propagated to LLDB in a way that
LLDB understands what is happening with the process.  This only
picks up the notifications from the OS in a way that they can be
sent to LLDB with subsequent patches.

Reviewed by: Scott Graham

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

llvm-svn: 221207

9 years agoLower __builtin_fabs* to @llvm.fabs.*
Reid Kleckner [Mon, 3 Nov 2014 23:52:09 +0000 (23:52 +0000)]
Lower __builtin_fabs* to @llvm.fabs.*

mingw64's headers implement fabs by calling __builtin_fabs, so using the
library call results in an infinite loop. If the backend legalizes
@llvm.fabs as a call to fabs later, things should work out, as the crt
provides a definition.

llvm-svn: 221206

9 years agoRemove dead AST type argument to EmitFAbs
Reid Kleckner [Mon, 3 Nov 2014 23:51:40 +0000 (23:51 +0000)]
Remove dead AST type argument to EmitFAbs

llvm-svn: 221205

9 years agoRename variables to conform to llvm coding standards.
Akira Hatanaka [Mon, 3 Nov 2014 23:24:10 +0000 (23:24 +0000)]
Rename variables to conform to llvm coding standards.

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

llvm-svn: 221204

9 years agoUse AA in LoadCombine
Hal Finkel [Mon, 3 Nov 2014 23:19:16 +0000 (23:19 +0000)]
Use AA in LoadCombine

LoadCombine can be smarter about aborting when a writing instruction is
encountered, instead of aborting upon encountering any writing instruction, use
an AliasSetTracker, and only abort when encountering some write that might
alias with the loads that could potentially be combined.

This was originally motivated by comments made (and a test case provided) by
David Majnemer in response to PR21448. It turned out that LoadCombine was not
responsible for that PR, but LoadCombine should also be improved so that
unrelated stores (and @llvm.assume) don't interrupt load combining.

llvm-svn: 221203

9 years agoUse common range handling for the CU's ranges
David Blaikie [Mon, 3 Nov 2014 23:10:59 +0000 (23:10 +0000)]
Use common range handling for the CU's ranges

This generalizes the range handling for ranges in both the skeleton and
full unit, laying the foundation for the addition of more ranges (rather
than just the CU's special case) in the skeleton CU with fission+gmlt.

llvm-svn: 221202