platform/upstream/llvm.git
9 years ago[asan] Re-enable zero_page_pc test on Android.
Evgeniy Stepanov [Tue, 18 Nov 2014 14:28:57 +0000 (14:28 +0000)]
[asan] Re-enable zero_page_pc test on Android.

It's not failing anymore. Not sure what has changed (the bot was down for a
long time), but lets keep it this way.

llvm-svn: 222236

9 years agoDon't include <stddef.h>
Jeroen Ketema [Tue, 18 Nov 2014 14:19:27 +0000 (14:19 +0000)]
Don't include <stddef.h>

Including a standard or system header isn't allowed in OpenCL.

The type "size_t" needs to be explicitely defined now.

v2: Use __SIZE_TYPE__ instead of unsigned int.
v3: Define ptrdiff_t and NULL.

Patch-by: Jean-Sébastien Pédron
Reviewed-by: Jeroen Ketema
Reviewed-by: Jan Vesely
llvm-svn: 222235

9 years ago[asan] Fix CMake CMP0046 warning in standalone build.
Evgeniy Stepanov [Tue, 18 Nov 2014 14:04:12 +0000 (14:04 +0000)]
[asan] Fix CMake CMP0046 warning in standalone build.

Make FileCheck an "imported dependency" in standalone build.

llvm-svn: 222234

9 years agoCallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.
NAKAMURA Takumi [Tue, 18 Nov 2014 12:23:19 +0000 (12:23 +0000)]
CallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.

MSVC Runtime detects "Assertion failed: vector iterator not incrementable"

llvm-svn: 222233

9 years ago[msan] Remove MSanDR and supporting code.
Evgeniy Stepanov [Tue, 18 Nov 2014 10:33:15 +0000 (10:33 +0000)]
[msan] Remove MSanDR and supporting code.

MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.

This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.

llvm-svn: 222232

9 years ago[OPENMP] Additional processing of 'omp atomic read' directive.
Alexey Bataev [Tue, 18 Nov 2014 10:14:22 +0000 (10:14 +0000)]
[OPENMP] Additional processing of 'omp atomic read' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it.

llvm-svn: 222231

9 years agoInstCombine: Fold away tautological masked compares
David Majnemer [Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)]
InstCombine: Fold away tautological masked compares

It is impossible for (x & INT_MAX) == 0 && x == INT_MAX to ever be true.

While this sort of reasoning should normally live in InstSimplify,
the machinery that derives this result is not trivial to split out.

llvm-svn: 222230

9 years agoInstCombine: Clean up foldLogOpOfMaskedICmps
David Majnemer [Tue, 18 Nov 2014 09:31:36 +0000 (09:31 +0000)]
InstCombine: Clean up foldLogOpOfMaskedICmps

No functional change intended.

llvm-svn: 222229

9 years agotsan: add description of AcquireGlobal function
Dmitry Vyukov [Tue, 18 Nov 2014 06:44:43 +0000 (06:44 +0000)]
tsan: add description of AcquireGlobal function

llvm-svn: 222228

9 years agoAdd PIC-level support to Clang.
Justin Hibbits [Tue, 18 Nov 2014 06:17:20 +0000 (06:17 +0000)]
Add PIC-level support to Clang.

Summary:
This distinguishes between -fpic and -fPIC now, with the additions in LLVM for
PIC level support.

Test Plan: No regressions

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: rnk, emaste, llvm-commits

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

llvm-svn: 222227

9 years agoFix up the code in the FuncUnwinders class that
Jason Molenda [Tue, 18 Nov 2014 05:57:42 +0000 (05:57 +0000)]
Fix up the code in the FuncUnwinders class that
retrieves the personality routine addr and the
LSDA addr.  Don't bother checking with the
"non-call site" unwind plan - this kind of
information is only going to come from the
call site unwind plan.

llvm-svn: 222226

9 years agoAdd documentation for the SBTarget::ReadInstructions and
Jason Molenda [Tue, 18 Nov 2014 05:43:11 +0000 (05:43 +0000)]
Add documentation for the SBTarget::ReadInstructions and
SBTarget::GetInstructions APIs so it's a little clearer to
understand which should be used.

<rdar://problem/18787018>

llvm-svn: 222225

9 years ago[ASTReader] Add a convenience function to retrieve all the input files of a module...
Argyrios Kyrtzidis [Tue, 18 Nov 2014 05:24:18 +0000 (05:24 +0000)]
[ASTReader] Add a convenience function to retrieve all the input files of a module file.

llvm-svn: 222224

9 years agodocs: Modernize some examples in WritingAnLLVMPass
Justin Bogner [Tue, 18 Nov 2014 05:22:39 +0000 (05:22 +0000)]
docs: Modernize some examples in WritingAnLLVMPass

llvm-svn: 222223

9 years agodocs: Fix a couple of typo-ish errors in WritingAnLLVMPass
Justin Bogner [Tue, 18 Nov 2014 05:00:52 +0000 (05:00 +0000)]
docs: Fix a couple of typo-ish errors in WritingAnLLVMPass

- Make CallGraphSCCPass's paragraph about doFinalization refer to
  runOnSCC instead of runOnFunction, since that's what it's about.
- Fix a reference in the FunctionPass paragraph.

llvm-svn: 222222

9 years agoMake the mutex ivar in Unwind recursive so we don't have a thread
Jason Molenda [Tue, 18 Nov 2014 04:57:28 +0000 (04:57 +0000)]
Make the mutex ivar in Unwind recursive so we don't have a thread
deadlocking when we have the base Unwind class and the HistoryUnwind
subclass both trying to acquire the lock on the same thread to clear
their respective ivar state.
<rdar://problem/18986350>

llvm-svn: 222221

9 years agoFully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()
Frederic Riss [Tue, 18 Nov 2014 03:40:51 +0000 (03:40 +0000)]
Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()

Currently this function would return nothing for functions or globals that
haven't seen a definition yet. Make it return a forward declaration that will
get RAUWed with the definition if one is seen at a later point. The strategy
used to implement this is similar to what's done for types: the forward
declarations are stored in a vector and post processed upon finilization to
perform the required RAUWs.

For now the only user of getDeclarationOrDefinition() is EmitUsingDecl(), thus
this patch allows to emit correct imported declarations even in the absence of
an actual definition of the imported entity.

(Another user will be the debug info generation for argument default values
that I need to resurect).

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

llvm-svn: 222220

9 years ago[DebugInfo] Move collection of various function/var decl properties into helper funct...
Frederic Riss [Tue, 18 Nov 2014 03:40:46 +0000 (03:40 +0000)]
[DebugInfo] Move collection of various function/var decl properties into helper functions.

NFC. Helpers to be re-used in upcoming commit.

llvm-svn: 222219

9 years agoUpdate to match LLVM r222216
David Majnemer [Tue, 18 Nov 2014 03:06:52 +0000 (03:06 +0000)]
Update to match LLVM r222216

llvm-svn: 222218

9 years agoAllow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable...
Frederic Riss [Tue, 18 Nov 2014 02:46:11 +0000 (02:46 +0000)]
Allow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable DIE.

Usually global variables are in a retain list and instanciated before
any call to constructImportedEntityDIE is made. This isn't true for
forward declarations though.
The testcase for this change is generated by a clang patched to emit
such forward declarations (patch at http://reviews.llvm.org/D6173
which will land soon). The updated testcase tests more than just
global variables, it now tests every type of 'using' clause we
support.

llvm-svn: 222217

9 years agollvm-readobj: Don't print the Characteristics field as the Subsystem
David Majnemer [Tue, 18 Nov 2014 02:45:28 +0000 (02:45 +0000)]
llvm-readobj: Don't print the Characteristics field as the Subsystem

We claimed that we were printing the Subystem field when we were
actually printing the Characteristics field.

llvm-svn: 222216

9 years agoSimplifyCFG: Range'ify some for-loops. No functional change.
Hans Wennborg [Tue, 18 Nov 2014 02:37:11 +0000 (02:37 +0000)]
SimplifyCFG: Range'ify some for-loops. No functional change.

llvm-svn: 222215

9 years agoRead the LSDA and Personality Routine function address out of the
Jason Molenda [Tue, 18 Nov 2014 02:27:42 +0000 (02:27 +0000)]
Read the LSDA and Personality Routine function address out of the
eh_frame data.  These two pieces of information are used in the
process of exception handler unwinding on SysV ABI systems.

This patch reads the data from the eh_frame section
(DWARFCallFrameInfo.cpp), allows for it to be saved & read out
of a given UnwindPlan (UnwindPlan.h, UnwindPlan.cpp) - as well
as printing the information in the UnwindPlan::Dump method - and
adds methods to the FuncUnwinders object so that higher levels
can query if a given function has an LSDA / personality routine
defined.

It's only lightly tested, but seems to be working correctly as long
as your have this information in eh_frame.  Does not address getting
this information from compact unwind yet on Darwin systems.

<rdar://problem/18742797>

llvm-svn: 222214

9 years agoIndVarSimplify: Allow LFTR to fire more often
David Majnemer [Tue, 18 Nov 2014 02:20:58 +0000 (02:20 +0000)]
IndVarSimplify: Allow LFTR to fire more often

I added a pessimization in r217102 to prevent miscompiles when the
incremented induction variable was used in a comparison; it would be
poison.

Try to use the incremented induction variable more often when we can be
sure that the increment won't end in poison.

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

llvm-svn: 222213

9 years agoIR: Sink MDNode::Hash down to GenericMDNode::Hash
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 02:20:29 +0000 (02:20 +0000)]
IR: Sink MDNode::Hash down to GenericMDNode::Hash

Part of PR21532.

llvm-svn: 222212

9 years agoIR: Move MDNode operands from the back to the front
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 01:56:14 +0000 (01:56 +0000)]
IR: Move MDNode operands from the back to the front

Having the operands at the back prevents subclasses from safely adding
fields.  Move them to the front.

Instead of replicating the custom `malloc()`, `free()` and `DestroyFlag`
logic that was there before, overload `new` and `delete`.

I added calls to a new `GenericMDNode::dropAllReferences()` in
`LLVMContextImpl::~LLVMContextImpl()`.  There's a maze of callbacks
happening during teardown, and this resolves them before we enter
the destructors.

Part of PR21532.

llvm-svn: 222211

9 years agoUpdate testing case that was accidently duplicated.
Manman Ren [Tue, 18 Nov 2014 01:49:06 +0000 (01:49 +0000)]
Update testing case that was accidently duplicated.

llvm-svn: 222210

9 years agoFix covered switch warning
Michael J. Spencer [Tue, 18 Nov 2014 01:26:46 +0000 (01:26 +0000)]
Fix covered switch warning

llvm-svn: 222209

9 years agoSupport ELF files of unknown type.
Michael J. Spencer [Tue, 18 Nov 2014 01:14:25 +0000 (01:14 +0000)]
Support ELF files of unknown type.

llvm-svn: 222208

9 years agoHave CommandObjectCommandsAddRegex inherit from IOHandlerDelegateMultiline so it...
Greg Clayton [Tue, 18 Nov 2014 00:43:17 +0000 (00:43 +0000)]
Have CommandObjectCommandsAddRegex inherit from IOHandlerDelegateMultiline so it will not immediately terminate after the first regular expression in "command regex <name>" commands.

Fixed the prompt to not include non-printable characters as it was hosing up the prompt when you ran "command regex foo" and entered multi-line editing mode.

Fixed error strings to include more complete descriptions when bad regular expressions are entered.

Removed the old IOHandlerLinesUpdated function as it is no longer needed (inheriting from IOHandlerDelegateMultiline takes care of what this function used to do).

llvm-svn: 222207

9 years agoFixed a broken test suite test after recent editline merges.
Greg Clayton [Tue, 18 Nov 2014 00:39:31 +0000 (00:39 +0000)]
Fixed a broken test suite test after recent editline merges.

The problem is that editline currently is trying to be smart when we paste things into a terminal window. It detects that input is pending and multi-line input is accepted as long as there is anything pending.

So if you open lldb and paste the text between the quotes:

"command regex carp
s/^$/help/

carp
"

We still still be stuck in the "command regex" multi-line input reader as it will have all three lines:

"s/^$/help/

carp
"

The true fix for this is something Kate Stone will soon work on:

- multi-line input readers must opt into this paste/pending input feature ("expr" will opt into it, all other commands won't)
- If we are in a multi-line input reader that requests this and stuff is pasted, then it will do what it does today
- if we start in a IOHandler that doesn't need/want pending input and text is pasted, and we transistion to a IOHandler that does want this functionality, then disable the pending input. Example text would be:

"frame variable
thread backtrace
expr
for (int i=0;i<10;++i)
  (int)printf("i = %i\n", i);

frame select 0
"

When we push the expression multi-line reader we would disable the pending input because we had pending input _before_ we entered "expr".

If we did this first:

(lldb) expr

Then we pasted:

"void foo()
{
}

void bar()
{
}
"

Then we would allow the pending input to not look for an empty line to terminate the expression. We filed radar 19008425 to track fixing this issue.

llvm-svn: 222206

9 years agoIR: Split MDNode into GenericMDNode and MDNodeFwdDecl
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 00:37:17 +0000 (00:37 +0000)]
IR: Split MDNode into GenericMDNode and MDNodeFwdDecl

Split `MDNode` into two classes:

  - `GenericMDNode`, which is uniquable (and for now, always starts
    uniqued).  Once `Metadata` is split from the `Value` hierarchy, this
    class will lose the ability to RAUW itself.

  - `MDNodeFwdDecl`, which is used for the "temporary" interface, is
    never uniqued, and isn't managed by `LLVMContext` at all.

I've left most of the guts in `MDNode` for now, but I'll incrementally
move things to the right places (or delete the functionality, as
appropriate).

Part of PR21532.

llvm-svn: 222205

9 years agoInstrProf: Don't emit coverage for uninstantiated templates
Justin Bogner [Tue, 18 Nov 2014 00:34:46 +0000 (00:34 +0000)]
InstrProf: Don't emit coverage for uninstantiated templates

We include unused functions and methods in -fcoverage-mapping so that
we can differentiate between uninstrumented and unused. This can cause
problems for uninstantiated templates though, since they may involve
an incomplete type that can't be mangled. This shows up in things like
libc++'s <unordered_map> and makes coverage unusable.

Avoid the issue by skipping uninstantiated methods of a templated
class.

llvm-svn: 222204

9 years agoRevert r222040 because of bot failure.
Manman Ren [Tue, 18 Nov 2014 00:33:22 +0000 (00:33 +0000)]
Revert r222040 because of bot failure.

http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green.

llvm-svn: 222203

9 years ago[mach-o] zero-fill sections have no file offset
Nick Kledzik [Tue, 18 Nov 2014 00:30:29 +0000 (00:30 +0000)]
[mach-o] zero-fill sections have no file offset

In mach-o, sections of type S_ZEROFILL are special cased and to always have
their section.offset field be zero.

llvm-svn: 222202

9 years ago[mach-o] extract atom alignment information from mach-o files
Nick Kledzik [Tue, 18 Nov 2014 00:30:25 +0000 (00:30 +0000)]
[mach-o] extract atom alignment information from mach-o files

llvm-svn: 222201

9 years ago[mach-o] enhance arm64 reloc parser to support local pointer relocations
Nick Kledzik [Tue, 18 Nov 2014 00:30:22 +0000 (00:30 +0000)]
[mach-o] enhance arm64 reloc parser to support local pointer relocations

The arm64 assembler almost always uses r_extern=1 relocations in which the
r_symbolnum field is the index of the symbol the relocation references.  But
sometimes it will set r_extern=0 in which case the linker needs to read the
content of the reloction to determine the target.

Add test case that the r_extern=0 relocation round trips.

llvm-svn: 222200

9 years ago[mach-o] fix typos. No function change
Nick Kledzik [Tue, 18 Nov 2014 00:30:20 +0000 (00:30 +0000)]
[mach-o] fix typos. No function change

llvm-svn: 222199

9 years ago[mach-o] enhance arm64 reloc parser to support local pointer relocations
Nick Kledzik [Tue, 18 Nov 2014 00:30:17 +0000 (00:30 +0000)]
[mach-o] enhance arm64 reloc parser to support local pointer relocations

The arm64 assembler almost always uses r_extern=1 relocations in which the
r_symbolnum field is the index of the symbol the relocation references.  But
sometimes it will set r_extern=0 in which case the linker needs to read the
content of the reloction to determine the target.

Add test case that the r_extern=0 relocation round trips.

llvm-svn: 222198

9 years ago[mach-o] fix typos. No function change
Nick Kledzik [Tue, 18 Nov 2014 00:30:14 +0000 (00:30 +0000)]
[mach-o] fix typos. No function change

llvm-svn: 222197

9 years agoDebug Info: context field of a global variable is DIScopeRef.
Manman Ren [Tue, 18 Nov 2014 00:29:32 +0000 (00:29 +0000)]
Debug Info: context field of a global variable is DIScopeRef.

Paired commit with r222195.

llvm-svn: 222196

9 years agoDebug Info: In DIBuilder, the context field of a global variable is updated to
Manman Ren [Tue, 18 Nov 2014 00:29:08 +0000 (00:29 +0000)]
Debug Info: In DIBuilder, the context field of a global variable is updated to
use DIScopeRef.

A paired commit at clang will follow to show cases where we will use an
identifer for the context of a global variable.

rdar://18958417

llvm-svn: 222195

9 years agoFix an assertion when ending a function definition.
John McCall [Tue, 18 Nov 2014 00:19:01 +0000 (00:19 +0000)]
Fix an assertion when ending a function definition.

The bug is that ExprCleanupObjects isn't always empty
in a fresh evaluation context.  New evaluation contexts just
track the current depth of the stack.

The assertion will misfire whenever we finish processing
a function body inside an expression that contained an earlier
block literal with non-trivial captures.  That's actually
a lot less likely than you'd think, though, because it has
to be a real function declaration, not just another block.
Mixed block/lambda code would work, as would a template
instantiation or a local class definition.

The code works correctly if the assertion is disabled.

rdar://16356628

llvm-svn: 222194

9 years agoMake DiagnosticsEngine::takeClient return std::unique_ptr<>
Alexander Kornienko [Mon, 17 Nov 2014 23:46:02 +0000 (23:46 +0000)]
Make DiagnosticsEngine::takeClient return std::unique_ptr<>

Summary:
Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated
callers to store conditional ownership using a pair of pointer and unique_ptr
instead of a pointer + bool. Updated code that temporarily registers clients to
use the non-owning registration (+ removed extra calls to takeClient).

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: cfe-commits

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

llvm-svn: 222193

9 years agoHandle use of default member initializers before end of outermost class
Reid Kleckner [Mon, 17 Nov 2014 23:36:45 +0000 (23:36 +0000)]
Handle use of default member initializers before end of outermost class

Specifically, when we have this situation:
  struct A {
    template <typename T> struct B {
      int m1 = sizeof(A);
    };
    B<int> m2;
  };

We can't parse m1's initializer eagerly because we need A to be
complete.  Therefore we wait until the end of A's class scope to parse
it. However, we can trigger instantiation of B before the end of A,
which will attempt to instantiate the field decls eagerly, and it would
build a bad field decl instantiation that said it had an initializer but
actually lacked one.

Fixed by deferring instantiation of default member initializers until
they are needed during constructor analysis. This addresses a long
standing FIXME in the code.

Fixes PR19195.

Reviewed By: rsmith

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

llvm-svn: 222192

9 years agoIR: Simplify uniquing for MDNode
Duncan P. N. Exon Smith [Mon, 17 Nov 2014 23:28:21 +0000 (23:28 +0000)]
IR: Simplify uniquing for MDNode

Change uniquing from a `FoldingSet` to a `DenseSet` with custom
`DenseMapInfo`.  Unfortunately, this doesn't save any memory, since
`DenseSet<T>` is a simple wrapper for `DenseMap<T, char>`, but I'll come
back to fix that later.

I used the name `GenericDenseMapInfo` to the custom `DenseMapInfo` since
I'll be splitting `MDNode` into two classes soon: `MDNodeFwdDecl` for
temporaries, and `GenericMDNode` for everything else.

I also added a non-debug-info reduced version of a type-uniquing test
that started failing on an earlier draft of this patch.

Part of PR21532.

llvm-svn: 222191

9 years agoFix a problem where the StringPrinter could be mistaking an empty string for a read...
Enrico Granata [Mon, 17 Nov 2014 23:14:11 +0000 (23:14 +0000)]
Fix a problem where the StringPrinter could be mistaking an empty string for a read error, and reporting spurious 'unable to read data' messages. rdar://19007243

llvm-svn: 222190

9 years agoAdd APIs on SBFunction and SBCompileUnit to inquire about the language type that...
Enrico Granata [Mon, 17 Nov 2014 23:06:20 +0000 (23:06 +0000)]
Add APIs on SBFunction and SBCompileUnit to inquire about the language type that the function/compile unit is defined in

llvm-svn: 222189

9 years agoRevert "ADT: correctly report isMSVCEnvironment for windows itanium"
Reid Kleckner [Mon, 17 Nov 2014 22:55:59 +0000 (22:55 +0000)]
Revert "ADT: correctly report isMSVCEnvironment for windows itanium"

This reverts commit r222180.

llvm-svn: 222188

9 years agoRevert "Improve memory ownership/management in TableGen by unique_ptrifying TreePatte...
David Blaikie [Mon, 17 Nov 2014 22:55:41 +0000 (22:55 +0000)]
Revert "Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member."

This reverts commit r222183.

Broke on the MSVC buildbots due to MSVC not producing default move
operations - I'd fix it immediately but just broke my build system a
bit, so backing out until I have a chance to get everything going again.

llvm-svn: 222187

9 years agoFix override/virtual warnings.
Eric Christopher [Mon, 17 Nov 2014 22:55:13 +0000 (22:55 +0000)]
Fix override/virtual warnings.

llvm-svn: 222186

9 years agoChange HostThread::GetNativeThread() to return a derived reference.
Zachary Turner [Mon, 17 Nov 2014 22:42:57 +0000 (22:42 +0000)]
Change HostThread::GetNativeThread() to return a derived reference.

Previously using HostThread::GetNativeThread() required an ugly
cast to most-derived type.  This solves the issue by simply returning
the derived type directly.

llvm-svn: 222185

9 years agoFix broken NativeProcessLinux.cpp after signature change of ResolveExecutable.
Oleksiy Vyalov [Mon, 17 Nov 2014 22:42:28 +0000 (22:42 +0000)]
Fix broken NativeProcessLinux.cpp after signature change of ResolveExecutable.

llvm-svn: 222184

9 years agoImprove memory ownership/management in TableGen by unique_ptrifying TreePattern's...
David Blaikie [Mon, 17 Nov 2014 22:16:55 +0000 (22:16 +0000)]
Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member.

The next step is to actually use unique_ptr in TreePatternNode's
Children vector. That will be more intrusive, and may not work,
depending on exactly how these things are handled (I have a bad
suspicion things are shared more than they should be, making this more
DAG than tree - but if it's really a tree, unique_ptr should suffice)

llvm-svn: 222183

9 years agoFix broken Linux build after signature change of ResolveExecutable.
Oleksiy Vyalov [Mon, 17 Nov 2014 22:16:42 +0000 (22:16 +0000)]
Fix broken Linux build after signature change of ResolveExecutable.

llvm-svn: 222182

9 years agoCMake: Use the new USES_TERMINAL option for test suite targets when available.
Peter Collingbourne [Mon, 17 Nov 2014 22:16:15 +0000 (22:16 +0000)]
CMake: Use the new USES_TERMINAL option for test suite targets when available.

llvm-svn: 222181

9 years agoADT: correctly report isMSVCEnvironment for windows itanium
Saleem Abdulrasool [Mon, 17 Nov 2014 22:13:26 +0000 (22:13 +0000)]
ADT: correctly report isMSVCEnvironment for windows itanium

The itanium environment on Windows uses MSVC and is a MSVC environment.  Report
this correctly.

llvm-svn: 222180

9 years agoCodeGen: make a check stricter
Saleem Abdulrasool [Mon, 17 Nov 2014 22:11:07 +0000 (22:11 +0000)]
CodeGen: make a check stricter

When targeting Windows itanium (a MSVC environment), use itanium style
exceptions rather than SEH.  Existing test cases already test this code path.
Applying this change ensures that tests wont break due to a parallel change in
LLVM (to correctly report isMSVCEnvironment).

llvm-svn: 222179

9 years agoMove the thread logic around to fit better into LLDB's process model.
Zachary Turner [Mon, 17 Nov 2014 21:31:30 +0000 (21:31 +0000)]
Move the thread logic around to fit better into LLDB's process model.

Previously we were directly updating the thread list and stopping
and restarting the process every time threads were created.  With
this patch, we queue up thread launches and thread exits, resolve
these all internally, and only update the threads when we get an
UpdateThreadList call.  We now only update the private state on
an actual stop (i.e. breakpoint).

llvm-svn: 222178

9 years agoDisable Editline on Windows.
Zachary Turner [Mon, 17 Nov 2014 21:31:18 +0000 (21:31 +0000)]
Disable Editline on Windows.

Editline does not work correctly on Windows.  This goes back at
least to r208369, and as a result r210105 was submitted to disable
libedit at runtime on Windows.

More recently, r222163 was submitted which re-writes editline
entirely, but makes the situation even worse on Windows, to the
point that it doesn't even compile.  While it would be easy to
fix the compilation failure, this patch simply stops compiling
Editline entirely on Windows, as the simple compilation fix would
still result in a broken use of select on Windows, and as such a
broken implementation of Editline.

Since Editline was already disabled to begin with on Windows, we
don't attempt to fix the compilation failure or the underlying
issues, and instead just disable it "even more".

llvm-svn: 222177

9 years agoFix broken build after signature change of ResolveExecutable.
Zachary Turner [Mon, 17 Nov 2014 21:30:58 +0000 (21:30 +0000)]
Fix broken build after signature change of ResolveExecutable.

llvm-svn: 222176

9 years agoR600/SI: Don't copy flags when extracting subreg
Matt Arsenault [Mon, 17 Nov 2014 21:11:37 +0000 (21:11 +0000)]
R600/SI: Don't copy flags when extracting subreg

This was resulting in use of a register after a kill.
For some reason this showed up as a problem in many tests
when moving the SIFixSGPRCopies pass closer to instruction
selection.

llvm-svn: 222175

9 years agoR600/SI: Assume SIFixSGPRCopies makes changes
Matt Arsenault [Mon, 17 Nov 2014 21:11:34 +0000 (21:11 +0000)]
R600/SI: Assume SIFixSGPRCopies makes changes

I'm not sure if this was breaking anything.

llvm-svn: 222174

9 years agoFix the autoconf build.
Rafael Espindola [Mon, 17 Nov 2014 21:06:38 +0000 (21:06 +0000)]
Fix the autoconf build.

llvm-svn: 222173

9 years agoFactor common code it Linker::init.
Rafael Espindola [Mon, 17 Nov 2014 20:51:01 +0000 (20:51 +0000)]
Factor common code it Linker::init.

The TypeFinder was not being used in one of the constructors.

llvm-svn: 222172

9 years agoSmall tweaks to make the editline sources match the lldb
Jason Molenda [Mon, 17 Nov 2014 20:10:15 +0000 (20:10 +0000)]
Small tweaks to make the editline sources match the lldb
source layout.

llvm-svn: 222171

9 years agoPass a reference to ValueEnumerator.
Rafael Espindola [Mon, 17 Nov 2014 20:06:27 +0000 (20:06 +0000)]
Pass a reference to ValueEnumerator.

NFC. This will just make it easier to use std::unique_ptr in a caller.

llvm-svn: 222170

9 years agoMissing comma in a string array initialization (CID 1254893)
Sylvestre Ledru [Mon, 17 Nov 2014 19:41:49 +0000 (19:41 +0000)]
Missing comma in a string array initialization (CID 1254893)

Summary:
We have this error from a while (Wed Jun 15 18:02:42 2011
r133103)

Reviewers: rsmith

Reviewed By: rsmith

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

llvm-svn: 222169

9 years ago[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.
Juergen Ributzka [Mon, 17 Nov 2014 19:39:56 +0000 (19:39 +0000)]
[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.

When converting a switch to a lookup table we might have to generate a bitmaks
to encode and check for holes in the original switch statement.

The type of this mask depends on the number of switch statements, which can
result in illegal types for pretty much all architectures.

To avoid unnecessary type legalization and help FastISel this commit increases
the size of the bitmask to next power-of-2 value when necessary.

This fixes rdar://problem/18984639.

llvm-svn: 222168

9 years agoFixed more fallout from running the test suite remotely on iOS devices.
Greg Clayton [Mon, 17 Nov 2014 19:39:20 +0000 (19:39 +0000)]
Fixed more fallout from running the test suite remotely on iOS devices.

Fixed include:
- Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch).
- Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener.
- Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now
- Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules:

    size_t
    Target::UnloadModuleSections (const ModuleList &module_list);

    size_t
    Target::UnloadModuleSections (const lldb::ModuleSP &module_sp);

llvm-svn: 222167

9 years agoRevert commits r222146 and r222137.
Rafael Espindola [Mon, 17 Nov 2014 19:26:40 +0000 (19:26 +0000)]
Revert commits r222146 and r222137.

They were producing the wrong result if NumBits == BitsInWord. The old mask
produced -1, the new mask 0.

This should fix the 32 bit bots.

llvm-svn: 222166

9 years agoFix the tests I broke with the last commit. Sorry for the noise
Marshall Clow [Mon, 17 Nov 2014 19:16:57 +0000 (19:16 +0000)]
Fix the tests I broke with the last commit. Sorry for the noise

llvm-svn: 222165

9 years agoclang-cl: Allow /Fo without an argument (PR21589)
Hans Wennborg [Mon, 17 Nov 2014 19:16:36 +0000 (19:16 +0000)]
clang-cl: Allow /Fo without an argument (PR21589)

When it's used without an argument, the default file name is
used. The same goes for /Fe.

Also, allow using /Fo, /Fa and /Fe with multiple inputs if they
don't have an argument.

llvm-svn: 222164

9 years agoComplete rewrite of interactive editing support for single- and multi-line input.
Kate Stone [Mon, 17 Nov 2014 19:06:59 +0000 (19:06 +0000)]
Complete rewrite of interactive editing support for single- and multi-line input.

Improvements include:
* Use of libedit's wide character support, which is imperfect but a distinct improvement over ASCII-only
* Fallback for ASCII editing path
* Support for a "faint" prompt clearly distinguished from input
* Breaking lines and insert new lines in the middle of a batch by simply pressing return
* Joining lines with forward and backward character deletion
* Detection of paste to suppress automatic formatting and statement completion tests
* Correctly reformatting when lines grow or shrink to occupy different numbers of rows
* Saving multi-line history, and correctly preserving the "tip" of history during editing
* Displaying visible ^C and ^D indications when interrupting input or sending EOF
* Fledgling VI support for multi-line editing
* General correctness and reliability improvements

llvm-svn: 222163

9 years agoImplement LWG2400 - 'shared_ptr's get_deleter() should use addressof()', and add...
Marshall Clow [Mon, 17 Nov 2014 19:05:50 +0000 (19:05 +0000)]
Implement LWG2400 - 'shared_ptr's get_deleter() should use addressof()', and add tests. Mark LWG2400 and LWG2404 as complete

llvm-svn: 222161

9 years agoNot all things callable have an im_self, so harden the test logic against that. getat...
Enrico Granata [Mon, 17 Nov 2014 19:00:20 +0000 (19:00 +0000)]
Not all things callable have an im_self, so harden the test logic against that. getattr(,,None) is the closest to ?. we have in Python, so use that

llvm-svn: 222160

9 years agoReworked mismatch tests to count the number of comparisons, and make sure we are...
Marshall Clow [Mon, 17 Nov 2014 18:52:25 +0000 (18:52 +0000)]
Reworked mismatch tests to count the number of comparisons, and make sure we are conforming with LWG2404. We are

llvm-svn: 222159

9 years agoclang-format: Fix more incorrect pointer detection.
Daniel Jasper [Mon, 17 Nov 2014 18:42:22 +0000 (18:42 +0000)]
clang-format: Fix more incorrect pointer detection.

Before:
  Constructor() : a(a), b(c, d *e) {}

After:
  Constructor() : a(a), b(c, d * e) {}

llvm-svn: 222158

9 years agotest/Driver/cl-outputs.c: tweak some check prefixes; NFC.
Hans Wennborg [Mon, 17 Nov 2014 18:40:45 +0000 (18:40 +0000)]
test/Driver/cl-outputs.c: tweak some check prefixes; NFC.

These tests deal with the /o option; rename to better reflect that.

llvm-svn: 222157

9 years agoFixes for remote test suite execution of the "lldb/test/lang" directory.
Greg Clayton [Mon, 17 Nov 2014 18:40:27 +0000 (18:40 +0000)]
Fixes for remote test suite execution of the "lldb/test/lang" directory.

Fixes include:
- Add a new lldbtest.TestBase function named registerSharedLibrariesWithTarget. This function can be called using the shared libraries for your test suite either as shared library basename ("foo"), path basename ("libfoo.dylib") or full path ("/tmp/lldb/test/lang/c/carp/libfoo.dylib"). These shared libraries are then registered with the target so they will be downloaded when the test is run remotely.
- Changed a lot of tests over to use SBDebugger::CreateTarget(...) calls instead of using "file a.out" commands.
- Cleaned up some tests to add new locations for breakpoints that all compilers should be able to abide by. Some tests and constants being loaded into values of structs and some compilers like arm64 will often combine two constant data loads into a single source line so some breakpoint locations were not being set correctly. Adding lines like 'puts("")' allow us to lock onto a source line that will have code.

llvm-svn: 222156

9 years agoBasic: tweak comment
Saleem Abdulrasool [Mon, 17 Nov 2014 18:40:15 +0000 (18:40 +0000)]
Basic: tweak comment

Add a missing surrounding brace for doxygen group.  This messes with pair
jumping in vim and is annoying.  NFC.

llvm-svn: 222155

9 years agoFix buildSwigWrapperClasses.py after recent break.
Zachary Turner [Mon, 17 Nov 2014 18:38:22 +0000 (18:38 +0000)]
Fix buildSwigWrapperClasses.py after recent break.

A re-ordering of some enum values exposed a lingering bug where an
invalid key was indexing a dictionary.

llvm-svn: 222154

9 years agoFix some issue with running the test suite remotely on iOS.
Greg Clayton [Mon, 17 Nov 2014 18:32:17 +0000 (18:32 +0000)]
Fix some issue with running the test suite remotely on iOS.

- Added a new "--apple-sdk" flag that can be specified on Darwin only so the correct cross compilers can be auto-selected without having to specify the "--compiler" flag.
- Set SDKROOT if needed

llvm-svn: 222153

9 years agoFix the indentation: Nesting level does not match indentation (CID 1254863)
Sylvestre Ledru [Mon, 17 Nov 2014 18:26:39 +0000 (18:26 +0000)]
Fix the indentation: Nesting level does not match indentation (CID 1254863)

llvm-svn: 222152

9 years agoFixing a use of stringstream to use an LLVM helper function. Drive-by fixing header...
Aaron Ballman [Mon, 17 Nov 2014 18:17:19 +0000 (18:17 +0000)]
Fixing a use of stringstream to use an LLVM helper function. Drive-by fixing header include order. NFC.

llvm-svn: 222151

9 years agoReformat lldb-mi using clang-format.
Zachary Turner [Mon, 17 Nov 2014 18:06:21 +0000 (18:06 +0000)]
Reformat lldb-mi using clang-format.

Courtesy of dawn@burble.org.

llvm-svn: 222150

9 years agoFix GraphTraits for "const CallGraphNode *" and "const CallGraph *"
Rafael Espindola [Mon, 17 Nov 2014 17:51:45 +0000 (17:51 +0000)]
Fix GraphTraits for "const CallGraphNode *" and "const CallGraph *"

The specializations were broken. For example,

void foo(const CallGraph *G) {
  auto I = GraphTraits<const CallGraph *>::nodes_begin(G);
  auto K = I++;

  ...
}

or

void bar(const CallGraphNode *N) {
  auto I = GraphTraits<const CallGraphNode *>::nodes_begin(G);
  auto K = I++;

  ....
}

would not compile.

Patch by Speziale Ettore!

llvm-svn: 222149

9 years ago[ProcessWindows] Create a TargetThreadWindows class.
Zachary Turner [Mon, 17 Nov 2014 17:46:43 +0000 (17:46 +0000)]
[ProcessWindows] Create a TargetThreadWindows class.

This creates a TargetThreadWindows class and updates the thread
list of the Process with the main thread.  Additionally, we
fill out a few more overrides of Process base class methods.  We
do not yet update the thread list as threads are created and/or
destroyed, and we do not yet propagate stop reasons to threads as
their states change.

llvm-svn: 222148

9 years ago[ProcessWindows] Implement read / write process memory.
Zachary Turner [Mon, 17 Nov 2014 17:46:27 +0000 (17:46 +0000)]
[ProcessWindows] Implement read / write process memory.

llvm-svn: 222147

9 years agoAvoid undefined behavior by masking the shift amount.
Rafael Espindola [Mon, 17 Nov 2014 17:43:27 +0000 (17:43 +0000)]
Avoid undefined behavior by masking the shift amount.

Should hopefully fix the mips bots.

llvm-svn: 222146

9 years ago[clang-tidy] Move the missing namespace comment warnings to the closing brace
Alexander Kornienko [Mon, 17 Nov 2014 17:32:32 +0000 (17:32 +0000)]
[clang-tidy] Move the missing namespace comment warnings to the closing brace

Summary:
The google-readability-namespace-comments/llvm-namespace-comment
warnings are quite confusing when they appear at the beginning of a long
namespace and the closing brace is not in sight.

For convenience added notes pointing to the start of the namespace.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 222145

9 years ago[Reassociate] Update test cases due to r222142.
Chad Rosier [Mon, 17 Nov 2014 16:34:47 +0000 (16:34 +0000)]
[Reassociate] Update test cases due to r222142.

llvm-svn: 222144

9 years agoFix a warning in the test; no functionality change
Marshall Clow [Mon, 17 Nov 2014 16:34:44 +0000 (16:34 +0000)]
Fix a warning in the test; no functionality change

llvm-svn: 222143

9 years ago[Reassociate] As the expression tree is rewritten make sure the operands are
Chad Rosier [Mon, 17 Nov 2014 16:33:50 +0000 (16:33 +0000)]
[Reassociate] As the expression tree is rewritten make sure the operands are
emitted in canonical form.

llvm-svn: 222142

9 years ago[X86] Use ADD/SUB instead of INC/DEC for Haswell and Broadwell CPUs
Alexey Volkov [Mon, 17 Nov 2014 16:17:51 +0000 (16:17 +0000)]
[X86] Use ADD/SUB instead of INC/DEC for Haswell and Broadwell CPUs

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

llvm-svn: 222141

9 years agoMinor readability tweaks to VFTableBuilder.cpp
Timur Iskhodzhanov [Mon, 17 Nov 2014 15:53:50 +0000 (15:53 +0000)]
Minor readability tweaks to VFTableBuilder.cpp

llvm-svn: 222140

9 years ago[Reassociate] Canonicalize constants to RHS operand.
Chad Rosier [Mon, 17 Nov 2014 15:52:51 +0000 (15:52 +0000)]
[Reassociate] Canonicalize constants to RHS operand.

Fix a thinko where the RHS was already a constant.

llvm-svn: 222139

9 years agoImplement void_t from N3911. Add a private version for use in the library before...
Marshall Clow [Mon, 17 Nov 2014 15:50:08 +0000 (15:50 +0000)]
Implement void_t from N3911. Add a private version for use in the library before C++1z. Update the 1z status page, marking a bunch of issues that don't require library changes as complete (2129, 2212, 2230, 2233, 2325, 2365, 2376)

llvm-svn: 222138

9 years agoUse a more canonical way of computing a mask with N trailing 1s. NFC.
Rafael Espindola [Mon, 17 Nov 2014 15:46:21 +0000 (15:46 +0000)]
Use a more canonical way of computing a mask with N trailing 1s. NFC.

llvm-svn: 222137

9 years agoFix Darwin and FreeBSD OS type detection
Ed Maste [Mon, 17 Nov 2014 15:40:18 +0000 (15:40 +0000)]
Fix Darwin and FreeBSD OS type detection

Obtained in part from http://reviews.llvm.org/D6290

llvm-svn: 222136