platform/upstream/llvm.git
9 years agoEnable warnings in the debugserver project file..
Jason Molenda [Thu, 16 Oct 2014 08:16:29 +0000 (08:16 +0000)]
Enable warnings in the debugserver project file..

llvm-svn: 219917

9 years agoA series of bit-flag values should be bitwise-or'ed not logical-or'ed.
Jason Molenda [Thu, 16 Oct 2014 08:15:11 +0000 (08:15 +0000)]
A series of bit-flag values should be bitwise-or'ed not logical-or'ed.
clang unreachable code warning.

llvm-svn: 219916

9 years agoRemove unreachable code.
Jason Molenda [Thu, 16 Oct 2014 08:08:13 +0000 (08:08 +0000)]
Remove unreachable code.

llvm-svn: 219915

9 years agoRemove unreachable code.
Jason Molenda [Thu, 16 Oct 2014 08:07:54 +0000 (08:07 +0000)]
Remove unreachable code.

llvm-svn: 219914

9 years agoAdd /* DISABLES CODE */ annotation before if (0) to mark it as intentional.
Jason Molenda [Thu, 16 Oct 2014 08:07:20 +0000 (08:07 +0000)]
Add /* DISABLES CODE */ annotation before if (0) to mark it as intentional.

llvm-svn: 219913

9 years agoRemove unreachable code.
Jason Molenda [Thu, 16 Oct 2014 08:05:49 +0000 (08:05 +0000)]
Remove unreachable code.

llvm-svn: 219912

9 years agoRemove unreachable code.
Jason Molenda [Thu, 16 Oct 2014 08:05:22 +0000 (08:05 +0000)]
Remove unreachable code.

llvm-svn: 219911

9 years agoXcode recommended these changes to the project file. It recommended
Jason Molenda [Thu, 16 Oct 2014 08:04:28 +0000 (08:04 +0000)]
Xcode recommended these changes to the project file.  It recommended
a number of warnings to be enabled.  The one making the most noise
across the code base right now is CLANG_WARN_UNREACHABLE_CODE = YES.

llvm-svn: 219910

9 years agoRemove unused initialization.
Jason Molenda [Thu, 16 Oct 2014 07:53:46 +0000 (07:53 +0000)]
Remove unused initialization.
clang static analyzer fixit.

llvm-svn: 219909

9 years agoRemove dead store.
Jason Molenda [Thu, 16 Oct 2014 07:52:17 +0000 (07:52 +0000)]
Remove dead store.
clang static analyzer fixit.

llvm-svn: 219908

9 years agoRemove dead store.
Jason Molenda [Thu, 16 Oct 2014 07:49:27 +0000 (07:49 +0000)]
Remove dead store.
clang static analyzer fixit.

llvm-svn: 219907

9 years agoAdds stable-runtime to ubsan to avoid broken ARM tests with asan
Renato Golin [Thu, 16 Oct 2014 07:48:27 +0000 (07:48 +0000)]
Adds stable-runtime to ubsan to avoid broken ARM tests with asan

llvm-svn: 219906

9 years agoRemove dead store.
Jason Molenda [Thu, 16 Oct 2014 07:47:37 +0000 (07:47 +0000)]
Remove dead store.
clang static analyzer fixit.

llvm-svn: 219905

9 years agoRemove unused variable.
Jason Molenda [Thu, 16 Oct 2014 07:41:32 +0000 (07:41 +0000)]
Remove unused variable.
clang static analyzer fixit.

llvm-svn: 219904

9 years agoFrontend: Fix some underscore-then-capital UB
Justin Bogner [Thu, 16 Oct 2014 06:00:55 +0000 (06:00 +0000)]
Frontend: Fix some underscore-then-capital UB

llvm-svn: 219903

9 years agoReapply r219832 - InstCombine: Narrow switch instructions using known bits.
Akira Hatanaka [Thu, 16 Oct 2014 06:00:46 +0000 (06:00 +0000)]
Reapply r219832 - InstCombine: Narrow switch instructions using known bits.

The code committed in r219832 asserted when it attempted to shrink a switch
statement whose type was larger than 64-bit.

llvm-svn: 219902

9 years agospecify dwarf version for Solaris
Alexander Eremin [Thu, 16 Oct 2014 05:55:24 +0000 (05:55 +0000)]
specify dwarf version for Solaris

llvm-svn: 219901

9 years agoPR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc...
David Blaikie [Thu, 16 Oct 2014 04:21:25 +0000 (04:21 +0000)]
PR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc) for non-type template parameters

Plumb through the full QualType of the TemplateArgument::Declaration, as
it's insufficient to only know whether the type is a reference or
pointer (that was necessary for mangling, but insufficient for debug
info). This shouldn't increase the size of TemplateArgument as
TemplateArgument::Integer is still longer by another 32 bits.

Several bits of code were testing that the reference-ness of the
parameters matched, but this seemed to be insufficient (various other
features of the type could've mismatched and wouldn't've been caught)
and unnecessary, at least insofar as removing those tests didn't cause
anything to fail.

(Richard - perchaps you can hypothesize why any of these checks might
need to test reference-ness of the parameters (& explain why
reference-ness is part of the mangling - I would've figured that for the
reference-ness to be different, a prior template argument would have to
be different). I'd be happy to add them in/beef them up and add test
cases if there's a reason for them)

llvm-svn: 219900

9 years agoTRE: make TRE a bit more aggressive
Saleem Abdulrasool [Thu, 16 Oct 2014 03:27:30 +0000 (03:27 +0000)]
TRE: make TRE a bit more aggressive

Make tail recursion elimination a bit more aggressive.  This allows us to get
tail recursion on functions that are just branches to a different function.  The
fact that the function takes a byval argument does not restrict it from being
optimised into just a tail call.

llvm-svn: 219899

9 years agoFix bad link in documentation. Thanks to rsmith
Eric Fiselier [Thu, 16 Oct 2014 03:15:31 +0000 (03:15 +0000)]
Fix bad link in documentation. Thanks to rsmith

llvm-svn: 219898

9 years agoBugfix in template instantiation in CXXPseudoDestructorExpr.
Alexey Bataev [Thu, 16 Oct 2014 03:04:35 +0000 (03:04 +0000)]
Bugfix in template instantiation in CXXPseudoDestructorExpr.
Fix for clang crash when instantiating a template with qualified lookup for members in non-class types.
Differential Revision: http://reviews.llvm.org/D5769

llvm-svn: 219897

9 years agoRyan Brown's patch to handle DW_OP_call_frame_cfa addresses
Jason Molenda [Thu, 16 Oct 2014 02:56:12 +0000 (02:56 +0000)]
Ryan Brown's patch to handle DW_OP_call_frame_cfa addresses
as load addreses instead of host addresses.
http://reviews.llvm.org/D5735

llvm-svn: 219896

9 years agoFix accidental over-checking of args in launcherXPCService.
Jason Molenda [Thu, 16 Oct 2014 02:53:57 +0000 (02:53 +0000)]
Fix accidental over-checking of args in launcherXPCService.

llvm-svn: 219895

9 years agoAdd my buildbot to list of libc++ buildbots in documentation
Eric Fiselier [Thu, 16 Oct 2014 02:48:59 +0000 (02:48 +0000)]
Add my buildbot to list of libc++ buildbots in documentation

llvm-svn: 219894

9 years agoFix a potential null pointer deref & a potential memory leak,
Jason Molenda [Thu, 16 Oct 2014 02:08:11 +0000 (02:08 +0000)]
Fix a potential null pointer deref & a potential memory leak,
also reformat to conform to the usual lldb coding conventions
a little better.
clang static analyzer fixit.

llvm-svn: 219893

9 years agoRemove unnecessary update of 'name' local.
Jason Molenda [Thu, 16 Oct 2014 01:55:21 +0000 (01:55 +0000)]
Remove unnecessary update of 'name' local.
clang static analyzer fixit.

llvm-svn: 219892

9 years agoRemove unused change to argc/argv after long option parsing has been completed.
Jason Molenda [Thu, 16 Oct 2014 01:50:14 +0000 (01:50 +0000)]
Remove unused change to argc/argv after long option parsing has been completed.
clang static analyzer fixit.

llvm-svn: 219891

9 years agoEnsure that user_exe_path is non-NULL before derferencing.
Jason Molenda [Thu, 16 Oct 2014 01:42:11 +0000 (01:42 +0000)]
Ensure that user_exe_path is non-NULL before derferencing.
We've already created a FileSpec based on this local and
this code path would never be executed if it is an invalid
FilePath - but the static analyzer doesn't know this and I
want to placate it.
clang static analyzer fixit.

llvm-svn: 219890

9 years agoGuard against NULL derefs.
Jason Molenda [Thu, 16 Oct 2014 01:40:16 +0000 (01:40 +0000)]
Guard against NULL derefs.
clang static analyzer fixits.

llvm-svn: 219889

9 years agoAh, accidentally committed a patch I didn't mean to.
Jason Molenda [Thu, 16 Oct 2014 01:27:31 +0000 (01:27 +0000)]
Ah, accidentally committed a patch I didn't mean to.

llvm-svn: 219888

9 years agoIt's possible for long_options[long_options_index].definition to be null
Jason Molenda [Thu, 16 Oct 2014 01:26:51 +0000 (01:26 +0000)]
It's possible for long_options[long_options_index].definition to be null
from the previous for() loop - check that it is non-null before trying
to deref it.
clang static analyzer fixit.

llvm-svn: 219887

9 years agoCheck that process is non-null before calling a method in it.
Jason Molenda [Thu, 16 Oct 2014 01:23:06 +0000 (01:23 +0000)]
Check that process is non-null before calling a method in it.
clang static analyzer fixit.

llvm-svn: 219886

9 years agoIt's possible for this function to not be passed a CompUnit*; add
Jason Molenda [Thu, 16 Oct 2014 01:21:25 +0000 (01:21 +0000)]
It's possible for this function to not be passed a CompUnit*; add
guards around a few additional uses of the cu local pointer.
clang static analyzer fixit.

llvm-svn: 219885

9 years agoRevert r219832.
Akira Hatanaka [Thu, 16 Oct 2014 01:17:02 +0000 (01:17 +0000)]
Revert r219832.

llvm-svn: 219884

9 years agoDebugInfo: Cleanup testing of non-type template parameters.
David Blaikie [Thu, 16 Oct 2014 00:41:40 +0000 (00:41 +0000)]
DebugInfo: Cleanup testing of non-type template parameters.

Separate out the non-nullable parameters from the nullable ones
(currently only the template template parameter) and demonstrate that
cv-qualifiers aren't preserved for non-null parameters (but are
preserved for null parameters) by adding 'const' to an int* non-type
template parameter.

llvm-svn: 219883

9 years ago[LVI] Add some additional comments about caching and context instructions
Hal Finkel [Thu, 16 Oct 2014 00:40:05 +0000 (00:40 +0000)]
[LVI] Add some additional comments about caching and context instructions

Philip Reames and I had a long conversation about this, mostly because it is
not obvious why the current logic is correct. Hopefully, these comments will
prevent such confusion in the future.

llvm-svn: 219882

9 years agollvm/Support/Options.h: Use \tparam. [-Wdocumentation]
NAKAMURA Takumi [Thu, 16 Oct 2014 00:14:57 +0000 (00:14 +0000)]
llvm/Support/Options.h: Use \tparam. [-Wdocumentation]

llvm-svn: 219881

9 years ago[CMake] clangBasic: Add Core to LINK_COMPONENTS introduced by r219840.
NAKAMURA Takumi [Thu, 16 Oct 2014 00:12:02 +0000 (00:12 +0000)]
[CMake] clangBasic: Add Core to LINK_COMPONENTS introduced by r219840.

llvm-svn: 219880

9 years agoR600: Remove dead function
Matt Arsenault [Thu, 16 Oct 2014 00:08:09 +0000 (00:08 +0000)]
R600: Remove dead function

llvm-svn: 219879

9 years agoRevert "r219834 - Teach ScalarEvolution to sharpen range information"
Sanjoy Das [Wed, 15 Oct 2014 23:46:04 +0000 (23:46 +0000)]
Revert "r219834 - Teach ScalarEvolution to sharpen range information"

This change breaks the asan buildbots:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13468

llvm-svn: 219878

9 years agoMoving CGF::EmitAlignmentAssumption to IRBuilder
Hal Finkel [Wed, 15 Oct 2014 23:45:08 +0000 (23:45 +0000)]
Moving CGF::EmitAlignmentAssumption to IRBuilder

The functionality contained in CodeGenFunction::EmitAlignmentAssumption has
been moved to IRBuilder (so that it can also be used by LLVM-level code).
Remove this now-duplicate implementation in favor of the IRBuilder code.

llvm-svn: 219877

9 years agoPreserve non-byval pointer alignment attributes using @llvm.assume when inlining
Hal Finkel [Wed, 15 Oct 2014 23:44:41 +0000 (23:44 +0000)]
Preserve non-byval pointer alignment attributes using @llvm.assume when inlining

For pointer-typed function arguments, enhanced alignment can be asserted using
the 'align' attribute. When inlining, if this enhanced alignment information is
not otherwise available, preserve it using @llvm.assume-based alignment
assumptions.

llvm-svn: 219876

9 years agoAdd CreateAlignmentAssumption to IRBuilder
Hal Finkel [Wed, 15 Oct 2014 23:44:22 +0000 (23:44 +0000)]
Add CreateAlignmentAssumption to IRBuilder

Clang CodeGen had a utility function for creating pointer alignment assumptions
using the @llvm.assume intrinsic. This functionality will also be needed by the
inliner (to preserve function-argument alignment attributes when inlining), so
this moves the utility function into IRBuilder where it can be used both by
Clang CodeGen and also other LLVM-level code.

llvm-svn: 219875

9 years ago[AVX512] Add DQ subvector inserts
Adam Nemet [Wed, 15 Oct 2014 23:42:17 +0000 (23:42 +0000)]
[AVX512] Add DQ subvector inserts

In AVX512f we support 64x2 and 32x8 inserts via matching them to 32x4 and 64x4
respectively.  These are matched by "Alt" Pat<>'s (Alt stands for alternative
VTs).

Since DQ has native support for these intructions, I peeled off the non-"Alt"
part of the baseclass into vinsert_for_size_no_alt. The DQ instructions are
derived from this multiclass.  The "Alt" Pat<>'s are disabled with DQ.

Fixes <rdar://problem/18426089>

llvm-svn: 219874

9 years ago[AVX512] Add SKX testing to avx512-insert-extract.ll
Adam Nemet [Wed, 15 Oct 2014 23:42:14 +0000 (23:42 +0000)]
[AVX512] Add SKX testing to avx512-insert-extract.ll

This is in preparation to adding DQ subvector inserts to this testcase.

llvm-svn: 219873

9 years ago[AVX512] Fix test to produce a defined value
Adam Nemet [Wed, 15 Oct 2014 23:42:11 +0000 (23:42 +0000)]
[AVX512] Fix test to produce a defined value

We're inserting into a 8 wide vector, so the index should be < 8.

llvm-svn: 219872

9 years ago[AVX512] Two new attributes in X86VectorVTInfo for subvector insert
Adam Nemet [Wed, 15 Oct 2014 23:42:09 +0000 (23:42 +0000)]
[AVX512] Two new attributes in X86VectorVTInfo for subvector insert

The new attributes are NumElts and the CD8TupleForm.  This prepares the code
to enable x8 and x2 inserts.

NFC, no change in X86.td.expanded except for the new attributes.

llvm-svn: 219871

9 years ago[AVX512] Rename arg from Opcode32/64 to Opcode128/256 in vinsert_for_size
Adam Nemet [Wed, 15 Oct 2014 23:42:04 +0000 (23:42 +0000)]
[AVX512] Rename arg from Opcode32/64 to Opcode128/256 in vinsert_for_size

It's the W bit that selects between 32 or 64 elt type and not the opcode.  The
opcode selects between the width of the insert (128 or 256).

llvm-svn: 219870

9 years agoGive old_state a default value so we won't try to restore
Jason Molenda [Wed, 15 Oct 2014 23:39:31 +0000 (23:39 +0000)]
Give old_state a default value so we won't try to restore
an uninitialized value.  In reality the code block that
initializes it and the code block that restores it will always
match up - but the analyzer doesn't know that and I want to
quiet it, so...
clang static analyzer fixit.

llvm-svn: 219869

9 years agoR600: Remove unnecessary part of computeKnownBitsForTargetNode
Matt Arsenault [Wed, 15 Oct 2014 23:37:49 +0000 (23:37 +0000)]
R600: Remove unnecessary part of computeKnownBitsForTargetNode

Zero-width BFEs are combined away already, so there's no point in
handling them.

llvm-svn: 219868

9 years agoMove variable down to use
Matt Arsenault [Wed, 15 Oct 2014 23:37:42 +0000 (23:37 +0000)]
Move variable down to use

llvm-svn: 219867

9 years agoAdd MachOObjectFile::getUuid()
Alexander Potapenko [Wed, 15 Oct 2014 23:35:45 +0000 (23:35 +0000)]
Add MachOObjectFile::getUuid()

This CL introduces MachOObjectFile::getUuid(). This function returns an ArrayRef to the object file's UUID, or an empty ArrayRef if the object file doesn't contain an LC_UUID load command.
The new function is gonna be used by llvm-symbolizer.

llvm-svn: 219866

9 years agoGive user_id a default invalid value so we don't
Jason Molenda [Wed, 15 Oct 2014 23:27:12 +0000 (23:27 +0000)]
Give user_id a default invalid value so we don't
possibly use it uninitialized in a log message later.
clang static analyzer fixit.

llvm-svn: 219865

9 years ago[Refactor][NfC] ReportLevel should be used as a bool not an int
Johannes Doerfert [Wed, 15 Oct 2014 23:24:28 +0000 (23:24 +0000)]
[Refactor][NfC] ReportLevel should be used as a bool not an int

llvm-svn: 219864

9 years agoFix unused-variable warnings from the clang static analyzer.
Jason Molenda [Wed, 15 Oct 2014 23:13:51 +0000 (23:13 +0000)]
Fix unused-variable warnings from the clang static analyzer.

llvm-svn: 219863

9 years agoUpdating documentation based on my change to remove the template disambiguation.
Chris Bieneman [Wed, 15 Oct 2014 23:11:40 +0000 (23:11 +0000)]
Updating documentation based on my change to remove the template disambiguation.

llvm-svn: 219862

9 years agoFixing the build failure due to compiler warnings and unnecessary disambiguation.
Chris Bieneman [Wed, 15 Oct 2014 23:11:35 +0000 (23:11 +0000)]
Fixing the build failure due to compiler warnings and unnecessary disambiguation.

llvm-svn: 219861

9 years ago[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's renam...
Kuba Brecka [Wed, 15 Oct 2014 22:47:54 +0000 (22:47 +0000)]
[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's rename it to append_list_if

Doing s/append_if/append_list_if/, no functional change.

http://reviews.llvm.org/D5739

llvm-svn: 219860

9 years agoCodeGen: Don't drop thread_local when emitting __thread aliases
David Majnemer [Wed, 15 Oct 2014 22:38:23 +0000 (22:38 +0000)]
CodeGen: Don't drop thread_local when emitting __thread aliases

CodeGen wouldn't mark the aliasee as thread_local if the aliasee was a
tentative definition.

Even if the definition was already emitted, it would never mark the
alias as thread_local.

This fixes PR21288.

llvm-svn: 219859

9 years agoMove SanitizerBlacklist object from CodeGenModule to ASTContext.
Alexey Samsonov [Wed, 15 Oct 2014 22:17:27 +0000 (22:17 +0000)]
Move SanitizerBlacklist object from CodeGenModule to ASTContext.

Soon we'll need to have access to blacklist before the CodeGen
phase (see http://reviews.llvm.org/D5687), so parse and construct
the blacklist earlier.

llvm-svn: 219857

9 years agoMechanical change to FastDemangle to make it closer to the lldb
Jason Molenda [Wed, 15 Oct 2014 22:11:15 +0000 (22:11 +0000)]
Mechanical change to FastDemangle to make it closer to the lldb
coding conventions.  Lots of whitespace et al changes but no
content changes.

llvm-svn: 219856

9 years agoAvoid having "using namespace" for both "clang" and "llvm" namespaces.
Alexey Samsonov [Wed, 15 Oct 2014 22:00:40 +0000 (22:00 +0000)]
Avoid having "using namespace" for both "clang" and "llvm" namespaces.
This is fragile, as there are classes with the same name in both
namespaces (e.g. llvm::Module and clang::Module).

llvm-svn: 219855

9 years agoDefining a new API for debug options that doesn't rely on static global cl::opts.
Chris Bieneman [Wed, 15 Oct 2014 21:54:35 +0000 (21:54 +0000)]
Defining a new API for debug options that doesn't rely on static global cl::opts.

Summary:
This is based on the discussions from the LLVMDev thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075886.html

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 219854

9 years agoThis should keep the non-Xcode-based builds happy
Enrico Granata [Wed, 15 Oct 2014 21:39:17 +0000 (21:39 +0000)]
This should keep the non-Xcode-based builds happy

llvm-svn: 219853

9 years agoAdd synthetic children support for NSIndexPath
Enrico Granata [Wed, 15 Oct 2014 21:38:32 +0000 (21:38 +0000)]
Add synthetic children support for NSIndexPath

llvm-svn: 219852

9 years agoSema: handle AttributedTypeLocs in C++14 auto deduction
Saleem Abdulrasool [Wed, 15 Oct 2014 21:37:55 +0000 (21:37 +0000)]
Sema: handle AttributedTypeLocs in C++14 auto deduction

When performing a type deduction from the return type, the FunctionDecl may be
attributed with a calling convention.  In such a case, the retrieved type
location may be an AttributedTypeLoc.  Performing a castAs<FunctionProtoTypeLoc>
on such a type loc would result in an assertion as they are not derived types.

Ensure that we correctly handle the attributed type location by looking through
it to the modified type loc.

Fixes an assertion triggered in C++14 mode.

llvm-svn: 219851

9 years agotest: simplify test further
Saleem Abdulrasool [Wed, 15 Oct 2014 21:37:52 +0000 (21:37 +0000)]
test: simplify test further

Remove the use of an unnecessary function.  NFC.

llvm-svn: 219850

9 years agoChange hasName() to take const std::string&, as it was taking before rL219792.
Samuel Benzaquen [Wed, 15 Oct 2014 21:23:31 +0000 (21:23 +0000)]
Change hasName() to take const std::string&, as it was taking before rL219792.

llvm-svn: 219849

9 years agoR600/SI: Fix bug where immediates were being used in DS addr operands
Tom Stellard [Wed, 15 Oct 2014 21:08:59 +0000 (21:08 +0000)]
R600/SI: Fix bug where immediates were being used in DS addr operands

The SelectDS1Addr1Offset complex pattern always tries to store constant
lds pointers in the offset operand and store a zero value in the addr operand.
Since the addr operand does not accept immediates, the zero value
needs to first be copied to a register.

This newly created zero value will not go through normal instruction
selection, so we need to manually insert a V_MOV_B32_e32 in the complex
pattern.

This bug was hidden by the fact that if there was another zero value
in the DAG that had not been selected yet, then the CSE done by the DAG
would use the unselected node for the addr operand rather than the one
that was just created.  This would lead to the zero value being selected
and the DAG automatically inserting a V_MOV_B32_e32 instruction.

llvm-svn: 219848

9 years agoAvoid caching the MachineFunction, we don't use it outside of
Eric Christopher [Wed, 15 Oct 2014 21:06:25 +0000 (21:06 +0000)]
Avoid caching the MachineFunction, we don't use it outside of
runOnMachineFunction.

llvm-svn: 219847

9 years agoWrong attribute. LLVM_ATTRIBUTE_UNUSED not LLVM_ATTRIBUTE_USED
Sid Manning [Wed, 15 Oct 2014 20:41:17 +0000 (20:41 +0000)]
Wrong attribute.  LLVM_ATTRIBUTE_UNUSED not LLVM_ATTRIBUTE_USED

This original fix for the build break was correct.  LLVM_ATTRIBUTE_USED
removes the warning message because it keeps the function in the object
file.  LLVM_ATTRIBUTE_UNUSED indicates that it may or may not be used
depending on build settings.

llvm-svn: 219846

9 years agoIR: Move NumOperands from User to Value, NFC
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 20:39:05 +0000 (20:39 +0000)]
IR: Move NumOperands from User to Value, NFC

Store `User::NumOperands` (and `MDNode::NumOperands`) in `Value`.

On 64-bit host architectures, this reduces `sizeof(User)` and all
subclasses by 8, and has no effect on `sizeof(Value)` (or, incidentally,
on `sizeof(MDNode)`).

On 32-bit host architectures, this increases `sizeof(Value)` by 4.
However, it has no effect on `sizeof(User)` and `sizeof(MDNode)`, so the
only concrete subclasses of `Value` that actually see the increase are
`BasicBlock`, `Argument`, `InlineAsm`, and `MDString`.  Moreover, I'll
be shocked and confused if this causes a tangible memory regression.

This has no functionality change (other than memory footprint).

llvm-svn: 219845

9 years agoIR: Cleanup comments for Value, User, and MDNode
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 20:28:31 +0000 (20:28 +0000)]
IR: Cleanup comments for Value, User, and MDNode

A follow-up commit will modify the memory-layout of `Value`, `User`, and
`MDNode`.  First fix the comments to be doxygen-friendly (and to follow
the coding standards).

  - Use "\brief" instead of "repeatedName -".
  - Add a brief intro where it was missing.
  - Remove duplicated comments from source files (and a couple of
    noisy/trivial comments altogether).

llvm-svn: 219844

9 years ago[mach-o] avoid overly clever std::find_if
Tim Northover [Wed, 15 Oct 2014 20:26:24 +0000 (20:26 +0000)]
[mach-o] avoid overly clever std::find_if

The bots were complaining (possibly because of a lack of traits on the iterator
I was trying to use). No functional change.

llvm-svn: 219843

9 years agoMove -fsanitize-blacklist to LangOpts from CodeGenOpts. NFC.
Alexey Samsonov [Wed, 15 Oct 2014 20:22:54 +0000 (20:22 +0000)]
Move -fsanitize-blacklist to LangOpts from CodeGenOpts. NFC.

After http://reviews.llvm.org/D5687 is submitted, we will need
SanitizerBlacklist before the CodeGen phase, so make it a LangOpt
(as it will actually affect ABI / class layout).

llvm-svn: 219842

9 years agoThe NSDate formatter should use GMT instead of the local timezone. Fixes rdar://13416848
Enrico Granata [Wed, 15 Oct 2014 20:18:58 +0000 (20:18 +0000)]
The NSDate formatter should use GMT instead of the local timezone. Fixes rdar://13416848

llvm-svn: 219841

9 years agoMove SanitizerBlacklist to clangBasic. NFC.
Alexey Samsonov [Wed, 15 Oct 2014 19:57:45 +0000 (19:57 +0000)]
Move SanitizerBlacklist to clangBasic. NFC.

This change moves SanitizerBlacklist.h from lib/CodeGen
to public Clang headers in include/clang/Basic. SanitizerBlacklist
is currently only used in CodeGen to decide which functions/modules
should be instrumented, but this will soon change as ASan will
optionally modify class layouts during AST construction
(http://reviews.llvm.org/D5687). We need blacklist machinery
to be available at this point.

llvm-svn: 219840

9 years agoAs requested by Matt Thomas, use long long for intmax_t and int64_t on
Joerg Sonnenberger [Wed, 15 Oct 2014 19:52:03 +0000 (19:52 +0000)]
As requested by Matt Thomas, use long long for intmax_t and int64_t on
PPC64/NetBSD.

llvm-svn: 219839

9 years agoSet ABI and DescriptionString first to reduce OS specific logic.
Joerg Sonnenberger [Wed, 15 Oct 2014 19:47:15 +0000 (19:47 +0000)]
Set ABI and DescriptionString first to reduce OS specific logic.
Use switch for FreeBSD check to allow easier extension.

llvm-svn: 219838

9 years agoWrong attribute. LLVM_ATTRIBUTE_USED not LLVM_ATTRIBUTE_UNUSED
Sid Manning [Wed, 15 Oct 2014 19:32:52 +0000 (19:32 +0000)]
Wrong attribute. LLVM_ATTRIBUTE_USED not LLVM_ATTRIBUTE_UNUSED

llvm-svn: 219837

9 years ago[mach-o] make __unwind_info defer to __eh_frame when necessary.
Tim Northover [Wed, 15 Oct 2014 19:32:21 +0000 (19:32 +0000)]
[mach-o] make __unwind_info defer to __eh_frame when necessary.

Not all situations are representable in the compressed __unwind_info format,
and when this happens the entry needs to point to the more general __eh_frame
description.

Just x86_64 implementation for now.

rdar://problem/18208653

llvm-svn: 219836

9 years agoAllow forward references to section symbols.
Rafael Espindola [Wed, 15 Oct 2014 19:30:18 +0000 (19:30 +0000)]
Allow forward references to section symbols.

llvm-svn: 219835

9 years agoTeach ScalarEvolution to sharpen range information.
Sanjoy Das [Wed, 15 Oct 2014 19:25:28 +0000 (19:25 +0000)]
Teach ScalarEvolution to sharpen range information.

If x is known to have the range [a, b) in a loop predicated by (icmp
ne x, a), its range can be sharpened to [a + 1, b).  Get
ScalarEvolution and hence IndVars to exploit this fact.

This change triggers an optimization to widen-loop-comp.ll, so it had
to be edited to get it to pass.

phabricator: http://reviews.llvm.org/D5639
llvm-svn: 219834

9 years agoAdd LLVM_ATTRIBUTE_UNUSED to function currently just used in an assert
Sid Manning [Wed, 15 Oct 2014 19:24:14 +0000 (19:24 +0000)]
Add LLVM_ATTRIBUTE_UNUSED to function currently just used in an assert

Fixes break when -Wunused-function is used.

llvm-svn: 219833

9 years agoInstCombine: Narrow switch instructions using known bits.
Akira Hatanaka [Wed, 15 Oct 2014 19:05:50 +0000 (19:05 +0000)]
InstCombine: Narrow switch instructions using known bits.

Truncate the operands of a switch instruction to a narrower type if the upper
bits are known to be all ones or zeros.

rdar://problem/17720004

llvm-svn: 219832

9 years agoReapply "[FastISel][AArch64] Add custom lowering for GEPs."
Juergen Ributzka [Wed, 15 Oct 2014 18:58:07 +0000 (18:58 +0000)]
Reapply "[FastISel][AArch64] Add custom lowering for GEPs."

This is mostly a copy of the existing FastISel GEP code, but we have to
duplicate it for AArch64, because otherwise we would bail out even for simple
cases. This is because the standard fastEmit functions don't cover MUL at all
and ADD is lowered very inefficientily.

The original commit had a bug in the add emit logic, which has been fixed.

llvm-svn: 219831

9 years ago[FastISel][AArch64] Factor out add with immediate emission into a helper function...
Juergen Ributzka [Wed, 15 Oct 2014 18:58:02 +0000 (18:58 +0000)]
[FastISel][AArch64] Factor out add with immediate emission into a helper function. NFC.

Simplify add with immediate emission by factoring it out into a helper function.

llvm-svn: 219830

9 years agoCorrectly handle references to section symbols.
Rafael Espindola [Wed, 15 Oct 2014 18:55:30 +0000 (18:55 +0000)]
Correctly handle references to section symbols.

When processing assembly like

.long .text

we were creating a new undefined symbol .text. GAS on the other hand would
handle that as a reference to the .text section.

This patch implements that by creating the section symbols earlier so that
they are visible during asm parsing.

The patch also updates llvm-readobj to print the symbol number in the relocation
dump so that the test can differentiate between two sections with the same name.

llvm-svn: 219829

9 years agoMake this test case more resilient in the face of line-table and inlining changes
Enrico Granata [Wed, 15 Oct 2014 18:42:45 +0000 (18:42 +0000)]
Make this test case more resilient in the face of line-table and inlining changes

llvm-svn: 219828

9 years ago[compiler-rt] Enable ASAN for powerpc64le-linux
Will Schmidt [Wed, 15 Oct 2014 18:34:04 +0000 (18:34 +0000)]
[compiler-rt] Enable ASAN for powerpc64le-linux

Whitespace update for lint check by myself (Will).  Otherwise code and comments by Peter Bergner, as previously seen on llvm-commits.

    The following patch gets ASAN somewhat working on powerpc64le-linux.
    It currently assumes the LE kernel uses 46-bit addressing, which is
    true, but it doesn't solve the case for BE where it may be 44 or
    46 bits.  That can be fixed with a follow on patch.

    There are some test suite fails even with this patch that I haven't had
    time to solve yet, but this is better than the state it is in now.
    The limited debugging of those test suite fails seems to show that the
    address map for 46-bit addressing has changed and so we'll need to
    modify the shadow memory location slightly.  Again, that can be fixed
    with a follow on patch.

llvm-svn: 219827

9 years agoEnable the instruction printer in HexagonMCTargetDesc
Sid Manning [Wed, 15 Oct 2014 18:27:40 +0000 (18:27 +0000)]
Enable the instruction printer in HexagonMCTargetDesc

This adds the MCInstPrinter to the LLVMHexagonDesc library and removes
the dependency LLVMHexagonAsmPrinter had on LLVMHexagonDesc. This is
a prerequisite needed by the disassembler.

Phabricator Revision: http://reviews.llvm.org/D5734

llvm-svn: 219826

9 years ago[CMake] Cleanup CMake rules after r219302. NFC.
Alexey Samsonov [Wed, 15 Oct 2014 18:23:57 +0000 (18:23 +0000)]
[CMake] Cleanup CMake rules after r219302. NFC.

llvm-svn: 219825

9 years ago[macho] Create references from __eh_frame FDEs to their function.
Tim Northover [Wed, 15 Oct 2014 18:19:31 +0000 (18:19 +0000)]
[macho] Create references from __eh_frame FDEs to their function.

We'll also need references back to the CIE eventually, but for now making sure
we can work out what an FDE is referring to is enough.

The actual kind of reference needs to be different between architectures,
probably because of MachO's chronic shortage of relocation types but I don't
really want to know in case I find out something that distresses me even more.

rdar://problem/18208653

llvm-svn: 219824

9 years agoR600/SI: Also try to use 0 base for misaligned 8-byte DS loads.
Matt Arsenault [Wed, 15 Oct 2014 18:06:43 +0000 (18:06 +0000)]
R600/SI: Also try to use 0 base for misaligned 8-byte DS loads.

llvm-svn: 219823

9 years ago[UBSan] [MIPS] Adding support of UBSan for mipsel arch
Alexey Samsonov [Wed, 15 Oct 2014 18:04:42 +0000 (18:04 +0000)]
[UBSan] [MIPS] Adding support of UBSan for mipsel arch

Summary:
Changed files:
config-ix.cmake: Added mipsel to UBSAN_SUPPORTED_ARCH

Reviewers: rsmith, kcc, dsanders, petarj, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, mohit.bhakkad, farazs, kumarsukhani

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

llvm-svn: 219822

9 years agoAllow ThreadLauncher::LaunchThread() to specify a minimum stack byte size when launch...
Greg Clayton [Wed, 15 Oct 2014 18:03:59 +0000 (18:03 +0000)]
Allow ThreadLauncher::LaunchThread() to specify a minimum stack byte size when launching threads.

This defaults to zero, which means to use the system default.

NOTE: Windows will need to implement this.

<rdar://problem/18644448>

llvm-svn: 219821

9 years agoAdd llvm_unreachable after switch to avoid warnings about a missing
Kaelyn Takata [Wed, 15 Oct 2014 18:03:26 +0000 (18:03 +0000)]
Add llvm_unreachable after switch to avoid warnings about a missing
return.

Forgot to add this in r219818.

llvm-svn: 219820

9 years agoR600: Fix miscompiles when BFE has multiple uses
Matt Arsenault [Wed, 15 Oct 2014 17:58:34 +0000 (17:58 +0000)]
R600: Fix miscompiles when BFE has multiple uses

SimplifyDemandedBits would break the other uses of the operand.

llvm-svn: 219819

9 years agoDrop unneccessary default case from switch introduced in r219809
Kaelyn Takata [Wed, 15 Oct 2014 17:46:18 +0000 (17:46 +0000)]
Drop unneccessary default case from switch introduced in r219809

This silences:
../tools/clang/tools/libclang/CIndex.cpp:6451:3: warning: default label
in switch which covers all enumeration values [-Wcovered-switch-default]

llvm-svn: 219818

9 years agocorrect const-ness with auto and dyn_cast
Sanjay Patel [Wed, 15 Oct 2014 17:45:13 +0000 (17:45 +0000)]
correct const-ness with auto and dyn_cast

1. Use const with autos.
2. Don't bother with explicit const in cast ops because they do it automagically.

Thanks, David B. / Aaron B. / Reid K.

llvm-svn: 219817