platform/upstream/llvm.git
8 years agoAPInt: Simplify EqualSlowCase
Matthias Braun [Wed, 10 Feb 2016 22:13:10 +0000 (22:13 +0000)]
APInt: Simplify EqualSlowCase

Previously the code used getActiveBits() to determine the highest set
bit of each APInt first. However doing so requires the same amount of
memory accesses as simply comparing both numbers right away.

Removing all the active bit checks leads to simpler code and is faster
in my benchmark.

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

llvm-svn: 260447

8 years agoFix buildbot failure (hosts without zlib)
Xinliang David Li [Wed, 10 Feb 2016 22:05:41 +0000 (22:05 +0000)]
Fix buildbot failure (hosts without zlib)

llvm-svn: 260446

8 years agoWhen importing Objective-C protocols, mark them as having external decls.
Sean Callanan [Wed, 10 Feb 2016 22:00:32 +0000 (22:00 +0000)]
When importing Objective-C protocols, mark them as having external decls.

We already do this for Objective-C interfaces, but we never handled protocols
because the DWARF didn't represent them.  Nowadays, though, we can import them
from modules, and we have to mark them properly.

<rdar://problem/24193009>

llvm-svn: 260445

8 years agoELF: Combine cases that has the same code.
Rui Ueyama [Wed, 10 Feb 2016 22:00:21 +0000 (22:00 +0000)]
ELF: Combine cases that has the same code.

llvm-svn: 260444

8 years agoRemove changes that snuck in within r260431
Eric Fiselier [Wed, 10 Feb 2016 21:58:36 +0000 (21:58 +0000)]
Remove changes that snuck in within r260431

llvm-svn: 260443

8 years agoRestore "[ThinLTO] Use MD5 hash in function index." with fix
Teresa Johnson [Wed, 10 Feb 2016 21:55:02 +0000 (21:55 +0000)]
Restore "[ThinLTO] Use MD5 hash in function index." with fix

This restores commit r260408, along with a fix for a bot failure.

The bot failure was caused by dereferencing a unique_ptr in the same
call instruction parameter list where it was passed via std::move.
Apparently due to luck this was not exposed when I built the compiler
with clang, only with gcc.

llvm-svn: 260442

8 years agoFix invalid casts in <functional>.
Evgeniy Stepanov [Wed, 10 Feb 2016 21:53:28 +0000 (21:53 +0000)]
Fix invalid casts in <functional>.

static_cast of a pointer to object before the start of the object's
lifetime has undefined behavior.

This code triggers CFI warnings.

This change replaces C-style casts with reinterpret_cast, which is
fine per the standard, add applies an attribute to silence CFI (which
barks on reinterpret_cast, too).

llvm-svn: 260441

8 years agoFix copy/paste error in TestCModules.
Zachary Turner [Wed, 10 Feb 2016 21:47:36 +0000 (21:47 +0000)]
Fix copy/paste error in TestCModules.

llvm-svn: 260440

8 years ago[LVI] Handle constants defensively
Philip Reames [Wed, 10 Feb 2016 21:46:32 +0000 (21:46 +0000)]
[LVI] Handle constants defensively

There's nothing preventing callers of LVI from asking for lattice values representing a Constant.  In fact, given that several callers are walking back through PHI nodes and trying to simplify predicates, such queries are actually quite common.  This is mostly harmless today, but we start volatiling assertions if we add new calls to getBlockValue in otherwise reasonable places.

Note that this change is not NFC.  Specifically:
1) The result returned through getValueAt will now be more precise.  In principle, this could trigger any latent infinite optimization loops in callers, but in practice, we're unlikely to see this.
2) The result returned through getBlockValueAt is potentially weakened for non-constants that were previously queried.  With the old code, you had the possibility that a later query might bypass the cache and discover some information the original query did not.  I can't find a scenario which actually causes this to happen, but it was in principle possible.  On the other hand, this may end up reducing compile time when the same value is queried repeatedly.

llvm-svn: 260439

8 years ago[WebAssembly] Re-triage list of compilation failures for torture tests
Derek Schuff [Wed, 10 Feb 2016 21:43:16 +0000 (21:43 +0000)]
[WebAssembly] Re-triage list of compilation failures for torture tests

llvm-svn: 260438

8 years agoUse ArrayRef instead of deep copies of CompactUnwindEntries. NFC.
Pete Cooper [Wed, 10 Feb 2016 21:32:24 +0000 (21:32 +0000)]
Use ArrayRef instead of deep copies of CompactUnwindEntries.  NFC.

We have a vector of all of the compact unwind entries anyway, and
its live as long as we need it to be.  So instead of copying from that
vector to another, just take references to the range of the original vector
we need for each compact unwind page.

llvm-svn: 260437

8 years agoNo reason for these two letters to be uppercase
Enrico Granata [Wed, 10 Feb 2016 21:30:20 +0000 (21:30 +0000)]
No reason for these two letters to be uppercase

llvm-svn: 260436

8 years ago[clang-cl] /Z7 now generates normal debug info, not just line info
Reid Kleckner [Wed, 10 Feb 2016 21:28:38 +0000 (21:28 +0000)]
[clang-cl] /Z7 now generates normal debug info, not just line info

Previously LLVM could not process any debug info we produced, so it
didn't make sense to spend time generating it. Now that it has primitive
support for local variable info, it does make sense to generate normal
debug info.

llvm-svn: 260435

8 years agoNow that SymbolFileDWARF supports having types in completely separate .pcm file with...
Greg Clayton [Wed, 10 Feb 2016 21:28:13 +0000 (21:28 +0000)]
Now that SymbolFileDWARF supports having types in completely separate .pcm file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument:

    llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files

Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries.

This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files.

<rdar://problem/24581488>

llvm-svn: 260434

8 years agoTest commit, fixed "clang" to "Clang" in docs
Mandeep Singh Grang [Wed, 10 Feb 2016 21:06:10 +0000 (21:06 +0000)]
Test commit, fixed "clang" to "Clang" in docs

Reviewers: weimingz

Subscribers: cfe-commits

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

llvm-svn: 260433

8 years ago[codeview] Describe int local variables using .cv_def_range
Reid Kleckner [Wed, 10 Feb 2016 20:55:49 +0000 (20:55 +0000)]
[codeview] Describe int local variables using .cv_def_range

Summary:
Refactor common value, scope, and label tracking logic out of DwarfDebug
into a common base class called DebugHandlerBase.

Update an old LLVM IR test case to avoid an assertion in LexicalScopes.

Reviewers: dblaikie, majnemer

Subscribers: llvm-commits

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

llvm-svn: 260432

8 years agoRecommit r260012 - Cleanup node-type handling in the unordered containers.
Eric Fiselier [Wed, 10 Feb 2016 20:46:23 +0000 (20:46 +0000)]
Recommit r260012 - Cleanup node-type handling in the unordered containers.

This time I kept <ext/hash_map> working!

This patch is the first in a series of patches that's meant to better
support unordered_map. unordered_map has a special "value_type" that
differs from pair<const Key, Value>. In order to meet the EmplaceConstructible
and CopyInsertable requirements we need to teach __hash_table about this
special value_type.

This patch creates a "__hash_node_types" traits class that contains
all of the typedefs needed by the unordered containers and it's iterators.
These typedefs include ones for each node type and  node pointer type,
as well as special typedefs for "unordered_map"'s value type.

As a result of this change all of the unordered containers now all support
incomplete types.

As a drive-by fix I changed the difference_type in __hash_table to always
be ptrdiff_t. There is a corresponding change to size_type but it cannot
take affect until an ABI break.

This patch will be followed up shortly with fixes for various unordered_map
bugs and problems.

llvm-svn: 260431

8 years ago[llvm-readobj] Option to emit readelf like output
Hemant Kulkarni [Wed, 10 Feb 2016 20:40:55 +0000 (20:40 +0000)]
[llvm-readobj] Option to emit readelf like output

New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

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

llvm-svn: 260430

8 years ago[WebAssembly] Address comments left over from r260421
Derek Schuff [Wed, 10 Feb 2016 20:14:15 +0000 (20:14 +0000)]
[WebAssembly] Address comments left over from r260421

llvm-svn: 260429

8 years ago[Coverage] add covmap v2 binary format regression test
Xinliang David Li [Wed, 10 Feb 2016 20:14:04 +0000 (20:14 +0000)]
[Coverage] add covmap v2 binary format regression test

llvm-svn: 260428

8 years agoAMDGPU: Release the scavenged offset register during VGPR spill
Nicolai Haehnle [Wed, 10 Feb 2016 20:13:58 +0000 (20:13 +0000)]
AMDGPU: Release the scavenged offset register during VGPR spill

Summary:
This fixes a crash where subsequent spills would be unable to scavenge
a register. In particular, it fixes a crash in piglit's
spec@glsl-1.50@execution@geometry@max-input-components (the test still
has a shader that fails to compile because of too many SGPR spills, but
at least it doesn't crash any more).

This is a candidate for the release branch.

Reviewers: arsenm, tstellarAMD

Subscribers: qcolombet, arsenm

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

llvm-svn: 260427

8 years ago[x86] refactor masked load/store combine logic ; NFCI
Sanjay Patel [Wed, 10 Feb 2016 20:02:45 +0000 (20:02 +0000)]
[x86] refactor masked load/store combine logic ; NFCI

llvm-svn: 260426

8 years agoDon't assume that there is only one strchr overload in the global namespace;
Richard Smith [Wed, 10 Feb 2016 20:02:04 +0000 (20:02 +0000)]
Don't assume that there is only one strchr overload in the global namespace;
that's not true in general. Instead, use a preference order to pick the
standard C++ signature 'char*(char*, int)' where possible and fall back to the
C signature 'char*(const char*, int)' only when it's unavailable.

llvm-svn: 260425

8 years ago[ELF][MIPS] Add lazy relocation support for MIPS
Simon Atanasyan [Wed, 10 Feb 2016 19:57:19 +0000 (19:57 +0000)]
[ELF][MIPS] Add lazy relocation support for MIPS

The patch adds lazy relocation support for MIPS and R_MIPS_26 relocation
handing.

R_MIPS_26 relocation might require PLT entry creation. In that case it
is fully supported by the patch. But if the relocation target is a local
symbol we need to use a different expression to calculate the relocation
result. This case is not implemented yet because there is no method to
get know the kind of relocation target in the `relocateOne` routine.

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

llvm-svn: 260424

8 years agoRemove skipUnlessListedRemote.
Zachary Turner [Wed, 10 Feb 2016 19:53:45 +0000 (19:53 +0000)]
Remove skipUnlessListedRemote.

This was supposed to have been removed but made it back in
accidentally.

llvm-svn: 260423

8 years agoRemove expectedFailureLinux decorator.
Zachary Turner [Wed, 10 Feb 2016 19:53:36 +0000 (19:53 +0000)]
Remove expectedFailureLinux decorator.

llvm-svn: 260422

8 years ago[WebAssembly] Switch varags calling convention to use a register
Derek Schuff [Wed, 10 Feb 2016 19:51:04 +0000 (19:51 +0000)]
[WebAssembly] Switch varags calling convention to use a register

Instead of passing varargs directly on the user stack, allocate a buffer in
the caller's stack frame and pass a pointer to it. This simplifies the C
ABI (e.g. non-C callers of C functions do not need to use C's user stack if
they have their own mechanism) and allows further optimizations in the future
(e.g. fewer functions may need to use the stack).

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

llvm-svn: 260421

8 years ago[analyzer] Windows: launch scan-build from an arbitrary location.
Anton Yartsev [Wed, 10 Feb 2016 19:46:41 +0000 (19:46 +0000)]
[analyzer] Windows: launch scan-build from an arbitrary location.

The following batch files allow to launch scan-build from an arbitrary location if path to clang\tools\scan-build-py\bin is added to %PATH%.

llvm-svn: 260420

8 years ago[AArch64] Refactor is logic into a helper function. NFC.
Chad Rosier [Wed, 10 Feb 2016 19:45:48 +0000 (19:45 +0000)]
[AArch64] Refactor is logic into a helper function.  NFC.

llvm-svn: 260419

8 years agoFix a -Wsign-compare in Support Path unittests
Reid Kleckner [Wed, 10 Feb 2016 19:29:01 +0000 (19:29 +0000)]
Fix a -Wsign-compare in Support Path unittests

llvm-svn: 260418

8 years agoSilence MSVC warning about falling off the end of a function after a fully covered...
Reid Kleckner [Wed, 10 Feb 2016 19:28:13 +0000 (19:28 +0000)]
Silence MSVC warning about falling off the end of a function after a fully covered switch

llvm-svn: 260417

8 years agoDisable MSVC 2015's warning about zero extending after ~ and others
Reid Kleckner [Wed, 10 Feb 2016 19:25:51 +0000 (19:25 +0000)]
Disable MSVC 2015's warning about zero extending after ~ and others

Very often in LLVM we have APIs that take a bitwidth and a uint64_t that
we pass immediates such as ~0U to. Consider APInt, Constant, and
MachineInstrBuilder::addImm. Fixing all uses of these APIs to manually
extend their arguments to uint64_t doesn't seem worth it.

llvm-svn: 260416

8 years agoFix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Eugene Zelenko [Wed, 10 Feb 2016 19:11:58 +0000 (19:11 +0000)]
Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes.

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

llvm-svn: 260414

8 years agoSilence some MSVC warnings about zero extending unsigned to void*
Reid Kleckner [Wed, 10 Feb 2016 19:11:15 +0000 (19:11 +0000)]
Silence some MSVC warnings about zero extending unsigned to void*

llvm-svn: 260413

8 years agoRevert "[ThinLTO] Use MD5 hash in function index." due to bot failure
Teresa Johnson [Wed, 10 Feb 2016 19:11:15 +0000 (19:11 +0000)]
Revert "[ThinLTO] Use MD5 hash in function index." due to bot failure

This reverts commit r260408. Bot failure that I need to investigate.

llvm-svn: 260412

8 years agoSilence some MSVC false positive warnings about integer zexts and falling off the...
Reid Kleckner [Wed, 10 Feb 2016 19:09:15 +0000 (19:09 +0000)]
Silence some MSVC false positive warnings about integer zexts and falling off the end of a covered switch

llvm-svn: 260411

8 years agoEnable constexpr on Visual Studio 2015, add support for two equivalent attributes
Reid Kleckner [Wed, 10 Feb 2016 19:07:47 +0000 (19:07 +0000)]
Enable constexpr on Visual Studio 2015, add support for two equivalent attributes

Patch by Alexander Riccio

This patch enables `constexpr` on Visual Studio 2015 by adding `||
LLVM_MSC_PREREQ(1900)` to the preprocessor `#if` statement. Since VS2013
doesn't support `constexpr`, that's purposely excluded. The
`LLVM_CONSTEXPR` macro is used in ~25 places.

I also added the MSVC/SAL equivalent of:

  - `__attribute__((__warn_unused_result__))` as an
    `LLVM_ATTRIBUTE_UNUSED_RESULT` definition

  - `__attribute__((returns_nonnull))` as an
    `LLVM_ATTRIBUTE_RETURNS_NONNULL` definition

...in case anybody ever decides to run `/analyze` on LLVM (probably
myself, if anybody)

Reviewers: rnk, aaron.ballman

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

llvm-svn: 260410

8 years agoFix return type of bool function
Matt Arsenault [Wed, 10 Feb 2016 19:04:12 +0000 (19:04 +0000)]
Fix return type of bool function

llvm-svn: 260409

8 years ago[ThinLTO] Use MD5 hash in function index.
Teresa Johnson [Wed, 10 Feb 2016 18:57:54 +0000 (18:57 +0000)]
[ThinLTO] Use MD5 hash in function index.

Summary:
This patch uses the lower 64-bits of the MD5 hash of a function name as
a GUID in the function index, instead of storing function names. Any
local functions are first given a global name by prepending the original
source file name. This is the same naming scheme and GUID used by PGO in
the indexed profile format.

This change has a couple of benefits. The primary benefit is size
reduction in the combined index file, for example 483.xalancbmk's
combined index file was reduced by around 70%. It should also result in
memory savings for the index file in memory, as the in-memory map is
also indexed by the hash instead of the string.

Second, this enables integration with indirect call promotion, since the
indirect call profile targets are recorded using the same global naming
convention and hash. This will enable the function importer to easily
locate function summaries for indirect call profile targets to enable
their import and subsequent promotion.

The original source file name is recorded in the bitcode in a new
module-level record for use in the ThinLTO backend pipeline.

Reviewers: davidxl, joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 260408

8 years ago[ADT] Add "return *this;" to PointerEmbeddedInt::operator=.
Jordan Rose [Wed, 10 Feb 2016 18:54:41 +0000 (18:54 +0000)]
[ADT] Add "return *this;" to PointerEmbeddedInt::operator=.

llvm-svn: 260407

8 years ago[AArch64] Update comment to match reality. NFC.
Chad Rosier [Wed, 10 Feb 2016 18:49:28 +0000 (18:49 +0000)]
[AArch64] Update comment to match reality. NFC.

llvm-svn: 260406

8 years agoDisable the new Orc lazy JIT tests on Windows, they do not pass
Reid Kleckner [Wed, 10 Feb 2016 18:46:42 +0000 (18:46 +0000)]
Disable the new Orc lazy JIT tests on Windows, they do not pass

llvm-svn: 260405

8 years agoSelectionDAG: Make Properties a field of SDPatternOperator
Matt Arsenault [Wed, 10 Feb 2016 18:40:04 +0000 (18:40 +0000)]
SelectionDAG: Make Properties a field of SDPatternOperator

Currently you can't specify node properties like commutativity on
a PatFrag. If you want to create a PatFrag on a commutative node
with a hasOneUse predicate, this enables you to specify that the
PatFrag is also commutable.

llvm-svn: 260404

8 years agoSelectionDAG: Make min/max commutative and associative
Matt Arsenault [Wed, 10 Feb 2016 18:39:57 +0000 (18:39 +0000)]
SelectionDAG: Make min/max commutative and associative

llvm-svn: 260403

8 years agoRollback 260394 -- 32bit test needs more config support
Xinliang David Li [Wed, 10 Feb 2016 18:38:27 +0000 (18:38 +0000)]
Rollback 260394 -- 32bit test needs more config support

llvm-svn: 260402

8 years ago[MC] Merge VK_PPC_TPREL in to generic VK_TPREL.
Colin LeMahieu [Wed, 10 Feb 2016 18:32:01 +0000 (18:32 +0000)]
[MC] Merge VK_PPC_TPREL in to generic VK_TPREL.

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

llvm-svn: 260401

8 years ago[PGO] Indirect-call profile annotation in IR level profiling
Rong Xu [Wed, 10 Feb 2016 18:24:45 +0000 (18:24 +0000)]
[PGO] Indirect-call profile annotation in IR level profiling

This patch reads the indirect-call value records in the profile and makes the
annotation in the indirect-call instruction. This is for IR level profile
instrumentation.

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

llvm-svn: 260400

8 years agoAMDGPU: Fix indentation and variable names
Matt Arsenault [Wed, 10 Feb 2016 18:21:45 +0000 (18:21 +0000)]
AMDGPU: Fix indentation and variable names

llvm-svn: 260399

8 years agoAMDGPU: Split R600 and SI load lowering
Matt Arsenault [Wed, 10 Feb 2016 18:21:39 +0000 (18:21 +0000)]
AMDGPU: Split R600 and SI load lowering

These weren't actually sharing anything in the common
LowerLOAD.

llvm-svn: 260398

8 years agoRevert "[llvm-readobj] Option to emit readelf like output"
Hemant Kulkarni [Wed, 10 Feb 2016 18:21:01 +0000 (18:21 +0000)]
Revert "[llvm-readobj] Option to emit readelf like output"

This reverts commit a58765909660a7195b32e0cc8c7476168b913750.

llvm-svn: 260397

8 years ago[pdbdump] Fix test for different type ordering with DIA 2015
Reid Kleckner [Wed, 10 Feb 2016 18:17:17 +0000 (18:17 +0000)]
[pdbdump] Fix test for different type ordering with DIA 2015

llvm-svn: 260396

8 years ago[ThinLTO] Move global processing from Linker to TransformUtils (NFC)
Teresa Johnson [Wed, 10 Feb 2016 18:11:31 +0000 (18:11 +0000)]
[ThinLTO] Move global processing from Linker to TransformUtils (NFC)

Summary:
As discussed on IRC, move the ThinLTOGlobalProcessing code out of
the linker, and into TransformUtils. The name of the class is changed
to FunctionImportGlobalProcessing.

Reviewers: joker.eph, rafael

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 260395

8 years agoAdd tests for -m32
Xinliang David Li [Wed, 10 Feb 2016 17:57:55 +0000 (17:57 +0000)]
Add tests for -m32

llvm-svn: 260394

8 years ago[PGO] coverage map bug with cov data produced for 32bit target
Xinliang David Li [Wed, 10 Feb 2016 17:57:08 +0000 (17:57 +0000)]
[PGO] coverage map bug with cov data produced for 32bit target

Fix the result truncation bug: [PR26560]
Test case is following (compiler-rt).

llvm-svn: 260393

8 years ago[llvm-nm] Add -radix option
Hemant Kulkarni [Wed, 10 Feb 2016 17:51:39 +0000 (17:51 +0000)]
[llvm-nm] Add -radix option

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

llvm-svn: 260392

8 years ago[llvm-readobj] Option to emit readelf like output
Hemant Kulkarni [Wed, 10 Feb 2016 17:51:28 +0000 (17:51 +0000)]
[llvm-readobj] Option to emit readelf like output

New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

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

llvm-svn: 260391

8 years ago[SPARC] Repair floating-point condition encodings in assembly parser.
James Y Knight [Wed, 10 Feb 2016 17:47:20 +0000 (17:47 +0000)]
[SPARC] Repair floating-point condition encodings in assembly parser.

The encodings for floating point conditions A(lways) and N(ever) were
incorrectly specified for the assembly parser, per Sparc manual v8 page
121. This change corrects that mistake.

Also, strangely, all of the branch instructions already had MC test
cases, except for the broken ones. Added the tests.

Patch by Chris Dewhurst

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

llvm-svn: 260390

8 years agoRename a member variable to be more accurate with how it is used
Daniel Berlin [Wed, 10 Feb 2016 17:41:25 +0000 (17:41 +0000)]
Rename a member variable to be more accurate with how it is used

llvm-svn: 260389

8 years ago[MS ABI] Never reference dllimport'd vtables
David Majnemer [Wed, 10 Feb 2016 17:40:47 +0000 (17:40 +0000)]
[MS ABI] Never reference dllimport'd vtables

Referencing a dllimported vtable is impossible in a constexpr
constructor.  It would be friendlier to C++ programmers if we
synthesized a copy of the vftable which referenced imported virtual
functions.  This would let us initialize the object in a way which
preserves both the intent to import functionality from another DLL while
also making constexpr work.

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

llvm-svn: 260388

8 years agoConstify two functions, make them accessible to unit tests
Daniel Berlin [Wed, 10 Feb 2016 17:39:43 +0000 (17:39 +0000)]
Constify two functions, make them accessible to unit tests

llvm-svn: 260387

8 years agoDisable all llvm-config tests for now, will investigate later
Ehsan Akhgari [Wed, 10 Feb 2016 17:29:50 +0000 (17:29 +0000)]
Disable all llvm-config tests for now, will investigate later

llvm-svn: 260386

8 years ago[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles
Rong Xu [Wed, 10 Feb 2016 17:18:30 +0000 (17:18 +0000)]
[PGO] Differentiate Clang instrumentation and IR level instrumentation profiles

This patch uses one bit in profile version to differentiate Clang
instrumentation and IR level instrumentation profiles.

PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so
that the compiler runtime can set the right profile kind.
For Maco-O platform, we generate the variable as linkonce_odr linkage as
COMDAT is not supported.

PGOInstrumenation now checks this bit to make sure it's an IR level
instrumentation profile.

The patch was submitted as r260164 but reverted due to a Darwin test breakage.
Original Differential Revision: http://reviews.llvm.org/D15540

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

llvm-svn: 260385

8 years agoAdd support for R_X86_64_DTPOFF64.
Rafael Espindola [Wed, 10 Feb 2016 16:26:31 +0000 (16:26 +0000)]
Add support for R_X86_64_DTPOFF64.

It is used by clang to produce debug info for tls variables.

llvm-svn: 260384

8 years ago[AArch64] This bit of logic is specific to pairing. NFC.
Chad Rosier [Wed, 10 Feb 2016 15:52:46 +0000 (15:52 +0000)]
[AArch64] This bit of logic is specific to pairing. NFC.

llvm-svn: 260383

8 years agoFix VST_CODE_* bitcode id comments (NFC)
Teresa Johnson [Wed, 10 Feb 2016 15:02:51 +0000 (15:02 +0000)]
Fix VST_CODE_* bitcode id comments (NFC)

llvm-svn: 260382

8 years agoLimit catopen usage to unix-like OSes
Ben Craig [Wed, 10 Feb 2016 13:47:25 +0000 (13:47 +0000)]
Limit catopen usage to unix-like OSes

Operating systems that are not unix-like are unlikely to have access to
catopen. Instead of black-listing each one, we now filter out all non-unix
operating systems first. We then exclude the unix-like operating systems
that don't have catopen. _WIN32 counts as a unix-like operating system
because of cygwin.

http://reviews.llvm.org/D16639

llvm-svn: 260381

8 years agoUse a SymbolBody to represent the personality.
Rafael Espindola [Wed, 10 Feb 2016 13:19:32 +0000 (13:19 +0000)]
Use a SymbolBody to represent the personality.

NFC, just more in line with the rest of lld.

Thanks to Rui for the suggestion.

llvm-svn: 260380

8 years agoReapply the patch of r260376.
Andrey Turetskiy [Wed, 10 Feb 2016 12:56:10 +0000 (12:56 +0000)]
Reapply the patch of r260376.

llvm-svn: 260379

8 years agoclang-format sort include use the source file name to determine the
Daniel Jasper [Wed, 10 Feb 2016 12:42:58 +0000 (12:42 +0000)]
clang-format sort include use the source file name to determine the
"main include" that will be the 1st include (category 0).

Because the clang-format visual studio extension does not pass the file
name and use the standard input, sort include cannot find a "main
include":

Testing fix on llvm\tools\clang\lib\Format\Format.cpp:
Original file:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Without fix, selecting the includes and running visual studio
clang-format:
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Format/Format.h"
  #include "clang/Lex/Lexer.h"

With fix, selecting the includes and running visual studio clang-format:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Test 2 with main header not at the start:
Original file:
  ...
  #include "clang/Format/Format.h"
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Without fix, selecting the includes and running visual studio
clang-format:
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Format/Format.h"
  #include "clang/Lex/Lexer.h"

With fix, selecting the includes and running visual studio clang-format:
  #include "clang/Format/Format.h"
  ...
  #include "clang/Basic/SourceManager.h"
  #include "clang/Lex/Lexer.h"

Patch by Jean-Philippe Dufraigne, thank you.
Review: http://reviews.llvm.org/D16524

llvm-svn: 260378

8 years agoRevert "Improve the handling of missing elf symtab and missing symbol sizes"
Tamas Berghammer [Wed, 10 Feb 2016 12:10:58 +0000 (12:10 +0000)]
Revert "Improve the handling of missing elf symtab and missing symbol sizes"

This reverts commit 252dda67782f2cbf838e375bce21ed4191f6d9ce.

The commit caused several test failure on the OSX build bot.

llvm-svn: 260377

8 years ago[X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.
Andrey Turetskiy [Wed, 10 Feb 2016 11:58:46 +0000 (11:58 +0000)]
[X86] Fix stack alignment for MCU target (Clang part), by Anton Nadolskiy.

This patch fixes stack alignments for MCU (should be aligned to 4 bytes).

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

llvm-svn: 260376

8 years ago[X86] Fix stack alignment for MCU target, by Anton Nadolskiy.
Andrey Turetskiy [Wed, 10 Feb 2016 11:57:06 +0000 (11:57 +0000)]
[X86] Fix stack alignment for MCU target, by Anton Nadolskiy.

This patch fixes stack alignments for MCU (should be aligned to 4 bytes).

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

llvm-svn: 260375

8 years ago[OPENMP 4.5] Initial support for data members in 'firstprivate' clause.
Alexey Bataev [Wed, 10 Feb 2016 11:29:16 +0000 (11:29 +0000)]
[OPENMP 4.5] Initial support for data members in 'firstprivate' clause.
OpenMP 4.5 allows privatization of non-static data members of current
class in non-static member functions.

llvm-svn: 260374

8 years agoFix assertion "Chunk.Kind == DeclaratorChunk::Function" with attributed type.
Denis Zobnin [Wed, 10 Feb 2016 11:23:48 +0000 (11:23 +0000)]
Fix assertion "Chunk.Kind == DeclaratorChunk::Function" with attributed type.

This patch is to upgrade FunctionTypeUnwrapper for correct processing of
AttributedType. Fixes PR25786.
Patch by Alexander Makarov.

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

llvm-svn: 260373

8 years ago[RenderScript] Refactor allocation expressions
Ewan Crawford [Wed, 10 Feb 2016 11:23:27 +0000 (11:23 +0000)]
[RenderScript] Refactor allocation expressions

Patch refractors RS plugin code specifying how format strings are used to JIT the runtime.

Author: Dean De Leo <dean@codeplay.com>
llvm-svn: 260372

8 years agoFix PR26543: add a check for definition in CXXRecordDecl.
Alexey Bataev [Wed, 10 Feb 2016 10:50:12 +0000 (10:50 +0000)]
Fix PR26543: add a check for definition in CXXRecordDecl.

llvm-svn: 260370

8 years agoImprove the handling of missing elf symtab and missing symbol sizes
Tamas Berghammer [Wed, 10 Feb 2016 10:43:34 +0000 (10:43 +0000)]
Improve the handling of missing elf symtab and missing symbol sizes

* Generate artificial symbol names from eh_fame during symbol parsing
  so these symbols are already present when we calcualte the size of
  the symbols where 0 is specified.
* Fix symbol size calculation for the last symbol in the file where
  it have to last until the end of the parent section.

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

llvm-svn: 260369

8 years agoFix handling of the arm IT instruction in the unwinder
Tamas Berghammer [Wed, 10 Feb 2016 10:42:13 +0000 (10:42 +0000)]
Fix handling of the arm IT instruction in the unwinder

The IT instruction can specify condition code for up to 4 consecutive
instruction and it is used quite often by clang in epilogues causing
an issue when trying to unwind from locations covered by the IT
instruction and for locatins inmediately after the IT instruction.

Changes made to fix it:
* Introduce the concept of conditional instruction block what is a list
  of consecutive instructions with the same condition. We update the
  unwind information during the conditional instruction block and when
  we reach the end of it (first instruction with a differemt condition)
  then we restore the unwind information we had before the condition.
* Fix a bug in the ARM instruction emulator where neither PC nor the
  ITSTATE was advanced when we reached an instruction what we can't
  decode.

After the change we have no regression on android-arm running the
regular test suit and TestStandardUnwind also passes when running it
with clang as the compiler (previously it failed on an IT instruction).

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

llvm-svn: 260368

8 years agoUse BKPT instead of UDF for arm/thumb breakpoints
Tamas Berghammer [Wed, 10 Feb 2016 10:42:00 +0000 (10:42 +0000)]
Use BKPT instead of UDF for arm/thumb breakpoints

The UDF instruction is deprecated in armv7 and in case of thumb2
instructions set it don't work well together with the IT instruction.

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

llvm-svn: 260367

8 years agoAdd new option to lldb-server to display its version
Tamas Berghammer [Wed, 10 Feb 2016 10:35:48 +0000 (10:35 +0000)]
Add new option to lldb-server to display its version

llvm-svn: 260366

8 years ago[ELF][MIPS] Group and sort initialization of MipsTargetInfo class fields. NFC
Simon Atanasyan [Wed, 10 Feb 2016 10:08:39 +0000 (10:08 +0000)]
[ELF][MIPS] Group and sort initialization of MipsTargetInfo class fields. NFC

llvm-svn: 260365

8 years ago[ELF][MIPS] Rename MipsTargetInfo::relocateOne argument SA to S
Simon Atanasyan [Wed, 10 Feb 2016 10:08:35 +0000 (10:08 +0000)]
[ELF][MIPS] Rename MipsTargetInfo::relocateOne argument SA to S

MIPS 32-bit ABI uses REL relocation record format. We read addends from
relocation destinations right in the MipsTargetInfo::relocateOne
function.

llvm-svn: 260364

8 years ago[AVR] Add instruction definitions
Dylan McKay [Wed, 10 Feb 2016 08:55:23 +0000 (08:55 +0000)]
[AVR] Add instruction definitions

Summary: Add the AVR instruction tablegen definitions.

Reviewers: stoklund, hfinkel, dsanders, arsenm, vkalintiris

Subscribers: dylanmckay, agnat, rjordans, llvm-commits

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

llvm-svn: 260363

8 years ago[LLDB][MIPS] Generalise MIPS arch names
Mohit K. Bhakkad [Wed, 10 Feb 2016 06:58:13 +0000 (06:58 +0000)]
[LLDB][MIPS] Generalise MIPS arch names
Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: zturner, bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16840

llvm-svn: 260362

8 years ago[PGO] fix prof symbol lookup bug
Xinliang David Li [Wed, 10 Feb 2016 06:36:55 +0000 (06:36 +0000)]
[PGO] fix prof symbol lookup bug

Patch by Rong Xu

The problem is exposed by intra-module indirect call promotion where
prof symtab is created from module which does not contain all symbols
from the program. With partial symtab, the result needs to be checked
more strictly.

llvm-svn: 260361

8 years ago[Sema] Issue a warning for integer overflow in nested struct initializer
Akira Hatanaka [Wed, 10 Feb 2016 06:06:06 +0000 (06:06 +0000)]
[Sema] Issue a warning for integer overflow in nested struct initializer

r257357 fixed clang to warn on integer overflow in struct initializers.
However, it didn't warn when a struct had a nested initializer. This
commit makes changes in Sema::CheckForIntOverflow to handle nested
initializers.

For example:

struct s {
  struct t {
    unsigned x;
  } t;
} s = {
  {
    .x = 4 * 1024 * 1024 * 1024
  }
};

rdar://problem/23526454

llvm-svn: 260360

8 years agoX86: Remove useless semicolon
JF Bastien [Wed, 10 Feb 2016 04:04:12 +0000 (04:04 +0000)]
X86: Remove useless semicolon

llvm-svn: 260359

8 years agoThis is an idea to make "thread step-in --target" work for the common
Jim Ingham [Wed, 10 Feb 2016 03:25:24 +0000 (03:25 +0000)]
This is an idea to make "thread step-in --target" work for the common
case where you have:

1 ->    foo (bar(),
2            baz(),
3            lala());
4

You are sitting on line 1, and want to step into foo, but not bar, baz & lala.  Unfortunately
there are line table entries for lines 1-3, and lldb doesn't know anything about the nesting
of statement in these lines.  So we'll have to use the user's intelligence...  This patch adds:

(lldb) thread step-in -t foo --end-line 4

That tells lldb to keep stepping in till line 4, but stop if you step into foo.  I think I would
remember to use this when faced with some of the long gnarly call sequences in lldb.  But there
might be ways I haven't thought of to make it more convenient.  Jason suggests having "end" as a
special token for --end-line which just means keep going to the end of the function, I really want
to get into this thing...

There should be an SB API and tests, which will come if this seems useful.

llvm-svn: 260352

8 years agollvm-config: Fix DLL prefix on cygming.
NAKAMURA Takumi [Wed, 10 Feb 2016 03:09:13 +0000 (03:09 +0000)]
llvm-config: Fix DLL prefix on cygming.

For example, LLVMSupport takes the form of LLVMSupport.dll, not libLLVMSupport.dll.

llvm-svn: 260351

8 years ago[CMake] For multi-stage builds to be deterministic we need to disable timestamps.
Chris Bieneman [Wed, 10 Feb 2016 02:17:21 +0000 (02:17 +0000)]
[CMake] For multi-stage builds to be deterministic we need to disable timestamps.

Duh! With this change I've verified -O3 builds are deterministic.

llvm-svn: 260350

8 years agoChange lldb.value.__int__() so that it takes into account the signedness of the value...
Enrico Granata [Wed, 10 Feb 2016 02:12:42 +0000 (02:12 +0000)]
Change lldb.value.__int__() so that it takes into account the signedness of the value being cast to return a Python number with the proper value

The explicit APIs on SBValue obviously remain if one wants to be explicit in intent, or override this guess, but since __int__() has to pick one, an educated guess is definitely better than than always going to signed regardless

Fixes rdar://24556976

llvm-svn: 260349

8 years agoGet rid of another SAME-NOT. FileCheck does not have this suffix.
Paul Robinson [Wed, 10 Feb 2016 02:08:24 +0000 (02:08 +0000)]
Get rid of another SAME-NOT. FileCheck does not have this suffix.

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

llvm-svn: 260348

8 years agoclang/test/Index/skip-parsed-bodies/compile_commands.json: Appease targeting msvc.
NAKAMURA Takumi [Wed, 10 Feb 2016 01:45:51 +0000 (01:45 +0000)]
clang/test/Index/skip-parsed-bodies/compile_commands.json: Appease targeting msvc.

llvm-svn: 260347

8 years agoRemove some unnecessary CHECK-SAMEs in ModuleDebugInfo.{cpp,m}.
Justin Lebar [Wed, 10 Feb 2016 01:34:17 +0000 (01:34 +0000)]
Remove some unnecessary CHECK-SAMEs in ModuleDebugInfo.{cpp,m}.

Suggested by Paul Robinson.

llvm-svn: 260346

8 years agoAdd a missing break.
Jim Ingham [Wed, 10 Feb 2016 01:33:58 +0000 (01:33 +0000)]
Add a missing break.

llvm-svn: 260345

8 years agolibclang: Enable skip-parsed-bodies on win32.
NAKAMURA Takumi [Wed, 10 Feb 2016 01:29:57 +0000 (01:29 +0000)]
libclang: Enable skip-parsed-bodies on win32.

I guess it would be working since Rafael's r187619.

llvm-svn: 260344

8 years agollvm-config: Quick fix for cross compilation. Don't be confsed between host and targe...
NAKAMURA Takumi [Wed, 10 Feb 2016 01:12:55 +0000 (01:12 +0000)]
llvm-config: Quick fix for cross compilation. Don't be confsed between host and target. It has been there since r252532.

FIXME: The clause may use conditions of host compiler, not HOST_TRIPLE.
llvm-svn: 260343

8 years agoStructurizeCFG: Initialize SkipUniformRegions in the default constructor
Tom Stellard [Wed, 10 Feb 2016 01:10:09 +0000 (01:10 +0000)]
StructurizeCFG: Initialize SkipUniformRegions in the default constructor

This should fix some random bot failures caused by r260336.

llvm-svn: 260342

8 years ago[CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to subsequent stages
Chris Bieneman [Wed, 10 Feb 2016 01:09:59 +0000 (01:09 +0000)]
[CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to subsequent stages

For multi-stage builds we need to pass any overridden source directory variables. Without passing these the subsequent stages won't find the project sources.

llvm-svn: 260341

8 years ago[CMake] Fixing the 3-stage cmake cache.
Chris Bieneman [Wed, 10 Feb 2016 01:09:56 +0000 (01:09 +0000)]
[CMake] Fixing the 3-stage cmake cache.

I had hoped this would work from a single cache file, but turns out there is a bug I can't quite figure out relating to passing list arguments to recursive CMake invocations.

This change works around that.

llvm-svn: 260340