platform/upstream/llvm.git
7 years ago[MC] Prevent out of order HashDirective lexing in AsmLexer.
Nirav Dave [Sat, 1 Oct 2016 00:42:32 +0000 (00:42 +0000)]
[MC] Prevent out of order HashDirective lexing in AsmLexer.

To lex hash directives we peek ahead to find component tokens, create a
unified token, and unlex the peeked tokens so the parser does not need
to parse the tokens then. Make sure we do not to lex another hash
directive during peek operation.

This fixes PR28921.

Reviewers: rnk, loladiro

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24839

llvm-svn: 282992

7 years agoAdd support for some extended push instructions in i386/x86_64 like
Jason Molenda [Sat, 1 Oct 2016 00:19:26 +0000 (00:19 +0000)]
Add support for some extended push instructions in i386/x86_64 like
'push 0x20(%esp)' which clang can generate when emitting
-fomit-frame-pointer code for 32-bit.

Add a unit test program which includes this instruction.

Also fix a bug in the refactoring/rewrite of the x86 assembly
instruction profiler where I'd hard coded it as a 64-bit disassembler
instead of using the ArchSpec to pick a 32-bit or 64-bit disassembler
from llvm.  When the disassembler would hit an instruction
that is invalid in 64-bit mode, it would stop disassembling the function.
This likely led to the TestSBData testsuite failure on linux with 32-bit
i386 and gcc-4.9; I'll test that in a bit.

The newly added unit test program is 32-bit i386 code and it includes
an instruction which is invalid in 64-bit mode so it will catch this.

<rdar://problem/28557876>

llvm-svn: 282991

7 years agotest infra: clear file-charged issues on rerun of file
Todd Fiala [Sat, 1 Oct 2016 00:17:08 +0000 (00:17 +0000)]
test infra: clear file-charged issues on rerun of file

This change addresses the corner case bug in the test
infrastructure where a test file times out *outside*
of any running test method.  In those cases, the issue
was charged to the file, not to a test method within
the file.  When that file is re-run successfully,
none of the test-method-level successes would clear
the file-level issue.

This change fixes that: for all test files that are
getting rerun (whether by being marked flaky or
via the --rerun-all-issues flag), file-level test
issues are searched for in each of those files.  Each
file-level issue found in the rerun file list then
gets cleared.

A test of this feature is added to issue_verification,
using the technique there of moving the *.py.park file
to *.py to do an end-to-end validation.

This change also adds a .gitignore entry for pyenv
project-level files and fixes up a few minor pep8
formatting violations in files I touched.

Fixes:
llvm.org/pr27423

llvm-svn: 282990

7 years agoFix crash when emitting error.
Richard Trieu [Sat, 1 Oct 2016 00:15:24 +0000 (00:15 +0000)]
Fix crash when emitting error.

With templated classes, is possible to not be able to determine is a member
function is a special member function before the class is instantiated.  Only
these special member functions can be defaulted.  In some cases, knowing
whether a function is a special member function can't be determined until
instantiation, so an uninstantiated function could possibly be defaulted too.
Add a case to the error diagnostic when the function marked with a default is
not known to be a special member function.

llvm-svn: 282989

7 years ago[ASAN] Add the binder globals on Darwin to llvm.compiler.used to avoid LTO dead-stripping
Mehdi Amini [Sat, 1 Oct 2016 00:05:34 +0000 (00:05 +0000)]
[ASAN] Add the binder globals on Darwin to llvm.compiler.used to avoid LTO dead-stripping

The binder is in a specific section that "reverse" the edges in a
regular dead-stripping: the binder is live as long as a global it
references is live.

This is a big hammer that prevents LLVM from dead-stripping these,
while still allowing linker dead-stripping (with special knowledge
of the section).

Differential Revision: https://reviews.llvm.org/D24673

llvm-svn: 282988

7 years ago[CUDA] Harmonize asserts in SemaCUDA, NFC.
Justin Lebar [Fri, 30 Sep 2016 23:57:38 +0000 (23:57 +0000)]
[CUDA] Harmonize asserts in SemaCUDA, NFC.

llvm-svn: 282987

7 years ago[CUDA] Disallow __constant__ local variables.
Justin Lebar [Fri, 30 Sep 2016 23:57:34 +0000 (23:57 +0000)]
[CUDA] Disallow __constant__ local variables.

Reviewers: tra, rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25129

llvm-svn: 282986

7 years ago[CUDA] Disallow 'extern __shared__' variables.
Justin Lebar [Fri, 30 Sep 2016 23:57:30 +0000 (23:57 +0000)]
[CUDA] Disallow 'extern __shared__' variables.

Also add a test that we disallow

  __constant__ __shared__ int x;

because it's possible to break this without breaking

  __shared__ __constant__ int x;

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D25125

llvm-svn: 282985

7 years agoFix tests to not assume they know exactly what will be in Clang's predefines buffer.
Richard Smith [Fri, 30 Sep 2016 23:47:58 +0000 (23:47 +0000)]
Fix tests to not assume they know exactly what will be in Clang's predefines buffer.

llvm-svn: 282984

7 years ago[libFuzzer] remove some experimental code
Kostya Serebryany [Fri, 30 Sep 2016 23:29:27 +0000 (23:29 +0000)]
[libFuzzer] remove some experimental code

llvm-svn: 282983

7 years ago[llvm-objdump] Switch to a range loop. NFCI.
Davide Italiano [Fri, 30 Sep 2016 23:22:42 +0000 (23:22 +0000)]
[llvm-objdump] Switch to a range loop. NFCI.

llvm-svn: 282982

7 years agoFix bogus "inline namespace cannot be reopened as non-inline" diagnostic to
Richard Smith [Fri, 30 Sep 2016 23:16:08 +0000 (23:16 +0000)]
Fix bogus "inline namespace cannot be reopened as non-inline" diagnostic to
just warn that the second declaration is missing the 'inline' keyword. This is
valid, and we shouldn't be suggesting otherwise.

llvm-svn: 282981

7 years agoCodeGen: inherit DLLExport attribute in Windows Itanium
Saleem Abdulrasool [Fri, 30 Sep 2016 23:11:05 +0000 (23:11 +0000)]
CodeGen: inherit DLLExport attribute in Windows Itanium

When emitting the fundamental type information constants, inherit the
DLLExportAttr from `__fundamental_type_info`.  We would previously not
honor the `__declspec(dllexport)` on the type information.

llvm-svn: 282980

7 years agoScheduleDAGInstrs: Cleanup, use range based for; NFC
Matthias Braun [Fri, 30 Sep 2016 23:08:07 +0000 (23:08 +0000)]
ScheduleDAGInstrs: Cleanup, use range based for; NFC

llvm-svn: 282979

7 years agoFix up the test so it gets closer to passing.
Jim Ingham [Fri, 30 Sep 2016 22:55:57 +0000 (22:55 +0000)]
Fix up the test so it gets closer to passing.

Remove the test for thread stopped states from this test.
That isn't set properly now, and its setting doesn't matter till we actually support non-stop debugging, so
we shouldn't have unrelated tests failing from it.

Also changed some code that was trying and failing to grub command line output, and replaced
it by SB API calls.

llvm-svn: 282976

7 years agoP0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we
Richard Smith [Fri, 30 Sep 2016 22:41:36 +0000 (22:41 +0000)]
P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we
assume that ::operator new provides no more alignment than is necessary for any
primitive type, except when we're on a GNU OS, where glibc's malloc guarantees
to provide 64-bit alignment on 32-bit systems and 128-bit alignment on 64-bit
systems. This can be controlled by the command-line -fnew-alignment flag.

llvm-svn: 282974

7 years ago[coroutines] Diagnose when 'main' is declared as a coroutine.
Eric Fiselier [Fri, 30 Sep 2016 22:38:31 +0000 (22:38 +0000)]
[coroutines] Diagnose when 'main' is declared as a coroutine.

Summary: The title says it all.

Reviewers: rsmith, GorNishanov

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D25078

llvm-svn: 282973

7 years ago[libFuzzer] fix openssl fuzzer tests when running on a machine w/o openssl installed
Kostya Serebryany [Fri, 30 Sep 2016 22:35:08 +0000 (22:35 +0000)]
[libFuzzer] fix openssl fuzzer tests when running on a machine w/o openssl installed

llvm-svn: 282972

7 years ago[libFuzzer] remove unused option
Kostya Serebryany [Fri, 30 Sep 2016 22:29:57 +0000 (22:29 +0000)]
[libFuzzer] remove unused option

llvm-svn: 282971

7 years agoAdd the radar on our end to the bugreport string.
Jim Ingham [Fri, 30 Sep 2016 22:24:11 +0000 (22:24 +0000)]
Add the radar on our end to the bugreport string.

llvm-svn: 282970

7 years agoAdd the radar from our end to the bugreport string.
Jim Ingham [Fri, 30 Sep 2016 22:22:09 +0000 (22:22 +0000)]
Add the radar from our end to the bugreport string.

llvm-svn: 282969

7 years ago[Sema] Support lax conversions for compound assignments
Bruno Cardoso Lopes [Fri, 30 Sep 2016 22:19:38 +0000 (22:19 +0000)]
[Sema] Support lax conversions for compound assignments

Support lax convertions on compound assignment expressions like:

  typedef __attribute__((vector_size(8))) double float64x1_t;
  typedef __attribute__((vector_size(16))) double float64x2_t;
  float64x1_t vget_low_f64(float64x2_t __p0);

  double c = 3.0;
  float64x2_t v = {0.0, 1.0};
  c += vget_low_f64(v);

This restores one more valid behavior pre r266366, and is a incremental
follow up from work committed in r274646.

While here, make the check more strict, add FIXMEs, clean up variable
names to match what they can actually be and update testcases to reflect
that. We now reject:

  typedef float float2 __attribute__ ((vector_size (8)));
  double d;
  f2 += d;

which doesn't fit as a direct bitcast anyway.

Differential Revision: https://reviews.llvm.org/D24472

rdar://problem/28033929

llvm-svn: 282968

7 years ago[SEH] Emit the parent frame offset label even if there are no funclets
Reid Kleckner [Fri, 30 Sep 2016 22:10:12 +0000 (22:10 +0000)]
[SEH] Emit the parent frame offset label even if there are no funclets

This avoids errors about references to undefined local labels from
unreferenced filter functions.

Fixes (sort of) PR30431

llvm-svn: 282967

7 years agoIsValid is the way to ask a breakpoint location whether it is valid.
Jim Ingham [Fri, 30 Sep 2016 22:07:41 +0000 (22:07 +0000)]
IsValid is the way to ask a breakpoint location whether it is valid.

llvm-svn: 282966

7 years ago[cmake] Fix for a bug https://llvm.org/bugs/show_bug.cgi?id=30489 "Cannot build with...
Paul Osmialowski [Fri, 30 Sep 2016 22:05:45 +0000 (22:05 +0000)]
[cmake] Fix for a bug https://llvm.org/bugs/show_bug.cgi?id=30489 "Cannot build with -DLIBOMP_FORTRAN_MODULES=True"

Differential Revision: https://reviews.llvm.org/D24959

llvm-svn: 282965

7 years agoUse StringSwtich::Cases for multiple choices.
Rui Ueyama [Fri, 30 Sep 2016 22:01:25 +0000 (22:01 +0000)]
Use StringSwtich::Cases for multiple choices.

llvm-svn: 282964

7 years ago[sanitizer-coverage] fix docs
Kostya Serebryany [Fri, 30 Sep 2016 21:57:10 +0000 (21:57 +0000)]
[sanitizer-coverage] fix docs

llvm-svn: 282962

7 years ago[AArch64][RegisterBankInfo] Use the helper functions for the checks
Quentin Colombet [Fri, 30 Sep 2016 21:46:21 +0000 (21:46 +0000)]
[AArch64][RegisterBankInfo] Use the helper functions for the checks

This makes sure the helper functions work as expected.

NFC.

llvm-svn: 282961

7 years ago[AArch64][RegisterBankInfo] Rename getValueMappingIdx to getValueMapping
Quentin Colombet [Fri, 30 Sep 2016 21:46:19 +0000 (21:46 +0000)]
[AArch64][RegisterBankInfo] Rename getValueMappingIdx to getValueMapping

We don't return index, we return the actual ValueMapping.

NFC.

llvm-svn: 282960

7 years ago[AArch64][RegisterBankInfo] Compress the ValueMapping table a bit.
Quentin Colombet [Fri, 30 Sep 2016 21:46:17 +0000 (21:46 +0000)]
[AArch64][RegisterBankInfo] Compress the ValueMapping table a bit.

We don't need to have singleton ValueMapping on their own, we can just
reuse one of the elements of the 3-ops mapping.
This allows even more code sharing.

NFC.

llvm-svn: 282959

7 years ago[AArch64][RegisterBankInfo] Refactor the code to access AArch64::ValMapping
Quentin Colombet [Fri, 30 Sep 2016 21:46:15 +0000 (21:46 +0000)]
[AArch64][RegisterBankInfo] Refactor the code to access AArch64::ValMapping

Use a helper function to access ValMapping. This should make the code
easier to understand and maintain.

NFC.

llvm-svn: 282958

7 years ago[AArch64][RegisterBankInfo] Rename getRegBankIdx to getRegBankIdxOffset
Quentin Colombet [Fri, 30 Sep 2016 21:46:12 +0000 (21:46 +0000)]
[AArch64][RegisterBankInfo] Rename getRegBankIdx to getRegBankIdxOffset

The function name did not make it clear that the returned value was an
offset to apply to a register bank index.

NFC.

llvm-svn: 282957

7 years ago[AArch64][RegisterBankInfo] Use the static opds mapping for alt mappings
Quentin Colombet [Fri, 30 Sep 2016 21:45:56 +0000 (21:45 +0000)]
[AArch64][RegisterBankInfo] Use the static opds mapping for alt mappings

Avoid to rely on the dynamically allocated operands mapping for the
alternative mapping.
NFC.

llvm-svn: 282956

7 years ago[libFuzzer] move common parts of shell scripts into a separate file
Kostya Serebryany [Fri, 30 Sep 2016 21:12:30 +0000 (21:12 +0000)]
[libFuzzer] move common parts of shell scripts into a separate file

llvm-svn: 282954

7 years ago[libfuzzer] sancov documentation update
Mike Aizatsky [Fri, 30 Sep 2016 21:07:04 +0000 (21:07 +0000)]
[libfuzzer] sancov documentation update

llvm-svn: 282953

7 years agoNFC Add const
Piotr Padlewski [Fri, 30 Sep 2016 21:05:55 +0000 (21:05 +0000)]
NFC Add const

llvm-svn: 282952

7 years agoNFC fix class members initialization
Piotr Padlewski [Fri, 30 Sep 2016 21:05:52 +0000 (21:05 +0000)]
NFC fix class members initialization

llvm-svn: 282951

7 years agoNFC fix doxygen comments
Piotr Padlewski [Fri, 30 Sep 2016 21:05:49 +0000 (21:05 +0000)]
NFC fix doxygen comments

llvm-svn: 282950

7 years agoAdd missing std::move in Replacements::add
Alexander Shaposhnikov [Fri, 30 Sep 2016 21:05:45 +0000 (21:05 +0000)]
Add missing std::move in Replacements::add

This diff adds std::move to avoid copying of
the Replacement NewR in the method Replacements::add.

Test plan: make -j8 check-all

Differential revision: https://reviews.llvm.org/D25049

llvm-svn: 282949

7 years ago[sancov] -symbolize documentation update
Mike Aizatsky [Fri, 30 Sep 2016 21:02:56 +0000 (21:02 +0000)]
[sancov] -symbolize documentation update

llvm-svn: 282948

7 years agoInsert missing checks for KMP_AFFINITY_CAPABLE() in affinity API.
Jonathan Peyton [Fri, 30 Sep 2016 20:56:44 +0000 (20:56 +0000)]
Insert missing checks for KMP_AFFINITY_CAPABLE() in affinity API.

If affinity is not capable, then these API functions will perform the stubs
version.

llvm-svn: 282947

7 years agoChange for LLVM upstream change r282944.
Rui Ueyama [Fri, 30 Sep 2016 20:53:45 +0000 (20:53 +0000)]
Change for LLVM upstream change r282944.

llvm-svn: 282945

7 years agoDo not pass a superblock to PDBFileBuilder.
Rui Ueyama [Fri, 30 Sep 2016 20:52:12 +0000 (20:52 +0000)]
Do not pass a superblock to PDBFileBuilder.

When we create a PDB file using PDBFileBuilder, the information
in the superblock, such as the size of the resulting file, is not
available.

Previously, PDBFileBuilder::initialize took a superblock assuming
that all the members of the struct are correct. That is useful when
you want to restore the exact information from a YAML file, but
that's probably the only use case in which that is useful.
When we are creating a PDB file on the fly, we have to backfill the
members.

This patch redefines PDBFileBuilder::initialize to take only a
block size. Now all the other members are left as default values,
so that they'll be updated when commit() is called.

Differential Revision: https://reviews.llvm.org/D25108

llvm-svn: 282944

7 years agoAdding ivars in class extensions isn't supported on i386; skip a test.
Sean Callanan [Fri, 30 Sep 2016 20:46:09 +0000 (20:46 +0000)]
Adding ivars in class extensions isn't supported on i386; skip a test.

llvm-svn: 282943

7 years agoChange for LLVM change r282940.
Rui Ueyama [Fri, 30 Sep 2016 20:39:04 +0000 (20:39 +0000)]
Change for LLVM change r282940.

llvm-svn: 282942

7 years agoFix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo:...
Dawn Perchik [Fri, 30 Sep 2016 20:38:33 +0000 (20:38 +0000)]
Fix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo::LookupInfo.

llvm-svn: 282941

7 years agoPass a filename instead of a msf::WritableStream to PDBFileBuilder::commit.
Rui Ueyama [Fri, 30 Sep 2016 20:34:44 +0000 (20:34 +0000)]
Pass a filename instead of a msf::WritableStream to PDBFileBuilder::commit.

WritableStream needs the exact file size to open a file, but
until we fix the final layout of a PDB file, we don't know the
size of the file.

This patch changes the parameter type of PDBFileBuilder::commit
to solve that chiecken-and-egg problem. Now the function opens
a file after fixing the layout, so it can create a file with the
exact size.

Differential Revision: https://reviews.llvm.org/D25107

llvm-svn: 282940

7 years agoSort LLVM_VERSION_INFO
Joerg Sonnenberger [Fri, 30 Sep 2016 20:34:02 +0000 (20:34 +0000)]
Sort LLVM_VERSION_INFO

llvm-svn: 282939

7 years agoGC left-over from workarounds for missing pid_t and size_t
Joerg Sonnenberger [Fri, 30 Sep 2016 20:32:42 +0000 (20:32 +0000)]
GC left-over from workarounds for missing pid_t and size_t

llvm-svn: 282938

7 years agoGC ENABLE_PIC
Joerg Sonnenberger [Fri, 30 Sep 2016 20:30:25 +0000 (20:30 +0000)]
GC ENABLE_PIC

llvm-svn: 282936

7 years agoGC HAVE___DSO_HANDLE
Joerg Sonnenberger [Fri, 30 Sep 2016 20:29:19 +0000 (20:29 +0000)]
GC HAVE___DSO_HANDLE

llvm-svn: 282935

7 years agoCorrectly expand HOST_LINK_VERSION.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:28:42 +0000 (20:28 +0000)]
Correctly expand HOST_LINK_VERSION.

llvm-svn: 282934

7 years agoFix expansion of HAVE_SYS_MMAN_H
Joerg Sonnenberger [Fri, 30 Sep 2016 20:27:41 +0000 (20:27 +0000)]
Fix expansion of HAVE_SYS_MMAN_H

llvm-svn: 282933

7 years agoGC HAVE_LINK_EXPORT_DYNAMIC.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:26:31 +0000 (20:26 +0000)]
GC HAVE_LINK_EXPORT_DYNAMIC.

llvm-svn: 282932

7 years agoGC HAVE_MMAP and HAVE_MMAP_FILE
Joerg Sonnenberger [Fri, 30 Sep 2016 20:24:54 +0000 (20:24 +0000)]
GC HAVE_MMAP and HAVE_MMAP_FILE

llvm-svn: 282931

7 years agoSpell comment consistently with other library comments.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:24:21 +0000 (20:24 +0000)]
Spell comment consistently with other library comments.

llvm-svn: 282930

7 years agoSort LINK_POLLY_INTO_TOOLS.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:21:35 +0000 (20:21 +0000)]
Sort LINK_POLLY_INTO_TOOLS.

llvm-svn: 282929

7 years agoGC STDC_HEADERS.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:19:02 +0000 (20:19 +0000)]
GC STDC_HEADERS.

llvm-svn: 282928

7 years ago[CUDA] Fix implicit-device-lambda.cu after r282911.
Justin Lebar [Fri, 30 Sep 2016 20:17:37 +0000 (20:17 +0000)]
[CUDA] Fix implicit-device-lambda.cu after r282911.

This commit added a warning that we're (correctly) hitting in this test.
Just ignore it.

llvm-svn: 282927

7 years agoRemoved a test that should've been removed with r282916.
Rui Ueyama [Fri, 30 Sep 2016 20:17:26 +0000 (20:17 +0000)]
Removed a test that should've been removed with r282916.

llvm-svn: 282926

7 years agoDeal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP
Joerg Sonnenberger [Fri, 30 Sep 2016 20:17:23 +0000 (20:17 +0000)]
Deal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP
to check for the former, don't depend on (dangling) HAVE_MMAP_ANONYMOUS.

llvm-svn: 282925

7 years agoRetire NEED_DEV_ZERO_FOR_MMAP. It should be needed only on outdated
Joerg Sonnenberger [Fri, 30 Sep 2016 20:16:01 +0000 (20:16 +0000)]
Retire NEED_DEV_ZERO_FOR_MMAP. It should be needed only on outdated
systems. It wasn't even hooked up in cmake, so problems on such systems
would be visible with 3.9 release already.

llvm-svn: 282924

7 years agoHAVE_LINK_R is not the only reason why this needs config.h.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:11:21 +0000 (20:11 +0000)]
HAVE_LINK_R is not the only reason why this needs config.h.

llvm-svn: 282923

7 years agoGC HAVE_LIBDL, HAVE_LIBM and HAVE_LIBOLE32
Joerg Sonnenberger [Fri, 30 Sep 2016 20:09:45 +0000 (20:09 +0000)]
GC HAVE_LIBDL, HAVE_LIBM and HAVE_LIBOLE32

llvm-svn: 282922

7 years agoSort HAVE_LIBEDIT.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:08:36 +0000 (20:08 +0000)]
Sort HAVE_LIBEDIT.

llvm-svn: 282921

7 years agoX86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)
Hans Wennborg [Fri, 30 Sep 2016 20:07:35 +0000 (20:07 +0000)]
X86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)

We can't use Jcc to leave a Win64 function in general, because that
confuses the unwinder. However, for "leaf" functions, that is, functions
where the return address is always on top of the stack and which don't
have unwind info, it's OK.

Differential Revision: https://reviews.llvm.org/D24836

llvm-svn: 282920

7 years agoTurn ENABLE_CRASH_OVERRIDES into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:06:19 +0000 (20:06 +0000)]
Turn ENABLE_CRASH_OVERRIDES into a 0/1 definition.

llvm-svn: 282919

7 years agoConvert ENABLE_BACKTRACES into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:04:24 +0000 (20:04 +0000)]
Convert ENABLE_BACKTRACES into a 0/1 definition.

llvm-svn: 282918

7 years agoGC TIME_WITH_SYS_TIME and TM_IN_SYS_TIME
Joerg Sonnenberger [Fri, 30 Sep 2016 19:59:58 +0000 (19:59 +0000)]
GC TIME_WITH_SYS_TIME and TM_IN_SYS_TIME

llvm-svn: 282917

7 years agoRemove an warning message that can be spammy.
Rui Ueyama [Fri, 30 Sep 2016 19:59:25 +0000 (19:59 +0000)]
Remove an warning message that can be spammy.

This was intended to warn on a usage error of an ar command.
I was thinking that false positive would be rare because it
has two guards: it warns only when an archive file has no symbols
and contains at least one file.

Turned out that false positive would probably be not that rare.
You wouldn't intentionally create an object file that contains no
exported symbols, but with conditional compile guards, you could
create such file. If it is for a LTO build, you could create an
archive file containing such file. That means there's no way to
detect the usage error in a reliable manner.

This patch simply removes the warning.

llvm-svn: 282916

7 years agoGC STAT_MACROS_BROKEN.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:58:44 +0000 (19:58 +0000)]
GC STAT_MACROS_BROKEN.

llvm-svn: 282915

7 years agoGC NEED_USCORE.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:57:54 +0000 (19:57 +0000)]
GC NEED_USCORE.

llvm-svn: 282914

7 years ago[scudo] Fix an edge case in the secondary allocator
Kostya Kortchinsky [Fri, 30 Sep 2016 19:57:21 +0000 (19:57 +0000)]
[scudo] Fix an edge case in the secondary allocator

Summary:
s/CHECK_LT/CHECK_LE/ in the secondary allocator, as under certain circumstances
Ptr + Size can be equal to MapEnd. This edge case was not found by the current
tests, so those were extended to be able to catch that.

Reviewers: kcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25101

llvm-svn: 282913

7 years ago[CUDA] Remove incorrect comment in CUDASetLambdaAttrs.
Justin Lebar [Fri, 30 Sep 2016 19:55:59 +0000 (19:55 +0000)]
[CUDA] Remove incorrect comment in CUDASetLambdaAttrs.

I'd said that nvcc doesn't allow you to add __host__ or __device__
attributes on lambdas in all circumstances, but I believe this was user
error on my part.  I can't reproduce these warnings/errors if I pass
--expt-extended-lambda to nvcc.

llvm-svn: 282912

7 years ago[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(....
Justin Lebar [Fri, 30 Sep 2016 19:55:55 +0000 (19:55 +0000)]
[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

Summary:
This is probably the sane place for the attribute to go, but nvcc
specifically rejects it.  Other GNU-style attributes are allowed in this
position (although judging from the warning it emits for
host/device/global, those attributes are applied to the lambda's
anonymous struct, not to the function itself).

It would be nice to have a FixIt message here, but doing so, or even
just getting the correct range for the attribute, including its '((' and
'))'s, is apparently Hard.

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D25115

llvm-svn: 282911

7 years ago[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA...
Justin Lebar [Fri, 30 Sep 2016 19:55:48 +0000 (19:55 +0000)]
[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

Summary: There's an overload that we can use to make this a bit cleaner.

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D25114

llvm-svn: 282910

7 years agoTurn LLVM_USE_OPROFILE into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:55:37 +0000 (19:55 +0000)]
Turn LLVM_USE_OPROFILE into a 0/1 definition.

llvm-svn: 282909

7 years agoTurn LLVM_USE_INTEL_JITEVENTS into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:54:25 +0000 (19:54 +0000)]
Turn LLVM_USE_INTEL_JITEVENTS into a 0/1 definition.

llvm-svn: 282908

7 years agoTurn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
Joerg Sonnenberger [Fri, 30 Sep 2016 19:52:27 +0000 (19:52 +0000)]
Turn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
LLVM_ENABLE_THREADS. Include llvm-config.h explicitly in headers to make
sure that the definition is available.

llvm-svn: 282907

7 years ago[InstCombine] allow non-splat folds of select cond (ext X), C
Sanjay Patel [Fri, 30 Sep 2016 19:49:22 +0000 (19:49 +0000)]
[InstCombine] allow non-splat folds of select cond (ext X), C

llvm-svn: 282906

7 years ago[compiler-rt] Fix interception of crt atoll on win10 CRT.
Etienne Bergeron [Fri, 30 Sep 2016 19:37:11 +0000 (19:37 +0000)]
[compiler-rt] Fix interception of crt atoll on win10 CRT.

Summary:
The check-asan-dynamic tests were broken on win10 because the interception
library was not able to hook on some functions.

credits: thanks sebastian marchand to help debugging this on win10.

Reviewers: rnk

Subscribers: chrisha, llvm-commits, dberris

Differential Revision: https://reviews.llvm.org/D25120

llvm-svn: 282904

7 years agoRevert test change in r282894 as it's broken in some platforms.
Dehao Chen [Fri, 30 Sep 2016 19:25:23 +0000 (19:25 +0000)]
Revert test change in r282894 as it's broken in some platforms.

llvm-svn: 282903

7 years ago[Coroutines] Part15c: Fix coro-split to correctly handle definitions between coro...
Gor Nishanov [Fri, 30 Sep 2016 19:24:19 +0000 (19:24 +0000)]
[Coroutines] Part15c: Fix coro-split to correctly handle definitions between coro.save and coro.suspend

Summary:
In the case below, %Result.i19 is defined between coro.save and coro.suspend and used after coro.suspend. We need to correctly place such a value into the coroutine frame.

```
  %save = call token @llvm.coro.save(i8* null)
  %Result.i19 = getelementptr inbounds %"struct.lean_future<int>::Awaiter", %"struct.lean_future<int>::Awaiter"* %ref.tmp7, i64 0, i32 0
  %suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
  switch i8 %suspend, label %exit [
    i8 0, label %await.ready
    i8 1, label %exit
  ]
await.ready:
  %val = load i32, i32* %Result.i19

```

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24418

llvm-svn: 282902

7 years ago[InstCombine] add tests for non-splat select(ext)
Sanjay Patel [Fri, 30 Sep 2016 19:15:41 +0000 (19:15 +0000)]
[InstCombine] add tests for non-splat select(ext)

llvm-svn: 282901

7 years ago[MS] Implement __iso_volatile loads/stores as builtins
Martin Storsjo [Fri, 30 Sep 2016 19:13:46 +0000 (19:13 +0000)]
[MS] Implement __iso_volatile loads/stores as builtins

These are supposed to produce the same as normal volatile
pointer loads/stores. When -volatile:ms is specified,
normal volatile pointers are forced to have atomic semantics
(as is the default on x86 in MSVC mode). In that case,
these builtins should still produce non-atomic volatile
loads/stores without acquire/release semantics, which
the new test verifies.

These are only available on ARM (and on AArch64,
although clang doesn't support AArch64/Windows yet).

This implements what is missing for PR30394, making it possible
to compile C++ for ARM in MSVC mode with MSVC headers.

Differential Revision: https://reviews.llvm.org/D24986

llvm-svn: 282900

7 years ago[Coroutines] Part15b: Fix dbg information handling in coro-split.
Gor Nishanov [Fri, 30 Sep 2016 19:05:06 +0000 (19:05 +0000)]
[Coroutines] Part15b: Fix dbg information handling in coro-split.

Summary:
Without the fix, if there was a function inlined into the coroutine with debug information, CloneFunctionInto(NewF, &F, VMap, /*ModuleLevelChanges=*/true, Returns); would duplicate all of the debug information including the DICompileUnit.

We know use VMap to indicate that debug metadata for a File, Unit and FunctionType should not be duplicated when we creating clones that will become f.resume, f.destroy and f.cleanup.

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D24417

llvm-svn: 282899

7 years agoFixed several i386 Objective-C tests by completing objects, not their pointers.
Sean Callanan [Fri, 30 Sep 2016 18:44:43 +0000 (18:44 +0000)]
Fixed several i386 Objective-C tests by completing objects, not their pointers.

llvm-svn: 282898

7 years ago[Coroutines] Part 15a: Lower coro.subfn.addr in CoroCleanup
Gor Nishanov [Fri, 30 Sep 2016 18:41:35 +0000 (18:41 +0000)]
[Coroutines] Part 15a: Lower coro.subfn.addr in CoroCleanup

Summary: Not all coro.subfn.addr intrinsics can be eliminated in CoroElide through devirtualization. Those that remain need to be lowered in CoroCleanup.

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24412

llvm-svn: 282897

7 years agoclean up tests and auto-generate checks
Sanjay Patel [Fri, 30 Sep 2016 18:37:34 +0000 (18:37 +0000)]
clean up tests and auto-generate checks

llvm-svn: 282896

7 years agocmake: Install the OCaml libraries into a more correct path
Michal Gorny [Fri, 30 Sep 2016 18:34:23 +0000 (18:34 +0000)]
cmake: Install the OCaml libraries into a more correct path

Add a OCAML_INSTALL_PATH variable that can be used to control
the install path for OCaml libraries. The new variable defaults to
${OCAML_STDLIB_PATH}, i.e. the OCaml library path obtained from
the OCaml compiler. Install libraries into "llvm" subdirectory.

This fixes two issues:

1. OCaml library directories differ between systems, and 'lib/ocaml' is
incorrect e.g. on amd64 Gentoo where OCaml is installed
in 'lib64/ocaml'. Therefore, obtain the library path from the OCaml
compiler using 'ocamlc -where' (which is already used to set
OCAML_STDLIB_PATH), which is the method used commonly in OCaml packages.

2. The top-level directory is reserved for the standard library, and has
precedence over local directory in search path. As a result, OCaml
preferred the files installed along with previous LLVM version over the
source tree when building a new version, resulting in two versions being
mixed during the build. The new layout is used commonly by other OCaml
packages, and findlib is able to find the LLVM libraries successfully.

Bug: https://bugs.gentoo.org/559134
Bug: https://bugs.gentoo.org/559624

Differential Revision: https://reviews.llvm.org/D24354

llvm-svn: 282895

7 years agoUpdate loop unroller cost model to make sure debug info does not affect optimization...
Dehao Chen [Fri, 30 Sep 2016 18:30:04 +0000 (18:30 +0000)]
Update loop unroller cost model to make sure debug info does not affect optimization decisions.

Summary: Debug info should *not* affect optimization decisions. This patch updates loop unroller cost model to make it not affected by debug info.

Reviewers: davidxl, mzolotukhin

Subscribers: haicheng, llvm-commits, mzolotukhin

Differential Revision: https://reviews.llvm.org/D25098

llvm-svn: 282894

7 years ago[CodeGen] Add assertion for indirect array index expression generation. NFC.
Michael Kruse [Fri, 30 Sep 2016 18:29:37 +0000 (18:29 +0000)]
[CodeGen] Add assertion for indirect array index expression generation. NFC.

Currently Polly cannot generate code for index expressions if the base pointer
is computed within the scop. The base pointer must be generated as well, but
there is no code that triggers that.

Add an assertion to detect when this would occur and miscompile. The IR verifier
should catch it as well.

llvm-svn: 282893

7 years ago[libFuzzer] add a fuzzer test that finds CVE-2015-3193
Kostya Serebryany [Fri, 30 Sep 2016 18:16:16 +0000 (18:16 +0000)]
[libFuzzer] add a fuzzer test that finds CVE-2015-3193

llvm-svn: 282892

7 years ago[InstCombine] add tests for select X, (ext X), C
Sanjay Patel [Fri, 30 Sep 2016 18:10:14 +0000 (18:10 +0000)]
[InstCombine] add tests for select X, (ext X), C

llvm-svn: 282891

7 years ago[WebAssembly] Make register stackification more conservative
Derek Schuff [Fri, 30 Sep 2016 18:02:54 +0000 (18:02 +0000)]
[WebAssembly] Make register stackification more conservative

Register stackification currently checks VNInfo for changes. Make that
more accurate by testing each intervening instruction for any other defs
to the same virtual register.

Patch by Jacob Gravelle

Differential Revision: https://reviews.llvm.org/D24942

llvm-svn: 282886

7 years agoImprove error check for an empty archive.
Rui Ueyama [Fri, 30 Sep 2016 17:56:20 +0000 (17:56 +0000)]
Improve error check for an empty archive.

Previously, it warned on any archive file that has no symbol.
It turned out that that is too noisy.

With this patch, it warns on such archive file that contains no file.

Differential Revision: https://reviews.llvm.org/D25111

llvm-svn: 282885

7 years ago[Object] Define Archive::isEmpty().
Rui Ueyama [Fri, 30 Sep 2016 17:54:31 +0000 (17:54 +0000)]
[Object] Define Archive::isEmpty().

llvm-svn: 282884

7 years ago[Support] Complete ISL annotations to IslPtr<>. NFC.
Michael Kruse [Fri, 30 Sep 2016 17:47:39 +0000 (17:47 +0000)]
[Support] Complete ISL annotations to IslPtr<>. NFC.

Add missing __isl_(give/take/keep) annotations to IslPtr<> and NonowningIslPtr<>
methods.

Because IslPtr's constructor's annotation would depend on the TakeOwnership
parameter, the parameter has been removed. Caller must copy the object
themselves if the do not want to take ownership.

llvm-svn: 282883

7 years ago[compiler-rt] Add support for the dynamic shadow allocation
Etienne Bergeron [Fri, 30 Sep 2016 17:47:34 +0000 (17:47 +0000)]
[compiler-rt] Add support for the dynamic shadow allocation

Summary:
This patch is adding support for dynamic shadow allocation.

This is a merge and re-commit of the following patches.

```
[compiler-rt] Fix Asan build on Android
  https://reviews.llvm.org/D24768
[compiler-rt] Add support for the dynamic shadow allocation
  https://reviews.llvm.org/D23363
```

This patch needed to re-land at the same time:
```
[asan] Support dynamic shadow address instrumentation
  https://reviews.llvm.org/D23354
```

Reviewers: rnk, zaks.anna

Subscribers: tberghammer, danalbert, kubabrecka, dberris, chrisha, llvm-commits

Differential Revision: https://reviews.llvm.org/D25104

llvm-svn: 282882

7 years ago[asan] Support dynamic shadow address instrumentation
Etienne Bergeron [Fri, 30 Sep 2016 17:46:32 +0000 (17:46 +0000)]
[asan] Support dynamic shadow address instrumentation

Summary:
This patch is adding the support for a shadow memory with
dynamically allocated address range.

The compiler-rt needs to export a symbol containing the shadow
memory range.

This is required to support ASAN on windows 64-bits.

Reviewers: kcc, rnk, vitalybuka

Subscribers: zaks.anna, kubabrecka, dberris, llvm-commits, chrisha

Differential Revision: https://reviews.llvm.org/D23354

llvm-svn: 282881