platform/upstream/llvm.git
9 years ago[MBP] Revert r231238 which attempted to fix a nasty bug where MBP is
Chandler Carruth [Thu, 5 Mar 2015 01:07:03 +0000 (01:07 +0000)]
[MBP] Revert r231238 which attempted to fix a nasty bug where MBP is
just arbitrarily interleaving unrelated control flows once they get
moved "out-of-line" (both outside of natural CFG ordering and with
diamonds that cannot be fully laid out by chaining fallthrough edges).

This easy solution doesn't work in practice, and it isn't just a small
bug. It looks like a very different strategy will be required. I'm
working on that now, and it'll again go behind some flag so that
everyone can experiment and make sure it is working well for them.

llvm-svn: 231332

9 years agoScalarEvolution.cpp: Appease g++-4.7. He missed implicit "this" in lambda.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:02:45 +0000 (01:02 +0000)]
ScalarEvolution.cpp: Appease g++-4.7. He missed implicit "this" in lambda.

llvm-svn: 231331

9 years agoRemove else if a last block ends with return.
Rui Ueyama [Thu, 5 Mar 2015 01:02:20 +0000 (01:02 +0000)]
Remove else if a last block ends with return.

llvm-svn: 231330

9 years agoRemove redundant virtual destructor.
Rui Ueyama [Thu, 5 Mar 2015 00:55:04 +0000 (00:55 +0000)]
Remove redundant virtual destructor.

DefinedAtom, which is the base class of ELFCommonAtom, has a
virtual destructor, so this is redundant.

llvm-svn: 231329

9 years agoMS ABI: Implement support for throwing a C++ exception
David Majnemer [Thu, 5 Mar 2015 00:46:22 +0000 (00:46 +0000)]
MS ABI: Implement support for throwing a C++ exception

Throwing a C++ exception, under the MS ABI, is implemented using three
components:
- ThrowInfo structure which contains information like CV qualifiers,
  what destructor to call and a pointer to the CatchableTypeArray.
- In a significant departure from the Itanium ABI, copying by-value
  occurs in the runtime and not at the catch site.  This means we need
  to enumerate all possible types that this exception could be caught as
  and encode the necessary information to convert from the exception
  object's type to the catch handler's type.  This includes complicated
  derived to base conversions and the execution of copy-constructors.

N.B. This implementation doesn't support the execution of a
copy-constructor from within the runtime for now.  Adding support for
that functionality is quite difficult due to things like default
argument expressions which may evaluate arbitrary code hiding in the
copy-constructor's parameters.

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

llvm-svn: 231328

9 years agoCreate a dependence struct to hold dependence information for a SCoP.
Johannes Doerfert [Thu, 5 Mar 2015 00:43:48 +0000 (00:43 +0000)]
Create a dependence struct to hold dependence information for a SCoP.

  The new Dependences struct in the DependenceInfo holds all information
  that was formerly part of the DependenceInfo. It also provides the
  same interface for the user to access this information.

  This is another step to a more general ScopPass interface that does
  allow multiple SCoPs to be "in flight".

llvm-svn: 231327

9 years agoAdd missing forward declaration [NFC]
Johannes Doerfert [Thu, 5 Mar 2015 00:40:07 +0000 (00:40 +0000)]
Add missing forward declaration [NFC]

llvm-svn: 231326

9 years ago[ASan] Fix asan-(32|64)-bits lit tests feature.
Alexey Samsonov [Thu, 5 Mar 2015 00:33:11 +0000 (00:33 +0000)]
[ASan] Fix asan-(32|64)-bits lit tests feature.

It broke down at some point, and all tests with
  REQUIRES: asan-(32|64)-bits
line stopped being executed. Restore the intended behavior.

llvm-svn: 231325

9 years agoRemove the conditional addition of the execution dependency fixing
Eric Christopher [Thu, 5 Mar 2015 00:28:55 +0000 (00:28 +0000)]
Remove the conditional addition of the execution dependency fixing
pass from the ARM backend as the pass itself will detect any use
of the appropriate register class.

llvm-svn: 231324

9 years agoCleanup and remove a chunk of getARMSubtarget calls in the
Eric Christopher [Thu, 5 Mar 2015 00:23:40 +0000 (00:23 +0000)]
Cleanup and remove a chunk of getARMSubtarget calls in the
ARM TargetMachine pass pipeline construction by pushing them down
into the appropriate pass.

llvm-svn: 231323

9 years agoTurn off .debug_pubnames/pubtypes for PS4.
Paul Robinson [Thu, 5 Mar 2015 00:08:27 +0000 (00:08 +0000)]
Turn off .debug_pubnames/pubtypes for PS4.

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

llvm-svn: 231322

9 years agoUse range-based for loops to iterate over file nodes.
Rui Ueyama [Thu, 5 Mar 2015 00:07:38 +0000 (00:07 +0000)]
Use range-based for loops to iterate over file nodes.

I converted them to non-range-based loops in r226883 and r226893
because at that moment File::parse() may have side effects and
may update the vector that the reference returned from
LinkingContext::nodes().

Now File::parse() is free from side effects. We can use range-based
loops again.

llvm-svn: 231321

9 years agoGive some obj-c rewriter tests that use MS pragmas a triple as a speculative fix
Reid Kleckner [Thu, 5 Mar 2015 00:04:18 +0000 (00:04 +0000)]
Give some obj-c rewriter tests that use MS pragmas a triple as a speculative fix

llvm-svn: 231320

9 years ago[sanitizer] when dumping coverage bitset, dump seperate file for every module, instea...
Kostya Serebryany [Wed, 4 Mar 2015 23:41:55 +0000 (23:41 +0000)]
[sanitizer] when dumping coverage bitset, dump seperate file for every module, instead of dumping a single combined bitset

llvm-svn: 231319

9 years agoTemporary XFAILs for Hexagon
Rick Foos [Wed, 4 Mar 2015 23:40:38 +0000 (23:40 +0000)]
Temporary XFAILs for Hexagon

Summary: Temporary XFAIL's until patches done.

Reviewers: echristo, adasgupt, colinl

Reviewed By: colinl

Subscribers: llvm-commits

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

llvm-svn: 231318

9 years agoImplement section pragma feedback on r205810
Reid Kleckner [Wed, 4 Mar 2015 23:39:17 +0000 (23:39 +0000)]
Implement section pragma feedback on r205810

Mostly short-circuits some conditionals.  Adds target validation of
sections passed to these pragmas.

llvm-svn: 231317

9 years agoPECOFF: Update comments on .drectve section encoding.
Rui Ueyama [Wed, 4 Mar 2015 23:22:48 +0000 (23:22 +0000)]
PECOFF: Update comments on .drectve section encoding.

llvm-svn: 231316

9 years agoAppease the Windows bot
Enrico Granata [Wed, 4 Mar 2015 23:19:36 +0000 (23:19 +0000)]
Appease the Windows bot

llvm-svn: 231315

9 years ago[analyzer] Bug fix: do not report leaks for alloca()
Anton Yartsev [Wed, 4 Mar 2015 23:18:21 +0000 (23:18 +0000)]
[analyzer] Bug fix: do not report leaks for alloca()

llvm-svn: 231314

9 years agoInitializer lists are supported in MSVC 2013. Since that's our minimum required versi...
Aaron Ballman [Wed, 4 Mar 2015 23:17:31 +0000 (23:17 +0000)]
Initializer lists are supported in MSVC 2013. Since that's our minimum required version, we can move that to the list of acceptable C++11 features.

llvm-svn: 231313

9 years agoPass -dll to link.exe when building with -shared (PR22697)
Hans Wennborg [Wed, 4 Mar 2015 23:16:21 +0000 (23:16 +0000)]
Pass -dll to link.exe when building with -shared (PR22697)

And start building a test for non-clang-cl link.exe invocations.

llvm-svn: 231312

9 years agoMove the <dynarray> tests out of the std/ hierarchy, since it's not really part of...
Marshall Clow [Wed, 4 Mar 2015 23:09:15 +0000 (23:09 +0000)]
Move the <dynarray> tests out of the std/ hierarchy, since it's not really part of the standard any more.

llvm-svn: 231311

9 years agoIntroduce lldbassert(x)
Enrico Granata [Wed, 4 Mar 2015 22:59:20 +0000 (22:59 +0000)]
Introduce lldbassert(x)

We would like it if LLDB never crashed, especially if we never caused LLDB to crash
On the other hand, having assertions can sometimes be useful

lldbassert(x) is the best of both worlds:
- in debug builds, it turns into a regular assert, which is fine because we don't mind debug LLDB to crash on development machines
- in non-debug builds, it emits a message formatted just like assert(x) would, but then instead of crashing, it dumps a backtrace, suggests filing a bug, and keeps running

llvm-svn: 231310

9 years ago[Support] Increase timeout for the LockFileManager back to 5 mins.
Argyrios Kyrtzidis [Wed, 4 Mar 2015 22:54:38 +0000 (22:54 +0000)]
[Support] Increase timeout for the LockFileManager back to 5 mins.

Waiting for just 1 min may not be enough for some contexts.

llvm-svn: 231309

9 years agoRename the Dependences pass to DependenceInfo [NFC]
Johannes Doerfert [Wed, 4 Mar 2015 22:43:40 +0000 (22:43 +0000)]
Rename the Dependences pass to DependenceInfo [NFC]

  We rename the Dependences pass to DependenceInfo as a first step to a
  caching pass policy. The new DependenceInfo pass will later provide
  "Dependences" for a SCoP.

  To keep consistency the test folder is renamed too.

llvm-svn: 231308

9 years agoImprove test robustness
Matthias Braun [Wed, 4 Mar 2015 22:31:18 +0000 (22:31 +0000)]
Improve test robustness

Improve test robustness in preparation of coming commits:
- Avoid undefs which may get propagated too much.
- Remove several pointless add 0, instructions

llvm-svn: 231307

9 years ago[IndVarSimplify] use the "canonical" way to infer no-wrap.
Sanjoy Das [Wed, 4 Mar 2015 22:24:23 +0000 (22:24 +0000)]
[IndVarSimplify] use the "canonical" way to infer no-wrap.

Summary:
rL225282 introduced an ad-hoc way to promote some additions to nuw or
nsw.  Since then SCEV has become smarter in directly proving no-wrap;
and using the canonical "ext(A op B) == ext(A) op ext(B)" method of
proving no-wrap is just as powerful now.  Rip out the existing
complexity in favor of getting SCEV to do all the heaving lifting
internally.

This change does not add any unit tests because it is supposed to be a
non-functional change.  Tests added in rL225282 and rL226075 are valid
tests for this change.

Reviewers: atrick, majnemer

Subscribers: llvm-commits

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

llvm-svn: 231306

9 years ago[SCEV] make SCEV smarter about proving no-wrap.
Sanjoy Das [Wed, 4 Mar 2015 22:24:17 +0000 (22:24 +0000)]
[SCEV] make SCEV smarter about proving no-wrap.

Summary:
Teach SCEV to prove no overflow for an add recurrence by proving
something about the range of another add recurrence a loop-invariant
distance away from it.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 231305

9 years agoSimplify dropConstantScheduleDims [NFC]
Johannes Doerfert [Wed, 4 Mar 2015 22:23:21 +0000 (22:23 +0000)]
Simplify dropConstantScheduleDims [NFC]

llvm-svn: 231304

9 years agoProvide an explicit move ctor because MSVC can't synthesize one
David Blaikie [Wed, 4 Mar 2015 22:20:52 +0000 (22:20 +0000)]
Provide an explicit move ctor because MSVC can't synthesize one

llvm-svn: 231303

9 years agoFix the clang self-host -Werror build
David Blaikie [Wed, 4 Mar 2015 22:15:41 +0000 (22:15 +0000)]
Fix the clang self-host -Werror build

Sorry about the breakage.

llvm-svn: 231302

9 years agoPECOFF: Do not add layout-after edges.
Rui Ueyama [Wed, 4 Mar 2015 22:13:25 +0000 (22:13 +0000)]
PECOFF: Do not add layout-after edges.

The last use of layout-after edge for PE/COFF was removed in r231290.
Now layout-after edges do nothing. We can stop adding them to the graph.
No functionality change intended.

llvm-svn: 231301

9 years ago[dsymutil] Add minimal code to emit DIE trees.
Frederic Riss [Wed, 4 Mar 2015 22:07:44 +0000 (22:07 +0000)]
[dsymutil] Add minimal code to emit DIE trees.

This commit adds code to emit DIE trees that have been pruned from the
parts that haven't been marked as kept in the previous pass.

It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf)
into a tree of DIE objects. Cloning the DIEs means essentially cloning
their attributes. The code in this commit does only handle scalar and
block attributes (scalar because they are trivial, blocks because they
can't be easily replaced by a scalr placeholder), all the other ones
are replaced by placeholder zero values and will be handled in
further commits.

The added tests mostly check that the DIE tree has the correct layout and
also verify that a few chosen scalar and block attributes correctly make
their way into the output.

llvm-svn: 231300

9 years agoDWARFFormValue: Add getAsSignedConstant method.
Frederic Riss [Wed, 4 Mar 2015 22:07:41 +0000 (22:07 +0000)]
DWARFFormValue: Add getAsSignedConstant method.

The implementation accepts explicitely signed forms (DW_FORM_sdata),
but also unsigned forms as long as they fit in an int64_t.

llvm-svn: 231299

9 years agoTeach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.
Frederic Riss [Wed, 4 Mar 2015 22:07:36 +0000 (22:07 +0000)]
Teach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.

To be used/tested by llvm-dsymutil. (llvm-dsymutil does a 'static' link,
no need for relocations for most things, so it'll just emit raw integers
for most attributes)

llvm-svn: 231298

9 years agoMake the DWARFAbbreviationDeclaration::AttributeSpec type public.
Frederic Riss [Wed, 4 Mar 2015 22:07:30 +0000 (22:07 +0000)]
Make the DWARFAbbreviationDeclaration::AttributeSpec type public.

It was already exposed through the iterators anyway.

llvm-svn: 231297

9 years agoUpdate LangRef for explicit type changes to 'load' instruction
David Blaikie [Wed, 4 Mar 2015 22:06:14 +0000 (22:06 +0000)]
Update LangRef for explicit type changes to 'load' instruction

llvm-svn: 231296

9 years agoExpand variables when evaluating absolute expressions.
Rafael Espindola [Wed, 4 Mar 2015 22:03:21 +0000 (22:03 +0000)]
Expand variables when evaluating absolute expressions.

This allows for variables to be used in .size.
This matches gnu AS functionality.

llvm-svn: 231295

9 years agoUpdate LangRef for getelementptr explicit type changes
David Blaikie [Wed, 4 Mar 2015 22:02:58 +0000 (22:02 +0000)]
Update LangRef for getelementptr explicit type changes

Here's a rough/first draft - it at least hits the actual textual IR
examples and some of the phrasing. It's probably worth a full pass over,
but I'm not sure how much these docs should reflect the strange
intermediate state we're in anyway.

Totally open to lots of review/feedback/suggestions.

llvm-svn: 231294

9 years ago[Sanitizer] Fix/suppress compiler warnings in unit tests.
Alexey Samsonov [Wed, 4 Mar 2015 21:54:20 +0000 (21:54 +0000)]
[Sanitizer] Fix/suppress compiler warnings in unit tests.

llvm-svn: 231293

9 years agodon't repeat class / function / variable names in comments; NFC
Sanjay Patel [Wed, 4 Mar 2015 21:49:03 +0000 (21:49 +0000)]
don't repeat class / function / variable names in comments; NFC

llvm-svn: 231292

9 years agoAdd Clang support for PPC cryptography builtins
Nemanja Ivanovic [Wed, 4 Mar 2015 21:48:22 +0000 (21:48 +0000)]
Add Clang support for PPC cryptography builtins
Review: http://reviews.llvm.org/D7951

llvm-svn: 231291

9 years agoDefine DefinedAtom::sectionSize.
Rui Ueyama [Wed, 4 Mar 2015 21:40:46 +0000 (21:40 +0000)]
Define DefinedAtom::sectionSize.

Merge::mergeByLargestSection is half-baked since it's defined
in terms of section size, there's no way to get the section size
of an atom.

Currently we work around the issue by traversing the layout edges
to both directions and calculate the sum of all atoms reachable.
I wrote that code but I knew it's hacky. It's even not guaranteed
to work. If you add layout edges before the core linking, it
miscalculates a size.

Also it's of course slow. It's basically a linked list traversal.

In this patch I added DefinedAtom::sectionSize so that we can use
that for mergeByLargestSection. I'm not very happy to add a new
field to DefinedAtom base class, but I think it's legitimate since
mergeByLargestSection is defined for section size, and the section
size is currently just missing.

http://reviews.llvm.org/D7966

llvm-svn: 231290

9 years agoExclude LLVM sources from lint check.
Alexey Samsonov [Wed, 4 Mar 2015 21:38:10 +0000 (21:38 +0000)]
Exclude LLVM sources from lint check.

Checking files from different repository is not nice, and LLVM code
follows its own style guide anyway.

llvm-svn: 231289

9 years agoAdd a required #include
Enrico Granata [Wed, 4 Mar 2015 21:33:45 +0000 (21:33 +0000)]
Add a required #include

llvm-svn: 231288

9 years agoFix a thinko in the case where we return a launch error with no error
Jim Ingham [Wed, 4 Mar 2015 21:28:55 +0000 (21:28 +0000)]
Fix a thinko in the case where we return a launch error with no error
string.  Return "<unknown error>" rather than the empty launch error...

<rdar://problem/20026469>

llvm-svn: 231287

9 years agoSupport standard DWARF TLS opcode; Darwin and PS4 use it.
Paul Robinson [Wed, 4 Mar 2015 20:55:11 +0000 (20:55 +0000)]
Support standard DWARF TLS opcode; Darwin and PS4 use it.

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

llvm-svn: 231286

9 years agoAdd LLVM support for PPC cryptography builtins
Nemanja Ivanovic [Wed, 4 Mar 2015 20:44:33 +0000 (20:44 +0000)]
Add LLVM support for PPC cryptography builtins
Review: http://reviews.llvm.org/D7955

llvm-svn: 231285

9 years agoTry to satisfy sanitizer lint check
Reid Kleckner [Wed, 4 Mar 2015 20:38:59 +0000 (20:38 +0000)]
Try to satisfy sanitizer lint check

llvm-svn: 231284

9 years ago[sanitizer] Since x32 runs under 64-bit kernel, GetKernelAreaSize should return 0
Kostya Serebryany [Wed, 4 Mar 2015 20:32:06 +0000 (20:32 +0000)]
[sanitizer] Since x32 runs under 64-bit kernel, GetKernelAreaSize should return 0

llvm-svn: 231283

9 years agoAdd a FIXME for PR22796, broken ordering of ClassInfo in TableGen
David Blaikie [Wed, 4 Mar 2015 19:56:44 +0000 (19:56 +0000)]
Add a FIXME for PR22796, broken ordering of ClassInfo in TableGen

As discussed (at length) in code review of r222935, with Duncan.

llvm-svn: 231282

9 years agoRemove unnecessary dynamic memory management
Tobias Grosser [Wed, 4 Mar 2015 19:33:31 +0000 (19:33 +0000)]
Remove unnecessary dynamic memory management

llvm-svn: 231281

9 years agoFix test/CodeGen/builtins.c for platforms that don't lower sjlj
Reid Kleckner [Wed, 4 Mar 2015 19:24:16 +0000 (19:24 +0000)]
Fix test/CodeGen/builtins.c for platforms that don't lower sjlj

Opt in Win64 to supporting sjlj lowering. We have the backend lowering,
so I think this was just an oversight because WinX86_64TargetCodeGenInfo
doesn't inherit from X86_64TargetCodeGenInfo.

llvm-svn: 231280

9 years agoFix the build of the gold-plugin and examples.
Rafael Espindola [Wed, 4 Mar 2015 19:15:29 +0000 (19:15 +0000)]
Fix the build of the gold-plugin and examples.

llvm-svn: 231279

9 years agoTry to fix the build after removing DataLayoutPass
Reid Kleckner [Wed, 4 Mar 2015 19:10:41 +0000 (19:10 +0000)]
Try to fix the build after removing DataLayoutPass

llvm-svn: 231278

9 years agoAdd missing <atomic> include to PassRegistry.h
Reid Kleckner [Wed, 4 Mar 2015 19:06:17 +0000 (19:06 +0000)]
Add missing <atomic> include to PassRegistry.h

llvm-svn: 231277

9 years agoAdd a lock() function in PassRegistry to speed up multi-thread synchronization.
Erik Eckstein [Wed, 4 Mar 2015 18:57:11 +0000 (18:57 +0000)]
Add a lock() function in PassRegistry to speed up multi-thread synchronization.

When calling lock() after all passes are registered, the PassRegistry doesn't need a mutex anymore to look up passes.
This speeds up multithreaded llvm execution by ~5% (tested with 4 threads).
In an asserts build of llvm this has an even bigger impact.

Note that it's not required to use the lock function.

llvm-svn: 231276

9 years agoRecommit r231221: "Devirtualize ~parser<T> by making it protected in base classes...
David Blaikie [Wed, 4 Mar 2015 18:52:32 +0000 (18:52 +0000)]
Recommit r231221: "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final"

Reverted in r231254 due to a self-hosting crash of Clang (see Clang
PR22793). Workaround the crash by using {} instead of = default to
define a dtor.

llvm-svn: 231274

9 years agoBring r231132 back with a fix.
Rafael Espindola [Wed, 4 Mar 2015 18:51:45 +0000 (18:51 +0000)]
Bring r231132 back with a fix.

The issue was that we were always printing the remarks. Fix that and add a test
showing that it prints nothing if -pass-remarks is not given.

Original message:
Correctly handle -pass-remarks in the gold plugin.

llvm-svn: 231273

9 years agoAllow to build shared libraries if BUILD_SHARED_LIBS is enabled
Tobias Grosser [Wed, 4 Mar 2015 18:51:27 +0000 (18:51 +0000)]
Allow to build shared libraries if BUILD_SHARED_LIBS is enabled

Contributed-by: Richard Membarth <richard.membarth@uni-saarland.de>
llvm-svn: 231272

9 years agoRemove "inline" from inlined functions.
Rui Ueyama [Wed, 4 Mar 2015 18:51:19 +0000 (18:51 +0000)]
Remove "inline" from inlined functions.

llvm-svn: 231271

9 years agoMake DataLayout Non-Optional in the Module
Mehdi Amini [Wed, 4 Mar 2015 18:43:29 +0000 (18:43 +0000)]
Make DataLayout Non-Optional in the Module

Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231270

9 years agoRevert "unique_ptrify ValID::ConstantStructElts"
Reid Kleckner [Wed, 4 Mar 2015 18:31:10 +0000 (18:31 +0000)]
Revert "unique_ptrify ValID::ConstantStructElts"

This reverts r231200 and r231204. The second one added an explicit move
ctor for MSVC.

This change broke the clang-cl self-host due to weirdness in MSVC's
implementation of std::map::insert. Somehow we lost our rvalue ref-ness
when going through variadic placement new:

  template <class _Objty, class... _Types>
  void construct(_Objty *_Ptr,
                 _Types &&... _Args) { // construct _Objty(_Types...) at _Ptr
    ::new ((void *)_Ptr) _Objty(_STD forward<_Types>(_Args)...);
  }

For some reason, Clang decided to call the deleted std::pair copy
constructor at this point. Needs further investigation, once I can
build.

llvm-svn: 231269

9 years agoAdd support for conditional 'and' and 'or' expressions
Tobias Grosser [Wed, 4 Mar 2015 18:14:59 +0000 (18:14 +0000)]
Add support for conditional 'and' and 'or' expressions

No test cases unfortunately as we do not yet generate isl_ast_op_and_then or
isl_ast_op_or_else. Those will be added in a later commit.

llvm-svn: 231268

9 years ago[clang-tidy] Fix namespace comments. NFC.
Alexander Kornienko [Wed, 4 Mar 2015 18:01:10 +0000 (18:01 +0000)]
[clang-tidy] Fix namespace comments. NFC.

llvm-svn: 231267

9 years ago[analyzer] Individual configuration options can be specified for checkers.
Gabor Horvath [Wed, 4 Mar 2015 17:59:34 +0000 (17:59 +0000)]
[analyzer] Individual configuration options can be specified for checkers.

Reviewed by: Anna Zaks

Original patch by: Aleksei Sidorin

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

llvm-svn: 231266

9 years agoNew ObjC warning: circular containers.
Alex Denisov [Wed, 4 Mar 2015 17:55:52 +0000 (17:55 +0000)]
New ObjC warning: circular containers.

This commit adds new warning to prevent user from creating 'circular containers'.

Mutable collections from NSFoundation allows user to add collection to itself, e.g.:

NSMutableArray *a = [NSMutableArray new];
[a addObject:a];

The code above leads to really weird behaviour (crashes, 'endless' recursion) and
retain cycles (collection retains itself) if ARC enabled.

Patch checks the following collections:
  - NSMutableArray,
  - NSMutableDictionary,
  - NSMutableSet,
  - NSMutableOrderedSet,
  - NSCountedSet.

llvm-svn: 231265

9 years agoRevert the test commit.
Wei Mi [Wed, 4 Mar 2015 17:44:22 +0000 (17:44 +0000)]
Revert the test commit.

llvm-svn: 231264

9 years agoDon't #include clang headers from BreakpointLocation.h
Zachary Turner [Wed, 4 Mar 2015 17:43:00 +0000 (17:43 +0000)]
Don't #include clang headers from BreakpointLocation.h

llvm-svn: 231263

9 years agoTest commit. It will be reverted in the next commit.
Wei Mi [Wed, 4 Mar 2015 17:41:17 +0000 (17:41 +0000)]
Test commit. It will be reverted in the next commit.

llvm-svn: 231262

9 years agoUpdate the out-of-date dwarf expressions in these testcases.
Adrian Prantl [Wed, 4 Mar 2015 17:39:59 +0000 (17:39 +0000)]
Update the out-of-date dwarf expressions in these testcases.

llvm-svn: 231261

9 years agoFix DwarfExpression::AddMachineRegExpression so it doesn't read past the
Adrian Prantl [Wed, 4 Mar 2015 17:39:33 +0000 (17:39 +0000)]
Fix DwarfExpression::AddMachineRegExpression so it doesn't read past the
end of an expression that ends with DW_OP_plus.
Caught by the ASAN build bots.

llvm-svn: 231260

9 years agoR600/SI: Add an intrinsic for S_FLBIT_I32 / V_FFBH_I32
Marek Olsak [Wed, 4 Mar 2015 17:33:45 +0000 (17:33 +0000)]
R600/SI: Add an intrinsic for S_FLBIT_I32 / V_FFBH_I32

Required by OpenGL (ARB_gpu_shader5).

llvm-svn: 231259

9 years agoTest commit. Removed an unnecessary space
Nemanja Ivanovic [Wed, 4 Mar 2015 17:09:12 +0000 (17:09 +0000)]
Test commit. Removed an unnecessary space

llvm-svn: 231257

9 years agoExplicitly default ilistTest::Node's copy constructor
David Blaikie [Wed, 4 Mar 2015 17:01:18 +0000 (17:01 +0000)]
Explicitly default ilistTest::Node's copy constructor

In the presence of a user-declared dtor, calling an implicit copy ctor
is deprecated in C++11.

llvm-svn: 231256

9 years agoNbjoerg suggested a better name for the macro for the default rune table: _LIBCPP_PRO...
Marshall Clow [Wed, 4 Mar 2015 16:50:02 +0000 (16:50 +0000)]
Nbjoerg suggested a better name for the macro for the default rune table: _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE

llvm-svn: 231255

9 years agoRevert r231221, "Devirtualize ~parser<T> by making it protected in base classes and...
NAKAMURA Takumi [Wed, 4 Mar 2015 16:24:40 +0000 (16:24 +0000)]
Revert r231221, "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final"

It broke seflhosting.

llvm-svn: 231254

9 years agoRevert r231132, "Correctly handle -pass-remarks in the gold plugin.", for now, to...
NAKAMURA Takumi [Wed, 4 Mar 2015 16:24:28 +0000 (16:24 +0000)]
Revert r231132, "Correctly handle -pass-remarks in the gold plugin.", for now, to suppress log floodng in LTO.

llvm-svn: 231253

9 years agoCreate a default rune table for libc++. Initial setting - never enabled. The expectat...
Marshall Clow [Wed, 4 Mar 2015 16:10:14 +0000 (16:10 +0000)]
Create a default rune table for libc++. Initial setting - never enabled. The expectation is that some targets (Android, cough) will enable it. Note that this is an implementation detail, not an interface change.

llvm-svn: 231252

9 years ago[Modules] Fix crash in Preprocessor::getLastMacroWithSpelling().
Argyrios Kyrtzidis [Wed, 4 Mar 2015 16:03:07 +0000 (16:03 +0000)]
[Modules] Fix crash in Preprocessor::getLastMacroWithSpelling().

Macro names that got undefined inside a module may not have their MacroInfo set.

llvm-svn: 231251

9 years agoMutate TargetLowering::shouldExpandAtomicRMWInIR to specifically dictate how AtomicRM...
JF Bastien [Wed, 4 Mar 2015 15:47:57 +0000 (15:47 +0000)]
Mutate TargetLowering::shouldExpandAtomicRMWInIR to specifically dictate how AtomicRMWInsts are expanded.

Summary:
In PNaCl, most atomic instructions have their own @llvm.nacl.atomic.* function, each one, with a few exceptions, represents a consistent behaviour across all NaCl-supported targets. Unfortunately, the atomic RMW operations nand, [u]min, and [u]max aren't directly represented by any such @llvm.nacl.atomic.* function. This patch refines shouldExpandAtomicRMWInIR in TargetLowering so that a future `Le32TargetLowering` class can selectively inform the caller how the target desires the atomic RMW instruction to be expanded (ie via load-linked/store-conditional for ARM/AArch64, via cmpxchg for X86/others?, or not at all for Mips) if at all.

This does not represent a behavioural change and as such no tests were added.

Patch by: Richard Diamond.

Reviewers: jfb

Reviewed By: jfb

Subscribers: jfb, aemerson, t.p.northover, llvm-commits

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

llvm-svn: 231250

9 years ago[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator
Jozef Kolek [Wed, 4 Mar 2015 15:47:42 +0000 (15:47 +0000)]
[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator

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

llvm-svn: 231249

9 years agoRevert "[IAS] Teach -cc1as about the 'target-abi' option."
Daniel Jasper [Wed, 4 Mar 2015 15:02:22 +0000 (15:02 +0000)]
Revert "[IAS] Teach -cc1as about the 'target-abi' option."

This reverts commit 0e41c8faeff75614cf4627533331d780ba3db030.

This is breaking buildbots:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/4668/

llvm-svn: 231248

9 years agoPrevent test from writing files.
Daniel Jasper [Wed, 4 Mar 2015 15:02:17 +0000 (15:02 +0000)]
Prevent test from writing files.

llvm-svn: 231247

9 years ago[PowerPC] Remove unnecessary and incomplete commentary
Bill Schmidt [Wed, 4 Mar 2015 14:56:05 +0000 (14:56 +0000)]
[PowerPC] Remove unnecessary and incomplete commentary

This "itinerary class map" in PPCSchedule.td is incomplete and
redundant with the actual code.  As it provides no value, we've
decided to remove it.

No functional change.

llvm-svn: 231246

9 years agoAdjust the changes from r230255 to bail out if the backend can't lower
Joerg Sonnenberger [Wed, 4 Mar 2015 14:25:35 +0000 (14:25 +0000)]
Adjust the changes from r230255 to bail out if the backend can't lower
__builtin_setjmp/__builtin_longjmp and don't fall back to the libc
functions.

llvm-svn: 231245

9 years ago[IAS] Teach -cc1as about the 'target-abi' option.
Toma Tabacu [Wed, 4 Mar 2015 14:24:25 +0000 (14:24 +0000)]
[IAS] Teach -cc1as about the 'target-abi' option.

Summary:
When using the IAS from clang, the 'target-abi' option gets passed to cc1as, but cc1as doesn't know about it and gives an "unknown argument" error.

This is fixed by adding the 'CC1AsOption' flag to the 'target-abi' option in CC1Options.td.

Reviewers: atanasyan, echristo, dsanders

Reviewed By: dsanders

Subscribers: cfe-commits

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

llvm-svn: 231244

9 years ago[X86][FastISel] Simplify the logic in method X86SelectSIToFP.
Andrea Di Biagio [Wed, 4 Mar 2015 14:23:25 +0000 (14:23 +0000)]
[X86][FastISel] Simplify the logic in method X86SelectSIToFP.

The target-independent selection algorithm in FastISel already knows how
to select a SINT_TO_FP if the target is SSE but not AVX.

On targets that have SSE but not AVX, the tablegen'd 'fastEmit' functions
for ISD::SINT_TO_FP know how to select instruction X86::CVTSI2SSrr
(for an i32 to f32 conversion) and X86::CVTSI2SDrr (for an i32 to f64
conversion).

This patch simplifies the logic in method X86SelectSIToFP knowing that
the code would not be reachable if the subtarget doesn't have AVX.
No functional change intended.

llvm-svn: 231243

9 years agoMove one more diagnostic into the new -Wformat-pedantic group.
Daniel Jasper [Wed, 4 Mar 2015 14:18:20 +0000 (14:18 +0000)]
Move one more diagnostic into the new -Wformat-pedantic group.

This was apparently overlooked in r231211.

llvm-svn: 231242

9 years agoasan: do not instrument direct inbounds accesses to stack variables
Dmitry Vyukov [Wed, 4 Mar 2015 13:27:53 +0000 (13:27 +0000)]
asan: do not instrument direct inbounds accesses to stack variables

Do not instrument direct accesses to stack variables that can be
proven to be inbounds, e.g. accesses to fields of structs on stack.

But it eliminates 33% of instrumentation on webrtc/modules_unittests
(number of memory accesses goes down from 290152 to 193998) and
reduces binary size by 15% (from 74M to 64M) and improved compilation time by 6-12%.

The optimization is guarded by asan-opt-stack flag that is off by default.

http://reviews.llvm.org/D7583

llvm-svn: 231241

9 years ago[mips] Rename the LA/LI/DLI TableGen definitions and classes. NFC.
Toma Tabacu [Wed, 4 Mar 2015 13:01:14 +0000 (13:01 +0000)]
[mips] Rename the LA/LI/DLI TableGen definitions and classes. NFC.

Summary:
Use more reasonable names for these pseudo-instructions.
As there's only one definition tied to any one of these classes, I named them with abbreviated versions of their respective class' name.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 231240

9 years ago[mips] Keep the parameter list of Filler::searchRange() consistent. NFC.
Vasileios Kalintiris [Wed, 4 Mar 2015 12:37:58 +0000 (12:37 +0000)]
[mips] Keep the parameter list of Filler::searchRange() consistent. NFC.

Summary:
Move the "Filler" parameter to the end of the parameter list as it is,
conceptually, the only output parameter of that function.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 231239

9 years ago[MBP] Fix a really horrible bug in MachineBlockPlacement, but behind
Chandler Carruth [Wed, 4 Mar 2015 12:18:08 +0000 (12:18 +0000)]
[MBP] Fix a really horrible bug in MachineBlockPlacement, but behind
a flag for now.

First off, thanks to Daniel Jasper for really pointing out the issue
here. It's been here forever (at least, I think it was there when
I first wrote this code) without getting really noticed or fixed.

The key problem is what happens when two reasonably common patterns
happen at the same time: we outline multiple cold regions of code, and
those regions in turn have diamonds or other CFGs for which we can't
just topologically lay them out. Consider some C code that looks like:

  if (a1()) { if (b1()) c1(); else d1(); f1(); }
  if (a2()) { if (b2()) c2(); else d2(); f2(); }
  done();

Now consider the case where a1() and a2() are unlikely to be true. In
that case, we might lay out the first part of the function like:

  a1, a2, done;

And then we will be out of successors in which to build the chain. We go
to find the best block to continue the chain with, which is perfectly
reasonable here, and find "b1" let's say. Laying out successors gets us
to:

  a1, a2, done; b1, c1;

At this point, we will refuse to lay out the successor to c1 (f1)
because there are still un-placed predecessors of f1 and we want to try
to preserve the CFG structure. So we go get the next best block, d1.

... wait for it ...

Except that the next best block *isn't* d1. It is b2! d1 is waaay down
inside these conditionals. It is much less important than b2. Except
that this is exactly what we didn't want. If we keep going we get the
entire set of the rest of the CFG *interleaved*!!!

  a1, a2, done; b1, c1; b2, c2; d1, f1; d2, f2;

So we clearly need a better strategy here. =] My current favorite
strategy is to actually try to place the block whose predecessor is
closest. This very simply ensures that we unwind these kinds of CFGs the
way that is natural and fitting, and should minimize the number of cache
lines instructions are spread across.

It also happens to be *dead simple*. It's like the datastructure was
specifically set up for this use case or something. We only push blocks
onto the work list when the last predecessor for them is placed into the
chain. So the back of the worklist *is* the nearest next block.

Unfortunately, a change like this is going to cause *soooo* many
benchmarks to swing wildly. So for now I'm adding this under a flag so
that we and others can validate that this is fixing the problems
described, that it seems possible to enable, and hopefully that it fixes
more of our problems long term.

llvm-svn: 231238

9 years ago[mips] Specify the correct value type when combining a CMovFP node.
Vasileios Kalintiris [Wed, 4 Mar 2015 12:10:18 +0000 (12:10 +0000)]
[mips] Specify the correct value type when combining a CMovFP node.

This commit fixes a bug introduced in r230956 where we were creating
CMovFP_{T,F} nodes with multiple return value types (one for each operand).
With this change the return value type of the new node is the same as the
value type of the True/False operands of the original node.

llvm-svn: 231237

9 years ago[clang-tidy] Output more diagnostics in check_clang_tidy.sh
Alexander Kornienko [Wed, 4 Mar 2015 12:07:50 +0000 (12:07 +0000)]
[clang-tidy] Output more diagnostics in check_clang_tidy.sh

Print clang-tidy output and fixes applied.

llvm-svn: 231236

9 years agoFix build on OS X after r231202
Ilia K [Wed, 4 Mar 2015 12:05:24 +0000 (12:05 +0000)]
Fix build on OS X after r231202

llvm-svn: 231235

9 years agoSet the signals based on the OS in the qHostInfo packet
Tamas Berghammer [Wed, 4 Mar 2015 11:34:10 +0000 (11:34 +0000)]
Set the signals based on the OS in the qHostInfo packet

Setting it from the Target architecture cause problems when the target
archiutecture is filled just by examining the executable because in that
case the OS isn't set.

Differential revision: http://reviews.llvm.org/D8035

llvm-svn: 231234

9 years agoAdded long 'print-values' option for var-update MI command.
Ilia K [Wed, 4 Mar 2015 11:21:18 +0000 (11:21 +0000)]
Added long 'print-values' option for var-update MI command.

Summary:
The -var-update MI command should take the same print-values options as var-list children, however currently only the integer versions are supported.
Added --no-values, --all-values, and --simple-values long options.

See:
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Variable-Objects.html#GDB_002fMI-Variable-Objects

Patch from ewan@codeplay.com

Reviewers: EwanCrawford

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 231233

9 years agoFix expectation for TestPlatformCommand.test_shell
Tamas Berghammer [Wed, 4 Mar 2015 11:18:34 +0000 (11:18 +0000)]
Fix expectation for TestPlatformCommand.test_shell

* Create expectation based on target platform
* Add custom expectation for remote android target

Differential revision: http://reviews.llvm.org/D8031

llvm-svn: 231232

9 years agoFix deadlock in operation thread in NativeProcessLinux
Tamas Berghammer [Wed, 4 Mar 2015 11:10:03 +0000 (11:10 +0000)]
Fix deadlock in operation thread in NativeProcessLinux

The deadlock occurred when the Attach or the Launch operation failed for
any reason.

Differential revision: http://reviews.llvm.org/D8030

llvm-svn: 231231