platform/upstream/llvm.git
10 years agoIf a hand-called function is interrupted by hitting a breakpoint, then
Jim Ingham [Tue, 8 Jul 2014 01:07:32 +0000 (01:07 +0000)]
If a hand-called function is interrupted by hitting a breakpoint, then
when you continue to finish off the function call, the expression result
will be included as part of the thread stop info.

llvm-svn: 212506

10 years ago[ASan] Completely remove sanitizer blacklist file from instrumentation pass.
Alexey Samsonov [Tue, 8 Jul 2014 00:50:49 +0000 (00:50 +0000)]
[ASan] Completely remove sanitizer blacklist file from instrumentation pass.

All blacklisting logic is now moved to the frontend (Clang).
If a function (or source file it is in) is blacklisted, it doesn't
get sanitize_address attribute and is therefore not instrumented.
If a global variable (or source file it is in) is blacklisted, it is
reported to be blacklisted by the entry in llvm.asan.globals metadata,
and is not modified by the instrumentation.

The latter may lead to certain false positives - not all the globals
created by Clang are described in llvm.asan.globals metadata (e.g,
RTTI descriptors are not), so we may start reporting errors on them
even if "module" they appear in is blacklisted. We assume it's fine
to take such risk:
  1) errors on these globals are rare and usually indicate wild memory access
  2) we can lazily add descriptors for these globals into llvm.asan.globals
     lazily.

llvm-svn: 212505

10 years ago[X86] AVX512: Only allow k1-k7 as predicates to vpcmp*
Adam Nemet [Tue, 8 Jul 2014 00:22:32 +0000 (00:22 +0000)]
[X86] AVX512: Only allow k1-k7 as predicates to vpcmp*

As destination k0 is allowed but not as predicate/writemask.

I also modified the test to allow checking of error messages by the assembler.
I applied a similar approach to the test ret.s in the same directory.

llvm-svn: 212504

10 years agoKill unnecessary include
Alexey Samsonov [Tue, 8 Jul 2014 00:03:11 +0000 (00:03 +0000)]
Kill unnecessary include

llvm-svn: 212503

10 years agoRename static function to better describe its purpose
Alp Toker [Tue, 8 Jul 2014 00:02:05 +0000 (00:02 +0000)]
Rename static function to better describe its purpose

llvm-svn: 212502

10 years ago[Sanitizer] Remove brittle cache variable and slightly simplify blacklisting code.
Alexey Samsonov [Mon, 7 Jul 2014 23:59:57 +0000 (23:59 +0000)]
[Sanitizer] Remove brittle cache variable and slightly simplify blacklisting code.
Now CodeGenFunction is responsible for looking at sanitizer blacklist
(in CodeGenFunction::StartFunction) and turning off instrumentation,
if necessary.

No functionality change.

llvm-svn: 212501

10 years agoInvalidate process UID/GID-related command options on Windows.
Zachary Turner [Mon, 7 Jul 2014 23:54:51 +0000 (23:54 +0000)]
Invalidate process UID/GID-related command options on Windows.

Windows uses a different process security model and does not have
a concept of process UID or GID.  This patch makes these options
invalid on Windows.  Attempting to specify these options when the
current platform is Windows will generate an error.

Reviewed by: Jim Ingham
Differential Revision: http://reviews.llvm.org/D4373

llvm-svn: 212500

10 years ago[Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModule
Alexey Samsonov [Mon, 7 Jul 2014 23:34:34 +0000 (23:34 +0000)]
[Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModule

Get rid of cached CodeGenModule::SanOpts, which was used to turn off
sanitizer codegen options if current LLVM Module is blacklisted, and use
plain LangOpts.Sanitize instead.

1) Some codegen decisions (turning TBAA or writable strings on/off)
   shouldn't depend on the contents of blacklist.

2) llvm.asan.globals should *always* be created, even if the module
   is blacklisted - soon Clang's CodeGen where we read sanitizer
   blacklist files, so we should properly report which globals are
   blacklisted to the backend.

llvm-svn: 212499

10 years ago[x86] Fix assertion failure caused by a wrong combine of PSHUFD nodes with different...
Andrea Di Biagio [Mon, 7 Jul 2014 23:25:23 +0000 (23:25 +0000)]
[x86] Fix assertion failure caused by a wrong combine of PSHUFD nodes with different types.

When combining a sequence of two PSHUFD dag nodes into a single PSHUFD,
make sure that we assign the correct type to the resulting PSHUFD.
X86ISD::PSHUFD dag nodes can be either MVT::v4i32 or MVT::v4f32.

Before this change, an assertion failure was triggered in method
'DAGCombinerInfo::CombineTo' when trying to combine the shuffles from the test
below into a single PSHUFD.

define <4 x float> @test1(<4 x float> %V) {
  %1 = shufflevector <4 x float> %V, <4 x float> undef, <4 x i32> <i32 3, i32 0, i32 2, i32 1>
  %2 = shufflevector <4 x float> %1, <4 x float> undef, <4 x i32> <i32 3, i32 0, i32 2, i32 1>
  ret <4 x float> %2
}

llvm-svn: 212498

10 years agolibclang: pass return code out argument by reference
Alp Toker [Mon, 7 Jul 2014 22:42:03 +0000 (22:42 +0000)]
libclang: pass return code out argument by reference

r212427 formalized the message-passing pattern by making these argument
structures const. This commit changes output arguments to get passed by
reference so we can eliminate mutable fields.

llvm-svn: 212497

10 years agoASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.
Joe Groff [Mon, 7 Jul 2014 22:25:15 +0000 (22:25 +0000)]
ASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.

It is useful to get the property encoding for an ObjC type without a full
ObjCPropertyDecl.

llvm-svn: 212496

10 years agofixed some typos
Sanjay Patel [Mon, 7 Jul 2014 22:13:58 +0000 (22:13 +0000)]
fixed some typos

llvm-svn: 212495

10 years agoPlistSupport: make utility functions non-static inline to encourage linker dedup
Alp Toker [Mon, 7 Jul 2014 21:57:42 +0000 (21:57 +0000)]
PlistSupport: make utility functions non-static inline to encourage linker dedup

llvm-svn: 212494

10 years ago[FastISel][X86] Fix smul.with.overflow.i8 lowering.
Juergen Ributzka [Mon, 7 Jul 2014 21:52:21 +0000 (21:52 +0000)]
[FastISel][X86] Fix smul.with.overflow.i8 lowering.

Add custom lowering code for signed multiply instruction selection, because the
default FastISel instruction selection for ISD::MUL will use unsigned multiply
for the i8 type and signed multiply for all other types. This would set the
incorrect flags for the overflow check.

This fixes <rdar://problem/17549300>

llvm-svn: 212493

10 years agoAllow AArch64FastISel to degrade graceully in the presence of an MVT::i128
Louis Gerbarg [Mon, 7 Jul 2014 21:37:51 +0000 (21:37 +0000)]
Allow AArch64FastISel to degrade graceully in the presence of an MVT::i128

Currently AArch64FastISel crashes if it tries to extend an integer into an
MVT::i128. This can happen by creating 128 bit integers like so:

  typedef unsigned int uint128_t __attribute__((mode(TI)));
  typedef int sint128_t __attribute__((mode(TI)));

This patch makes EmitIntExt check for their presence and then falls back to
SelectionDAG.

Tests included.

rdar://17516686

llvm-svn: 212492

10 years agoMark test_watchpoint_multiple_threads_with_dwarf as XFAIL on Linux/clang.
Todd Fiala [Mon, 7 Jul 2014 21:28:37 +0000 (21:28 +0000)]
Mark test_watchpoint_multiple_threads_with_dwarf as XFAIL on Linux/clang.

See http://llvm.org/bugs/show_bug.cgi?id=20233 for details.

llvm-svn: 212491

10 years agoFix for PR17073 ( http://llvm.org/pr17073 ), simplifycfg illegally hoists an operatio...
Sanjay Patel [Mon, 7 Jul 2014 21:19:00 +0000 (21:19 +0000)]
Fix for PR17073 ( llvm.org/pr17073 ), simplifycfg illegally hoists an operation in a phi node that can trap.

This patch adds to an existing loop over phi nodes in SimplifyCondBranchToCondBranch() to check for trapping ops and bails out of the optimization if we find one of those.

The test cases verify that trapping ops are not hoisted and non-trapping ops are still optimized as expected.

llvm-svn: 212490

10 years agoMark Radar9974002DataFormatterTestCase test XFAIL on Linux.
Todd Fiala [Mon, 7 Jul 2014 21:13:39 +0000 (21:13 +0000)]
Mark Radar9974002DataFormatterTestCase test XFAIL on Linux.

See http://llvm.org/bugs/show_bug.cgi?id=20232 for details.

llvm-svn: 212489

10 years agoMarked TestLongjmp.py tests XFAIL for Linux.
Todd Fiala [Mon, 7 Jul 2014 21:07:41 +0000 (21:07 +0000)]
Marked TestLongjmp.py tests XFAIL for Linux.

See http://llvm.org/bugs/show_bug.cgi?id=20231

llvm-svn: 212488

10 years ago[MSan] Make one more test standalone
Alexey Samsonov [Mon, 7 Jul 2014 20:59:10 +0000 (20:59 +0000)]
[MSan] Make one more test standalone

llvm-svn: 212487

10 years agoMarked TestFormatters.py XFAIL on Linux per pr20230.
Todd Fiala [Mon, 7 Jul 2014 20:58:38 +0000 (20:58 +0000)]
Marked TestFormatters.py XFAIL on Linux per pr20230.

See http://www.llvm.org/bugs/show_bug.cgi?id=20230 for details.

llvm-svn: 212486

10 years agoAllow specification of no source display on stop.
Todd Fiala [Mon, 7 Jul 2014 20:47:24 +0000 (20:47 +0000)]
Allow specification of no source display on stop.

See http://llvm.org/bugs/show_bug.cgi?id=20149 for details.

Change by Randy Smith.

llvm-svn: 212485

10 years ago[MSan] Use a single file for dso-origin test
Alexey Samsonov [Mon, 7 Jul 2014 20:37:12 +0000 (20:37 +0000)]
[MSan] Use a single file for dso-origin test

llvm-svn: 212484

10 years agoUse raw_fd_ostream instead of std::ofstream.
Rafael Espindola [Mon, 7 Jul 2014 20:34:51 +0000 (20:34 +0000)]
Use raw_fd_ostream instead of std::ofstream.

llvm-svn: 212483

10 years agoCMake: Let LLDB build with CMake 3
David Majnemer [Mon, 7 Jul 2014 20:29:00 +0000 (20:29 +0000)]
CMake: Let LLDB build with CMake 3

Teach add_lldb_library to correctly use the CMake 2.8.12
PUBLIC/PRIVATE/INTERFACE keywords.  LLDB's CMake configuration would
inconsistently apply these keywords; this was previously a warning in
CMake 2.x but became an error in CMake 3.

llvm-svn: 212482

10 years agoDriver: Produce crash diagnostics more often on Windows
Reid Kleckner [Mon, 7 Jul 2014 20:23:27 +0000 (20:23 +0000)]
Driver: Produce crash diagnostics more often on Windows

Assertion failures call abort(), which return an exit code of 3 on
Windows.  The 'not' utility has the same check.

Unfortunately, the crash-report.c test requires a shell, so it does not
run for me locally, so I can only test this manually.

There's still more work to be done here: we should generate a batch
script instead of a shell script on Windows.

llvm-svn: 212481

10 years ago[Mips] Make rel-dynamic-05.test test case independent from external input files.
Simon Atanasyan [Mon, 7 Jul 2014 20:14:49 +0000 (20:14 +0000)]
[Mips] Make rel-dynamic-05.test test case independent from external input files.

llvm-svn: 212480

10 years agoRefactor ARM subarchitecture parsing
Renato Golin [Mon, 7 Jul 2014 20:01:11 +0000 (20:01 +0000)]
Refactor ARM subarchitecture parsing

According to a FIXME in ARMMCTargetDesc.cpp the ARM version parsing should be
in the Triple helper class.

Patch by: Gabor Ballabas

llvm-svn: 212479

10 years ago[PowerPC] Fix testcase regression
Ulrich Weigand [Mon, 7 Jul 2014 19:41:54 +0000 (19:41 +0000)]
[PowerPC] Fix testcase regression

Use -mcpu to avoid different codegen depending on host platform.

llvm-svn: 212478

10 years ago[PowerPC] Fix no-assert build
Ulrich Weigand [Mon, 7 Jul 2014 19:39:44 +0000 (19:39 +0000)]
[PowerPC] Fix no-assert build

r212476 caused a compile failure (unused variable) in a non-assertion
build ...

llvm-svn: 212477

10 years ago[PowerPC] Fix "byval align" arguments
Ulrich Weigand [Mon, 7 Jul 2014 19:26:41 +0000 (19:26 +0000)]
[PowerPC] Fix "byval align" arguments

Arguments passed as "byval align" should get the specified alignment
in the parameter save area.  There was some code in PPCISelLowering.cpp
that attempted to implement this, but this didn't work correctly:
while code did update the ArgOffset value, it neglected to update
the PtrOff value (which was already computed from the old ArgOffset),
and it also neglected to update GPR_idx -- fields skipped due to
alignment in the save area must likewise be skipped in GPRs.

This patch fixes and simplifies this logic by:
- handling argument offset alignment right at the beginning
  of argument processing, using a new helper routine
  CalculateStackSlotAlignment (this avoids having to update
  PtrOff and other derived values later on)
- not tracking GPR_idx separately, but always computing the
  correct GPR_idx for each argument *from* its ArgOffset
- removing some redundant computation in LowerFormalArguments:
  MinReservedArea must equal ArgOffset after argument processing,
  so there's no use in computing it twice.

[This doesn't change the behavior of the current clang front-end,
since that never creates "byval align" arguments at the moment.
This will change with a follow-on patch, however.]

llvm-svn: 212476

10 years ago[x86] Revert r212324 which was too aggressive w.r.t. allowing undef
Chandler Carruth [Mon, 7 Jul 2014 19:03:32 +0000 (19:03 +0000)]
[x86] Revert r212324 which was too aggressive w.r.t. allowing undef
lanes in vector splats.

The core problem here is that undef lanes can't *unilaterally* be
considered to contribute to splats. Their handling needs to be more
cautious. There is also a reported failure of the nightly testers
(thanks Tobias!) that may well stem from the same core issue. I'm going
to fix this theoretical issue, factor the APIs a bit better, and then
verify that I don't see anything bad with Tobias's reduction from the
test suite before recommitting.

Original commit message for r212324:
  [x86] Generalize BuildVectorSDNode::getConstantSplatValue to work for
  any constant, constant FP, or undef splat and to tolerate any undef
  lanes in a splat, then replace all uses of isSplatVector in X86's
  lowering with it.

  This fixes issues where undef lanes in an otherwise splat vector would
  prevent the splat logic from firing. It is a touch more awkward to use
  this interface, but it is much more accurate. Suggestions for better
  interface structuring welcome.

  With this fix, the code generated with the widening legalization
  strategy for widen_cast-4.ll is *dramatically* improved as the special
  lowering strategies for a v16i8 SRA kick in even though the high lanes
  are undef.

  We also get a slightly different choice for broadcasting an aligned
  memory location, and use vpshufd instead of vbroadcastss. This looks
  like a minor win for pipelining and domain crossing, but a minor loss
  for the number of micro-ops. I suspect its a wash, but folks can
  easily tweak the lowering if they want.

llvm-svn: 212475

10 years ago[Sanitizer] Move test for malloc/free hooks under test/sanitizer_common
Alexey Samsonov [Mon, 7 Jul 2014 18:47:29 +0000 (18:47 +0000)]
[Sanitizer] Move test for malloc/free hooks under test/sanitizer_common

llvm-svn: 212474

10 years agoR600: Fix mishandling of load / store chains.
Matt Arsenault [Mon, 7 Jul 2014 18:34:45 +0000 (18:34 +0000)]
R600: Fix mishandling of load / store chains.

Fixes various bugs with reordering loads and stores.
Scalarized vector loads weren't collecting the chains
at all.

llvm-svn: 212473

10 years agoFix typo, weird indentation
Matt Arsenault [Mon, 7 Jul 2014 18:34:42 +0000 (18:34 +0000)]
Fix typo, weird indentation

llvm-svn: 212472

10 years ago[ASan] Clean up leftovers from assembly instrumentation helpers
Alexey Samsonov [Mon, 7 Jul 2014 18:11:24 +0000 (18:11 +0000)]
[ASan] Clean up leftovers from assembly instrumentation helpers

llvm-svn: 212471

10 years agoprepare-builtins: Fix broken build due to recent LLVM API change
Tom Stellard [Mon, 7 Jul 2014 17:46:45 +0000 (17:46 +0000)]
prepare-builtins: Fix broken build due to recent LLVM API change

llvm-svn: 212470

10 years agoGeneralize sanitizer allocator public interface.
Alexey Samsonov [Mon, 7 Jul 2014 17:39:31 +0000 (17:39 +0000)]
Generalize sanitizer allocator public interface.

Introduce new public header <sanitizer/allocator_interface.h> and a set
of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc.
that will eventually replace their tool-specific equivalents
(__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific
functions are now deprecated and implemented as stubs redirecting
to __sanitizer_ versions (which are implemented differently in each tool).

Replace all uses of __xsan_ versions with __sanitizer_ versions in unit
and lit tests.

llvm-svn: 212469

10 years agoDriver: Fix think-o in adding -ivfsoverlay flag to crashdumps
Justin Bogner [Mon, 7 Jul 2014 17:34:40 +0000 (17:34 +0000)]
Driver: Fix think-o in adding -ivfsoverlay flag to crashdumps

If there isn't a VFS to overlay we shouldn't be adding a -ivfsoverlay
flag.

llvm-svn: 212468

10 years agoUse temporary module cache in test
Ben Langmuir [Mon, 7 Jul 2014 17:34:37 +0000 (17:34 +0000)]
Use temporary module cache in test

llvm-svn: 212467

10 years agoFix memory leak in FileSystemStatCache.
Manuel Klimek [Mon, 7 Jul 2014 17:00:49 +0000 (17:00 +0000)]
Fix memory leak in FileSystemStatCache.

Patch by Guochun Shi.

llvm-svn: 212466

10 years ago[ASan/Win] Unbreak the build after r211216
Timur Iskhodzhanov [Mon, 7 Jul 2014 16:22:04 +0000 (16:22 +0000)]
[ASan/Win] Unbreak the build after r211216

llvm-svn: 212465

10 years agoHandle __builtin_clzs and __builtin_ctzs in the constant expression evaluator.
Anders Carlsson [Mon, 7 Jul 2014 15:53:44 +0000 (15:53 +0000)]
Handle __builtin_clzs and __builtin_ctzs in the constant expression evaluator.

llvm-svn: 212464

10 years agoMS ABI: Don't unnecessarily use CGM abstraction
David Majnemer [Mon, 7 Jul 2014 15:29:16 +0000 (15:29 +0000)]
MS ABI: Don't unnecessarily use CGM abstraction

If we are in MicrosoftCXXABI, we don't need to use CGM to get a
TypeDescriptor.

llvm-svn: 212463

10 years agoFix comment typo.
David Majnemer [Mon, 7 Jul 2014 15:29:10 +0000 (15:29 +0000)]
Fix comment typo.

No functionality changed.

llvm-svn: 212462

10 years ago[testing]: lld generally lives in tools/, so fix llvm-lit.
Tim Northover [Mon, 7 Jul 2014 15:26:53 +0000 (15:26 +0000)]
[testing]: lld generally lives in tools/, so fix llvm-lit.

Otherwise we can't run individual tests directly ("llvm-lit /path/to/test")

llvm-svn: 212461

10 years agoMake helper functions static.
Benjamin Kramer [Mon, 7 Jul 2014 14:47:51 +0000 (14:47 +0000)]
Make helper functions static.

llvm-svn: 212460

10 years agoX86: revert unintentional change to X86FastISel.
Tim Northover [Mon, 7 Jul 2014 14:06:42 +0000 (14:06 +0000)]
X86: revert unintentional change to X86FastISel.

This crept in with r212443.

llvm-svn: 212459

10 years agoPTHInternals.rst: PCH is now a thing, update docs to reflect it
Alp Toker [Mon, 7 Jul 2014 14:02:39 +0000 (14:02 +0000)]
PTHInternals.rst: PCH is now a thing, update docs to reflect it

llvm-svn: 212458

10 years agoPTH: use a variable instead of a macro
Alp Toker [Mon, 7 Jul 2014 14:01:37 +0000 (14:01 +0000)]
PTH: use a variable instead of a macro

Cleanup only.

llvm-svn: 212457

10 years ago[asan] Remove runtime assembly helpers.
Evgeniy Stepanov [Mon, 7 Jul 2014 13:59:12 +0000 (13:59 +0000)]
[asan] Remove runtime assembly helpers.

Remove helper functions that were used in assembly instrumentation.

Patch by Yuri Gorshenin.

llvm-svn: 212456

10 years ago[asan] Generate asm instrumentation in MC.
Evgeniy Stepanov [Mon, 7 Jul 2014 13:57:37 +0000 (13:57 +0000)]
[asan] Generate asm instrumentation in MC.

Generate entire ASan asm instrumentation in MC without
relying on runtime helper functions.

Patch by Yuri Gorshenin.

llvm-svn: 212455

10 years ago[msan] Fix handling of phi in blacklisted functions.
Evgeniy Stepanov [Mon, 7 Jul 2014 13:28:31 +0000 (13:28 +0000)]
[msan] Fix handling of phi in blacklisted functions.

llvm-svn: 212454

10 years ago[OPENMP] Added initial support for 'omp parallel for'.
Alexey Bataev [Mon, 7 Jul 2014 13:01:15 +0000 (13:01 +0000)]
[OPENMP] Added initial support for 'omp parallel for'.

llvm-svn: 212453

10 years agoIncrease argument limit of anyOf, allOf and eachOf from 5 to 9.
Manuel Klimek [Mon, 7 Jul 2014 12:55:16 +0000 (12:55 +0000)]
Increase argument limit of anyOf, allOf and eachOf from 5 to 9.

Patch by Alexey Sokolov.

llvm-svn: 212452

10 years agoMove ChainedIncludesSource into the implementation
Alp Toker [Mon, 7 Jul 2014 11:07:10 +0000 (11:07 +0000)]
Move ChainedIncludesSource into the implementation

This doesn't need to be in the headers.

llvm-svn: 212451

10 years agoChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memory
Alp Toker [Mon, 7 Jul 2014 11:06:51 +0000 (11:06 +0000)]
ChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memory

Just reference the data instead with shallow MemoryBuffer instances.

llvm-svn: 212450

10 years agoInstCombine: Simplify code, no functionality change.
Benjamin Kramer [Mon, 7 Jul 2014 11:01:16 +0000 (11:01 +0000)]
InstCombine: Simplify code, no functionality change.

llvm-svn: 212449

10 years ago[msan] Increase hash table size for chained origins.
Evgeniy Stepanov [Mon, 7 Jul 2014 10:45:15 +0000 (10:45 +0000)]
[msan] Increase hash table size for chained origins.

llvm-svn: 212448

10 years agoPointerLoc does not exist anymore.
Yaron Keren [Mon, 7 Jul 2014 09:52:31 +0000 (09:52 +0000)]
PointerLoc does not exist anymore.
SourceLocation is available from TypeLoc member functions.

llvm-svn: 212447

10 years agoRevert "Add lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt (r212445)"
Tobias Grosser [Mon, 7 Jul 2014 09:39:09 +0000 (09:39 +0000)]
Revert "Add lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt (r212445)"

I misidentified the problem and did not test suffifiently. The files had
correctly been removed, but for some reason they still remained in my git
checkout. Not adding the files back to CMakeLists.txt, but rather removing
the stale files was the solution. Sorry for the unnecessary noise.

llvm-svn: 212446

10 years agoAdd lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt
Tobias Grosser [Mon, 7 Jul 2014 09:23:06 +0000 (09:23 +0000)]
Add lib/Codgen/[CGRTTI|MicrosoftRTTI].cpp to CMakeLists.txt

This fixes the cmake builds.

llvm-svn: 212445

10 years ago[x86] Teach the new vector shuffle lowering code to handle what is
Chandler Carruth [Mon, 7 Jul 2014 09:06:58 +0000 (09:06 +0000)]
[x86] Teach the new vector shuffle lowering code to handle what is
essentially a DAG combine that never gets a chance to run.

We might typically expect DAG combining to remove shuffles-of-splats and
other similar patterns, but we don't get a chance to run the DAG
combiner when we recursively form sub-shuffles during the lowering of
a shuffle. So instead hand-roll a really important combine directly into
the lowering code to detect shuffles-of-splats, especially shuffles of
an all-zero splat which needn't even have the same element width, etc.

This lets the new vector shuffle lowering handle shuffles which
implement things like zero-extension really nicely. This will become
even more important when I wire the legalization of zero-extension to
vector shuffles with the new widening legalization strategy.

llvm-svn: 212444

10 years agoCodeGen: it turns out that NAND is not the same thing as BIC. At all.
Tim Northover [Mon, 7 Jul 2014 09:06:35 +0000 (09:06 +0000)]
CodeGen: it turns out that NAND is not the same thing as BIC. At all.

We've been performing the wrong operation on ARM for "atomicrmw nand" for
years, since "a NAND b" is "~(a & b)" rather than ARM's very tempting "a & ~b".
This bled over into the generic expansion pass.

So I assume no-one has ever actually tried to do an atomic nand in the real
world. Oh well.

llvm-svn: 212443

10 years agoSwitch over a few uses of param_begin() to parameters()
Alp Toker [Mon, 7 Jul 2014 09:02:20 +0000 (09:02 +0000)]
Switch over a few uses of param_begin() to parameters()

llvm-svn: 212442

10 years agoRemove unused sys/stat.h includes
Alp Toker [Mon, 7 Jul 2014 08:37:15 +0000 (08:37 +0000)]
Remove unused sys/stat.h includes

The facility was abstracted to LLVM in r187364.

llvm-svn: 212441

10 years ago[msan] Better hash function for chained origins.
Evgeniy Stepanov [Mon, 7 Jul 2014 08:31:55 +0000 (08:31 +0000)]
[msan] Better hash function for chained origins.

llvm-svn: 212440

10 years agoCodeGen: Cleanup MS ABI RTTI LLVM IR
David Majnemer [Mon, 7 Jul 2014 08:09:15 +0000 (08:09 +0000)]
CodeGen: Cleanup MS ABI RTTI LLVM IR

The MS ABI RTTI emission code would choose names for IR types like
%"MSRTTITypeDescriptor\02".  This name is undesirable because it
requires escaping; the underlying reason for this is that the name is
unprintable.  Fix this by naming it %rtti.TypeDescriptor2.

While here, stop trying to do lookups in the LLVM Module's type table.
Instead, store the IR types in MicrosoftCXXABI.  Lookups by name aren't
particularly fast.

llvm-svn: 212439

10 years agoPeel away old-style file remapping typedefs and cruft
Alp Toker [Mon, 7 Jul 2014 07:47:20 +0000 (07:47 +0000)]
Peel away old-style file remapping typedefs and cruft

llvm-svn: 212438

10 years agoFix an iterator invalidation issue: deserializing a key function can write to
Richard Smith [Mon, 7 Jul 2014 06:38:20 +0000 (06:38 +0000)]
Fix an iterator invalidation issue: deserializing a key function can write to
the key functions table. Don't hold references to anything within that table
across such an access.

llvm-svn: 212437

10 years agoStaticAnalyzer: Silence a warning
David Majnemer [Mon, 7 Jul 2014 06:20:50 +0000 (06:20 +0000)]
StaticAnalyzer: Silence a warning

ExprEngine wasn't ready for SEHLeaveStmtClass.  Handle it like all the
other SEH constructs by aborting.

llvm-svn: 212436

10 years agoCodeGen: Refactor RTTI emission
David Majnemer [Mon, 7 Jul 2014 06:20:47 +0000 (06:20 +0000)]
CodeGen: Refactor RTTI emission

Let's not expose ABI specific minutia inside of CodeGenModule and Type.
Instead, let's abstract it through CXXABI.

This gets rid of:
CodeGenModule::getCompleteObjectLocator,
CodeGenModule::EmitFundamentalTypeDescriptor{s,},
CodeGenModule::getMSTypeDescriptor,
CodeGenModule::getMSCompleteObjectLocator,
CGCXXABI::shouldRTTIBeUnique,
CGCXXABI::classifyRTTIUniqueness.

CGRTTI was *almost* entirely centered around providing Itanium-style
RTTI information.  Instead of providing interfaces that only it
consumes, move it to the ItaniumCXXABI implementation file.  This allows
it to have access to Itanium-specific implementation details without
providing useless expansion points for the Microsoft ABI side.

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

llvm-svn: 212435

10 years agoFix layering of file remapping and header search initialization
Alp Toker [Mon, 7 Jul 2014 06:05:00 +0000 (06:05 +0000)]
Fix layering of file remapping and header search initialization

These two functions initialize the source manager and header search objects and
shouldn't be in InitPreprocessor which is concerned with priming the
preprocessor itself and predefining macros.

llvm-svn: 212434

10 years agoAdd an explicit diagnostic for the case where an expression is not a constant
Richard Smith [Mon, 7 Jul 2014 06:00:13 +0000 (06:00 +0000)]
Add an explicit diagnostic for the case where an expression is not a constant
expression because it uses 'this'. Inspired by PR20219 comment#2.

llvm-svn: 212433

10 years agoCleanup. No functionality change intended.
Richard Smith [Mon, 7 Jul 2014 05:36:14 +0000 (05:36 +0000)]
Cleanup. No functionality change intended.

llvm-svn: 212432

10 years agoARM: properly lower dllimport'ed global values
Saleem Abdulrasool [Mon, 7 Jul 2014 05:18:35 +0000 (05:18 +0000)]
ARM: properly lower dllimport'ed global values

This completes the handling for DLL import storage symbols when lowering
instructions.  A DLL import storage symbol must have an additional load
performed prior to use.  This is applicable to variables and functions.

This is particularly important for non-function symbols as it is possible to
handle function references by emitting a thunk which performs the translation
from the unprefixed __imp_ symbol to the proper symbol (although, this is a
non-optimal lowering).  For a variable symbol, no such thunk can be
accommodated.

llvm-svn: 212431

10 years agoARM: correctly mangle dllimport symbols
Saleem Abdulrasool [Mon, 7 Jul 2014 05:18:30 +0000 (05:18 +0000)]
ARM: correctly mangle dllimport symbols

Add support for tracking DLLImport storage class information on a per symbol
basis in the ARM instruction selection.  Use that information to correctly
mangle the symbol (dllimport symbols are referenced via *__imp_<name>).

llvm-svn: 212430

10 years agoARM: unify symbol name retrieval
Saleem Abdulrasool [Mon, 7 Jul 2014 05:18:22 +0000 (05:18 +0000)]
ARM: unify symbol name retrieval

Ensure that all paths that retrieve the symbol name go through GetARMGVSymbol
rather than getSymbol.  This is desirable so that any global symbol mangling can
be centralised to this function.  The motivation for this is handling of symbols
that are marked as having dll import dll storage.  Such a symbol requires an
extra load that is currently handled in the backend and a __imp_ prefix on the
symbol name.

llvm-svn: 212429

10 years ago[AArch64] Normalize all constants to build a vector.
Kevin Qin [Mon, 7 Jul 2014 02:45:40 +0000 (02:45 +0000)]
[AArch64] Normalize all constants to build a vector.

The value of constant operands will be truncated to fit element width.

llvm-svn: 212428

10 years agolibclang: refactor handling of unsaved_files
Alp Toker [Mon, 7 Jul 2014 01:23:14 +0000 (01:23 +0000)]
libclang: refactor handling of unsaved_files

Consolidate CXUnsavedFile argument handling in API functions to support a wider
cleanup of various file remapping schemes in the frontend.

llvm-svn: 212427

10 years agoUpdate internals manual on how to add AST nodes.
Nico Weber [Mon, 7 Jul 2014 00:50:39 +0000 (00:50 +0000)]
Update internals manual on how to add AST nodes.

StmtDumper.cpp is called ASTDumper.cpp these days, and usually works well
for new AST nodes without changes.  There's now DataRecursiveASTVisitor
in addition to RecursiveASTVisitor, and serialization wasn't mentioned.

llvm-svn: 212426

10 years agoAdd an AST node for __leave statements, hook it up.
Nico Weber [Mon, 7 Jul 2014 00:12:30 +0000 (00:12 +0000)]
Add an AST node for __leave statements, hook it up.

Codegen is still missing (and I won't work on that), but __leave is now
as implemented as __try and friends.

llvm-svn: 212425

10 years agofixed typos in comments
Sanjay Patel [Sun, 6 Jul 2014 23:24:53 +0000 (23:24 +0000)]
fixed typos in comments

llvm-svn: 212424

10 years agofixed some typos in comments
Sanjay Patel [Sun, 6 Jul 2014 23:10:24 +0000 (23:10 +0000)]
fixed some typos in comments

llvm-svn: 212423

10 years agoSema: Check that __leave is contained in a __try block.
Nico Weber [Sun, 6 Jul 2014 22:53:19 +0000 (22:53 +0000)]
Sema: Check that __leave is contained in a __try block.

Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema
walk the scope chain to find the SEHTry parent on __leave statements.
(They are rare enough that it seems better to do the walk instead of
giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.)

llvm-svn: 212422

10 years agoAdd parser support for __leave (sema and onward still missing).
Nico Weber [Sun, 6 Jul 2014 22:32:59 +0000 (22:32 +0000)]
Add parser support for __leave (sema and onward still missing).

llvm-svn: 212421

10 years agoAArch64: whitespace cleanup
Saleem Abdulrasool [Sun, 6 Jul 2014 22:13:26 +0000 (22:13 +0000)]
AArch64: whitespace cleanup

llvm-svn: 212420

10 years agoThese should be EXPECT_TRUE, not EXPECT_FALSE. Amends r212415.
Aaron Ballman [Sun, 6 Jul 2014 20:20:02 +0000 (20:20 +0000)]
These should be EXPECT_TRUE, not EXPECT_FALSE. Amends r212415.

llvm-svn: 212419

10 years agoGiving this test a triple to satisfy the build bots.
Aaron Ballman [Sun, 6 Jul 2014 20:07:16 +0000 (20:07 +0000)]
Giving this test a triple to satisfy the build bots.

llvm-svn: 212418

10 years agoThe MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed...
Aaron Ballman [Sun, 6 Jul 2014 20:04:10 +0000 (20:04 +0000)]
The MicrosoftExtensions.c test file should not rely on -x objective-c++. Removed that from the RUN line, fixed obvious C++isms in the code, and moved some C++ tests into MicrosoftExtensions.cpp instead. As a drive-by, changed the line endings for MicrosoftExtensions.c to be LF instead of CRLF.

llvm-svn: 212417

10 years agoThis test case does not require -Wno-missing-declarations or -x objective-c++.
Aaron Ballman [Sun, 6 Jul 2014 19:44:38 +0000 (19:44 +0000)]
This test case does not require -Wno-missing-declarations or -x objective-c++.

llvm-svn: 212416

10 years agoFixing compile errors related to changes with MemoryBuffer::getFile.
Aaron Ballman [Sun, 6 Jul 2014 19:34:52 +0000 (19:34 +0000)]
Fixing compile errors related to changes with MemoryBuffer::getFile.

llvm-svn: 212415

10 years agoMove InterlockedBitTestAndSet into its own test file
Ehsan Akhgari [Sun, 6 Jul 2014 18:45:44 +0000 (18:45 +0000)]
Move InterlockedBitTestAndSet into its own test file

Summary:
This gives us back the test coverage we lost when I made
MicrosoftExtensions.c x86-only.

Reviewers: majnemer

Subscribers: cfe-commits

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

llvm-svn: 212414

10 years agollvm::IntrusiveRefCntPtr => std::shared_ptr to match the changes in clang r212388
Sylvestre Ledru [Sun, 6 Jul 2014 18:39:39 +0000 (18:39 +0000)]
llvm::IntrusiveRefCntPtr => std::shared_ptr to match the changes in clang r212388

llvm-svn: 212413

10 years agoUpdate for llvm api change.
Rafael Espindola [Sun, 6 Jul 2014 18:11:46 +0000 (18:11 +0000)]
Update for llvm api change.

llvm-svn: 212412

10 years agoremove trailing whitespace + remove some useless comments
Sylvestre Ledru [Sun, 6 Jul 2014 17:54:58 +0000 (17:54 +0000)]
remove trailing whitespace + remove some useless comments

llvm-svn: 212411

10 years agoUpdate lldb code to match the change in clang r212386
Sylvestre Ledru [Sun, 6 Jul 2014 17:50:36 +0000 (17:50 +0000)]
Update lldb  code to match the change in clang r212386

llvm-svn: 212410

10 years ago[Mips] Make rel-dynamic-04.test test case independent from external input files.
Simon Atanasyan [Sun, 6 Jul 2014 17:44:40 +0000 (17:44 +0000)]
[Mips] Make rel-dynamic-04.test test case independent from external input files.

llvm-svn: 212409

10 years agoUpdate for llvm api change.
Rafael Espindola [Sun, 6 Jul 2014 17:43:24 +0000 (17:43 +0000)]
Update for llvm api change.

llvm-svn: 212408

10 years agoUpdate for llvm api change.
Rafael Espindola [Sun, 6 Jul 2014 17:43:22 +0000 (17:43 +0000)]
Update for llvm api change.

llvm-svn: 212407