platform/upstream/llvm.git
11 years agoAllow users to specify NULL like macros to be replaced
Tareq A. Siraj [Thu, 28 Mar 2013 16:06:59 +0000 (16:06 +0000)]
Allow users to specify NULL like macros to be replaced

-use-nullptr only replaced macro named NULL and ignored any user defined
macros that behaved like NULL. This patch introduces -user-null-macros
command line option to let users specify their custom NULL like macros.

- Added a -user-null-macros command line option that takes a
  comma-separated list of user-defined macros to be replaced when using
  the -use-nullptr transform.
- Added documentation.
- Updated testcase to reflect current behavior.
- Whitespace fixes.

Reviewers: revane, klimek, gribozavr
llvm-svn: 178243

11 years agoFix the Linux build issues introduced by r178191.
Ashok Thirumurthi [Thu, 28 Mar 2013 16:02:31 +0000 (16:02 +0000)]
Fix the Linux build issues introduced by r178191.

- All Linux logging channels now use a single global instance of lldb_private::Log, to handle the case of logging during process tear down.
- Also removed a single use of LogSP in FreeBSD and fixed a typo in a comment while reading through ProcessKDPLog.

Reviewed by Daniel Malea.

llvm-svn: 178242

11 years agoTest commit: Remove whitespace.
Tareq A. Siraj [Thu, 28 Mar 2013 15:48:49 +0000 (15:48 +0000)]
Test commit: Remove whitespace.

llvm-svn: 178241

11 years agoSeciton 24.2.2 of the C++ standard, [iterator.iterators], Table 106
Howard Hinnant [Thu, 28 Mar 2013 15:47:50 +0000 (15:47 +0000)]
Seciton 24.2.2 of the C++ standard, [iterator.iterators], Table 106
requires that the return type of *r for all iterators r be reference,
where reference is defined in [iterator.requirements.general]/p11 as
iterator_traits<X>::reference, and X is the type of r.

But in CFG.h, the dereference operator of PredIterator and SuccIterator
return pointer, not reference.

Furthermore the nested type reference is value_type&, which is not the
type returned from operator*().

This patch simply makes the iterator::reference type value_type*, which
is what the operator*() returns, and then re-lables the return type as
reference.

From a functionality point of view, the only difference is that the
nested reference type is now value_type* instead of value_type&.

llvm-svn: 178240

11 years ago[ASan] Speed-up initialization-order checking: create and use fast versions of Poison...
Alexey Samsonov [Thu, 28 Mar 2013 15:42:43 +0000 (15:42 +0000)]
[ASan] Speed-up initialization-order checking: create and use fast versions of PoisonShadow functions, store copies of __asan_global descriptors in a vector instead of list of pointers. This gives 3x speedup on both benchmarks and real binaries with lots of globals.

llvm-svn: 178239

11 years ago[Sanitizer] Minor enhancements in InternalVector container
Alexey Samsonov [Thu, 28 Mar 2013 15:37:11 +0000 (15:37 +0000)]
[Sanitizer] Minor enhancements in InternalVector container

llvm-svn: 178238

11 years agoAdd missing #ifndef _LIBCPP_NO_EXCEPTIONS around throw in include/thread.
Howard Hinnant [Thu, 28 Mar 2013 15:00:04 +0000 (15:00 +0000)]
Add missing #ifndef _LIBCPP_NO_EXCEPTIONS around throw in include/thread.

llvm-svn: 178237

11 years agoAArch64: implement GICv3 system registers
Tim Northover [Thu, 28 Mar 2013 14:30:46 +0000 (14:30 +0000)]
AArch64: implement GICv3 system registers

llvm-svn: 178236

11 years agoAdd support for gcc-compatible -mpopcntd -mno-popcntd PPC options
Hal Finkel [Thu, 28 Mar 2013 13:51:36 +0000 (13:51 +0000)]
Add support for gcc-compatible -mpopcntd -mno-popcntd PPC options

gcc provides -mpopcntd and -mno-popcntd for controlling the popcntd target
feature; support these options as well.

llvm-svn: 178235

11 years agoUpdating LibASTMatchersReference
Edwin Vane [Thu, 28 Mar 2013 13:50:22 +0000 (13:50 +0000)]
Updating LibASTMatchersReference

The generator for LibASTMatchersReference.html didn't get run last time
ASTMatchers changes were made. Here are up-to-date docs.

llvm-svn: 178234

11 years agoAdd the PPC64 popcntd instruction
Hal Finkel [Thu, 28 Mar 2013 13:29:47 +0000 (13:29 +0000)]
Add the PPC64 popcntd instruction

PPC ISA 2.06 (P7, A2, etc.) has a popcntd instruction. Add this instruction and
tell TTI about it so that popcount-loop recognition will know about it.

llvm-svn: 178233

11 years ago[Mips] Handle pseudo-target flags '-EL' and '-EB' and properly adjust
Simon Atanasyan [Thu, 28 Mar 2013 11:36:22 +0000 (11:36 +0000)]
[Mips] Handle pseudo-target flags '-EL' and '-EB' and properly adjust
toolchain flags for MIPS targets.

llvm-svn: 178232

11 years ago[tsan] a test checking that memset/memcpy/memmove are not inlined in tsan mode
Kostya Serebryany [Thu, 28 Mar 2013 11:21:50 +0000 (11:21 +0000)]
[tsan] a test checking that memset/memcpy/memmove are not inlined in tsan mode

llvm-svn: 178231

11 years ago[tsan] make sure memset/memcpy/memmove are not inlined in tsan mode
Kostya Serebryany [Thu, 28 Mar 2013 11:21:13 +0000 (11:21 +0000)]
[tsan] make sure memset/memcpy/memmove are not inlined in tsan mode

llvm-svn: 178230

11 years agoFix unmatching ASan runtime flag for init-order checking exposed by r178158. Add...
Alexey Samsonov [Thu, 28 Mar 2013 09:11:20 +0000 (09:11 +0000)]
Fix unmatching ASan runtime flag for init-order checking exposed by r178158. Add a test for r178158.

llvm-svn: 178229

11 years ago[tsan] don't use -fno-builtin for tests; add a test for a false negative bug (inlined...
Kostya Serebryany [Thu, 28 Mar 2013 08:41:49 +0000 (08:41 +0000)]
[tsan] don't use -fno-builtin for tests; add a test for a false negative bug (inlined memcpy is not instrumented)

llvm-svn: 178228

11 years agoAdd support for gcc-compatible -mmfcrf -mno-mfcrf PPC options
Hal Finkel [Thu, 28 Mar 2013 08:38:53 +0000 (08:38 +0000)]
Add support for gcc-compatible -mmfcrf -mno-mfcrf PPC options

gcc provides -mmfcrf and -mno-mfcrf for controlling what we call
the mfocrf target feature. Also, PPC is now making use of the
static function AddTargetFeature used by the Mips Driver code.

llvm-svn: 178227

11 years agoDefine __SIZE_MAX__ preprocessor macro.
Evgeniy Stepanov [Thu, 28 Mar 2013 08:36:54 +0000 (08:36 +0000)]
Define __SIZE_MAX__ preprocessor macro.

llvm-svn: 178226

11 years agoRevert "modularize - Fixed poor array usage."
Michael Gottesman [Thu, 28 Mar 2013 06:07:15 +0000 (06:07 +0000)]
Revert "modularize - Fixed poor array usage."

This has broken buildbots for a few hours.

llvm-svn: 178223

11 years agoRevert "Updated ELF relocation test for .eh_frame section"
Michael Gottesman [Thu, 28 Mar 2013 05:14:26 +0000 (05:14 +0000)]
Revert "Updated ELF relocation test for .eh_frame section"

This reverts commit c8d65364223a04b179958a50a4bf0f89b21dd7d2.

This broke a bunch of the buildbots.

llvm-svn: 178222

11 years agoDisable JIT/MCJIT tests in unittests/ExecutionEngine for the targets that don't suppo...
Jyotsna Verma [Thu, 28 Mar 2013 03:38:29 +0000 (03:38 +0000)]
Disable JIT/MCJIT tests in unittests/ExecutionEngine for the targets that don't support JIT.

llvm-svn: 178221

11 years agoCleanup PPC CR-spill kill flags and 32- vs. 64-bit instructions
Hal Finkel [Thu, 28 Mar 2013 03:38:16 +0000 (03:38 +0000)]
Cleanup PPC CR-spill kill flags and 32- vs. 64-bit instructions

There were a few places where kill flags were not being set correctly, and
where 32-bit instruction variants were being used with 64-bit registers. After
r178180, this code was being triggered causing llc to assert.

llvm-svn: 178220

11 years agoFix typo in PPCInstr64Bit
Hal Finkel [Thu, 28 Mar 2013 03:38:08 +0000 (03:38 +0000)]
Fix typo in PPCInstr64Bit

llvm-svn: 178219

11 years agoFor -Wignored-qualifiers, don't warn on qualifiers which we acquire via a
Richard Smith [Thu, 28 Mar 2013 03:27:52 +0000 (03:27 +0000)]
For -Wignored-qualifiers, don't warn on qualifiers which we acquire via a
typedef. Also don't warn on the _Atomic type specifier, just on the _Atomic
type qualifier.

llvm-svn: 178218

11 years agoTeach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic type...
Richard Smith [Thu, 28 Mar 2013 02:51:21 +0000 (02:51 +0000)]
Teach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic type qualifier.

llvm-svn: 178217

11 years agomodularize - Updated futures comment.
John Thompson [Thu, 28 Mar 2013 02:46:25 +0000 (02:46 +0000)]
modularize - Updated futures comment.

llvm-svn: 178216

11 years agoRevert "Adding DIImportedModules to DIScopes."
David Blaikie [Thu, 28 Mar 2013 02:44:59 +0000 (02:44 +0000)]
Revert "Adding DIImportedModules to DIScopes."

This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7.

Turns out we're going with a different schema design to represent
DW_TAG_imported_modules so we won't need this extra field.

llvm-svn: 178215

11 years agomodularize - Fixed poor array usage.
John Thompson [Thu, 28 Mar 2013 02:44:31 +0000 (02:44 +0000)]
modularize - Fixed poor array usage.

llvm-svn: 178214

11 years agoRevert "Update debug info test for schema change made to LLVM."
David Blaikie [Thu, 28 Mar 2013 02:44:15 +0000 (02:44 +0000)]
Revert "Update debug info test for schema change made to LLVM."

This reverts commit 5035c483b7fcbf0fa2a7afba24fa35a10995d195.

This schema change wasn't necessary after all. I'm going ith a different
solution that will hopefully use space more conservatively.

llvm-svn: 178213

11 years agoFix a default on covered switch found by -Wcovered-switch-default
David Blaikie [Thu, 28 Mar 2013 02:30:37 +0000 (02:30 +0000)]
Fix a default on covered switch found by -Wcovered-switch-default

Introduced in r178207

llvm-svn: 178212

11 years agoRemove outdated FIXME.
Richard Smith [Thu, 28 Mar 2013 01:56:34 +0000 (01:56 +0000)]
Remove outdated FIXME.

llvm-svn: 178211

11 years agoSupport C11 _Atomic type qualifier. This is more-or-less just syntactic sugar for...
Richard Smith [Thu, 28 Mar 2013 01:55:44 +0000 (01:55 +0000)]
Support C11 _Atomic type qualifier. This is more-or-less just syntactic sugar for the _Atomic type specifier.

llvm-svn: 178210

11 years agoDebugserver fix for launching iOS apps who are named "com.apple.something"
Jason Molenda [Thu, 28 Mar 2013 01:48:21 +0000 (01:48 +0000)]
Debugserver fix for launching iOS apps who are named "com.apple.something"
- the ".app" would be treated as the app bundle final characters
and the SpringBoard launch would fail.
<rdar://problem/13258935>

llvm-svn: 178209

11 years agoCheck if Type is a vector before calling function Type::getVectorNumElements.
Akira Hatanaka [Thu, 28 Mar 2013 01:28:02 +0000 (01:28 +0000)]
Check if Type is a vector before calling function Type::getVectorNumElements.

llvm-svn: 178208

11 years agomodularize - revised to group duplicate symbols together in the error output.
John Thompson [Thu, 28 Mar 2013 01:20:19 +0000 (01:20 +0000)]
modularize - revised to group duplicate symbols together in the error output.

llvm-svn: 178207

11 years ago<rdar://problem/13412986>
Enrico Granata [Thu, 28 Mar 2013 00:27:30 +0000 (00:27 +0000)]
<rdar://problem/13412986>

Holding the Python lock while we call the Python C API to post-process objects returned from the OS plugins
This should avoid issues where some Python objects get invalidated while we are in the middle of processing them and we end up with an invalid Python state and a crash

llvm-svn: 178206

11 years agoProtect against the case where the current inlined depth is wrong, and leads us to...
Jim Ingham [Thu, 28 Mar 2013 00:13:30 +0000 (00:13 +0000)]
Protect against the case where the current inlined depth is wrong, and leads us to think we can't even get the
frame at index 0.  We should ALWAYS be able to get that.

<rdar://problem/13497571>

llvm-svn: 178205

11 years agoUse the error from ValidatePlan.
Jim Ingham [Thu, 28 Mar 2013 00:08:00 +0000 (00:08 +0000)]
Use the error from ValidatePlan.

llvm-svn: 178204

11 years agoThe other half of the checkin to produce better error messages when the ThreadPlanCal...
Jim Ingham [Thu, 28 Mar 2013 00:07:20 +0000 (00:07 +0000)]
The other half of the checkin to produce better error messages when the ThreadPlanCallFunction isn't valid.

llvm-svn: 178203

11 years agoRunThreadPlan should make sure the plan passed in is valid before running it.
Jim Ingham [Thu, 28 Mar 2013 00:05:34 +0000 (00:05 +0000)]
RunThreadPlan should make sure the plan passed in is valid before running it.

<rdar://problem/13485541>

llvm-svn: 178202

11 years agoReturn a useful error message from ValidatePlan if the expression can't be made for...
Jim Ingham [Thu, 28 Mar 2013 00:04:05 +0000 (00:04 +0000)]
Return a useful error message from ValidatePlan if the expression can't be made for some reason.

llvm-svn: 178201

11 years agoFold together the two implementations of 6.7.3p2 in SemaType. Fix two bugs, each...
Richard Smith [Thu, 28 Mar 2013 00:03:10 +0000 (00:03 +0000)]
Fold together the two implementations of 6.7.3p2 in SemaType. Fix two bugs, each of which was only present in one version:
 * Give the right diagnostic for 'restrict' applied to a non-pointer, non-reference type.
 * Don't reject 'restrict' applied indirectly to an Objective-C object pointer type (eg, through template instantiation).

llvm-svn: 178200

11 years ago[Parser] Don't code-complete twice.
Argyrios Kyrtzidis [Wed, 27 Mar 2013 23:58:17 +0000 (23:58 +0000)]
[Parser] Don't code-complete twice.

When we are consuming the current token just to enter a new token stream, we push
the current token in the back of the stream so that we get it again.

Unfortunately this had the effect where if the current token is a code-completion one,
we would code-complete once during consuming it and another time after the stream ended.

Fix this by making sure that, in this case, ConsumeAnyToken() will consume a code-completion
token without invoking code-completion.

rdar://12842503

llvm-svn: 178199

11 years agoDon't reject __restrict applied to a dependent type; it might instantiate to a pointe...
Richard Smith [Wed, 27 Mar 2013 23:36:39 +0000 (23:36 +0000)]
Don't reject __restrict applied to a dependent type; it might instantiate to a pointer or reference type.

llvm-svn: 178198

11 years agoSimplify test to use a count for the number of notes expected.
Bill Wendling [Wed, 27 Mar 2013 23:26:09 +0000 (23:26 +0000)]
Simplify test to use a count for the number of notes expected.

llvm-svn: 178196

11 years agocompiler-rt part of r178194. Remove ubsan test for diagnostic on inf/nan conversion...
Richard Smith [Wed, 27 Mar 2013 23:21:10 +0000 (23:21 +0000)]
compiler-rt part of r178194. Remove ubsan test for diagnostic on inf/nan conversion between floating-point types.

llvm-svn: 178195

11 years agoUBSan: Don't diagnose inf/nan conversions between floating-point types. It's far...
Richard Smith [Wed, 27 Mar 2013 23:20:25 +0000 (23:20 +0000)]
UBSan: Don't diagnose inf/nan conversions between floating-point types. It's far from clear whether these have undefined behavior, and these checks are helping no-one. Keep the double->float overflow warnings, though, since those are useful in practice, even though it's unclear whether such operations have defined behavior.

llvm-svn: 178194

11 years agoThis patch follows is a follow up to r178171, which uses the register
Preston Gurd [Wed, 27 Mar 2013 23:16:18 +0000 (23:16 +0000)]
This patch follows is a follow up to r178171, which uses the register
form of call in preference to memory indirect on Atom.

In this case, the patch applies the optimization to the code for reloading
spilled registers.

The patch also includes changes to sibcall.ll and movgs.ll, which were
failing on the Atom buildbot after the first patch was applied.

This patch by Sriram Murali.

llvm-svn: 178193

11 years agoThis test case was not doing the right thing with libc++ being used and was generatin...
Enrico Granata [Wed, 27 Mar 2013 23:08:54 +0000 (23:08 +0000)]
This test case was not doing the right thing with libc++ being used and was generating spurious over-completion warning flags

llvm-svn: 178192

11 years ago<rdar://problem/13521159>
Greg Clayton [Wed, 27 Mar 2013 23:08:40 +0000 (23:08 +0000)]
<rdar://problem/13521159>

LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.

llvm-svn: 178191

11 years agoUpdated ELF relocation test for .eh_frame section
Jack Carter [Wed, 27 Mar 2013 22:58:49 +0000 (22:58 +0000)]
Updated ELF relocation test for .eh_frame section

Made sure we were looking a correct section
Added Mips32/64 as an extra check
Updated llvm-objdump to generate symbolic info for Mips relocations

llvm-svn: 178190

11 years agoImplementing the notion of externally-acquirable ScriptInterpreter lock
Enrico Granata [Wed, 27 Mar 2013 22:38:11 +0000 (22:38 +0000)]
Implementing the notion of externally-acquirable ScriptInterpreter lock
With this notion, if parties outside the ScriptInterpreter itself need to acquire a lock on script APIs, they can do so by a pattern like this:

{
auto lock = interpeter->AcquireInterpreterLock();
// do whatever you need to do...
} // lock will automatically be released here

This might be useful for classes that use the Python convenience objects (e.g. PythonDictionary) to ensure they keep the underlying interpreter in a safe and controlled condition while they call through the C API functions
Of course, the ScriptInterpreter still manages its internal locking correctly when necessary :-)

llvm-svn: 178189

11 years agoRemove unnecessary attributes from test case.
Chad Rosier [Wed, 27 Mar 2013 21:54:09 +0000 (21:54 +0000)]
Remove unnecessary attributes from test case.

llvm-svn: 178188

11 years agoAdd a front-end test case for r178186.
Chad Rosier [Wed, 27 Mar 2013 21:50:39 +0000 (21:50 +0000)]
Add a front-end test case for r178186.

llvm-svn: 178187

11 years ago[ms-inline asm] Add support of imm displacement before bracketed memory
Chad Rosier [Wed, 27 Mar 2013 21:49:56 +0000 (21:49 +0000)]
[ms-inline asm] Add support of imm displacement before bracketed memory
expression.  Specifically, this syntax:

 ImmDisp [ BaseReg + Scale*IndexReg + Disp ]

We don't currently support:

 ImmDisp [ Symbol ]

rdar://13518671

llvm-svn: 178186

11 years agoFixes a typo in my last patch.
Fariborz Jahanian [Wed, 27 Mar 2013 21:33:52 +0000 (21:33 +0000)]
Fixes a typo in my last patch.

llvm-svn: 178184

11 years agoBroke out header file list reading into separate function. Moved options to front...
John Thompson [Wed, 27 Mar 2013 21:23:21 +0000 (21:23 +0000)]
Broke out header file list reading into separate function. Moved options to front.  Removed some trailing spaces.

llvm-svn: 178182

11 years agoRevert "[lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__."
Argyrios Kyrtzidis [Wed, 27 Mar 2013 21:22:45 +0000 (21:22 +0000)]
Revert "[lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__."

Per feedback by Doug, we should avoid platform-specific implementations
in lib/Headers as much as possible.

This reverts commit r178110.

llvm-svn: 178181

11 years agoResynchronize isLoadFromStackSlot with LoadRegFromStackSlot (and stores) in PPCInstrInfo
Hal Finkel [Wed, 27 Mar 2013 21:21:15 +0000 (21:21 +0000)]
Resynchronize isLoadFromStackSlot with LoadRegFromStackSlot (and stores) in PPCInstrInfo

These functions should have the same list of load/store instructions. Now that
all load/store forms have been normalized (to single instructions or pseudos)
they can be resynchronized.

Found by inspection, although hopefully this will improve optimization.  I've
also added some comments.

llvm-svn: 178180

11 years agoObjective-C: Issue more precise warning when user
Fariborz Jahanian [Wed, 27 Mar 2013 21:19:25 +0000 (21:19 +0000)]
Objective-C: Issue more precise warning when user
is accessing 'isa' as an object pointer.
// rdar://13503456. FixIt to follow in another patch.

llvm-svn: 178179

11 years agotest commit
Ashok Thirumurthi [Wed, 27 Mar 2013 21:09:30 +0000 (21:09 +0000)]
test commit
- modified a comment

llvm-svn: 178178

11 years ago<rdar://problem/13327940>
Greg Clayton [Wed, 27 Mar 2013 20:53:12 +0000 (20:53 +0000)]
<rdar://problem/13327940>

Cleaned up some paths.

llvm-svn: 178177

11 years agoAdded a source file needed for clang to compile in the lldb_perf_clang test.
Greg Clayton [Wed, 27 Mar 2013 20:13:09 +0000 (20:13 +0000)]
Added a source file needed for clang to compile in the lldb_perf_clang test.

llvm-svn: 178176

11 years ago<rdar://problem/13327940>
Greg Clayton [Wed, 27 Mar 2013 20:12:14 +0000 (20:12 +0000)]
<rdar://problem/13327940>

Enhance automated testing to include evaluating function calls.

llvm-svn: 178175

11 years agotest file name change to correct typo
Jack Carter [Wed, 27 Mar 2013 20:07:48 +0000 (20:07 +0000)]
test file name change to correct typo

llvm-svn: 178174

11 years agoCleanup clang's specializations of simplify_type.
Rafael Espindola [Wed, 27 Mar 2013 19:38:14 +0000 (19:38 +0000)]
Cleanup clang's specializations of simplify_type.

Now that the basic implementation in llvm has been fixed, simplify the
specializations in clang.

llvm-svn: 178173

11 years agoAdded informational comment about using -x c++.
John Thompson [Wed, 27 Mar 2013 19:31:22 +0000 (19:31 +0000)]
Added informational comment about using -x c++.

llvm-svn: 178172

11 years agoFor the current Atom processor, the fastest way to handle a call
Preston Gurd [Wed, 27 Mar 2013 19:14:02 +0000 (19:14 +0000)]
For the current Atom processor, the fastest way to handle a call
indirect through a memory address is to load the memory address into
a register and then call indirect through the register.

This patch implements this improvement by modifying SelectionDAG to
force a function address which is a memory reference to be loaded
into a virtual register.

Patch by Sriram Murali.

llvm-svn: 178171

11 years agoFix typo (common to both X86 and PPC)
Hal Finkel [Wed, 27 Mar 2013 19:10:42 +0000 (19:10 +0000)]
Fix typo (common to both X86 and PPC)

Thanks to Bill Schmidt for pointing this out during code review!

llvm-svn: 178170

11 years agoRemove more dead LR-as-GPR PPC code
Hal Finkel [Wed, 27 Mar 2013 19:10:40 +0000 (19:10 +0000)]
Remove more dead LR-as-GPR PPC code

I had removed similar code a few days ago, but somehow missed this.

llvm-svn: 178169

11 years agocpp11-migrate segfaults transforming map<string,int>::iterator
Ariel J. Bernal [Wed, 27 Mar 2013 18:49:31 +0000 (18:49 +0000)]
cpp11-migrate segfaults transforming map<string,int>::iterator

cpp11-migrate segfaults when -use-auto tries to resolve initializing
expression resulting in an expression with cleanups.

- Skip expressions with cleanups from the initializer
- Added test case

Fixes PR15550

llvm-svn: 178167

11 years agoAvoid undefined behavior from passing a std::vector's own contents
Dan Gohman [Wed, 27 Mar 2013 18:44:56 +0000 (18:44 +0000)]
Avoid undefined behavior from passing a std::vector's own contents
in as an argument to push_back.

llvm-svn: 178166

11 years agoRemove "gpr0 allocation" from the PPC README TODO list
Hal Finkel [Wed, 27 Mar 2013 18:39:52 +0000 (18:39 +0000)]
Remove "gpr0 allocation" from the PPC README TODO list

As Chris pointed out, post r178123, this is now done!

llvm-svn: 178165

11 years agoFixed path in file comment. Fixed #include order.
John Thompson [Wed, 27 Mar 2013 18:34:38 +0000 (18:34 +0000)]
Fixed path in file comment.  Fixed #include order.

llvm-svn: 178164

11 years agoDon't try to generate crash diagnostics if we had an I/O failure. It's very
Chad Rosier [Wed, 27 Mar 2013 18:30:00 +0000 (18:30 +0000)]
Don't try to generate crash diagnostics if we had an I/O failure.  It's very
likely the crash diagnostics generation will fail as well.
Part of rdar://13296693

llvm-svn: 178163

11 years agoUpdate the error handing static functions for r178161.
Chad Rosier [Wed, 27 Mar 2013 18:28:23 +0000 (18:28 +0000)]
Update the error handing static functions for r178161.
Part of rdar://13296693

llvm-svn: 178162

11 years agoAdd a boolean parameter to the llvm::report_fatal_error() function to indicated
Chad Rosier [Wed, 27 Mar 2013 18:27:54 +0000 (18:27 +0000)]
Add a boolean parameter to the llvm::report_fatal_error() function to indicated
if crash diagnostics should be generated.  By default this is enabled.
Part of rdar://13296693

llvm-svn: 178161

11 years ago[analyzer] Use evalBind for C++ new of scalar types.
Jordan Rose [Wed, 27 Mar 2013 18:10:35 +0000 (18:10 +0000)]
[analyzer] Use evalBind for C++ new of scalar types.

These types will not have a CXXConstructExpr to do the initialization for
them. Previously we just used a simple call to ProgramState::bindLoc, but
that doesn't trigger proper checker callbacks (like pointer escape).

Found by Anton Yartsev.

llvm-svn: 178160

11 years agotsan: print matched suppressions if print_suppressions=1 flag is provided
Dmitry Vyukov [Wed, 27 Mar 2013 17:59:57 +0000 (17:59 +0000)]
tsan: print matched suppressions if print_suppressions=1 flag is provided

llvm-svn: 178159

11 years agotsan: better flag parsing: do not confuse flag that is a part of another flag
Dmitry Vyukov [Wed, 27 Mar 2013 17:59:13 +0000 (17:59 +0000)]
tsan: better flag parsing: do not confuse flag that is a part of another flag
(e.g. suppressions and print_suppressions)

llvm-svn: 178158

11 years agotsan: fix lint warning
Dmitry Vyukov [Wed, 27 Mar 2013 17:57:58 +0000 (17:57 +0000)]
tsan: fix lint warning

llvm-svn: 178157

11 years agoSpecutively revert r178130.
Bill Wendling [Wed, 27 Mar 2013 17:54:41 +0000 (17:54 +0000)]
Specutively revert r178130.

This may be causing a failure on some buildbots:

Referencing function in another module!
  tail call fastcc void @_ZL11EvaluateOpstPtRj(i16 zeroext %17, i16* %Vals, i32* %NumVals), !dbg !219
Referencing function in another module!
  tail call fastcc void @_ZL11EvaluateOpstPtRj(i16 zeroext %19, i16* %Vals, i32* %NumVals), !dbg !221
Broken module found, compilation aborted!
Stack dump:
0.    Running pass 'Function Pass Manager' on module 'ld-temp.o'.
1.    Running pass 'Module Verifier' on function '@_ZL11EvaluateOpstPtRj'
clang: error: unable to execute command: Illegal instruction: 4
clang: error: linker command failed due to signal (use -v to see invocation)

<rdar://problem/13516485>

llvm-svn: 178156

11 years agoFix comment
David Blaikie [Wed, 27 Mar 2013 17:50:12 +0000 (17:50 +0000)]
Fix comment

llvm-svn: 178155

11 years agoFix a typo in help string.
Jim Ingham [Wed, 27 Mar 2013 17:36:54 +0000 (17:36 +0000)]
Fix a typo in help string.

llvm-svn: 178154

11 years ago[analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
Anna Zaks [Wed, 27 Mar 2013 17:36:01 +0000 (17:36 +0000)]
[analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment

llvm-svn: 178153

11 years ago[analyzer] Ensure that the node NilReceiverBRVisitor is looking for is not reclaimed
Anna Zaks [Wed, 27 Mar 2013 17:35:58 +0000 (17:35 +0000)]
[analyzer] Ensure that the node NilReceiverBRVisitor is looking for is not reclaimed

The visitor should look for the PreStmt node as the receiver is nil in the PreStmt and this is the node. Also, tag the nil
receiver nodes with a special tag for consistency.

llvm-svn: 178152

11 years ago[modules] Make sure enabled diagnostic pragmas inside the module don't affect the...
Argyrios Kyrtzidis [Wed, 27 Mar 2013 17:17:23 +0000 (17:17 +0000)]
[modules] Make sure enabled diagnostic pragmas inside the module don't affect the translation unit that
imports the module.

Getting diagnostic sections from modules properly working is a fixme.

rdar://13516663

llvm-svn: 178151

11 years agoInsert extra new line before access specifiers.
Alexander Kornienko [Wed, 27 Mar 2013 17:08:02 +0000 (17:08 +0000)]
Insert extra new line before access specifiers.

Summary: Insert extra new line before access specifiers.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D581

llvm-svn: 178149

11 years ago<rdar://problem/13509689> Introduce -module-file-info option that provides informatio...
Douglas Gregor [Wed, 27 Mar 2013 16:47:18 +0000 (16:47 +0000)]
<rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file.

This option can be useful for end users who want to know why they
ended up with a ton of different variants of the "std" module in their
module cache. This problem should go away over time, as we reduce the
need for module variants, but it will never go away entirely.

llvm-svn: 178148

11 years agoCleanup the simplify_type implementation.
Rafael Espindola [Wed, 27 Mar 2013 16:43:11 +0000 (16:43 +0000)]
Cleanup the simplify_type implementation.

As far as simplify_type is concerned, there are 3 kinds of smart pointers:

* const correct: A 'const MyPtr<int> &' produces a 'const int*'. A
'MyPtr<int> &' produces a 'int *'.
* always const: Even a 'MyPtr<int> &' produces a 'const int*'.
* no const: Even a 'const MyPtr<int> &' produces a 'int*'.

This patch then does the following:

* Removes the unused specializations. Since they are unused, it is hard
to know which kind should be implemented.
* Make sure we don't drop const.
* Fix the default forwarding so that const correct pointer only need
one specialization.
* Simplifies the existing specializations.

llvm-svn: 178147

11 years agoAdd const in preparation for a simplify_type change in llvm.
Rafael Espindola [Wed, 27 Mar 2013 15:37:54 +0000 (15:37 +0000)]
Add const in preparation for a simplify_type change in llvm.

llvm-svn: 178146

11 years agoR600/SI: add SETO/SETUO patterns
Christian Konig [Wed, 27 Mar 2013 15:27:31 +0000 (15:27 +0000)]
R600/SI: add SETO/SETUO patterns

6 more piglit tests.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 178145

11 years agoSilence warning about mixing || in &&, fix up 80-cols.
Benjamin Kramer [Wed, 27 Mar 2013 15:03:14 +0000 (15:03 +0000)]
Silence warning about mixing || in &&, fix up 80-cols.

llvm-svn: 178144

11 years agoAdd another expected note. Two errors => two notes.
Tim Northover [Wed, 27 Mar 2013 13:50:57 +0000 (13:50 +0000)]
Add another expected note. Two errors => two notes.

llvm-svn: 178143

11 years agoPrint PPC ZERO as 0 (not r0) even on Darwin
Hal Finkel [Wed, 27 Mar 2013 13:20:52 +0000 (13:20 +0000)]
Print PPC ZERO as 0 (not r0) even on Darwin

It seems that the Darwin PPC assembler requires r0 to be written as 0 when it
means 0 (at least in lwarx/stwcx.). Fixes PR15605.

llvm-svn: 178142

11 years agoSwitch to LLVM support function abs64 to keep VS2008 happy.
Tim Northover [Wed, 27 Mar 2013 13:15:08 +0000 (13:15 +0000)]
Switch to LLVM support function abs64 to keep VS2008 happy.

llvm-svn: 178141

11 years agoDisable ASan/MSan symbolization of reports in tests.
Evgeniy Stepanov [Wed, 27 Mar 2013 13:11:46 +0000 (13:11 +0000)]
Disable ASan/MSan symbolization of reports in tests.

It was using an instrumented symbolizer binary, which is a potential fork bomb.

llvm-svn: 178140

11 years agoDisable ASan/MSan symbolization of reports in tests.
Evgeniy Stepanov [Wed, 27 Mar 2013 13:11:12 +0000 (13:11 +0000)]
Disable ASan/MSan symbolization of reports in tests.

It was using an instrumented symbolizer binary, which is a potential fork bomb.

llvm-svn: 178139

11 years agoMark comment-to-html-xml-conversion test as XFAIL:msan, in addition to valgrind.
Evgeniy Stepanov [Wed, 27 Mar 2013 13:05:40 +0000 (13:05 +0000)]
Mark comment-to-html-xml-conversion test as XFAIL:msan, in addition to valgrind.

llvm-svn: 178138

11 years agoFix target-customized spilling in the register scavenger
Hal Finkel [Wed, 27 Mar 2013 13:00:56 +0000 (13:00 +0000)]
Fix target-customized spilling in the register scavenger

This is a follow-up to r178073 (which should actually make target-customized
spilling work again).

I still don't have a regression test for this (but it would be good to have
one; Thumb 1 and Mips16 use this callback as well).

Patch by Richard Sandiford.

llvm-svn: 178137