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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

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

llvm-svn: 221235

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

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

llvm-svn: 221221

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 years agoFix this test to set a breakpoint at the correct location that will always get hit...
Greg Clayton [Mon, 3 Nov 2014 23:10:56 +0000 (23:10 +0000)]
Fix this test to set a breakpoint at the correct location that will always get hit so it doesn't intermittently fail on MacOSX.

llvm-svn: 221201

10 years agoRemove local handling of ASAN_OPTIONS and UBSAN_OPTIONS.
Rafael Espindola [Mon, 3 Nov 2014 23:09:25 +0000 (23:09 +0000)]
Remove local handling of ASAN_OPTIONS and UBSAN_OPTIONS.

They are now forwarded by TestingConfig.py.

llvm-svn: 221200

10 years ago[AArch64] Make function processLogicalImmediate more efficient. NFC.
Akira Hatanaka [Mon, 3 Nov 2014 23:06:31 +0000 (23:06 +0000)]
[AArch64] Make function processLogicalImmediate more efficient. NFC.

llvm-svn: 221199

10 years agoHandle ASAN_OPTIONS and UBSAN_OPTIONS in TestingConfig.py
Rafael Espindola [Mon, 3 Nov 2014 23:04:56 +0000 (23:04 +0000)]
Handle ASAN_OPTIONS and UBSAN_OPTIONS in TestingConfig.py

Currently they are passed to tests of llvm itself, but not, for example, lld.

With this patch the options are visible in every test.

llvm-svn: 221198

10 years agoFixed a test suite error on MacOSX where people were using ".data" as the data sectio...
Greg Clayton [Mon, 3 Nov 2014 23:02:08 +0000 (23:02 +0000)]
Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).

llvm-svn: 221197

10 years agoFixed a test suite error on MacOSX where people were using ".data" as the data sectio...
Greg Clayton [Mon, 3 Nov 2014 22:58:38 +0000 (22:58 +0000)]
Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).

llvm-svn: 221196

10 years ago[TSan] Remove bogus unused global variables
Alexey Samsonov [Mon, 3 Nov 2014 22:46:13 +0000 (22:46 +0000)]
[TSan] Remove bogus unused global variables

llvm-svn: 221195

10 years ago[TSan] Use StackTrace from sanitizer_common where applicable
Alexey Samsonov [Mon, 3 Nov 2014 22:23:44 +0000 (22:23 +0000)]
[TSan] Use StackTrace from sanitizer_common where applicable

Summary:
This change removes `__tsan::StackTrace` class. There are
now three alternatives:
  # Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer
  of PCs. It is used in functions that need stack traces in read-only
  mode, and helps to prevent unnecessary allocations/copies (e.g.
  for StackTraces fetched from StackDepot).
  # `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in
  a constant array. It is used in TraceHeader (non-Go version)
  # `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically
  allocated via TSan internal allocator.

Test Plan: compiler-rt test suite

Reviewers: dvyukov, kcc

Reviewed By: kcc

Subscribers: llvm-commits, kcc

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

llvm-svn: 221194

10 years ago[TSan} Build Go version with -std=c++11
Alexey Samsonov [Mon, 3 Nov 2014 22:18:12 +0000 (22:18 +0000)]
[TSan} Build Go version with -std=c++11

llvm-svn: 221192

10 years agorefactor duplicated code. NFC.
Rafael Espindola [Mon, 3 Nov 2014 22:17:49 +0000 (22:17 +0000)]
refactor duplicated code. NFC.

llvm-svn: 221191

10 years ago[TSan] Fix signed-compare warning in the unit test
Alexey Samsonov [Mon, 3 Nov 2014 22:17:39 +0000 (22:17 +0000)]
[TSan] Fix signed-compare warning in the unit test

llvm-svn: 221190

10 years agoRevert "Temporary disable formatting error"
Tobias Grosser [Mon, 3 Nov 2014 22:11:20 +0000 (22:11 +0000)]
Revert "Temporary disable formatting error"

This reverts commit r221159, as clang-format is again back to its old behaviour
and we do not cause any buildbot error messages any more.

llvm-svn: 221189

10 years agoMove the no-prototype calling conv check after decl merging
Reid Kleckner [Mon, 3 Nov 2014 21:56:03 +0000 (21:56 +0000)]
Move the no-prototype calling conv check after decl merging

Now we don't warn on this code:
  void __stdcall f(void);
  void __stdcall f();

My previous commit regressed this functionality because I didn't update
the relevant test case which used a definition.

llvm-svn: 221188

10 years agoInstCombine: Remove infinite loop caused by FoldOpIntoPhi
David Majnemer [Mon, 3 Nov 2014 21:55:12 +0000 (21:55 +0000)]
InstCombine: Remove infinite loop caused by FoldOpIntoPhi

FoldOpIntoPhi could create an infinite loop if the PHI could potentially
reach a BB it was considering inserting instructions into.  The
instructions it would insert would eventually lead to other combines
firing which would, again, lead to FoldOpIntoPhi firing.

The solution is to handicap FoldOpIntoPhi so that it doesn't attempt to
insert instructions that the PHI might reach.

This fixes PR21377.

llvm-svn: 221187

10 years agoPush the CURangeList down into the skeleton CU (where available) rather than the...
David Blaikie [Mon, 3 Nov 2014 21:52:56 +0000 (21:52 +0000)]
Push the CURangeList down into the skeleton CU (where available) rather than the full CU

So that it may be shared between skeleton/full compile unit, for CU
ranges and other ranges to be added for fission+gmlt.

(at some point we might want some kind of object shared between the
skeleton and full compile units for all those things we only want one of
in that scope, rather than having the full unit always look through to
the skeleton... - alternatively, we might be able to have the skeleton
pointer (or another, separate pointer) point to the skeleton or to the
unit itself in non-fission, so we don't have to special case its
absence)

llvm-svn: 221186

10 years ago[X86] Add debug print name for X86ISD::[US]MUL8. NFC-ish.
Ahmed Bougacha [Mon, 3 Nov 2014 21:25:18 +0000 (21:25 +0000)]
[X86] Add debug print name for X86ISD::[US]MUL8. NFC-ish.

The opcodes were added in r220516, but I forgot to add the print names.

llvm-svn: 221185

10 years agoDon't diagnose no-prototype callee-cleanup function definitions
Reid Kleckner [Mon, 3 Nov 2014 21:24:50 +0000 (21:24 +0000)]
Don't diagnose no-prototype callee-cleanup function definitions

We already have a warning on the call sites of code like this:
  void f() { }
  void g() { f(1, 2, 3); }
t.c:2:21: warning: too many arguments in call to 'f'

We can limit ourselves to diagnosing unprototyped forward declarations
of f to cut down on noise.

llvm-svn: 221184

10 years ago[lit] Forward LD_PRELOAD to tests.
Rafael Espindola [Mon, 3 Nov 2014 21:24:43 +0000 (21:24 +0000)]
[lit] Forward LD_PRELOAD to tests.

With this patch I can use asan to test the gold plugin without having
to build gold itself with asan.

llvm-svn: 221183

10 years agoAdd DwarfCompileUnit::BaseAddress to track the base address used by relative addressi...
David Blaikie [Mon, 3 Nov 2014 21:15:30 +0000 (21:15 +0000)]
Add DwarfCompileUnit::BaseAddress to track the base address used by relative addressing in debug_ranges and debug_loc

This is one of a few steps to generalize range handling to include the
CU range (thus the CU's range list will be moved into the range list
list, losing track of the base address in the process), which means
generalizing ranges from both the skeleton and full unit under fission.

And... then I can used that generalized support for ranges in
fission+gmlt where there'll be a bunch more ranges in the skeleton.

llvm-svn: 221182

10 years agoThe change previously committed as 220983 broke large binary memory reads. I kept...
Greg Clayton [Mon, 3 Nov 2014 21:02:54 +0000 (21:02 +0000)]
The change previously committed as 220983 broke large binary memory reads. I kept the "idx - 1" fix from 220983, but reverted the while loop that was incorrectly added.

The details are: large packets (like large memory reads (m packets) or large binary memory reads (x packet)) can get responses that come in across multiple read() calls. The while loop that was added meant that if only a partial packet came in (like only "$abc" coming for a response) GDBRemoteCommunication::CheckForPacket() was called, it would deadlock in the while loop because no more data is going to come in as this function needs to be called again with more data from another read. So the original fix will need to be corrected and resubmitted.

<rdar://problem/18853744>

llvm-svn: 221181

10 years agoFix leak found by asan.
Rafael Espindola [Mon, 3 Nov 2014 20:55:23 +0000 (20:55 +0000)]
Fix leak found by asan.

llvm-svn: 221180

10 years agoFix a leak found by asan.
Rafael Espindola [Mon, 3 Nov 2014 20:49:17 +0000 (20:49 +0000)]
Fix a leak found by asan.

llvm-svn: 221179

10 years ago[ARM, inline-asm] Fix ARMTargetLowering::getRegForInlineAsmConstraint to return
Akira Hatanaka [Mon, 3 Nov 2014 20:37:04 +0000 (20:37 +0000)]
[ARM, inline-asm] Fix ARMTargetLowering::getRegForInlineAsmConstraint to return
register class tGPRRegClass if the target is thumb1.

This commit fixes a crash that occurs during register allocation which was
triggered when a virtual register defined by an inline-asm instruction had to
be spilled.

rdar://problem/18740489

llvm-svn: 221178

10 years agoMSVC requires redeclarations to repeat noexcept
Reid Kleckner [Mon, 3 Nov 2014 20:35:30 +0000 (20:35 +0000)]
MSVC requires redeclarations to repeat noexcept

llvm-svn: 221177

10 years ago[X86] 8bit divrem: Improve codegen for AH register extraction.
Ahmed Bougacha [Mon, 3 Nov 2014 20:26:35 +0000 (20:26 +0000)]
[X86] 8bit divrem: Improve codegen for AH register extraction.

For 8-bit divrems where the remainder is used, we used to generate:
    divb  %sil
    shrw  $8, %ax
    movzbl  %al, %eax

That was to avoid an H-reg access, which is problematic mainly because
it isn't possible in REX-prefixed instructions.

This patch optimizes that to:
    divb  %sil
    movzbl  %ah, %eax

To do that, we explicitly extend AH, and extract the L-subreg in the
resulting register.  The extension is done using the NOREX variants of
MOVZX.  To support signed operations, MOVSX_NOREX is also added.
Further, this introduces a new SDNode type, [us]divrem_ext_hreg, which is
then lowered to a sequence containing a single zext (rather than 2).

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

llvm-svn: 221176

10 years agoEarlyCSE should ignore calls to @llvm.assume
Hal Finkel [Mon, 3 Nov 2014 20:21:32 +0000 (20:21 +0000)]
EarlyCSE should ignore calls to @llvm.assume

EarlyCSE uses a simple generation scheme for handling memory-based
dependencies, and calls to @llvm.assume (which are marked as writing to memory
to ensure the preservation of control dependencies) disturb that scheme
unnecessarily. Skipping calls to @llvm.assume is legal, and the alternative
(adding AA calls in EarlyCSE) is likely undesirable (we have GVN for that).

Fixes PR21448.

llvm-svn: 221175

10 years agoRequire asserts to unbreak the buildbots.
Roman Divacky [Mon, 3 Nov 2014 19:50:48 +0000 (19:50 +0000)]
Require asserts to unbreak the buildbots.

llvm-svn: 221174

10 years agoReapply: R600: Make sure to inline all internal functions
Tom Stellard [Mon, 3 Nov 2014 19:49:05 +0000 (19:49 +0000)]
Reapply: R600: Make sure to inline all internal functions

Function calls aren't supported yet.

This was reverted due to build breakages, which should be fixed now.

llvm-svn: 221173

10 years agoFurther restrict issuance of 'override' warning if method
Fariborz Jahanian [Mon, 3 Nov 2014 19:46:18 +0000 (19:46 +0000)]
Further restrict issuance of 'override' warning if method
is argument to a macro which is defined in system header.

llvm-svn: 221172

10 years ago[Reassociate] Canonicalize negative constants out of expressions.
Chad Rosier [Mon, 3 Nov 2014 19:11:30 +0000 (19:11 +0000)]
[Reassociate] Canonicalize negative constants out of expressions.

This gives CSE/GVN more options to eliminate duplicate expressions.
This is a follow up patch to http://reviews.llvm.org/D4904.

http://reviews.llvm.org/D5363

llvm-svn: 221171

10 years agoImplement vaarg lowering for ppc32. Lowering of scalars and aggregates
Roman Divacky [Mon, 3 Nov 2014 18:32:54 +0000 (18:32 +0000)]
Implement vaarg lowering for ppc32. Lowering of scalars and aggregates
is supported. Complex numbers are not.

llvm-svn: 221170

10 years agoRelax the LLVM_NOEXCEPT _MSC_VER version check back to 1900
Reid Kleckner [Mon, 3 Nov 2014 18:22:42 +0000 (18:22 +0000)]
Relax the LLVM_NOEXCEPT _MSC_VER version check back to 1900

Unconditional noexcept support was added in the VS 2013 Nov CTP. Given
that there have been three CTPs since then, I don't think we need
careful macro magic to target that specific tech preview. Instead,
target the major release version number of 1900, which corresponds to
the as-yet unreleased VS "14".

llvm-svn: 221169

10 years agoNormally an 'optnone' function goes through fast-isel, which does not
Paul Robinson [Mon, 3 Nov 2014 18:19:26 +0000 (18:19 +0000)]
Normally an 'optnone' function goes through fast-isel, which does not
call DAGCombiner. But we ran into a case (on Windows) where the
calling convention causes argument lowering to bail out of fast-isel,
and we end up in CodeGenAndEmitDAG() which does run DAGCombiner.
So, we need to make DAGCombiner check for 'optnone' after all.

Commit includes the test that found this, plus another one that got
missed in the original optnone work.

llvm-svn: 221168

10 years agoIR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc()
Duncan P. N. Exon Smith [Mon, 3 Nov 2014 18:13:57 +0000 (18:13 +0000)]
IR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc()

Change `Instruction::getAllMetadataOtherThanDebugLoc()` from a vector of
`MDNode` to one of `Value`.  Part of PR21433.

llvm-svn: 221167

10 years agoRemove the cortex-a9-mp CPU.
Charlie Turner [Mon, 3 Nov 2014 17:38:00 +0000 (17:38 +0000)]
Remove the cortex-a9-mp CPU.

This CPU definition is redundant. The Cortex-A9 is defined as
supporting multiprocessing extensions. Remove its definition and
update appropriate tests.

LLVM defines both a cortex-a9 CPU and a cortex-a9-mp CPU. The only
difference between the two CPU definitions in ARM.td is that
cortex-a9-mp contains the feature FeatureMP for multiprocessing
extensions.

This is redundant since the Cortex-A9 is defined as having
multiprocessing extensions in the TRMs. armcc also defines the
Cortex-A9 as having multiprocessing extensions by default.

Change-Id: Ifcadaa6c322be0a33d9d2a39cfdd7da1d75981a7
llvm-svn: 221166

10 years agoFix warnings about missing override.
Rafael Espindola [Mon, 3 Nov 2014 17:14:46 +0000 (17:14 +0000)]
Fix warnings about missing override.

llvm-svn: 221165

10 years agoCleanup some unused or trivial functions in DwarfCompileUnit
David Blaikie [Mon, 3 Nov 2014 17:10:38 +0000 (17:10 +0000)]
Cleanup some unused or trivial functions in DwarfCompileUnit

llvm-svn: 221164

10 years agoThis patch reverts r220496 which issues warning on comparing
Fariborz Jahanian [Mon, 3 Nov 2014 17:03:07 +0000 (17:03 +0000)]
This patch reverts r220496 which issues warning on comparing
parameters with nonnull attribute when comparison is always
true/false. Patch causes false positive when parameter is
modified in the function.

llvm-svn: 221163

10 years agoEmit OpenCL local global variables without zeorinitializer
Matt Arsenault [Mon, 3 Nov 2014 16:51:53 +0000 (16:51 +0000)]
Emit OpenCL local global variables without zeorinitializer

Local variables are not initialized, and every target has
been (incorrectly) ignoring the unnecessary request for
zero initialization.

llvm-svn: 221162

10 years agoSink DwarfUnit::CURanges into DwarfCompileUnit
David Blaikie [Mon, 3 Nov 2014 16:40:43 +0000 (16:40 +0000)]
Sink DwarfUnit::CURanges into DwarfCompileUnit

llvm-svn: 221161

10 years agoDon't allow dllimport/export on classes with internal linkage (PR21399)
Hans Wennborg [Mon, 3 Nov 2014 16:09:16 +0000 (16:09 +0000)]
Don't allow dllimport/export on classes with internal linkage (PR21399)

Trying to import or export such classes doesn't make sense, and Clang
would assert trying to export vtables for them.

This is consistent with how we treat functions with internal linkage,
but it is stricter than MSVC so we may have to back down if it breaks
real code.

llvm-svn: 221160

10 years agoTemporary disable formatting error
Tobias Grosser [Mon, 3 Nov 2014 15:42:45 +0000 (15:42 +0000)]
Temporary disable formatting error

This should silence the buildbots until we understand if the clang-format
changes in r221125 have been intentional. See reply on cfe-commits for details.

llvm-svn: 221159

10 years agoRevert "clang-format: [Java] Allow trailing semicolons after enums."
Daniel Jasper [Mon, 3 Nov 2014 15:42:11 +0000 (15:42 +0000)]
Revert "clang-format: [Java] Allow trailing semicolons after enums."

This reverts commit b5bdb2ef59ab922bcb4d6e843fffaee1f7f68a8c.

This doesn't really seem necessary on second though and causes problems
with C++ enum formatting.

llvm-svn: 221158

10 years ago[AArch64] Fix miscompile of comparison with 0xffffffffffffffff
Oliver Stannard [Mon, 3 Nov 2014 15:28:40 +0000 (15:28 +0000)]
[AArch64] Fix miscompile of comparison with 0xffffffffffffffff

Some literals in the AArch64 backend had 15 'f's rather than 16, causing
comparisons with a constant 0xffffffffffffffff to be miscompiled.

llvm-svn: 221157

10 years agoHandle ctor/init_array initialization.
Sid Manning [Mon, 3 Nov 2014 14:56:05 +0000 (14:56 +0000)]
Handle ctor/init_array initialization.

Hexagon was not calling InitializeELF and could not select between
ctors and init_array.

Phabricator revision: http://reviews.llvm.org/D6061

llvm-svn: 221156

10 years agoMerge the directive-eabi_attribute.s and directive-eabi_attribute-2.s tests.
Charlie Turner [Mon, 3 Nov 2014 14:52:00 +0000 (14:52 +0000)]
Merge the directive-eabi_attribute.s and directive-eabi_attribute-2.s tests.

test/MC/ARM/directive-eabi_attribute.s had gotten out-of-sync with
test/MC/ARM/directive-eabi_attribute-2.s. The former tests the encoding of
build attributes in object files, and the latter the encoding in assembly
files. Since both these tests need to be updated at the same time, it makes
sense to combine them into a single test. The object file encodings are being
checked against the ouput of -arm-attributes rather than by direct byte
comparisons which makes for easier reading.

Change-Id: I0075de506ae5626fb2fa235383fe5ce6a65a15a9
llvm-svn: 221155

10 years agoDon't dllimport inline functions when targeting MinGW (PR21366)
Hans Wennborg [Mon, 3 Nov 2014 14:24:45 +0000 (14:24 +0000)]
Don't dllimport inline functions when targeting MinGW (PR21366)

It turns out that MinGW never dllimports of exports inline functions.
This means that code compiled with Clang would fail to link with
MinGW-compiled libraries since we might try to import functions that
are not imported.

To fix this, make Clang never dllimport inline functions when targeting
MinGW.

llvm-svn: 221154

10 years agoAdd CRLF support to LineIterator.
Rafael Espindola [Mon, 3 Nov 2014 14:09:47 +0000 (14:09 +0000)]
Add CRLF support to LineIterator.

The MRI scripts have to work with CRLF, and in general it is probably
a good idea to support this in a core utility like LineIterator.

llvm-svn: 221153

10 years ago[clang-tidy] Added -fix-errors option
Alexander Kornienko [Mon, 3 Nov 2014 14:06:31 +0000 (14:06 +0000)]
[clang-tidy] Added -fix-errors option

Summary:
Added -fix-errors option to allow applying fixes when compiler errors
are present. Without this flag -fix would bail out if there are compiler errors.
This is needed to avoid applying wrong fixes if Clang fails to recover from
compilation errors correctly.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 221152

10 years agoRevert r221150, as it broke sanitizer tests
Oliver Stannard [Mon, 3 Nov 2014 12:19:03 +0000 (12:19 +0000)]
Revert r221150, as it broke sanitizer tests

llvm-svn: 221151

10 years agoEmit .eh_frame with relocations to functions, rather than sections
Oliver Stannard [Mon, 3 Nov 2014 12:02:51 +0000 (12:02 +0000)]
Emit .eh_frame with relocations to functions, rather than sections

When LLVM emits DWARF call frame information, it currently creates a local,
section-relative symbol in the code section, which is pointed to by a
relocation on the .eh_frame section. However, for C++ we emit some functions in
section groups, and the SysV ABI has some rules to make it easier to remove
these sections
(http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules):

  A symbol table entry with STB_LOCAL binding that is defined relative to one
  of a group's sections, and that is contained in a symbol table section that is
  not part of the group, must be discarded if the group members are discarded.
  References to this symbol table entry from outside the group are not allowed.

This means that we need to use the function symbol for the relocation, not a
temporary symbol.

There was a comment in the code claiming that the local symbol was used to
avoid creating a relocation, but a relocation must be created anyway as the
code and CFI are in different sections.

llvm-svn: 221150

10 years ago[OCaml] Fix mismatched CAMLparam/CAMLreturn.
Peter Zotov [Mon, 3 Nov 2014 11:47:14 +0000 (11:47 +0000)]
[OCaml] Fix mismatched CAMLparam/CAMLreturn.

Also, revert r221142--it was an incorrect fix to this bug
which fixed tests by accident.

llvm-svn: 221149

10 years agoTest commit.
Charlie Turner [Mon, 3 Nov 2014 10:58:05 +0000 (10:58 +0000)]
Test commit.

Fixes two typos.

Change-Id: I129f647de8933e1d8f0dc9941bcb91602edce7e2
llvm-svn: 221148

10 years agoCMake: Add libm to list of system libs printed by llvm-config.
Peter Collingbourne [Mon, 3 Nov 2014 10:38:26 +0000 (10:38 +0000)]
CMake: Add libm to list of system libs printed by llvm-config.

This is required by the interpreter library, and also matches the autoconf
behavior.

llvm-svn: 221147

10 years ago[mips] Remove unused prototype and variable. NFC.
Daniel Sanders [Mon, 3 Nov 2014 10:14:57 +0000 (10:14 +0000)]
[mips] Remove unused prototype and variable. NFC.

llvm-svn: 221146