platform/upstream/llvm.git
10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 years ago[SLPVectorize] Basic ephemeral-value awareness
Hal Finkel [Wed, 15 Oct 2014 17:35:01 +0000 (17:35 +0000)]
[SLPVectorize] Basic ephemeral-value awareness

The SLP vectorizer should not vectorize ephemeral values. These are used to
express information to the optimizer, and vectorizing them does not lead to
faster code (because the ephemeral values are dropped prior to code generation,
vectorized or not), and obscures the information the instructions are
attempting to communicate (the logic that interprets the arguments to
@llvm.assume generically does not understand vectorized conditions).

Also, uses by ephemeral values are free (because they, and the necessary
extractelement instructions, will be dropped prior to code generation).

llvm-svn: 219816

10 years agoTreat the WorkSet used to find ephemeral values as double-ended
Hal Finkel [Wed, 15 Oct 2014 17:34:48 +0000 (17:34 +0000)]
Treat the WorkSet used to find ephemeral values as double-ended

We need to make sure that we visit all operands of an instruction before moving
deeper in the operand graph. We had been pushing operands onto the back of the work
set, and popping them off the back as well, meaning that we might visit an
instruction before visiting all of its uses that sit in between it and the call
to @llvm.assume.

To provide an explicit example, given the following:
  %q0 = extractelement <4 x float> %rd, i32 0
  %q1 = extractelement <4 x float> %rd, i32 1
  %q2 = extractelement <4 x float> %rd, i32 2
  %q3 = extractelement <4 x float> %rd, i32 3
  %q4 = fadd float %q0, %q1
  %q5 = fadd float %q2, %q3
  %q6 = fadd float %q4, %q5
  %qi = fcmp olt float %q6, %q5
  call void @llvm.assume(i1 %qi)

%q5 is used by both %qi and %q6. When we visit %qi, it will be marked as
ephemeral, and we'll queue %q6 and %q5. %q6 will be marked as ephemeral and
we'll queue %q4 and %q5. Under the old system, we'd then visit %q4, which
would become ephemeral, %q1 and then %q0, which would become ephemeral as
well, and now we have a problem. We'd visit %rd, but it would not be marked as
ephemeral because we've not yet visited %q2 and %q3 (because we've not yet
visited %q5).

This will be covered by a test case in a follow-up commit that enables
ephemeral-value awareness in the SLP vectorizer.

llvm-svn: 219815

10 years agoRemove some unnecessary headers from Host.cpp
Zachary Turner [Wed, 15 Oct 2014 17:27:11 +0000 (17:27 +0000)]
Remove some unnecessary headers from Host.cpp

After the recent migration of code out of Host.cpp, many
unnecessary headers were still being included.  This prunes the
include list down to only what is still necessary.

llvm-svn: 219814

10 years agoRevert "Fix late template parsing leak with incremental processing"
Reid Kleckner [Wed, 15 Oct 2014 17:22:56 +0000 (17:22 +0000)]
Revert "Fix late template parsing leak with incremental processing"

This reverts commit r219810.

The test suite appears broken.

llvm-svn: 219813

10 years ago[analyzer] Perl scripts are run differently from makefiles. Sometimes additional...
Anton Yartsev [Wed, 15 Oct 2014 17:13:02 +0000 (17:13 +0000)]
[analyzer] Perl scripts are run differently from makefiles. Sometimes additional utilities are involved, e.g. 'env' utility that present in MSYS but is missing in MinGW. The patch unifies launch of "c++-analyzer" and "ccc-analyzer".

llvm-svn: 219812

10 years ago[MC] Make bundle alignment mode setting idempotent and support nested bundles
Derek Schuff [Wed, 15 Oct 2014 17:10:04 +0000 (17:10 +0000)]
[MC] Make bundle alignment mode setting idempotent and support nested bundles

Summary:
Currently an error is thrown if bundle alignment mode is set more than once
per module (either via the API or the .bundle_align_mode directive). This
change allows setting it multiple times as long as the alignment doesn't
change.

Also nested bundle_lock groups are currently not allowed. This change allows
them, with the effect that the group stays open until all nests are exited,
and if any of the bundle_lock directives has the align_to_end flag, the
group becomes align_to_end.

These changes make the bundle aligment simpler to use in the compiler, and
also better match the corresponding support in GNU as.

Reviewers: jvoung, eliben

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

llvm-svn: 219811

10 years agoFix late template parsing leak with incremental processing
Reid Kleckner [Wed, 15 Oct 2014 17:08:33 +0000 (17:08 +0000)]
Fix late template parsing leak with incremental processing

Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing.  Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed.  Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.

Patch by Brad King!

llvm-svn: 219810

10 years ago[libclang] Add function to retrieve storage class in libclang.
Argyrios Kyrtzidis [Wed, 15 Oct 2014 17:05:31 +0000 (17:05 +0000)]
[libclang] Add function to retrieve storage class in libclang.

Patch by guibufolo!

llvm-svn: 219809

10 years agoDI: Make comments "brief"-er, NFC
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 17:01:28 +0000 (17:01 +0000)]
DI: Make comments "brief"-er, NFC

Follow-up to r219801.  Post-commit review pointed out that all comments
require a `\brief` description [1], so I converted many and recrafted a
few to be briefer or to include a brief intro.  (If I'm going to clean
them up, I should do it right!)

[1]: http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments

llvm-svn: 219808

10 years agoAdding attributes to the IndirectFieldDecl that we generate for anonymous struct...
Aaron Ballman [Wed, 15 Oct 2014 16:58:18 +0000 (16:58 +0000)]
Adding attributes to the IndirectFieldDecl that we generate for anonymous struct/union fields. This fixes PR20930.

llvm-svn: 219807

10 years agoDon't use a global_ctors comdat for globals that aren't externally visible
Reid Kleckner [Wed, 15 Oct 2014 16:38:00 +0000 (16:38 +0000)]
Don't use a global_ctors comdat for globals that aren't externally visible

In particular, if you have two identical templates in different TUs in
anonymous namespaces, we would use the same global_ctors comdat key for
both. As a result, only one would be run.

llvm-svn: 219806

10 years agoCodeGen: Cleanup CGRecordLowering::lowerUnion a little
David Majnemer [Wed, 15 Oct 2014 16:36:11 +0000 (16:36 +0000)]
CodeGen: Cleanup CGRecordLowering::lowerUnion a little

Remove some duplicated state, no functionality change intended.

llvm-svn: 219805

10 years agoUse 'auto' for easier reading; no functional change intended.
Sanjay Patel [Wed, 15 Oct 2014 16:21:37 +0000 (16:21 +0000)]
Use 'auto' for easier reading; no functional change intended.

llvm-svn: 219804

10 years agoremove function names from comments; NFC
Sanjay Patel [Wed, 15 Oct 2014 16:20:45 +0000 (16:20 +0000)]
remove function names from comments; NFC

llvm-svn: 219803

10 years agoFix for PR21254 - Assertion in comment parser
Dario Domizioli [Wed, 15 Oct 2014 16:18:20 +0000 (16:18 +0000)]
Fix for PR21254 - Assertion in comment parser

The size of the ID field in CommandInfo was narrow, leading to potential
wrap-around of command IDs, causing misinterpretation later on.
The patch does the following:
- It extends the ID bitfield from 8 to 20 bits.
- It provides a DRY definition of the number of bits for the field to
  avoid using literal numbers in different files.
- It introduces a new assertion that checks for the wrap-around.
- It adds the testcase from PR21254.

llvm-svn: 219802

10 years agoDI: Cleanup comments, NFC
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 16:15:15 +0000 (16:15 +0000)]
DI: Cleanup comments, NFC

A number of comment cleanups:

  - Remove duplicated function and class names from comments.

  - Remove duplicated comments from source file (some of which were
    out-of-sync).

  - Move any unduplicated comments from source file to header.

  - Remove some noisy comments entirely (e.g., a comment for
    `DIDescriptor::print()` saying "print descriptor" just gets in the
    way of reading the code).

llvm-svn: 219801

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 15 Oct 2014 16:12:57 +0000 (16:12 +0000)]
Update for llvm api change.

llvm-svn: 219800

10 years agoSimplify handling of --noexecstack by using getNonexecutableStackSection.
Rafael Espindola [Wed, 15 Oct 2014 16:12:52 +0000 (16:12 +0000)]
Simplify handling of --noexecstack by using getNonexecutableStackSection.

llvm-svn: 219799

10 years agoDI: Use a `DenseMap` instead of named metadata, NFC
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 16:11:41 +0000 (16:11 +0000)]
DI: Use a `DenseMap` instead of named metadata, NFC

Remove a strange round-trip through named metadata to assign preserved
local variables to their subprograms.

llvm-svn: 219798

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 15 Oct 2014 15:44:25 +0000 (15:44 +0000)]
Update for llvm api change.

llvm-svn: 219797

10 years agoMove getNonexecutableStackSection up to the base ELF class.
Rafael Espindola [Wed, 15 Oct 2014 15:44:16 +0000 (15:44 +0000)]
Move getNonexecutableStackSection up to the base ELF class.

The .note.GNU-stack section is not SystemZ/X86 specific.

llvm-svn: 219796

10 years agoTurned Sema::HandleDelayedAvailabilityCheck into a static function; NFC.
Aaron Ballman [Wed, 15 Oct 2014 15:37:51 +0000 (15:37 +0000)]
Turned Sema::HandleDelayedAvailabilityCheck into a static function; NFC.

Did a bit of drive-by reformatting as well since it required rearranging some other static functions in the file.

llvm-svn: 219795

10 years ago[analyzer] Handle 'mingw32-make' in the same way as 'make' and 'gmake'.
Anton Yartsev [Wed, 15 Oct 2014 15:11:45 +0000 (15:11 +0000)]
[analyzer] Handle 'mingw32-make' in the same way as 'make' and 'gmake'.

llvm-svn: 219794

10 years agor600: Use llvm intrinsic to read work dimension information
Jan Vesely [Wed, 15 Oct 2014 15:08:06 +0000 (15:08 +0000)]
r600: Use llvm intrinsic to read work dimension information

v2: Fix function declaration
    Add range metadata to r600 implementation
v3: change prefix to AMDGPU

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 219793

10 years agoSpeed up hasName() matcher.
Samuel Benzaquen [Wed, 15 Oct 2014 14:58:46 +0000 (14:58 +0000)]
Speed up hasName() matcher.

Summary:
Speed up hasName() matcher by skipping the expensive generation of the
fully qualified name unless we need it.
In the common case of matching an unqualified name, we don't need to
generate the full name. We might not even need to copy any string at
all.
This change speeds up our clang-tidy benchmark by ~10%

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 219792

10 years ago[Tsan] Fix the sunrpc.cc test to build on FreeBSD
Viktor Kutuzov [Wed, 15 Oct 2014 12:47:48 +0000 (12:47 +0000)]
[Tsan] Fix the sunrpc.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D5730

llvm-svn: 219791

10 years ago[Tsan] Make the mutex_robust tests Linux-specific
Viktor Kutuzov [Wed, 15 Oct 2014 12:43:04 +0000 (12:43 +0000)]
[Tsan] Make the mutex_robust tests Linux-specific
Differential Revision: http://reviews.llvm.org/D5729

llvm-svn: 219790

10 years agoFix llvm-header-guard check.
Alexander Kornienko [Wed, 15 Oct 2014 12:18:35 +0000 (12:18 +0000)]
Fix llvm-header-guard check.

Summary:
This patch makes the check work better for LLVM code:
  * always fix existing #endif comments
  * use one space before the comment (+allow customization for other styles)

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 219789

10 years agoReformatted code samples in the unit test. No functional changes.
Alexander Kornienko [Wed, 15 Oct 2014 11:36:48 +0000 (11:36 +0000)]
Reformatted code samples in the unit test. No functional changes.

llvm-svn: 219788

10 years agoFixed a comment. No functional changes.
Alexander Kornienko [Wed, 15 Oct 2014 11:03:39 +0000 (11:03 +0000)]
Fixed a comment. No functional changes.

llvm-svn: 219787

10 years ago[clang-tidy] Move some of the misc checks to readability/
Alexander Kornienko [Wed, 15 Oct 2014 10:51:57 +0000 (10:51 +0000)]
[clang-tidy] Move some of the misc checks to readability/

Summary:
Some of the misc checks belong to readability/. I'm moving them there
without changing check names for now. As the next step, I want to register some
of these checks in the google and llvm modules with suitable settings (e.g.
BracesAroundStatementsCheck). I'm not sure if we want to create a "readability"
module, probably not.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 219786

10 years agoFixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks to Louis...
Marshall Clow [Wed, 15 Oct 2014 10:33:02 +0000 (10:33 +0000)]
Fixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks to Louis Dionne for the bug report and the patch.

llvm-svn: 219785

10 years agotsan: fix false positive related to signals
Dmitry Vyukov [Wed, 15 Oct 2014 08:56:43 +0000 (08:56 +0000)]
tsan: fix false positive related to signals
Write interceptor calls malloc, which causes a false
unsafe-call-in-signal-handler report. See the test.

llvm-svn: 219784

10 years agotsan: use a different dir for llvm build
Dmitry Vyukov [Wed, 15 Oct 2014 08:56:15 +0000 (08:56 +0000)]
tsan: use a different dir for llvm build
build is used as gtest temp build dir, and is cleared during every build

llvm-svn: 219783

10 years agoImprove the handling of kalimba ELF file section type recognition.
Matthew Gardiner [Wed, 15 Oct 2014 08:21:54 +0000 (08:21 +0000)]
Improve the handling of kalimba ELF file section type recognition.

Recognise the SHT_NOBITS property in kalimba ELF, and determine this to be
of type zerofilled. Subsequently recognise this type to represent bytes
on the target's DATA address space, and therefore be sized accordingly.

llvm-svn: 219782

10 years agoCodeGen: Use the initing member's type for a union's storage type more often
David Majnemer [Wed, 15 Oct 2014 07:57:41 +0000 (07:57 +0000)]
CodeGen: Use the initing member's type for a union's storage type more often

Unions are initialized with the default initialization of their first
named member.  If that member is not zero initialized, then we should
prefer that member's type.  Otherwise, we might try to make an otherwise
unsuitable type (like an array) which we cannot easily initialize with a
pointer to member.

llvm-svn: 219781

10 years agoCodeGen: Fix a typo in a comment
David Majnemer [Wed, 15 Oct 2014 07:57:38 +0000 (07:57 +0000)]
CodeGen: Fix a typo in a comment

No functionality change intended.

llvm-svn: 219780

10 years agotsan: remove dead code
Dmitry Vyukov [Wed, 15 Oct 2014 05:38:49 +0000 (05:38 +0000)]
tsan: remove dead code

llvm-svn: 219779

10 years agoR600: Use existing variable
Matt Arsenault [Wed, 15 Oct 2014 05:07:00 +0000 (05:07 +0000)]
R600: Use existing variable

llvm-svn: 219778

10 years agoR600: Remove outdated comment
Matt Arsenault [Wed, 15 Oct 2014 05:06:57 +0000 (05:06 +0000)]
R600: Remove outdated comment

llvm-svn: 219777

10 years agoRevert "[FastISel][AArch64] Add custom lowering for GEPs."
Juergen Ributzka [Wed, 15 Oct 2014 04:55:48 +0000 (04:55 +0000)]
Revert "[FastISel][AArch64] Add custom lowering for GEPs."

This breaks our internal build bots. Reverting it to get the bots green again.

llvm-svn: 219776

10 years agoMS ABI: Use the correct this arg when generating implicit array copy ctor
David Majnemer [Wed, 15 Oct 2014 04:54:54 +0000 (04:54 +0000)]
MS ABI: Use the correct this arg when generating implicit array copy ctor

We assumed the last argument of the copy constructor was the this
pointer.  However, this is not the case under the MS ABI.

llvm-svn: 219775

10 years agoImprovements to -Wnull-conversion
Richard Trieu [Wed, 15 Oct 2014 03:42:06 +0000 (03:42 +0000)]
Improvements to -Wnull-conversion

Split logic to separate checking function
Refine the macro checking
Catch nullptr->bool conversions
Add some explanatory comments

llvm-svn: 219774

10 years ago[MachineSink] Use the real post dominator tree
Jingyue Wu [Wed, 15 Oct 2014 03:27:43 +0000 (03:27 +0000)]
[MachineSink] Use the real post dominator tree

Summary:
Fixes a FIXME in MachineSinking. Instead of using the simple heuristics in
isPostDominatedBy, use the real MachinePostDominatorTree and MachineLoopInfo.
The old heuristics caused instructions to sink unnecessarily, and might create
register pressure.

This is the second try of the fix. The first one (D4814) caused a performance
regression due to failing to sink instructions out of loops (PR21115). This
patch fixes PR21115 by sinking an instruction from a deeper loop to a shallower
one regardless of whether the target block post-dominates the source.

Thanks Alexey Volkov for reporting PR21115!

Test Plan:
Added a NVPTX codegen test to verify that our change prevents the backend from
over-sinking. It also shows the unnecessary register pressure caused by
over-sinking.

Added an X86 test to verify we can sink instructions out of loops regardless of
the dominance relationship. This test is reduced from Alexey's test in PR21115.

Updated an affected test in X86.

Also ran SPEC CINT2006 and llvm-test-suite for compilation time and runtime
performance. Results are attached separately in the review thread.

Reviewers: Jiangning, resistor, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, bruno, volkalexey, llvm-commits, meheff, eliben, jholewinski

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

llvm-svn: 219773

10 years agoBe more consistent about null checks for the Process and ABI
Jason Molenda [Wed, 15 Oct 2014 03:11:37 +0000 (03:11 +0000)]
Be more consistent about null checks for the Process and ABI
in GetFullUnwindPlanForFrame() - the code was mostly checking
that we had an active Process and ABI but not always.
clang static analyzer fixit.

llvm-svn: 219772

10 years agoMake sure local var cu is non-NULL before dereferencing.
Jason Molenda [Wed, 15 Oct 2014 03:07:39 +0000 (03:07 +0000)]
Make sure local var cu is non-NULL before dereferencing.
(it was checked for NULL-ness in some places, not in others)
clang static analyzer fixit.

llvm-svn: 219771

10 years agoRemove unneeded local var initialization.
Jason Molenda [Wed, 15 Oct 2014 03:06:23 +0000 (03:06 +0000)]
Remove unneeded local var initialization.
clang static analyzer fixit.

llvm-svn: 219770

10 years agoMake sure is_indirect local var is initialized; there
Jason Molenda [Wed, 15 Oct 2014 03:05:38 +0000 (03:05 +0000)]
Make sure is_indirect local var is initialized; there
exists a code path where it could be used while uninitialized.
clang static analyzer fixit.

llvm-svn: 219769

10 years agoEnsure that m_syntax is initialized in all the FileSpec
Jason Molenda [Wed, 15 Oct 2014 03:04:33 +0000 (03:04 +0000)]
Ensure that m_syntax is initialized in all the FileSpec
constructors.
clang static analyzer fixit.

llvm-svn: 219768

10 years agoARM: drop check for triple that's no longer used.
Tim Northover [Wed, 15 Oct 2014 01:05:01 +0000 (01:05 +0000)]
ARM: drop check for triple that's no longer used.

Early attempts to support AAPCS bare metal MachO targets based the decision on
the CPU being compiled for. This was not a particularly great idea and we've
got a better option now, but this check remained.

No functional change for any target we care about.

llvm-svn: 219767

10 years agoFrontend: Don't accept null DiagnosticsEngines when building ASTUnits
Justin Bogner [Wed, 15 Oct 2014 00:33:06 +0000 (00:33 +0000)]
Frontend: Don't accept null DiagnosticsEngines when building ASTUnits

The various ways to create an ASTUnit all take a refcounted pointer to
a diagnostics engine as an argument, and if it isn't pointing at
anything they initialize it. This is a pretty confusing API, and it
really makes more sense for the caller to initialize the thing since
they control the lifetime anyway.

This fixes the one caller that didn't bother initializing the pointer
and asserts that the argument is initialized.

llvm-svn: 219752

10 years agoRemove unused variable.
Eric Christopher [Wed, 15 Oct 2014 00:15:26 +0000 (00:15 +0000)]
Remove unused variable.

llvm-svn: 219751

10 years agoRemove unused variable.
Eric Christopher [Wed, 15 Oct 2014 00:09:07 +0000 (00:09 +0000)]
Remove unused variable.

llvm-svn: 219750