platform/upstream/llvm.git
10 years agoMS ABI: Remove nv adjustment from direct vdtor calls and prologues
Reid Kleckner [Tue, 18 Feb 2014 22:51:52 +0000 (22:51 +0000)]
MS ABI: Remove nv adjustment from direct vdtor calls and prologues

Summary:
Generally the vector deleting dtor, which we model as a vtable thunk,
takes care of non-virtual adjustment and delegates to the other
destructor variants.  The other non-complete destructor variants assume
that 'this' on entry points to the virtual base subobject that first
declared the virtual destructor.

We need to change the adjustment in both the prologue and the vdtor call
setup.

Reviewers: timurrrr

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2821

llvm-svn: 201612

10 years agoAlso recognize interrupt as a possible trap handler name.
Jason Molenda [Tue, 18 Feb 2014 22:48:27 +0000 (22:48 +0000)]
Also recognize interrupt as a possible trap handler name.

llvm-svn: 201611

10 years agoMore tests for r201536.
Richard Smith [Tue, 18 Feb 2014 22:47:10 +0000 (22:47 +0000)]
More tests for r201536.

llvm-svn: 201610

10 years agoAdd two additional trap handler names for PlatformDarwinKernel.
Jason Molenda [Tue, 18 Feb 2014 22:35:38 +0000 (22:35 +0000)]
Add two additional trap handler names for PlatformDarwinKernel.
<rdar://problem/15246793>

llvm-svn: 201609

10 years agoFix PR18743.
Rafael Espindola [Tue, 18 Feb 2014 22:24:57 +0000 (22:24 +0000)]
Fix PR18743.

The IR
@foo = private constant i32 42

is valid, but before this patch we would produce an invalid MachO from it. It
was invalid because it would use an L label in a section where the liker needs
the labels in order to atomize it.

One way of fixing it would be to just reject this IR in the backend, but that
would not be very front end friendly.

What this patch does is use an 'l' prefix in sections that we know the linker
requires symbols for atomizing them. This allows frontends to just use
private and not worry about which sections they go to or how the linker handles
them.

One small issue with this strategy is that now a symbol name depends on the
section, which is not available before codegen. This is not a problem in
practice. The reason is that it only happens with private linkage, which will
be ignored by the non codegen users (llvm-nm and llvm-ar).

llvm-svn: 201608

10 years agoExperiment with making -Wunreachable-code more immediately useful by restricting...
Ted Kremenek [Tue, 18 Feb 2014 22:12:10 +0000 (22:12 +0000)]
Experiment with making -Wunreachable-code more immediately useful by restricting warnings to those issued in the main file.

This warning has a whole bunch of known false positives, much of them due
to code that is "sometimes unreachable".  This can caused by code that
is conditionally generated by the preprocessor, branches that are defined
in terms of architecture-specific details (e.g., the size of a type), and
so on.  While these are all good things to address one by one, the reality
is that this warning has received little love lately.  By restricting
its purvue, we can focus on the top issues effecting main files, which
should be smaller, and then gradually widen the scope.

llvm-svn: 201607

10 years agoRename a DebugLoc variable to DbgLoc and a DataLayout to DL.
Rafael Espindola [Tue, 18 Feb 2014 22:05:46 +0000 (22:05 +0000)]
Rename a DebugLoc variable to DbgLoc and a DataLayout to DL.

This is quiet a bit less confusing now that TargetData was renamed DataLayout.

llvm-svn: 201606

10 years agoConsistently check 'IsCode' when allocating sections in RuntimeDyld (via
Lang Hames [Tue, 18 Feb 2014 21:46:39 +0000 (21:46 +0000)]
Consistently check 'IsCode' when allocating sections in RuntimeDyld (via
findOrEmitSection).

Vaidas Gasiunas's patch, r201259, fixed one instance where we were always
allocating sections as text. This patch fixes the remaining buggy call sites.

No test case: This isn't breaking anything that I know of, it's just
inconsistent.

<rdar://problem/15943542>

llvm-svn: 201605

10 years agoclang-cl /fallback: emit a note when falling back
Hans Wennborg [Tue, 18 Feb 2014 21:42:51 +0000 (21:42 +0000)]
clang-cl /fallback: emit a note when falling back

This makes it a lot easier to see what's going on from the output.

llvm-svn: 201604

10 years agoEliminate kernel warning when running tests on FreeBSD
Ed Maste [Tue, 18 Feb 2014 21:33:10 +0000 (21:33 +0000)]
Eliminate kernel warning when running tests on FreeBSD

pexpect had a hack to work around some old buggy platforms, and as a
result of the hack running the tests on FreeBSD produced a stream of
kernel warnings in the system log:

  Feb 5 17:19:11 feynman kernel: WARNING pid 11323 (python2.7):
    ioctl sign-extension ioctl ffffffff80087467

The hack has now been removed upstream, so remove it here too.

llvm.org/pr18749

llvm-svn: 201603

10 years agoDebugInfo: Avoid unnecessarily looking up the context when the declaration is already...
David Blaikie [Tue, 18 Feb 2014 20:52:05 +0000 (20:52 +0000)]
DebugInfo: Avoid unnecessarily looking up the context when the declaration is already built.

No functional change intended.

llvm-svn: 201602

10 years ago[AArch64] Expanded sin, cos, pow with FP vector types inputs
Ana Pazos [Tue, 18 Feb 2014 20:31:05 +0000 (20:31 +0000)]
[AArch64] Expanded sin, cos, pow with FP vector types inputs

llvm-svn: 201601

10 years agoMake sure we don't try to print the SystemExit exception, or we will cause the contai...
Enrico Granata [Tue, 18 Feb 2014 20:00:20 +0000 (20:00 +0000)]
Make sure we don't try to print the SystemExit exception, or we will cause the containing process to exit() from under us

llvm-svn: 201600

10 years agoAdd a makefile for clang-query. Patch by Alex Horn!
Peter Collingbourne [Tue, 18 Feb 2014 19:46:01 +0000 (19:46 +0000)]
Add a makefile for clang-query. Patch by Alex Horn!

While at it, have cmake build and test the tool if libedit is not installed,
as this dependency is now optional.

llvm-svn: 201599

10 years agoUpdated documentation for Thread Safety Analysis.
DeLesley Hutchins [Tue, 18 Feb 2014 19:42:01 +0000 (19:42 +0000)]
Updated documentation for Thread Safety Analysis.

llvm-svn: 201598

10 years agoclang-cl: support -v
Hans Wennborg [Tue, 18 Feb 2014 19:29:31 +0000 (19:29 +0000)]
clang-cl: support -v

It doesn't conflict with any cl.exe options and it's useful for debugging.

llvm-svn: 201597

10 years agoMove the libpanel dependency into the Libraries project folder.
Jim Ingham [Tue, 18 Feb 2014 19:22:13 +0000 (19:22 +0000)]
Move the libpanel dependency into the Libraries project folder.

llvm-svn: 201596

10 years agoConvert to codesigning by hand to work around bugs in Xcode cert verification.
Jim Ingham [Tue, 18 Feb 2014 19:11:49 +0000 (19:11 +0000)]
Convert to codesigning by hand to work around bugs in Xcode cert verification.

llvm-svn: 201595

10 years agoCheck scops a second time before working on them
Tobias Grosser [Tue, 18 Feb 2014 18:49:49 +0000 (18:49 +0000)]
Check scops a second time before working on them

In rare cases the modification of one scop can effect the validity of other
scops, as code generation of an earlier scop may make the scalar evolution
functions derived for later scops less precise. The example that triggered this
patch was a scop that contained an 'or' expression as follows:

  %add13710 = or i32 %j.19, 1
    -->  {(1 + (4 * %l)),+,2}<nsw><%for.body81>

Scev could only analyze the 'or' as it knew %j.19 is a multiple of 2. This
information was not available after the first scop was code generated (or
independent-blocks was run on it) and SCEV could not derive a precise SCEV
expression any more. This means we could not any more code generate this SCoP.
My current understanding is that there is always the risk that an earlier code
generation change invalidates later scops.  As the example we have seen here is
difficult to avoid, we use this occasion to guard us against all such
invalidations.

This patch "solves" this issue by verifying right before we start working on
a detected scop, if this scop is in fact still valid. This adds a certain
overhead. However the verification we run is anyways very fast and secondly
it is only run on detected scops. So the overhead should not be very large. As
a later optimization we could detect scops only on demand, such that we need
to run scop-detections always only a single time.

This should fix the single last failure in the LLVM test-suite for the new
scev-based code generation.

llvm-svn: 201593

10 years agoAdd ScopDetection::isValidRegion(Region)
Tobias Grosser [Tue, 18 Feb 2014 18:49:46 +0000 (18:49 +0000)]
Add ScopDetection::isValidRegion(Region)

llvm-svn: 201592

10 years agoFix testcase to actually check what it was supposed to, and make it a bit more robust.
Richard Smith [Tue, 18 Feb 2014 18:35:57 +0000 (18:35 +0000)]
Fix testcase to actually check what it was supposed to, and make it a bit more robust.

llvm-svn: 201591

10 years agoAttempting to fix the build bot due to some missing text in the ast dump.
Aaron Ballman [Tue, 18 Feb 2014 17:56:41 +0000 (17:56 +0000)]
Attempting to fix the build bot due to some missing text in the ast dump.

llvm-svn: 201590

10 years agoclang-cl: Parse the /d2Zi+ flag (PR18728)
Hans Wennborg [Tue, 18 Feb 2014 17:49:01 +0000 (17:49 +0000)]
clang-cl: Parse the /d2Zi+ flag (PR18728)

This is an undocumented, but reportedly widely used flag.
We don't support it, but should be able to parse it.

llvm-svn: 201588

10 years agoMissed updating this test case with r201585 -- the lockable attribute is now internal...
Aaron Ballman [Tue, 18 Feb 2014 17:46:17 +0000 (17:46 +0000)]
Missed updating this test case with r201585 -- the lockable attribute is now internally represented by CapabilityAttr.

llvm-svn: 201587

10 years agoIn some cases (for example, the Firefox build system), the CLANG_CXX variable is...
Sylvestre Ledru [Tue, 18 Feb 2014 17:45:06 +0000 (17:45 +0000)]
In some cases (for example, the Firefox build system), the CLANG_CXX variable is defined but empty.
Extend the test (like it is done in scan-build) to check also if the variable
is empty or not.

llvm-svn: 201586

10 years agoDeLesley Hutchins (who wrote the original thread-safety attribute functionality)...
Aaron Ballman [Tue, 18 Feb 2014 17:36:50 +0000 (17:36 +0000)]
DeLesley Hutchins (who wrote the original thread-safety attribute functionality) and I have agreed to start migrating from lock-specific terminology to "capability"-specific terminology. This opens the door for future threading-related analysis passes so that a common nomenclature can be used.

The following attributes have been (silently) deprecated, with their replacements listed:

lockable => capability
exclusive_locks_required => requires_capability
shared_locks_required => requires_shared_capability
locks_excluded => requires_capability

There are no functional changes intended.

llvm-svn: 201585

10 years agoRemove trailing spaces (no other change). Bikeshed #2
Sylvestre Ledru [Tue, 18 Feb 2014 17:21:45 +0000 (17:21 +0000)]
Remove trailing spaces (no other change). Bikeshed #2

llvm-svn: 201584

10 years ago[analyzer] Teach CastSizeChecker about flexible array members.
Jordan Rose [Tue, 18 Feb 2014 17:06:30 +0000 (17:06 +0000)]
[analyzer] Teach CastSizeChecker about flexible array members.

...as well as fake flexible array members: structs that end in arrays with
length 0 or 1.

Patch by Daniel Fahlgren!

llvm-svn: 201583

10 years ago[mips] Add support for ELF64-mips and the R_MIPS_32/R_MIPS_64 relocs for it.
Daniel Sanders [Tue, 18 Feb 2014 15:57:52 +0000 (15:57 +0000)]
[mips] Add support for ELF64-mips and the R_MIPS_32/R_MIPS_64 relocs for it.

Summary:
This fixes several test failures when building LLVM on a MIPS host.

The failures were:
    LLVM :: DebugInfo/enum.ll
    LLVM :: DebugInfo/inlined-arguments.ll
    LLVM :: DebugInfo/member-order.ll
    LLVM :: DebugInfo/namespace.ll
    LLVM :: DebugInfo/template-recursive-void.ll
    LLVM :: DebugInfo/tu-composite.ll
    LLVM :: DebugInfo/two-cus-from-same-file.ll
    LLVM :: Linker/type-unique-simple-a.ll
    LLVM :: Linker/type-unique-simple2.ll

Reviewers: jacksprat, matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D2721

llvm-svn: 201582

10 years agoRename some member variables from TD to DL.
Rafael Espindola [Tue, 18 Feb 2014 15:33:12 +0000 (15:33 +0000)]
Rename some member variables from TD to DL.

TargetData was renamed DataLayout back in r165242.

llvm-svn: 201581

10 years ago[ASan/Win] Add a couple more DLL thunks
Timur Iskhodzhanov [Tue, 18 Feb 2014 15:31:29 +0000 (15:31 +0000)]
[ASan/Win] Add a couple more DLL thunks

llvm-svn: 201580

10 years agoAdd files that I forgot to svn add in 201578.
Dmitri Gribenko [Tue, 18 Feb 2014 15:29:17 +0000 (15:29 +0000)]
Add files that I forgot to svn add in 201578.

llvm-svn: 201579

10 years agolibclang: fix a bug in processing invalid arguments, introduced in r201249
Dmitri Gribenko [Tue, 18 Feb 2014 15:20:02 +0000 (15:20 +0000)]
libclang: fix a bug in processing invalid arguments, introduced in r201249

Recommit r201346, reverted in r201373.

llvm-svn: 201578

10 years agoelf-core: support 32- and 64-bit x86 registers
Ed Maste [Tue, 18 Feb 2014 15:12:35 +0000 (15:12 +0000)]
elf-core: support 32- and 64-bit x86 registers

This way the same RegisterContext class can support i386 and
amd64/x86_64 core files.

With some further refinement we should be able to merge all of the
processor-specific RegisterContextPOSIX_* classes into a single shared
one.

llvm-svn: 201577

10 years ago[sanitizer] when reporting a deadlock also report the lock cycle
Kostya Serebryany [Tue, 18 Feb 2014 14:56:19 +0000 (14:56 +0000)]
[sanitizer] when reporting a deadlock also report the lock cycle

llvm-svn: 201576

10 years ago[CMake] Rename several variables
Alexey Samsonov [Tue, 18 Feb 2014 14:28:53 +0000 (14:28 +0000)]
[CMake] Rename several variables

llvm-svn: 201575

10 years agoMS ABI: Refactor extended qualifiers
David Majnemer [Tue, 18 Feb 2014 14:20:10 +0000 (14:20 +0000)]
MS ABI: Refactor extended qualifiers

Extended qualifiers can appear in many places, refactor the code so it's
more reusable.  Add tests in areas where we've increased compatibility.

llvm-svn: 201574

10 years agoAdd myself as owner for libc++
Marshall Clow [Tue, 18 Feb 2014 14:03:17 +0000 (14:03 +0000)]
Add myself as owner for libc++

llvm-svn: 201573

10 years ago[sanitizer] make sure the deadlock detector survives the change of epochs; add a...
Kostya Serebryany [Tue, 18 Feb 2014 13:41:49 +0000 (13:41 +0000)]
[sanitizer] make sure the deadlock detector survives the change of epochs; add a test and a comment

llvm-svn: 201572

10 years ago[asan] Relax stack-overflow test.
Evgeniy Stepanov [Tue, 18 Feb 2014 13:11:40 +0000 (13:11 +0000)]
[asan] Relax stack-overflow test.

llvm-svn: 201571

10 years agoRemove trailing spaces (no other change)
Sylvestre Ledru [Tue, 18 Feb 2014 12:59:51 +0000 (12:59 +0000)]
Remove trailing spaces (no other change)

llvm-svn: 201570

10 years agoMS ABI: Add support for mangling __restrict
David Majnemer [Tue, 18 Feb 2014 12:58:35 +0000 (12:58 +0000)]
MS ABI: Add support for mangling __restrict

Pointer types in the MSVC ABI are a bit awkward, the width of the
pointer is considered a kind of CVR qualifier.

Restrict is handled similarly to const and volatile but is mangled after
the pointer width qualifier.

This fixes PR18880.

llvm-svn: 201569

10 years ago[tsan] in deadlock detector do not register locks on their creation and unregister...
Kostya Serebryany [Tue, 18 Feb 2014 12:50:31 +0000 (12:50 +0000)]
[tsan] in deadlock detector do not register locks on their creation and unregister them on destruction; added a relevant test

llvm-svn: 201568

10 years ago[asan] Disable stack-overflow test on main thread.
Evgeniy Stepanov [Tue, 18 Feb 2014 12:29:39 +0000 (12:29 +0000)]
[asan] Disable stack-overflow test on main thread.

Failing on some bots.

llvm-svn: 201567

10 years ago[CMake] Don't build ASan for iossim if -mmacosx-version-min is specified
Alexey Samsonov [Tue, 18 Feb 2014 12:01:24 +0000 (12:01 +0000)]
[CMake] Don't build ASan for iossim if -mmacosx-version-min is specified

llvm-svn: 201566

10 years ago[asan] Stack overflow detection.
Evgeniy Stepanov [Tue, 18 Feb 2014 11:49:52 +0000 (11:49 +0000)]
[asan] Stack overflow detection.

Report segmentation faults near or below stack bottom as stack-overflow
(not stack-buffer-overflow!).

llvm-svn: 201565

10 years ago[asan] Fix one test on OSX.
Evgeniy Stepanov [Tue, 18 Feb 2014 11:32:24 +0000 (11:32 +0000)]
[asan] Fix one test on OSX.

llvm-svn: 201564

10 years agoXCore target: Handle common linkage
Robert Lytton [Tue, 18 Feb 2014 11:21:59 +0000 (11:21 +0000)]
XCore target: Handle common linkage

llvm-svn: 201563

10 years agoXCore target: addMemOperand as necessary
Robert Lytton [Tue, 18 Feb 2014 11:21:53 +0000 (11:21 +0000)]
XCore target: addMemOperand as necessary

BuildMI instructions were not including MachineMemOperand information.
This was discovered by 'SingleSource/Benchmarks/Stanford/Oscar' failing
due to a FrameIndex load incorrectly being hoisted by postra-machine-licm.
No other tests have been found to fail.

llvm-svn: 201562

10 years agoXCore target: Fix llvm.eh.return and EH info register handling
Robert Lytton [Tue, 18 Feb 2014 11:21:48 +0000 (11:21 +0000)]
XCore target: Fix llvm.eh.return and EH info register handling

llvm-svn: 201561

10 years agoDarwin builds: handle different possible form for SDKROOT.
Tim Northover [Tue, 18 Feb 2014 11:20:44 +0000 (11:20 +0000)]
Darwin builds: handle different possible form for SDKROOT.

Modifying build_llvm to handle SDKROOT being the name of an SDK rather than a
path. This will still work if SDKROOT is a path.

rdar://problem/15162322

llvm-svn: 201560

10 years agoGlobalMerge: move "-global-merge" option to the pass itself.
Tim Northover [Tue, 18 Feb 2014 11:17:29 +0000 (11:17 +0000)]
GlobalMerge: move "-global-merge" option to the pass itself.

It's rather odd to have the flag enabling and disabling this pass only affect a
single target.

llvm-svn: 201559

10 years agoX86: use vpsllvd (& friends) for 16-bit shifts on Haswell
Tim Northover [Tue, 18 Feb 2014 11:15:32 +0000 (11:15 +0000)]
X86: use vpsllvd (& friends) for 16-bit shifts on Haswell

llvm-svn: 201558

10 years ago[asan] Override default sigaltstack setting on Android.
Evgeniy Stepanov [Tue, 18 Feb 2014 11:14:30 +0000 (11:14 +0000)]
[asan] Override default sigaltstack setting on Android.

Android libc always sets altstack on non-main threads, but it is too small for
our unwinder. With use_sigaltstack=1, override this setting with a larger one.

llvm-svn: 201557

10 years ago[CMake] Add top-level target for each compiler-rt library, and add 'compiler-rt'...
Alexey Samsonov [Tue, 18 Feb 2014 09:33:45 +0000 (09:33 +0000)]
[CMake] Add top-level target for each compiler-rt library, and add 'compiler-rt' target encompassing them all.

llvm-svn: 201556

10 years agollvm-cov: Support gcov's extermely lenient treatment of -o
Justin Bogner [Tue, 18 Feb 2014 09:19:48 +0000 (09:19 +0000)]
llvm-cov: Support gcov's extermely lenient treatment of -o

In gcov, the -o flag can accept either a directory or a file name.
When given a directory, the gcda and gcno files are expected to be in
that directory. When given a file, the gcda and gcno files are
expected to be named based on the stem of that file. Non-existent
paths are treated as files.

This implements compatible behaviour.

llvm-svn: 201555

10 years ago[tsan] one more lit test for deadlock detector; more to come
Kostya Serebryany [Tue, 18 Feb 2014 09:08:03 +0000 (09:08 +0000)]
[tsan] one more lit test for deadlock detector; more to come

llvm-svn: 201554

10 years agoSimplify lit test configs for LSan and UBSan by using a generic config
Alexey Samsonov [Tue, 18 Feb 2014 08:56:49 +0000 (08:56 +0000)]
Simplify lit test configs for LSan and UBSan by using a generic config

llvm-svn: 201553

10 years agoDrop test/asan/GenericConfig directory
Alexey Samsonov [Tue, 18 Feb 2014 08:24:28 +0000 (08:24 +0000)]
Drop test/asan/GenericConfig directory

llvm-svn: 201552

10 years agoAdd PS prefix to some classes I missed in r201538.
Craig Topper [Tue, 18 Feb 2014 08:24:22 +0000 (08:24 +0000)]
Add PS prefix to some classes I missed in r201538.

llvm-svn: 201551

10 years agoAdd a bunch of OpSize32 tags to 64-bit mode only instructions to match their 32-bit...
Craig Topper [Tue, 18 Feb 2014 08:18:29 +0000 (08:18 +0000)]
Add a bunch of OpSize32 tags to 64-bit mode only instructions to match their 32-bit mode counterparts for cases where there is also a OpSize16 instruction.

llvm-svn: 201550

10 years ago[CMake] Check for -fPIE and -ffreestanding flags for consistency
Alexey Samsonov [Tue, 18 Feb 2014 08:07:09 +0000 (08:07 +0000)]
[CMake] Check for -fPIE and -ffreestanding flags for consistency

llvm-svn: 201549

10 years ago[asan] Replace rand_r with rand in test.
Evgeniy Stepanov [Tue, 18 Feb 2014 08:03:44 +0000 (08:03 +0000)]
[asan] Replace rand_r with rand in test.

llvm-svn: 201548

10 years ago[CMake] Simplify setting compile flag disabling RTTI
Alexey Samsonov [Tue, 18 Feb 2014 07:52:40 +0000 (07:52 +0000)]
[CMake] Simplify setting compile flag disabling RTTI

llvm-svn: 201547

10 years agoAVX-512: Fixed size of mask registers
Elena Demikhovsky [Tue, 18 Feb 2014 07:52:26 +0000 (07:52 +0000)]
AVX-512: Fixed size of mask registers

llvm-svn: 201546

10 years ago[asan] Make __cxa_demangle non-weak symbol on Android.
Evgeniy Stepanov [Tue, 18 Feb 2014 07:34:52 +0000 (07:34 +0000)]
[asan] Make __cxa_demangle non-weak symbol on Android.

This fixes global-demangle.cc test on Android.

https://code.google.com/p/address-sanitizer/issues/detail?id=264

llvm-svn: 201545

10 years agoRemove debug print
Alexey Samsonov [Tue, 18 Feb 2014 07:30:37 +0000 (07:30 +0000)]
Remove debug print

llvm-svn: 201544

10 years ago[CMake] Simplify code for detecting/setting compiler flags
Alexey Samsonov [Tue, 18 Feb 2014 07:26:58 +0000 (07:26 +0000)]
[CMake] Simplify code for detecting/setting compiler flags

llvm-svn: 201543

10 years agoPR18876: The special-case rule that ignores the destruction of a top-level
Richard Smith [Tue, 18 Feb 2014 03:51:47 +0000 (03:51 +0000)]
PR18876: The special-case rule that ignores the destruction of a top-level
temporary in a decltype expression only applies if that temporary was created
by a function call, not by a function-style cast or other flavour of
expression.

llvm-svn: 201542

10 years agoFix a typo about lowering AArch64 va_copy.
Jiangning Liu [Tue, 18 Feb 2014 02:37:42 +0000 (02:37 +0000)]
Fix a typo about lowering AArch64 va_copy.

llvm-svn: 201541

10 years agoFix a non-error diagnostic that had an err_ name. Also move it from Warning to
Richard Smith [Tue, 18 Feb 2014 00:45:50 +0000 (00:45 +0000)]
Fix a non-error diagnostic that had an err_ name. Also move it from Warning to
ExtWarn, since it's an extension.

llvm-svn: 201540

10 years agoProperly report when a struct is anonymous.
Sean Callanan [Tue, 18 Feb 2014 00:31:38 +0000 (00:31 +0000)]
Properly report when a struct is anonymous.

<rdar://problem/16071066>

llvm-svn: 201539

10 years agoAdd an x86 prefix encoding for instructions that would decode to a different instruct...
Craig Topper [Tue, 18 Feb 2014 00:21:49 +0000 (00:21 +0000)]
Add an x86 prefix encoding for instructions that would decode to a different instruction with 0xf2/f3/66 were in front of them, but don't themselves have a prefix. For now this doesn't change any bbehavior, but plan to use it to fix some bugs in the disassembler.

llvm-svn: 201538

10 years agoPR18839: 'extern "C++"' also adds an implicit 'extern', not just 'extern "C"'.
Richard Smith [Mon, 17 Feb 2014 23:34:47 +0000 (23:34 +0000)]
PR18839: 'extern "C++"' also adds an implicit 'extern', not just 'extern "C"'.

llvm-svn: 201537

10 years agoPR18870: Parse language linkage specifiers properly if the string-literal is
Richard Smith [Mon, 17 Feb 2014 23:25:27 +0000 (23:25 +0000)]
PR18870: Parse language linkage specifiers properly if the string-literal is
spelled in an interesting way.

llvm-svn: 201536

10 years agoPGO: llvm-profdata: tool for merging profiles
Duncan P. N. Exon Smith [Mon, 17 Feb 2014 23:22:49 +0000 (23:22 +0000)]
PGO: llvm-profdata: tool for merging profiles

Introducing llvm-profdata, a tool for merging profile data generated by
PGO instrumentation in clang.

- The name indicates a file extension of <name>.profdata.  Eventually
  profile data output by clang should be changed to that extension.

- llvm-profdata merges two profiles.  However, the name is more general,
  since it will likely pick up more tasks (such as summarizing a single
  profile).

- llvm-profdata parses the current text-based format, but will be
  updated once we settle on a binary format.

<rdar://problem/15949645>

llvm-svn: 201535

10 years agoImplement LWG Issue 2346: integral_constant's member functions should be marked noexcept
Marshall Clow [Mon, 17 Feb 2014 22:18:51 +0000 (22:18 +0000)]
Implement LWG Issue 2346: integral_constant's member functions should be marked noexcept

llvm-svn: 201534

10 years agoDemangle Dc to decltype(auto) as per the Itanium C++ ABI spec.
Anders Carlsson [Mon, 17 Feb 2014 21:56:01 +0000 (21:56 +0000)]
Demangle Dc to decltype(auto) as per the Itanium C++ ABI spec.

llvm-svn: 201533

10 years agoPR18855: Add support for UCNs and UTF-8 encoding within ud-suffixes.
Richard Smith [Mon, 17 Feb 2014 21:52:30 +0000 (21:52 +0000)]
PR18855: Add support for UCNs and UTF-8 encoding within ud-suffixes.

llvm-svn: 201532

10 years agoFix the arm assembler so that this malformed instruction:
Kevin Enderby [Mon, 17 Feb 2014 21:45:27 +0000 (21:45 +0000)]
Fix the arm assembler so that this malformed instruction:
    ldrd r6, r7 [r2, #15]
simply gives an error and does not triggers an assertion.

As Jim points out, the diagnostic is really strange here,
but fixing that would be more complicated. The missing
comma results in the parser expecting a construct like r2[2],
which is the vector index thing the error message is talking
about. That's not what the user intended, though, and there's
nothing else in the instruction that looks at all like a vector.
Yet more fallout from not having a real parser here and trying
to do context-free generic matching for addressing modes.

rdar://15097243

llvm-svn: 201531

10 years agoAdd support for assigning to . in AsmParser.
Anders Waldenborg [Mon, 17 Feb 2014 20:48:32 +0000 (20:48 +0000)]
Add support for assigning to . in AsmParser.

This is implemented by handling assignments to the '.' pseudo symbol
as ".org" directives.

Differential Revision: http://llvm-reviews.chandlerc.com/D2625

llvm-svn: 201530

10 years agoChange PGO instrumentation to compute counts in a separate AST traversal.
Bob Wilson [Mon, 17 Feb 2014 19:21:09 +0000 (19:21 +0000)]
Change PGO instrumentation to compute counts in a separate AST traversal.

Previously, we made one traversal of the AST prior to codegen to assign
counters to the ASTs and then propagated the count values during codegen. This
patch now adds a separate AST traversal prior to codegen for the
-fprofile-instr-use option to propagate the count values. The counts are then
saved in a map from which they can be retrieved during codegen.

This new approach has several advantages:

1. It gets rid of a lot of extra PGO-related code that had previously been
added to codegen.

2. It fixes a serious bug. My original implementation (which was mailed to the
list but never committed) used 3 counters for every loop. Justin improved it to
move 2 of those counters into the less-frequently executed breaks and continues,
but that turned out to produce wrong count values in some cases. The solution
requires visiting a loop body before the condition so that the count for the
condition properly includes the break and continue counts. Changing codegen to
visit a loop body first would be a fairly invasive change, but with a separate
AST traversal, it is easy to control the order of traversal. I've added a
testcase (provided by Justin) to make sure this works correctly.

3. It improves the instrumentation overhead, reducing the number of counters for
a loop from 3 to 1. We no longer need dedicated counters for breaks and
continues, since we can just use the propagated count values when visiting
breaks and continues.

To make this work, I needed to make a change to the way we count case
statements, going back to my original approach of not including the fall-through
in the counter values. This was necessary because there isn't always an AST node
that can be used to record the fall-through count. Now case statements are
handled the same as default statements, with the fall-through paths branching
over the counter increments.  While I was at it, I also went back to using this
approach for do-loops -- omitting the fall-through count into the loop body
simplifies some of the calculations and make them behave the same as other
loops. Whenever we start using this instrumentation for coverage, we'll need
to add the fall-through counts into the counter values.

llvm-svn: 201528

10 years agoSome nitpicky comment fixes for "i.e." and "e.g." abbreviations.
Bob Wilson [Mon, 17 Feb 2014 19:21:03 +0000 (19:21 +0000)]
Some nitpicky comment fixes for "i.e." and "e.g." abbreviations.

llvm-svn: 201527

10 years agoFix some minor whitespace issues.
Bob Wilson [Mon, 17 Feb 2014 19:20:59 +0000 (19:20 +0000)]
Fix some minor whitespace issues.

llvm-svn: 201526

10 years ago[analyzer] Improved checker naming in CFG dump.
Anton Yartsev [Mon, 17 Feb 2014 18:25:34 +0000 (18:25 +0000)]
[analyzer] Improved checker naming in CFG dump.

This implements FIXME from Checker.cpp (FIXME: We want to return the package + name of the checker here.) and replaces hardcoded checker names with the new ones obtained via getCheckName().getName().

llvm-svn: 201525

10 years agoForcing it to be an error when there is no Documentation list specified for an attrib...
Aaron Ballman [Mon, 17 Feb 2014 18:23:02 +0000 (18:23 +0000)]
Forcing it to be an error when there is no Documentation list specified for an attribute. This is a bit of a (harmless) hack, but the FIXME explains why and when this hack can be removed. It's a justified hack because this prevents attribute authors from forgetting to add documentation when they add a new attribute.

llvm-svn: 201524

10 years agoReplaced custom variable arguments to standard library for correcting 64 bit Windows...
Deepak Panickal [Mon, 17 Feb 2014 17:52:22 +0000 (17:52 +0000)]
Replaced custom variable arguments to standard library for correcting 64 bit Windows build

llvm-svn: 201523

10 years agoFix Windows build, broken by the inclusion of sys/ioctl.h and isatty()
Deepak Panickal [Mon, 17 Feb 2014 17:43:39 +0000 (17:43 +0000)]
Fix Windows build, broken by the inclusion of sys/ioctl.h and isatty()

llvm-svn: 201522

10 years agoFix the LLDB prompt for older Editline versions, specifically running on Ubuntu 12.04
Deepak Panickal [Mon, 17 Feb 2014 17:42:25 +0000 (17:42 +0000)]
Fix the LLDB prompt for older Editline versions, specifically running on Ubuntu 12.04

llvm-svn: 201521

10 years agoRevert "Debug info: Make DWARF4 the default for Darwin, too."
Adrian Prantl [Mon, 17 Feb 2014 17:40:52 +0000 (17:40 +0000)]
Revert "Debug info: Make DWARF4 the default for Darwin, too."

I'm holding this change to give maintainers of Darwin buildbots more time
to update their toolchains.

This reverts commit r201375.

llvm-svn: 201520

10 years agoRemove nativecodegen as it forces the native target libraries to be linked in regardl...
Deepak Panickal [Mon, 17 Feb 2014 17:39:27 +0000 (17:39 +0000)]
Remove nativecodegen as it forces the native target libraries to be linked in regardless of whether the target was specified in LLVM_TARGETS_TO_BUILD

llvm-svn: 201519

10 years agoThe default assignment operator could not be generated by all of the bots, but it...
Aaron Ballman [Mon, 17 Feb 2014 16:18:32 +0000 (16:18 +0000)]
The default assignment operator could not be generated by all of the bots, but it's required by std::vector to operate properly.

llvm-svn: 201518

10 years agoRemoving a C++11'ism to also fix the build bots.
Aaron Ballman [Mon, 17 Feb 2014 15:59:37 +0000 (15:59 +0000)]
Removing a C++11'ism to also fix the build bots.

llvm-svn: 201517

10 years agoFixing build bot breakage due to using a local type as a template argument.
Aaron Ballman [Mon, 17 Feb 2014 15:36:08 +0000 (15:36 +0000)]
Fixing build bot breakage due to using a local type as a template argument.

llvm-svn: 201516

10 years agoImplements a declarative approach to documenting individual attributes in Clang via...
Aaron Ballman [Mon, 17 Feb 2014 15:27:10 +0000 (15:27 +0000)]
Implements a declarative approach to documenting individual attributes in Clang via a Documentation tablegen class. Also updates the internals manual with information about how to use this new, required, documentation feature.

This patch adds some very, very sparse initial documentation for some attributes. Additional effort from attribute authors is greatly appreciated.

llvm-svn: 201515

10 years ago[sanitizer] add tests for DeadlockDetector, minor fix in onLock
Kostya Serebryany [Mon, 17 Feb 2014 14:57:49 +0000 (14:57 +0000)]
[sanitizer] add tests for DeadlockDetector, minor fix in onLock

llvm-svn: 201514

10 years agoSimplify defining Clang compile flags in lit configs
Alexey Samsonov [Mon, 17 Feb 2014 13:08:10 +0000 (13:08 +0000)]
Simplify defining Clang compile flags in lit configs

llvm-svn: 201513

10 years agoFix gcc warning about C++ style comments.
Patrik Hagglund [Mon, 17 Feb 2014 11:54:08 +0000 (11:54 +0000)]
Fix gcc warning about C++ style comments.

llvm-svn: 201512

10 years ago[asan] Add a test for stack unwinding in new and delete.
Evgeniy Stepanov [Mon, 17 Feb 2014 11:52:29 +0000 (11:52 +0000)]
[asan] Add a test for stack unwinding in new and delete.

llvm-svn: 201511

10 years agoUpdate license.txt to point to the new code in third_party/android.
Evgeniy Stepanov [Mon, 17 Feb 2014 11:41:22 +0000 (11:41 +0000)]
Update license.txt to point to the new code in third_party/android.

Also remove a reference to mach_override code that is long gone.

llvm-svn: 201510