platform/upstream/llvm.git
9 years agoUse StringRefMemoryObject. NFC.
Rafael Espindola [Fri, 7 Nov 2014 00:52:15 +0000 (00:52 +0000)]
Use StringRefMemoryObject. NFC.

llvm-svn: 221502

9 years agoLoopVectorize: Don't assume pointees are sized
David Majnemer [Fri, 7 Nov 2014 00:31:14 +0000 (00:31 +0000)]
LoopVectorize: Don't assume pointees are sized

A pointer's pointee might not be sized: the pointee could be a function.

Report this as IK_NoInduction when calculating isInductionVariable.

This fixes PR21508.

llvm-svn: 221501

9 years ago[PECOFF] Improve subsystem inference
Rui Ueyama [Thu, 6 Nov 2014 23:50:48 +0000 (23:50 +0000)]
[PECOFF] Improve subsystem inference

If /subsystem option is not given, the linker needs to infer the
subsystem based on the entry point symbol. If it fails to infer
that, the linker should error out on it.

LLD was almost correct, but it would fail to infer the subsystem
if the entry point is specified with /entry. This is because the
subsystem inference was coupled with the entry point function
searching (if no entry point name is specified, the linker needs
to find the right entry name).

This patch makes the subsystem inference an independent pass to
fix the issue. Now, as long as an entry point function is defined,
LLD can infer the subsystem no matter how it resolved the entry
point.

I don't think scanning all the defined symbols is fast, although
it shouldn't be that slow. The file class there does not provide
any easy way to find an atom by name, so this is what we can do
at this moment. I'd like to revisit this later to make it more
efficient.

llvm-svn: 221499

9 years agoInstCombine: Rely on cmpxchg's return code when it's strong
David Majnemer [Thu, 6 Nov 2014 23:23:30 +0000 (23:23 +0000)]
InstCombine: Rely on cmpxchg's return code when it's strong

Comparing the result of a cmpxchg instruction can be replaced with an
extractvalue of the cmpxchg success indicator.

llvm-svn: 221498

9 years agoRemove unused variable. NFC.
Rafael Espindola [Thu, 6 Nov 2014 23:16:57 +0000 (23:16 +0000)]
Remove unused variable. NFC.

llvm-svn: 221497

9 years agoFixes so tests compile and run remotely.
Greg Clayton [Thu, 6 Nov 2014 22:59:28 +0000 (22:59 +0000)]
Fixes so tests compile and run remotely.

Fixes include:
- dont set or change LDFLAGS, but set LD_EXTRAS instead
- fix compilation errors for iOS based builds with objective C code
    - fix test cases to create classes instead of relying on classes from AppKit
    - rename things where it makes sense

llvm-svn: 221496

9 years agoDon't repeat names in comments. NFC.
Rafael Espindola [Thu, 6 Nov 2014 22:57:10 +0000 (22:57 +0000)]
Don't repeat names in comments. NFC.

llvm-svn: 221495

9 years agoChanged program to go along with the previous commit to allow this test to be run...
Greg Clayton [Thu, 6 Nov 2014 22:56:56 +0000 (22:56 +0000)]
Changed program to go along with the previous commit to allow this test to be run remotely via lldb-platform.

llvm-svn: 221494

9 years agoFix the test to not have to run the binary separately first to get the golden output...
Greg Clayton [Thu, 6 Nov 2014 22:56:15 +0000 (22:56 +0000)]
Fix the test to not have to run the binary separately first to get the golden output, use the process STDOUT instead.

This helps this test be able to be run remotely.

llvm-svn: 221493

9 years agoMake sure stderr is filtered out in case xcodebuild or xcrun print errors when gettin...
Greg Clayton [Thu, 6 Nov 2014 22:55:09 +0000 (22:55 +0000)]
Make sure stderr is filtered out in case xcodebuild or xcrun print errors when getting the SDK path and use xcrun to find the SDK path.

llvm-svn: 221492

9 years ago[ELF][yaml2obj] Handle additional MIPS specific st_other field flags
Simon Atanasyan [Thu, 6 Nov 2014 22:46:24 +0000 (22:46 +0000)]
[ELF][yaml2obj] Handle additional MIPS specific st_other field flags

The ELF symbol `st_other` field might contain additional flags besides
visibility ones. This patch implements support for some MIPS specific
flags.

llvm-svn: 221491

9 years agoFactor out call to push_back. NFC.
Rafael Espindola [Thu, 6 Nov 2014 22:39:16 +0000 (22:39 +0000)]
Factor out call to push_back. NFC.

llvm-svn: 221490

9 years ago[X86][SSE] Vector integer/float conversion memory folding (cvttps2dq / cvttpd2dq)
Simon Pilgrim [Thu, 6 Nov 2014 22:15:41 +0000 (22:15 +0000)]
[X86][SSE] Vector integer/float conversion memory folding (cvttps2dq / cvttpd2dq)

Fixed an issue with the (v)cvttps2dq and (v)cvttpd2dq instructions being incorrectly put in the 2 source operand folding tables instead of the 1 source operand and added the missing SSE/AVX versions.

Also added missing (v)cvtps2dq and (v)cvtpd2dq instructions to the folding tables.

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

llvm-svn: 221489

9 years ago[X86] Add VFMADDSUB cases for the 213->231 custom inserter.
Ahmed Bougacha [Thu, 6 Nov 2014 22:04:15 +0000 (22:04 +0000)]
[X86] Add VFMADDSUB cases for the 213->231 custom inserter.

Also add tests for vfmadd/vfmsub.

llvm-svn: 221488

9 years ago[X86] Add missing FMA3 VFMADDSUB in the emitter.
Ahmed Bougacha [Thu, 6 Nov 2014 21:58:11 +0000 (21:58 +0000)]
[X86] Add missing FMA3 VFMADDSUB in the emitter.

Also reuse the fma4 intrinsic test to cover fma3 instructions too.

llvm-svn: 221487

9 years agoThis is a large, but clearical, commit that enables the C++ formatters to take on...
Enrico Granata [Thu, 6 Nov 2014 21:55:30 +0000 (21:55 +0000)]
This is a large, but clearical, commit that enables the C++ formatters to take on the additional TypeSummaryOptions argument. It is still not used for anything, but it is now there. Adding support for this extra argument to Python formatters will follow suit

llvm-svn: 221486

9 years agoObject, COFF: Don't consider AuxFunctionDefinition for getSymbolSize
David Majnemer [Thu, 6 Nov 2014 21:46:55 +0000 (21:46 +0000)]
Object, COFF: Don't consider AuxFunctionDefinition for getSymbolSize

mingw lies about the size of a function's AuxFunctionDefinition.  Ignore
the field and rely on our heuristic to determine the symbol's size.

llvm-svn: 221485

9 years ago[X86] Split FMA4 RM tests into a separate file. NFC.
Ahmed Bougacha [Thu, 6 Nov 2014 21:46:23 +0000 (21:46 +0000)]
[X86] Split FMA4 RM tests into a separate file. NFC.

While there, remove useless comments.

llvm-svn: 221484

9 years agoFix formatting
Tobias Grosser [Thu, 6 Nov 2014 21:25:54 +0000 (21:25 +0000)]
Fix formatting

llvm-svn: 221483

9 years agoIntroduce the notion of "type summary options" as flags that can be passed down to...
Enrico Granata [Thu, 6 Nov 2014 21:23:20 +0000 (21:23 +0000)]
Introduce the notion of "type summary options" as flags that can be passed down to individual summary formatters to alter their behavior in a formatter-dependent way
Two flags are introduced:
- preferred display language (as in, ObjC vs. C++)
- summary capping (as in, should a limit be put to the amount of data retrieved)

The meaning - if any - of these options is for individual formatters to establish
The topic of a subsequent commit will be to actually wire these through to individual data formatters

llvm-svn: 221482

9 years agoReturn a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...
Frederic Riss [Thu, 6 Nov 2014 21:12:06 +0000 (21:12 +0000)]
Return a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...

... instead of a DIScope that might wrap something that's not actually
a DIScope (eg. a DIGlobalVariable);

llvm-svn: 221481

9 years agoBase check on the section name, not the variable name.
Rafael Espindola [Thu, 6 Nov 2014 20:01:34 +0000 (20:01 +0000)]
Base check on the section name, not the variable name.

The variable is private, so the name should not be relied on. Also, the
linker uses the sections, so asan should too when trying to avoid causing
the linker problems.

llvm-svn: 221480

9 years agoExplicitly annotate loops we want to run thread-parallel
Tobias Grosser [Thu, 6 Nov 2014 19:35:21 +0000 (19:35 +0000)]
Explicitly annotate loops we want to run thread-parallel

We introduces a new flag -polly-parallel and use it to annotate the for-nodes in
the isl ast that we want to execute thread parallel (e.g., using OpenMP). We
previously already emmitted openmp annotations, but we did this for various
kinds of parallel loops, including some which we can not run in parallel.

With this patch we now have three annotations:

  1) #pragma known-parallel [reduction]
  2) #pragma omp for
  3) #pragma simd

meaning:

  1) loop has no loop carried dependences
  2) loop will be executed thread-parallel
  3) loop can possibly be vectorized

This patch introduces 1) and reduces the use of 2) to only the cases where we
will actually generate thread parallel code.

It is in preparation of openmp code generation in our isl backend.

Legacy:

- We also have a command line option -enable-polly-openmp. This option controls
  the OpenMP code generation in CLooG. It will become an alias of
  -polly-parallel after the CLooG code generation has been dropped.

http://reviews.llvm.org/D6142

llvm-svn: 221479

9 years agoremove unneeded { }
Nick Kledzik [Thu, 6 Nov 2014 19:33:59 +0000 (19:33 +0000)]
remove unneeded { }

llvm-svn: 221478

9 years ago[mach-o] Add support for -force_load option
Nick Kledzik [Thu, 6 Nov 2014 19:33:57 +0000 (19:33 +0000)]
[mach-o] Add support for -force_load option

The darwin linker has two ways to force all members of an archive to be loaded.
The -all_load option applies to all static libraries.  The -force_load takes
a path to a library and just that library's members are force loaded.

llvm-svn: 221477

9 years agoHandle types from the runtime that conform to
Sean Callanan [Thu, 6 Nov 2014 19:26:10 +0000 (19:26 +0000)]
Handle types from the runtime that conform to
protocols.

<rdar://problem/18883778>

llvm-svn: 221476

9 years ago[RegAlloc] Remove reference to the trivial spiller in test case.
Lang Hames [Thu, 6 Nov 2014 19:24:18 +0000 (19:24 +0000)]
[RegAlloc] Remove reference to the trivial spiller in test case.

This test case was never actually testing the trivial spiller: the -spiller
option has not been hooked up for a while now.

llvm-svn: 221475

9 years ago[RegAlloc] Kill off the trivial spiller - nobody is using it any more.
Lang Hames [Thu, 6 Nov 2014 19:12:38 +0000 (19:12 +0000)]
[RegAlloc] Kill off the trivial spiller - nobody is using it any more.

llvm-svn: 221474

9 years ago[mach-o] Update test case to work with latest llvm-objdump output for ARM thumb
Kevin Enderby [Thu, 6 Nov 2014 19:12:28 +0000 (19:12 +0000)]
[mach-o] Update test case to work with latest llvm-objdump output for ARM thumb
code.  Same basic change that was done in r218429 for ARM code.

Where the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler is now
plumbed in with r221470 from the llvm trunk.

llvm-svn: 221473

9 years agoIndentation fixes
Michael Liao [Thu, 6 Nov 2014 19:05:57 +0000 (19:05 +0000)]
Indentation fixes

llvm-svn: 221472

9 years agoTry to appease MSVC buildbots after r221466.
Frederic Riss [Thu, 6 Nov 2014 19:00:47 +0000 (19:00 +0000)]
Try to appease MSVC buildbots after r221466.

llvm-svn: 221471

9 years agoPlumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler and
Kevin Enderby [Thu, 6 Nov 2014 19:00:13 +0000 (19:00 +0000)]
Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler and
add the code and test cases for 32-bit ARM symbolizer.

Also fixed the printing of data in code as it was not using the table correctly
and needed to fix one of the test cases too.

This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak
for that is made. Which I’ll be committing immediately after this commit.

llvm-svn: 221470

9 years ago[Sanitizer] Introduce "stack_trace_format" runtime flag.
Alexey Samsonov [Thu, 6 Nov 2014 18:43:45 +0000 (18:43 +0000)]
[Sanitizer] Introduce "stack_trace_format" runtime flag.

This flag can be used to specify the format of stack frames - user
can now provide a string with placeholders, which should be printed
for each stack frame with placeholders replaced with actual data.
For example "%p" will be replaced by PC, "%s" will be replaced by
the source file name etc.

"DEFAULT" value enforces default stack trace format currently used in
all the sanitizers except TSan.

This change also implements __sanitizer_print_stack_trace interface
function in TSan.

llvm-svn: 221469

9 years agoPick better floating point numbers (ones that can be exactly represented) in floating...
Greg Clayton [Thu, 6 Nov 2014 18:39:39 +0000 (18:39 +0000)]
Pick better floating point numbers (ones that can be exactly represented) in floating point instead of something that can't to avoid test suite failures on different devices and architectures.

<rdar://problem/18826900>

llvm-svn: 221468

9 years agofixed minor code indenting http://reviews.llvm.org/D6127
Shawn Best [Thu, 6 Nov 2014 17:52:15 +0000 (17:52 +0000)]
fixed minor code indenting  reviews.llvm.org/D6127

llvm-svn: 221467

9 years agoChange DIBuilder::createImportedDeclaration from taking a DIScope to a DIDescriptor.
Frederic Riss [Thu, 6 Nov 2014 17:46:55 +0000 (17:46 +0000)]
Change DIBuilder::createImportedDeclaration from taking a DIScope to a DIDescriptor.

Imported declarations can be DIGlobalVariables which aren't a DIScope. Today
clang (unknowingly I believe) shoehorns these into a DIScope and it all works
just because we never access the fields.

llvm-svn: 221466

9 years ago[Hexagon] Adding basic Hexagon ELF object emitter.
Colin LeMahieu [Thu, 6 Nov 2014 17:05:51 +0000 (17:05 +0000)]
[Hexagon] Adding basic Hexagon ELF object emitter.

llvm-svn: 221465

9 years agoClean up NVPTXLowerStructArgs.cpp. NFC
Eli Bendersky [Thu, 6 Nov 2014 17:05:49 +0000 (17:05 +0000)]
Clean up NVPTXLowerStructArgs.cpp. NFC

* Remove unnecessary const_casts and C-style casts
* Simplify attribute access code
* Simplify ArrayRef creation
* 80-col and clang-format

llvm-svn: 221464

9 years ago[mips] Removed IsSoftFloat from MipsISelLowering::analyzeCallOperands(). NFC
Daniel Sanders [Thu, 6 Nov 2014 16:48:57 +0000 (16:48 +0000)]
[mips] Removed IsSoftFloat from MipsISelLowering::analyzeCallOperands(). NFC

Summary:
It isn't used anymore.

Depends on D6081

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221463

9 years ago[Reassociate] Don't reassociate when mixing regular and fast-math FP
Chad Rosier [Thu, 6 Nov 2014 16:46:37 +0000 (16:46 +0000)]
[Reassociate] Don't reassociate when mixing regular and fast-math FP
instructions.  Inlining might cause such cases and it's not valid to
reassociate floating-point instructions without the unsafe algebra flag.

Patch by Mehdi Amini <mehdi_amini@apple.com>!

llvm-svn: 221462

9 years ago[mips] Removed MipsISelLowering::analyzeFormalArguments() in favour of CCState::Analy...
Daniel Sanders [Thu, 6 Nov 2014 16:36:30 +0000 (16:36 +0000)]
[mips] Removed MipsISelLowering::analyzeFormalArguments() in favour of CCState::AnalyzeFormalArguments()

Summary:
As with returns, we must be able to identify f128 arguments despite them
being lowered away. We do this with a pre-analyze step that builds a
vector and then we use this vector from the tablegen-erated code.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221461

9 years agoAdd support for UNSUPPORTED tag to lit
Eric Fiselier [Thu, 6 Nov 2014 15:26:20 +0000 (15:26 +0000)]
Add support for UNSUPPORTED tag to lit

llvm-svn: 221460

9 years agoUse FileCheck in a few tests.
Rafael Espindola [Thu, 6 Nov 2014 15:05:51 +0000 (15:05 +0000)]
Use FileCheck in a few tests.

llvm-svn: 221459

9 years agoRemove references to the cortex-a9-mp CPU.
Charlie Turner [Thu, 6 Nov 2014 14:59:30 +0000 (14:59 +0000)]
Remove references to the cortex-a9-mp CPU.

This CPU definition is redundant. The Cortex-A9 is defined as
supporting multiprocessing extensions. Remove references to this CPU.

This CPU was recently removed from LLVM. See http://reviews.llvm.org/D6057

Change-Id: I62ae7cc656fcae54fbaefc4b6976e77e694a8678
llvm-svn: 221458

9 years agoUse GET_CURRENT_FRAME() to calculate the memory layout for power. This works
Will Schmidt [Thu, 6 Nov 2014 14:58:06 +0000 (14:58 +0000)]
Use GET_CURRENT_FRAME() to calculate the memory layout for power. This works
for both PPC64 Big and Little endian modes, so also eliminates the need for
the BIG_ENDIAN/LITTLE_ENDIAN #ifdeffery.

By trial and error, it also looks like the kPPC64_ShadowOffset64 value is
valid using (1ULL << 41) for both BE and LE, so that #if/#elif/#endif block
has also been simplified.

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

llvm-svn: 221457

9 years agoCompute the correct jump table entries on 32 bit windows.
Rafael Espindola [Thu, 6 Nov 2014 14:39:49 +0000 (14:39 +0000)]
Compute the correct jump table entries on 32 bit windows.

On 32 bit windows we use label differences and .set does not suppress
rolocations, a combination that was not used before r220256.

This fixes PR21497.

llvm-svn: 221456

9 years ago[X86] When commuting SSE immediate blend, make sure that the new blend mask is a...
Andrea Di Biagio [Thu, 6 Nov 2014 14:36:45 +0000 (14:36 +0000)]
[X86] When commuting SSE immediate blend, make sure that the new blend mask is a valid imm8.

Example:
define <4 x i32> @test(<4 x i32> %a, <4 x i32> %b) {
  %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
  ret <4 x i32> %shuffle
}

Before llc (-mattr=+sse4.1), produced the following assembly instruction:
  pblendw $4294967103, %xmm1, %xmm0

After
  pblendw $63, %xmm1, %xmm0

llvm-svn: 221455

9 years agoFixing some -Wcast-qual warnings; NFC.
Aaron Ballman [Thu, 6 Nov 2014 14:32:30 +0000 (14:32 +0000)]
Fixing some -Wcast-qual warnings; NFC.

llvm-svn: 221454

9 years ago[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.
Toma Tabacu [Thu, 6 Nov 2014 14:25:42 +0000 (14:25 +0000)]
[mips] Tolerate the use of the %z inline asm operand modifier with non-immediates.

Summary:
Currently, we give an error if %z is used with non-immediates, instead of continuing as if the %z isn't there.

For example, you use the %z operand modifier along with the "Jr" constraints ("r" makes the operand a register, and "J" makes it an immediate, but only if its value is 0).
In this case, you want the compiler to print "$0" if the inline asm input operand turns out to be an immediate zero and you want it to print the register containing the operand, if it's not.

We give an error in the latter case, and we shouldn't (GCC also doesn't).

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 221453

9 years agoFix lldb-mi warnings so that it builds when --enable-werror is set.
Deepak Panickal [Thu, 6 Nov 2014 13:42:49 +0000 (13:42 +0000)]
Fix lldb-mi warnings so that it builds when --enable-werror is set.

llvm-svn: 221452

9 years agoDon't manually insert L prefixes.
Rafael Espindola [Thu, 6 Nov 2014 13:30:38 +0000 (13:30 +0000)]
Don't manually insert L prefixes.

Simply marking the symbol private conveys the desire to hide them to LLVM.

llvm-svn: 221451

9 years ago[mips] Add the following MIPS options that control gp-relative addressing of
Sasa Stankovic [Thu, 6 Nov 2014 13:20:12 +0000 (13:20 +0000)]
[mips] Add the following MIPS options that control gp-relative addressing of
small data items: -mgpopt, -mlocal-sdata, -mextern-sdata. Implement gp-relative
addressing for constants.

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

llvm-svn: 221450

9 years ago[X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add missing...
Andrea Di Biagio [Thu, 6 Nov 2014 12:08:57 +0000 (12:08 +0000)]
[X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add missing checks to test for target features.

This patch simplifies how default target features are set for AMD bdver2
and bdver1. In particular, method 'getDefaultFeatures' now implements a
fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'.
That is because 'bdver2' has the same features available in bdver1 plus
BMI, FMA, F16C and TBM.

This patch also adds missing checks for predefined macros in test
predefined-arch-macros.c. In the case of BTVER2, the test now also checks
for F16C, BMI and PCLMUL. In the case of BDVER3 and BDVER4, the test now
also checks for the presence of FSGSBASE.

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

llvm-svn: 221449

9 years agoFix for exception specification mismatch in explicit instantiation.
Alexey Bataev [Thu, 6 Nov 2014 10:10:50 +0000 (10:10 +0000)]
Fix for exception specification mismatch in explicit instantiation.
According to C++ standard if an exception-specification is specified in an explicit instantiation directive, it shall be compatible with the exception-specifications of other declarations of that function. This patch adds checks for this.
Differential Revision: http://reviews.llvm.org/D5822

llvm-svn: 221448

9 years ago[mips] Improve error/warning messages and testing for the .cpload assembler directive.
Toma Tabacu [Thu, 6 Nov 2014 10:02:45 +0000 (10:02 +0000)]
[mips] Improve error/warning messages and testing for the .cpload assembler directive.

Summary:
Improved warning message when using .cpload inside a reorder section and added an error message for using .cpload with Mips16 enabled.
Modified the tests to fit with the changes mentioned above, added a test-case for the N32 ABI in cpload.s and did some reformatting to make the tests easier to read.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 221447

9 years ago[JIT] Fix more missing endian conversions (opcodes for AArch64, ARM, and Mips stub...
Daniel Sanders [Thu, 6 Nov 2014 09:53:05 +0000 (09:53 +0000)]
[JIT] Fix more missing endian conversions (opcodes for AArch64, ARM, and Mips stub functions, and ARM target in general)

Summary:
Fixed all of the missing endian conversions that Lang Hames and I identified in
RuntimeDyldMachOARM.h.

Fixed the opcode emission in RuntimeDyldImpl::createStubFunction() for AArch64,
ARM, Mips when the host endian doesn't match the target endian.
PowerPC will need changing if it's opcodes are affected by endianness but I've
left this for now since I'm unsure if this is the case and it's the only path
that specifies the target endian.

This patch fixes MachO_ARM_PIC_relocations.s on a big-endian Mips host. This
is the last of the known issues on this host.

Reviewers: lhames

Reviewed By: lhames

Subscribers: aemerson, llvm-commits

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

llvm-svn: 221446

9 years agoUBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases
David Majnemer [Thu, 6 Nov 2014 08:55:23 +0000 (08:55 +0000)]
UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases

When the __virtual_mask is set, __offset_flags >> __offset_shift yields
an offset into the vtable.  Dereferencing this vtable slot gets us the
vbase offset.

Adjust a test case to verify that this, in fact, works.

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

llvm-svn: 221445

9 years agoObject, COFF: Infer symbol sizes from adjacent symbols
David Majnemer [Thu, 6 Nov 2014 08:10:41 +0000 (08:10 +0000)]
Object, COFF: Infer symbol sizes from adjacent symbols

Use the position of the subsequent symbol in the object file to infer
the size of it's predecessor.  I hope to eventually remove whatever COFF
specific details from this little algorithm so that we can unify this
logic with what Mach-O does.

llvm-svn: 221444

9 years agoX86, MC: Tidy up some whitespace in GetRelocType
David Majnemer [Thu, 6 Nov 2014 08:10:37 +0000 (08:10 +0000)]
X86, MC: Tidy up some whitespace in GetRelocType

No functionality change intended.

llvm-svn: 221443

9 years ago[Mips] Take into account that PIC code is inherently CPIC
Simon Atanasyan [Thu, 6 Nov 2014 07:07:29 +0000 (07:07 +0000)]
[Mips] Take into account that PIC code is inherently CPIC

Follow-up to r221439.

llvm-svn: 221442

9 years agoGCOV: Make sure that function idents in the .gcda and .gcno match
Justin Bogner [Thu, 6 Nov 2014 06:55:02 +0000 (06:55 +0000)]
GCOV: Make sure that function idents in the .gcda and .gcno match

When generating gcov compatible profiling, we sometimes skip emitting
data for functions for one reason or another. However, this was
emitting different function IDs in the .gcno and .gcda files, because
the .gcno case was using the loop index before skipping functions and
the .gcda the array index after. This resulted in completely invalid
gcov data.

This fixes the problem by making the .gcno loop track the ID
separately from the loop index.

llvm-svn: 221441

9 years ago[Mips] Follow-up to r221439. Include header to fix build on Windows.
Simon Atanasyan [Thu, 6 Nov 2014 06:28:40 +0000 (06:28 +0000)]
[Mips] Follow-up to r221439. Include header to fix build on Windows.

llvm-svn: 221440

9 years ago[Mips] Check ELF flags to prevent linking of incompatible files
Simon Atanasyan [Thu, 6 Nov 2014 05:53:10 +0000 (05:53 +0000)]
[Mips] Check ELF flags to prevent linking of incompatible files

1. The path checks ELF header flags to prevent linking of incompatible files.
   For example we do not allow to link files with different ABI, -mnan
   flags, some combination of target CPU etc.
2. The patch merge ELF header flags from input object files to put their
   combination to the generated file. For example, if some input files
   have EF_MIPS_NOREORDER flag we need to put this flag to the output
   file header.

I use the `parseFile()` (not `canParse()`) method because in case of
recognition of incorrect input flags combination we should show detailed
error message and stop the linking process and should not try to use
another `Reader`.

llvm-svn: 221439

9 years ago[Mips] Fix ELF flags for the non-PIC object file used in the test
Simon Atanasyan [Thu, 6 Nov 2014 05:52:54 +0000 (05:52 +0000)]
[Mips] Fix ELF flags for the non-PIC object file used in the test

No functional changes.

llvm-svn: 221438

9 years ago[X86] Use fallthroughs to reduce the number of calls to setFeatureEnabled for differe...
Craig Topper [Thu, 6 Nov 2014 05:52:19 +0000 (05:52 +0000)]
[X86] Use fallthroughs to reduce the number of calls to setFeatureEnabled for different CPUs.

llvm-svn: 221437

9 years agoAdd three other sections when L symbols are allowed.
Rafael Espindola [Thu, 6 Nov 2014 05:01:21 +0000 (05:01 +0000)]
Add three other sections when L symbols are allowed.

llvm-svn: 221436

9 years agoUse FileCheck.
Rafael Espindola [Thu, 6 Nov 2014 04:56:05 +0000 (04:56 +0000)]
Use FileCheck.

llvm-svn: 221435

9 years agoDelete dead test.
Rafael Espindola [Thu, 6 Nov 2014 04:48:05 +0000 (04:48 +0000)]
Delete dead test.

llvm-svn: 221434

9 years ago[ELF] Remove llvm::Twine usage
Shankar Easwaran [Thu, 6 Nov 2014 03:03:58 +0000 (03:03 +0000)]
[ELF] Remove llvm::Twine usage

llvm-svn: 221433

9 years ago[mach-o] Add support for -S option
Nick Kledzik [Thu, 6 Nov 2014 03:03:42 +0000 (03:03 +0000)]
[mach-o] Add support for -S option

The darwin linker does not process dwarf debug info.  Instead it produces a
"debug map" in the output file which points back to the original .o files for
anything that wants debug info (e.g. debugger).

The -S option means "don't add a debug map".  lld for mach-o currently does
not generate the debug map, so there is nothing to do when this option is used.
But we need to process the option to get existing projects building.

llvm-svn: 221432

9 years agoAllow L symbols in no_dead_strip sections.
Rafael Espindola [Thu, 6 Nov 2014 02:42:03 +0000 (02:42 +0000)]
Allow L symbols in no_dead_strip sections.

If a section cannot be dead stripped, it is safe to use L symbols, since
the linker will keep all of it in the end.

llvm-svn: 221431

9 years ago[ELF] Remove includes that are not used
Shankar Easwaran [Thu, 6 Nov 2014 02:35:42 +0000 (02:35 +0000)]
[ELF] Remove includes that are not used

llvm-svn: 221430

9 years ago[X86] Lower VSELECT into SHRUNKBLEND when we shrink the bits used into the
Quentin Colombet [Thu, 6 Nov 2014 02:25:03 +0000 (02:25 +0000)]
[X86] Lower VSELECT into SHRUNKBLEND when we shrink the bits used into the
condition to match a blend.
This prevents optimizations that work on VSELECT to perform invalid
transformations. Indeed, the optimized condition does not match the vector
boolean content that is expected and bad things may happen.

This patch yields the exact same code on the whole test-suite + specs (-O3 and
-O3 -march=core-avx2), it improves one test case (vector-blend.ll) and fixes a
bug reduced in vselect-avx.ll.

<rdar://problem/18819506>

llvm-svn: 221429

9 years ago[ELF] Use llvm::Twine
Shankar Easwaran [Thu, 6 Nov 2014 02:03:40 +0000 (02:03 +0000)]
[ELF] Use llvm::Twine

llvm-svn: 221428

9 years ago[ELF] Implement isLittleEndian for all architectures
Shankar Easwaran [Thu, 6 Nov 2014 02:03:38 +0000 (02:03 +0000)]
[ELF] Implement isLittleEndian for all architectures

llvm-svn: 221427

9 years ago[ELF] Use std::find_if instead
Shankar Easwaran [Thu, 6 Nov 2014 02:03:35 +0000 (02:03 +0000)]
[ELF] Use std::find_if instead

llvm-svn: 221426

9 years ago[mach-o] remove extra leading underscore on __bss and __got
Nick Kledzik [Thu, 6 Nov 2014 01:14:12 +0000 (01:14 +0000)]
[mach-o] remove extra leading underscore on __bss and __got

llvm-svn: 221425

9 years ago[mach-o] Add support for interposing tuples section
Nick Kledzik [Thu, 6 Nov 2014 01:14:09 +0000 (01:14 +0000)]
[mach-o] Add support for interposing tuples section

Darwin uses two-level-namespace lookup for symbols which means the static
linker records where each symbol must be found at runtime.  Thus defining a
symbol in a dylib loaded earlier will not effect where symbols needed by
later dylibs will be found.  Instead overriding is done through a section
of type S_INTERPOSING which contains tuples of <interposer, interposee>.

llvm-svn: 221424

9 years ago[PECOFF] Add a comment for SECREL relocation.
Rui Ueyama [Thu, 6 Nov 2014 01:14:02 +0000 (01:14 +0000)]
[PECOFF] Add a comment for SECREL relocation.

llvm-svn: 221423

9 years agoRemove unnecessary .c_str() when implicitly converting to Twine
Matt Arsenault [Thu, 6 Nov 2014 01:13:27 +0000 (01:13 +0000)]
Remove unnecessary .c_str() when implicitly converting to Twine

llvm-svn: 221422

9 years ago[mach-o] Add support for interposing tuples section
Nick Kledzik [Thu, 6 Nov 2014 01:09:13 +0000 (01:09 +0000)]
[mach-o] Add support for interposing tuples section

Darwin uses two-level-namespace lookup for symbols which means the static
linker records where each symbol must be found at runtime.  Thus defining a
symbol in a dylib loaded earlier will not effect where symbols needed by
later dylibs will be found.  Instead overriding is done through a section
of type S_INTERPOSING which contains tuples of <interposer, interposee>.

llvm-svn: 221421

9 years ago[PECOFF] Fix SECREL relocations.
Rui Ueyama [Thu, 6 Nov 2014 01:03:23 +0000 (01:03 +0000)]
[PECOFF] Fix SECREL relocations.

SECREL relocation's value is the offset to the beginning of the section.
Because of the off-by-one error, if a SECREL relocation target is at the
beginning of a section, it got wrong value.

Added a test that would have caught this.

llvm-svn: 221420

9 years ago[Docs][JIT] Update the clang++ invocation lines in the kaleidoscope docs.
Lang Hames [Thu, 6 Nov 2014 00:31:04 +0000 (00:31 +0000)]
[Docs][JIT] Update the clang++ invocation lines in the kaleidoscope docs.

The old examples had missing/incorrect flags that were causing failures on newer
versions of clang and the tutorial code.

llvm-svn: 221419

9 years agoExtract SCEV generation into subfunction
Tobias Grosser [Thu, 6 Nov 2014 00:27:01 +0000 (00:27 +0000)]
Extract SCEV generation into subfunction

This makes the code more readable and will be reused in subsequent OpenMP
patches.

llvm-svn: 221418

9 years agoPatch for small addition to availability attribute.
Fariborz Jahanian [Wed, 5 Nov 2014 23:58:55 +0000 (23:58 +0000)]
Patch for small addition to availability attribute.
This is to accept "NA" in place of vesion number for availability
attribute. Used on introduced=NA to mean unavailable
and deprecated=NA to mean nothing (not deprecated).
rdar://18804883

llvm-svn: 221417

9 years agoFixed the C++ method name class to be a bit more picky about what it identifies as...
Greg Clayton [Wed, 5 Nov 2014 23:56:37 +0000 (23:56 +0000)]
Fixed the C++ method name class to be a bit more picky about what it identifies as a C++ method.

This was done by using regular expressions on any basename we find to ensure it is valid.

This fixed setting breakpoints by name with values like '[J]com.robovm.debug.server.apps.SleepLoop.startingUp()V'. This was previously triggering the C++ method name class to identify the string as C++ with a basename of '[J]com.robovm.debug.server.apps.SleepLoop.startingUp' which was obviously incorrect.

The changes also fixed errors in templated function names like "void foo<int>(...)" where "void foo<int>" was being identified incorrectly as the basename. We also handle more C++ operators correctly now.

llvm-svn: 221416

9 years agocmake: Only export targets in the standalone build
Reid Kleckner [Wed, 5 Nov 2014 23:51:45 +0000 (23:51 +0000)]
cmake: Only export targets in the standalone build

Trying to fix bots that didn't like the fact that I exported targets
that depended on LLVM without exporting targets from LLVM.

llvm-svn: 221415

9 years agoFix shadowed variable warning
Nick Kledzik [Wed, 5 Nov 2014 23:40:04 +0000 (23:40 +0000)]
Fix shadowed variable warning

llvm-svn: 221414

9 years agocmake: Make the LLDB standalone build work for me
Reid Kleckner [Wed, 5 Nov 2014 23:23:18 +0000 (23:23 +0000)]
cmake: Make the LLDB standalone build work for me

This allows me to generate a Visual Studio solution that builds LLDB if
you have standalone builds of LLVM and Clang lying around.
Unfortunately, you have to pass *four* CMake variables in, but it means
you don't have to take the extra step of installing Clang and LLVM to
some package prefix.

Hopefully this will generate a more usable XCode project too.

llvm-svn: 221413

9 years agoMachO: Remove an unused variable from processSection
David Majnemer [Wed, 5 Nov 2014 23:22:41 +0000 (23:22 +0000)]
MachO: Remove an unused variable from processSection

The local variable `cfi` became dead in r220730 when it's use was
obviated; it was replaced with a call to read32.

No functionality change intended.

llvm-svn: 221412

9 years agoMake it easier to build against a pre-built Clang package with CMake
Reid Kleckner [Wed, 5 Nov 2014 23:14:59 +0000 (23:14 +0000)]
Make it easier to build against a pre-built Clang package with CMake

Installing <prefix>/share/clang/cmake/ClangConfig.cmake makes CMake's
builtin find_package() utility work with Clang. This also allows
downstream consumers of Clang to statically link against libraries like
clangAST and have that pull in dependencies like clangBasic and
LLVMSupport.

See the CMake docs on packages:
http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

llvm-svn: 221411

9 years agoThread Safety Analysis: move warnings on range-based for loops out of beta
DeLesley Hutchins [Wed, 5 Nov 2014 23:09:28 +0000 (23:09 +0000)]
Thread Safety Analysis: move warnings on range-based for loops out of beta
and into -Wthread-safety.

llvm-svn: 221410

9 years ago[Sanitizer] Introduce generic stack frame rendering machinery
Alexey Samsonov [Wed, 5 Nov 2014 22:44:36 +0000 (22:44 +0000)]
[Sanitizer] Introduce generic stack frame rendering machinery

Summary:
This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.

Test Plan: compiler-rt test suite

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

llvm-svn: 221409

9 years ago[mips64] Fix MIPS64 exception personality encoding
Petar Jovanovic [Wed, 5 Nov 2014 22:42:31 +0000 (22:42 +0000)]
[mips64] Fix MIPS64 exception personality encoding

Remove dynamic relocations of __gxx_personality_v0 from the .eh_frame.
The MIPS64 follow-up of the MIPS32 fix (rL209907).

Patch by Vladimir Stefanovic.

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

llvm-svn: 221408

9 years ago[X86][SSE] Vector integer to float conversion memory folding
Simon Pilgrim [Wed, 5 Nov 2014 22:28:25 +0000 (22:28 +0000)]
[X86][SSE] Vector integer to float conversion memory folding

Added missing memory folding for the (V)CVTDQ2PS instructions - we can safely fold these (but not the (V)CVTDQ2PD versions which have a register/memory size discrepancy in the source operand). I've added a test case demonstrating that stack folding now works.

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

llvm-svn: 221407

9 years ago[docs] Document usage of Inputs/ for extra test files.
Sean Silva [Wed, 5 Nov 2014 22:17:18 +0000 (22:17 +0000)]
[docs] Document usage of Inputs/ for extra test files.

llvm-svn: 221406

9 years agoDecouple ProcessWindows from the Windows debug driver thread.
Zachary Turner [Wed, 5 Nov 2014 22:16:28 +0000 (22:16 +0000)]
Decouple ProcessWindows from the Windows debug driver thread.

In the llgs world, ProcessWindows will eventually go away and
we'll implement a different protocol.  This patch decouples
ProcessWindows from the core debug loop so that this transition
will not be more difficult than it needs to be.

llvm-svn: 221405

9 years agoThis patch fixes a crash after rebuilding call AST of
Fariborz Jahanian [Wed, 5 Nov 2014 21:50:22 +0000 (21:50 +0000)]
This patch fixes a crash after rebuilding call AST of
an __unknown_anytype(...). In this case, we rebuild the
vararg function type specially to convert the call expression
to  something that IRGen can handle. However, FunctionDecl
as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and
results in crash when accessing its params later on. This
patch fixes the crash by rebuilding the FunctionDecl to match
its new resolved type. rdar://15297105.
John McCall, please review post-commit.

llvm-svn: 221404

9 years ago[Linker] Add some test coverage for llvm.ident merging
Sean Silva [Wed, 5 Nov 2014 21:33:34 +0000 (21:33 +0000)]
[Linker] Add some test coverage for llvm.ident merging

llvm-svn: 221403

9 years agoAllow inline test case to register actually useful teardown hooks by allowing a hook...
Enrico Granata [Wed, 5 Nov 2014 21:31:57 +0000 (21:31 +0000)]
Allow inline test case to register actually useful teardown hooks by allowing a hook to be passed back the test instance, were it not to be already bound to self. Use this ability to make the reversal of escape-non-printables a teardown hook for added reliability of the testing logic

llvm-svn: 221402