platform/upstream/llvm.git
9 years agoMake *abs() and *div() work on CloudABI.
Ed Schouten [Mon, 16 Mar 2015 14:27:44 +0000 (14:27 +0000)]
Make *abs() and *div() work on CloudABI.

According to POSIX, *abs() and *div() are allowed to be macros (in
addition to being functions). Make sure we undefine these, so that
std::*abs() and std::*div() work as expected.

llvm-svn: 232379

9 years agoUse the i8 immediate cmp instructions when possible.
Rafael Espindola [Mon, 16 Mar 2015 14:25:08 +0000 (14:25 +0000)]
Use the i8 immediate cmp instructions when possible.

llvm-svn: 232378

9 years ago[ASan] NFC: Factor out platform-specific interceptors
Timur Iskhodzhanov [Mon, 16 Mar 2015 14:22:53 +0000 (14:22 +0000)]
[ASan] NFC: Factor out platform-specific interceptors

Reviewed at http://reviews.llvm.org/D8321

llvm-svn: 232377

9 years agoRevert r232374: [hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory...
Daniel Sanders [Mon, 16 Mar 2015 14:21:22 +0000 (14:21 +0000)]
Revert r232374: [hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.

2007-12-17-InvokeAsm.ll fails on the buildbot but not on my own system. Will investigate.

llvm-svn: 232376

9 years agoDon't repeat names in comments and clang-format this function.
Rafael Espindola [Mon, 16 Mar 2015 14:05:49 +0000 (14:05 +0000)]
Don't repeat names in comments and clang-format this function.

llvm-svn: 232375

9 years ago[hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.
Daniel Sanders [Mon, 16 Mar 2015 13:54:19 +0000 (13:54 +0000)]
[hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.

Summary:
But still handle them the same way since I don't know how they differ on
this target.

No functional change intended.

Reviewers: kparzysz, adasgupt

Reviewed By: kparzysz, adasgupt

Subscribers: colinl, llvm-commits

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

llvm-svn: 232374

9 years agoMake each target map all inline assembly memory constraints to InlineAsm::Constraint_...
Daniel Sanders [Mon, 16 Mar 2015 13:13:41 +0000 (13:13 +0000)]
Make each target map all inline assembly memory constraints to InlineAsm::Constraint_m. NFC.

Summary:
This is instead of doing this in target independent code and is the last
non-functional change before targets begin to distinguish between
different memory constraints when selecting code for the ISD::INLINEASM
node.

Next, each target will individually move away from the idea that all
memory constraints behave like 'm'.

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 232373

9 years agoFix the test for gcc.
Hafiz Abid Qadeer [Mon, 16 Mar 2015 12:16:19 +0000 (12:16 +0000)]
Fix the test for gcc.

Following 3 changes were made.
1. Test was assuming that function name will have () in the end. I dont know why lldb is generating function name like this but it looks like a bug. For this test, I have removed it.
2. Step instruction test was assuming that function call will not be the first instruction in the range of the line. This assumption failed with gcc. So I had fixed this.
3. Some minor adjustments with the line number.

Test with bot gcc and clang and all tests pass.

This test is still very fragile. We should be removing hardcoded line number.

llvm-svn: 232372

9 years ago[mips] [IAS] Outline NOP creation. NFC.
Toma Tabacu [Mon, 16 Mar 2015 12:03:39 +0000 (12:03 +0000)]
[mips] [IAS] Outline NOP creation. NFC.

Summary: Make the code more readable by outlining NOP creation.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 232371

9 years agoCheck that RestartedFromEvent flag before processing the state changed event.
Hafiz Abid Qadeer [Mon, 16 Mar 2015 11:47:24 +0000 (11:47 +0000)]
Check that RestartedFromEvent flag before processing the state changed event.

Not checking for this flags caused lldb-mi to issue stop notification when target
has started running again. It also tried to get stack when target was running and
this caused randon failure.

Approved in http://lists.cs.uiuc.edu/pipermail/lldb-dev/2015-March/006953.html

llvm-svn: 232370

9 years agoFix build failure on MSVC compilers.
Gabor Horvath [Mon, 16 Mar 2015 10:19:53 +0000 (10:19 +0000)]
Fix build failure on MSVC compilers.

llvm-svn: 232368

9 years ago[clang] Replacing asserts with static_asserts where appropriate
Gabor Horvath [Mon, 16 Mar 2015 09:59:54 +0000 (09:59 +0000)]
[clang] Replacing asserts with static_asserts where appropriate

Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check.

Reviewers: alexfh

Subscribers: dblaikie, xazax.hun, cfe-commits

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

Patch by Szabolcs Sipos!

llvm-svn: 232367

9 years ago[llvm] Replacing asserts with static_asserts where appropriate
Gabor Horvath [Mon, 16 Mar 2015 09:53:42 +0000 (09:53 +0000)]
[llvm] Replacing asserts with static_asserts where appropriate

Summary:
This patch consists of the suggestions of clang-tidy/misc-static-assert check.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: xazax.hun, llvm-commits

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

llvm-svn: 232366

9 years agoDon't hardcode the locale name string.
Ed Schouten [Mon, 16 Mar 2015 09:44:37 +0000 (09:44 +0000)]
Don't hardcode the locale name string.

The rest of the test uses the #defines for the locale names properly. In
this single spot we do hardcode the string. This causes this test to
fail on CloudABI, where this locale is called en_US.UTF-8@UTC.

llvm-svn: 232365

9 years ago[Mips] clang-format the code
Simon Atanasyan [Mon, 16 Mar 2015 09:14:47 +0000 (09:14 +0000)]
[Mips] clang-format the code

No functional changes.

llvm-svn: 232364

9 years ago[Mips] Do not check the relocation type twice
Simon Atanasyan [Mon, 16 Mar 2015 09:14:40 +0000 (09:14 +0000)]
[Mips] Do not check the relocation type twice

No functional changes.

llvm-svn: 232363

9 years ago[Mips] Add `const` qualifier to some member functions
Simon Atanasyan [Mon, 16 Mar 2015 09:14:34 +0000 (09:14 +0000)]
[Mips] Add `const` qualifier to some member functions

No functional changes.

llvm-svn: 232362

9 years ago[Mips] Implement R_MIPS_TLS_xxx relocation handling in case of N64 ABI
Simon Atanasyan [Mon, 16 Mar 2015 09:14:28 +0000 (09:14 +0000)]
[Mips] Implement R_MIPS_TLS_xxx relocation handling in case of N64 ABI

llvm-svn: 232361

9 years ago[Mips] Implement R_MIPS_GOT_DISP/PAGE/OFST relocations handling
Simon Atanasyan [Mon, 16 Mar 2015 09:14:17 +0000 (09:14 +0000)]
[Mips] Implement R_MIPS_GOT_DISP/PAGE/OFST relocations handling

llvm-svn: 232360

9 years ago[Mips] Group some cases in the switch statement
Simon Atanasyan [Mon, 16 Mar 2015 09:14:06 +0000 (09:14 +0000)]
[Mips] Group some cases in the switch statement

No functional changes.

llvm-svn: 232359

9 years agoasan: fix overflows in isSafeAccess
Dmitry Vyukov [Mon, 16 Mar 2015 08:04:26 +0000 (08:04 +0000)]
asan: fix overflows in isSafeAccess

As pointed out in http://reviews.llvm.org/D7583
The current checks can cause overflows when object size/access offset cross Quintillion bytes.

http://reviews.llvm.org/D8193

llvm-svn: 232358

9 years agoOne more try with unused.
Michael Gottesman [Mon, 16 Mar 2015 08:00:27 +0000 (08:00 +0000)]
One more try with unused.

llvm-svn: 232357

9 years agoAdd in an unreachable after a covered switch to appease certain bots.
Michael Gottesman [Mon, 16 Mar 2015 07:46:34 +0000 (07:46 +0000)]
Add in an unreachable after a covered switch to appease certain bots.

llvm-svn: 232356

9 years agoRemove a used that snuck in that seems to be triggering the MSVC buildbots.
Michael Gottesman [Mon, 16 Mar 2015 07:34:17 +0000 (07:34 +0000)]
Remove a used that snuck in that seems to be triggering the MSVC buildbots.

llvm-svn: 232355

9 years agoInstrProf: Remove xfails for big-endian from coverage tests
Justin Bogner [Mon, 16 Mar 2015 07:29:49 +0000 (07:29 +0000)]
InstrProf: Remove xfails for big-endian from coverage tests

This still doesn't actually work correctly for big endian input files,
but since these tests all use little endian input files they don't
actually fail. I'll be committing a real fix for big endian soon, but
I don't have proper tests for it yet.

llvm-svn: 232354

9 years ago[OPENMP] Enable codegen of the ‘private’ clause for ‘omp simd’ directive
Alexander Musman [Mon, 16 Mar 2015 07:14:41 +0000 (07:14 +0000)]
[OPENMP] Enable codegen of the ‘private’ clause for ‘omp simd’ directive

llvm-svn: 232353

9 years ago[objc-arc] Fix indentation of debug logging so it is easy to read the output.
Michael Gottesman [Mon, 16 Mar 2015 07:02:39 +0000 (07:02 +0000)]
[objc-arc] Fix indentation of debug logging so it is easy to read the output.

llvm-svn: 232352

9 years ago[objc-arc] Make the ARC optimizer more conservative by forcing it to be non-safe...
Michael Gottesman [Mon, 16 Mar 2015 07:02:36 +0000 (07:02 +0000)]
[objc-arc] Make the ARC optimizer more conservative by forcing it to be non-safe in both direction, but mitigate the problem by noting that we just care if there was a further use.

The problem here is the infamous one direction known safe. I was
hesitant to turn it off before b/c of the potential for regressions
without an actual bug from users hitting the problem. This is that bug ;
).

The main performance impact of having known safe in both directions is
that often times it is very difficult to find two releases without a use
in-between them since we are so conservative with determining potential
uses. The one direction known safe gets around that problem by taking
advantage of many situations where we have two retains in a row,
allowing us to avoid that problem. That being said, the one direction
known safe is unsafe. Consider the following situation:

retain(x)
retain(x)
call(x)
call(x)
release(x)

Then we know the following about the reference count of x:

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
retain(x)
// rc(x) == N+2
call A(x)
call B(x)
// rc(x) >= 1 (since we can not release a deallocated pointer).
release(x)
// rc(x) >= 0

That is all the information that we can know statically. That means that
we know that A(x), B(x) together can release (x) at most N+1 times. Lets
say that we remove the inner retain, release pair.

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
call A(x)
call B(x)
// rc(x) >= 1
release(x)
// rc(x) >= 0

We knew before that A(x), B(x) could release x up to N+1 times meaning
that rc(x) may be zero at the release(x). That is not safe. On the other
hand, consider the following situation where we have a must use of
release(x) that x must be kept alive for after the release(x)**. Then we
know that:

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
retain(x)
// rc(x) == N+2
call A(x)
call B(x)
// rc(x) >= 2 (since we know that we are going to release x and that that release can not be the last use of x).
release(x)
// rc(x) >= 1 (since we can not deallocate the pointer since we have a must use after x).

// rc(x) >= 1
use(x)

Thus we know that statically the calls to A(x), B(x) can together only
release rc(x) N times. Thus if we remove the inner retain, release pair:

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
call A(x)
call B(x)
// rc(x) >= 1

// rc(x) >= 1
use(x)

We are still safe unless in the final … there are unbalanced retains,
releases which would have caused the program to blow up anyways even
before optimization occurred. The simplest form of must use is an
additional release that has not been paired up with any retain (if we
had paired the release with a retain and removed it we would not have
the additional use). This fits nicely into the ARC framework since
basically what you do is say that given any nested releases regardless
of what is in between, the inner release is known safe. This enables us to get
back the lost performance.

<rdar://problem/19023795>

llvm-svn: 232351

9 years ago[objc-arc] Treat memcpy, memove, memset as just using pointers, not decrementing...
Michael Gottesman [Mon, 16 Mar 2015 07:02:32 +0000 (07:02 +0000)]
[objc-arc] Treat memcpy, memove, memset as just using pointers, not decrementing them.

This will be tested in the next commit (which required it). The commit
is going to update a bunch of tests at the same time.

llvm-svn: 232350

9 years ago[objc-arc] Rename ConnectTDBUTraversals => PairUpRetainsReleases.
Michael Gottesman [Mon, 16 Mar 2015 07:02:30 +0000 (07:02 +0000)]
[objc-arc] Rename ConnectTDBUTraversals => PairUpRetainsReleases.

This is a name that is more descriptive of what the method really does. NFC.

llvm-svn: 232349

9 years ago[objc-arc] Move initialization of ARCMDKindCache into the class itself. I also made...
Michael Gottesman [Mon, 16 Mar 2015 07:02:27 +0000 (07:02 +0000)]
[objc-arc] Move initialization of ARCMDKindCache into the class itself. I also made it lazy.

llvm-svn: 232348

9 years ago[objc-arc] Change EntryPointType to an enum class outside of ARCRuntimeEntryPoints...
Michael Gottesman [Mon, 16 Mar 2015 07:02:24 +0000 (07:02 +0000)]
[objc-arc] Change EntryPointType to an enum class outside of ARCRuntimeEntryPoints called ARCRuntimeEntryPointKind.

llvm-svn: 232347

9 years agoInstrProf: Do a better job of reading coverage mapping data.
Justin Bogner [Mon, 16 Mar 2015 06:55:45 +0000 (06:55 +0000)]
InstrProf: Do a better job of reading coverage mapping data.

This code was casting regions of a memory buffer to a couple of
different structs. This is wrong in a few ways:

1. It breaks aliasing rules.
2. If the buffer isn't aligned, it hits undefined behaviour.
3. It completely ignores endianness differences.
4. The structs being defined for this aren't specifying their padding
   properly, so this doesn't even represent the data properly on some
   platforms.

This commit is mostly NFC, except that it fixes reading coverage for
32 bit binaries as a side effect of getting rid of the mispadded
structs. I've included a test for that.

I've also baked in that we only handle little endian more explicitly,
since that was true in practice already. I'll fix this to handle
endianness properly in a followup commit.

llvm-svn: 232346

9 years agoAdded nullptr to fix build
Vince Harron [Mon, 16 Mar 2015 03:54:22 +0000 (03:54 +0000)]
Added nullptr to fix build

llvm-svn: 232345

9 years agoAnd one more empty directory.
Alexander Kornienko [Mon, 16 Mar 2015 03:14:16 +0000 (03:14 +0000)]
And one more empty directory.

llvm-svn: 232344

9 years agoRemove an empty directory.
Alexander Kornienko [Mon, 16 Mar 2015 02:27:24 +0000 (02:27 +0000)]
Remove an empty directory.

llvm-svn: 232343

9 years ago[dsymutil] Add support to generate .debug_pubnames and .debug_pubtypes
Frederic Riss [Mon, 16 Mar 2015 02:05:10 +0000 (02:05 +0000)]
[dsymutil] Add support to generate .debug_pubnames and .debug_pubtypes

The information gathering part of the patch stores a bit more information
than what is strictly necessary for these 2 sections. The rest will
become useful when we start emitting __apple_* type accelerator tables.

llvm-svn: 232342

9 years ago[ELF][ARM] Make gotSymbol a member.
Shankar Easwaran [Mon, 16 Mar 2015 00:54:03 +0000 (00:54 +0000)]
[ELF][ARM] Make gotSymbol a member.

The gotSymbol need not be a global static variable. Apart from this reason, This
variable was creating an issue with self hosting lld, as there seems to be an
issue running global initializers, when initializing the guard for this static
variable.

Program received signal SIGTRAP, Trace/breakpoint trap.

llvm-svn: 232341

9 years agoFix ./configure build after r232338.
Alexander Kornienko [Mon, 16 Mar 2015 00:43:57 +0000 (00:43 +0000)]
Fix ./configure build after r232338.

llvm-svn: 232340

9 years agoRework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test dospath-tolerant.
NAKAMURA Takumi [Mon, 16 Mar 2015 00:40:47 +0000 (00:40 +0000)]
Rework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test dospath-tolerant.

llvm-svn: 232339

9 years agoMove remove-cstr-calls from a standalone executable to a clang-tidy check readability...
Alexander Kornienko [Mon, 16 Mar 2015 00:32:25 +0000 (00:32 +0000)]
Move remove-cstr-calls from a standalone executable to a clang-tidy check readability-redundant-string-cstr

http://reviews.llvm.org/D7318

Patch by Richard Thomson!

llvm-svn: 232338

9 years agoSuppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will fix later.
NAKAMURA Takumi [Sun, 15 Mar 2015 23:07:16 +0000 (23:07 +0000)]
Suppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will fix later.

llvm-svn: 232337

9 years agollvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions to meet...
NAKAMURA Takumi [Sun, 15 Mar 2015 23:07:05 +0000 (23:07 +0000)]
llvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions to meet dos path.

llvm-svn: 232336

9 years ago[dsymutil] Add missing raw_svector_stream::resync() calls.
Frederic Riss [Sun, 15 Mar 2015 22:20:28 +0000 (22:20 +0000)]
[dsymutil] Add missing raw_svector_stream::resync() calls.

Also, after looking at the raw_svector_stream internals, increase the
size of the SmallString used with it to prevent heap allocation.

Issue found by the Asan bot.

llvm-svn: 232335

9 years agoAdding commit msg guidelines to dev policy
Renato Golin [Sun, 15 Mar 2015 21:15:48 +0000 (21:15 +0000)]
Adding commit msg guidelines to dev policy

After much bike shed discussions, we seem to agree to a few loose
but relevant guidelines on how to prepare a commit message. It also
points the attribution section to the new commit messages section
to deduplicate information.

llvm-svn: 232334

9 years ago[dsymutil] Add support for linking line tables.
Frederic Riss [Sun, 15 Mar 2015 20:45:43 +0000 (20:45 +0000)]
[dsymutil] Add support for linking line tables.

This code comes with a lot of cruft that is meant to mimic darwin's
dsymutil behavior. A much simpler approach (described in the numerous
FIXMEs that I put in there) gives the right output for the vast
majority of cases. The extra corner cases that are handled differently
need to be investigated: they seem to correctly handle debug info that
is in the input, but that info looks suspicious in the first place.

Anyway, the current code needs to handle this, but I plan to revisit it
as soon as the big round of validation against the classic dsymutil is
over.

llvm-svn: 232333

9 years ago[MCDwarf] Do not emit useless line table opcode.
Frederic Riss [Sun, 15 Mar 2015 20:45:39 +0000 (20:45 +0000)]
[MCDwarf] Do not emit useless line table opcode.

No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while
comparing dsymutil's and LLVM's line table encoding. Not a correctenss
fix, just a small encoding size optimization.

I'm not sure how to generate a sequence that triggers this, and moreover
llvm-dwardump doesn't dump the line table program, thus the effort
involved in creating a testcase for this trivial patch seemed out of
proportion.

llvm-svn: 232332

9 years agoUse SDValue bool check to tidyup some possible combines. NFC.
Simon Pilgrim [Sun, 15 Mar 2015 19:47:42 +0000 (19:47 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.

llvm-svn: 232331

9 years agoSimpleArray: Provide reverse iteration via std::reverse_iterator.
Benjamin Kramer [Sun, 15 Mar 2015 18:47:26 +0000 (18:47 +0000)]
SimpleArray: Provide reverse iteration via std::reverse_iterator.

NFC intended.

llvm-svn: 232330

9 years agoRemove unneeded initialisation of fenv_t and fexcept_t.
Ed Schouten [Sun, 15 Mar 2015 18:36:31 +0000 (18:36 +0000)]
Remove unneeded initialisation of fenv_t and fexcept_t.

Though common, there is no requirement that fenv_t and fexcept_t are
structure and integer types, respectively. fexcept_t is a structure on
CloudABI.

llvm-svn: 232329

9 years agoremove function names from comments; NFC
Sanjay Patel [Sun, 15 Mar 2015 18:16:04 +0000 (18:16 +0000)]
remove function names from comments; NFC

llvm-svn: 232328

9 years agofix typo: NFC
Sanjay Patel [Sun, 15 Mar 2015 18:11:35 +0000 (18:11 +0000)]
fix typo: NFC

llvm-svn: 232327

9 years agoUse -fno-limit-debug-info instead of -fstandalone-debug in tests
Vince Harron [Sun, 15 Mar 2015 18:05:53 +0000 (18:05 +0000)]
Use -fno-limit-debug-info instead of -fstandalone-debug in tests

This fixes tests on clang-3.4

AFAICT, these flags have the same affect and -fstandalone-debug wasn't
added until after clang-3.4

Committed to try to fix buildbot

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

llvm-svn: 232326

9 years agoUse SDValue bool check to tidyup some possible combines. NFC.
Simon Pilgrim [Sun, 15 Mar 2015 17:21:35 +0000 (17:21 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.

llvm-svn: 232325

9 years ago[SSE} Added tests for float4-float3 conversions (PR11580)
Simon Pilgrim [Sun, 15 Mar 2015 16:19:15 +0000 (16:19 +0000)]
[SSE} Added tests for  float4-float3 conversions (PR11580)

llvm-svn: 232324

9 years agoImplement PreprocessingRecord's and LazyVector's iterators on top of iterator_adaptor...
Benjamin Kramer [Sun, 15 Mar 2015 15:27:19 +0000 (15:27 +0000)]
Implement PreprocessingRecord's and LazyVector's iterators on top of iterator_adaptor_base

This basically creates a wrapper around an 'int' that poses as an iterator.
While that looks a bit counter-intuitive it works just fine because iterator
operations and basic integer arithmetic works in exactly the same way.

Remove the manual integer wrapping code and reduce the reliance on iterator
internals in the implementation. No functionality change intended.

llvm-svn: 232322

9 years agoclang-format: [JS] support cast syntax and type arguments.
Daniel Jasper [Sun, 15 Mar 2015 13:59:51 +0000 (13:59 +0000)]
clang-format: [JS] support cast syntax and type arguments.

Casts in TS syntax (foo = <type>bar;) should not be followed by
whitespace.

Patch by Martin Probst. Thank you.

llvm-svn: 232321

9 years agoclang-format: [JS] more precisely detect enums.
Daniel Jasper [Sun, 15 Mar 2015 13:55:54 +0000 (13:55 +0000)]
clang-format: [JS] more precisely detect enums.

The current enum detection is overly aggressive. As NestingLevel only
applies per line (?) it classifies many if not most object literals as
enum declarations and adds superfluous line breaks into them. This
change narrows the heuristic by requiring an assignment just before the
open brace and requiring the line to start with an identifier.

Patch by Martin Probst. Thank you.

llvm-svn: 232320

9 years agoFactor the iterators of ImmutableSet/ImmutableMap into a common base class
Benjamin Kramer [Sun, 15 Mar 2015 13:26:03 +0000 (13:26 +0000)]
Factor the iterators of ImmutableSet/ImmutableMap into a common base class

This simplifies code quite a bit and brings the iterators closer to
C++'s iterator concept. No functional change intended.

llvm-svn: 232319

9 years agoMS ABI: Don't use qualified pointee types for 'catch' EH TypeDescriptors
David Majnemer [Sun, 15 Mar 2015 07:10:01 +0000 (07:10 +0000)]
MS ABI: Don't use qualified pointee types for 'catch' EH TypeDescriptors

Qualifiers are located next to the TypeDescriptor in order to properly
ensure that a pointer type can only be caught by a more qualified catch
handler.  This means that a catch handler of type 'const int *' requires
an RTTI object for 'int *'.  We got this correct for 'throw' but not for
'catch'.

N.B.  We don't currently have the means to store the qualifiers because
LLVM's EH strategy is tailored to the Itanium scheme.  The Itanium ABI
stores qualifiers inside the type descriptor in such a way that the
manner of qualification is stored in addition to the pointee type's
descriptor.  Perhaps the best way of modeling this for the MS ABI is
using an aggregate type to bundle the qualifiers with the descriptor?
This is tricky because we want to make it clear to the optimization
passes which catch handlers invalidate other handlers.

My current thoughts on a design for this is along the lines of:
  { { TypeDescriptor* TD, i32 QualifierFlags }, i32 MiscFlags }

The idea is that the inner most aggregate is all that is needed to
communicate that one catch handler might supercede another.  The
'MiscFlags' field would be used to hold the bitpattern for the notion
that the 'catch' handler does not need to invoke a copy-constructor
because we are catching by reference.

llvm-svn: 232318

9 years agoImmutableSet: Rename Self to SelfTy to make it more clear it is a type
David Majnemer [Sun, 15 Mar 2015 07:09:20 +0000 (07:09 +0000)]
ImmutableSet: Rename Self to SelfTy to make it more clear it is a type

No functional change intended.

llvm-svn: 232317

9 years agoPostOrderIterator: Remove stray semicolon
David Majnemer [Sun, 15 Mar 2015 07:09:18 +0000 (07:09 +0000)]
PostOrderIterator: Remove stray semicolon

llvm-svn: 232316

9 years agoIR: Default the Metadata::dump() argument "harder" after r232275
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 06:53:32 +0000 (06:53 +0000)]
IR: Default the Metadata::dump() argument "harder" after r232275

Use an overload instead of a default argument for `Metadata::dump()`.
The latter seems to require calling `dump(nullptr)` explicitly when
using a debugger, where as the former doesn't.

Other than utility for debugging, there's NFC here.

llvm-svn: 232315

9 years agoRestore the gcc build
David Majnemer [Sun, 15 Mar 2015 06:11:24 +0000 (06:11 +0000)]
Restore the gcc build

llvm-svn: 232314

9 years agoRemove iterator I accidentally left behind
David Blaikie [Sun, 15 Mar 2015 03:21:20 +0000 (03:21 +0000)]
Remove iterator I accidentally left behind

llvm-svn: 232312

9 years agoRemove use of reserved identifier _Iterator
David Blaikie [Sun, 15 Mar 2015 03:18:21 +0000 (03:18 +0000)]
Remove use of reserved identifier _Iterator

llvm-svn: 232311

9 years agoRemove use of reserved identifiers in Twine
David Blaikie [Sun, 15 Mar 2015 03:17:28 +0000 (03:17 +0000)]
Remove use of reserved identifiers in Twine

llvm-svn: 232310

9 years agoRemove use of reserved identifier and some excess 'inline' usage
David Blaikie [Sun, 15 Mar 2015 03:11:26 +0000 (03:11 +0000)]
Remove use of reserved identifier and some excess 'inline' usage

llvm-svn: 232309

9 years agoRemove reserved identifier & some unnecessary 'inline'
David Blaikie [Sun, 15 Mar 2015 03:11:24 +0000 (03:11 +0000)]
Remove reserved identifier & some unnecessary 'inline'

llvm-svn: 232308

9 years agoRemove use of reserved identifier
David Blaikie [Sun, 15 Mar 2015 03:03:41 +0000 (03:03 +0000)]
Remove use of reserved identifier

& some unnecessary 'inline' keywords

llvm-svn: 232307

9 years ago[clang-tidy] Fix false positives in the misc-static-assert check http://llvm.org...
Alexander Kornienko [Sun, 15 Mar 2015 02:19:37 +0000 (02:19 +0000)]
[clang-tidy] Fix false positives in the misc-static-assert check llvm.org/PR22880

The misc-static-assert check will not warn on assert(false), assert(False),
assert(FALSE); where false / False / FALSE are macros expanding to the false or
0 literals.

Also added corresponding test cases.

http://reviews.llvm.org/D8328

Patch by Szabolcs Sipos!

llvm-svn: 232306

9 years ago[dsymutil] Add an way to iterate over a DebugMapObject symbols.
Frederic Riss [Sun, 15 Mar 2015 02:02:53 +0000 (02:02 +0000)]
[dsymutil] Add an way to iterate over a DebugMapObject symbols.

llvm-svn: 232305

9 years agoRemove use of unreserved identifier (_Self)
David Blaikie [Sun, 15 Mar 2015 01:42:28 +0000 (01:42 +0000)]
Remove use of unreserved identifier (_Self)

And some unnecessary inline keywords

llvm-svn: 232304

9 years agoRemove use of a reserved identifier
David Blaikie [Sun, 15 Mar 2015 01:40:42 +0000 (01:40 +0000)]
Remove use of a reserved identifier

(& some unnecessary 'inline' keywords, too)

llvm-svn: 232303

9 years agoRemove use of reserved identifier
David Blaikie [Sun, 15 Mar 2015 01:37:01 +0000 (01:37 +0000)]
Remove use of reserved identifier

The C++ standard reserves all identifiers starting with an underscore
followed by an uppercase letter for the implementation for any use.

llvm-svn: 232302

9 years agollvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
David Majnemer [Sun, 15 Mar 2015 01:30:58 +0000 (01:30 +0000)]
llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump

llvm-vtabledump has grown enough functionality not related to vtables
that it deserves a name which is more descriptive.

llvm-svn: 232301

9 years ago[dsymutil] Add function size to the debug map.
Frederic Riss [Sun, 15 Mar 2015 01:29:30 +0000 (01:29 +0000)]
[dsymutil] Add function size to the debug map.

The debug map embedded by ld64 in binaries conatins function sizes.
These sizes are less precise than the ones given by the debug information
(byte granularity vs linker atom granularity), but they might cover code
that is referenced in the line table but not in the DIE tree (that might
very well be a compiler bug that I need to investigate later).
Anyway, extracting that information is necessary to be able to mimic
dsymutil's behavior exactly.

llvm-svn: 232300

9 years agoDbgIntrinsicInst: Downcast to specialized MDNodes in accessors
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:23:20 +0000 (01:23 +0000)]
DbgIntrinsicInst: Downcast to specialized MDNodes in accessors

Change accessors to downcast to `MDLocalVariable` and `MDExpression`,
now that we have -verify checks in place to confirm that it's safe.

llvm-svn: 232299

9 years agoRemove some unnecessary 'inline' keywords
David Blaikie [Sun, 15 Mar 2015 01:21:37 +0000 (01:21 +0000)]
Remove some unnecessary 'inline' keywords

llvm-svn: 232298

9 years agoIntervalIterator: Add move semantics rather than relying on broken implicit copy...
David Blaikie [Sun, 15 Mar 2015 01:21:34 +0000 (01:21 +0000)]
IntervalIterator: Add move semantics rather than relying on broken implicit copy ctor (found with -Wdeprecated)

We were just getting lucky because the copy ctor would be elided by RVO.

llvm-svn: 232297

9 years agoVerifier: Check debug info intrinsic arguments
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:21:30 +0000 (01:21 +0000)]
Verifier: Check debug info intrinsic arguments

Verify that debug info intrinsic arguments are valid.  (These checks
will not recurse through the full debug info graph, so they don't need
to be cordoned of in `DebugInfoVerifier`.)

With those checks in place, changing the `DbgIntrinsicInst` accessors to
downcast to `MDLocalVariable` and `MDExpression` is natural (added isa
specializations in `Metadata.h` to support this).

Added tests to `test/Verifier` for the new -verify checks, and fixed the
debug info in all the in-tree tests.

If you have out-of-tree testcases that have started to fail to -verify,
hopefully the verify checks are helpful.  The most likely problem is
that the expression argument is `!{}` (instead of `!MDExpression()`).

llvm-svn: 232296

9 years ago-Wempty-body: fix false negative triggered by macros
Dmitri Gribenko [Sun, 15 Mar 2015 01:08:23 +0000 (01:08 +0000)]
-Wempty-body: fix false negative triggered by macros

When if statement condition ended in a macro:

    if (ptr == NULL);

the check used to consider the definition location of NULL, instead of the
current line.

Patch by Manasij Mukherjee.

llvm-svn: 232295

9 years ago[opaque pointer type] IRBuilder gep migration progress
David Blaikie [Sun, 15 Mar 2015 01:03:19 +0000 (01:03 +0000)]
[opaque pointer type] IRBuilder gep migration progress

llvm-svn: 232294

9 years agoMade CFLAA agree with clang-format. NFC.
George Burgess IV [Sun, 15 Mar 2015 00:52:21 +0000 (00:52 +0000)]
Made CFLAA agree with clang-format. NFC.

So everyone's lives are easier in the future

llvm-svn: 232293

9 years agoVerifier: Remove unnecessary null check
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:50:57 +0000 (00:50 +0000)]
Verifier: Remove unnecessary null check

This is already assumed to be non-null above due to a dyn_cast<>.  Also
remove extraneous braces around statement.

llvm-svn: 232292

9 years agoVerifier: Make the raw_ostream constructor argument required
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:46:57 +0000 (00:46 +0000)]
Verifier: Make the raw_ostream constructor argument required

This was passed inconsistently; seems clearer to make it required anyway.

llvm-svn: 232291

9 years agoAssembler: Rewrite test for function-local metadata
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:45:51 +0000 (00:45 +0000)]
Assembler: Rewrite test for function-local metadata

This test for function-local metadata did strange things, and never
really sent in valid arguments for `llvm.dbg.declare` and
`llvm.dbg.value` intrinsics.  Those that might have once been valid have
bitrotted.

Rewrite it to be a targeted test for function-local metadata --
unrelated to debug info, which is tested elsewhere -- and rename it to
better match other metadata-related tests.

(Note: the scope of function-local metadata changed drastically during
the metadata/value split, but I didn't properly clean up this testcase.
Most of the IR in this file, while invalid for debug info intrinsics,
used to provide coverage for various (now illegal) forms of
function-local metadata.)

llvm-svn: 232290

9 years agoMS ABI: Tidy up references to the ASTContext
David Majnemer [Sat, 14 Mar 2015 23:44:48 +0000 (23:44 +0000)]
MS ABI: Tidy up references to the ASTContext

CGCXXABI has a handy getContext() method.  Use that instead of
explicitly going through the CodeGenModule.

llvm-svn: 232289

9 years agoFix a bug related to arg escaping, and add unit tests.
Zachary Turner [Sat, 14 Mar 2015 23:39:42 +0000 (23:39 +0000)]
Fix a bug related to arg escaping, and add unit tests.

A recent refactor had introduced a bug where if you escaped a
character, the rest of the string would get processed incorrectly.

This patch fixes that bug and adds some unit tests for Args.

llvm-svn: 232288

9 years ago[CMake] Make the unittests link against everything...
Zachary Turner [Sat, 14 Mar 2015 23:39:28 +0000 (23:39 +0000)]
[CMake] Make the unittests link against everything...

Sigh.  There's really not a good alternative until we decouple
python from lldb better.  The only way the build works right now
is by having every executable link against every LLDB library.
This causes implicit transitive link dependencies on the union
of everything that LLDB brings in.  Which means that if all we
want is one header file from interpreter, we have to bring in
everything, including everything that everything depends on,
which means python.

There's outstanding efforts to address this, but it's not yet
complete.  So until then, this is all we can do.

llvm-svn: 232287

9 years agoSimplified some stack folding tests.
Simon Pilgrim [Sat, 14 Mar 2015 23:16:43 +0000 (23:16 +0000)]
Simplified some stack folding tests.

Replaced explicit pmovzx* intrinsic tests with general shuffles

llvm-svn: 232286

9 years agoCodeGen: Correctly initialize bitfields with non-constant initializers
David Majnemer [Sat, 14 Mar 2015 22:24:38 +0000 (22:24 +0000)]
CodeGen: Correctly initialize bitfields with non-constant initializers

It is possible to construct an initializer for a bitfield which is not
constant.  Instead of emitting code to initialize the field before the
execution of main, clang would crash.

llvm-svn: 232285

9 years agoUpdate InstCombine to transform aggregate stores into scalar stores.
Mehdi Amini [Sat, 14 Mar 2015 22:19:33 +0000 (22:19 +0000)]
Update InstCombine to transform aggregate stores into scalar stores.

Summary: This is a first step toward getting proper support for aggregate loads and stores.

Test Plan: Added unittests

Reviewers: reames, chandlerc

Reviewed By: chandlerc

Subscribers: majnemer, joker.eph, chandlerc, llvm-commits

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

Patch by Amaury Sechet

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

9 years agoUpdate LangRef now that a DataLayout is mandatory.
Mehdi Amini [Sat, 14 Mar 2015 22:04:06 +0000 (22:04 +0000)]
Update LangRef now that a DataLayout is mandatory.

Reviewers: rafael, echristo

Reviewed By: rafael

Subscribers: rafael, llvm-commits

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

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

9 years agoUse setVisibility() rather than assigning the value directly.
Davide Italiano [Sat, 14 Mar 2015 21:57:15 +0000 (21:57 +0000)]
Use setVisibility() rather than assigning the value directly.
We don't want to risk to override wrong st_other bits, and when
we need to zero, we can do that explictly.

llvm-svn: 232282

9 years agoAdd some missed formatting
David Blaikie [Sat, 14 Mar 2015 21:40:12 +0000 (21:40 +0000)]
Add some missed formatting

llvm-svn: 232281

9 years ago[opaque pointer type] gep API migration
David Blaikie [Sat, 14 Mar 2015 21:40:10 +0000 (21:40 +0000)]
[opaque pointer type] gep API migration

This concludes the GetElementPtrInst::Create migration, thus marking the
beginning of the IRBuilder::CreateGEP* migration to come.

llvm-svn: 232280

9 years ago[opaque pointer type] gep API migration
David Blaikie [Sat, 14 Mar 2015 21:20:51 +0000 (21:20 +0000)]
[opaque pointer type] gep API migration

llvm-svn: 232279

9 years agoA few minor updates based on feedback from Justin and a few things I thought were...
Chris Bieneman [Sat, 14 Mar 2015 21:20:32 +0000 (21:20 +0000)]
A few minor updates based on feedback from Justin and a few things I thought were missing.

* Moved autotools configure & build example out of "Getting Started Quickly (A Summary)" and into BuildingLLVMWithAutoTools.
* Removed the annotations that CMake is the recommended process and Autotools is alternate.
* Added brief documentation about build targets under "Getting Started Quickly..."
* Added Overview text to BuildingLLVMWithAutotools
* Fixed up a broken link.

llvm-svn: 232278

9 years ago[opaque pointer type] gep API migration, ArgPromo
David Blaikie [Sat, 14 Mar 2015 21:11:26 +0000 (21:11 +0000)]
[opaque pointer type] gep API migration, ArgPromo

This involved threading the type-to-gep through a data structure, since
the code was relying on the pointer type to carry this information. I
imagine there will be a lot of this work across the project... slow
work chasing each use case, but the assertions will help keep me honest.

llvm-svn: 232277