Commit Graph

58760 Commits

Author SHA1 Message Date
Artem Belevich 5fbe3ccb49 [NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.
Differential Revision: http://reviews.llvm.org/D10664

llvm-svn: 240659
2015-06-25 17:34:23 +00:00
Aaron Ballman 9ec96a2f3f Fix #pragma redefine_extname when there is a local variable of the same name. The local should not be renamed, only the externally-available declaration should be.
Patch by Andrey Bokhanko!

llvm-svn: 240653
2015-06-25 15:37:16 +00:00
Daniel Marjamaki 0dadfa8d05 Fix a crash by division by zero in analyzer
Patch by takeshi-yoshimura!

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

llvm-svn: 240643
2015-06-25 14:06:02 +00:00
Jay Foad e967dd0420 Teach Clang about the PPC64 memory sanitizer implementation.
Summary:
This is the Clang part of the PPC64 memory sanitizer implementation in
D10648.

Reviewers: kcc, eugenis, willschm, wschmidt, samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

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

llvm-svn: 240628
2015-06-25 10:35:19 +00:00
Daniel Jasper 23d3bcfe5b clang-format: [Proto] Don't treat "operator" as keyword.
Before:
  optional string operator= 1;

After:
  optional string operator = 1;

llvm-svn: 240624
2015-06-25 08:38:46 +00:00
Steven Wu 7a1372ce34 Update darwin SDK version parsing to support OSX and simulator
This re-commits r226005 with a tweak. The origin attempt failed because
Darwin bot sets up SDKROOT and clang can deduce SDK version from them
after this patch. That broke many driver tests due to the change of
deployment target version. Now the tests should not complain after
r240574.

llvm-svn: 240619
2015-06-25 01:59:35 +00:00
Alexey Samsonov 1d4cff2cdc [UBSan] Allow to use -fsanitize=vptr only on Mac OS 10.9+
See https://llvm.org/bugs/show_bug.cgi?id=23539 for why this
is necessary.

llvm-svn: 240618
2015-06-25 00:58:02 +00:00
Hubert Tong 3280b3307f Consolidate and unify initializer list deduction
Summary:
This patch reduces duplication in the template argument deduction code
for handling deduction from initializer lists in a function call. This
extends the fix for PR12119 to also apply to the case where the
corresponding parameter is a trailing parameter pack.

Test Plan:
A test for deduction from nested initializer lists where the
corresponding parameter is a trailing parameter pack is added in
`clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp`.

Reviewers: fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 240612
2015-06-25 00:25:49 +00:00
Hubert Tong ec3cb573f5 [Concepts] Parsing of requires-clause in template-declaration
Summary:
This change implements parse-only acceptance of the optional
requires-clause in a template-declaration. Diagnostic testing is added
for cases where the grammar is ambiguous with the expectation that the
longest token sequence which matches the syntax of a
constraint-expression is consumed without backtracking.

Reviewers: faisalv, fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 240611
2015-06-25 00:23:39 +00:00
Ranjeet Singh ac08e53f3a [ARM] The bits set in the variable HW_FP could get unset
when iterating through the Features vector if we don't
keep track of what's already been set. This could lead to
the macro __ARM_FP getting the wrong value. This patch
fixes this issue by keeping track of the bits that have
already been set in the loop.

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

llvm-svn: 240607
2015-06-24 23:39:25 +00:00
Derek Schuff 5ec5128f64 update comment
llvm-svn: 240601
2015-06-24 22:36:38 +00:00
Derek Schuff 3c6a48d119 Relax assertion in x86_64 byval argument handling for 32-bit pointers
Summary:
Byval argument pair formation assumes that if a type is less than 8 bytes
it must be an integer and not a pointer, which is not true for x32 and NaCl.

Relax the assertion and add a test for a codegen case that triggered it.

Reviewers: jvoung

Subscribers: jfb, cfe-commits

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

llvm-svn: 240600
2015-06-24 22:36:36 +00:00
Douglas Gregor 59e3d75537 Add __nonnull/__nullable/__null_unspecified predefines for Darwin.
Addresses the rest of rdar://problem/21530726.

llvm-svn: 240597
2015-06-24 22:02:16 +00:00
Douglas Gregor aea7afdc13 Replace __double_underscored type nullability qualifiers with _Uppercase_underscored
Addresses a conflict with glibc's __nonnull macro by renaming the type
nullability qualifiers as follows:

  __nonnull -> _Nonnull
  __nullable -> _Nullable
  __null_unspecified -> _Null_unspecified

This is the major part of rdar://problem/21530726, but does not yet
provide the Darwin-specific behavior for the old names.

llvm-svn: 240596
2015-06-24 22:02:08 +00:00
Steven Wu 611a7947c5 Remove environment variables from driver tests
Summary:
Remove some of dangerous environmental variables from clang/Driver tests.
Driver tests should not rely on preset value of these variables and may
actually fail because of them.
They cannot be removed in test/lit.cfg because we still need to support
relocatable SDKs and other overwrite for other clang tests.

Reviewers: bogner

Subscribers: rnk, cfe-commits

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

llvm-svn: 240574
2015-06-24 19:30:36 +00:00
Jordan Rose a46bfa6b83 [Preprocessor] Iterating over all macros should include those from modules.
So, iterate over the list of macros mentioned in modules, and make sure those
are in the master table.

This isn't particularly efficient, but hopefully it's something that isn't
done too often.

PR23929 and rdar://problem/21480635

llvm-svn: 240571
2015-06-24 19:27:02 +00:00
Daniel Jasper 6b8d26c209 clang-format: [JS] Support regex literals containing quotes (' and ").
llvm-svn: 240548
2015-06-24 16:01:02 +00:00
Douglas Katzman 26eabf6d0f Express Driver::GetFilePath more concisely.
llvm-svn: 240545
2015-06-24 15:10:30 +00:00
Aaron Ballman d95d0dab46 Silencing some Sphinx warnings about duplicate explicit target names.
llvm-svn: 240536
2015-06-24 12:11:04 +00:00
Alexey Bataev 1d2353d4f3 [OPENMP] Codegen for 'depend' clause (OpenMP 4.0).
If task directive has associated 'depend' clause then function kmp_int32 __kmpc_omp_task_with_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_task_t * new_task, kmp_int32 ndeps, kmp_depend_info_t *dep_list,kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called instead of __kmpc_omp_task().
If this directive has associated 'if' clause then also before a call of kmpc_omp_task_begin_if0() a function void __kmpc_omp_wait_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called.
Array sections are not supported yet.

llvm-svn: 240532
2015-06-24 11:01:36 +00:00
Chandler Carruth c026e39451 Remove a limited and somewhat questionable DenseMapInfo specialization
for StringRef now that the core DenseMap library provides this facility.

llvm-svn: 240530
2015-06-24 10:24:30 +00:00
Bob Wilson 63c931443d Move the special-case check from r240462 into ARM-specific code.
This fixes a serious bug in r240462: checking the BuiltinID for
ARM::BI_MoveToCoprocessor* in EmitBuiltinExpr() ignores the fact that
each target has an overlapping range of the BuiltinID values. That check
can trigger for builtins from other targets, leading to very bad
behavior.

Part of the reason I did not implement r240462 this way to begin with is
the special handling of the last argument for Neon builtins. In this
change, I have factored out the check to see which builtins have that
extra argument into a new HasExtraNeonArgument() function. There is still
some awkwardness in having to check for those builtins in two separate
places, i.e., once to see if the extra argument is present and once to
generate the appropriate IR, but this seems much cleaner than my previous
patch.

llvm-svn: 240522
2015-06-24 06:05:20 +00:00
Alexey Bataev d157d47062 Proper changing/restoring for CapturedStmtInfo, NFC.
Added special RAII class for proper values changing/restoring in CodeGenFunction::CapturedStmtInfo.

llvm-svn: 240517
2015-06-24 03:35:38 +00:00
Richard Smith 1be4940a1c Fix test failure if this value doesn't end up named %0.
llvm-svn: 240479
2015-06-23 23:13:31 +00:00
Douglas Katzman 51fe7bf227 Use range-based loops when handling OPT_print_search_dirs.
llvm-svn: 240476
2015-06-23 22:43:50 +00:00
Peter Collingbourne 7ce9199a57 SafeStack documentation improvements
This patch makes the following improvements to the SafeStack documentation:

Explicitly states the security guarantees of the SafeStack
Clarifies which of the security guarantees are probabilistic
Re-orders security limitations to put the most severe ones first
Explains how `__attribute__((no_sanitize("safe-stack")))` works and how to use it safely
Explains that SafeStack should be combined with a forward-edge protection mechanism, such as CPI, IFCC or others
Multiple readability and stylistic improvements

Patch by Volodymyr Kuznetsov!

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

llvm-svn: 240472
2015-06-23 22:24:45 +00:00
Benjamin Kramer 452695e08a [Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.
This is consistent with all other classes in Tools.h.

llvm-svn: 240464
2015-06-23 21:15:15 +00:00
Bob Wilson 0c6ed3d29b Improve error handling for PR22560.
The ARM _MoveToCoprocessor and _MoveFromCoprocessor builtins require
integer constants for most arguments, but clang was not checking that.
With this change, we now report meaningful errors instead of crashing
in the backend.

llvm-svn: 240463
2015-06-23 21:10:24 +00:00
Bob Wilson 09aa90bbe1 PR22560: Fix argument order for ARM _MoveToCoprocessor builtins.
The Microsoft-extension _MoveToCoprocessor and _MoveToCoprocessor2
builtins take the register value to be moved as the first argument,
but the corresponding mcr and mcr2 LLVM intrinsics expect that value
to be the third argument. Handle this as a special case, while still
leaving those intrinsics as generic MSBuiltins. I considered the
alternative of handling these in EmitARMBuiltinExpr, but that does
not work well for the follow-up change that I'm going to make to improve
the error handling for PR22560 -- we need the GetBuiltinType() checks
for ICEArguments, and the ARM version of that code is only used for
Neon intrinsics where the last argument is special and not
checked in the normal way.

llvm-svn: 240462
2015-06-23 21:10:15 +00:00
Douglas Katzman 9535429270 Pedantically rename all Tool subclasses to be nouns, not verbs. NFC
Classes in Tools.h inherit ultimately from Tool, which is a noun,
but subclasses of Tool were named for their operation, such as "Compile",
wherein the constructor call "Compile(args...)" could be misconstrued
as actually causing a compile to happen.

Likewise various other methods were not harmonious with their effect,
in that "BuildLinker()" returned a "new namespace::Link(...)"
instead of a "new namespace::Linker(...)" which it now does.

Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names.
And there is no particulary great way to name the "Lipo-er" and a few others.

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

llvm-svn: 240455
2015-06-23 20:42:09 +00:00
David Majnemer 08ef2ba113 [MS ABI] Account for the virtual inheritance quirk when mangling
Virtual inheritance member pointers are always relative to the vbindex,
even when the member pointer doesn't point into a virtual base.  This is
corrected by adjusting the non-virtual offset backwards from the vbptr
back to the top of the most derived class.  While we performed this
adjustment when manifesting member pointers as constants or when
performing conversions, we didn't perform the adjustment when mangling
them.

llvm-svn: 240453
2015-06-23 20:34:18 +00:00
Justin Bogner e44dd6dbd0 InstrProf: Fix a crash when an implicit def appears in a macro
llvm-svn: 240452
2015-06-23 20:29:09 +00:00
Kaelyn Takata 72d16a581b Make the typo resolution in r240441 apply to all function calls.
Regular function calls (such as to cabs()) run into the same problem
with handling dependent exprs, not just builtins with custom type
checking.

Fixes PR23775.

llvm-svn: 240443
2015-06-23 19:13:17 +00:00
Kaelyn Takata e53f0f9019 Ensure delayed typos have been corrected in calls to builtins before
checking those calls when not in C++ mode, since those code paths can't
handle dependent exprs.

Fixes PR23740.

llvm-svn: 240441
2015-06-23 18:42:21 +00:00
Ben Langmuir d4a667a4c0 Use AddString/ReadString instead of doing it manually NFC
llvm-svn: 240434
2015-06-23 18:20:23 +00:00
Ben Langmuir cd98cb7312 [Modules] Consider -fmodule-feature in module hash and when loading
Any extra features from -fmodule-feature are part of the module hash and
need to get validated on load.  Also print them with -module-file-info.

llvm-svn: 240433
2015-06-23 18:20:18 +00:00
Jim Grosbach c78c2bcb2a Driver: Pass -I options to cc1as for .include search paths.
llvm-svn: 240432
2015-06-23 18:20:13 +00:00
Aaron Ballman a8bc40cf3d Adding a title to appease the sphinx build bot.
llvm-svn: 240430
2015-06-23 17:31:30 +00:00
Aaron Ballman 234197f28b AttributeReference.rst is automatically generated by a server-side process currently. To cut down on accidental commits to this file that are not properly reflected in AttrDocs.td (such as r215806 - r215808), this file now contains nothing but a comment explaining the current state of affairs.
llvm-svn: 240428
2015-06-23 17:14:51 +00:00
Alexey Bataev 1c2cfbc3ea [OPENMP] Initial support for 'depend' clause (4.0).
Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).

llvm-svn: 240409
2015-06-23 14:25:19 +00:00
Rafael Espindola b633d20d36 Update for LLVM api change.
llvm-svn: 240406
2015-06-23 13:59:36 +00:00
Aaron Ballman b440c4214d Moving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally applied to the RST file that is automatically generated by the server, and so the changes were never properly reflected online once the server overwrote AttributeReference.rst.
llvm-svn: 240402
2015-06-23 13:41:03 +00:00
Aaron Ballman 6dfdcdf746 Fixing a build bot break from r240400.
llvm-svn: 240401
2015-06-23 13:29:33 +00:00
Aaron Ballman 8d3a7a56a9 Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.
llvm-svn: 240400
2015-06-23 13:15:32 +00:00
NAKAMURA Takumi 0332edac98 Fix a warning. [-Wsign-compare]
FIXME: Should "Level" be unsigned?
llvm-svn: 240391
2015-06-23 10:01:20 +00:00
Yaron Keren b76cb044f1 Silence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
not all control paths return a value.

llvm-svn: 240389
2015-06-23 09:45:42 +00:00
Daniel Jasper 1758a9f1f7 Write output file to temp directory. The tests shouldn't assume that
they can write to the current working directory.

llvm-svn: 240388
2015-06-23 09:26:37 +00:00
NAKAMURA Takumi 4a8917be84 Tweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe on newer version of Windows.
It seems "*.pcm" would be expanded with current directory by NTOS 6.x's msvcrt. GnuWin32 utils are affected.
To avoid the issue, put an expression that msvcrt's glob won't match, like "*.pc[m]".

llvm-svn: 240387
2015-06-23 08:37:21 +00:00
David Majnemer c1709d387e [MS ABI] Rework member pointer conversion
Member pointers in the MS ABI are made complicated due to the following:
- Virtual methods in the most derived class (MDC) might live in a
  vftable in a virtual base.
- There are four different representations of member pointer: single
  inheritance, multiple inheritance, virtual inheritance and the "most
  general" representation.
- Bases might have a *more* general representation than classes which
  derived from them, a most surprising result.

We believed that we could treat all member pointers as-if they were a
degenerate case of the multiple inheritance model.  This fell apart once
we realized that implementing standard member pointers using this ABI
requires referencing members with a non-zero vbindex.

On a bright note, all but the virtual inheritance model operate rather
similarly.  The virtual inheritance member pointer representation
awkwardly requires a virtual base adjustment in order to refer to
entities in the MDC.

However, the first virtual base might be quite far from the start of the
virtual base.  This means that we must add a negative non-virtual
displacement.

However, things get even more complicated.  The most general
representation interprets vbindex zero differently from the virtual
inheritance model: it doesn't reference the vbtable at all.

It turns out that this complexity can increase for quite some time:
consider a derived to base conversion from the most general model to the
multiple inheritance model...

To manage this complexity we introduce a concept of "normalized" member
pointer which allows us to treat all three models as the most general
model.  Then we try to figure out how to map this generalized member
pointer onto the destination member pointer model.  I've done my best to
furnish the code with comments explaining why each adjustment is
performed.

This fixes PR23878.

llvm-svn: 240384
2015-06-23 07:31:11 +00:00
David Majnemer 5ca193c333 [MS ABI] Refactor member pointer generation
The MS ABI has very complicated member pointers.  Don't attempt to
synthesize the final member pointer ab ovo usque ad mala in one go.

Instead, start with a member pointer which points to the declaration in
question as-if it's decl context was the target class.  Then, utilize
our conversion logical to convert it to the target type.

This allows us to simplify how we think about member pointers because we
don't need to consider non-zero nv adjustments before we even generate
the member pointer.  Furthermore, it gives our adjustment logic more
exposure by utilizing it in a common path.

llvm-svn: 240383
2015-06-23 07:31:07 +00:00