platform/upstream/llvm.git
9 years agoXFAIL miscellaneous tests on windows.
Zachary Turner [Fri, 11 Sep 2015 20:01:24 +0000 (20:01 +0000)]
XFAIL miscellaneous tests on windows.

llvm.org/pr24778

llvm-svn: 247460

9 years agoXFAIL 2 breakpoint tests on Windows.
Zachary Turner [Fri, 11 Sep 2015 20:00:39 +0000 (20:00 +0000)]
XFAIL 2 breakpoint tests on Windows.

llvm.org/pr24777

llvm-svn: 247459

9 years agoXFAIL some more tests related to value api
Zachary Turner [Fri, 11 Sep 2015 20:00:25 +0000 (20:00 +0000)]
XFAIL some more tests related to value api

llvm.org/pr24772

llvm-svn: 247458

9 years agoXFAIL TestDisassembleBreakpoint.
Zachary Turner [Fri, 11 Sep 2015 20:00:09 +0000 (20:00 +0000)]
XFAIL TestDisassembleBreakpoint.

This is a trivial issue to fix, just marking it for later.
Windows prints function signatures a bit differently, and the
test expects a specific format.

llvm-svn: 247457

9 years agoXFAIL tests that try to call a function in the inferior.
Zachary Turner [Fri, 11 Sep 2015 20:00:00 +0000 (20:00 +0000)]
XFAIL tests that try to call a function in the inferior.

llvm.org/pr21765

llvm-svn: 247456

9 years agoXFAIL some C++ language specific tests on Windows.
Zachary Turner [Fri, 11 Sep 2015 19:59:39 +0000 (19:59 +0000)]
XFAIL some C++ language specific tests on Windows.

http://llvm.org/pr24764

llvm-svn: 247455

9 years agotypo; NFC
Sanjay Patel [Fri, 11 Sep 2015 19:29:18 +0000 (19:29 +0000)]
typo; NFC

llvm-svn: 247454

9 years agoDon't make assumptions about the size of the dynamic string table.
Rafael Espindola [Fri, 11 Sep 2015 19:12:37 +0000 (19:12 +0000)]
Don't make assumptions about the size of the dynamic string table.

It contains pathnames, so it can be different in each machine.

llvm-svn: 247453

9 years agoFix a small typo in ObjectFileELF.cpp.
Stephane Sezer [Fri, 11 Sep 2015 18:56:59 +0000 (18:56 +0000)]
Fix a small typo in ObjectFileELF.cpp.

llvm-svn: 247452

9 years agoRecord function attribute "stackrealign" instead of using backend option
Akira Hatanaka [Fri, 11 Sep 2015 18:55:09 +0000 (18:55 +0000)]
Record function attribute "stackrealign" instead of using backend option
-force-align-stack.

Also, make changes to the driver so that -mno-stack-realign is no longer
an option exposed to the end-user that disallows stack realignment in
the backend.

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

llvm-svn: 247451

9 years agoUse function attribute "stackrealign" to decide whether stack
Akira Hatanaka [Fri, 11 Sep 2015 18:54:38 +0000 (18:54 +0000)]
Use function attribute "stackrealign" to decide whether stack
realignment should be forced.

With this commit, we can now force stack realignment when doing LTO and
do so on a per-function basis. Also, add a new cl::opt option
"stackrealign" to CommandFlags.h which is used to force stack
realignment via llc's command line.

Out-of-tree projects currently using -force-align-stack to force stack
realignment should make changes to attach the attribute to the functions
in the IR.

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

llvm-svn: 247450

9 years agoFix a typo and make this test stricter.
Adrian Prantl [Fri, 11 Sep 2015 18:54:34 +0000 (18:54 +0000)]
Fix a typo and make this test stricter.

llvm-svn: 247449

9 years agoRemove an unnecessary check. NFC
Adrian Prantl [Fri, 11 Sep 2015 18:54:31 +0000 (18:54 +0000)]
Remove an unnecessary check. NFC

llvm-svn: 247448

9 years agoRemove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).
Adrian Prantl [Fri, 11 Sep 2015 18:54:28 +0000 (18:54 +0000)]
Remove a redundant check from CGDebugInfo::shouldOmitDefinition() (NFC).

llvm-svn: 247447

9 years agoImplement the -dynamic-linker option.
Rafael Espindola [Fri, 11 Sep 2015 18:49:42 +0000 (18:49 +0000)]
Implement the -dynamic-linker option.

With this dynamic executables can be executed with just ./t instead of
/lib64/ld-2.20.so ./t

llvm-svn: 247446

9 years agoCleanup: Get rid of a bunch of unnecessary invocations of internString()
Adrian Prantl [Fri, 11 Sep 2015 18:45:02 +0000 (18:45 +0000)]
Cleanup: Get rid of a bunch of unnecessary invocations of internString()
in CGDebugInfo.cpp: MDString::get() copies its arguments.

llvm-svn: 247445

9 years ago[Static Analyzer] Fixed a typo in a diagnostic message.
Gabor Horvath [Fri, 11 Sep 2015 18:41:50 +0000 (18:41 +0000)]
[Static Analyzer] Fixed a typo in a diagnostic message.

llvm-svn: 247444

9 years ago[CMake] [Darwin] Need to set lto_library on CMAKE_MODULE_LINKER_FLAGS as well
Chris Bieneman [Fri, 11 Sep 2015 18:39:19 +0000 (18:39 +0000)]
[CMake] [Darwin] Need to set lto_library on CMAKE_MODULE_LINKER_FLAGS as well

This is a follow-on to r247308.

llvm-svn: 247443

9 years agoExtend the Token visualizer used by MSVC to display the identifier text for tok:...
Aaron Ballman [Fri, 11 Sep 2015 18:35:18 +0000 (18:35 +0000)]
Extend the Token visualizer used by MSVC to display the identifier text for tok::identifier tokens.

Patch by Mike Spertus.

llvm-svn: 247442

9 years agoFix some typos in comments
Tobias Grosser [Fri, 11 Sep 2015 18:26:59 +0000 (18:26 +0000)]
Fix some typos in comments

llvm-svn: 247441

9 years agoMake this test a bit more resistant to section number changes.
Rafael Espindola [Fri, 11 Sep 2015 17:53:01 +0000 (17:53 +0000)]
Make this test a bit more resistant to section number changes.

llvm-svn: 247439

9 years agoUse Itanium C++ ABI triple for new modules+debug test
Reid Kleckner [Fri, 11 Sep 2015 17:50:14 +0000 (17:50 +0000)]
Use Itanium C++ ABI triple for new modules+debug test

llvm-svn: 247438

9 years ago[test] Specify exception object type in two tests
Vedant Kumar [Fri, 11 Sep 2015 17:39:34 +0000 (17:39 +0000)]
[test] Specify exception object type in two tests

Replace:
    'try { throw 0; } catch (...)'
with
    'try { throw 0; } catch (int e)'

in two test cases.

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

llvm-svn: 247437

9 years ago[CMake] Making the bootstrap-clear target always delete the boostrap build directories.
Chris Bieneman [Fri, 11 Sep 2015 17:38:38 +0000 (17:38 +0000)]
[CMake] Making the bootstrap-clear target always delete the boostrap build directories.

llvm-svn: 247436

9 years ago[X86] Make sure startproc/endproc are paired
David Majnemer [Fri, 11 Sep 2015 17:34:34 +0000 (17:34 +0000)]
[X86] Make sure startproc/endproc are paired

We used different conditions to determine if we should emit startproc vs
endproc.  Use the same condition to ensure that they will always be
paired.

This fixes PR24374.

llvm-svn: 247435

9 years agoUpdate test expectations for LLVM asm printing change
Reid Kleckner [Fri, 11 Sep 2015 17:27:53 +0000 (17:27 +0000)]
Update test expectations for LLVM asm printing change

llvm-svn: 247434

9 years ago[IR] Print the label operands of a catchpad like an invoke
Reid Kleckner [Fri, 11 Sep 2015 17:27:52 +0000 (17:27 +0000)]
[IR] Print the label operands of a catchpad like an invoke

The rest of the EH pads are fine, since they have at most one label and
take fewer operands for the personality.

Old catchpad vs. new:
  %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)] to label %__except.ret.10 unwind label %catchendblock.9
-----
  %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)]
          to label %__except.ret.10 unwind label %catchendblock.9

llvm-svn: 247433

9 years agoModule Debugging: Emit forward declarations for types that are defined in
Adrian Prantl [Fri, 11 Sep 2015 17:23:08 +0000 (17:23 +0000)]
Module Debugging: Emit forward declarations for types that are defined in
clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified.

This reimplements r247369 in about a third of the amount of code.
Thanks to David Blaikie pointing this out in post-commit review!

llvm-svn: 247432

9 years agoRevert "Module Debugging: Emit forward declarations for types that are defined in"
Adrian Prantl [Fri, 11 Sep 2015 17:23:03 +0000 (17:23 +0000)]
Revert "Module Debugging: Emit forward declarations for types that are defined in"

This reverts commit r247369 to facilitate reviewing of the following patch.

llvm-svn: 247431

9 years ago[Static Analyzer] Properly clean up the dynamic type information for dead regions.
Gabor Horvath [Fri, 11 Sep 2015 17:19:57 +0000 (17:19 +0000)]
[Static Analyzer] Properly clean up the dynamic type information for dead regions.

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

llvm-svn: 247430

9 years ago[CodeGen] Refactor TLI/AtomicExpand interface to make LLSC explicit.
Ahmed Bougacha [Fri, 11 Sep 2015 17:08:28 +0000 (17:08 +0000)]
[CodeGen] Refactor TLI/AtomicExpand interface to make LLSC explicit.

We used to have this magic "hasLoadLinkedStoreConditional()" callback,
which really meant two things:
- expand cmpxchg (to ll/sc).
- expand atomic loads using ll/sc (rather than cmpxchg).

Remove it, and, instead, introduce explicit callbacks:
- bool shouldExpandAtomicCmpXchgInIR(inst)
- AtomicExpansionKind shouldExpandAtomicLoadInIR(inst)

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

llvm-svn: 247429

9 years ago[CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.
Ahmed Bougacha [Fri, 11 Sep 2015 17:08:17 +0000 (17:08 +0000)]
[CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.

This lets us generalize its usage to the other atomic instructions.

llvm-svn: 247428

9 years ago[PR24785] Appease MSC18 to tweak optimizations.
NAKAMURA Takumi [Fri, 11 Sep 2015 17:08:02 +0000 (17:08 +0000)]
[PR24785] Appease MSC18 to tweak optimizations.

This brings a warning.

  cl : Command line warning D9035: option 'Og-' has been deprecated and will be removed in a future release

We should resolve PR11951 to remove this tweak.

llvm-svn: 247427

9 years ago[Static Analyzer] Lambda support.
Gabor Horvath [Fri, 11 Sep 2015 16:55:01 +0000 (16:55 +0000)]
[Static Analyzer] Lambda support.

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

llvm-svn: 247426

9 years ago[libFuzzer] mention more trophies
Kostya Serebryany [Fri, 11 Sep 2015 16:34:14 +0000 (16:34 +0000)]
[libFuzzer] mention more trophies

llvm-svn: 247425

9 years ago[SEH] Port __try / __leave test to new IR
Reid Kleckner [Fri, 11 Sep 2015 16:29:27 +0000 (16:29 +0000)]
[SEH] Port __try / __leave test to new IR

It turns out that the IR we already generate for __leave is fine, so no
code changes were needed.

llvm-svn: 247424

9 years ago[Static Analyzer] Minor cleanups for the nullability checker.
Gabor Horvath [Fri, 11 Sep 2015 16:29:05 +0000 (16:29 +0000)]
[Static Analyzer] Minor cleanups for the nullability checker.

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

llvm-svn: 247423

9 years ago[mips] Add missing disassembler tests for MIPS64-MIPS64R5.
Daniel Sanders [Fri, 11 Sep 2015 16:24:11 +0000 (16:24 +0000)]
[mips] Add missing disassembler tests for MIPS64-MIPS64R5.

llvm-svn: 247422

9 years ago[CodeGen] Teach SimplifyPersonality about the updated LandingPadInst
Vedant Kumar [Fri, 11 Sep 2015 15:40:05 +0000 (15:40 +0000)]
[CodeGen] Teach SimplifyPersonality about the updated LandingPadInst

When uses of personality functions were moved from LandingPadInst to
Function, we forgot to update SimplifyPersonality(). This patch corrects
that.

Note: SimplifyPersonality() is an optimization which replaces
personality functions with the default C++ personality when possible.
Without this update, some ObjC++ projects fail to link against C++
libraries (seeing as the exception ABI had effectively changed).

rdar://problem/22155434

llvm-svn: 247421

9 years ago[mips] Add missing MIPS32 - MIPS32R5 disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 15:28:19 +0000 (15:28 +0000)]
[mips] Add missing MIPS32 - MIPS32R5 disassembler tests.

llvm-svn: 247420

9 years agoUpdate autoconf too: Analysis/TempScopInfo.cpp has been removed
Sylvestre Ledru [Fri, 11 Sep 2015 15:05:29 +0000 (15:05 +0000)]
Update autoconf too: Analysis/TempScopInfo.cpp has been removed

llvm-svn: 247419

9 years ago[mips] Attempt to fix llvm-s390x-linux1
Daniel Sanders [Fri, 11 Sep 2015 14:57:54 +0000 (14:57 +0000)]
[mips] Attempt to fix llvm-s390x-linux1

It doesn't seem to like the '|&' in the test command.

llvm-svn: 247418

9 years ago[mips] Add missing MIPS-IV disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 14:54:58 +0000 (14:54 +0000)]
[mips] Add missing MIPS-IV disassembler tests.

llvm-svn: 247417

9 years ago[mips] Add missing MIPS-III disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 14:48:46 +0000 (14:48 +0000)]
[mips] Add missing MIPS-III disassembler tests.

llvm-svn: 247416

9 years agoTweak 2 x86 gold tests so they can run on non-x86 platforms
Arnaud A. de Grandmaison [Fri, 11 Sep 2015 14:45:34 +0000 (14:45 +0000)]
Tweak 2 x86 gold tests so they can run on non-x86 platforms

llvm-svn: 247415

9 years ago[mips] Add missing MIPS-II disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 14:34:41 +0000 (14:34 +0000)]
[mips] Add missing MIPS-II disassembler tests.

These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and were verified by checking the disassembler output is accepted by GAS.

llvm-svn: 247414

9 years ago[compiler-rt] [sanitizers] Add VMA size check at runtime
Adhemerval Zanella [Fri, 11 Sep 2015 13:55:00 +0000 (13:55 +0000)]
[compiler-rt] [sanitizers] Add VMA size check at runtime

This patch adds a runtime check for asan, dfsan, msan, and tsan for
architectures that support multiple VMA size (like aarch64).  Currently
the check only prints a warning indicating which is the VMA built and
expected against the one detected at runtime.

llvm-svn: 247413

9 years agoFix out-of-range access in test case
Michael Kruse [Fri, 11 Sep 2015 13:45:05 +0000 (13:45 +0000)]
Fix out-of-range access in test case

The function use_after_scop would iterate from 0 to 1024 and accessing element A[1024] where A has only valid indexes from 0 to 1023. Polly detects the situation of unconditionally undefined behavior and bail out in ScopInfo as non-feasible for optimization.

Other tests add impossible context assumptions as well, hance might show the same problem.

llvm-svn: 247412

9 years agoDemote TestAttachResume back to @expectedFailureFreeBSD
Ed Maste [Fri, 11 Sep 2015 13:43:07 +0000 (13:43 +0000)]
Demote TestAttachResume back to @expectedFailureFreeBSD

It turns out it fails consistently for me.

llvm.org/pr19310

llvm-svn: 247411

9 years agoThis test requires UTF-8 output to print the UT-8 characters.
Yaron Keren [Fri, 11 Sep 2015 13:29:12 +0000 (13:29 +0000)]
This test requires UTF-8 output to print the UT-8 characters.

llvm-svn: 247410

9 years agoAdd #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.
Yaron Keren [Fri, 11 Sep 2015 13:22:47 +0000 (13:22 +0000)]
Add #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.
Source code was assuming that llvm-config.h would be included somehow but
up to r247253 that added #include "llvm/Support/Compiler.h" to StringRef.h
the config file was not actually included. The inclusion of llvm-config.h
caused a change of behaviour in tools/clang/test/Frontend/source-col-map.c:
previously it would output the original UTF-8 but now it outputs <U+03B1>.

llvm-svn: 247409

9 years agoAdd more information to a comment.
Rafael Espindola [Fri, 11 Sep 2015 13:20:07 +0000 (13:20 +0000)]
Add more information to a comment.

llvm-svn: 247408

9 years agoRe-commit r247405: [mips] Add missing MIPS-I disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 12:59:03 +0000 (12:59 +0000)]
Re-commit r247405: [mips] Add missing MIPS-I disassembler tests.

These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and verified by checking the disassembler output is accepted by GAS.

The problematic tests from the previous commit have been moved to
valid-xfail.txt for now.

Also, give invalid instructions some coverage. invalid-xfail.txt contains
instructions that should be invalid but successfully disassemble.

llvm-svn: 247407

9 years agoRevert r247405: [mips] Add missing MIPS-I disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 12:42:38 +0000 (12:42 +0000)]
Revert r247405: [mips] Add missing MIPS-I disassembler tests.

A small number of the added tests have operands that change on each round trip.

llvm-svn: 247406

9 years ago[mips] Add missing MIPS-I disassembler tests.
Daniel Sanders [Fri, 11 Sep 2015 12:24:06 +0000 (12:24 +0000)]
[mips] Add missing MIPS-I disassembler tests.

These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and verified by checking the disassembler output is accepted by GAS.

llvm-svn: 247405

9 years agoFixed HasDeclarationMatcher to properly convert all types into decls where possible...
Aaron Ballman [Fri, 11 Sep 2015 11:51:24 +0000 (11:51 +0000)]
Fixed HasDeclarationMatcher to properly convert all types into decls where possible. Added objcObjectPointerType(), objcInterfaceDecl(), templateTypeParmType(), injectedClassNameType(), and unresolvedUsingTypenameDecl(). Updated documentation for pointerType() to call out that it does not match ObjCObjectPointerType types. Changed pointsTo() to handle ObjCObjectPointerType as well as PointerType.

While this may seem like a lot of unrelated changes, they all relate back to fixing HasDeclarationMatcher.

This now allows us to write a matcher like:

varDecl(hasType(namedDecl(hasName("Foo"))))

that matches code using typedefs, objc interfaces, template type parameters, injected class names, or unresolved using typenames.

llvm-svn: 247404

9 years ago[lldb-mi] No need to call Format with no varargs.
Bruce Mitchener [Fri, 11 Sep 2015 11:17:30 +0000 (11:17 +0000)]
[lldb-mi] No need to call Format with no varargs.

Summary:
There's no need to call CMIUtilString::Format
with a string and no args.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 247403

9 years agoClean up build of JITLoader/GDB in autoconf build.
Bruce Mitchener [Fri, 11 Sep 2015 10:37:17 +0000 (10:37 +0000)]
Clean up build of JITLoader/GDB in autoconf build.

Summary:
This builds on all platforms, so remove duplication in build
configuration.

Reviewers: labath, clayborg, emaste

Subscribers: lldb-commits

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

llvm-svn: 247402

9 years ago[OPENMP] Preserve alignment of the original variables for the captured references.
Alexey Bataev [Fri, 11 Sep 2015 10:29:41 +0000 (10:29 +0000)]
[OPENMP] Preserve alignment of the original variables for the captured references.
Patch makes codegen to preserve alignment of the shared variables captured and used in OpenMP regions.

llvm-svn: 247401

9 years agoImprove the arm/aarch64 mapping symbol handling
Tamas Berghammer [Fri, 11 Sep 2015 10:04:00 +0000 (10:04 +0000)]
Improve the arm/aarch64 mapping symbol handling

Change the mapping symbol handling to handle the case when the mapping
symbols are prefixed with an arbitrary prefix. This isn't strictly standard
compliance, but if all symbols in an object file is prefixed with objcopy
then the prefix will be added to the mapping symbol also. We still want to
treat these symbols as mapping symbols to get the correct address class data.

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

llvm-svn: 247400

9 years agoAnother patch for modernize-loop-convert.
Angel Garcia Gomez [Fri, 11 Sep 2015 10:02:07 +0000 (10:02 +0000)]
Another patch for modernize-loop-convert.

Summary:
1. Avoid converting loops that iterate over the size of a container and don't use its elements, as this would result in an unused-result warning.
2. Never capture the elements by value on lambdas, thus avoiding doing unnecessary copies and errors with non-copyable types.
3. The 'const auto &' instead of 'auto &' substitution on const containers now works on arrays and pseudoarrays as well.
4. The error about multiple replacements in the same macro call is now documented in the tests (not solved though).
5. Due to [1], I had to add a dummy usage of the range element (like "(void) *It;" or similars) on the tests that had empty loops.
6. I removed the braces from the CHECK comments. I think that there is no need for them, and they confuse vim.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

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

llvm-svn: 247399

9 years agoAdd Polly header files to IDE projects
Michael Kruse [Fri, 11 Sep 2015 09:01:55 +0000 (09:01 +0000)]
Add Polly header files to IDE projects

llvm-svn: 247398

9 years agoclang/test/Modules/ExtDebugInfo.cpp: Use %itanium_abi_triple.
NAKAMURA Takumi [Fri, 11 Sep 2015 08:56:12 +0000 (08:56 +0000)]
clang/test/Modules/ExtDebugInfo.cpp: Use %itanium_abi_triple.

llvm-svn: 247397

9 years agoclang/test/Modules/ExtDebugInfo.cpp: Use [[@LINE]].
NAKAMURA Takumi [Fri, 11 Sep 2015 08:53:29 +0000 (08:53 +0000)]
clang/test/Modules/ExtDebugInfo.cpp: Use [[@LINE]].

llvm-svn: 247396

9 years agoPPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.
NAKAMURA Takumi [Fri, 11 Sep 2015 08:20:56 +0000 (08:20 +0000)]
PPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.

It caused crash in MachineInstr::hasPropertyInBundle() since r247237.

llvm-svn: 247395

9 years agoclang-tidy/misc-sizeof-container.cpp: Add explicit triple.
NAKAMURA Takumi [Fri, 11 Sep 2015 08:16:30 +0000 (08:16 +0000)]
clang-tidy/misc-sizeof-container.cpp: Add explicit triple.

For targeting LLP64, like Windows x86, size_t is not unsigned long.

  tools/clang/tools/extra/test/clang-tidy/Output/misc-sizeof-container.cpp.tmp.cpp:33:12: error: target of using declaration conflicts with declaration already in scope [clang-diagnostic-error]
  using std::size_t;
             ^

llvm-svn: 247394

9 years agoclang-tidy/readability-inconsistent-declaration-parameter-name.cpp: Appease MS-incomp...
NAKAMURA Takumi [Fri, 11 Sep 2015 08:16:22 +0000 (08:16 +0000)]
clang-tidy/readability-inconsistent-declaration-parameter-name.cpp: Appease MS-incompatibility [-fno-delayed-template-parsing]

llvm-svn: 247393

9 years agoFix \param in r247251. [-Wdocumentation]
NAKAMURA Takumi [Fri, 11 Sep 2015 08:13:32 +0000 (08:13 +0000)]
Fix \param in r247251. [-Wdocumentation]

llvm-svn: 247392

9 years agoFix llvm/test/tools/gold/X86/bad-alias.ll.
NAKAMURA Takumi [Fri, 11 Sep 2015 08:03:17 +0000 (08:03 +0000)]
Fix llvm/test/tools/gold/X86/bad-alias.ll.

llvm-svn: 247391

9 years ago[lldb-mi] Fix failure in log file initialization.
Bruce Mitchener [Fri, 11 Sep 2015 08:02:50 +0000 (08:02 +0000)]
[lldb-mi] Fix failure in log file initialization.

I broke this in r247388.

llvm-svn: 247390

9 years ago[OPENMP] Fix printing of array section with single index.
Alexey Bataev [Fri, 11 Sep 2015 04:54:28 +0000 (04:54 +0000)]
[OPENMP] Fix printing of array section with single index.

llvm-svn: 247389

9 years ago[lldb-mi] Remove MIUtilSystem*.
Bruce Mitchener [Fri, 11 Sep 2015 04:50:44 +0000 (04:50 +0000)]
[lldb-mi] Remove MIUtilSystem*.

Summary:
This platform-specific code wasn't fully implemented and wasn't
actually needed. There was one call for the log file path and
that has been addressed.

This lets us also remove an error message from MICmnLogMediumFile
as it is no longer used.

Reviewers: ki.stfu, domipheus, abidh

Subscribers: lldb-commits

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

llvm-svn: 247388

9 years agoCOFF: Teach ICF to merge cyclic graphs.
Rui Ueyama [Fri, 11 Sep 2015 04:29:03 +0000 (04:29 +0000)]
COFF: Teach ICF to merge cyclic graphs.

Previously, LLD's ICF couldn't merge cyclic graphs. That was unfortunate
because, in COFF, cyclic graphs are not exceptional at all. That is
pretty common.

In this patch, sections are grouped by Tarjan's strongly connected
component algorithm to get acyclic graphs. And then we try to merge
SCCs whose outdegree is zero, and remove them from the graph. This
makes other SCCs to have outdegree zero, so we can repeat the
process until all SCCs are removed. When comparing two SCCs, we handle
cycles properly.

This algorithm works better than previous one. Previously, self-linking
produced a 29.0MB executable. It now produces a 27.7MB. There's still some
gap compared to MSVC linker which produces a 27.1MB executable for the
same input. So the gap is narrowed, but still LLD is not on par with MSVC.
I'll investigate that later.

llvm-svn: 247387

9 years ago[dsymutil] Discard useless location attributes.
Frederic Riss [Fri, 11 Sep 2015 04:17:30 +0000 (04:17 +0000)]
[dsymutil] Discard useless location attributes.

When cloning the debug info for a function that hasn't been linked,
strip the DIEs from all location attributes that wouldn't contain any
meaningful information anyway.

This kind of situation can happen when a function got discarded by the
linker, but its debug information is still wanted in the final link
because it was marked as required as some other DIE dependency. The easiest
way to get into that situation is to have using directives. They get
linked unconditionally, but their targets might not always be present.

llvm-svn: 247386

9 years ago[dsymutil] Rename some variables NFC.
Frederic Riss [Fri, 11 Sep 2015 04:17:25 +0000 (04:17 +0000)]
[dsymutil] Rename some variables NFC.

lldb doesn't like having variables named as an existing type. In order to
ease debugging, rename those variables to avoid that conflict.

llvm-svn: 247385

9 years ago[modules] Don't load files specified by -fmodule-file= when modules are
Richard Smith [Fri, 11 Sep 2015 03:58:07 +0000 (03:58 +0000)]
[modules] Don't load files specified by -fmodule-file= when modules are
disabled. (We still allow this via -cc1 / -Xclang, primarily for testing.)

llvm-svn: 247384

9 years agoLink liblldb.so with LLVMObjCARCOpts.a
Bruce Mitchener [Fri, 11 Sep 2015 03:52:08 +0000 (03:52 +0000)]
Link liblldb.so with LLVMObjCARCOpts.a

Summary:
Problems reported on NetBSD:

```
llvm[4]: Linking Debug+Asserts executable lldb
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCExpandPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCOptPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCAPElimPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCContractPass()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
 /tmp/llvm/Makefile.rules:1434: recipe for target '/tmp/build-llvm/Debug+Asserts/bin/lldb' failed
```

Reviewers: joerg, sas

Subscribers: brucem, sas, lldb-commits

Change by Kamil Rytarowski <n54@gmx.com>

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

llvm-svn: 247383

9 years agoUpdate polly for explicit type parameter to global alias change
David Blaikie [Fri, 11 Sep 2015 03:42:32 +0000 (03:42 +0000)]
Update polly for explicit type parameter to global alias change

llvm-svn: 247382

9 years agoFix the gold test cases after alias changes
David Blaikie [Fri, 11 Sep 2015 03:28:37 +0000 (03:28 +0000)]
Fix the gold test cases after alias changes

llvm-svn: 247381

9 years ago[opaque pointer type] update test cases for explicit pointee types on global aliases
David Blaikie [Fri, 11 Sep 2015 03:22:18 +0000 (03:22 +0000)]
[opaque pointer type] update test cases for explicit pointee types on global aliases

llvm-svn: 247380

9 years ago[opaque pointer type] update test cases for explicit pointee types on global aliases
David Blaikie [Fri, 11 Sep 2015 03:22:12 +0000 (03:22 +0000)]
[opaque pointer type] update test cases for explicit pointee types on global aliases

llvm-svn: 247379

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter for global...
David Blaikie [Fri, 11 Sep 2015 03:22:04 +0000 (03:22 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter for global aliases

update.py:
import fileinput
import sys
import re

alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias"
plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)")
cast  = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)")
gep   = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)")

def conv(line):
  m = re.match(cast, line)
  if m:
    return m.group(1) + " " + m.group(3) + ", " + m.group(2)
  m = re.match(gep, line)
  if m:
    return m.group(1) + " " + m.group(3) + ", " + m.group(2)
  m = re.match(plain, line)
  if m:
    return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n"
  return line

for line in sys.stdin:
  sys.stdout.write(conv(line))

apply.sh:
for name in "$@"
do
  python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
  rm -f "$name.tmp"
done

The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh

llvm-svn: 247378

9 years ago[modules] Move ConvertUTF.h to a separate submodule that doesn't require C++.
Richard Smith [Fri, 11 Sep 2015 03:14:00 +0000 (03:14 +0000)]
[modules] Move ConvertUTF.h to a separate submodule that doesn't require C++.
The former setup once resulted in us ignoring the module for C compilations,
but Clang now errors on this if the header is included from C code (which it is).

llvm-svn: 247377

9 years agoFixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.
Cong Hou [Fri, 11 Sep 2015 02:47:30 +0000 (02:47 +0000)]
Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.

llvm-svn: 247376

9 years ago[modules] Slightly defang an assert that produces false-positives on the selfhost...
Richard Smith [Fri, 11 Sep 2015 02:22:03 +0000 (02:22 +0000)]
[modules] Slightly defang an assert that produces false-positives on the selfhost bot.

llvm-svn: 247375

9 years agoDocs: Document __builtin_nontemporal_load and __builtin_nontemporal_store.
Michael Zolotukhin [Fri, 11 Sep 2015 02:01:15 +0000 (02:01 +0000)]
Docs: Document __builtin_nontemporal_load and __builtin_nontemporal_store.

Summary:
In r247104 I added the builtins for generating non-temporal memory operations,
but now I realized that they lack documentation. This patch adds some.

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

llvm-svn: 247374

9 years ago[sema] Fix assertion hit when using libclang to index a particular C++ snippet involv...
Argyrios Kyrtzidis [Fri, 11 Sep 2015 01:44:56 +0000 (01:44 +0000)]
[sema] Fix assertion hit when using libclang to index a particular C++ snippet involving templates.

Assertion hit was in ClassTemplateSpecializationDecl::getSourceRange().

llvm-svn: 247373

9 years agoAsmWriter: Avoid O(N^2) processing of metadata
Duncan P. N. Exon Smith [Fri, 11 Sep 2015 01:34:59 +0000 (01:34 +0000)]
AsmWriter: Avoid O(N^2) processing of metadata

Fix embarrassing bugs I introduced to the `SlotTracker` in or around
r235785.  I had us iterating through every instruction in a function
(and hitting a map in the LLVMContext) for every basic block in the
function.

While there, completely avoid the call to
`SlotTracker::processFunctionMetadata()` from
`SlotTracker::processFunction()` if we've speculatively done this
already in `SlotTracker::processModule()` by checking
`ShouldInitializeAllMetadata` (this wasn't an algorithmic problem, but
it's touching the same line of code).

Fixes PR24699.

llvm-svn: 247372

9 years agoRevert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing argume...
Mehdi Amini [Fri, 11 Sep 2015 01:33:48 +0000 (01:33 +0000)]
Revert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite"

This reverts commit r247356.

Breaks test/Transforms/InstCombine/pr8547.ll with:

Wrong types for attribute: byval inalloca nest noalias nocapture nonnull readnone readonly sret dereferenceable(1) dereferenceable_or_null(1)
  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 nonnull %conv2) #0
LLVM ERROR: Broken function found, compilation aborted!

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

9 years agoAdd a DT_SYMTAB entry in the dynamic section.
Rafael Espindola [Fri, 11 Sep 2015 01:14:39 +0000 (01:14 +0000)]
Add a DT_SYMTAB entry in the dynamic section.

With this a trivial shared binary runs with the glibc dynamic linker:

LD_LIBRARY_PATH=.  /lib64/ld-2.20.so ./t

llvm-svn: 247370

9 years agoModule Debugging: Emit forward declarations for types that are defined in
Adrian Prantl [Fri, 11 Sep 2015 01:03:26 +0000 (01:03 +0000)]
Module Debugging: Emit forward declarations for types that are defined in
clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified.

llvm-svn: 247369

9 years agoCleanup: Let CGDebugInfo::ModuleRefCache use a TrackingMDNode (NFC).
Adrian Prantl [Fri, 11 Sep 2015 01:03:19 +0000 (01:03 +0000)]
Cleanup: Let CGDebugInfo::ModuleRefCache use a TrackingMDNode (NFC).

llvm-svn: 247368

9 years ago[MS ABI] Remove another call to RequireCompleteType
David Majnemer [Fri, 11 Sep 2015 00:53:15 +0000 (00:53 +0000)]
[MS ABI] Remove another call to RequireCompleteType

I cannot come up with a testcase which would rely on this call to
RequireCompleteType, I believe that it is superfluous given the current
state of clang.

llvm-svn: 247367

9 years agoClean up building & linking of Process/elf-core.
Bruce Mitchener [Fri, 11 Sep 2015 00:31:33 +0000 (00:31 +0000)]
Clean up building & linking of Process/elf-core.

Summary:
* cmake/LLDBDependencies.cmake: elf-core is already included
  globally in LLDB_USED_LIBS, so it doesn't need to be re-added
  on individual platforms.

* lib/Makefile: elf-core is linked on each platform, so move it
  to the global list of used libraries.

* source/Plugins/Makefile: elf-core is built on each platform, so
  move it to the global list of things to build.

Reviewers: clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 247366

9 years agoCreate a dynamic symbol table.
Rafael Espindola [Fri, 11 Sep 2015 00:30:13 +0000 (00:30 +0000)]
Create a dynamic symbol table.

For now it includes every symbol in the regular table. Since we don't
create dynamic relocations yet, we don't have a good way of knowing which
symbols are actually needed.

llvm-svn: 247365

9 years ago[libFuzzer] perform fewer crossover operations compared to plain mutations
Kostya Serebryany [Fri, 11 Sep 2015 00:20:58 +0000 (00:20 +0000)]
[libFuzzer] perform fewer crossover operations compared to plain mutations

llvm-svn: 247364

9 years agoCache the bss output section in the writer, not in the symbol table.
Rafael Espindola [Fri, 11 Sep 2015 00:10:11 +0000 (00:10 +0000)]
Cache the bss output section in the writer, not in the symbol table.

There is soon going to be two symbol tables, but there will still be only one
output bss.

llvm-svn: 247363

9 years ago[Driver] Use UniversalCRT on Windows if available
Reid Kleckner [Fri, 11 Sep 2015 00:09:39 +0000 (00:09 +0000)]
[Driver] Use UniversalCRT on Windows if available

Summary:
With Visual Studio 2015 release, a part of runtime library was extracted
and now comes with Windows Kits. This patch enables clang to use
Universal CRT library if  %INCLUDE or %LIB environment varaibles are not
specified.

See also https://llvm.org/bugs/show_bug.cgi?id=24741

Patch by Igor Kudrin

Reviewers: zturner, hans, rnk

Subscribers: ruiu, cfe-commits

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

llvm-svn: 247362

9 years agoAdd .exe check to Execute to fix clang-modernize tests broken in r247358
Reid Kleckner [Thu, 10 Sep 2015 23:59:45 +0000 (23:59 +0000)]
Add .exe check to Execute to fix clang-modernize tests broken in r247358

llvm-svn: 247361

9 years agoDocs: Add missing new line before a list.
Michael Zolotukhin [Thu, 10 Sep 2015 23:56:10 +0000 (23:56 +0000)]
Docs: Add missing new line before a list.

llvm-svn: 247360