platform/upstream/llvm.git
9 years agoDon't create multiple mergeable sections with -fdata-sections.
Rafael Espindola [Thu, 29 Jan 2015 12:43:28 +0000 (12:43 +0000)]
Don't create multiple mergeable sections with -fdata-sections.

ELF has support for sections that can be split into fixed size or
null terminated entities.

Since these sections can be split by the linker, it is not necessary
to split them in codegen.

This reduces the combined .o size in a llvm+clang build from
202,394,570 to 173,819,098 bytes.

The time for linking clang with gold (on a VM, on a laptop) goes
from 2.250089985 to 1.383001792 seconds.

The flip side is the size of rodata in clang goes from 10,926,785
to 10,929,345 bytes.

The increase seems to be because of http://sourceware.org/bugzilla/show_bug.cgi?id=17902.

llvm-svn: 227431

9 years ago[Mips][Disassembler] When disassembler meets cache/pref instructions for r6 it crashe...
Vladimir Medic [Thu, 29 Jan 2015 11:33:41 +0000 (11:33 +0000)]
[Mips][Disassembler] When disassembler meets cache/pref instructions for r6 it crashes as the access to operands array is out of range. This patch adds dedicated decoder method for R6 CACHE_HINT_DESC class that properly handles decoding of these instructions.

llvm-svn: 227430

9 years agoAdd a missing Tag_DIV_use test for Cortex-M7.
Charlie Turner [Thu, 29 Jan 2015 11:19:54 +0000 (11:19 +0000)]
Add a missing Tag_DIV_use test for Cortex-M7.

llvm-svn: 227429

9 years agoCommandLineParser: Avoid non-static member nitializer(s).
NAKAMURA Takumi [Thu, 29 Jan 2015 11:06:59 +0000 (11:06 +0000)]
CommandLineParser: Avoid non-static member nitializer(s).

llvm-svn: 227428

9 years agoclang-format: Fix crasher caused by not properly setting dry-run.
Daniel Jasper [Thu, 29 Jan 2015 10:47:14 +0000 (10:47 +0000)]
clang-format: Fix crasher caused by not properly setting dry-run.

llvm-svn: 227427

9 years agoMS ABI: Implement proper support for setjmp
David Majnemer [Thu, 29 Jan 2015 09:29:21 +0000 (09:29 +0000)]
MS ABI: Implement proper support for setjmp

On targets which use the MSVCRT, setjmp is a macro which expands to
_setjmp or _setjmpex.

_setjmp and _setjmpex have a secret, hidden argument which is not listed
in the function prototype on X64 and WoA.  This hidden argument always
seems to be the frame pointer.

_setjmpex isn't used on X86, _setjmp is magically replaced with a call
to _setjmp3.  The second argument is zero for 'normal' setjmp/longjmp
pairs, otherwise it is a count of additional variadic arguments.  This
is used when setjmp appears inside of a try or __try.

It is not safe to use a pointer to setjmp because _setjmp, _setjmpex and
_setmp3 are not compatible with setjmp.

llvm-svn: 227426

9 years agoBasic: Re-sort these builtins
David Majnemer [Thu, 29 Jan 2015 09:29:17 +0000 (09:29 +0000)]
Basic: Re-sort these builtins

No functional change, it just makes it a little easier to find what you
are looking for.

llvm-svn: 227425

9 years agoFix the preprocessor checks used to determine if backtraces have been enabled.
Owen Anderson [Thu, 29 Jan 2015 07:53:13 +0000 (07:53 +0000)]
Fix the preprocessor checks used to determine if backtraces have been enabled.

llvm-svn: 227424

9 years agoUse the existing build configuration parameter ENABLE_BACKTRACE to compile out all...
Owen Anderson [Thu, 29 Jan 2015 07:35:31 +0000 (07:35 +0000)]
Use the existing build configuration parameter ENABLE_BACKTRACE to compile out all pretty stack trace support when backtraces are disabled.

This has the nice secondary effect of allowing LLVM to continue to build
for targets without __thread or thread_local support to continue to work
so long as they build without support for backtraces.

llvm-svn: 227423

9 years ago[ELFYAML] Provide default value 0 for YAML relocation addendum field
Simon Atanasyan [Thu, 29 Jan 2015 06:56:24 +0000 (06:56 +0000)]
[ELFYAML] Provide default value 0 for YAML relocation addendum field

Follow up to r227318.

llvm-svn: 227422

9 years agoIf lldb is being built with ASAN instrumentation, have lldb
Jason Molenda [Thu, 29 Jan 2015 06:28:36 +0000 (06:28 +0000)]
If lldb is being built with ASAN instrumentation, have lldb
create its own threads with 8MB additional maximum stack size.
Extra room is needed for the bookkeeping needed for this
instrumentation.

llvm-svn: 227421

9 years agoMake a codegen warning a real warning instead of a getCustomDiagID().
Nico Weber [Thu, 29 Jan 2015 06:25:59 +0000 (06:25 +0000)]
Make a codegen warning a real warning instead of a getCustomDiagID().

Warnings shouldn't use getCustomDiagID(), since then they can't be disabled
via a flag, can't be remapped, etc.

llvm-svn: 227420

9 years agoWhen starting a kernel debug session (PlatformDarwinKernel), scan
Jason Molenda [Thu, 29 Jan 2015 06:20:05 +0000 (06:20 +0000)]
When starting a kernel debug session (PlatformDarwinKernel), scan
for executable binaries on the local filesystem so the user doesn't
need to provide the path to the correct binary manually.

Also have lldb search for kexts/the kernel in the current working
directory in addition to all the usual places.

<rdar://problem/18126501>

llvm-svn: 227419

9 years agoSema: Turn some applicable functions static. NBC.
Francisco Lopes da Silva [Thu, 29 Jan 2015 05:54:59 +0000 (05:54 +0000)]
Sema: Turn some applicable functions static. NBC.

llvm-svn: 227418

9 years agoDon't use BCPL comments here, in case someone wants to use <stdatomic.h> from C89...
Richard Smith [Thu, 29 Jan 2015 03:34:39 +0000 (03:34 +0000)]
Don't use BCPL comments here, in case someone wants to use <stdatomic.h> from C89 mode.

llvm-svn: 227417

9 years ago[asan] use getrusage as an alternative to reading /proc/self/statm. Also move GetRSS...
Kostya Serebryany [Thu, 29 Jan 2015 02:54:39 +0000 (02:54 +0000)]
[asan] use getrusage as an alternative to reading /proc/self/statm. Also move GetRSS to sanitizer_linux_libcdep.cc (no change in the function itself)

llvm-svn: 227416

9 years agoRemove an unused private field added r227405 to fix a Clang warning.
Chandler Carruth [Thu, 29 Jan 2015 02:44:53 +0000 (02:44 +0000)]
Remove an unused private field added r227405 to fix a Clang warning.

llvm-svn: 227415

9 years ago[LPM] Try again to appease powerpc64 in its self host. I've been unable
Chandler Carruth [Thu, 29 Jan 2015 02:34:17 +0000 (02:34 +0000)]
[LPM] Try again to appease powerpc64 in its self host. I've been unable
to get a powerpc64 host so that I can reproduce and test this, but it
only impacts that platform so trying the only other realistic option.

According to Ulrich, who debugged this initially, initial-exec is likely
to be sufficient for our needs and not subject to this bug. Will watch
the build bots to see.

If this doesn't work, I'll be forced to cut a really ugly pthread-based
approach into the primary user (our stack trace printing) as that user
cannot use the ThreadLocal implementation due to lifetime issues.

llvm-svn: 227414

9 years ago[ASan] Generalize/simplify lit test configs generation.
Alexey Samsonov [Thu, 29 Jan 2015 02:28:53 +0000 (02:28 +0000)]
[ASan] Generalize/simplify lit test configs generation.

llvm-svn: 227413

9 years ago[LPM] Fix an "obvious" typo from r227411. Really sorry for the noise.
Chandler Carruth [Thu, 29 Jan 2015 01:29:22 +0000 (01:29 +0000)]
[LPM] Fix an "obvious" typo from r227411. Really sorry for the noise.
Too many cases to compile everything quickly.

llvm-svn: 227412

9 years ago[LPM] Clean up the use of TLS in pretty stack trace and disable it
Chandler Carruth [Thu, 29 Jan 2015 01:23:04 +0000 (01:23 +0000)]
[LPM] Clean up the use of TLS in pretty stack trace and disable it
entirely when threads are not enabled. This should allow anyone who
needs to bootstrap or cope with a host loader without TLS support to
limp along without threading support.

There is still some bug in the PPC TLS stuff that is not worked around.
I'm getting access to a machine to reproduce and debug this further.
There is some chance that I'll have to add a terrible workaround for
PPC.

There is also some problem with iOS, but I have no ability to really
evaluate what the issue is there. I'm leaving it to folks maintaining
that platform to suggest a path forward -- personally I don't see any
useful path forward that supports threading in LLVM but does so without
support for *very basic* TLS. Note that we don't need more than some
pointers, and we don't need constructors, destructors, or any of the
other fanciness which remains widely unimplemented.

llvm-svn: 227411

9 years agoFix MSVC C4060 warning (switch statement contains no case or default).
Rui Ueyama [Thu, 29 Jan 2015 00:56:24 +0000 (00:56 +0000)]
Fix MSVC C4060 warning (switch statement contains no case or default).

llvm-svn: 227410

9 years agoEnsure that -fsyntax-only with fortran 90 passes along silently
Eric Christopher [Thu, 29 Jan 2015 00:56:17 +0000 (00:56 +0000)]
Ensure that -fsyntax-only with fortran 90 passes along silently
to the underlying gcc.
PR22234

Patch by Artem Belevich.

llvm-svn: 227409

9 years agoRemove unused variable
Reid Kleckner [Thu, 29 Jan 2015 00:55:44 +0000 (00:55 +0000)]
Remove unused variable

llvm-svn: 227408

9 years ago[FIX] Correct two C snippets in test cases
Johannes Doerfert [Thu, 29 Jan 2015 00:50:46 +0000 (00:50 +0000)]
[FIX] Correct two C snippets in test cases

llvm-svn: 227407

9 years agoRemove NaClX86_64TargetCodeGenInfo and NaClARMTargetCodeGenInfo
Derek Schuff [Thu, 29 Jan 2015 00:47:04 +0000 (00:47 +0000)]
Remove NaClX86_64TargetCodeGenInfo and NaClARMTargetCodeGenInfo

Summary:
They just existed before to use NaCl's custom ABIInfos; now that those are gone,
the custom TargetCodeGenInfos are no longer needed either.

Test Plan: don't break the existing tests

Reviewers: jvoung

Subscribers: jfb, cfe-commits

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

llvm-svn: 227406

9 years agoAdd a Windows EH preparation pass that zaps resumes
Reid Kleckner [Thu, 29 Jan 2015 00:41:44 +0000 (00:41 +0000)]
Add a Windows EH preparation pass that zaps resumes

If the personality is not a recognized MSVC personality function, this
pass delegates to the dwarf EH preparation pass. This chaining supports
people on *-windows-itanium or *-windows-gnu targets.

Currently this recognizes some personalities used by MSVC and turns
resume instructions into traps to avoid link errors.  Even if cleanups
are not used in the source program, LLVM requires the frontend to emit a
code path that resumes unwinding after an exception.  Clang does this,
and we get unreachable resume instructions. PR20300 covers cleaning up
these unreachable calls to resume.

Reviewers: majnemer

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

llvm-svn: 227405

9 years ago[FIX] Handle pointer-pointer comparisons
Johannes Doerfert [Thu, 29 Jan 2015 00:41:33 +0000 (00:41 +0000)]
[FIX] Handle pointer-pointer comparisons

  This should fix a problem introduced by r225464.

llvm-svn: 227404

9 years agoirgen: don't emit debug metadata for locals
Andrew Wilkins [Thu, 29 Jan 2015 00:34:30 +0000 (00:34 +0000)]
irgen: don't emit debug metadata for locals

Summary:
The debug metadata we generate is wrong, and is
now causing build failures. This revision disables
the only llvm.dbg.declare calls we make.

(There is also a drive-by fix to CMakeLists.txt,
adding in a missing .go dependency.)

Fixes http://llvm.org/bugs/show_bug.cgi?id=22330

Reviewers: pcc

Reviewed By: pcc

Subscribers: dblaikie, llvm-commits

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

llvm-svn: 227403

9 years agoRemove getSubtargetImpl from AArch64ISelLowering and cache the
Eric Christopher [Thu, 29 Jan 2015 00:19:42 +0000 (00:19 +0000)]
Remove getSubtargetImpl from AArch64ISelLowering and cache the
correct subtarget by passing it in during the constructor as
TargetLowering is Subtarget specific.

llvm-svn: 227402

9 years agoRemove getSubtargetImpl from ARMISelLowering and cache the
Eric Christopher [Thu, 29 Jan 2015 00:19:39 +0000 (00:19 +0000)]
Remove getSubtargetImpl from ARMISelLowering and cache the
correct subtarget by passing it in during the constructor as
TargetLowering is Subtarget specific.

llvm-svn: 227401

9 years agoSmall cleanup in ARMFastISel initialization.
Eric Christopher [Thu, 29 Jan 2015 00:19:37 +0000 (00:19 +0000)]
Small cleanup in ARMFastISel initialization.

llvm-svn: 227400

9 years agoMigrate ARM except for TTI, AsmPrinter, and frame lowering
Eric Christopher [Thu, 29 Jan 2015 00:19:33 +0000 (00:19 +0000)]
Migrate ARM except for TTI, AsmPrinter, and frame lowering
away from getSubtargetImpl.

llvm-svn: 227399

9 years agoAdd nullptr checks for TargetSelectionDAGInfo in SelectionDAG.
Manuel Jacob [Wed, 28 Jan 2015 23:50:40 +0000 (23:50 +0000)]
Add nullptr checks for TargetSelectionDAGInfo in SelectionDAG.

TSI is not guaranteed be non-null in SelectionDAG.

llvm-svn: 227397

9 years ago[fuzzer] add option -save_minimized_corpus
Kostya Serebryany [Wed, 28 Jan 2015 23:48:39 +0000 (23:48 +0000)]
[fuzzer] add option -save_minimized_corpus

llvm-svn: 227395

9 years agoFor the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.
Joerg Sonnenberger [Wed, 28 Jan 2015 23:30:39 +0000 (23:30 +0000)]
For the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.
Those used the old Big Endian support on ARM and don't need flags.
Refactor the logic in a separate common function, which also looks at
-march. Add corresponding logic for the Linux toolchain.

llvm-svn: 227393

9 years ago[clang] Use -android environment for all compiler-rt libs.
Dan Albert [Wed, 28 Jan 2015 23:23:36 +0000 (23:23 +0000)]
[clang] Use -android environment for all compiler-rt libs.

Summary:
This was already done for the sanitizers, but it needs to be done for
the profile and builtin libs as well.

Reviewers: srhines, timmurray, eugenis, samsonov

Reviewed By: samsonov

Subscribers: compnerd, cfe-commits

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

llvm-svn: 227392

9 years ago[LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This should
Chandler Carruth [Wed, 28 Jan 2015 23:10:57 +0000 (23:10 +0000)]
[LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This should
let the build bot make finish compiling stage2.

llvm-svn: 227391

9 years agoTeach SplitBlockPredecessors how to handle landingpad blocks.
Philip Reames [Wed, 28 Jan 2015 23:06:47 +0000 (23:06 +0000)]
Teach SplitBlockPredecessors how to handle landingpad blocks.

Patch by: Igor Laevsky <igor@azulsystems.com>

"Currently SplitBlockPredecessors generates incorrect code in case if basic block we are going to split has a landingpad. Also seems like it is fairly common case among it's users to conditionally call either SplitBlockPredecessors or SplitLandingPadPredecessors. Because of this I think it is reasonable to add this condition directly into SplitBlockPredecessors."

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

llvm-svn: 227390

9 years agoAdd lit-style tests for the Fuzzer library
Kostya Serebryany [Wed, 28 Jan 2015 22:49:25 +0000 (22:49 +0000)]
Add lit-style tests for the Fuzzer library

Summary: Add test targets and the lit-style runner.

Test Plan: Run the tests on bot.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 227389

9 years agoNFC. Migrating clang-tools-extra to the cl::HideUnrelatedOptions API.
Chris Bieneman [Wed, 28 Jan 2015 22:45:26 +0000 (22:45 +0000)]
NFC. Migrating clang-tools-extra to the cl::HideUnrelatedOptions API.

llvm-svn: 227388

9 years ago[sanitizer] allow to reset the bb/edge coverage data inside the process while it...
Kostya Serebryany [Wed, 28 Jan 2015 22:39:44 +0000 (22:39 +0000)]
[sanitizer] allow to reset the bb/edge coverage data inside the process while it is running (single-threaded). Also expose the current coverage set to the process.

llvm-svn: 227387

9 years agofix typos; NFC
Sanjay Patel [Wed, 28 Jan 2015 22:37:32 +0000 (22:37 +0000)]
fix typos; NFC

llvm-svn: 227386

9 years agoBuild fix for Visual Studio. NFC.
Chris Bieneman [Wed, 28 Jan 2015 22:25:00 +0000 (22:25 +0000)]
Build fix for Visual Studio. NFC.

llvm-svn: 227385

9 years agoFix for PR22061 by K-ballo
Marshall Clow [Wed, 28 Jan 2015 22:22:35 +0000 (22:22 +0000)]
Fix for PR22061 by K-ballo

llvm-svn: 227384

9 years agoAdd logic to ClangASTType and SBType to discover information about vector types
Enrico Granata [Wed, 28 Jan 2015 22:18:02 +0000 (22:18 +0000)]
Add logic to ClangASTType and SBType to discover information about vector types

llvm-svn: 227383

9 years ago[dsymutil] Gather the DIE tree child->parent relationships.
Frederic Riss [Wed, 28 Jan 2015 22:15:14 +0000 (22:15 +0000)]
[dsymutil] Gather the DIE tree child->parent relationships.

The libDebugInfo DIE parsing doesn't store these relationships, we have to
recompute them. This commit introduces the CompileUnit bookkeeping class to
store this data. It will be expanded with more fields in the future.

No tests as this produces no visible output.

llvm-svn: 227382

9 years agoAdd DWARFUnit::getNumDIEs() and getDIEIndex()
Frederic Riss [Wed, 28 Jan 2015 22:15:07 +0000 (22:15 +0000)]
Add DWARFUnit::getNumDIEs() and getDIEIndex()

Parsed DIEs are stored in a vector and that makes it easy to get their
indices. Having easy access to a DIE's index makes it possible to use
arrays or vectors to efficiently store/access DIE related information.

There's no test for that new functionality (I don't see how to test
it standalone), but it'll be used in a subsequent dsymutil commit.

llvm-svn: 227381

9 years agoFixed the failing test:
Greg Clayton [Wed, 28 Jan 2015 22:08:17 +0000 (22:08 +0000)]
Fixed the failing test:

./dotest.py -A x86_64 -C clang -v -t  -f TestImageListMultiArchitecture.test_image_list_shows_multiple_architectures

The problem was that if the platform wasn't compatible with the current file in the "target create" command, it wasn't finding a platform that was like it used to.

Also, the currently selected platform was being used upload the file _before_ the target was created which was incorrect as "target create a.out" might switch platforms if its architecture doesn't match, so I moved the uploading to happen after the target was created so we use the right platform (the one in the target, not the selected one).

llvm-svn: 227380

9 years ago[Hexagon] Updating several V5 intrinsics and adding FP tests.
Colin LeMahieu [Wed, 28 Jan 2015 22:08:16 +0000 (22:08 +0000)]
[Hexagon] Updating several V5 intrinsics and adding FP tests.

llvm-svn: 227379

9 years agoCXX [qoi]. Prevent a crash when initializer expression is
Fariborz Jahanian [Wed, 28 Jan 2015 22:08:10 +0000 (22:08 +0000)]
CXX [qoi]. Prevent a crash when initializer expression is
invalid when trying to create temporary copy of the invalid
initializer. rdar://19109967

llvm-svn: 227378

9 years agoPR22367: Don't forget to create a CXXFunctionalCastExpr around
Richard Smith [Wed, 28 Jan 2015 22:06:01 +0000 (22:06 +0000)]
PR22367: Don't forget to create a CXXFunctionalCastExpr around
list-initialization that gets converted to some form other than an
InitListExpr. CXXTemporaryObjectExpr is a special case here, because it
represents a fused CXXFunctionalCastExpr + CXXConstructExpr. That, in
itself, is probably a design error...

llvm-svn: 227377

9 years agoSpelling fixes. NFC.
Simon Pilgrim [Wed, 28 Jan 2015 22:03:52 +0000 (22:03 +0000)]
Spelling fixes. NFC.

llvm-svn: 227376

9 years agoLine endings fix. NFC.
Simon Pilgrim [Wed, 28 Jan 2015 21:56:52 +0000 (21:56 +0000)]
Line endings fix. NFC.

llvm-svn: 227374

9 years ago[mips][microMIPS] Implement SWM and LWM aliases
Zoran Jovanovic [Wed, 28 Jan 2015 21:52:27 +0000 (21:52 +0000)]
[mips][microMIPS] Implement SWM and LWM aliases
Differential Revision: http://reviews.llvm.org/D5820

llvm-svn: 227373

9 years agoUpdated tools to match r227345 which changed the getRegisteredOptions method
Pete Cooper [Wed, 28 Jan 2015 21:34:05 +0000 (21:34 +0000)]
Updated tools to match r227345 which changed the getRegisteredOptions method

llvm-svn: 227372

9 years agoPR 17456
Nathan Sidwell [Wed, 28 Jan 2015 21:31:26 +0000 (21:31 +0000)]
PR 17456
More helpful diagnostic on casts between unrelated class hierarchies.

llvm-svn: 227371

9 years agoWe had two identical files named 'MoveOnly.h' in the test suite. Move one to support...
Marshall Clow [Wed, 28 Jan 2015 21:22:53 +0000 (21:22 +0000)]
We had two identical files named 'MoveOnly.h' in the test suite. Move one to support/, remove the other, and update all the tests that included them. No functionality change.

llvm-svn: 227370

9 years agoELF: s/diagnostics/diag/
Rui Ueyama [Wed, 28 Jan 2015 21:20:28 +0000 (21:20 +0000)]
ELF: s/diagnostics/diag/

We use a variable name "diag" in many other places and I think
it's preferred because of its length.

llvm-svn: 227369

9 years agoRevert a change from r222797 that is no longer needed and can cause
Kaelyn Takata [Wed, 28 Jan 2015 21:10:46 +0000 (21:10 +0000)]
Revert a change from r222797 that is no longer needed and can cause
infinite recursion.

Also guard against said infinite recursion by adding an assert that will
trigger if CorrectDelayedTyposInExpr is called before a previous call to
CorrectDelayedTyposInExpr returns (i.e. if the TreeTransform run by
CorrectDelayedTyposInExpr calls a sequence of methods that
end up calling CorrectDelayedTyposInExpr, as the new test case had done
prior to this commit). Fixes PR22292.

llvm-svn: 227368

9 years agoELF: add a unit test for --as-needed.
Rui Ueyama [Wed, 28 Jan 2015 21:01:24 +0000 (21:01 +0000)]
ELF: add a unit test for --as-needed.

llvm-svn: 227367

9 years agoFixed compiler warnings for functions that weren't marked virtual and the functions...
Greg Clayton [Wed, 28 Jan 2015 20:47:27 +0000 (20:47 +0000)]
Fixed compiler warnings for functions that weren't marked virtual and the functions didn't have "override" on them.

llvm-svn: 227366

9 years agoRemoved some tabs that snuck into the test suite. No functionality change
Marshall Clow [Wed, 28 Jan 2015 20:26:11 +0000 (20:26 +0000)]
Removed some tabs that snuck into the test suite. No functionality change

llvm-svn: 227363

9 years agoRemove support for pnaclcall attribute
Derek Schuff [Wed, 28 Jan 2015 20:24:52 +0000 (20:24 +0000)]
Remove support for pnaclcall attribute

Summary:
It was used for interoperability with PNaCl's calling conventions, but
it's no longer needed.

Also Remove NaCl*ABIInfo which just existed to delegate to either the portable
or native ABIInfo, and remove checkCallingConvention which was now a no-op
override.

Reviewers: jvoung

Subscribers: jfb, llvm-commits

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

llvm-svn: 227362

9 years agoFix layering violation: include/clang/Basic/PlistSupport.h should not include
Richard Smith [Wed, 28 Jan 2015 20:14:54 +0000 (20:14 +0000)]
Fix layering violation: include/clang/Basic/PlistSupport.h should not include
files from include/clang/Lex. Clean up module map.

llvm-svn: 227361

9 years agoFix PR22366. When move-constructing an associative container and explicitly passing...
Marshall Clow [Wed, 28 Jan 2015 19:54:25 +0000 (19:54 +0000)]
Fix PR22366. When move-constructing an associative container and explicitly passing an allocator that compares different, we were not calling the destructor of the elements in the moved-from container.

llvm-svn: 227359

9 years ago[fuzzer] instructions for building/running clang-format-fuzzer
Kostya Serebryany [Wed, 28 Jan 2015 19:51:58 +0000 (19:51 +0000)]
[fuzzer] instructions for building/running clang-format-fuzzer

llvm-svn: 227357

9 years agoDebugInfo: Attribute implicit boolean tests to the expression being tested, not to...
David Blaikie [Wed, 28 Jan 2015 19:50:09 +0000 (19:50 +0000)]
DebugInfo: Attribute implicit boolean tests to the expression being tested, not to the outer use of that expression.

This is half a fix for a GDB test suite failure that expects to start at
'a' in the following code:

  void func(int a)
    if (a
        &&
b)
...

But instead, without this change, the comparison was assigned to '&&'
(well, worse actually - because there was a chained 'a && b && c' and it
was assigned to the second '&&' because of a recursive application of
this bug) and then the load folded into the comparison so breaking on
the function started at '&&' instead of 'a'.

The other part of this needs to be fixed in LLVM where it's ignoring the
location of the icmp and instead using the location of the branch
instruction.

The fix to the conditional operator is actually a no-op currently,
because the conditional operator's location coincides with 'a' (the
start of the conditional expression) but should probably be '?' instead.
See the FIXME in the test case that mentions the ARCMigration tool
failures when I tried to make that change.

llvm-svn: 227356

9 years agoinvert check for less indentation; use local vars to reduce duplication; NFC
Sanjay Patel [Wed, 28 Jan 2015 19:44:21 +0000 (19:44 +0000)]
invert check for less indentation; use local vars to reduce duplication; NFC

llvm-svn: 227355

9 years agoAdd clang-format-fuzzer target
Kostya Serebryany [Wed, 28 Jan 2015 19:39:18 +0000 (19:39 +0000)]
Add clang-format-fuzzer target

Summary:
This adds clang-format-fuzzer binary,
which depends on the Fuzzer lib,
see http://reviews.llvm.org/D7184

This fuzer has found ~15 bugs so far, and I hope to set up a bot for it.

Test Plan: run on a bot.

Reviewers: samsonov, djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 227354

9 years ago[Hexagon] Updating many V4 intrinsic patterns. Adding missing instruction and deleti...
Colin LeMahieu [Wed, 28 Jan 2015 19:39:09 +0000 (19:39 +0000)]
[Hexagon] Updating many V4 intrinsic patterns.  Adding missing instruction and deleting unused classes.

llvm-svn: 227353

9 years ago[LPM] Try to work around a bug with local-dynamic TLS on PowerPC 64.
Chandler Carruth [Wed, 28 Jan 2015 19:29:22 +0000 (19:29 +0000)]
[LPM] Try to work around a bug with local-dynamic TLS on PowerPC 64.

Sadly, this precludes optimizing it down to initial-exec or local-exec
when statically linking, and in general makes the code slower on PPC 64,
but there's nothing else for it until we can arrange to produce the
correct bits for the linker.

Lots of thanks to Ulirch for tracking this down and Bill for working on
the long-term fix to LLVM so that we can relegate this to old host
clang versions.

I'll be watching the PPC build bots to make sure this effectively
revives them.

llvm-svn: 227352

9 years agoRemove gc.root's performCustomLowering
Philip Reames [Wed, 28 Jan 2015 19:28:03 +0000 (19:28 +0000)]
Remove gc.root's performCustomLowering

This is a refactoring to restructure the single user of performCustomLowering as a specific lowering pass and remove the custom lowering hook entirely.

Before this change, the LowerIntrinsics pass (note to self: rename!) was essentially acting as a pass manager, but without being structured in terms of passes. Instead, it proxied calls to a set of GCStrategies internally. This adds a lot of conceptual complexity (i.e. GCStrategies are stateful!) for very little benefit. Since there's been interest in keeping the ShadowStackGC working, I extracting it's custom lowering pass into a dedicated pass and just added that to the pass order. It will only run for functions which opt-in to that gc.

I wasn't able to find an easy way to preserve the runtime registration of custom lowering functionality. Given that no user of this exists that I'm aware of, I made the choice to just remove that. If someone really cares, we can look at restoring it via dynamic pass registration in the future.

Note that despite the large diff, none of the lowering code actual changes. I added the framing needed to make it a pass and rename the class, but that's it.

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

llvm-svn: 227351

9 years agoHarden against the process pointer being null - this seems like it shouldn't happen...
Enrico Granata [Wed, 28 Jan 2015 19:23:51 +0000 (19:23 +0000)]
Harden against the process pointer being null - this seems like it shouldn't happen, except it did - by a user stopping the debugger while the variables view was refreshing

Fixes rdar://19599357

llvm-svn: 227350

9 years agoMoving AddLiteralOption's declaration higher up in the header to make gcc happy.
Chris Bieneman [Wed, 28 Jan 2015 19:17:09 +0000 (19:17 +0000)]
Moving AddLiteralOption's declaration higher up in the header to make gcc happy.

llvm-svn: 227348

9 years ago[Hexagon] Adding XTYPE/MPY intrinsic tests and some missing multiply instructions.
Colin LeMahieu [Wed, 28 Jan 2015 19:16:17 +0000 (19:16 +0000)]
[Hexagon] Adding XTYPE/MPY intrinsic tests and some missing multiply instructions.

llvm-svn: 227347

9 years agoRefactoring llvm command line parsing and option registration.
Chris Bieneman [Wed, 28 Jan 2015 19:00:25 +0000 (19:00 +0000)]
Refactoring llvm command line parsing and option registration.

Summary:
The primary goal of this patch is to remove the need for MarkOptionsChanged(). That goal is accomplished by having addOption and removeOption properly sort the options.

This patch puts the new add and remove functionality on a CommandLineParser class that is a placeholder. Some of the functionality in this class will need to be merged into the OptionRegistry, and other bits can hopefully be in a better abstraction.

This patch also removes the RegisteredOptionList global, and the need for cl::Option objects to be linked list nodes.

The changes in CommandLineTest.cpp are required because these changes shift when we validate that options are not duplicated. Before this change duplicate options were only found during certain cl API calls (like cl::ParseCommandLine). With this change duplicate options are found during option construction.

Reviewers: dexonsmith, chandlerc, pete

Reviewed By: pete

Subscribers: pete, majnemer, llvm-commits

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

llvm-svn: 227345

9 years agoTestcase for PS4 target defaults (from r227215 and r227219)
Filipe Cabecinhas [Wed, 28 Jan 2015 18:49:45 +0000 (18:49 +0000)]
Testcase for PS4 target defaults (from r227215 and r227219)

llvm-svn: 227343

9 years agoAs promised, make this more efficient by only doing all the busy work when necessary
Enrico Granata [Wed, 28 Jan 2015 18:45:28 +0000 (18:45 +0000)]
As promised, make this more efficient by only doing all the busy work when necessary

llvm-svn: 227342

9 years agoAdd a unit test for LinkerScript.
Rui Ueyama [Wed, 28 Jan 2015 18:38:50 +0000 (18:38 +0000)]
Add a unit test for LinkerScript.

llvm-svn: 227341

9 years agoAssume code ownership for the PS4 to ensure patches get reviewed, per the Developer...
Alex Rosenberg [Wed, 28 Jan 2015 18:33:39 +0000 (18:33 +0000)]
Assume code ownership for the PS4 to ensure patches get reviewed, per the Developer Policy.

llvm-svn: 227340

9 years agoFix build breakage caused by memory leaks in llvm-c-test
Bjorn Steinbrink [Wed, 28 Jan 2015 18:32:31 +0000 (18:32 +0000)]
Fix build breakage caused by memory leaks in llvm-c-test

I accidently introduced those in r227319.

llvm-svn: 227339

9 years ago[Hexagon] Deleting a lot of old variants of intrinsics and updating references.
Colin LeMahieu [Wed, 28 Jan 2015 18:29:11 +0000 (18:29 +0000)]
[Hexagon] Deleting a lot of old variants of intrinsics and updating references.

llvm-svn: 227338

9 years ago[dsymutil] Add DwarfLinker class.
Frederic Riss [Wed, 28 Jan 2015 18:27:01 +0000 (18:27 +0000)]
[dsymutil] Add DwarfLinker class.

It's an empty shell for now. It's main method just opens the debug
map objects and parses their Dwarf info. Test that we at least do
that correctly.

llvm-svn: 227337

9 years agoEnable pragma comment processing for PS4. Original patch by Yunzhong Gao!
Alex Rosenberg [Wed, 28 Jan 2015 18:26:15 +0000 (18:26 +0000)]
Enable pragma comment processing for PS4. Original patch by Yunzhong Gao!

llvm-svn: 227336

9 years ago[Hexagon] Converting XTYPE/BIT intrinsic patterns and adding tests.
Colin LeMahieu [Wed, 28 Jan 2015 18:06:23 +0000 (18:06 +0000)]
[Hexagon] Converting XTYPE/BIT intrinsic patterns and adding tests.

llvm-svn: 227335

9 years agouse SDValue methods directly instead of getNode()->* ; NFCI
Sanjay Patel [Wed, 28 Jan 2015 18:01:31 +0000 (18:01 +0000)]
use SDValue methods directly instead of getNode()->* ; NFCI

llvm-svn: 227334

9 years agoSimplify code. NFC.
Rafael Espindola [Wed, 28 Jan 2015 17:54:19 +0000 (17:54 +0000)]
Simplify code. NFC.

llvm-svn: 227333

9 years ago[Hexagon] Replacing XTYPE/SHIFT intrinsic patternss. Adding tests and missing instru...
Colin LeMahieu [Wed, 28 Jan 2015 17:37:59 +0000 (17:37 +0000)]
[Hexagon] Replacing XTYPE/SHIFT intrinsic patternss.  Adding tests and missing instructions with tests.

llvm-svn: 227330

9 years agoLaunch lldb-gdbserver in same process group when launched remotely using lldb-platfor...
Oleksiy Vyalov [Wed, 28 Jan 2015 17:36:59 +0000 (17:36 +0000)]
Launch lldb-gdbserver in same process group when launched remotely using lldb-platform - commit on behalf of flackr.

http://reviews.llvm.org/D7211

llvm-svn: 227329

9 years agoFix indents on asan_symbolize.py's argument parsing code. No behavior change.
Nico Weber [Wed, 28 Jan 2015 17:29:57 +0000 (17:29 +0000)]
Fix indents on asan_symbolize.py's argument parsing code. No behavior change.

llvm-svn: 227327

9 years agoMake asan_symbolize.py not crash on Windows.
Nico Weber [Wed, 28 Jan 2015 17:28:04 +0000 (17:28 +0000)]
Make asan_symbolize.py not crash on Windows.

asan_symbolize.py isn't needed on Windows, but it's nice if asan has a unified
UI on all platforms. So rather than have asan_symolize.py die on startup due to
it importing modules that don't exist on Windows, let it just echo the input.

llvm-svn: 227326

9 years ago[mips][microMIPS] Implement LWGP instruction
Jozef Kolek [Wed, 28 Jan 2015 17:27:26 +0000 (17:27 +0000)]
[mips][microMIPS] Implement LWGP instruction

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

llvm-svn: 227325

9 years ago[Hexagon] Replacing intrinsics for halfword adds and max/min word/dword.
Colin LeMahieu [Wed, 28 Jan 2015 17:06:40 +0000 (17:06 +0000)]
[Hexagon] Replacing intrinsics for halfword adds and max/min word/dword.

llvm-svn: 227322

9 years ago[Hexagon] Replacing old intrinsic tests with organized versions that match the refere...
Colin LeMahieu [Wed, 28 Jan 2015 16:58:05 +0000 (16:58 +0000)]
[Hexagon] Replacing old intrinsic tests with organized versions that match the reference manual.

llvm-svn: 227321

9 years agoRemove PPC ELF target
Greg Fitzgerald [Wed, 28 Jan 2015 16:37:43 +0000 (16:37 +0000)]
Remove PPC ELF target

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

llvm-svn: 227320

9 years agoFix LLVMSetMetadata and LLVMAddNamedMetadataOperand for single value MDNodes
Bjorn Steinbrink [Wed, 28 Jan 2015 16:35:59 +0000 (16:35 +0000)]
Fix LLVMSetMetadata and LLVMAddNamedMetadataOperand for single value MDNodes

Summary:
MetadataAsValue uses a canonical format that strips the MDNode if it
contains only a single constant value. This triggers an assertion when
trying to cast the value to a MDNode.

Subscribers: llvm-commits

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

llvm-svn: 227319

9 years ago[ELFYAML] Provide explicit value for relocation addendums in the test
Simon Atanasyan [Wed, 28 Jan 2015 16:22:50 +0000 (16:22 +0000)]
[ELFYAML] Provide explicit value for relocation addendums in the test

The `Addend` is an optional field of the `Relocation` YAML record. But
we do not provide its default value while reading it from a YAML file
and so it might keep uninitialized.

I am going to fix the code by a separate commit. We might either make
this field mandatory (at least for .rela sections) or specify 0 as
a default value explicitly.

llvm-svn: 227318

9 years ago[x32] Change the condition from bitness to LP64 for TCRETURNdi64.
Michael Kuperstein [Wed, 28 Jan 2015 16:11:35 +0000 (16:11 +0000)]
[x32] Change the condition from bitness to LP64 for TCRETURNdi64.

TCRETURNmi64, which was mistakenly changed in r227307 will wait for another day.

llvm-svn: 227317

9 years agoR600: Move DataLayout to AMDGPUTargetMachine
Tom Stellard [Wed, 28 Jan 2015 16:04:26 +0000 (16:04 +0000)]
R600: Move DataLayout to AMDGPUTargetMachine

This is a follow up to r227113.

It is now required to use the amdgcn target for SI and newer GPUs.

llvm-svn: 227316