platform/upstream/llvm.git
10 years agoMC: collapse emission of producer
Saleem Abdulrasool [Thu, 17 Jul 2014 16:27:35 +0000 (16:27 +0000)]
MC: collapse emission of producer

Rather than use three EmitBytes, concatenate the string at compile time,
constructing a single StringRef and emitting the data in one shot.  This also
creates nicer assembly output.  NFC.

llvm-svn: 213273

10 years ago[Refactor] Move code out of the IslAst header
Johannes Doerfert [Thu, 17 Jul 2014 16:11:28 +0000 (16:11 +0000)]
[Refactor] Move code out of the IslAst header

  Offer the static functions to extract information out of an IslAst for node
  as members of IslAstInfo not as top level entities.

  + Refactor common code
  + Add isParallel and isReductionParallel
  + Rename IslAstUser to IslAstUserPayload to make it clear this is just a (or
    the) payload struct.

llvm-svn: 213272

10 years agoFix bug #20335 - memory leak when move-constructing a string with unequal allocator...
Marshall Clow [Thu, 17 Jul 2014 15:32:20 +0000 (15:32 +0000)]
Fix bug #20335 - memory leak when move-constructing a string with unequal allocator. Thanks to Thomas Koeppe for the report

llvm-svn: 213269

10 years ago[NVPTX] Flag surface/texture query instructions with IsTexSurfQuery
Justin Holewinski [Thu, 17 Jul 2014 14:51:33 +0000 (14:51 +0000)]
[NVPTX] Flag surface/texture query instructions with IsTexSurfQuery

Also, add some tests to make sure we can handle surface/texture
queries on both Fermi and Kepler+.

llvm-svn: 213268

10 years agoHandle __assume in the VoidExprEvaluator
Hal Finkel [Thu, 17 Jul 2014 14:49:58 +0000 (14:49 +0000)]
Handle __assume in the VoidExprEvaluator

This is a follow-up to an IRC conversation with Richard last night; __assume
does not evaluate its argument, and so the argument should not contribute to
whether (__assume(e), constant) can be used where a constant is required.

llvm-svn: 213267

10 years agoAdd an __assume side-effects warning
Hal Finkel [Thu, 17 Jul 2014 14:25:55 +0000 (14:25 +0000)]
Add an __assume side-effects warning

In MS-compatibility mode, we support the __assume builtin. The __assume builtin
does not evaluate its arguments, and we should issue a warning if __assume is
provided with an argument with side effects (because these effects will be
discarded).

This is similar in spirit to the warnings issued by other compilers (Intel
Diagnostic 2261, MS Compiler Warning C4557).

llvm-svn: 213266

10 years agoUsing a std::string instead of a StringRef because the Default case synthesizes a...
Aaron Ballman [Thu, 17 Jul 2014 13:28:50 +0000 (13:28 +0000)]
Using a std::string instead of a StringRef because the Default case synthesizes a temporary std::string from a Twine. Assigning that into a StringRef causes the StringRef to refer to a temporary, and bad things happen.

This fixes a failing test case on Windows.

llvm-svn: 213265

10 years ago[asan] Remove leftover debug printf.
Evgeniy Stepanov [Thu, 17 Jul 2014 13:05:21 +0000 (13:05 +0000)]
[asan] Remove leftover debug printf.

llvm-svn: 213264

10 years ago[asan] Fix malloc interception on Android L Preview.
Evgeniy Stepanov [Thu, 17 Jul 2014 12:48:45 +0000 (12:48 +0000)]
[asan] Fix malloc interception on Android L Preview.

Format of __libc_malloc_dispatch has changed in Android L.
While we are moving towards a solution that does not depend on bionic
internals, here is something to support both K* and L releases.

llvm-svn: 213263

10 years ago[OPENMP] Initial parsing and sema analysis of 'mergeable' clause.
Alexey Bataev [Thu, 17 Jul 2014 12:47:03 +0000 (12:47 +0000)]
[OPENMP] Initial parsing and sema analysis of 'mergeable' clause.

llvm-svn: 213262

10 years agoARM: Add ACLE memory barrier intrinsic mapping
Yi Kong [Thu, 17 Jul 2014 12:45:17 +0000 (12:45 +0000)]
ARM: Add ACLE memory barrier intrinsic mapping

llvm-svn: 213261

10 years agoRevert "Handle diagnostic warnings in Frontend diagnostic handler."
Alp Toker [Thu, 17 Jul 2014 12:29:08 +0000 (12:29 +0000)]
Revert "Handle diagnostic warnings in Frontend diagnostic handler."

This commit is missing tests and there are a few points that need to be
addressed before a new user-facing option can be added:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140714/110198.html

This reverts commit r213112.

llvm-svn: 213260

10 years agoFixing the objc_runtine_name documentation so that the code block is properly generated.
Aaron Ballman [Thu, 17 Jul 2014 12:25:32 +0000 (12:25 +0000)]
Fixing the objc_runtine_name documentation so that the code block is properly generated.

llvm-svn: 213259

10 years agoclang-format: Fix parsing of conditional expressions.
Daniel Jasper [Thu, 17 Jul 2014 12:22:04 +0000 (12:22 +0000)]
clang-format: Fix parsing of conditional expressions.

Before:
  aaaaaa = aaaaaaaaaaaa ? aaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      : aaaaaaaaaaaaaaaaaaaaaa
      : aaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  aaaaaa = aaaaaaaaaaaa
               ? aaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                            : aaaaaaaaaaaaaaaaaaaaaa
               : aaaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 213258

10 years ago[OPENMP] Initial support for parsing and sema analysis of 'untied' clause.
Alexey Bataev [Thu, 17 Jul 2014 12:19:31 +0000 (12:19 +0000)]
[OPENMP] Initial support for parsing and sema analysis of 'untied' clause.

llvm-svn: 213257

10 years ago[NVPTX] Add more surface/texture intrinsics, including CUDA unified texture fetch
Justin Holewinski [Thu, 17 Jul 2014 11:59:04 +0000 (11:59 +0000)]
[NVPTX] Add more surface/texture intrinsics, including CUDA unified texture fetch

This also uses TSFlags to mark machine instructions that are surface/texture
accesses, as well as the vector width for surface operations.  This is used
to simplify some of the switch statements that need to detect surface/texture
instructions

llvm-svn: 213256

10 years agoUpstream an MS inline assembly test from Mozilla's inline assembly code
Ehsan Akhgari [Thu, 17 Jul 2014 11:38:22 +0000 (11:38 +0000)]
Upstream an MS inline assembly test from Mozilla's inline assembly code

Summary:
I'm planning on upstreaming some test cases for the inline assembly
usage in the Mozilla code base.  A lot of these test cases test the
recent fixes to this code.

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 213255

10 years agoARM: support direct f16 <-> f64 conversions
Tim Northover [Thu, 17 Jul 2014 11:27:04 +0000 (11:27 +0000)]
ARM: support direct f16 <-> f64 conversions

ARMv8 has instructions to handle it, otherwise a libcall is needed.

llvm-svn: 213254

10 years ago[TABLEGEN] Do not crash on intrinsics with names longer than 40 characters
Justin Holewinski [Thu, 17 Jul 2014 11:23:29 +0000 (11:23 +0000)]
[TABLEGEN] Do not crash on intrinsics with names longer than 40 characters

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

llvm-svn: 213253

10 years agoCodeGen: generate single libcall for fptrunc -> f16 operations.
Tim Northover [Thu, 17 Jul 2014 11:12:12 +0000 (11:12 +0000)]
CodeGen: generate single libcall for fptrunc -> f16 operations.

Previously we asserted on this code. Currently compiler-rt doesn't
actually implement any of these new libcalls, but external help is
pretty much the only viable option for LLVM.

I've followed the much more generic "__truncST2" naming, as opposed to
the odd name for f32 -> f16 truncation. This can obviously be changed
later, or overridden by any targets that need to.

llvm-svn: 213252

10 years agoX86: support double extension of f16 type.
Tim Northover [Thu, 17 Jul 2014 11:04:04 +0000 (11:04 +0000)]
X86: support double extension of f16 type.

x86 has no native ability to extend an f16 to f64, but the same result
is obtained if we expand it into two separate extensions: f16 -> f32
-> f64.

Unfortunately the same is not true for truncate, so that still results
in a compilation failure.

llvm-svn: 213251

10 years agoPort memory barriers intrinsics to AArch64
Yi Kong [Thu, 17 Jul 2014 10:52:06 +0000 (10:52 +0000)]
Port memory barriers intrinsics to AArch64

Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to
implement their corresponding ACLE and MSVC intrinsics.

This patch ports ARM dmb, dsb, isb intrinsic to AArch64.

Requires LLVM r213247.

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

llvm-svn: 213250

10 years agoIR: update Clang to use polymorphic __fp16 conversion intrinsics.
Tim Northover [Thu, 17 Jul 2014 10:51:31 +0000 (10:51 +0000)]
IR: update Clang to use polymorphic __fp16 conversion intrinsics.

There should be no change in semantics at this stage.

llvm-svn: 213249

10 years agoCodeGen: extend f16 conversions to permit types > float.
Tim Northover [Thu, 17 Jul 2014 10:51:23 +0000 (10:51 +0000)]
CodeGen: extend f16 conversions to permit types > float.

This makes the two intrinsics @llvm.convert.from.f16 and
@llvm.convert.to.f16 accept types other than simple "float". This is
only strictly needed for the truncate operation, since otherwise
double rounding occurs and there's no way to represent the strict IEEE
conversion. However, for symmetry we allow larger types in the extend
too.

During legalization, we can expand an "fp16_to_double" operation into
two extends for convenience, but abort when the truncate isn't legal. A new
libcall is probably needed here.

Even after this commit, various target tweaks are needed to actually use the
extended intrinsics. I've put these into separate commits for clarity, so there
are no actual tests of f64 conversion here.

llvm-svn: 213248

10 years agoPort memory barriers intrinsics to AArch64
Yi Kong [Thu, 17 Jul 2014 10:50:20 +0000 (10:50 +0000)]
Port memory barriers intrinsics to AArch64

Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to
implement their corresponding ACLE and MSVC intrinsics.

This patch ports ARM dmb, dsb, isb intrinsic to AArch64.

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

llvm-svn: 213247

10 years ago[mips] .reginfo is 8 byte aligned on N32.
Daniel Sanders [Thu, 17 Jul 2014 10:10:04 +0000 (10:10 +0000)]
[mips] .reginfo is 8 byte aligned on N32.

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

llvm-svn: 213246

10 years agoMake the diagnostic message more complete to check the check name.
Alexander Kornienko [Thu, 17 Jul 2014 10:05:26 +0000 (10:05 +0000)]
Make the diagnostic message more complete to check the check name.

llvm-svn: 213245

10 years ago[mips] Correct ELF e_flags for the N32 ABI when using a mips-* triple rather than...
Daniel Sanders [Thu, 17 Jul 2014 10:02:08 +0000 (10:02 +0000)]
[mips] Correct ELF e_flags for the N32 ABI when using a mips-* triple rather than a mips64-* triple

Summary:
Generally speaking, mips-* vs mips64-* should not be used to make decisions
about the content or format of the ELF. This should be based on the ABI
and CPU in use. For example, `mips-linux-gnu-clang -mips64r2 -mabi=64`
should produce an ELF64 as should `mips64-linux-gnu-clang -mabi=64`.
Conversely, `mips64-linux-gnu-clang -mabi=n32` should produce an ELF32 as
should `mips-linux-gnu-clang -mips64r2 -mabi=n32`.

This patch fixes the e_flags but leaves the ELF32 vs ELF64 issue for now
since there is no apparent way to base this decision on the ABI and CPU.

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

llvm-svn: 213244

10 years ago[mips] Correct .MIPS.abiflags for -mfpxx on MIPS32r6
Daniel Sanders [Thu, 17 Jul 2014 09:57:23 +0000 (09:57 +0000)]
[mips] Correct .MIPS.abiflags for -mfpxx on MIPS32r6

Summary:
The cpr1_size field describes the minimum register width to run the program
rather than the size of the registers on the target. MIPS32r6 was acting
as if -mfp64 has been given because it starts off with 64-bit FPU registers.

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

llvm-svn: 213243

10 years ago[mips] Fix ELF e_flags related to -mabicalls and -mplt.
Daniel Sanders [Thu, 17 Jul 2014 09:52:56 +0000 (09:52 +0000)]
[mips] Fix ELF e_flags related to -mabicalls and -mplt.

Summary:
These options are not implemented yet but we act as if they are always
given.

The integrated assembler is driven by the clang driver so the e_flag test
cases should match the e_flags emitted by GCC+GAS rather than GAS
by itself.

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

llvm-svn: 213242

10 years ago[mips] Pass the ABI to the integrated assembler and add tests the existing arguments.
Daniel Sanders [Thu, 17 Jul 2014 09:46:40 +0000 (09:46 +0000)]
[mips] Pass the ABI to the integrated assembler and add tests the existing arguments.

Summary:
With this patch (and a corresponding LLVM patch), assembling an empty file with
GCC and Clang -fintegrated-as produce near identical objects. The remaining
differences are:
* GCC/GAS produce objects have a .pdr section
* GCC/GAS produce objects have a .gnu.attributes section
Other differences are insignificant such as precise file offsets and the order
of strings in the string table.

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

llvm-svn: 213241

10 years agoFix the prefix for arm64 triple
Yi Kong [Thu, 17 Jul 2014 09:43:27 +0000 (09:43 +0000)]
Fix the prefix for arm64 triple

Triple.cpp still returns "arm64" as prefix for arm64 triple, causing Clang not
being able to select the correct GCCBuiltin IR.

This patch changes the value to correct prefix "aarch64". Regression test will
be added in the coming patch.

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

llvm-svn: 213240

10 years ago[msan] Avoid redundant origin stores.
Evgeniy Stepanov [Thu, 17 Jul 2014 09:10:37 +0000 (09:10 +0000)]
[msan] Avoid redundant origin stores.

Origin is meaningless for fully initialized values. Avoid
storing origin for function arguments that are known to
be always initialized (i.e. shadow is a compile-time null
constant).

This is not about correctness, but purely an optimization.
Seems to affect compilation time of blacklisted functions
significantly.

llvm-svn: 213239

10 years ago[clang-tidy] MemsetZeroLenghtChecker: Don't crash trying to evaluate dependent values.
Benjamin Kramer [Thu, 17 Jul 2014 08:56:55 +0000 (08:56 +0000)]
[clang-tidy] MemsetZeroLenghtChecker: Don't crash trying to evaluate dependent values.

llvm-svn: 213238

10 years ago[OPENMP] Parsing/Sema analysis of directive 'master'
Alexander Musman [Thu, 17 Jul 2014 08:54:58 +0000 (08:54 +0000)]
[OPENMP] Parsing/Sema analysis of directive 'master'

llvm-svn: 213237

10 years agoConsistency on the tab/space
Sylvestre Ledru [Thu, 17 Jul 2014 08:40:35 +0000 (08:40 +0000)]
Consistency on the tab/space

llvm-svn: 213236

10 years agoFix Bug 14061 - scan-build crashes during postprocessing if BUGFILE no longer exists
Sylvestre Ledru [Thu, 17 Jul 2014 08:39:04 +0000 (08:39 +0000)]
Fix Bug 14061 -  scan-build crashes during postprocessing if BUGFILE no longer exists
Experienced with Thunderbird build

Patch by Matti Niemenmaa

llvm-svn: 213235

10 years ago[clang-tidy] Provide links to the google style guide for checks derived from it.
Benjamin Kramer [Thu, 17 Jul 2014 08:23:24 +0000 (08:23 +0000)]
[clang-tidy] Provide links to the google style guide for checks derived from it.

llvm-svn: 213233

10 years ago[OPENMP] Initial parsing and sema analysis for 'final' clause.
Alexey Bataev [Thu, 17 Jul 2014 07:32:53 +0000 (07:32 +0000)]
[OPENMP] Initial parsing and sema analysis for 'final' clause.

llvm-svn: 213232

10 years agoMove ashr optimization from InstCombineShift to InstSimplify.
Suyog Sarda [Thu, 17 Jul 2014 06:28:15 +0000 (06:28 +0000)]
Move ashr optimization from InstCombineShift to InstSimplify.
Refactor code, no functionality change, test case moved from instcombine to instsimplify.

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

llvm-svn: 213231

10 years agoUse range for
Matt Arsenault [Thu, 17 Jul 2014 06:19:06 +0000 (06:19 +0000)]
Use range for

llvm-svn: 213230

10 years agoR600: Short circuit alloca check if address space isn't private.
Matt Arsenault [Thu, 17 Jul 2014 06:13:41 +0000 (06:13 +0000)]
R600: Short circuit alloca check if address space isn't private.

Skip calling GetUnderlyingObject in cases where it obviously
isn't from an alloca. This should only be a compile time improvement.

llvm-svn: 213229

10 years agoFix Typo (first commit to test commit access)
Suyog Sarda [Thu, 17 Jul 2014 06:09:34 +0000 (06:09 +0000)]
Fix Typo (first commit to test commit access)

llvm-svn: 213228

10 years ago[lit] Add --show-unsupported flag to LIT
Eric Fiselier [Thu, 17 Jul 2014 05:53:00 +0000 (05:53 +0000)]
[lit] Add --show-unsupported flag to LIT

llvm-svn: 213227

10 years ago[libcxx] Add <experimental/utility> header for LFTS.
Eric Fiselier [Thu, 17 Jul 2014 05:31:31 +0000 (05:31 +0000)]
[libcxx] Add <experimental/utility> header for LFTS.

Summary:
This patch adds the `<experimental/utility>` header as specified in the latest draft of the library fundamentals TS.

`<experimental/utility>` only contains `class erased_type`.

This patch also updates the documentation to list the `erased_type` class as "initial implementation complete".

Test Plan:
Three test cases where added:

1. Test that `_LIBCPP_VERSION` is defined.
2. Test that `<utility>` has been included.
3. Test that `erased_type` is in the correct namespace and is constexpr default constructible.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 213226

10 years agoChange _LIBCXX_CONSTEXPR_AFTER_CXX11 to check for c++14 constexpr rules
Eric Fiselier [Thu, 17 Jul 2014 05:16:18 +0000 (05:16 +0000)]
Change _LIBCXX_CONSTEXPR_AFTER_CXX11 to check for c++14 constexpr rules

llvm-svn: 213225

10 years agoTrack the difference between
Richard Smith [Thu, 17 Jul 2014 05:12:35 +0000 (05:12 +0000)]
Track the difference between

 -- a constructor list initialization that unpacked an initializer list into
    constructor arguments and
 -- a list initialization that created as std::initializer_list and passed it
    as the first argument to a constructor

in the AST. Use this flag while instantiating templates to provide the right
semantics for the resulting initialization.

llvm-svn: 213224

10 years agoTest commit: Reverting whitespace changes
Eric Fiselier [Thu, 17 Jul 2014 05:10:03 +0000 (05:10 +0000)]
Test commit: Reverting whitespace changes

llvm-svn: 213223

10 years agoTest commit: whitespace change
Eric Fiselier [Thu, 17 Jul 2014 05:06:09 +0000 (05:06 +0000)]
Test commit: whitespace change

llvm-svn: 213222

10 years agoMC: make WinEH opcode an opaque value
Saleem Abdulrasool [Thu, 17 Jul 2014 03:08:50 +0000 (03:08 +0000)]
MC: make WinEH opcode an opaque value

This makes the opcode an opaque value (unsigned int) rather than the
enumeration.  This permits the use of target specific operands.

Split out the generic type into a MCWinEH header and add a supporting
MCWin64EH::Instruction to abstract out the selection of the opcode and
construction of the actual instruction.

llvm-svn: 213221

10 years agoFix FriendDecl source location and range for class templates and function declaration...
Nikola Smiljanic [Thu, 17 Jul 2014 01:59:34 +0000 (01:59 +0000)]
Fix FriendDecl source location and range for class templates and function declarations that don't start with 'friend' keyword. Add more unittests.

llvm-svn: 213220

10 years agoImprove BasicAA CS-CS queries (redux)
Hal Finkel [Thu, 17 Jul 2014 01:28:25 +0000 (01:28 +0000)]
Improve BasicAA CS-CS queries (redux)

This reverts, "r213024 - Revert r212572 "improve BasicAA CS-CS queries", it
causes PR20303." with a fix for the bug in pr20303. As it turned out, the
relevant code was both wrong and over-conservative (because, as with the code
it replaced, it would return the overall ModRef mask even if just Ref had been
implied by the argument aliasing results). Hopefully, this correctly fixes both
problems.

Thanks to Nick Lewycky for reducing the test case for pr20303 (which I've
cleaned up a little and added in DSE's test directory). The BasicAA test has
also been updated to check for this error.

Original commit message:

BasicAA contains knowledge of certain intrinsics, such as memcpy and memset,
and uses that information to form more-accurate answers to CallSite vs. Loc
ModRef queries. Unfortunately, it did not use this information when answering
CallSite vs. CallSite queries.

Generically, when an intrinsic takes one or more pointers and the intrinsic is
marked only to read/write from its arguments, the offset/size is unknown. As a
result, the generic code that answers CallSite vs. CallSite (and CallSite vs.
Loc) queries in AA uses UnknownSize when forming Locs from an intrinsic's
arguments. While BasicAA's CallSite vs. Loc override could use more-accurate
size information for some intrinsics, it did not do the same for CallSite vs.
CallSite queries.

This change refactors the intrinsic-specific logic in BasicAA into a generic AA
query function: getArgLocation, which is overridden by BasicAA to supply the
intrinsic-specific knowledge, and used by AA's generic implementation. This
allows the intrinsic-specific knowledge to be used by both CallSite vs. Loc and
CallSite vs. CallSite queries, and simplifies the BasicAA implementation.

Currently, only one function, Mac's memset_pattern16, is handled by BasicAA
(all the rest are intrinsics). As a side-effect of this refactoring, BasicAA's
getModRefBehavior override now also returns OnlyAccessesArgumentPointees for
this function (which is an improvement).

llvm-svn: 213219

10 years agoTwo fixes in the Objective-C language runtime:
Sean Callanan [Thu, 17 Jul 2014 01:20:37 +0000 (01:20 +0000)]
Two fixes in the Objective-C language runtime:

- First, when logging, be helpful by printing
  the real name of the class;

- Second, up the limit for number of classes
  from 16k to 128k, and put in an assertion
  (and better error handling when not in a
  debug configuration) when we cross that
  limit the next time.

<rdar://problem/17052976>

llvm-svn: 213218

10 years agoMS ABI: Padding injected between empty vbases doesn't up required align
David Majnemer [Thu, 17 Jul 2014 00:55:19 +0000 (00:55 +0000)]
MS ABI: Padding injected between empty vbases doesn't up required align

Only alignment is changed, not required alignment.

llvm-svn: 213217

10 years ago[PECOFF] Set DLL bit in PE header if DLL.
Rui Ueyama [Thu, 17 Jul 2014 00:22:26 +0000 (00:22 +0000)]
[PECOFF] Set DLL bit in PE header if DLL.

Windows loader can load a DLL without this bit but it wouldn't
call the initializer function in the DLL if the bit is absent.

llvm-svn: 213216

10 years ago[compiler-rt] [asan] Refactor DescribeAddressIfStack to allow reuse for debugging API
Kuba Brecka [Thu, 17 Jul 2014 00:18:03 +0000 (00:18 +0000)]
[compiler-rt] [asan] Refactor DescribeAddressIfStack to allow reuse for debugging API

Refactoring the DescribeAddressIfStack function in asan_report.cc to be able to reuse it for http://reviews.llvm.org/D4527.

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

llvm-svn: 213215

10 years agolibcxxabi cmake: Use HandleLLVMOptions.cmake, don't manually add -std=c++11.
Nico Weber [Wed, 16 Jul 2014 23:53:37 +0000 (23:53 +0000)]
libcxxabi cmake: Use HandleLLVMOptions.cmake, don't manually add -std=c++11.

No intended behavior change on Linux and Mac OS X.  On Windows, having libcxxabi
in one's checkout should now no longer break running cmake. (cl.exe supports
c++11, but doesn't understand a -std= flag.)

llvm-svn: 213214

10 years agoDebugInfo: Forward HandleTagDeclRequiredDefinition through MultiplexConsumer to fix...
David Blaikie [Wed, 16 Jul 2014 23:52:46 +0000 (23:52 +0000)]
DebugInfo: Forward HandleTagDeclRequiredDefinition through MultiplexConsumer to fix debug info emission in the presence of plugins.

When plugins are used the Multiplex(AST)Consumer is employed to dispatch
to both the plugin ASTConsumers and the IRGen ASTConsumer. It wasn't
dispatching a critical call for debug info, resulting in plugin users
having a negative debugging experience.

While I'm here, forward a bunch of other missing calls through the
consumer that seem like they should be there.

To test this, use the example plugin (requires plugins and examples) and
split the test case up so that the plugin testing can be done under that
requirement while the non-plugin testing will execute even in builds
that don't include plugin support or examples.

llvm-svn: 213213

10 years agoRevert "Stuff"
David Blaikie [Wed, 16 Jul 2014 23:26:17 +0000 (23:26 +0000)]
Revert "Stuff"

This reverts commit r213210.

Accidental commit.

llvm-svn: 213212

10 years agoDebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path...
David Blaikie [Wed, 16 Jul 2014 23:25:44 +0000 (23:25 +0000)]
DebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path is tested.

By having the two variables 'a' and 'b' in this test in a namespace, the
type was required to be complete before any debug info was ever emitted
(the entire namespace is parsed before the variables were emitted), this
meant that the codepath in which a declaration is emitted, then later on
the type is required to be complete and the debug info must be upgraded
to a definition was not used.

Moving the variables outside a namespace fixes this test coverage bug.

(interestingly, code coverage didn't help here -
HandleTagDeclRequireDefinition is fully covered because it's called even
in cases where the type hasn't been emitted for debug info at all
(further down in CGDebugInfo this no-ops) - so CC wouldn't've helped
catch this test coverage problem)

llvm-svn: 213211

10 years agoStuff
David Blaikie [Wed, 16 Jul 2014 23:25:37 +0000 (23:25 +0000)]
Stuff

llvm-svn: 213210

10 years agoPartially revert r210444 due to performance regression
Jingyue Wu [Wed, 16 Jul 2014 23:25:00 +0000 (23:25 +0000)]
Partially revert r210444 due to performance regression

Summary:
Converting outermost zext(a) to sext(a) causes worse code when the
computation of zext(a) could be reused. For example, after converting

... = array[zext(a)]
... = array[zext(a) + 1]

to

... = array[sext(a)]
... = array[zext(a) + 1],

the program computes sext(a), which is actually unnecessary. I added one
test in split-gep-and-gvn.ll to illustrate this scenario.

Also, with r211281 and r211084, we annotate more "nuw" tags to
computation involving CUDA intrinsics such as threadIdx.x. These
annotations help with splitting GEP a lot, rendering the benefit we get
from this reverted optimization only marginal.

Test Plan: make check-all

Reviewers: eliben, meheff

Reviewed By: meheff

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 213209

10 years agoAdd basic (noop) CodeGen support for __assume
Hal Finkel [Wed, 16 Jul 2014 22:44:54 +0000 (22:44 +0000)]
Add basic (noop) CodeGen support for __assume

Clang supports __assume, at least at the semantic level, when MS extensions are
enabled. Unfortunately, trying to actually compile code using __assume would
result in this error:

  error: cannot compile this builtin function yet

__assume is an optimizer hint, and can be ignored at the IR level. Until LLVM
supports assumptions at the IR level, a noop lowering is valid, and that is
what is done here.

llvm-svn: 213206

10 years agoFixed formatting, removed bug reference, renamed testcase
Sanjay Patel [Wed, 16 Jul 2014 22:40:28 +0000 (22:40 +0000)]
Fixed formatting, removed bug reference, renamed testcase

Thanks to Duncan Exon Smith for reviewing and cleanup suggestions.

llvm-svn: 213205

10 years ago[FastISel] Local values shouldn't be alive across an inline asm call with side effects.
Juergen Ributzka [Wed, 16 Jul 2014 22:20:51 +0000 (22:20 +0000)]
[FastISel] Local values shouldn't be alive across an inline asm call with side effects.

This fixes an issue where a local value is defined before and used after an
inline asm call with side effects.

This fix simply flushes the local value map, which updates the insertion point
for the inline asm call to be above any previously defined local values.

This fixes <rdar://problem/17694203>

llvm-svn: 213203

10 years ago[MCJIT] Improve a RuntimeDyldChecker diagnostic.
Lang Hames [Wed, 16 Jul 2014 22:02:20 +0000 (22:02 +0000)]
[MCJIT] Improve a RuntimeDyldChecker diagnostic.

When a RuntimeDyldChecker test requests an invalid operand for an instruction,
print the decoded instruction to aid diagnosis.

llvm-svn: 213202

10 years agoWhen list-initializing an object of class type, if we pick an initializer list
Richard Smith [Wed, 16 Jul 2014 21:33:43 +0000 (21:33 +0000)]
When list-initializing an object of class type, if we pick an initializer list
constructor (and pass it an implicitly-generated std::initializer_list object),
be sure to mark the resulting construction as list-initialization. This fixes
an assert in template instantiation where we previously thought we'd got direct
non-list initialization without any parentheses.

llvm-svn: 213201

10 years agoFix a typo in the inalloca description
Hal Finkel [Wed, 16 Jul 2014 21:22:46 +0000 (21:22 +0000)]
Fix a typo in the inalloca description

llvm-svn: 213200

10 years agoModify the EFI KDP debugging to not use any dynamic loader since it does manual dynam...
Greg Clayton [Wed, 16 Jul 2014 21:16:27 +0000 (21:16 +0000)]
Modify the EFI KDP debugging to not use any dynamic loader since it does manual dynamic loading itself via python modules.

Also track down the required binary by trying to locate the main executable module through LLDB's symbol and executable file locating code.

<rdar://problem/16570258>

llvm-svn: 213199

10 years agoTypically linker options are protected with -Xlinker or -Wl,
Arthur Marble [Wed, 16 Jul 2014 21:16:16 +0000 (21:16 +0000)]
Typically linker options are protected with -Xlinker or -Wl,
however certain sloppy Makefiles pass -z options directly to
the compiler. This patch enables clang to recognize these
options (because -z is not used by clang itself).

llvm-svn: 213198

10 years agotrivial fix for PR20314
Sanjay Patel [Wed, 16 Jul 2014 21:08:10 +0000 (21:08 +0000)]
trivial fix for PR20314

Make sure that the AddrInst is an Instruction.

llvm-svn: 213197

10 years ago^C wasn't interrupting an expression during a long evaluation or deadlock.
Greg Clayton [Wed, 16 Jul 2014 21:05:41 +0000 (21:05 +0000)]
^C wasn't interrupting an expression during a long evaluation or deadlock.

The problem was that we have an IOHandler thread that services the IOHandler stack. The command interepter is on the top of the stack and it receives a "expression ..." command, and it calls the IOHandlerIsComplete() callback in the command interpereter delegate which runs an expression. This causes the IOHandlerProcessSTDIO to be pushed, but since we are running the code from the IOHandler thread, it won't get run. When CTRL+C is pressed, we do deliver the interrupt to the IOHandlerProcessSTDIO::Interrupt() function, but it was always writing 'i' to the interrupt pipe, even if we weren't actively reading from the debugger input and the pipes. This fix works around the issue by directly issuing the async interrupt to the process if the process is running.

A longer term more correct fix would to be run the IOHandler thread and have it just do the determination of the input and when complete input is received, run the code that handles that input on another thread and syncronize with that other thread to detect when more input is desired. That change is too big to make right now, so this fix will tide us over until we can get there.

<rdar://problem/16556228>

llvm-svn: 213196

10 years agoUpdate .gitignore to ignore hidden MacOSX Finder droppings
Nick Kledzik [Wed, 16 Jul 2014 21:01:17 +0000 (21:01 +0000)]
Update .gitignore to ignore hidden MacOSX Finder droppings

llvm-svn: 213195

10 years agoFix some warnings in the Windows build.
Zachary Turner [Wed, 16 Jul 2014 20:28:24 +0000 (20:28 +0000)]
Fix some warnings in the Windows build.

llvm-svn: 213194

10 years agoSpecifying the diagnostic argument through the attribute table generator instead...
Aaron Ballman [Wed, 16 Jul 2014 20:28:10 +0000 (20:28 +0000)]
Specifying the diagnostic argument through the attribute table generator instead of having to enter it manually as part of the attribute subject list. This only affects attributes appertaining to ObjC interfaces and protocols.

No new tests required as this is covered by existing tests.

llvm-svn: 213193

10 years agoObjective-C. Modify text of documentation for objc_runtime_name
Fariborz Jahanian [Wed, 16 Jul 2014 20:24:55 +0000 (20:24 +0000)]
Objective-C. Modify text of documentation for objc_runtime_name
attribute.

llvm-svn: 213192

10 years agoRemoving a FIXME from the attribute parsing code by now passing along the scope and...
Aaron Ballman [Wed, 16 Jul 2014 20:21:50 +0000 (20:21 +0000)]
Removing a FIXME from the attribute parsing code by now passing along the scope and syntax information for attributes with custom parsing. It turns out not to matter too much because the FIXME wasn't quite true -- none of these attributes have a C++11 spelling. However, it's still a good change (for instance, we may add an attribute with a type arg in the future for which this code now behaves properly).

llvm-svn: 213191

10 years agoRemove Atom references in description.
Sanjay Patel [Wed, 16 Jul 2014 20:18:49 +0000 (20:18 +0000)]
Remove Atom references in description.

Any CPU can run this pass.

llvm-svn: 213190

10 years agoUtilize CastInst::CreatePointerBitCastOrAddrSpaceCast here.
Manuel Jacob [Wed, 16 Jul 2014 20:13:45 +0000 (20:13 +0000)]
Utilize CastInst::CreatePointerBitCastOrAddrSpaceCast here.

llvm-svn: 213189

10 years ago[RegisterCoalescer] Moving the RegisterCoalescer subtarget hook onto the TargetRegist...
Chris Bieneman [Wed, 16 Jul 2014 20:13:31 +0000 (20:13 +0000)]
[RegisterCoalescer] Moving the RegisterCoalescer subtarget hook onto the TargetRegisterInfo instead of the TargetSubtargetInfo.

llvm-svn: 213188

10 years ago[mach-o] refactor KindHandler into ArchHandler and simplify passes.
Nick Kledzik [Wed, 16 Jul 2014 19:49:02 +0000 (19:49 +0000)]
[mach-o] refactor KindHandler into ArchHandler and simplify passes.

All architecture specific handling is now done in the appropriate
ArchHandler subclass.

The StubsPass and GOTPass have been simplified.  All architecture specific
variations in stubs are now encoded in a table which is vended by the
current ArchHandler.

llvm-svn: 213187

10 years ago[NVPTX] Honor alignment on vector loads/stores
Justin Holewinski [Wed, 16 Jul 2014 19:45:35 +0000 (19:45 +0000)]
[NVPTX] Honor alignment on vector loads/stores

We were not considering the stated alignment on vector loads/stores,
leading us to generate vector instructions even when we do not have
sufficient alignment.

Now, for IR like:

  %1 = load <4 x float>, <4 x float>* %ptr, align 4

we will generate correct, conservative PTX like:

  ld.f32 ... [%ptr]
  ld.f32 ... [%ptr+4]
  ld.f32 ... [%ptr+8]
  ld.f32 ... [%ptr+12]

Or if we have an alignment of 8 (for example), we can
generate code like:

  ld.v2.f32 ... [%ptr]
  ld.v2.f32 ... [%ptr+8]

llvm-svn: 213186

10 years agoObjective-C. Changes per A. Ballman's comment
Fariborz Jahanian [Wed, 16 Jul 2014 19:44:34 +0000 (19:44 +0000)]
Objective-C. Changes per A. Ballman's comment
for my last patch. // rdar://17631257

llvm-svn: 213185

10 years agoRemove whitespace from test commit.
Arthur Marble [Wed, 16 Jul 2014 19:10:36 +0000 (19:10 +0000)]
Remove whitespace from test commit.

llvm-svn: 213184

10 years agoAdd Host::MAX_THREAD_NAME_LENGTH constant.
Todd Fiala [Wed, 16 Jul 2014 19:03:16 +0000 (19:03 +0000)]
Add Host::MAX_THREAD_NAME_LENGTH constant.

This value gets set to a max uint32_t value when there is no known limit; otherwise,
it is set to a value appropriate for the platform.  For the moment, only
Linux, FreeBSD and NetBSD set it to 16.  All other platforms set it to
the max uint32_t value.

Modifies the Process private state thread names to fit within a 16-character limit
when the max thread name length is <= 16.  These guarantee that the thread names
can be distinguished within the first 16 characters.  Prior to this change, those
threads had names in the final dotted name segment that were not distinguishable
within the first 16 characters.

llvm-svn: 213183

10 years agoTest commit.
Arthur Marble [Wed, 16 Jul 2014 19:02:11 +0000 (19:02 +0000)]
Test commit.

llvm-svn: 213182

10 years agoFix build broken as a result of r213171.
Zachary Turner [Wed, 16 Jul 2014 18:53:18 +0000 (18:53 +0000)]
Fix build broken as a result of r213171.

r213171 renames the 'clangRewriteCore' library to 'clangRewrite'.
This change simply updates the makefiles to reference the correct
library name.

llvm-svn: 213181

10 years agoAdd the --target option to clang-cl and use it to fix a test.
Reid Kleckner [Wed, 16 Jul 2014 18:31:25 +0000 (18:31 +0000)]
Add the --target option to clang-cl and use it to fix a test.

llvm-svn: 213180

10 years agoDon't use -msse2 in test/Driver/cl-options.c
Hans Wennborg [Wed, 16 Jul 2014 18:20:35 +0000 (18:20 +0000)]
Don't use -msse2 in test/Driver/cl-options.c

It's already tested in cl-x86-flags.c, and can only be used
when targeting X86.

llvm-svn: 213179

10 years agoSimplify memory management in NestedNameSpecifierLocBuilder.
Serge Pavlov [Wed, 16 Jul 2014 18:18:13 +0000 (18:18 +0000)]
Simplify memory management in NestedNameSpecifierLocBuilder.

With this change the memory of buffer in NestedNameSpecifierLocBuilder
is allocated in one place. It also prevents from allocation of tiny blocks.

llvm-svn: 213178

10 years agoCHECK-LABEL-ize one test
Alexey Samsonov [Wed, 16 Jul 2014 18:11:31 +0000 (18:11 +0000)]
CHECK-LABEL-ize one test

llvm-svn: 213177

10 years agoAdd the "-x" flag to llvm-nm for Mach-O files that prints the fields of a symbol...
Kevin Enderby [Wed, 16 Jul 2014 17:38:26 +0000 (17:38 +0000)]
Add the "-x" flag to llvm-nm for Mach-O files that prints the fields of a symbol in hex.
(generally use for debugging the tools).  This is same functionality as darwin’s
nm(1) "-x" flag.

llvm-svn: 213176

10 years ago[Driver][Mips] If CPU name is not provided to the driver explicitly use
Simon Atanasyan [Wed, 16 Jul 2014 17:34:54 +0000 (17:34 +0000)]
[Driver][Mips] If CPU name is not provided to the driver explicitly use
multilibs from the FSFS toolchain corresponding to the mips32r2/mips64r2 CPUs.

llvm-svn: 213175

10 years agoRemove unnecessary/redundant std::move
David Blaikie [Wed, 16 Jul 2014 17:09:21 +0000 (17:09 +0000)]
Remove unnecessary/redundant std::move

(run returns unique_ptr by value already)

llvm-svn: 213174

10 years agoTrack clang r213171
Alp Toker [Wed, 16 Jul 2014 16:50:34 +0000 (16:50 +0000)]
Track clang r213171

The clang rewriter is now a core facility.

llvm-svn: 213173

10 years agoTrack clang r213171
Alp Toker [Wed, 16 Jul 2014 16:50:17 +0000 (16:50 +0000)]
Track clang r213171

The clang rewriter is now a core facility.

llvm-svn: 213172

10 years agoMake clang's rewrite engine a core feature
Alp Toker [Wed, 16 Jul 2014 16:48:33 +0000 (16:48 +0000)]
Make clang's rewrite engine a core feature

The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171

10 years agoclang-cl: expand test coverage for "core" options
Hans Wennborg [Wed, 16 Jul 2014 16:29:00 +0000 (16:29 +0000)]
clang-cl: expand test coverage for "core" options

llvm-svn: 213170

10 years agoAdded documentation for SizeMultiplier in the ARM subtarget hook for register coalesc...
Chris Bieneman [Wed, 16 Jul 2014 16:27:31 +0000 (16:27 +0000)]
Added documentation for SizeMultiplier in the ARM subtarget hook for register coalescing. Also fixed some 80 col violations.

No functional code changes.

llvm-svn: 213169

10 years ago[NVPTX] Rename registers %fl -> %fd and %rl -> %rd
Justin Holewinski [Wed, 16 Jul 2014 16:26:58 +0000 (16:26 +0000)]
[NVPTX] Rename registers %fl -> %fd and %rl -> %rd

This matches the internal behavior of NVIDIA tools like libnvvm.

llvm-svn: 213168