platform/upstream/llvm.git
9 years agoFix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers...
Kevin Enderby [Fri, 16 Jan 2015 22:10:36 +0000 (22:10 +0000)]
Fix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers option
and tweak its use in llvm-objdump.  Add back the test case for the -archive-headers option.

llvm-svn: 226332

9 years agoRemove pathname dependence. Also rewrite test to use FileCheck
Eric Christopher [Fri, 16 Jan 2015 22:03:52 +0000 (22:03 +0000)]
Remove pathname dependence. Also rewrite test to use FileCheck
at the same time.

Patch by David Callahan.

llvm-svn: 226331

9 years agoA couple small changes to get LIT working with python3
Eric Fiselier [Fri, 16 Jan 2015 21:59:07 +0000 (21:59 +0000)]
A couple small changes to get LIT working with python3

llvm-svn: 226330

9 years agoMove common code to base class.
Rui Ueyama [Fri, 16 Jan 2015 21:58:20 +0000 (21:58 +0000)]
Move common code to base class.

llvm-svn: 226329

9 years agoFix some copypasta typos in asserts.
Sean Silva [Fri, 16 Jan 2015 21:44:26 +0000 (21:44 +0000)]
Fix some copypasta typos in asserts.

Fixes PR22236

Patch by Nicolas Brunie! <nicolas.brunie@kalray.eu>

llvm-svn: 226328

9 years ago[Kaleidoscope] Run clang-format over chapter 4 of kaleidoscope.
Lang Hames [Fri, 16 Jan 2015 21:42:07 +0000 (21:42 +0000)]
[Kaleidoscope] Run clang-format over chapter 4 of kaleidoscope.

I forgot to do this for r226308. Thanks to Eric Christopher for the reminder.

llvm-svn: 226327

9 years ago[Hexagon] Converting halfword to doubleword multiply intrinsics.
Colin LeMahieu [Fri, 16 Jan 2015 21:41:57 +0000 (21:41 +0000)]
[Hexagon] Converting halfword to doubleword multiply intrinsics.

llvm-svn: 226326

9 years agoAlso put vtables in a comdat when rtti is disabled.
Rafael Espindola [Fri, 16 Jan 2015 21:41:44 +0000 (21:41 +0000)]
Also put vtables in a comdat when rtti is disabled.

llvm-svn: 226325

9 years ago[Hexagon] Converting accumulating halfword multiply intrinsics to patterns.
Colin LeMahieu [Fri, 16 Jan 2015 21:36:34 +0000 (21:36 +0000)]
[Hexagon] Converting accumulating halfword multiply intrinsics to patterns.

llvm-svn: 226324

9 years ago[libcxx] Add compiler utility class for LIT tests
Eric Fiselier [Fri, 16 Jan 2015 21:35:08 +0000 (21:35 +0000)]
[libcxx] Add compiler utility class for LIT tests

Summary:
This adds a compiler utility class that handles generating compile commands and running them. Instead of having to pass the compiler path and 3 groups of flags between the configuration and the test format this allows us to just pass the compiler object.

Reviewers: danalbert, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 226323

9 years agoAdd 'no_default_flags' option for turning off all default test compile and link flags.
Eric Fiselier [Fri, 16 Jan 2015 21:22:08 +0000 (21:22 +0000)]
Add 'no_default_flags' option for turning off all default test compile and link flags.

When 'no_default_flags' is true only flags passed using '--param=compile_flags'
and '--param=link_flags' will be used when compiling the tests. This option
can be used to run the test suite against libstdc++ and helps with all
unusual test suite configurations.

NOTE: sanitizer flags are still added when '--param=use_sanitizer' is used even
if '--param=no_default_flags' is given.

llvm-svn: 226322

9 years agoRemove duplication code.
Rui Ueyama [Fri, 16 Jan 2015 21:11:00 +0000 (21:11 +0000)]
Remove duplication code.

llvm-svn: 226321

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Fri, 16 Jan 2015 21:09:43 +0000 (21:09 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 226320

9 years ago[PECOFF] Remove ResolvableSymbols to simplify.
Rui Ueyama [Fri, 16 Jan 2015 20:48:46 +0000 (20:48 +0000)]
[PECOFF] Remove ResolvableSymbols to simplify.

We had such class there because of InputGraph abstraction.
Previously, no one except InputGraph itself has complete picture of
input file list. In order to create a set of all defined symbols,
we had to use some indirections there to workaround InputGraph.

It can now be rewritten as simple code. No change in functionality.

llvm-svn: 226319

9 years ago[Hexagon] Beginning converting intrinsics to patterns instead of duplicated definitio...
Colin LeMahieu [Fri, 16 Jan 2015 20:38:54 +0000 (20:38 +0000)]
[Hexagon] Beginning converting intrinsics to patterns instead of duplicated definitions.  Converting halfword multiply intrinsics.

llvm-svn: 226318

9 years agoAdd comdat to string literal variables on COFF.
Rafael Espindola [Fri, 16 Jan 2015 20:32:35 +0000 (20:32 +0000)]
Add comdat to string literal variables on COFF.

llvm-svn: 226317

9 years ago[RuntimeDyld] Add 'stub_addr' to comment describing RuntimeDyldChecker's syntax.
Lang Hames [Fri, 16 Jan 2015 20:31:38 +0000 (20:31 +0000)]
[RuntimeDyld] Add 'stub_addr' to comment describing RuntimeDyldChecker's syntax.

llvm-svn: 226316

9 years ago[Hexagon] Fix 226309, replacement atomic store patterns didn't actually exist, added...
Colin LeMahieu [Fri, 16 Jan 2015 20:16:14 +0000 (20:16 +0000)]
[Hexagon] Fix 226309, replacement atomic store patterns didn't actually exist, added new versions.

llvm-svn: 226315

9 years agollvm-readobj: add IMAGE_REL_ARM_MOV32(T) to the enumeration
Saleem Abdulrasool [Fri, 16 Jan 2015 20:16:09 +0000 (20:16 +0000)]
llvm-readobj: add IMAGE_REL_ARM_MOV32(T) to the enumeration

Add an additional based relocation to the enumeration of based relocation names.
The lack of the enumerator value causes issues when inspecting WoA binaries.

llvm-svn: 226314

9 years agoX86: fix comment typo in AsmParser
Saleem Abdulrasool [Fri, 16 Jan 2015 20:16:06 +0000 (20:16 +0000)]
X86: fix comment typo in AsmParser

Fix a typo.  NFC.

llvm-svn: 226313

9 years agoInstrProf: Optionally print an error when emitting profile data fails
Justin Bogner [Fri, 16 Jan 2015 20:10:56 +0000 (20:10 +0000)]
InstrProf: Optionally print an error when emitting profile data fails

Debugging a missing profile is a bit painful right now. We can make
people's lives a bit easier by adding a knob to enable printing a
helpful error message for such failures.

llvm-svn: 226312

9 years agoMove ownership of GCStrategy objects to LLVMContext
Philip Reames [Fri, 16 Jan 2015 20:07:33 +0000 (20:07 +0000)]
Move ownership of GCStrategy objects to LLVMContext

Note: This change ended up being slightly more controversial than expected.  Chandler has tentatively okayed this for the moment, but I may be revisiting this in the near future after we settle some high level questions.

Rather than have the GCStrategy object owned by the GCModuleInfo - which is an immutable analysis pass used mainly by gc.root - have it be owned by the LLVMContext. This simplifies the ownership logic (i.e. can you have two instances of the same strategy at once?), but more importantly, allows us to access the GCStrategy in the middle end optimizer. To this end, I add an accessor through Function which becomes the canonical way to get at a GCStrategy instance.

In the near future, this will allows me to move some of the checks from http://reviews.llvm.org/D6808 into the Verifier itself, and to introduce optimization legality predicates for some of the recent additions to InstCombine. (These will follow as separate changes.)

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

llvm-svn: 226311

9 years agoFix abort_message.cpp for the NDK.
Dan Albert [Fri, 16 Jan 2015 20:00:49 +0000 (20:00 +0000)]
Fix abort_message.cpp for the NDK.

The NDK doesn't have access to `android/set_abort_message.h`, so use
an extern declaration instead for API 21. For older releases, just use
`__assert2`, which will report to logcat and/or the tombstone for some
older releases.

llvm-svn: 226310

9 years ago[Hexagon] Removing old duplicate atomic load/store patterns.
Colin LeMahieu [Fri, 16 Jan 2015 19:53:35 +0000 (19:53 +0000)]
[Hexagon] Removing old duplicate atomic load/store patterns.

llvm-svn: 226309

9 years ago[Kaleidoscope] Fix a bug in Chapter 4 of the Kaleidoscope tutorial where repeat
Lang Hames [Fri, 16 Jan 2015 19:44:46 +0000 (19:44 +0000)]
[Kaleidoscope] Fix a bug in Chapter 4 of the Kaleidoscope tutorial where repeat
calls to functions weren't evaluated correctly.

Patch by Charlie Turner. Thanks Charlie!

llvm-svn: 226308

9 years agoSpell 0 in an enum-appropriate way. No behavior change.
Nico Weber [Fri, 16 Jan 2015 19:35:01 +0000 (19:35 +0000)]
Spell 0 in an enum-appropriate way. No behavior change.

llvm-svn: 226307

9 years agoDon't crash if a declarator in a friend decl doesn't have a name.
Nico Weber [Fri, 16 Jan 2015 19:34:13 +0000 (19:34 +0000)]
Don't crash if a declarator in a friend decl doesn't have a name.

There was already an explicit check for that for the first decl.  Move that
to a different place so that it's called for the following decls too.  Also
don't randomly set the BitfieldSize ExprResult to true (this sets a pointer to
true internally).

Found by SLi's bot.

llvm-svn: 226306

9 years agoRemove gc.root's findCustomSafePoints mechanism
Philip Reames [Fri, 16 Jan 2015 19:33:28 +0000 (19:33 +0000)]
Remove gc.root's findCustomSafePoints mechanism

Searching all of the existing gc.root implementations I'm aware of (all three of them), there was exactly one use of this mechanism, and that was to implement a performance improvement that should have been applied to the default lowering.

Having this function is requiring a dependency on a CodeGen class (MachineFunction), in a class which is otherwise completely independent of CodeGen. I could solve this differently, but given that I see absolutely no value in preserving this mechanism, I going to just get rid of it.

Note: Tis is the first time I'm intentionally breaking previously supported gc.root functionality. Given 3.6 has branched, I believe this is a good time to do this.

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

llvm-svn: 226305

9 years ago[Hexagon] Converting old patterns to new versions using classes.
Colin LeMahieu [Fri, 16 Jan 2015 19:29:59 +0000 (19:29 +0000)]
[Hexagon] Converting old patterns to new versions using classes.

llvm-svn: 226304

9 years agoAdd comdats to the RTTI variables in the microsoft abi.
Rafael Espindola [Fri, 16 Jan 2015 19:23:42 +0000 (19:23 +0000)]
Add comdats to the RTTI variables in the microsoft abi.

llvm-svn: 226303

9 years agoCheck commit access
Sumanth Gundapaneni [Fri, 16 Jan 2015 19:23:34 +0000 (19:23 +0000)]
Check commit access

llvm-svn: 226302

9 years agoCompile fix for WIN32
Vince Harron [Fri, 16 Jan 2015 19:07:30 +0000 (19:07 +0000)]
Compile fix for WIN32

llvm-svn: 226301

9 years agoAdd a utility script that executes an inferior process tucking its output away somewh...
Enrico Granata [Fri, 16 Jan 2015 18:59:54 +0000 (18:59 +0000)]
Add a utility script that executes an inferior process tucking its output away somewhere safe, and not letting error messages escape
This has potential to be useful in build automation environments

llvm-svn: 226300

9 years agoTake extra care to ensure we don't deref a NULL pointer.
Greg Clayton [Fri, 16 Jan 2015 18:59:48 +0000 (18:59 +0000)]
Take extra care to ensure we don't deref a NULL pointer.

llvm-svn: 226299

9 years ago[AVX512] Add intrinsics for masked aligned FP loads and stores
Adam Nemet [Fri, 16 Jan 2015 18:51:50 +0000 (18:51 +0000)]
[AVX512] Add intrinsics for masked aligned FP loads and stores

Part of <rdar://problem/17688758>

llvm-svn: 226298

9 years agoFix typo in r225922.
Adam Nemet [Fri, 16 Jan 2015 18:51:46 +0000 (18:51 +0000)]
Fix typo in r225922.

llvm-svn: 226297

9 years ago[AVX512] Add intrinsics for masked aligned FP loads and stores
Adam Nemet [Fri, 16 Jan 2015 18:50:09 +0000 (18:50 +0000)]
[AVX512] Add intrinsics for masked aligned FP loads and stores

Similar to the unaligned cases.

Test was generated with update_llc_test_checks.py.

Part of <rdar://problem/17688758>

llvm-svn: 226296

9 years ago[AVX512] Remove trailing whitespaces in this test
Adam Nemet [Fri, 16 Jan 2015 18:50:07 +0000 (18:50 +0000)]
[AVX512] Remove trailing whitespaces in this test

llvm-svn: 226295

9 years agoAArch64: implement AAPCS layout rules for bit-fields.
Tim Northover [Fri, 16 Jan 2015 18:44:04 +0000 (18:44 +0000)]
AArch64: implement AAPCS layout rules for bit-fields.

llvm-svn: 226294

9 years agoSplit a function for readability.
Rui Ueyama [Fri, 16 Jan 2015 17:53:55 +0000 (17:53 +0000)]
Split a function for readability.

llvm-svn: 226292

9 years agoIR: Allow 16-bits for column info
Duncan P. N. Exon Smith [Fri, 16 Jan 2015 17:33:08 +0000 (17:33 +0000)]
IR: Allow 16-bits for column info

Raise the limit for column information from 8 bits to 16 bits.

llvm-svn: 226291

9 years agoIR: Cleanup dead code, NFC
Duncan P. N. Exon Smith [Fri, 16 Jan 2015 17:31:29 +0000 (17:31 +0000)]
IR: Cleanup dead code, NFC

Line/column fixups already exist in `MDLocation`.  Delete the duplicated
logic in `DebugLoc`.

llvm-svn: 226290

9 years ago[Hexagon] Updating call/jump instruction patterns.
Colin LeMahieu [Fri, 16 Jan 2015 17:05:27 +0000 (17:05 +0000)]
[Hexagon] Updating call/jump instruction patterns.

llvm-svn: 226288

9 years agoSimplify. No functionality change.
Rui Ueyama [Fri, 16 Jan 2015 16:58:58 +0000 (16:58 +0000)]
Simplify. No functionality change.

llvm-svn: 226287

9 years agoAdd comdats to dynamic init functions in the microsoft abi.
Rafael Espindola [Fri, 16 Jan 2015 16:04:45 +0000 (16:04 +0000)]
Add comdats to dynamic init functions in the microsoft abi.

llvm-svn: 226286

9 years agoMake this test a bit stricter. NFC.
Rafael Espindola [Fri, 16 Jan 2015 16:02:03 +0000 (16:02 +0000)]
Make this test a bit stricter. NFC.

llvm-svn: 226285

9 years ago[PECOFF] Improve parallelism.
Rui Ueyama [Fri, 16 Jan 2015 15:58:36 +0000 (15:58 +0000)]
[PECOFF] Improve parallelism.

llvm-svn: 226284

9 years agofew fixes for ittnotify iterface (used by Intel(R) VTune Amplifier)
Andrey Churbanov [Fri, 16 Jan 2015 15:58:03 +0000 (15:58 +0000)]
few fixes for ittnotify iterface (used by Intel(R) VTune Amplifier)

llvm-svn: 226283

9 years agoAttempt to fix the build with XCode 5.0.2 (and probably 5.1.1).
Alexander Kornienko [Fri, 16 Jan 2015 15:57:15 +0000 (15:57 +0000)]
Attempt to fix the build with XCode 5.0.2 (and probably 5.1.1).

llvm-svn: 226282

9 years agoRun the resolver in parallel with the reader.
Rui Ueyama [Fri, 16 Jan 2015 15:54:13 +0000 (15:54 +0000)]
Run the resolver in parallel with the reader.

This patch makes File::parse() multi-thread safe. If one thread is running
File::parse(), other threads will block if they try to call the same method.
File::parse() is idempotent, so you can safely call  multiple times.

With this change, we don't have to wait for all worker threads to finish
in Driver::link(). Previously, Driver::link() calls TaskGroup::sync() to
wait for all threads running File::parse(). This was not ideal because
we couldn't start the resolver until we parse all files.

This patch increase parallelism by making Driver::link() to not wait for
worker threads. The resolver calls parse() to make sure that the file
being read has been parsed, and then uses the file. In this approach,
the resolver can run with the parser threads in parallel.

http://reviews.llvm.org/D6994

llvm-svn: 226281

9 years agoAdd comdats to constructs and destructor in the microsoft abi.
Rafael Espindola [Fri, 16 Jan 2015 15:37:11 +0000 (15:37 +0000)]
Add comdats to constructs and destructor in the microsoft abi.

llvm-svn: 226280

9 years ago[sanitizer] Additional error checking.
Evgeniy Stepanov [Fri, 16 Jan 2015 15:25:16 +0000 (15:25 +0000)]
[sanitizer] Additional error checking.

llvm-svn: 226279

9 years agorestore fix for 18645, buildbot apparently gave a false positive.
Nathan Sidwell [Fri, 16 Jan 2015 15:20:14 +0000 (15:20 +0000)]
restore fix for 18645, buildbot apparently gave a false positive.
Correct logic concerning 'T &&' deduction against lvalues.

llvm-svn: 226278

9 years ago[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.
Andrea Di Biagio [Fri, 16 Jan 2015 14:55:26 +0000 (14:55 +0000)]
[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.

This patch disables target specific combine on X86ISD::INSERTPS dag nodes
if optlevel is CodeGenOpt::None.

The backend currently implements a target specific combine rule that converts
a vector load used by an INSERTPS dag node into a scalar load plus a
scalar_to_vector. This allows ISel to select a single INSERTPSrm instead of
two instructions (i.e. a vector load plus INSERTPSrr).

However, the existing target combine rule on INSERTPS nodes only works under
the assumption that ISel will always be able to match an INSERTPSrm. This is
not true in general at -O0, since the backend only allows folding a load into
the memory operand of an instruction if the optimization level is not
CodeGenOpt::None.

In the example below:

//
__m128 test(__m128 a, __m128 *b) {
  __m128 c = _mm_insert_ps(a, *b, 1 << 6);
  return c;
}
//

Before this patch, at -O0, the backend would have canonicalized the load to 'b'
into a scalar load plus scalar_to_vector. Later on, ISel would have selected an
INSERTPSrr leaving the insertps mask in an inconsistent state:

  movss 4(%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # xmm0 = xmm1[1],xmm0[1,2,3].

With this patch, the backend avoids folding the vector load into the operand of
the INSERTPS. The new codegen at -O0 is:

  movaps (%rdi), %xmm1
  insertps  $64, %xmm1, %xmm0 # %xmm1[1],xmm0[1,2,3].

llvm-svn: 226277

9 years ago[Sanitizers] Intercept clock_gettime() on FreeBSD
Viktor Kutuzov [Fri, 16 Jan 2015 14:54:39 +0000 (14:54 +0000)]
[Sanitizers] Intercept clock_gettime() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 226276

9 years ago[Sanitizers] Intercept lgamma_r() on FreeBSD
Viktor Kutuzov [Fri, 16 Jan 2015 14:52:17 +0000 (14:52 +0000)]
[Sanitizers] Intercept lgamma_r() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 226275

9 years ago[ELF] Add --as-needed.
Rui Ueyama [Fri, 16 Jan 2015 14:27:01 +0000 (14:27 +0000)]
[ELF] Add --as-needed.

The previous default behavior of LLD is --as-needed. LLD linked
against a DSO only if the DSO file was actually used to link an
executable (i.e. at least one symbol was resolved using the shared
library file.)

In this patch I added a boolean flag to FileNode for --as-needed.
I also added an accessor to DSO name to shared library file class.

llvm-svn: 226274

9 years ago[asan] Change detection of allow_user_segv_handler on Android.
Evgeniy Stepanov [Fri, 16 Jan 2015 13:12:22 +0000 (13:12 +0000)]
[asan] Change detection of allow_user_segv_handler on Android.

llvm-svn: 226273

9 years agocleanup changes of cmake-building for Intel(R) Many Integrated Core Architecture
Andrey Churbanov [Fri, 16 Jan 2015 13:05:23 +0000 (13:05 +0000)]
cleanup changes of cmake-building for Intel(R) Many Integrated Core Architecture

llvm-svn: 226272

9 years agocleanup changes of building for Intel(R) Many Integrated Core Architecture
Andrey Churbanov [Fri, 16 Jan 2015 12:54:51 +0000 (12:54 +0000)]
cleanup changes of building for Intel(R) Many Integrated Core Architecture

llvm-svn: 226271

9 years ago[asan] More verbose output from one of the tests.
Evgeniy Stepanov [Fri, 16 Jan 2015 12:08:32 +0000 (12:08 +0000)]
[asan] More verbose output from one of the tests.

Trying to debug a buildbot-only failure.

llvm-svn: 226270

9 years ago[mips] Remove a redundant semicolon and add space before curly brackets. NFC.
Toma Tabacu [Fri, 16 Jan 2015 10:45:15 +0000 (10:45 +0000)]
[mips] Remove a redundant semicolon and add space before curly brackets. NFC.

llvm-svn: 226269

9 years ago[asan] Fix asan_options-include test.
Evgeniy Stepanov [Fri, 16 Jan 2015 10:30:53 +0000 (10:30 +0000)]
[asan] Fix asan_options-include test.

Wrong include order.

llvm-svn: 226268

9 years ago[sanitizer] Fix bashism in check_lint.sh.
Evgeniy Stepanov [Fri, 16 Jan 2015 10:20:49 +0000 (10:20 +0000)]
[sanitizer] Fix bashism in check_lint.sh.

llvm-svn: 226267

9 years ago[sanitizer] Cleanup linter temporary files.
Evgeniy Stepanov [Fri, 16 Jan 2015 10:09:56 +0000 (10:09 +0000)]
[sanitizer] Cleanup linter temporary files.

llvm-svn: 226266

9 years ago[ELF] Remove TargetHandler and DefaultTargetHandler constructors
Simon Atanasyan [Fri, 16 Jan 2015 09:40:21 +0000 (09:40 +0000)]
[ELF] Remove TargetHandler and DefaultTargetHandler constructors

These classes contain only abstract virtual functions. Explicit
constructors are redundant.

llvm-svn: 226265

9 years ago[X86] Refactored stack memory folding tests to explicitly force register spilling
Simon Pilgrim [Fri, 16 Jan 2015 09:32:54 +0000 (09:32 +0000)]
[X86] Refactored stack memory folding tests to explicitly force register spilling

The current 'big vectors' stack folded reload testing pattern is very bulky and makes it difficult to test all instructions as big vectors will tend to use only the ymm instruction implementations.

This patch changes the tests to use a nop call that lists explicit xmm registers as sideeffects, with this we can force a partial register spill of the relevant registers and then check that the reload is correctly folded. The asm generated only adds the forced spill, a nop instruction and a couple of extra labels (a fraction of the current approach).

More exhaustive tests will follow shortly, I've added some extra tests (the xmm versions of some of the existing folding tests) as a starting point.

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

llvm-svn: 226264

9 years ago[sanitizer] Fix compiler warning in the flag parser code.
Evgeniy Stepanov [Fri, 16 Jan 2015 09:32:31 +0000 (09:32 +0000)]
[sanitizer] Fix compiler warning in the flag parser code.

llvm-svn: 226263

9 years ago[ELF] Remove unused class field
Simon Atanasyan [Fri, 16 Jan 2015 08:58:14 +0000 (08:58 +0000)]
[ELF] Remove unused class field

No functional changes.

llvm-svn: 226262

9 years ago[ELF] s/_context/_ctx/ and clang-format the code
Simon Atanasyan [Fri, 16 Jan 2015 08:58:09 +0000 (08:58 +0000)]
[ELF] s/_context/_ctx/ and clang-format the code

No functional changes.

llvm-svn: 226261

9 years ago[ELF] Make the unhandledReferenceType() protected method
Simon Atanasyan [Fri, 16 Jan 2015 08:58:03 +0000 (08:58 +0000)]
[ELF] Make the unhandledReferenceType() protected method

No functional changes.

llvm-svn: 226260

9 years ago[ELF] Make `TargetRelocationHandler` a regular non-template class
Simon Atanasyan [Fri, 16 Jan 2015 08:57:58 +0000 (08:57 +0000)]
[ELF] Make `TargetRelocationHandler` a regular non-template class

This class defines a relocation handler interface. The interface does
not depend on the template argument so the argument is redundant.

llvm-svn: 226259

9 years ago[PPC] Remove redundant `virtual` keyword
Simon Atanasyan [Fri, 16 Jan 2015 08:57:45 +0000 (08:57 +0000)]
[PPC] Remove redundant `virtual` keyword

No functional changes.

llvm-svn: 226258

9 years ago[PPC] Remove unused class field PPCTargetRelocationHandler::_ppcTargetLayout
Simon Atanasyan [Fri, 16 Jan 2015 08:57:39 +0000 (08:57 +0000)]
[PPC] Remove unused class field PPCTargetRelocationHandler::_ppcTargetLayout

No functional changes.

llvm-svn: 226257

9 years ago[Mips] Use ELFLinkingContext class instead of MipsLinkingContext where possible
Simon Atanasyan [Fri, 16 Jan 2015 08:57:33 +0000 (08:57 +0000)]
[Mips] Use ELFLinkingContext class instead of MipsLinkingContext where possible

No functional changes.

llvm-svn: 226256

9 years ago[Mips] Make MipsLinkingContext owner of MipsELFFlagsMerger
Simon Atanasyan [Fri, 16 Jan 2015 08:57:26 +0000 (08:57 +0000)]
[Mips] Make MipsLinkingContext owner of MipsELFFlagsMerger

That reduce class dependencies and simplify the code a bit.
No functional changes.

llvm-svn: 226255

9 years ago[Mips] Remove redundant namespace names
Simon Atanasyan [Fri, 16 Jan 2015 08:57:17 +0000 (08:57 +0000)]
[Mips] Remove redundant namespace names

No functional changes.

llvm-svn: 226254

9 years ago[Mips] Allow linking object files with MIPS32 and MIPS64 instructions
Simon Atanasyan [Fri, 16 Jan 2015 08:57:08 +0000 (08:57 +0000)]
[Mips] Allow linking object files with MIPS32 and MIPS64 instructions

If object files satisfy O32 ABI they can be linked together even if some
of them contains MIPS64 or MIPS64R2 instructions.

llvm-svn: 226253

9 years agoRevert r226242 - Revert Revert Don't create new comdats in CodeGen
Timur Iskhodzhanov [Fri, 16 Jan 2015 08:38:45 +0000 (08:38 +0000)]
Revert r226242 - Revert Revert Don't create new comdats in CodeGen

This breaks AddressSanitizer (ninja check-asan) on Windows

llvm-svn: 226251

9 years ago[OPENMP] Fixed data-sharing attributes processing for variables with global
Alexey Bataev [Fri, 16 Jan 2015 07:11:33 +0000 (07:11 +0000)]
[OPENMP] Fixed data-sharing attributes processing for variables with global
storage.
This fix allows to use non-constant global variables, static local variables and static data
members in data-sharing attribute clauses in parallel and task regions.

llvm-svn: 226250

9 years agominor refactoring to remove unneeded/unspecific header files
Vince Harron [Fri, 16 Jan 2015 06:47:43 +0000 (06:47 +0000)]
minor refactoring to remove unneeded/unspecific header files

Differential review: http://reviews.llvm.org/D6919

llvm-svn: 226249

9 years agoUse report_fatal_error instead of llvm_unreachable, so we don't crash on user input
Filipe Cabecinhas [Fri, 16 Jan 2015 04:54:12 +0000 (04:54 +0000)]
Use report_fatal_error instead of llvm_unreachable, so we don't crash on user input

llvm-svn: 226248

9 years ago[PowerPC] Adjust PatchPoints for ppc64le
Hal Finkel [Fri, 16 Jan 2015 04:40:58 +0000 (04:40 +0000)]
[PowerPC] Adjust PatchPoints for ppc64le

Bill Schmidt pointed out that some adjustments would be needed to properly
support powerpc64le (using the ELF V2 ABI). For one thing, R11 is not available
as a scratch register, so we need to use R12. R12 is also available under ELF
V1, so to maintain consistency, I flipped the order to make R12 the first
scratch register in the array under both ABIs.

llvm-svn: 226247

9 years agoPE/COFF: use dyn_cast for the check of the target
Saleem Abdulrasool [Fri, 16 Jan 2015 04:14:33 +0000 (04:14 +0000)]
PE/COFF: use dyn_cast for the check of the target

The target may be a synthetic symbol like __ImageBase.  cast_or_null will ensure
that the atom is a DefinedAtom, which is not guaranteed, which was the original
reason for the cast_or_null.  Switch this to dyn_cast, which should enable
building of executables for WoA.  Unfortunately, the issue of missing base
relocations still needs to be investigated.

llvm-svn: 226246

9 years agoFix Reassociate handling of constant in presence of undef float
Mehdi Amini [Fri, 16 Jan 2015 03:00:58 +0000 (03:00 +0000)]
Fix Reassociate handling of constant in presence of undef float

http://reviews.llvm.org/D6993

llvm-svn: 226245

9 years agoFixes to DNBArchImpl in debugserver to correctly get/set
Jason Molenda [Fri, 16 Jan 2015 02:31:35 +0000 (02:31 +0000)]
Fixes to DNBArchImpl in debugserver to correctly get/set
the register state when debugging AArch32 programs (armv7
programs running on an armv8 processor).  Most notably,
there is no "fpscr" register in the register context -
there is an fpsr and an fpcr.

Also fix a bug where the floating point values could not
be written in armv7 processes.
<rdar://problem/18977767>

llvm-svn: 226244

9 years agoRemove triple detection from cmake.
Dan Albert [Fri, 16 Jan 2015 02:27:17 +0000 (02:27 +0000)]
Remove triple detection from cmake.

This isn't actually used for anything, and is broken on Darwin
(currently causing build failures now that the triple is passed to aid
cross compiling). Rather than fix unused code, just remove it.

llvm-svn: 226243

9 years agoRevert "Revert Don't create new comdats in CodeGen"
Rafael Espindola [Fri, 16 Jan 2015 02:22:55 +0000 (02:22 +0000)]
Revert "Revert Don't create new comdats in CodeGen"

This reverts commit r226173, adding r226038 back.

No change in this commit, but clang was changed to also produce trivial comdats for
costructors, destructors and vtables when needed.

Original message:

Don't create new comdats in CodeGen.

This patch stops the implicit creation of comdats during codegen.

Clang now sets the comdat explicitly when it is required. With this patch clang and gcc
now produce the same result in pr19848.

llvm-svn: 226242

9 years agoWork around to get the build bot clang-cmake-armv7-a15-full green by
Kevin Enderby [Fri, 16 Jan 2015 02:08:11 +0000 (02:08 +0000)]
Work around to get the build bot clang-cmake-armv7-a15-full green by
removing the macho-archive-headers.test added with r226228 that it is
failing on for now while I try to figure out what is going on.

llvm-svn: 226241

9 years agoLIBCXXABI_TARGET_TRIPLE won't always be set.
Dan Albert [Fri, 16 Jan 2015 01:10:09 +0000 (01:10 +0000)]
LIBCXXABI_TARGET_TRIPLE won't always be set.

Fixes issue with r226235. Build configuration difference between
libc++ and libc++abi.

llvm-svn: 226240

9 years agoAnother attempt to fix the build bot clang-cmake-armv7-a15-full failing on
Kevin Enderby [Fri, 16 Jan 2015 01:09:54 +0000 (01:09 +0000)]
Another attempt to fix the build bot clang-cmake-armv7-a15-full failing on
the macho-archive-headers.test added with r226228.

llvm-svn: 226239

9 years agoAdd a new pass "inductive range check elimination"
Sanjoy Das [Fri, 16 Jan 2015 01:03:22 +0000 (01:03 +0000)]
Add a new pass "inductive range check elimination"

IRCE eliminates range checks of the form

  0 <= A * I + B < Length

by splitting a loop's iteration space into three segments in a way
that the check is completely redundant in the middle segment.  As an
example, IRCE will convert

  len = < known positive >
  for (i = 0; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

to

  len = < known positive >
  limit = smin(n, len)
  // no first segment
  for (i = 0; i < limit; i++) {
    if (0 <= i && i < len) { // this check is fully redundant
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }
  for (i = limit; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

IRCE can deal with multiple range checks in the same loop (it takes
the intersection of the ranges that will make each of them redundant
individually).

Currently IRCE does not do any profitability analysis.  That is a
TODO.

Please note that the status of this pass is *experimental*, and it is
not part of any default pass pipeline.  Having said that, I will love
to get feedback and general input from people interested in trying
this out.

This pass was originally r226201.  It was reverted because it used C++
features not supported by MSVC 2012.

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

llvm-svn: 226238

9 years ago[libc++] Add support for cross compiling.
Dan Albert [Fri, 16 Jan 2015 00:55:15 +0000 (00:55 +0000)]
[libc++] Add support for cross compiling.

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 226237

9 years agoUse std::recursive_mutex instead of llvm's SmartMutex.
Rui Ueyama [Fri, 16 Jan 2015 00:55:01 +0000 (00:55 +0000)]
Use std::recursive_mutex instead of llvm's SmartMutex.

llvm-svn: 226236

9 years ago[libc++abi] Add support for cross compiling.
Dan Albert [Fri, 16 Jan 2015 00:52:11 +0000 (00:52 +0000)]
[libc++abi] Add support for cross compiling.

Reviewers: EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 226235

9 years agoAdd Socket::Get[Remote/Local]IpAddress and unit tests
Vince Harron [Fri, 16 Jan 2015 00:47:08 +0000 (00:47 +0000)]
Add Socket::Get[Remote/Local]IpAddress and unit tests

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

llvm-svn: 226234

9 years agoGive lldb a clean null build.
Nico Weber [Fri, 16 Jan 2015 00:35:05 +0000 (00:35 +0000)]
Give lldb a clean null build.

`ninja lldb` used to always run "echo -n", which on OS X results in literally
echoing "-n" to the screen.  Just remove the command from add_custom_target,
then it only adds an alias and `ninja lldb` now reports "no work to do".

Other than that, no intended behavior change.

llvm-svn: 226233

9 years agoThis should fix the build bot clang-cmake-armv7-a15-full failing on
Kevin Enderby [Fri, 16 Jan 2015 00:27:31 +0000 (00:27 +0000)]
This should fix the build bot clang-cmake-armv7-a15-full failing on
the macho-archive-headers.test added with r226228.

llvm-svn: 226232

9 years agoAdd comment regarding which i386 registers are non-volatile instead of
Jason Molenda [Fri, 16 Jan 2015 00:27:25 +0000 (00:27 +0000)]
Add comment regarding which i386 registers are non-volatile instead of
just pointing to the standard document regarding this.

llvm-svn: 226231

9 years agoR600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32
Matt Arsenault [Thu, 15 Jan 2015 23:58:35 +0000 (23:58 +0000)]
R600/SI: Add patterns for v_cvt_{flr|rpi}_i32_f32

llvm-svn: 226230