Commit Graph

244245 Commits

Author SHA1 Message Date
Mehdi Amini ed76706008 Update documentation after r283671 ("Turn cl::values() (for enum) from a vararg function to using C++ variadic template")
llvm-svn: 283782
2016-10-10 17:13:14 +00:00
Marshall Clow 03344b3bdc Updated notes about issues; marked 2062, 2223, 2394, 2460 and 2540 as complete.
llvm-svn: 283781
2016-10-10 17:11:37 +00:00
Marshall Clow 089d54b540 Add tests to check that swap(std::function, std::function) is noexcept. This is LWG#2062, but we already do this. No changes to the library, just adding tests.
llvm-svn: 283780
2016-10-10 16:47:48 +00:00
Zachary Turner 3174bde6f4 Add llvm::apply to STLExtras.
This is equivalent to the C++14 std::apply().  Since we are not
using C++14 yet, this allows us to still make use of apply anyway.

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

llvm-svn: 283779
2016-10-10 16:44:09 +00:00
Justin Lebar b89d85fec0 [Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.
llvm-svn: 283778
2016-10-10 16:41:00 +00:00
Haojian Wu eaf77911b2 [clang-tidy] Add a whitelist option in google-runtime-references.
Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 283777
2016-10-10 16:38:11 +00:00
Mehdi Amini ce2da5e143 Use StringRef in LangOptions::isNoBuiltinFunc API (NFC)
llvm-svn: 283776
2016-10-10 16:34:07 +00:00
Justin Lebar 5f3d1dc44c [Analysis] Use unique_ptr for CallGraph::FunctionMap.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283775
2016-10-10 16:26:48 +00:00
Justin Lebar 5cb35e1676 [Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283774
2016-10-10 16:26:44 +00:00
Justin Lebar 82380d8eb4 [AST] Convert Marshallers to use unique_ptr.
Reviewers: timshen

Subscribers: cfe-commits, klimek

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

llvm-svn: 283773
2016-10-10 16:26:40 +00:00
Justin Lebar 03b0620192 Use unique_ptr for VTableBuilder::VBaseInfo map.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283772
2016-10-10 16:26:36 +00:00
Justin Lebar e920cfadf0 Use unique_ptr for VTableBuilder::VFTableLayouts map.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283771
2016-10-10 16:26:33 +00:00
Justin Lebar 562914e505 Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283770
2016-10-10 16:26:29 +00:00
Justin Lebar 072f9ba99a [AST] Use unique_ptr for VTableLayout.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283769
2016-10-10 16:26:24 +00:00
Justin Lebar 20ebffc99a [AST] Convert MangleNumberingContext to a unique_ptr.
Summary: It doesn't need to be refcounted anymore, either.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283768
2016-10-10 16:26:19 +00:00
Justin Lebar 611c5c225a Use unique_ptr in LLVMContextImpl's constant maps.
Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283767
2016-10-10 16:26:13 +00:00
Justin Lebar 28f09c50e2 [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.
Summary:
This is possible now that MapVector supports move-only values.

Depends on D25404.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283766
2016-10-10 16:26:08 +00:00
Justin Lebar 1109197156 [ADT] Add make_pointe{e,r}_iterator.
Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 283765
2016-10-10 16:26:03 +00:00
Justin Lebar 1b78217662 [ADT] Let MapVector handle non-copyable values.
Summary: The keys must still be copyable, because we store two copies of them.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 283764
2016-10-10 16:25:59 +00:00
Alexandros Lamprineas 20e9ddba73 [ARM] Fix invalid VLDM/VSTM access when targeting Big Endian with NEON
The instructions VLDM/VSTM can only access word-aligned memory
locations and produce alignment fault if the condition is not met.

The compiler currently generates VLDM/VSTM for v2f64 load/store
regardless the alignment of the memory access. Instead, if a v2f64
load/store is not word-aligned, the compiler should generate
VLD1/VST1. For each non double-word-aligned VLD1/VST1, a VREV
instruction should be generated when targeting Big Endian.

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

llvm-svn: 283763
2016-10-10 16:01:54 +00:00
Asiri Rathnayake 0c21b40d37 [libcxx] Fix gcc build.
Attempt to fix a horrible gcc include order problem.

llvm-svn: 283762
2016-10-10 15:56:01 +00:00
Nirav Dave f43cc9f8b5 Add return type for checkForValidSection parsing function. NFC Intended.
llvm-svn: 283761
2016-10-10 15:24:54 +00:00
Eugene Leviant cd8eaf891a [ELF] Don't emit empty PT_LOAD segment
Sometimes the very first PT_LOAD segment, created by lld, can be empty. 
This happens when (all conditions met):

- Linker script is used
- First section in ELF image is not RO
- Not enough space for program headers.

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

llvm-svn: 283760
2016-10-10 15:09:44 +00:00
Eric Fiselier 5df547c28e Fix documentation mis-spelling.
I promise to stop misspelling things when the English language gains a program
that does strict semantic checking.

llvm-svn: 283759
2016-10-10 14:45:06 +00:00
Zvi Rackover 2a21f125bd [X86] Prefer rotate by 1 over rotate by imm
Summary:
Rotate by 1 is translated to 1 micro-op, while rotate with imm8 is translated to 2 micro-ops.

Fixes pr30644.

Reviewers: delena, igorb, craig.topper, spatel, RKSimon

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

llvm-svn: 283758
2016-10-10 14:43:55 +00:00
Marshall Clow 8c7365a9fa Add whitespace to make not_fn_impl more clear. NFC.
llvm-svn: 283757
2016-10-10 14:37:18 +00:00
Simon Pilgrim cfef627b1f [SLPVectorizer][X86] Add 512-bit sitofp/uitofp tests
llvm-svn: 283756
2016-10-10 14:28:06 +00:00
Eric Fiselier 7ae80c6396 [Sema] Prevent using member declaration diagnostic if the base class is invalid.
Summary:
Once a base class has been made invalid (by a static_assert for example) all using-member declarations in the derived classes will result in a "not a base class" diagnostic. This diagnostic is very misleading and should not be emitted.

This change is needed to help libc++ produce reasonable diagnostics in `std::optional` and `std::variant`.  

Reviewers: rsmith, majnemer, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 283755
2016-10-10 14:26:40 +00:00
Haojian Wu ea99ff719b [include-fixer] query-mode should be false by default.
Makes it consistent with documentations.

llvm-svn: 283754
2016-10-10 14:21:55 +00:00
Nico Weber 21b9c7a6dc Revert r283683 because r283680 got reverted.
llvm-svn: 283753
2016-10-10 14:20:35 +00:00
Marshall Clow 33566a711d Mark issues 2544, 2567, 2569, 2686 and 2694 as ready/done.
llvm-svn: 283752
2016-10-10 14:15:56 +00:00
Simon Pilgrim 2c0733c678 [SLPVectorizer][X86] Add avx512 sitofp/uitofp tests
llvm-svn: 283751
2016-10-10 14:14:31 +00:00
Daniel Jasper e9abe64816 Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned allocation."
This reverts commit r283722. Breaks:
  Clang.SemaCUDA.device-var-init.cu
  Clang.CodeGenCUDA.device-var-init.cu

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/

llvm-svn: 283750
2016-10-10 14:13:55 +00:00
Marshall Clow 610ad3a598 Add tests for LWG2544. We already implement this; just adding tests to make sure that we keep doing it.
llvm-svn: 283749
2016-10-10 14:10:45 +00:00
Simon Pilgrim 6cadb5610e [SLPVectorizer][X86] Fixed alignments of scalar loads in sitofp/uitofp tests
Fixed copy+paste vector alignment to correct for per-element scalar loads

Increased to 512-bit data sizes in preparation of avx512 tests

llvm-svn: 283748
2016-10-10 14:10:41 +00:00
Nico Weber 67dd74ef89 Revert r283680.
Breaks bootstrap builds on (at least) Windows:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\lib\Support\Allocator.cpp:14:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/Allocator.h:24:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/ADT/SmallVector.h:20:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/MathExtras.h:19:
D:\buildslave\clang-x64-ninja-win7\stage1.install\bin\..\lib\clang\4.0.0\include\algorithm(63,8) :
    error: unknown type name '__device__'
    inline __device__ const __T &

llvm-svn: 283747
2016-10-10 14:10:00 +00:00
Michal Gorny 7cfe480122 [Driver] Make -print-libgcc-file-name print compiler-rt lib when used
Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.

The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:

  clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)

in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.

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

llvm-svn: 283746
2016-10-10 12:23:40 +00:00
Michael Kruse c9edc2ee8d [DepInfo] Print -debug output outside of max-operations scope.
ISL tries to simplify the polyhedral operations before printing its objects.
This increases the operations counter and therefore can contribute to hitting
the operations limit. Therefore the result could be different when -debug output
is enabled, making debugging harder.

llvm-svn: 283745
2016-10-10 11:45:59 +00:00
Michael Kruse 8bfba1ff46 [Support/DepInfo] Introduce IslMaxOperationsGuard and make DepInfo use it. NFC.
IslMaxOperationsGuard defines a scope where ISL may abort operations because if
it takes too many operations. Replace the call to the raw ISL interface by a
use of the guard.

IslMaxOperationsGuard provides a uniform way to define a maximal computation
time for a code region in C++ using RAII.

llvm-svn: 283744
2016-10-10 11:45:54 +00:00
Daniel Jasper 1eb779b5ae Revert "[x86][inline-asm][clang] accept 'v' constraint"
This reverts commit r283716.

Breaks buildbot:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/9155/testReport/junit/Clang/CodeGen/x86_inline_asm_v_constraint_c/

llvm-svn: 283743
2016-10-10 11:40:28 +00:00
Eugene Leviant 9257764d61 [ELF] Change argument type for findSections. NFC
llvm-svn: 283742
2016-10-10 11:23:12 +00:00
Simon Pilgrim 4aea8e8a39 Fixed windows stdout/stderr redirection in inline asm constraint tests
llvm-svn: 283741
2016-10-10 11:11:27 +00:00
George Rimar e4dce5ce3e [Object/ELF] - Do not crash on invalid Header->e_shoff value.
sections_begin() may return unalignment pointer when Header->e_shoff isinvalid.
That may result in a crash in clients, for example we have one in LLD:

assert((PtrWord & ~PointerBitMask) == 0 &&
       "Pointer is not sufficiently aligned");
fails when trying to push_back Elf_Shdr* (unaligned) into TinyPtrVector.

Patch forces check for alignment of Header->e_shoff.

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

llvm-svn: 283740
2016-10-10 10:51:38 +00:00
Nitesh Jain 2e2c24d2b2 [LLDB][MIPS] All tests get errors in dotest after this test.
Subscribers: jaydeep, bhushan, slthakur, llvm-commits
llvm-svn: 283739
2016-10-10 10:47:53 +00:00
George Rimar 27e651d4f6 Recommit r283733 "[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX.
With fix: commit changes from InputFiles.cpp too.

Original commit message:
We have following code in lld, that truncates the alignment value to 32 bit. Big alignment in this case
may give result 0 and crash later.

template <class ELFT>
CommonInputSection<ELFT>::CommonInputSection(std::vector<DefinedCommon *> Syms)
    : InputSection<ELFT>(nullptr, &Hdr, "") {
....
  for (DefinedCommon *Sym : Syms) {
    this->Alignment = std::max<uintX_t>(this->Alignment, Sym->Alignment);
...
  }
}

Patch fixes the issue.

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

llvm-svn: 283738
2016-10-10 10:31:03 +00:00
George Rimar a1b8245654 Revert r283733 "[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX."
Broke BB because forgot to commit source file.

llvm-svn: 283737
2016-10-10 10:27:38 +00:00
Manuel Klimek 5f85048385 Use `let' instead of `let*' in one place where `let*' isn't necessary
Differential Revision: https://reviews.llvm.org/D25395

Patch by Philipp Stephani.

llvm-svn: 283736
2016-10-10 10:22:40 +00:00
Peter Smith bafd3c40e2 [ELF][ARM] Fix formatting mistake, removed extra space before ) NFC.
llvm-svn: 283735
2016-10-10 10:18:58 +00:00
Peter Smith 0760605ac5 [ELF][ARM] Garbage collection support for .ARM.exidx sections
.ARM.exidx sections have a reverse dependency on the section they have
a SHF_LINK_ORDER dependency on. In other words a .ARM.exidx section is
live only if the executable section it describes is live. We implement
this with a reverse dependency field in InputSection.

Adding the dependency to InputSection is the simplest implementation
but it could be moved out to a separate map if it were found to decrease
performance for non ARM targets.

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

llvm-svn: 283734
2016-10-10 10:10:27 +00:00
George Rimar 50188b2771 [ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX.
We have following code in lld, that truncates the alignment value to 32 bit. Big alignment in this case
may give result 0 and crash later.

template <class ELFT>
CommonInputSection<ELFT>::CommonInputSection(std::vector<DefinedCommon *> Syms)
    : InputSection<ELFT>(nullptr, &Hdr, "") {
....
  for (DefinedCommon *Sym : Syms) {
    this->Alignment = std::max<uintX_t>(this->Alignment, Sym->Alignment);
...
  }
}

Patch fixes the issue.

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

llvm-svn: 283733
2016-10-10 10:10:09 +00:00