platform/upstream/llvm.git
9 years agoDefine LIBXML2_DEFINED in the Xcode project for Xcode builds so Darwin builds can...
Greg Clayton [Thu, 16 Apr 2015 23:13:26 +0000 (23:13 +0000)]
Define LIBXML2_DEFINED in the Xcode project for Xcode builds so Darwin builds can take advantage of the new GDB register info from the target XML.

Also add "#if defined( LIBXML2_DEFINED )" around code that already used libxml2 in SymbolVendorMacOSX.cpp.

Cleaned up some warnings in ProcessGDBRemote.cpp.

llvm-svn: 235144

9 years agoFix warnings about construction ordering.
Greg Clayton [Thu, 16 Apr 2015 23:11:06 +0000 (23:11 +0000)]
Fix warnings about construction ordering.

llvm-svn: 235143

9 years agoUse a singleton accessor for the static list of alternate mangling prefixes so we...
Greg Clayton [Thu, 16 Apr 2015 23:10:22 +0000 (23:10 +0000)]
Use a singleton accessor for the static list of alternate mangling prefixes so we don't have a global constructor. Apple build systems like for shared libraries to have no global constructors.

llvm-svn: 235142

9 years agoFor llvm-objdump, dump the (__OBJC,__protocol) section for Objc1 32-bit Mach-O files
Kevin Enderby [Thu, 16 Apr 2015 22:33:20 +0000 (22:33 +0000)]
For llvm-objdump, dump the (__OBJC,__protocol) section for Objc1 32-bit Mach-O files
with the -section option as objc_protocol_t structs.

llvm-svn: 235141

9 years agoDebugInfo: Fix UserValue::match() in LiveDebugVariables after r235050
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 22:27:54 +0000 (22:27 +0000)]
DebugInfo: Fix UserValue::match() in LiveDebugVariables after r235050

r235050 dropped the inlined-at field from `MDLocalVariable`, deferring
to the `!dbg` attachments.  Fix `UserValue` to take the `!dbg` into
account when differentiating between variables.

llvm-svn: 235140

9 years agoAsmPrinter: Remove dead code, NFC
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 22:14:20 +0000 (22:14 +0000)]
AsmPrinter: Remove dead code, NFC

llvm-svn: 235139

9 years agoAsmPrinter: Simplify logic for debug info intrinsics' !dbg attachments
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 22:12:59 +0000 (22:12 +0000)]
AsmPrinter: Simplify logic for debug info intrinsics' !dbg attachments

These are required, so just assume they're there.

llvm-svn: 235138

9 years agoFix TestPluginCommands for gcc.
Chaoren Lin [Thu, 16 Apr 2015 22:03:43 +0000 (22:03 +0000)]
Fix TestPluginCommands for gcc.

Summary: gcc requires that LDFLAGS come after DYLIB_OBJECTS.

Test Plan: TestPluginCommands passes.

Reviewers: sivachandra, pcc, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 235137

9 years agoUpdating symbol wildcards one more time.
Chris Bieneman [Thu, 16 Apr 2015 21:58:22 +0000 (21:58 +0000)]
Updating symbol wildcards one more time.

This should catch all C++ symbols containing llvm in the name.

llvm-svn: 235136

9 years ago[Objective-C Sema]. In my last patch change the
Fariborz Jahanian [Thu, 16 Apr 2015 21:52:34 +0000 (21:52 +0000)]
[Objective-C Sema]. In my last patch change the
attribute name to objc_independent_class.
rdar://20255473

llvm-svn: 235135

9 years agoA few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@micro...
Marshall Clow [Thu, 16 Apr 2015 21:36:54 +0000 (21:36 +0000)]
A few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@microsoft.com for the bug report

llvm-svn: 235134

9 years agoDisable AArch64 fast-isel on big-endian call vector returns.
Pete Cooper [Thu, 16 Apr 2015 21:19:36 +0000 (21:19 +0000)]
Disable AArch64 fast-isel on big-endian call vector returns.

A big-endian vector return needs a byte-swap which we aren't doing right now.

For now just bail on these cases to get correctness back.

llvm-svn: 235133

9 years ago[IR] Introduce a dereferenceable_or_null(N) attribute.
Sanjoy Das [Thu, 16 Apr 2015 20:29:50 +0000 (20:29 +0000)]
[IR] Introduce a dereferenceable_or_null(N) attribute.

Summary:
If a pointer is marked as dereferenceable_or_null(N), LLVM assumes it
is either `null` or `dereferenceable(N)` or both.  This change only
introduces the attribute and adds a token test case for the `llvm-as`
/ `llvm-dis`.  It does not hook up other parts of the optimizer to
actually exploit the attribute -- those changes will come later.

For pointers in address space 0, `dereferenceable(N)` is now exactly
equivalent to `dereferenceable_or_null(N)` && `nonnull`.  For other
address spaces, `dereferenceable(N)` is potentially weaker than
`dereferenceable_or_null(N)` && `nonnull` (since we could have a null
`dereferenceable(N)` pointer).

The motivating case for this change is Java (and other managed
languages), where pointers are either `null` or dereferenceable up to
some usually known-at-compile-time constant offset.

Reviewers: rafael, hfinkel

Reviewed By: hfinkel

Subscribers: nicholas, llvm-commits

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

llvm-svn: 235132

9 years agoSurround assignments w/ parenthesis to avoid mistakes.
Davide Italiano [Thu, 16 Apr 2015 18:44:35 +0000 (18:44 +0000)]
Surround assignments w/ parenthesis to avoid mistakes.

This also silences a warning.

llvm-svn: 235131

9 years ago[NFC] [MachO] remove extra semicolons
Jingyue Wu [Thu, 16 Apr 2015 18:43:44 +0000 (18:43 +0000)]
[NFC] [MachO] remove extra semicolons

llvm-svn: 235130

9 years ago[NaryReassociate] speeds up candidate searching
Jingyue Wu [Thu, 16 Apr 2015 18:42:31 +0000 (18:42 +0000)]
[NaryReassociate] speeds up candidate searching

Summary:
This fixes a left-over efficiency issue in D8950.

As Andrew and Daniel suggested, we can store the candidates in a stack
and pop the top element when it does not dominate the current
instruction. This reduces the worst-case time complexity to O(n).

Test Plan: a new test in nary-add.ll that exercises this optimization.

Reviewers: broune, dberlin, meheff, atrick

Reviewed By: atrick

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 235129

9 years ago[Objective-C Sema] patch to introduce IndependentClass
Fariborz Jahanian [Thu, 16 Apr 2015 18:38:44 +0000 (18:38 +0000)]
[Objective-C Sema] patch to introduce IndependentClass
attribute to be placed on Objective-C pointer typedef
to make them strong enough so on their "new" method
family no attempt is made to override these
types. rdar://20255473

llvm-svn: 235128

9 years agoProperly escaping the quotes so that bash doesn't do stupid things with the wildcards.
Chris Bieneman [Thu, 16 Apr 2015 18:36:32 +0000 (18:36 +0000)]
Properly escaping the quotes so that bash doesn't do stupid things with the wildcards.

llvm-svn: 235127

9 years agoUse the correct type, and silence a warning.
Davide Italiano [Thu, 16 Apr 2015 18:36:16 +0000 (18:36 +0000)]
Use the correct type, and silence a warning.

llvm-svn: 235126

9 years agoCleanup based on rnk's feedback.
Chris Bieneman [Thu, 16 Apr 2015 18:08:33 +0000 (18:08 +0000)]
Cleanup based on rnk's feedback.

llvm-svn: 235125

9 years ago[X86, SSE] instcombine common cases of insertps intrinsics into shuffles
Sanjay Patel [Thu, 16 Apr 2015 17:52:13 +0000 (17:52 +0000)]
[X86, SSE] instcombine common cases of insertps intrinsics into shuffles

This is very similar to D8486 / r232852 (vperm2). If we treat insertps intrinsics
as shufflevectors, we can optimize them better.

I've left all but the full zero case of the zero mask variants out of this patch.
I don't think those can be converted into a single shuffle in all cases, but I'd
be happy to be proven wrong as I was for vperm2f128.

Either way, we'd need to support whatever sequence we come up with for those cases
in the backend before converting them here.

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

llvm-svn: 235124

9 years agoFixing windows bots.
Chris Bieneman [Thu, 16 Apr 2015 17:40:51 +0000 (17:40 +0000)]
Fixing windows bots.

Third time's the try.

llvm-svn: 235123

9 years agoThe last argument to CreateExceptionBreakpoint is "internal" not Hardware.
Jim Ingham [Thu, 16 Apr 2015 17:32:27 +0000 (17:32 +0000)]
The last argument to CreateExceptionBreakpoint is "internal" not Hardware.

llvm-svn: 235122

9 years agoBetter fix to the windows conditional.
Chris Bieneman [Thu, 16 Apr 2015 17:26:50 +0000 (17:26 +0000)]
Better fix to the windows conditional.

llvm-svn: 235121

9 years agoFix Windows bots.
Chris Bieneman [Thu, 16 Apr 2015 17:25:17 +0000 (17:25 +0000)]
Fix Windows bots.

Turns out Windows is special. All library installs are RUNTIME.

llvm-svn: 235120

9 years agoFor llvm-objdump added support for printing Objc1 32-bit runtime meta data
Kevin Enderby [Thu, 16 Apr 2015 17:19:59 +0000 (17:19 +0000)]
For llvm-objdump added support for printing Objc1 32-bit runtime meta data
with the existing -objc-meta-data and -macho options for Mach-O files.

llvm-svn: 235119

9 years agoAdd new virtual method for language runtime plug-ins:
Greg Clayton [Thu, 16 Apr 2015 17:13:34 +0000 (17:13 +0000)]
Add new virtual method for language runtime plug-ins:

virtual void
LanguageRuntime::ModulesDidLoad (const ModuleList &module_list);

Then reorganized how the objective C plug-in is notified so it will work for all LanguageRuntime subclasses.

llvm-svn: 235118

9 years ago[WinEH] Handle a landingpad, resume, and cleanup all rolled into a BB
Reid Kleckner [Thu, 16 Apr 2015 17:02:23 +0000 (17:02 +0000)]
[WinEH] Handle a landingpad, resume, and cleanup all rolled into a BB

This happens a lot with simple cleanups after SimplifyCFG.

llvm-svn: 235117

9 years agoEditorial changes in the programmers manual.
Charlie Turner [Thu, 16 Apr 2015 17:01:23 +0000 (17:01 +0000)]
Editorial changes in the programmers manual.

VMCore was renamed to IR back in 2013. The relevant "core"
implementations were moved into the lib/IR directory at the same time.

llvm-svn: 235116

9 years agoDebugInfo: Allow DebugLocs to be constructed from const
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 16:56:29 +0000 (16:56 +0000)]
DebugInfo: Allow DebugLocs to be constructed from const

Allow `const`-qualified pointers to be used to construct `DebugLoc`s, as
a convenience.

llvm-svn: 235115

9 years agoFixing llvm-shlib's LLVM_DYLIB_EXPORT_ALL to work with Darwin fat binaries.
Chris Bieneman [Thu, 16 Apr 2015 16:56:22 +0000 (16:56 +0000)]
Fixing llvm-shlib's LLVM_DYLIB_EXPORT_ALL to work with Darwin fat binaries.

llvm-svn: 235114

9 years agoFixing a mis-use of the CMake install command.
Chris Bieneman [Thu, 16 Apr 2015 16:56:18 +0000 (16:56 +0000)]
Fixing a mis-use of the CMake install command.

The CMake install command is defined as:

install(TARGETS targets... [EXPORT <export-name>]
        [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
          PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
         [DESTINATION <dir>]
         [INCLUDES DESTINATION [<dir> ...]]
         [PERMISSIONS permissions...]
         [CONFIGURATIONS [Debug|Release|...]]
         [COMPONENT <component>]
         [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
        ] [...])

This means it can only take one parameter from the set of RUNTIME, LIBRARY, or ARCHIVE. If you set more than one of these it seems to gobble up the extra arguments and ignore the COMPONENT argument.

This adds a check to only set LIBRARY or ARCHIVE based on whether or not the library being built is shared.

llvm-svn: 235113

9 years agoDebugInfo: Update for LLVM API change in DIBuilder (r235111)
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 16:36:45 +0000 (16:36 +0000)]
DebugInfo: Update for LLVM API change in DIBuilder (r235111)

LLVM r235111 changed the `DIBuilder` API to stop using `DIDescriptor`
and its subclasses.  Rolled into this was some tightening up of types:

  - Scopes: `DIDescriptor` => `MDScope*`.
  - Generic debug nodes: `DIDescriptor` => `DebugNode*`.
  - Subroutine types: `DICompositeType` => `MDSubroutineType*`.
  - Composite types: `DICompositeType` => `MDCompositeType*`.

Note that `DIDescriptor` wraps `MDNode`, and `DICompositeType` wraps
`MDCompositeTypeBase`.

It's this new type strictness that requires changes here.

llvm-svn: 235112

9 years agoDebugInfo: Remove DIDescriptor from the DIBuilder API
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 16:36:23 +0000 (16:36 +0000)]
DebugInfo: Remove DIDescriptor from the DIBuilder API

As a step toward killing `DIDescriptor` and its subclasses, remove it
from the `DIBuilder` API.  Replace the subclasses with appropriate
pointers from the new debug info hierarchy.  There are a couple of
possible surprises in type choices for out-of-tree frontends:

  - Subroutine types: `MDSubroutineType`, not `MDCompositeTypeBase`.
  - Composite types: `MDCompositeType`, not `MDCompositeTypeBase`.
  - Scopes: `MDScope`, not `MDNode`.
  - Generic debug info nodes: `DebugNode`, not `MDNode`.

This is part of PR23080.

llvm-svn: 235111

9 years ago[AArch64] Add v8.1a architecture
Vladimir Sukharev [Thu, 16 Apr 2015 15:53:09 +0000 (15:53 +0000)]
[AArch64] Add v8.1a architecture

Add support for AArch64 v8.1 architecture. Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development

Reviewers: jmolloy

Subscribers: cfe-commits

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

llvm-svn: 235110

9 years agoAdds lldb support for querying the register mapping from gdbserver remote targets...
Colin Riley [Thu, 16 Apr 2015 15:51:33 +0000 (15:51 +0000)]
Adds lldb support for querying the register mapping from gdbserver remote targets using qXfer:features:read packet. Only enabled if libxml2 enabled in build.

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

llvm-svn: 235109

9 years agoRevert the switch lowering change (r235101, r235103, r235106)
Hans Wennborg [Thu, 16 Apr 2015 15:43:26 +0000 (15:43 +0000)]
Revert the switch lowering change (r235101, r235103, r235106)

Looks like it broke the sanitizer-ppc64-linux1 build. Reverting for now.

llvm-svn: 235108

9 years ago[AArch64] Add v8.1a "Virtualization Host Extensions"
Vladimir Sukharev [Thu, 16 Apr 2015 15:38:58 +0000 (15:38 +0000)]
[AArch64] Add v8.1a "Virtualization Host Extensions"

Reviewers: t.p.northover

Subscribers: llvm-commits

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

Patch by: Tom Coxon

llvm-svn: 235107

9 years agoAdd a triple to test/DebugInfo/unconditional-branch.ll (PR23252)
Hans Wennborg [Thu, 16 Apr 2015 15:35:44 +0000 (15:35 +0000)]
Add a triple to test/DebugInfo/unconditional-branch.ll (PR23252)

This started failing on Windows after my switch lowering change in r235101.

I suspect the error is unrelated, so adding a triple to pacify it
until it can be fixed. See the PR for details.

llvm-svn: 235106

9 years ago[AArch64] Add v8.1a "Limited Ordering Regions" extension
Vladimir Sukharev [Thu, 16 Apr 2015 15:30:43 +0000 (15:30 +0000)]
[AArch64] Add v8.1a "Limited Ordering Regions" extension

Reviewers:  t.p.northover

Subscribers: llvm-commits

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

Patch by: Tom Coxon

llvm-svn: 235105

9 years ago[AArch64] Add v8.1a "Privileged Access Never" extension
Vladimir Sukharev [Thu, 16 Apr 2015 15:20:51 +0000 (15:20 +0000)]
[AArch64] Add v8.1a "Privileged Access Never" extension

Reviewers: jmolloy

Subscribers: llvm-commits

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

llvm-svn: 235104

9 years agoAdd a triple to switch.ll test.
Hans Wennborg [Thu, 16 Apr 2015 15:09:33 +0000 (15:09 +0000)]
Add a triple to switch.ll test.

llvm-svn: 235103

9 years ago[AArch64] Handle Cyclone-specific register in common way
Vladimir Sukharev [Thu, 16 Apr 2015 15:01:20 +0000 (15:01 +0000)]
[AArch64] Handle Cyclone-specific register in common way

Reviewers: jmolloy

Subscribers: llvm-commits

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

Patch by: Tom Coxon

llvm-svn: 235102

9 years agoSwitch lowering: extract jump tables and bit tests before building binary tree (PR22262)
Hans Wennborg [Thu, 16 Apr 2015 14:49:23 +0000 (14:49 +0000)]
Switch lowering: extract jump tables and bit tests before building binary tree (PR22262)

This is a major rewrite of the SelectionDAG switch lowering. The previous code
would lower switches as a binary tre, discovering clusters of cases
suitable for lowering by jump tables or bit tests as it went along. To increase
the likelihood of finding jump tables, the binary tree pivot was selected to
maximize case density on both sides of the pivot.

By not selecting the pivot in the middle, the binary trees would not always
be balanced, leading to performance problems in the generated code.

This patch rewrites the lowering to search for clusters of cases
suitable for jump tables or bit tests first, and then builds the binary
tree around those clusters. This way, the binary tree will always be balanced.

This has the added benefit of decoupling the different aspects of the lowering:
tree building and jump table or bit tests finding are now easier to tweak
separately.

For example, this will enable us to balance the tree based on profile info
in the future.

The algorithm for finding jump tables is O(n^2), whereas the previous algorithm
was O(n log n) for common cases, and quadratic only in the worst-case. This
doesn't seem to be major problem in practice, e.g. compiling a file consisting
of a 10k-case switch was only 30% slower, and such large switches should be rare
in practice. Compiling e.g. gcc.c showed no compile-time difference.  If this
does turn out to be a problem, we could limit the search space of the algorithm.

This commit also disables all optimizations during switch lowering in -O0.

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

llvm-svn: 235101

9 years agoXFAIL a test in TestGdbRemoteRegisterState.py on linux to stabilize build bot
Pavel Labath [Thu, 16 Apr 2015 14:47:01 +0000 (14:47 +0000)]
XFAIL a test in TestGdbRemoteRegisterState.py on linux to stabilize build bot

llvm-svn: 235100

9 years ago[AArch64] Follow-up to: Refactor AArch64NamedImmMapper to become dependent on subtarg...
Vladimir Sukharev [Thu, 16 Apr 2015 14:36:13 +0000 (14:36 +0000)]
[AArch64] Follow-up to: Refactor AArch64NamedImmMapper to become dependent on subtarget features

Fixed compilation with clang on some buildbots with "-Werror -Wmissing-field-initializers"

Related to: http://reviews.llvm.org/rL235089

llvm-svn: 235099

9 years agoFix thumb symbol value fixup in ObjectFileELF
Tamas Berghammer [Thu, 16 Apr 2015 14:06:18 +0000 (14:06 +0000)]
Fix thumb symbol value fixup in ObjectFileELF

llvm-svn: 235098

9 years agoFix printing of the failure address in NativeThreadLinux
Tamas Berghammer [Thu, 16 Apr 2015 14:06:15 +0000 (14:06 +0000)]
Fix printing of the failure address in NativeThreadLinux

llvm-svn: 235097

9 years ago[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.
Alexey Bataev [Thu, 16 Apr 2015 13:49:42 +0000 (13:49 +0000)]
[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.

Currently checks for active data-sharing attributes for variables are performed for found var decls. Instead these checks must be performed for canonical decls of these variables to avoid possible troubles with with the differently qualified re-declarations of the same variable, for example:
namespace A { int x; }
namespace B { using A::x; }
Both A::x and B::x actually reference the same object A::x and this fact must be taken into account during data-sharing attributes analysis.

llvm-svn: 235096

9 years ago[mips] [IAS] Preserve microMIPS label marking for objects when assigning.
Toma Tabacu [Thu, 16 Apr 2015 13:37:32 +0000 (13:37 +0000)]
[mips] [IAS] Preserve microMIPS label marking for objects when assigning.

Summary: Previously, this was only happening for functions, but because of .insn, objects can also be marked now.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235095

9 years agoSilencing a -Wunused-but-set-variable warning; NFC.
Aaron Ballman [Thu, 16 Apr 2015 13:29:36 +0000 (13:29 +0000)]
Silencing a -Wunused-but-set-variable warning; NFC.

llvm-svn: 235094

9 years agoXFAILing TestGdbRemoteAttach to stabilise linux build bot
Pavel Labath [Thu, 16 Apr 2015 13:03:55 +0000 (13:03 +0000)]
XFAILing TestGdbRemoteAttach to stabilise linux build bot

also, deleting what appears to be a concatenation of a file with itself (How that compiled in the
first place?).

llvm-svn: 235093

9 years agoDon't depend on the order relocations are written to a .o file.
Rafael Espindola [Thu, 16 Apr 2015 12:59:30 +0000 (12:59 +0000)]
Don't depend on the order relocations are written to a .o file.

llvm-svn: 235092

9 years ago[Mips] Use unique_ptr to manage ownership.
Benjamin Kramer [Thu, 16 Apr 2015 12:43:33 +0000 (12:43 +0000)]
[Mips] Use unique_ptr to manage ownership.

Required some tweaking of ValueMap to accommodate a move-only value
type. No functional change intended.

llvm-svn: 235091

9 years agoMake it obvious that we're iterating over a range of pointers.
Benjamin Kramer [Thu, 16 Apr 2015 12:43:07 +0000 (12:43 +0000)]
Make it obvious that we're iterating over a range of pointers.

Found by -Wrange-loop-analysis.

llvm-svn: 235090

9 years ago[AArch64] Refactor AArch64NamedImmMapper to become dependent on subtarget features.
Vladimir Sukharev [Thu, 16 Apr 2015 12:15:27 +0000 (12:15 +0000)]
[AArch64] Refactor AArch64NamedImmMapper to become dependent on subtarget features.

In order to introduce v8.1a-specific entities, Mappers should be aware of SubtargetFeatures available.

This patch introduces refactoring, that will then allow to easily introduce:

- v8.1-specific "pan" PState for PStateMapper (PAN extension)

- v8.1-specific sysregs for SysRegMapper (LOR,VHE extensions)

Reviewers: jmolloy

Subscribers: llvm-commits

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

Patch by Tom Coxon

llvm-svn: 235089

9 years ago[AArch64] Fix invalid use of references to BuildMI.
James Molloy [Thu, 16 Apr 2015 11:37:40 +0000 (11:37 +0000)]
[AArch64] Fix invalid use of references to BuildMI.

This was found in GCC PR65773 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65773).

We shouldn't be taking a reference to the temporary that BuildMI returns, we must copy it.

llvm-svn: 235088

9 years ago[ARM] Add v8.1a "Privileged Access Never" extension
Vladimir Sukharev [Thu, 16 Apr 2015 11:34:25 +0000 (11:34 +0000)]
[ARM] Add v8.1a "Privileged Access Never" extension

Reviewers: jmolloy

Subscribers: llvm-commits

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

llvm-svn: 235087

9 years agoupdated copyright date to 2015
Andrey Churbanov [Thu, 16 Apr 2015 11:10:17 +0000 (11:10 +0000)]
updated copyright date to 2015

llvm-svn: 235086

9 years agoUpdate MCELFStreamer::reset() following r234714
Yaron Keren [Thu, 16 Apr 2015 10:53:22 +0000 (10:53 +0000)]
Update MCELFStreamer::reset() following r234714
and order fields according to declaration order.

llvm-svn: 235085

9 years ago[mips] [IAS] Add support for the .insn directive.
Toma Tabacu [Thu, 16 Apr 2015 09:53:47 +0000 (09:53 +0000)]
[mips] [IAS] Add support for the .insn directive.

Summary:
This assembler directive marks the current label as an instruction label in microMIPS and MIPS16.

This initial implementation works only for microMIPS.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235084

9 years agoAppend to CFLAGS_EXTRAS and LD_EXTRAS when building cmdline.
Robert Flack [Thu, 16 Apr 2015 09:18:12 +0000 (09:18 +0000)]
Append to CFLAGS_EXTRAS and LD_EXTRAS when building cmdline.

When building the command-line for compilations during tests, append to
CFLAGS_EXTRAS and LD_EXTRAS to preserve switches set by the environment
(i.e. for cross compiling to test on another platform).

Test Plan:
TestCPP11EnumTypes.py passes testing from macosx -> linux remotely with cross
compiling args in CFLAGS_EXTRAS and LD_EXTRAS.

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

llvm-svn: 235083

9 years agoRevert "[RuntimeDyldELF] Fold Placeholder into Addend"
Pavel Labath [Thu, 16 Apr 2015 08:58:15 +0000 (08:58 +0000)]
Revert "[RuntimeDyldELF] Fold Placeholder into Addend"

This reverts commit cbbeac14f0ddca71f6d8ff91cd05522bd23908e5.

llvm-svn: 235082

9 years agoRevert "[RuntimeDyldELF] Fix missing cases in Placeholder processing"
Pavel Labath [Thu, 16 Apr 2015 08:58:11 +0000 (08:58 +0000)]
Revert "[RuntimeDyldELF] Fix missing cases in Placeholder processing"

This reverts commit ec0a34f850eca0d97e0592236e0ac14083aa1c3d.

llvm-svn: 235081

9 years agoclang-format: add an option for fallback style in vimrc
Daniel Jasper [Thu, 16 Apr 2015 08:26:37 +0000 (08:26 +0000)]
clang-format: add an option for fallback style in vimrc

With this patch, clang-format.py will search and use existing .clang-format
file if there is one and fallback to the specific format style if
not. It should cover the projects which don't have .clang-format
files in their source. As the option fallback-style is available in
clang 3.5 or later, it is safe to use.

Patch by "Chilledheart" (http://reviews.llvm.org/D8489).

llvm-svn: 235080

9 years agoTRUNCATE constant folding - minor fix for rL233224
Simon Pilgrim [Thu, 16 Apr 2015 08:21:09 +0000 (08:21 +0000)]
TRUNCATE constant folding - minor fix for rL233224

Fix for test case found by James Molloy - TRUNCATE of constant build vectors can be more simply achieved by simply replacing with a new build vector node with the truncated value type - no need to touch the scalar operands at all.

llvm-svn: 235079

9 years agoclang-format: [JS] handle comments in template strings.
Daniel Jasper [Thu, 16 Apr 2015 08:20:51 +0000 (08:20 +0000)]
clang-format: [JS] handle comments in template strings.

Patch by Martin Probst. Thank you.

llvm-svn: 235078

9 years agoPass normalized target file paths via GDB-remote to a target and denormalize them...
Oleksiy Vyalov [Thu, 16 Apr 2015 07:02:56 +0000 (07:02 +0000)]
Pass normalized target file paths via GDB-remote to a target and denormalize them on the target.

http://reviews.llvm.org/D8980

llvm-svn: 235077

9 years agoclang-format: Undo r214508. It was essentially always removing the
Daniel Jasper [Thu, 16 Apr 2015 07:02:19 +0000 (07:02 +0000)]
clang-format: Undo r214508. It was essentially always removing the
space where we already had the flag ObjCSpaceBeforeProtocolList to
control it. I don't know what I was thinking.

llvm-svn: 235076

9 years ago[OPENMP] Codegen for 'copyin' clause in 'parallel' directive.
Alexey Bataev [Thu, 16 Apr 2015 05:39:01 +0000 (05:39 +0000)]
[OPENMP] Codegen for 'copyin' clause in 'parallel' directive.

Emits the following code for the clause at the beginning of the outlined function for implicit threads:

if (<not a master thread>) {
  ...
  <thread local copy of var> = <master thread local copy of var>;
  ...
}
<sync point>;
Checking for a non-master thread is performed by comparing of the address of the thread local variable with the address of the master's variable. Master thread always uses original variables, so you always know the address of the variable in the master thread.
Differential Revision: http://reviews.llvm.org/D9026

llvm-svn: 235075

9 years ago[OPENMP] Codegen for 'lastprivate' clause in 'for' directive.
Alexey Bataev [Thu, 16 Apr 2015 04:54:05 +0000 (04:54 +0000)]
[OPENMP] Codegen for 'lastprivate' clause in 'for' directive.

#pragma omp for lastprivate(<var>)
for (i = a; i < b; ++b)
  <BODY>;

This construct is translated into something like:

  <last_iter> = alloca i32
  <lastprivate_var> = alloca <type>
  <last_iter> = 0
  ; No initializer for simple variables or a default constructor is called for objects.
  ; For arrays perform element by element initialization by the call of the default constructor.
  ...
  OMP_FOR_START(...,<last_iter>, ..); sets <last_iter> to 1 if this is the last iteration.
  <BODY>
  ...
  OMP_FOR_END
  if (<last_iter> != 0) {
    <var> = <lastprivate_var> ; Update original variable with the lastprivate value.
  }
  call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race.

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

llvm-svn: 235074

9 years agoReplace loop doing postorder walk with postorder iterator
Daniel Berlin [Thu, 16 Apr 2015 04:28:32 +0000 (04:28 +0000)]
Replace loop doing postorder walk with postorder iterator

Summary: LoopInfoImpl's loop population is just a normal postorder walk, written out.

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 235073

9 years ago[CodeGen] Re-apply r234809 (concat of scalars), with an x86_mmx fix.
Ahmed Bougacha [Thu, 16 Apr 2015 02:39:14 +0000 (02:39 +0000)]
[CodeGen] Re-apply r234809 (concat of scalars), with an x86_mmx fix.

The only type that isn't an integer, isn't floating point, and isn't
a vector; ladies and gentlemen, the gift that keeps on giving: x86_mmx!

Fixes PR23246.

Original message (reverted in r235062):
[CodeGen] Combine concat_vectors of scalars into build_vector.

Combine something like:
  (v8i8 concat_vectors (v2i8 bitcast (i16)) x4)
into:
  (v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4)))

If any of the scalars are floating point, use that throughout.

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

llvm-svn: 235072

9 years agoDebugInfo: DIRef<> => TypedDebugNodeRef<>
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 02:24:01 +0000 (02:24 +0000)]
DebugInfo: DIRef<> => TypedDebugNodeRef<>

Delete `DIRef<>`, and replace the remaining uses of it with
`TypedDebugNodeRef<>`.  To minimize code churn, I've added typedefs from
`MDTypeRef` to `DITypeRef` (etc.).

llvm-svn: 235071

9 years ago[RuntimeDyldELF] Fix missing cases in Placeholder processing
Keno Fischer [Thu, 16 Apr 2015 02:00:38 +0000 (02:00 +0000)]
[RuntimeDyldELF] Fix missing cases in Placeholder processing

Try to appease the build bots. We should write rtdyld test cases for these
to make them testible on other platforms.

llvm-svn: 235070

9 years agoDebugInfo: Gut DIDescriptor
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:53:33 +0000 (01:53 +0000)]
DebugInfo: Gut DIDescriptor

PR23080 is almost finished.  With this commit, there's no consequential
API in `DIDescriptor` and its subclasses.  What's left?

  - Default-constructed to `nullptr`.
  - Handy `const_cast<>` (constructed from `const`, but accessors are
    non-`const`).

I think the safe way to catch those is to delete the classes and fix
compile errors.  That'll be my next step, after I delete the `DITypeRef`
(etc.) wrapper around `MDTypeRef`.

llvm-svn: 235069

9 years agoDebugInfo: Prepare for DIDescriptor to be gutted in LLVM
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:53:23 +0000 (01:53 +0000)]
DebugInfo: Prepare for DIDescriptor to be gutted in LLVM

All the API is about to be dropped from `DIDescriptor` in LLVM, so stop
using it.

llvm-svn: 235068

9 years agoDebugInfo: Gut DIScope, DIEnumerator and DISubrange
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:37:00 +0000 (01:37 +0000)]
DebugInfo: Gut DIScope, DIEnumerator and DISubrange

The only class the still has API left is `DIDescriptor` itself.

llvm-svn: 235067

9 years agoDebugInfo: Prepare for DIScope to be gutted in LLVM
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:36:36 +0000 (01:36 +0000)]
DebugInfo: Prepare for DIScope to be gutted in LLVM

An upcoming LLVM commit will gut `DIScope`, so just use `MDScope*`
directly.

llvm-svn: 235066

9 years agoMake -arch work on MacOSX.
Greg Clayton [Thu, 16 Apr 2015 01:18:05 +0000 (01:18 +0000)]
Make -arch work on MacOSX.

llvm-svn: 235065

9 years agoDebugInfo: Gut DIType and subclasses
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:01:28 +0000 (01:01 +0000)]
DebugInfo: Gut DIType and subclasses

Continuing PR23080, gut `DIType` and its various subclasses, leaving
behind thin wrappers around the pointer types in the new debug info
hierarchy.

llvm-svn: 235064

9 years agoDebugInfo: Prepare for DIType to be gutted
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:00:56 +0000 (01:00 +0000)]
DebugInfo: Prepare for DIType to be gutted

`DIType` and its subclasses are about to be gutted in LLVM.  Prepare for
that by treating these like the raw pointers they wrap.

llvm-svn: 235063

9 years agoRevert r234809 because it caused PR23246.
Nick Lewycky [Thu, 16 Apr 2015 00:56:20 +0000 (00:56 +0000)]
Revert r234809 because it caused PR23246.

llvm-svn: 235062

9 years ago[SEH] Deal with users of the old lpad for SEH catch-all blocks
Reid Kleckner [Thu, 16 Apr 2015 00:02:04 +0000 (00:02 +0000)]
[SEH] Deal with users of the old lpad for SEH catch-all blocks

The way we split SEH catch-all blocks can leave some dead EH values
behind at -O0. Try to remove them, and if we fail, replace them all with
undef.

Fixes a crash when removing the old unreachable landingpad which is
still used by extractvalue instructions in the catch-all block.

llvm-svn: 235061

9 years ago[RuntimeDyldELF] Fold Placeholder into Addend
Keno Fischer [Wed, 15 Apr 2015 23:49:29 +0000 (23:49 +0000)]
[RuntimeDyldELF] Fold Placeholder into Addend

Summary:

This allows us to get rid of the original unrelocated object file after
we're done processing relocations (but before applying them).
MachO and COFF already do not require this (currently we have temporary hacks
to prevent ownership from being released, but those are brittle and should be
removed soon).

The placeholder mechanism allowed the relocation resolver to look at original
object file to obtain more information that are required to apply the
relocations. This is usually necessary in two cases:

- For relocations targetting sub-word memory locations, there may be pieces
  of the instruction at the target address which we should not override.
- Some relocations on some platforms allow an extra addend to be encoded in
  their immediate fields.

The problem is that in the second case the information cannot be recovered
after the relocations have been applied once because they will have been
overridden. In the first case we also need to be careful to not use any bits
that aren't fixed and may have been overriden by applying a first relocation.

In the past both have been fixed by just looking at original object file. This
patch attempts to recover the information from the first by looking at the
relocated object file, while the extra addend in the second case is read
upon relocation processing and addend to the regular addend.

I have tested this on X86. Other platforms represent my best understanding
of how those relocations should work, but I may have missed something because
I do not have access to those platforms.
We will keep the ugly workarounds in place for a couple of days, so this commit
can be reverted if it breaks the bots.

Reviewers: petarj, t.p.northover, lhames

Reviewed By: lhames

Subscribers: aemerson, llvm-commits

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

llvm-svn: 235060

9 years agoDebugInfo: Remove unnecessary API from DIDerivedType and DIType
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 23:49:09 +0000 (23:49 +0000)]
DebugInfo: Remove unnecessary API from DIDerivedType and DIType

Remove the accessors of `DIDerivedType` that downcast to
`MDDerivedType`, shifting the `cast<MDDerivedType>` into the callers.
Also remove `DIType::isValid()`, which is really just a check against
`nullptr` at this point.

llvm-svn: 235059

9 years agoDebugInfo: Prepare for LLVM change removing DIType::isValid()
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 23:48:50 +0000 (23:48 +0000)]
DebugInfo: Prepare for LLVM change removing DIType::isValid()

This is being replaced with a null check.

llvm-svn: 235058

9 years agoComment parsing: fix an assertion failure on a verbatim block terminated with "**/"
Dmitri Gribenko [Wed, 15 Apr 2015 23:45:43 +0000 (23:45 +0000)]
Comment parsing: fix an assertion failure on a verbatim block terminated with "**/"

llvm-svn: 235057

9 years agoFix OS default in Makefile.rules for Windows. http://reviews.llvm.org/D9043
Adrian McCarthy [Wed, 15 Apr 2015 23:38:23 +0000 (23:38 +0000)]
Fix OS default in Makefile.rules for Windows. reviews.llvm.org/D9043

llvm-svn: 235056

9 years agoDebugInfo: Gut DICompileUnit and DIFile
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 23:19:27 +0000 (23:19 +0000)]
DebugInfo: Gut DICompileUnit and DIFile

Continuing gutting `DIDescriptor` subclasses; this edition,
`DICompileUnit` and `DIFile`.  In the name of PR23080.

llvm-svn: 235055

9 years agoDebugInfo: Prepare for LLVM gutting DICompileUnit/DIFile
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 23:19:15 +0000 (23:19 +0000)]
DebugInfo: Prepare for LLVM gutting DICompileUnit/DIFile

An upcoming LLVM commit will gut `DICompileUnit` and `DIFile`, so start
treating them more like pointers.

llvm-svn: 235054

9 years agoDon't crash when a selectany symbol would get common linkage
Nico Weber [Wed, 15 Apr 2015 23:04:24 +0000 (23:04 +0000)]
Don't crash when a selectany symbol would get common linkage

Things can't both be in comdats and have common linkage, so never give things
in comdats common linkage. Common linkage is only used in .c files, and the
only thing that can trigger a comdat in c is selectany from what I can tell.
Fixes PR23243.

Also address an over-the-shoulder review comment from rnk by moving the
hasAttr<SelectAnyAttr>() in Decl.cpp around a bit. It only makes a minor
difference for selectany on global variables, so it goes well with the rest of
this patch.

http://reviews.llvm.org/D9042

llvm-svn: 235053

9 years agoDebugInfo: factor out dead variable in NDEBUG from r235050
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 22:42:43 +0000 (22:42 +0000)]
DebugInfo: factor out dead variable in NDEBUG from r235050

Caught by the lld bot:

http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/9832

llvm-svn: 235052

9 years agoFix for PR20402 in -Wconsumed.
DeLesley Hutchins [Wed, 15 Apr 2015 22:32:44 +0000 (22:32 +0000)]
Fix for PR20402 in -Wconsumed.
https://llvm.org/bugs/show_bug.cgi?id=20402
Patch by Chris Wailes.

llvm-svn: 235051

9 years agoDebugInfo: Remove 'inlinedAt:' field from MDLocalVariable
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 22:29:27 +0000 (22:29 +0000)]
DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable

Remove 'inlinedAt:' from MDLocalVariable.  Besides saving some memory
(variables with it seem to be single largest `Metadata` contributer to
memory usage right now in -g -flto builds), this stops optimization and
backend passes from having to change local variables.

The 'inlinedAt:' field was used by the backend in two ways:

 1. To tell the backend whether and into what a variable was inlined.
 2. To create a unique id for each inlined variable.

Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg`
attachment, and change the DWARF backend to use a typedef called
`InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`.
This `DebugLoc` is already passed reliably through the backend (as
verified by r234021).

This commit removes the check from r234021, but I added a new check
(that will survive) in r235048, and changed the `DIBuilder` API in
r235041 to require a `!dbg` attachment whose 'scope:` is in the same
`MDSubprogram` as the variable's.

If this breaks your out-of-tree testcases, perhaps the script I used
(mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778
in a moment.

llvm-svn: 235050

9 years agoCreate a frontend flag to disable CUDA cross-target call checks
Eli Bendersky [Wed, 15 Apr 2015 22:27:06 +0000 (22:27 +0000)]
Create a frontend flag to disable CUDA cross-target call checks

For CUDA source, Sema checks that the targets of call expressions make sense
(e.g. a host function can't call a device function).

Adding a flag that lets us skip this check. Motivation: for source-to-source
translation tools that have to accept code that's not strictly kosher CUDA but
is still accepted by nvcc. The source-to-source translation tool can then fix
the code and leave calls that are semantically valid for the actual compilation
stage.

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

llvm-svn: 235049

9 years agoVerifier: Check that @llvm.dbg.* intrinsics have a !dbg attachment
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 22:15:46 +0000 (22:15 +0000)]
Verifier: Check that @llvm.dbg.* intrinsics have a !dbg attachment

Before we start to rely on valid `!dbg` attachments, add a check to the
verifier that `@llvm.dbg.*` intrinsics always have one.  Also check that
the `scope:` fields point at the same `MDSubprogram`.

This is in the context of PR22778.  The check that the `inlinedAt:`
fields agree has baked for a while (since r234021), so I'll kill [1] the
`MDLocalVariable::getInlinedAt()` field soon.

[1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150330/269387.html

Unfortunately, that means it's impossible to keep the current `Verifier`
checks, which rely on comparing `inlinedAt:` fields.  We'll be able to
keep the checks I'm adding here.

If this breaks your out-of-tree testcases, the upgrade script
(add-dbg-to-intrinsics.sh) attached to PR22778 that I used for r235040
might fix them for you.

llvm-svn: 235048

9 years agoclang-format a line containing nothing but a "{". No behavior change.
Nico Weber [Wed, 15 Apr 2015 21:53:00 +0000 (21:53 +0000)]
clang-format a line containing nothing but a "{". No behavior change.

llvm-svn: 235047

9 years agoMake __declspec(selectany) turn variable declartions into definitions.
Nico Weber [Wed, 15 Apr 2015 21:50:06 +0000 (21:50 +0000)]
Make __declspec(selectany) turn variable declartions into definitions.

Fixes PR23242.

llvm-svn: 235046

9 years agoOne more -Wrange-loop-analysis cleanup.
Richard Trieu [Wed, 15 Apr 2015 21:40:50 +0000 (21:40 +0000)]
One more -Wrange-loop-analysis cleanup.

llvm-svn: 235044