platform/upstream/llvm.git
10 years agoclang-format: [Java] Fix class declaration formatting.
Daniel Jasper [Mon, 3 Nov 2014 02:27:28 +0000 (02:27 +0000)]
clang-format: [Java] Fix class declaration formatting.

Before:
  @SomeAnnotation()
  abstract
      class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb implements cccccccccccc {
  }

After:
  @SomeAnnotation()
  abstract class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb
      implements cccccccccccc {
  }

llvm-svn: 221121

10 years agoUse ErrorOr for the ::create factory on instrumented and sample profilers.
Diego Novillo [Mon, 3 Nov 2014 00:51:45 +0000 (00:51 +0000)]
Use ErrorOr for the ::create factory on instrumented and sample profilers.

Summary:
As discussed in
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141027/242445.html,
the creation of reader and writer instances is better done using
ErrorOr. There are no functional changes, but several callers needed to
be adjusted.

Reviewers: bogner

Subscribers: llvm-commits

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

llvm-svn: 221120

10 years agoR600: Don't unnecessarily repeat the register class
Matt Arsenault [Sun, 2 Nov 2014 23:46:59 +0000 (23:46 +0000)]
R600: Don't unnecessarily repeat the register class

llvm-svn: 221119

10 years agoR600/SI: Use REG_SEQUENCE instead of INSERT_SUBREGs
Matt Arsenault [Sun, 2 Nov 2014 23:46:54 +0000 (23:46 +0000)]
R600/SI: Use REG_SEQUENCE instead of INSERT_SUBREGs

llvm-svn: 221118

10 years agoSupport REG_SEQUENCE in tablegen.
Matt Arsenault [Sun, 2 Nov 2014 23:46:51 +0000 (23:46 +0000)]
Support REG_SEQUENCE in tablegen.

The problem is mostly that variadic output instruction
aren't handled, so it is rejected for having an inconsistent
number of operands, and then the right number of operands
isn't emitted.

llvm-svn: 221117

10 years agoFix typo
Matt Arsenault [Sun, 2 Nov 2014 23:46:47 +0000 (23:46 +0000)]
Fix typo

llvm-svn: 221116

10 years agoFix missing C++ mode comment
Matt Arsenault [Sun, 2 Nov 2014 23:46:44 +0000 (23:46 +0000)]
Fix missing C++ mode comment

llvm-svn: 221115

10 years agoclang-format: Fix false positive in lambda detection.
Daniel Jasper [Sun, 2 Nov 2014 22:46:42 +0000 (22:46 +0000)]
clang-format: Fix false positive in lambda detection.

Before:
  delete [] a -> b;

After:
  delete[] a->b;

This fixes part of llvm.org/PR21419.

llvm-svn: 221114

10 years agoclang-format: [Java] Support enums without trailing semicolon.
Daniel Jasper [Sun, 2 Nov 2014 22:31:39 +0000 (22:31 +0000)]
clang-format: [Java] Support enums without trailing semicolon.

Before:
  class SomeClass {
    enum SomeThing { ABC, CDE } void f() {
    }
  }

After:
  class SomeClass {
    enum SomeThing { ABC, CDE }
    void f() {
    }
  }

This fixed llvm.org/PR21458.

llvm-svn: 221113

10 years agoclang-format: [Java] Don't break imports.
Daniel Jasper [Sun, 2 Nov 2014 22:13:03 +0000 (22:13 +0000)]
clang-format: [Java] Don't break imports.

This fixes llvm.org/PR21453.

llvm-svn: 221112

10 years agoFix the Makefile build by actually building ABI/SysV-ppc
Filipe Cabecinhas [Sun, 2 Nov 2014 22:03:15 +0000 (22:03 +0000)]
Fix the Makefile build by actually building ABI/SysV-ppc

llvm-svn: 221111

10 years agoclang-format: [Java] Add space between "synchronized" and "(".
Daniel Jasper [Sun, 2 Nov 2014 22:00:57 +0000 (22:00 +0000)]
clang-format: [Java] Add space between "synchronized" and "(".

Before:
  synchronized(mData) {
    // ...
  }

After:
  synchronized (mData) {
    // ...
  }

This fixes llvm.org/PR21455.

llvm-svn: 221110

10 years agoclang-format: [Java] Support generics with "?".
Daniel Jasper [Sun, 2 Nov 2014 21:52:57 +0000 (21:52 +0000)]
clang-format: [Java] Support generics with "?".

Before:
  @Override
  public Map < String,
          ? > getAll() {
    // ...
  }

After:
  @Override
  public Map<String, ?> getAll() {
    // ...
  }

This fixes llvm.org/PR21454.

llvm-svn: 221109

10 years agoclang-format: permit setting the path to clang in vimrc
Saleem Abdulrasool [Sun, 2 Nov 2014 21:27:59 +0000 (21:27 +0000)]
clang-format: permit setting the path to clang in vimrc

If g:clang_format_path is set in the vimrc, that path will take precedence over
the hard coded path (which is reliant on the PATH environment variable).  This
provides an easy mechanism for switching the selected clang-format binary during
development.

llvm-svn: 221108

10 years agodocs: remove double carriage-return
Saleem Abdulrasool [Sun, 2 Nov 2014 21:27:52 +0000 (21:27 +0000)]
docs: remove double carriage-return

The double carriage return would silence a warning due to a missing
.clang-format.  Permit the error to bubble through.

llvm-svn: 221107

10 years agoclang-format: [Java] Support try/catch/finally blocks.
Daniel Jasper [Sun, 2 Nov 2014 19:21:48 +0000 (19:21 +0000)]
clang-format: [Java] Support try/catch/finally blocks.

llvm-svn: 221104

10 years agoclang-format: [Java] Don't break after extends/implements.
Daniel Jasper [Sun, 2 Nov 2014 19:16:41 +0000 (19:16 +0000)]
clang-format: [Java] Don't break after extends/implements.

Before:
  abstract class SomeClass extends SomeOtherClass implements
      SomeInterface {}

After:
  abstract class SomeClass extends SomeOtherClass
      implements SomeInterface {}

llvm-svn: 221103

10 years agoRe-commit r221056 and others with fix, "[mips] Move F128 argument handling into MipsC...
Daniel Sanders [Sun, 2 Nov 2014 16:09:29 +0000 (16:09 +0000)]
Re-commit r221056 and others with fix, "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC."

sret arguments can never originate from an f128 argument so we detect
sret arguments and push false into OriginalArgWasF128.

llvm-svn: 221102

10 years agoMark string_view::to_string as const. Fixes PR21428
Marshall Clow [Sun, 2 Nov 2014 15:35:32 +0000 (15:35 +0000)]
Mark string_view::to_string as const. Fixes PR21428

llvm-svn: 221101

10 years ago[PowerPC] Change PPCTargetInfo::hasFeature() to use StringSwitch
Bill Schmidt [Sun, 2 Nov 2014 14:56:41 +0000 (14:56 +0000)]
[PowerPC] Change PPCTargetInfo::hasFeature() to use StringSwitch

Implement post-commit comment on r220989 from Eric Christopher.

llvm-svn: 221099

10 years agoRevert r221096 bringing back r221014 with a fix.
Rafael Espindola [Sun, 2 Nov 2014 13:28:57 +0000 (13:28 +0000)]
Revert r221096 bringing back r221014 with a fix.

The issue was that linkAppendingVarProto does the full linking job, including
deleting the old dst variable. The fix is just to call it and return early
if we have a GV with appending linkage.

original message:

    Refactor duplicated code in liking GlobalValues.

    There is quiet a bit of logic that is common to any GlobalValue but was
    duplicated for Functions, GlobalVariables and GlobalAliases.

    While at it, merge visibility even when comdats are used, fixing pr21415.

llvm-svn: 221098

10 years ago[cmake] Pass -O3 when linking.
Rafael Espindola [Sun, 2 Nov 2014 12:14:22 +0000 (12:14 +0000)]
[cmake] Pass -O3 when linking.

Gold and bfd ld enable misc optimizations. lld ignores the option for now.

llvm-svn: 221097

10 years agoRevert r221014: "Refactor duplicated code in liking GlobalValues."
Chandler Carruth [Sun, 2 Nov 2014 09:10:31 +0000 (09:10 +0000)]
Revert r221014: "Refactor duplicated code in liking GlobalValues."

This commit introduces heap-use-after-free detected by ASan. Here is the output
for one of several tests that detect it:

******************** TEST 'LLVM :: Linker/AppendingLinkage.ll' FAILED ********************
Command Output (stderr):
--
=================================================================
==2122==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c00000b9c8 at pc 0x0000005d05d1 bp 0x7fff64ed27c0 sp 0x7fff64ed27b8
READ of size 4 at 0x60c00000b9c8 thread T0
    #0 0x5d05d0 in llvm::GlobalValue::setUnnamedAddr(bool) /usr/local/google/home/chandlerc/src/llvm/build/../include/llvm/IR/GlobalValue.h:115:35
    #1 0x69fff1 in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1041:5
    #2 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9
    #3 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10
    #4 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9
    #5 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
    #6 0x41eb71 in _start (/usr/local/google/home/chandlerc/src/llvm/build/bin/llvm-link+0x41eb71)

0x60c00000b9c8 is located 72 bytes inside of 128-byte region [0x60c00000b980,0x60c00000ba00)
freed by thread T0 here:
    #0 0x4a1e6b in operator delete(void*) /usr/local/google/home/chandlerc/src/llvm/opt-build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:94:3
    #1 0x5d1a7a in llvm::iplist<llvm::GlobalVariable, llvm::ilist_traits<llvm::GlobalVariable> >::erase(llvm::ilist_iterator<llvm::GlobalVariable>) /usr/local/google/home/chandlerc/src/llvm/build/../inclu
de/llvm/ADT/ilist.h:466:5
    #2 0x5d1980 in llvm::GlobalVariable::eraseFromParent() /usr/local/google/home/chandlerc/src/llvm/build/../lib/IR/Globals.cpp:204:3
    #3 0x6a8a4d in (anonymous namespace)::ModuleLinker::linkAppendingVarProto(llvm::GlobalVariable*, llvm::GlobalVariable const*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.
cpp:980:3
    #4 0x6a7403 in (anonymous namespace)::ModuleLinker::linkGlobalVariableProto(llvm::GlobalVariable const*, llvm::GlobalValue*, bool) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkMod
ules.cpp:1074:11
    #5 0x69ff4e in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1028:13
    #6 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9
    #7 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10
    #8 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9
    #9 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

previously allocated by thread T0 here:
    #0 0x4a192b in operator new(unsigned long) /usr/local/google/home/chandlerc/src/llvm/opt-build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:62:35
    #1 0x61d85c in llvm::User::operator new(unsigned long, unsigned int) /usr/local/google/home/chandlerc/src/llvm/build/../lib/IR/User.cpp:57:19
    #2 0x6a7525 in (anonymous namespace)::ModuleLinker::linkGlobalVariableProto(llvm::GlobalVariable const*, llvm::GlobalValue*, bool) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkMod
ules.cpp:1100:3
    #3 0x69ff4e in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1028:13
    #4 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9
    #5 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10
    #6 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9
    #7 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: heap-use-after-free /usr/local/google/home/chandlerc/src/llvm/build/../include/llvm/IR/GlobalValue.h:115 llvm::GlobalValue::setUnnamedAddr(bool)
Shadow bytes around the buggy address:
  0x0c187fff96e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c187fff96f0: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa
  0x0c187fff9700: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c187fff9710: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c187fff9720: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
=>0x0c187fff9730: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd
  0x0c187fff9740: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c187fff9750: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
  0x0c187fff9760: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c187fff9770: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c187fff9780: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  ASan internal:           fe
==2122==ABORTING

llvm-svn: 221096

10 years agoFormatting
David Blaikie [Sun, 2 Nov 2014 08:52:37 +0000 (08:52 +0000)]
Formatting

llvm-svn: 221095

10 years agoAdd DwarfUnit::isDwoUnit and use it to generalize string creation
David Blaikie [Sun, 2 Nov 2014 08:51:37 +0000 (08:51 +0000)]
Add DwarfUnit::isDwoUnit and use it to generalize string creation

Currently we only need to emit skeleton strings into the CU header and
we do this by explicitly calling "addLocalString". With gmlt-in-fission,
we'll be emitting a bunch of other strings from other codepaths where
it's not statically known that these strings will be local or not.

Introduce a virtual function to indicate whether this unit is a DWO unit
or not (I'm not sure if we have a good term for this, the
opposite/alternative to 'skeleton' unit) and use that to generalize the
string emission logic so that strings can be correctly emitted in both
the skeleton and dwo unit when in split dwarf mode.

And to demonstrate that this works, switch the existing special callers
of addLocalString in the skeleton builder to addString - and they still
work. Yay.

llvm-svn: 221094

10 years agoRemove the last mention of LineTablesOnly from DwarfUnit, sinking it into DwarfCompil...
David Blaikie [Sun, 2 Nov 2014 08:18:06 +0000 (08:18 +0000)]
Remove the last mention of LineTablesOnly from DwarfUnit, sinking it into DwarfCompileUnit

This is a useful distinction/invariant/delination to make because
LineTablesOnly mode is never relevant to type units, so it's clear that
we're not doing weird line-tables-only-with-types by making this API
choice.

It also lays the foundations nicely for adding gmlt-like data to fission
skeleton CUs while limiting the effects to CUs and not TUs.

llvm-svn: 221093

10 years agoSink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 08:09:09 +0000 (08:09 +0000)]
Sink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit

llvm-svn: 221092

10 years agoUse Alias Analysis to hoist 2 loads from diamond to the common predecessor basic...
Elena Demikhovsky [Sun, 2 Nov 2014 08:03:05 +0000 (08:03 +0000)]
Use Alias Analysis to hoist 2 loads from diamond to the common predecessor basic block.
Alias Analysis allows to detect real barriers for load hoisting.

Review in http://reviews.llvm.org/D5991

llvm-svn: 221091

10 years agoSink DwarfUnit::addExpr into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 07:11:55 +0000 (07:11 +0000)]
Sink DwarfUnit::addExpr into DwarfCompileUnit

llvm-svn: 221090

10 years agoFix the build from the last commit
David Blaikie [Sun, 2 Nov 2014 07:08:12 +0000 (07:08 +0000)]
Fix the build from the last commit

llvm-svn: 221089

10 years agoSink DwarfUnit::applyVariableAttributes into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 07:06:51 +0000 (07:06 +0000)]
Sink DwarfUnit::applyVariableAttributes into DwarfCompileUnit

llvm-svn: 221088

10 years agoSink DwarfUnit::addLocationList down into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 07:03:19 +0000 (07:03 +0000)]
Sink DwarfUnit::addLocationList down into DwarfCompileUnit

llvm-svn: 221087

10 years agoSink DwarfUnit::addComplexAddress down into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 06:58:44 +0000 (06:58 +0000)]
Sink DwarfUnit::addComplexAddress down into DwarfCompileUnit

llvm-svn: 221086

10 years agoPush DwarfUnit::addAddress down into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 06:46:40 +0000 (06:46 +0000)]
Push DwarfUnit::addAddress down into DwarfCompileUnit

llvm-svn: 221085

10 years agoSink DwarfUnit::addVariableAddress into DwarfCompileUnit since type units don't have...
David Blaikie [Sun, 2 Nov 2014 06:37:23 +0000 (06:37 +0000)]
Sink DwarfUnit::addVariableAddress into DwarfCompileUnit since type units don't have variables

llvm-svn: 221084

10 years agoDebugInfo: Sink accelerator table lists down (GlobalNames/Types) into DwarfCompileUnit
David Blaikie [Sun, 2 Nov 2014 06:16:39 +0000 (06:16 +0000)]
DebugInfo: Sink accelerator table lists down (GlobalNames/Types) into DwarfCompileUnit

llvm-svn: 221083

10 years agoAdd DwarfUnit::addGlobalType to match DwarfUnit::addGlobalName
David Blaikie [Sun, 2 Nov 2014 06:06:14 +0000 (06:06 +0000)]
Add DwarfUnit::addGlobalType to match DwarfUnit::addGlobalName

(these will shortly become virtual, with a null implementation in
DwarfUnit (since type units don't have accelerator tables in the current
schema) and the current implementation down in DwarfCompileUnit, moving
the actual maps there too)

llvm-svn: 221082

10 years agoRevert r221056 and others, "[mips] Move F128 argument handling into MipsCCState as...
NAKAMURA Takumi [Sun, 2 Nov 2014 04:43:54 +0000 (04:43 +0000)]
Revert r221056 and others, "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC."

  r221056 "[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC."
  r221058 "[mips] Fix unused variable warning introduced in r221056"
  r221059 "[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC."
  r221061 "Renamed CCState members that appear to misspell 'Processed' as 'Proceed'. NFC."

It cuased an undefined behavior in LLVM :: CodeGen/Mips/return-vector.ll.

llvm-svn: 221081

10 years agoDebugInfo: Refactor index type DIE initialization by rolling it into the accessor
David Blaikie [Sun, 2 Nov 2014 03:09:13 +0000 (03:09 +0000)]
DebugInfo: Refactor index type DIE initialization by rolling it into the accessor

llvm-svn: 221080

10 years agoBe sure to initialize DwarfCompileUnit::LabelBegin now that it may be skipped in...
David Blaikie [Sun, 2 Nov 2014 02:40:26 +0000 (02:40 +0000)]
Be sure to initialize DwarfCompileUnit::LabelBegin now that it may be skipped in initSection

llvm-svn: 221079

10 years agoDon't bother creating LabelBegin for .dwo units
David Blaikie [Sun, 2 Nov 2014 02:26:24 +0000 (02:26 +0000)]
Don't bother creating LabelBegin for .dwo units

This would help catch cases where we might otherwise try to reference a
dwo CU label, which would be weird - because without relocations in the
dwo file it's not generally meaningful to talk about the CU offsets
there (or, if it is, we can do so in absolute terms without using a
relocation to compute it).

llvm-svn: 221078

10 years agoDocs: update va_arg example with valid x86_64 va_list type.
Tim Northover [Sun, 2 Nov 2014 01:21:51 +0000 (01:21 +0000)]
Docs: update va_arg example with valid x86_64 va_list type.

The given example was overflowing its alloca and segfaulting if actually run on
x86, so it's a good idea to provide something that works there too.

Patch by Ramkumar Ramachandra.

llvm-svn: 221077

10 years agoDrop DwarfCompileUnit::getLocalLabel* in favor of just mapping through the skeleton...
David Blaikie [Sun, 2 Nov 2014 01:21:43 +0000 (01:21 +0000)]
Drop DwarfCompileUnit::getLocalLabel* in favor of just mapping through the skeleton explicitly.

Confusing to do this two different ways - I'm not too wedded to either
one, but here goes.

llvm-svn: 221076

10 years agoSink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place...
David Blaikie [Sun, 2 Nov 2014 01:21:40 +0000 (01:21 +0000)]
Sink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place it's needed.

llvm-svn: 221075

10 years agoUpdate test to use llvm-readobj. NFC.
Rafael Espindola [Sun, 2 Nov 2014 01:12:02 +0000 (01:12 +0000)]
Update test to use llvm-readobj. NFC.

llvm-svn: 221074

10 years agoUpdate for LLVM API change in r221024
Ed Maste [Sun, 2 Nov 2014 00:24:22 +0000 (00:24 +0000)]
Update for LLVM API change in r221024

llvm-svn: 221073

10 years agoSink dwarf unit length emission down into DwarfUnit::emitHeader
David Blaikie [Sat, 1 Nov 2014 23:59:23 +0000 (23:59 +0000)]
Sink dwarf unit length emission down into DwarfUnit::emitHeader

This allows the CU label to be emitted only for compile units, as
they're the only ones that need it (so they can be referenced from
pubnames)

llvm-svn: 221072

10 years agoTest 221067 in a fixed-target test so as not to fail on targets with different DWARF...
David Blaikie [Sat, 1 Nov 2014 23:50:59 +0000 (23:50 +0000)]
Test 221067 in a fixed-target test so as not to fail on targets with different DWARF encodings

llvm-svn: 221071

10 years agoFix the build of the gold plugin.
Rafael Espindola [Sat, 1 Nov 2014 23:49:44 +0000 (23:49 +0000)]
Fix the build of the gold plugin.

I did the previous patch on OS X and didn't noticed the issue.

llvm-svn: 221070

10 years agoInstCombine: Don't assume that m_ZExt matches an Instruction
David Majnemer [Sat, 1 Nov 2014 23:46:05 +0000 (23:46 +0000)]
InstCombine: Don't assume that m_ZExt matches an Instruction

m_ZExt might bind against a ConstantExpr instead of an Instruction.
Assuming this, using cast<Instruction>, results in InstCombine crashing.

Instead, introduce ZExtOperator to bridge both Instruction and
ConstantExpr ZExts.

This fixes PR21445.

llvm-svn: 221069

10 years agoRemove test coverage added in 221067 due to it being non-portable.
David Blaikie [Sat, 1 Nov 2014 23:42:30 +0000 (23:42 +0000)]
Remove test coverage added in 221067 due to it being non-portable.

Will try to find a portable way to test this (or a fixed-target test I
can add such coverage to) shortly.

llvm-svn: 221068

10 years agoRemove DwarfUnit::LabelEnd in favor of computing the length of the section directly
David Blaikie [Sat, 1 Nov 2014 23:07:14 +0000 (23:07 +0000)]
Remove DwarfUnit::LabelEnd in favor of computing the length of the section directly

This was a compile-unit specific label (unused in type units) and seems
unnecessary anyway when we can more easily directly compute the size of
the compile unit.

llvm-svn: 221067

10 years agoAdd _lzcnt_u32 and _lzcnt_u64 to lzcntintrin.h to match Intel documentation names...
Craig Topper [Sat, 1 Nov 2014 22:50:57 +0000 (22:50 +0000)]
Add _lzcnt_u32 and _lzcnt_u64 to lzcntintrin.h to match Intel documentation names for these intrinsics.

llvm-svn: 221066

10 years agoAvoid undefined behavior in the x86 bmi header file by explicitly checking for 0...
Craig Topper [Sat, 1 Nov 2014 22:50:54 +0000 (22:50 +0000)]
Avoid undefined behavior in the x86 bmi header file by explicitly checking for 0 before calling __builtin_ctz. Without this the optimizers may take advantage of the undefined behavior and produce incorrect results. LLVM itself still needs to be taught to merge the zero check into the llvm.cttz with defined zero behavior.

llvm-svn: 221065

10 years agoAvoid undefined behavior in the x86 lzcnt header file by explicitly checking for...
Craig Topper [Sat, 1 Nov 2014 22:25:23 +0000 (22:25 +0000)]
Avoid undefined behavior in the x86 lzcnt header file by explicitly checking for 0 before calling __builtin_clz. Without this the optimizers may take advantage of the undefined behavior and produce incorrect results. LLVM itself still needs to be taught to merge the zero check into the llvm.ctlz with defined zero behavior.

llvm-svn: 221064

10 years agoUse kern.proc.auxv to get the aux data
Justin Hibbits [Sat, 1 Nov 2014 21:27:08 +0000 (21:27 +0000)]
Use kern.proc.auxv to get the aux data

Summary:
Instead of using a homegrown solution to get the auxv from a process, instead
use the OS-provided sysctl to get the needed data.  This allows the same code to
be used for both 32-bit and 64-bit processes on a 64-bit host.

Reviewers: emaste

Reviewed By: emaste

Subscribers: emaste, lldb-commits

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

llvm-svn: 221063

10 years agoSink DwarfUnit::SectionSym into DwarfCompileUnit as it's only needed/used there.
David Blaikie [Sat, 1 Nov 2014 20:06:28 +0000 (20:06 +0000)]
Sink DwarfUnit::SectionSym into DwarfCompileUnit as it's only needed/used there.

llvm-svn: 221062

10 years agoRenamed CCState members that appear to misspell 'Processed' as 'Proceed'. NFC.
Daniel Sanders [Sat, 1 Nov 2014 19:32:23 +0000 (19:32 +0000)]
Renamed CCState members that appear to misspell 'Processed' as 'Proceed'. NFC.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

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

llvm-svn: 221061

10 years agoMake DwarfCompileUnit::Skeleton more narrowly typed (DwarfCompileUnit* instead of...
David Blaikie [Sat, 1 Nov 2014 19:26:05 +0000 (19:26 +0000)]
Make DwarfCompileUnit::Skeleton more narrowly typed (DwarfCompileUnit* instead of DwarfUnit*) now that it's specific to DwarfCompileUnit anyway.

llvm-svn: 221060

10 years ago[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC.
Daniel Sanders [Sat, 1 Nov 2014 19:17:10 +0000 (19:17 +0000)]
[mips] Move all ByVal handling into CCState and tablegen-erated code. NFC.

Summary:
CCState already contains a byval implementation that is very similar to the
Mips custom code. This patch merges the custom code into the existing
common code and tablegen-erated code.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: rnk, llvm-commits

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

llvm-svn: 221059

10 years ago[mips] Fix unused variable warning introduced in r221056
Daniel Sanders [Sat, 1 Nov 2014 18:53:01 +0000 (18:53 +0000)]
[mips] Fix unused variable warning introduced in r221056

llvm-svn: 221058

10 years ago[mips] Remove ByValArgInfo::Address in favour of CCValAssign::getMemLocOffset()....
Daniel Sanders [Sat, 1 Nov 2014 18:44:56 +0000 (18:44 +0000)]
[mips] Remove ByValArgInfo::Address in favour of CCValAssign::getMemLocOffset(). NFC.

Summary: ByValArgInfo is practically the same as CCState::ByValInfo now.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221057

10 years ago[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC.
Daniel Sanders [Sat, 1 Nov 2014 18:38:03 +0000 (18:38 +0000)]
[mips] Move F128 argument handling into MipsCCState as we did for returns. NFC.

Summary:
There are a couple more changes to make before analyzeFormalArguments can
be merged into the standard AnalyzeFormalArguments. I've had to temporarily
poke a couple holes in MipsCCState's encapsulation to save having to make
all the required changes for this merge all at once*. These will be removed
shortly.

* We must merge our ByVal argument handling with the implementation in CCState.
  This will be done over the next three patches, then the fourth will merge
  analyzeFormalArguments with AnalyzeFormalArguments.

Depends on D5967

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221056

10 years agoSink DwarfUnit::Skeleton down into DwarfCompileUnit
David Blaikie [Sat, 1 Nov 2014 18:18:07 +0000 (18:18 +0000)]
Sink DwarfUnit::Skeleton down into DwarfCompileUnit

Type units no longer have skeletons and it's misleading to be able to
query for a type unit's skeleton (it might incorrectly lead one to
conclude that if a unit doesn't have a skeleton it's not in a .dwo
file... ).

llvm-svn: 221055

10 years ago[mips] Remove MipsCC::CCInfo. NFC.
Daniel Sanders [Sat, 1 Nov 2014 18:13:52 +0000 (18:13 +0000)]
[mips] Remove MipsCC::CCInfo. NFC.

Summary:
It's now passed in as an argument to functions that need it. Eventually
this argument will be replaced by the 'this' pointer for a MipsCCState
object.

Depends on D5966

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221054

10 years ago[mips] Removed MipsCC::fixedArgFn(). NFC
Daniel Sanders [Sat, 1 Nov 2014 17:44:51 +0000 (17:44 +0000)]
[mips] Removed MipsCC::fixedArgFn(). NFC

Summary:
There is one remaining trace of it in MipsCC::analyzeCallOperands() where
Mips16 might override the calling convention. This will moved into
tablegen-erated code later.

Depends on D5965

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 221053

10 years ago[tablegen] Add CustomCallingConv and use it to tablegen-erate the outermost parts...
Daniel Sanders [Sat, 1 Nov 2014 17:38:22 +0000 (17:38 +0000)]
[tablegen] Add CustomCallingConv and use it to tablegen-erate the outermost parts of the Mips O32 implementation

Summary:
CustomCallingConv is simply a CallingConv that tablegen should not generate the
implementation for. It allows regular CallingConv's to delegate to these custom
functions. This is (currently) necessary for Mips and we cannot use CCCustom
without having to adapt to the different API that CCCustom uses.

This brings us a bit closer to being able to remove
MipsCC::analyzeCallOperands and MipsCC::analyzeFormalArguments in favour of
the common implementation.

No functional change to the targets.

Depends on D3341

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: vmedic, llvm-commits

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

llvm-svn: 221052

10 years agoSink DwarfDebug::AbstractSPDies down into DwarfFile
David Blaikie [Sat, 1 Nov 2014 17:21:26 +0000 (17:21 +0000)]
Sink DwarfDebug::AbstractSPDies down into DwarfFile

This is the first big step to allowing gmlt-like inline scope
information in the skeleton CU. While this commit doesn't change the
functionality, it's only a small step to call
"constructAbstractSubprogramDIE" on both the InfoHolder and the
SkeletonHolder (when in use) and that will at least create the abstract
SP dies in that case, though still not creating the other subprograms.

llvm-svn: 221051

10 years agoRemove redundant calls to isMaterializable.
Rafael Espindola [Sat, 1 Nov 2014 16:46:18 +0000 (16:46 +0000)]
Remove redundant calls to isMaterializable.

This removes calls to isMaterializable in the following cases:

* It was redundant with a call to isDeclaration now that isDeclaration returns
  the correct answer for materializable functions.
* It was followed by a call to Materialize. Just call Materialize and check EC.

llvm-svn: 221050

10 years agoRevert r221048 - Test commit
Daniel Sanders [Sat, 1 Nov 2014 16:08:03 +0000 (16:08 +0000)]
Revert r221048 - Test commit

It seems I can't commit unless $DBUS_SESSION_BUS_ADDRESS is set correctly and
it is not set for ssh sessions.

llvm-svn: 221049

10 years agoTest commit
Daniel Sanders [Sat, 1 Nov 2014 16:00:40 +0000 (16:00 +0000)]
Test commit

Added some whitespace to debug some authentication issues I'm having.

llvm-svn: 221048

10 years ago[JIT] Fix some more missing endian conversions in RuntimeDyld
Daniel Sanders [Sat, 1 Nov 2014 15:52:31 +0000 (15:52 +0000)]
[JIT] Fix some more missing endian conversions in RuntimeDyld

Summary: This fixes MachO_i386_eh_frame.s on a big-endian Mips host.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

llvm-svn: 221047

10 years ago[CMake] llvm-profdata requires Core.
NAKAMURA Takumi [Sat, 1 Nov 2014 11:46:04 +0000 (11:46 +0000)]
[CMake] llvm-profdata requires Core.

llvm-svn: 221046

10 years agoInstCombine: Combine (X+cst) < 0 --> X < -cst
David Majnemer [Sat, 1 Nov 2014 09:09:51 +0000 (09:09 +0000)]
InstCombine: Combine (X+cst) < 0 --> X < -cst

This can happen pretty often in code that looks like:
int foo = bar - 1;
if (foo < 0)
  do stuff

In this case, bar < 1 is an equivalent condition.

This transform requires that the add instruction be annotated with nsw.

llvm-svn: 221045

10 years agoIR: Restore the old behavior of getDISubprogram
David Majnemer [Sat, 1 Nov 2014 07:57:14 +0000 (07:57 +0000)]
IR: Restore the old behavior of getDISubprogram

getDISubprogram was mistakenly thought to contain a bug: we thought we
might need to try harder if we found a DebugLoc we didn't find.

llvm-svn: 221044

10 years agoCodeGen: Declutter the emitVirtualObjectDelete interface
David Majnemer [Sat, 1 Nov 2014 07:37:17 +0000 (07:37 +0000)]
CodeGen: Declutter the emitVirtualObjectDelete interface

No functionality change intended.

llvm-svn: 221043

10 years agoCodeGen: Virtual dtor thunks shouldn't have this marked as 'returned'
David Majnemer [Sat, 1 Nov 2014 05:42:23 +0000 (05:42 +0000)]
CodeGen: Virtual dtor thunks shouldn't have this marked as 'returned'

The ARM ABI virtual destructor thunks cannot be marked as 'returned'
because they return undef.

llvm-svn: 221042

10 years agoRevert "Temporarily revert r220777 to sort out build bot breakage."
Adrian Prantl [Sat, 1 Nov 2014 03:19:45 +0000 (03:19 +0000)]
Revert "Temporarily revert r220777 to sort out build bot breakage."

This reverts commit r221028. Later commits depend on this and
reverting just this one causes even more bots to fail.

llvm-svn: 221041

10 years agoRevert r220779, "[AVX512] Removed special case for cmp instructions in getVectorMaski...
NAKAMURA Takumi [Sat, 1 Nov 2014 01:36:14 +0000 (01:36 +0000)]
Revert r220779, "[AVX512] Removed special case for cmp instructions in getVectorMaskingNode. Now cmp intrinsics lower as other intrinsics through VSELECT, and then VSELECT tranforms to AND in PerformSELECTCombine."

Since r221028 (reverting r220777), this caused failures.

llvm-svn: 221040

10 years agoclang/lib/CodeGen/TargetInfo.cpp: Fix a couple of warnings. [-Winconsistent-missing...
NAKAMURA Takumi [Sat, 1 Nov 2014 01:32:27 +0000 (01:32 +0000)]
clang/lib/CodeGen/TargetInfo.cpp: Fix a couple of warnings. [-Winconsistent-missing-override]

llvm-svn: 221039

10 years ago[FIX] Move the statistic code to fix the build.
Johannes Doerfert [Sat, 1 Nov 2014 01:30:11 +0000 (01:30 +0000)]
[FIX] Move the statistic code to fix the build.

llvm-svn: 221038

10 years agoRemove unused function
David Blaikie [Sat, 1 Nov 2014 01:15:26 +0000 (01:15 +0000)]
Remove unused function

llvm-svn: 221037

10 years agoAnd... fix the build some more.
David Blaikie [Sat, 1 Nov 2014 01:15:24 +0000 (01:15 +0000)]
And... fix the build some more.

llvm-svn: 221036

10 years agoRemove the LoopBounds from the TempScop class.
Johannes Doerfert [Sat, 1 Nov 2014 01:14:56 +0000 (01:14 +0000)]
Remove the LoopBounds from the TempScop class.

  We will use ScalarEvolution in the ScopInfo.cpp to get the loop trip
  count, not cache it in the TempScop object.

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

llvm-svn: 221035

10 years agoJust iterate the DwarfCompileUnits rather than trying to filter them out of the list...
David Blaikie [Sat, 1 Nov 2014 01:11:19 +0000 (01:11 +0000)]
Just iterate the DwarfCompileUnits rather than trying to filter them out of the list of all units.

llvm-svn: 221034

10 years agoAdd '*' to auto variable that is a pointer, as per the coding conventions.
David Blaikie [Sat, 1 Nov 2014 01:03:39 +0000 (01:03 +0000)]
Add '*' to auto variable that is a pointer, as per the coding conventions.

llvm-svn: 221033

10 years agoAdd show and merge tools for sample PGO profiles.
Diego Novillo [Sat, 1 Nov 2014 00:56:55 +0000 (00:56 +0000)]
Add show and merge tools for sample PGO profiles.

Summary:
This patch extends the 'show' and 'merge' commands in llvm-profdata to handle
sample PGO formats. Using the 'merge' command it is now possible to convert
one sample PGO format to another.

The only format that is currently not working is 'gcc'. I still need to
implement support for it in lib/ProfileData.

The changes in the sample profile support classes are needed for the
merge operation.

Reviewers: bogner

Subscribers: llvm-commits

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

llvm-svn: 221032

10 years agoAdd DwarfCompileUnit::getSkeleton that returns DwarfCompileUnit* to avoid having...
David Blaikie [Sat, 1 Nov 2014 00:50:34 +0000 (00:50 +0000)]
Add DwarfCompileUnit::getSkeleton that returns DwarfCompileUnit* to avoid having to cast from DwarfUnit* on every call.

llvm-svn: 221031

10 years agoFix a bug where -Wuninitialized would skip arguments to a function call.
Richard Trieu [Sat, 1 Nov 2014 00:46:54 +0000 (00:46 +0000)]
Fix a bug where -Wuninitialized would skip arguments to a function call.

llvm-svn: 221030

10 years agoPartial fix for building w/ libcxxrt on OSX. Patch from C Bergstrom.
Eric Fiselier [Sat, 1 Nov 2014 00:41:42 +0000 (00:41 +0000)]
Partial fix for building w/ libcxxrt on OSX. Patch from C Bergstrom.

llvm-svn: 221029

10 years agoTemporarily revert r220777 to sort out build bot breakage.
Adrian Prantl [Sat, 1 Nov 2014 00:26:59 +0000 (00:26 +0000)]
Temporarily revert r220777 to sort out build bot breakage.
"[x86] Simplify vector selection if condition value type matches vselect value type and true value is all ones or false value is all zeros."

llvm-svn: 221028

10 years agoIR: MDNode => Value: Instruction::getAllMetadata()
Duncan P. N. Exon Smith [Sat, 1 Nov 2014 00:26:42 +0000 (00:26 +0000)]
IR: MDNode => Value: Instruction::getAllMetadata()

Change `Instruction::getAllMetadata()` to modify a vector of `Value`
instead of `MDNode` and update call sites.  This is part of PR21433.

llvm-svn: 221027

10 years agoRemove the MaxLoopDepth attribute from the TempScop class
Johannes Doerfert [Sat, 1 Nov 2014 00:12:13 +0000 (00:12 +0000)]
Remove the MaxLoopDepth attribute from the TempScop class

  Now MaxLoopDepth only lives in Scops not in TempScops anymore.
  This is the first part of a series of changes to make TempScops
  obsolete.

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

llvm-svn: 221026

10 years agolibcxxrt defines bad_array_new_length::what() so move that into a conditional compila...
Eric Fiselier [Sat, 1 Nov 2014 00:11:25 +0000 (00:11 +0000)]
libcxxrt defines bad_array_new_length::what() so move that into a conditional compilation block

llvm-svn: 221025

10 years agoIR: MDNode => Value: Instruction::getMetadata()
Duncan P. N. Exon Smith [Sat, 1 Nov 2014 00:10:31 +0000 (00:10 +0000)]
IR: MDNode => Value: Instruction::getMetadata()

Change `Instruction::getMetadata()` to return `Value` as part of
PR21433.

Update most callers to use `Instruction::getMDNode()`, which wraps the
result in a `cast_or_null<MDNode>`.

llvm-svn: 221024

10 years agoIR: MDNode => Value: Add Instruction::getMDNode()
Duncan P. N. Exon Smith [Fri, 31 Oct 2014 23:58:04 +0000 (23:58 +0000)]
IR: MDNode => Value: Add Instruction::getMDNode()

Add `Instruction::getMDNode()` that casts to `MDNode` before changing
`Instruction::getMetadata()` to return `Value`.  This avoids adding
`cast_or_null<MDNode>` boiler-plate throughout the code.

Part of PR21433.

llvm-svn: 221023

10 years agoComplete the superclass type when completing an
Sean Callanan [Fri, 31 Oct 2014 23:55:36 +0000 (23:55 +0000)]
Complete the superclass type when completing an
Objective-C class type.

llvm-svn: 221022

10 years agoRevert "R600: Add missing file to CMakeLists.txt"
Reid Kleckner [Fri, 31 Oct 2014 23:39:10 +0000 (23:39 +0000)]
Revert "R600: Add missing file to CMakeLists.txt"

This reverts commit r220998.

It should've been reverted with the other change.

llvm-svn: 221021

10 years agoRevert "R600: Make sure to inline all internal functions"
Reid Kleckner [Fri, 31 Oct 2014 23:35:26 +0000 (23:35 +0000)]
Revert "R600: Make sure to inline all internal functions"

This reverts commit r220996.

It introduced layering violations causing link errors in many
configurations.

llvm-svn: 221020

10 years agoSilence a warning from MSVC "14" by making an enum unsigned
Reid Kleckner [Fri, 31 Oct 2014 23:33:56 +0000 (23:33 +0000)]
Silence a warning from MSVC "14" by making an enum unsigned

It says there is a narrowing conversion when we assign it to an unsigned
3 bit bitfield.

Also, use unsigned instead of size_t for the Size field of the struct in
question. Otherwise they won't run together in MSVC or clang-cl.

llvm-svn: 221019