platform/upstream/llvm.git
8 years agoFixed header determination logic. Was missing extensionless headers in coverage check.
John Thompson [Thu, 3 Dec 2015 19:20:43 +0000 (19:20 +0000)]
Fixed header determination logic. Was missing extensionless headers in coverage check.

llvm-svn: 254635

8 years agoUpdate .gitignore to include __pycache__ directories.
Zachary Turner [Thu, 3 Dec 2015 19:20:11 +0000 (19:20 +0000)]
Update .gitignore to include __pycache__ directories.

llvm-svn: 254634

8 years agoUn XFAIL some tests that are now passing on Windows.
Zachary Turner [Thu, 3 Dec 2015 19:20:05 +0000 (19:20 +0000)]
Un XFAIL some tests that are now passing on Windows.

llvm-svn: 254633

8 years agoAdd tests for pass_object_size.
George Burgess IV [Thu, 3 Dec 2015 19:19:09 +0000 (19:19 +0000)]
Add tests for pass_object_size.

These additions were meant to go in as a part of r254554; while it's
certainly nice to have new functionality, it's nicer if we have tests to
go with it. :)

llvm-svn: 254632

8 years agoSimplify test. NFC.
Rafael Espindola [Thu, 3 Dec 2015 19:10:55 +0000 (19:10 +0000)]
Simplify test. NFC.

llvm-svn: 254631

8 years agoTest commit.
Easwaran Raman [Thu, 3 Dec 2015 19:03:20 +0000 (19:03 +0000)]
Test commit.

Remove blank spaces at the end of comments

llvm-svn: 254630

8 years ago[WinEH] Avoid infinite loop in BranchFolding for multiple single block funclets
Andrew Kaylor [Thu, 3 Dec 2015 18:55:28 +0000 (18:55 +0000)]
[WinEH] Avoid infinite loop in BranchFolding for multiple single block funclets

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

llvm-svn: 254629

8 years ago[CMake] If you're not installing the libcxx library, exclude it from the "all" target...
Chris Bieneman [Thu, 3 Dec 2015 18:52:54 +0000 (18:52 +0000)]
[CMake] If you're not installing the libcxx library, exclude it from the "all" target so it doesn't get built when you run "ninja install"

This is just a build dependency optimization. Running check-libcxx will still build libcxx and function as expected, it just removes libcxx from the all build and install targets.

llvm-svn: 254628

8 years ago[CMake] Add option LLVM_EXTERNALIZE_DEBUGINFO
Chris Bieneman [Thu, 3 Dec 2015 18:45:39 +0000 (18:45 +0000)]
[CMake] Add option LLVM_EXTERNALIZE_DEBUGINFO

Summary: This adds support for generating dSYM files and stripping debug info from executables and dylibs. It also supports passing -object_path_lto to the linker to generate dSYMs for LTO builds.

Reviewers: bogner, friss

Subscribers: llvm-commits

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

llvm-svn: 254627

8 years agodwarfdump: Correctly indentify the indicies for DWP records
David Blaikie [Thu, 3 Dec 2015 18:41:59 +0000 (18:41 +0000)]
dwarfdump: Correctly indentify the indicies for DWP records

The indicies are one-based, not zero-based, per the spec.

llvm-svn: 254626

8 years ago[PGO] Introduce error report macro in profile-rt
Xinliang David Li [Thu, 3 Dec 2015 18:31:59 +0000 (18:31 +0000)]
[PGO] Introduce error report macro in profile-rt

Also added a test case for runtime error reporting.

llvm-svn: 254625

8 years ago[ThinLTO] Appending linkage fixes
Teresa Johnson [Thu, 3 Dec 2015 18:20:05 +0000 (18:20 +0000)]
[ThinLTO] Appending linkage fixes

Summary:
Fix import from module with appending var, which cannot be imported. The
first fix is to remove an overly-aggressive error check.

The second fix is to deal with restructuring introduced to the module
linker yesterday in r254418 (actually, this fix was included already
in r254559, just added some additional cleanup).

Test by Mehdi Amini.

Reviewers: joker.eph, rafael

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 254624

8 years ago[Hexagon] Remove variable unused in NDEBUG build
Krzysztof Parzyszek [Thu, 3 Dec 2015 17:53:34 +0000 (17:53 +0000)]
[Hexagon] Remove variable unused in NDEBUG build

llvm-svn: 254623

8 years agoFix Objective-C metadata for properties from class extensions after r251874
Nico Weber [Thu, 3 Dec 2015 17:44:51 +0000 (17:44 +0000)]
Fix Objective-C metadata for properties from class extensions after r251874

After, properties from class extensions no longer show up in
ObjCInterfaceDecl::properties().  Make ObjCCommonMac::EmitPropertyList()
explicitly look for properties in class extensions before looking at
direct properties.

Also add a test that passes both with clang before r251874 and after this
patch (but fails with r251874 and without this patch).

llvm-svn: 254622

8 years agoAArch64FastISel: Use cbz/cbnz to branch on i1
Matthias Braun [Thu, 3 Dec 2015 17:19:58 +0000 (17:19 +0000)]
AArch64FastISel: Use cbz/cbnz to branch on i1

In the case of a conditional branch without a preceding cmp we used to emit
a "and; cmp; b.eq/b.ne" sequence, use tbz/tbnz instead.

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

llvm-svn: 254621

8 years agoFriendly takeover of the Hexagon backend
Krzysztof Parzyszek [Thu, 3 Dec 2015 17:07:12 +0000 (17:07 +0000)]
Friendly takeover of the Hexagon backend

llvm-svn: 254620

8 years ago[sanitizer] Replace a local array with InternalScopedString in MaybeReexec()
Kuba Brecka [Thu, 3 Dec 2015 17:05:43 +0000 (17:05 +0000)]
[sanitizer] Replace a local array with InternalScopedString in MaybeReexec()

`MaybeReexec` contains a 1024-byte long local array, which produces a warning about frame size:

   .../lib/sanitizer_common/sanitizer_mac.cc:548:6: warning: stack frame size of 1132 bytes in function '__sanitizer::MaybeReexec' [-Wframe-larger-than=]

Let's replace it with InternalScopedString.

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

llvm-svn: 254619

8 years ago[sanitizer] Cache results of darwin_test_archs
Kuba Brecka [Thu, 3 Dec 2015 17:02:07 +0000 (17:02 +0000)]
[sanitizer] Cache results of darwin_test_archs

For OS X builds of compiler-rt, we run `darwin_test_archs` to determine which architectures can the toolchain target. This detection takes quite a long time, and the result is always the same (as long as you don't upgrade your OS, system headers or toolchain). Let's cache the result.

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

llvm-svn: 254618

8 years ago[Hexagon] Implement CONCAT_VECTORS for HVX using V6_vcombine
Krzysztof Parzyszek [Thu, 3 Dec 2015 16:47:20 +0000 (16:47 +0000)]
[Hexagon] Implement CONCAT_VECTORS for HVX using V6_vcombine

llvm-svn: 254617

8 years ago[Hexagon] NFC Using canonicalizePacket to compound/duplex/pad packets rather than...
Colin LeMahieu [Thu, 3 Dec 2015 16:37:21 +0000 (16:37 +0000)]
[Hexagon] NFC Using canonicalizePacket to compound/duplex/pad packets rather than doing it separately.  This also ensures the integrated assembler path matches the assembly parser path.

llvm-svn: 254616

8 years agoSimplify ValueMap handling.
Rafael Espindola [Thu, 3 Dec 2015 16:36:16 +0000 (16:36 +0000)]
Simplify ValueMap handling.

We now just return values and let ValueMap handle the map.

llvm-svn: 254615

8 years agoFix clang/test/Sema/struct-packed-align.c. "Windows" is not MS compiler.
NAKAMURA Takumi [Thu, 3 Dec 2015 16:03:34 +0000 (16:03 +0000)]
Fix clang/test/Sema/struct-packed-align.c. "Windows" is not MS compiler.

llvm-svn: 254614

8 years ago[Hexagon] Fix instruction descriptor flags for memory access size
Krzysztof Parzyszek [Thu, 3 Dec 2015 15:41:33 +0000 (15:41 +0000)]
[Hexagon] Fix instruction descriptor flags for memory access size

llvm-svn: 254613

8 years agoMake check-clang depend on LTO.
Nico Weber [Thu, 3 Dec 2015 15:40:23 +0000 (15:40 +0000)]
Make check-clang depend on LTO.

r249143 added test/Driver/darwin-ld-lto.c which requires libLTO.dylib
to pass, but when running `ninja check-clang` in a fresh build directory
nothing caused libLTO.dylib to be built and the test would fail.

llvm-svn: 254612

8 years ago[tsan] Add interceptors for Darwin-specific locking APIs
Kuba Brecka [Thu, 3 Dec 2015 15:10:52 +0000 (15:10 +0000)]
[tsan] Add interceptors for Darwin-specific locking APIs

On OS X, there are other-than-pthread locking APIs that are used quite extensively - OSSpinLock and os_lock_lock. Let's add interceptors for those.

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

llvm-svn: 254611

8 years agoDon't pass member variables to member functions. NFC.
Rafael Espindola [Thu, 3 Dec 2015 14:48:20 +0000 (14:48 +0000)]
Don't pass member variables to member functions. NFC.

llvm-svn: 254610

8 years agoDelete dead code.
Rafael Espindola [Thu, 3 Dec 2015 14:35:15 +0000 (14:35 +0000)]
Delete dead code.

llvm-svn: 254609

8 years agoRemove some duplicated code from PlatformPOSIX/Android
Tamas Berghammer [Thu, 3 Dec 2015 12:58:03 +0000 (12:58 +0000)]
Remove some duplicated code from PlatformPOSIX/Android

The code was duplicated to handle the custom symbol name for functions
in libdl.so for android. This change modify the way we handle the issue
to eliminate a lot of duplicated code.

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

llvm-svn: 254608

8 years ago[X86] MS inline asm: produce error when encountering "<type> ptr <reg name>"
Marina Yatsina [Thu, 3 Dec 2015 12:17:03 +0000 (12:17 +0000)]
[X86] MS inline asm: produce error when encountering "<type> ptr <reg name>"

Currently "<type> ptr <reg name>" treated as <reg name> in MS inline asm, ignoring the "<type> ptr" completely and possibly ignoring the intention of the user.
Fixed llvm to produce an error when encountering "<type> ptr <reg name>" operands.

For example: andpd xmm1,xmmword ptr xmm1 --> andpd xmm1, xmm1
though andpd has 2 possible matching formats - andpd xmm, xmm/m128

Patch by: ziv.izhar@intel.com
Differential Revision: http://reviews.llvm.org/D14607

llvm-svn: 254607

8 years agoUnxfail passing test: test/CodeGenCXX/crash.cpp
Krzysztof Parzyszek [Thu, 3 Dec 2015 12:03:56 +0000 (12:03 +0000)]
Unxfail passing test: test/CodeGenCXX/crash.cpp

llvm-svn: 254606

8 years agoRevert "Fix for merging decls in pragma weak Calling CheckFunctionDeclaration so...
Alexander Kornienko [Thu, 3 Dec 2015 11:37:28 +0000 (11:37 +0000)]
Revert "Fix for merging decls in pragma weak Calling CheckFunctionDeclaration so that 2 decls for the 'weak' are merged. Differential Revision: reviews.llvm.org/D13048"

This reverts commit r254143 which introduces a crash on the following input:
  f(char *);
  g(char *);
  #pragma weak f = g
  int g(char *p) {}

llvm-svn: 254605

8 years agoFollow-up of r254600 to fix the dyld_insert_libraries_reexec.cc testcase on OS X...
Kuba Brecka [Thu, 3 Dec 2015 11:34:16 +0000 (11:34 +0000)]
Follow-up of r254600 to fix the dyld_insert_libraries_reexec.cc testcase on OS X 10.10.

llvm-svn: 254604

8 years ago[tsan] Enable ThreadSanitizer on OS X builds by default, take 2
Kuba Brecka [Thu, 3 Dec 2015 11:02:43 +0000 (11:02 +0000)]
[tsan] Enable ThreadSanitizer on OS X builds by default, take 2

Second attempt to enable building ThreadSanitizer (and running tests) on OS X by default.

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

llvm-svn: 254603

8 years agoFix TestLoadUnload for Windows -> POSIX remote debugging
Tamas Berghammer [Thu, 3 Dec 2015 11:02:10 +0000 (11:02 +0000)]
Fix TestLoadUnload for Windows -> POSIX remote debugging

Previously we used sys.os.path for appending target pathes what failed
when cased dlopen to fail on the target because of the '\'.

The fix won't work for local Windows tests but dlopen don't available
on Windows anyway so the test don't make sense in that context.

llvm-svn: 254602

8 years ago[tsan] Use MAP_ANON instead of MAP_ANONYMOUS
Kuba Brecka [Thu, 3 Dec 2015 10:46:26 +0000 (10:46 +0000)]
[tsan] Use MAP_ANON instead of MAP_ANONYMOUS

In mmap_large.cc, let's use MAP_ANON instead of MAP_ANONYMOUS, because MAP_ANONYMOUS is only available on OS X 10.11 and later.

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

llvm-svn: 254601

8 years ago[tsan] Use re-exec method to enable interceptors on older versions of OS X
Kuba Brecka [Thu, 3 Dec 2015 10:39:43 +0000 (10:39 +0000)]
[tsan] Use re-exec method to enable interceptors on older versions of OS X

In AddressSanitizer, we have the MaybeReexec method to detect when we're running without DYLD_INSERT_LIBRARIES (in which case interceptors don't work) and re-execute with the environment variable set. On OS X 10.11+, this is no longer necessary, but to have ThreadSanitizer supported on older versions of OS X, let's use the same method as well. This patch moves the implementation from `asan/` into `sanitizer_common/`.

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

llvm-svn: 254600

8 years agoAdd fall-back mode for clang tools.
Manuel Klimek [Thu, 3 Dec 2015 10:38:53 +0000 (10:38 +0000)]
Add fall-back mode for clang tools.

Run without flags if we cannot load a compilation database. This matches
the behavior of clang itself when simply called with a source file.

Based on a patch by Russell Wallace.

llvm-svn: 254599

8 years ago[mips][DSP] Add DSPr1 and DSPr2 tests for the standard encodings
Zlatko Buljan [Thu, 3 Dec 2015 09:56:39 +0000 (09:56 +0000)]
[mips][DSP] Add DSPr1 and DSPr2 tests for the standard encodings
Differential Revision: http://reviews.llvm.org/D15141

llvm-svn: 254598

8 years ago[OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.
Alexey Bataev [Thu, 3 Dec 2015 09:40:15 +0000 (09:40 +0000)]
[OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.

OpenMP 4.5 adds directive 'taskloop simd'. Patch adds parsing/sema analysis for 'taskloop simd' directive and its clauses.

llvm-svn: 254597

8 years agoPR25575: Make GCC 4.4+ comatible layout for packed bit-fileds of char type, patch...
Alexey Bataev [Thu, 3 Dec 2015 09:34:49 +0000 (09:34 +0000)]
PR25575: Make GCC 4.4+ comatible layout for packed bit-fileds of char type, patch by D. Polukhin

This CL is for discussion how to better fix bit-filed layout compatibility issue with GCC (see PR25575 for test case and more details). Current clang behavior is compatible with GCC 4.1-4.3 series but it was fixed in 4.4+. Ignoring packed attribute looks very odd and because it was also fixed in GCC 4.4+, it makes sense also fix it in clang.
Differential Revision: http://reviews.llvm.org/D14872

llvm-svn: 254596

8 years ago[X86] Add support for fcomip, fucomip for Intel syntax
Marina Yatsina [Thu, 3 Dec 2015 08:55:33 +0000 (08:55 +0000)]
[X86] Add support for fcomip, fucomip for Intel syntax

According to x86 spec, fcomip and fucomip should be supported for Intel syntax.

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

llvm-svn: 254595

8 years ago[X86] Stripped backend codegen tests
Simon Pilgrim [Thu, 3 Dec 2015 08:45:21 +0000 (08:45 +0000)]
[X86] Stripped backend codegen tests

As discussed on the ml, backend tests need to be put in llvm/test/CodeGen/X86 as fast-isel tests using IR that is as close to what is generated here as possible.

The llvm tests will (re)added in a future commit

I will update PR24580 on this new plan

llvm-svn: 254594

8 years ago[Fix] fix build failure due to rL254588
Mohit K. Bhakkad [Thu, 3 Dec 2015 08:44:33 +0000 (08:44 +0000)]
[Fix] fix build failure due to rL254588

llvm-svn: 254593

8 years agoFix class SCEVPredicate has virtual functions and accessible non-virtual destructor.
Andy Gibbs [Thu, 3 Dec 2015 08:20:20 +0000 (08:20 +0000)]
Fix class SCEVPredicate has virtual functions and accessible non-virtual destructor.

It is not enough to simply make the destructor virtual since there is a g++ 4.7
issue (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53613) that throws the
error "looser throw specifier for ... overridding ~SCEVPredicate() noexcept".

llvm-svn: 254592

8 years ago[ELF/AArch64] Support R_AARCH64_COPY relocation.
Igor Kudrin [Thu, 3 Dec 2015 08:05:35 +0000 (08:05 +0000)]
[ELF/AArch64] Support R_AARCH64_COPY relocation.

Generate R_AARCH64_COPY relocations for non-GOT relocations,
which reference object symbols from shared libraries.

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

llvm-svn: 254591

8 years ago[LLDB][MIPS] Using enum instead of a constant to fetch PC and CAUSE registers.
Jaydeep Patil [Thu, 3 Dec 2015 06:41:24 +0000 (06:41 +0000)]
[LLDB][MIPS] Using enum instead of a constant to fetch PC and CAUSE registers.
    SUMMARY:
    Using enum instead of a constant to fetch PC and CAUSE registers.

llvm-svn: 254590

8 years ago[TableGen] Remove an assumption about the order of encodings in the MVT::SimpleValueT...
Craig Topper [Thu, 3 Dec 2015 05:57:37 +0000 (05:57 +0000)]
[TableGen] Remove an assumption about the order of encodings in the MVT::SimpleValueType enum. Instead of assuming the types are sorted by size, scan the typeset arrays to find the smallest/largest type. NFC

llvm-svn: 254589

8 years ago[LLDB] Switch to assembly view if source is moved
Mohit K. Bhakkad [Thu, 3 Dec 2015 04:56:16 +0000 (04:56 +0000)]
[LLDB] Switch to assembly view if source is moved

Reviewers: clayborg, jingham, jasonmolenda.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain,lldb-commits.
Differential Revision: http://reviews.llvm.org/D12877

llvm-svn: 254588

8 years agoAMDGPU/SI: Emit constant arrays in the .hsrodata_readonly_agent section
Tom Stellard [Thu, 3 Dec 2015 03:34:32 +0000 (03:34 +0000)]
AMDGPU/SI: Emit constant arrays in the .hsrodata_readonly_agent section

Summary: This is done only when targeting HSA.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 254587

8 years agoRevert "ScheduleDAGInstrs: Rework schedule graph builder."
Matthias Braun [Thu, 3 Dec 2015 03:01:10 +0000 (03:01 +0000)]
Revert "ScheduleDAGInstrs: Rework schedule graph builder."

This works mostly fine but breaks some stage 1 builders when compiling
compiler-rt on i386. Revert for further investigation as I can't see an
obvious cause/fix.

This reverts commit r254577.

llvm-svn: 254586

8 years agoclang-format FunctionImport after refactoring (NFC)
Mehdi Amini [Thu, 3 Dec 2015 02:58:14 +0000 (02:58 +0000)]
clang-format FunctionImport after refactoring (NFC)

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

8 years agoRename Set variable to be plural
Mehdi Amini [Thu, 3 Dec 2015 02:40:39 +0000 (02:40 +0000)]
Rename Set variable to be plural

Thanks Sean Silva for catching this.

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

8 years agoRefactor FunctionImporter::importFunctions with a helper function to process the...
Mehdi Amini [Thu, 3 Dec 2015 02:37:33 +0000 (02:37 +0000)]
Refactor FunctionImporter::importFunctions with a helper function to process the Worklist (NFC)

This precludes some more functional changes to perform bulk imports.

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

8 years agoAdapt comment and rename variable in ModuleLinker to describe more accurately the...
Mehdi Amini [Thu, 3 Dec 2015 02:37:30 +0000 (02:37 +0000)]
Adapt comment and rename variable in ModuleLinker to describe more accurately the actual use.

Thanks Sean Silva for the suggestion.

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

8 years agoRemove "ExportingModule" from ThinLTO Index (NFC)
Mehdi Amini [Thu, 3 Dec 2015 02:37:23 +0000 (02:37 +0000)]
Remove "ExportingModule" from ThinLTO Index (NFC)

There is no real reason the index has to have the concept of an
exporting Module. We should be able to have one single unique
instance of the Index, and it should be read-only after creation
for the whole ThinLTO processing.
The linker plugin should be able to process multiple modules (in
parallel or in sequence) with the same index.

The only reason the ExportingModule was present seems to be to
implement hasExportedFunctions() that is used by the Module linker
to decide what to do with the current Module.
For now I replaced it with a query to the map of Modules path to
see if this module was declared in the Index and consider that if
it is the case then it is probably exporting function.
On the long term the Linker interface needs to evolve and this
call should not be needed anymore.

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

8 years agoAdd a TODO item that the nop handling before FP conditional branches is
Joerg Sonnenberger [Thu, 3 Dec 2015 02:35:24 +0000 (02:35 +0000)]
Add a TODO item that the nop handling before FP conditional branches is
not enough for SPARCv7.

llvm-svn: 254580

8 years agoFix a comment typo from r251874.
Nico Weber [Thu, 3 Dec 2015 02:25:26 +0000 (02:25 +0000)]
Fix a comment typo from r251874.

llvm-svn: 254579

8 years agoCOFF: Non-external COMDAT sections sholud not be merged by ICF.
Rui Ueyama [Thu, 3 Dec 2015 02:23:33 +0000 (02:23 +0000)]
COFF: Non-external COMDAT sections sholud not be merged by ICF.

If a section symbol is not external, that COMDAT section should never
be merge with other sections in other compilation unit. Previously,
we didn't take visibility into account.

Note that COMDAT sections with non-external visibility makes sense
because they can be removed by dead-stripping.

Fixes https://llvm.org/bugs/show_bug.cgi?id=25686

llvm-svn: 254578

8 years agoScheduleDAGInstrs: Rework schedule graph builder.
Matthias Braun [Thu, 3 Dec 2015 02:05:27 +0000 (02:05 +0000)]
ScheduleDAGInstrs: Rework schedule graph builder.

The new algorithm remembers the uses encountered while walking backwards
until a matching def is found. Contrary to the previous version this:
- Works without LiveIntervals being available
- Allows to increase the precision to subregisters/lanemasks
  (not used for now)

The changes in the AMDGPU tests are necessary because the R600 scheduler
is not stable with respect to the order of nodes in the ready queues.

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

llvm-svn: 254577

8 years agogeneralize CHECK lines to make buildbot happy
Sanjay Patel [Thu, 3 Dec 2015 01:51:39 +0000 (01:51 +0000)]
generalize CHECK lines to make buildbot happy

llvm-svn: 254576

8 years agoRegisterPressure: Use range based for, fix else style; NFC
Matthias Braun [Thu, 3 Dec 2015 01:44:45 +0000 (01:44 +0000)]
RegisterPressure: Use range based for, fix else style; NFC

llvm-svn: 254575

8 years agoPR17381: Treat undefined behavior during expression evaluation as an unmodeled
Richard Smith [Thu, 3 Dec 2015 01:36:22 +0000 (01:36 +0000)]
PR17381: Treat undefined behavior during expression evaluation as an unmodeled
side-effect, so that we don't allow speculative evaluation of such expressions
during code generation.

This caused a diagnostic quality regression, so fix constant expression
diagnostics to prefer either the first "can't be constant folded" diagnostic or
the first "not a constant expression" diagnostic depending on the kind of
evaluation we're doing. This was always the intent, but didn't quite work
correctly before.

This results in certain initializers that used to be constant initializers to
no longer be; in particular, things like:

  float f = 1e100;

are no longer accepted in C. This seems appropriate, as such constructs would
lead to code being executed if sanitizers are enabled.

llvm-svn: 254574

8 years agochange an assert when generating fmuladd to an ordinary 'if' check (PR25719)
Sanjay Patel [Thu, 3 Dec 2015 01:25:12 +0000 (01:25 +0000)]
change an assert when generating fmuladd to an ordinary 'if' check (PR25719)

We don't want to generate fmuladd if there's a use of the fmul expression, but this shouldn't be an assert.

The test case is derived from the commit message for r253337:
http://reviews.llvm.org/rL253337

That commit reverted r253269:
http://reviews.llvm.org/rL253269

...but the bug exists independently of the default fp-contract setting. It just became easier to hit with that change.

PR25719:
https://llvm.org/bugs/show_bug.cgi?id=25719

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

llvm-svn: 254573

8 years ago[PGO] Add v2 format compatibility test
Xinliang David Li [Thu, 3 Dec 2015 01:05:31 +0000 (01:05 +0000)]
[PGO] Add v2 format compatibility test

llvm-svn: 254572

8 years agoMC: Make sure to clear *all* of MCMachOStreamer's state
Justin Bogner [Thu, 3 Dec 2015 00:52:20 +0000 (00:52 +0000)]
MC: Make sure to clear *all* of MCMachOStreamer's state

The CreatedADWARFSection flag was added in r232842, but isn't cleared
properly when resetting the streamer's state. Fix that.

llvm-svn: 254571

8 years ago[WebAssembly] Add a test for wasm-store-results pass
Derek Schuff [Thu, 3 Dec 2015 00:50:30 +0000 (00:50 +0000)]
[WebAssembly] Add a test for wasm-store-results pass

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

llvm-svn: 254570

8 years ago[WebAssembly] Assert that byval and nest are not used for return types.
Dan Gohman [Wed, 2 Dec 2015 23:40:03 +0000 (23:40 +0000)]
[WebAssembly] Assert that byval and nest are not used for return types.

llvm-svn: 254567

8 years agoRename a header guard to be more appropriate
David Majnemer [Wed, 2 Dec 2015 23:28:27 +0000 (23:28 +0000)]
Rename a header guard to be more appropriate

llvm-svn: 254566

8 years agoForgot to add this file with r254562.
David Majnemer [Wed, 2 Dec 2015 23:09:05 +0000 (23:09 +0000)]
Forgot to add this file with r254562.

llvm-svn: 254565

8 years ago[Hexagon] Improve lowering of instructions to the MC layer
Krzysztof Parzyszek [Wed, 2 Dec 2015 23:08:29 +0000 (23:08 +0000)]
[Hexagon] Improve lowering of instructions to the MC layer

- Add extenders when necessary.
- Handle some basic relocations.

This should fix the failure in tools/clang/test/CodeGenCXX/crash.cpp

llvm-svn: 254564

8 years agoFix test result serialization to use bytes.
Zachary Turner [Wed, 2 Dec 2015 23:07:33 +0000 (23:07 +0000)]
Fix test result serialization to use bytes.

llvm-svn: 254563

8 years agoMove EH-specific helper functions to a more appropriate place
David Majnemer [Wed, 2 Dec 2015 23:06:39 +0000 (23:06 +0000)]
Move EH-specific helper functions to a more appropriate place

No functionality change is intended.

llvm-svn: 254562

8 years agofix typos; NFC
Sanjay Patel [Wed, 2 Dec 2015 23:06:17 +0000 (23:06 +0000)]
fix typos; NFC

llvm-svn: 254561

8 years agoFixup for r254547: use format_hex() to simplify code.
Alexey Samsonov [Wed, 2 Dec 2015 22:59:22 +0000 (22:59 +0000)]
Fixup for r254547: use format_hex() to simplify code.

llvm-svn: 254560

8 years agoSwitch the linker to having a whitelist of GVs.
Rafael Espindola [Wed, 2 Dec 2015 22:59:04 +0000 (22:59 +0000)]
Switch the linker to having a whitelist of GVs.

This replaces DoNotLinkFromSource with ValuesToLink. It also moves the
computation of ValuesToLink earlier.

It is a bit simpler and an important step in slitting the linker into an
ir mover and a linker proper.

The test change is because we now avoid creating dead declarations.

llvm-svn: 254559

8 years agoLibfuzzer: do not pass null into user function
Mike Aizatsky [Wed, 2 Dec 2015 22:43:53 +0000 (22:43 +0000)]
Libfuzzer: do not pass null into user function

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

llvm-svn: 254558

8 years agoUse std::string instead of strdup() and free() in WinCodeViewLineTables
Reid Kleckner [Wed, 2 Dec 2015 22:34:30 +0000 (22:34 +0000)]
Use std::string instead of strdup() and free() in WinCodeViewLineTables

llvm-svn: 254557

8 years agoDelete what is now duplicated code.
Rafael Espindola [Wed, 2 Dec 2015 22:22:24 +0000 (22:22 +0000)]
Delete what is now duplicated code.

Having to import an alias as declaration is not thinlto specific.

The test difference are because when we already have a decl and we are
not importing it, we just leave the decl alone.

llvm-svn: 254556

8 years ago[llvm-dwp] Include only the non-empty columns in the cu_index
David Blaikie [Wed, 2 Dec 2015 22:01:56 +0000 (22:01 +0000)]
[llvm-dwp] Include only the non-empty columns in the cu_index

llvm-svn: 254555

8 years agoAdd the `pass_object_size` attribute to clang.
George Burgess IV [Wed, 2 Dec 2015 21:58:08 +0000 (21:58 +0000)]
Add the `pass_object_size` attribute to clang.

`pass_object_size` is our way of enabling `__builtin_object_size` to
produce high quality results without requiring inlining to happen
everywhere.

A link to the design doc for this attribute is available at the
Differential review link below.

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

llvm-svn: 254554

8 years agoSync up with master file
Xinliang David Li [Wed, 2 Dec 2015 21:48:22 +0000 (21:48 +0000)]
Sync up with master file

llvm-svn: 254552

8 years ago[PGO] Allow input value node list to be null
Xinliang David Li [Wed, 2 Dec 2015 21:47:43 +0000 (21:47 +0000)]
[PGO] Allow input value node list to be null

This is to handle the case when vp node linked
list array is laziliy initialized at runtime

llvm-svn: 254551

8 years agoCandidate fixes for python2/3 compatible string handling in pickling support.
Todd Fiala [Wed, 2 Dec 2015 21:45:15 +0000 (21:45 +0000)]
Candidate fixes for python2/3 compatible string handling in pickling support.

llvm-svn: 254550

8 years agoFix a typo in LoopVectorize.cpp. NFC.
Cong Hou [Wed, 2 Dec 2015 21:33:47 +0000 (21:33 +0000)]
Fix a typo in LoopVectorize.cpp. NFC.

llvm-svn: 254549

8 years ago[PowerPC] Remove wild call to RegScavenger::initRegState().
Alexey Samsonov [Wed, 2 Dec 2015 21:25:28 +0000 (21:25 +0000)]
[PowerPC] Remove wild call to RegScavenger::initRegState().

This call should in fact be made by RegScavenger::enterBasicBlock()
called below. The first call does nothing except for triggering UB,
indicated by UBSan (passing nullptr to memset()).

llvm-svn: 254548

8 years ago[Hexagon] Remove std::hex in favor of format().
Alexey Samsonov [Wed, 2 Dec 2015 21:13:43 +0000 (21:13 +0000)]
[Hexagon] Remove std::hex in favor of format().

std::hex is not used anywhere in LLVM code base except for this place,
and it has a known undefined behavior (at least in libstdc++ 4.9.3):
https://llvm.org/bugs/show_bug.cgi?id=18156, which fires in UBSan
bootstrap of LLVM.

llvm-svn: 254547

8 years agoMake --results-file stdout implied if unspecified when using a results formatter.
Todd Fiala [Wed, 2 Dec 2015 21:12:17 +0000 (21:12 +0000)]
Make --results-file stdout implied if unspecified when using a results formatter.

Also cleans up pylint warnings (stock settings) in the modified function.

llvm-svn: 254546

8 years agoTests: PPC: remove unnecessary metadata. NFC
Kyle Butt [Wed, 2 Dec 2015 21:08:03 +0000 (21:08 +0000)]
Tests: PPC: remove unnecessary metadata. NFC

Remove unnecessary metadata from a test case.

llvm-svn: 254544

8 years agoAlso copy private linkage globals when needed.
Rafael Espindola [Wed, 2 Dec 2015 20:57:33 +0000 (20:57 +0000)]
Also copy private linkage globals when needed.

This was an omission when handling COFF style comdats with local keys.
Should fix the sanitizer-windows bot.

llvm-svn: 254543

8 years agoRe-enable UBSan tests for SystemZ: PR20980 was fixed.
Alexey Samsonov [Wed, 2 Dec 2015 20:46:51 +0000 (20:46 +0000)]
Re-enable UBSan tests for SystemZ: PR20980 was fixed.

llvm-svn: 254542

8 years agoDon't copy information from aliasee to alias.
Rafael Espindola [Wed, 2 Dec 2015 20:03:17 +0000 (20:03 +0000)]
Don't copy information from aliasee to alias.

They are independent.

llvm-svn: 254541

8 years agoAMDGPU/SI: Correctly emit agent global segment variables when targeting HSA
Tom Stellard [Wed, 2 Dec 2015 19:47:57 +0000 (19:47 +0000)]
AMDGPU/SI: Correctly emit agent global segment variables when targeting HSA

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

llvm-svn: 254540

8 years ago[Hexagon] Remove TFRI_V4 instruction, use existing A2_tfrsi instead
Krzysztof Parzyszek [Wed, 2 Dec 2015 19:44:35 +0000 (19:44 +0000)]
[Hexagon] Remove TFRI_V4 instruction, use existing A2_tfrsi instead

llvm-svn: 254539

8 years agoFix linking when we copy over only a decl.
Rafael Espindola [Wed, 2 Dec 2015 19:30:52 +0000 (19:30 +0000)]
Fix linking when we copy over only a decl.

We were failing to copy the fact that the GV is weak and in the case of
an alias, producing invalid IR.

llvm-svn: 254538

8 years agoFix the clang driver when "-nostdlib" is present
Sumanth Gundapaneni [Wed, 2 Dec 2015 19:12:41 +0000 (19:12 +0000)]
Fix the clang driver when "-nostdlib" is present

This patch is a fix to r252901 which changed the behavior of
clang driver. In the presence of "-nostdlib" none of the standard
libraries should be passed to link line.

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

llvm-svn: 254535

8 years agoUse sub-commands instead of --mode={client,server}.
Zachary Turner [Wed, 2 Dec 2015 19:00:52 +0000 (19:00 +0000)]
Use sub-commands instead of --mode={client,server}.

This is more pythonic and allows a more idiomatic way of getting
detailed usage information for each individual sub-command.

llvm-svn: 254533

8 years ago[CodeGen]: Fix bad interaction with AntiDep breaking and inline asm.
Kyle Butt [Wed, 2 Dec 2015 18:58:51 +0000 (18:58 +0000)]
[CodeGen]: Fix bad interaction with AntiDep breaking and inline asm.

AggressiveAntiDepBreaker was renaming registers specified by the user
for inline assembly. While this will work for compiler-specified
registers, it won't work for user-specified registers, and at the time
this runs, I don't currently see a way to distinguish them.

llvm-svn: 254532

8 years agoTest Commit: iteratee
Kyle Butt [Wed, 2 Dec 2015 18:53:33 +0000 (18:53 +0000)]
Test Commit: iteratee

Remove whitespace from blank lines. NFC

llvm-svn: 254531

8 years agoAdds candidate formatter for replacing legacy summary results.
Todd Fiala [Wed, 2 Dec 2015 18:48:38 +0000 (18:48 +0000)]
Adds candidate formatter for replacing legacy summary results.

Also cleans up some usages of strings where symbolic names
were safer and made more sense.

Try a test run with something like this to check out the new
basic results formatter (not used by default):

time test/dotest.py --executable `pwd`/build/Debug/lldb --results-formatter lldbsuite.test.basic_results_formatter.BasicResultsFormatter --results-file stdout

This will yield something like:

Testing: 1 test suites, 8 threads
1 out of 1 test suites processed - TestHelp.py
Test Results
Total Test Methods Run (excluding reruns): 13
Test Method rerun count: 0

===================
Test Result Summary
===================
Success:              13
Expected Failure:      0
Failure:               0
Error:                 0
Unexpected Success:    0
Skip:                  0

Whereas something with a bit of error will look more like this:

42 out of 42 test suites processed - TestSymbolTable.py
Test Results
Total Test Methods Run (excluding reruns): 166
Test Method rerun count: 0

===================
Test Result Summary
===================
Success:              93
Expected Failure:     10
Failure:               2
Error:                 2
Unexpected Success:    0
Skip:                 59

Details:
FAIL:
TestModulesInlineFunctions.ModulesInlineFunctionsTestCase.test_expr_dsym
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py)
FAIL:
TestModulesInlineFunctions.ModulesInlineFunctionsTestCase.test_expr_dwarf
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py)
ERROR: TestObjCCheckers.ObjCCheckerTestCase.test_objc_checker_dsym
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py)
ERROR: TestObjCCheckers.ObjCCheckerTestCase.test_objc_checker_dwarf
(/Users/tfiala/work/lldb-tot/git-svn/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py)

The Details header only prints if there are any issues to report.  The
Details section has tags that should get picked up using the normal
issue text scrapers (e.g. buildbot).

Test numbers reported are strictly test method runs.

The rerun bit at the top is in support of the multi-pass test
runner code (to run the low-load, single worker test pass for
tests that failed the first run), which I'll be able to put up
for review after this.

ResultsFormatters now have the ability to indicate they replace
the legacy summary, as this one does.

Once we come to agreement on the exact format, I will switch
us over to using this by default.

llvm-svn: 254530

8 years agoFix accidental off by one change
Fiona Glaser [Wed, 2 Dec 2015 18:46:23 +0000 (18:46 +0000)]
Fix accidental off by one change

Didn't break any tests, but did unnecessary extra work.

llvm-svn: 254529