Commit Graph

56526 Commits

Author SHA1 Message Date
Filipe Cabecinhas 22e7635dc5 Testcase for PS4 target defaults (from r227215 and r227219)
llvm-svn: 227343
2015-01-28 18:49:45 +00:00
Alex Rosenberg 286f124da5 Enable pragma comment processing for PS4. Original patch by Yunzhong Gao!
llvm-svn: 227336
2015-01-28 18:26:15 +00:00
Tom Stellard d99fb956a3 R600: Use a Southern Islands GPU as the default for the amdgcn target
llvm-svn: 227315
2015-01-28 15:38:44 +00:00
Hal Finkel 77366097f4 Fix typo (count correctly) in include/clang/AST/TypeNodes.def
Patch by Mingjie Xing.

llvm-svn: 227313
2015-01-28 15:11:18 +00:00
Nathan Sidwell 0ba1940b8d PR 20146
make new diagnostic an ExtWarn

llvm-svn: 227312
2015-01-28 14:48:39 +00:00
Sean Silva fdcbb0284e Avoid testing for a particular choice of resource dir.
Without this patch, this test was accidentally testing that
CLANG_RESOURCE_DIR, CLANG_LIBDIR_SUFFIX, and CLANG_VERSION_STRING
were set to a particular set of values.

The test was also getting pretty hairy since it was attempting to craft
a regular expression that covered "all" possible combinations of
settings for these configure-time constants.

Clean it up by directly capturing the resource directory in a FileCheck
variable.

llvm-svn: 227310
2015-01-28 14:19:08 +00:00
Francisco Lopes da Silva 0c010cddb3 Improves overload completion result chunks.
The code building the code completion string for overloads was providing
less detail compared to the one building completion strings for function
declarations. There was no information about optionals and no information
about what's a parameter and what's a function identifier, everything
besides ResultType, CurrentParameter and special characters was classified
as Text.

This makes code completion strings for overload candidates to follow a
pattern very similar, but not identical, to the one in use for function
declarations:

 - return type chunk: ResultType
 - function identifier chunk: Text
 - parameter chunks: Placeholder
 - optional parameter chunks: Optional
 - current parameter chunk: CurrentParameter

llvm-svn: 227309
2015-01-28 14:17:22 +00:00
David Majnemer e85cff84b9 Sema: Ensure that __c11_atomic_fetch_add has a pointer to complete type
Pointer arithmetic is only makes sense if the pointee type is complete.

This fixes PR22361.

llvm-svn: 227295
2015-01-28 05:48:06 +00:00
Larisse Voufo 4891e74c39 Re-arrange DR test cases, and update DR status page.
llvm-svn: 227279
2015-01-28 01:01:21 +00:00
Kaelyn Takata 20deb1d78c Use the real CXXScopeSpec when setting the correction SourceRange.
Otherwise, in the most important case and the only case where SS and
TempSS are different (which is when the CXXScopeSpec should be dropped,
and TempSS is NULL) the wrong SourceRange will be used in the fixit for
the typo correction. Fixes the remaining issue in PR20626.

llvm-svn: 227278
2015-01-28 00:46:09 +00:00
Hans Wennborg 2e56d950ff Intrin.h: define _XCR_XFEATURE_ENABLED_MASK
Users expect to be able to use this with _xgetbv.

llvm-svn: 227270
2015-01-27 23:34:35 +00:00
Richard Smith 1bbaba8746 Cleanups, and add some FIXMEs. No functional change.
llvm-svn: 227267
2015-01-27 23:23:39 +00:00
Kaelyn Takata 7a503694fe Fix a think-o in handling ambiguous corrections for a TypoExpr.
Under certain circumstances, the identifier mentioned in the diagnostic
won't match the intended correction even though the replacement
expression and the note pointing to the decl are both correct.
Basically, the TreeTransform assumes the TypoExpr's Consumer points to
the correct TypoCorrection, but the handling of typos that appear to be
ambiguous from the point of view of TransformTypoExpr would cause that
assumption to be violated by altering the Consumer's correction stream.
This fix allows the Consumer's correction stream to be reset to the
right TypoCorrection after successfully resolving the percieved ambiguity.

Included is a fix to suppress correcting the RHS of an assignment to the
LHS of that assignment for non-C++ code, to prevent a regression in
test/SemaObjC/provisional-ivar-lookup.m.

This fixes PR22297.

llvm-svn: 227251
2015-01-27 22:01:39 +00:00
Larisse Voufo 19d0867284 Implement the remaining portion of DR1467 from r227022. I may have overlooked a few things, but this implementation comes straight from the DR resolution itself.
llvm-svn: 227224
2015-01-27 18:47:05 +00:00
Alex Rosenberg ba1b6a16c4 Check wchar_t type on PS4.
llvm-svn: 227223
2015-01-27 18:43:05 +00:00
Adrian Prantl f75014aa34 Update the doxygen comments in CGDebugInfo.h to follow the coding standards.
llvm-svn: 227221
2015-01-27 18:32:19 +00:00
Kaelyn Takata 05f4050928 Properly handle typos in the conditional of ?: expressions in C.
In particular, remove the OpaqueExpr transformation from r225389 and
move the correction of the conditional from CheckConditionalOperands to
ActOnConditionalOp before the OpaqueExpr is created. This fixes the
typo correction behavior in C code that uses the GNU extension for a
binary ?: (without an expression between the "?" and the ":").

llvm-svn: 227220
2015-01-27 18:26:18 +00:00
Filipe Cabecinhas b1e6c2dd3d Fix part of r227215. PS4 code just omits leaf frame pointers.
llvm-svn: 227219
2015-01-27 18:08:32 +00:00
Filipe Cabecinhas 4b44257c54 Added more PS4 defaults for code generation
llvm-svn: 227215
2015-01-27 17:27:37 +00:00
Sean Silva 110de6fc29 No longer SCE_PRIVATE ;)
llvm-svn: 227200
2015-01-27 16:53:56 +00:00
Alex Rosenberg 12207fab78 Begin to teach clang about the PS4.
llvm-svn: 227194
2015-01-27 14:47:44 +00:00
Craig Topper 335e218760 [X86] Add intrinsics for AVX512 128 and 256 bit integer comparison of word and byte vectors.
llvm-svn: 227186
2015-01-27 09:16:29 +00:00
Richard Smith 48372b68fe DR1902: if overload resolution recurses, and the inner overload resolution
selects a deleted function, the outer function is still a candidate even though
the initialization sequence is "otherwise ill-formed".

llvm-svn: 227169
2015-01-27 03:30:40 +00:00
Pete Cooper f051cbf631 Don't generate llvm.expect intrinsics with -O0.
The backend won't run LowerExpect on -O0.  In a debug LTO build, this results in llvm.expect intrinsics being in the LTO IR which doesn't know how to optimize them.

Thanks to Chandler for the suggestion and review.

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

llvm-svn: 227135
2015-01-26 20:51:58 +00:00
Ben Langmuir 7b30f53b18 Tweak r227115 per review feedback
Use getAsArrayTypeUnsafe() instead of getUnqualifiedDesugaredType() to
get the underlying ArrayType.

llvm-svn: 227129
2015-01-26 20:01:17 +00:00
Reid Kleckner ee15ea3560 Fix broken doc link to Clang 3.5 release notes
We appear to use 3.5.0 in the directory structure now. That's probably
unnecessary. We should probably let the micro releases update the docs
for the same minor version.

llvm-svn: 227127
2015-01-26 19:53:16 +00:00
Ben Langmuir 577b39349e Fix assert instantiating string init of static variable
... when the variable's type is a typedef of a ConstantArrayType. Just
look through the typedef (and any other sugar).  We only use the
constant array type here to get the element count.

llvm-svn: 227115
2015-01-26 19:04:10 +00:00
Eric Christopher 611dfed99f Update for LLVM API change.
llvm-svn: 227114
2015-01-26 19:03:30 +00:00
Fariborz Jahanian 4732d43cc2 Objective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macros
with typed enums. rdar://19352510

llvm-svn: 227104
2015-01-26 17:41:03 +00:00
Joerg Sonnenberger dceac987bd For NetBSD/ARM-EB, link with --be8. Support for the older BE32 is
currently not planned.

llvm-svn: 227088
2015-01-26 12:30:16 +00:00
Craig Topper b4789096c0 [X86] Add AVX512 integer comparison intrinsics for word and byte vectors.
llvm-svn: 227079
2015-01-26 09:24:10 +00:00
Evgeniy Stepanov 5e927b6285 [msan] Remove MSanDR reference from the manual.
It is no longer supported.

llvm-svn: 227078
2015-01-26 09:17:37 +00:00
Craig Topper 2f25a5a875 [X86] Add more of the AVX512 integer comparision intrinsics. This adds 128 and 256 bit vectors of dwords and qwords.
llvm-svn: 227075
2015-01-26 08:11:49 +00:00
Nico Weber b3a9978dc8 Don't let virtual calls and dynamic casts call Sema::MarkVTableUsed().
clang currently calls MarkVTableUsed() for classes that get their virtual
methods called or that participate in a dynamic_cast. This is unnecessary,
since CodeGen only emits vtables when it generates constructor, destructor, and
vtt code. (*)

Note that Sema::MarkVTableUsed() doesn't cause the emission of a vtable.
Its main user-visible effect is that it instantiates virtual member functions
of template classes, to make sure that if codegen decides to write a vtable
all the entries in the vtable are defined.

While this shouldn't change the behavior of codegen (other than being faster),
it does make clang more permissive: virtual methods of templates (in particular
destructors) end up being instantiated less often. In particular, classes that
have members that are smart pointers to incomplete types will now get their
implicit virtual destructor instantiated less frequently. For example, this
used to not compile but does now compile:

    template <typename T> struct OwnPtr {
      ~OwnPtr() { static_assert((sizeof(T) > 0), "TypeMustBeComplete"); }
    };
    class ScriptLoader;
    struct Base { virtual ~Base(); };
    struct Sub : public Base {
      virtual void someFun() const {}
      OwnPtr<ScriptLoader> m_loader;
    };
    void f(Sub *s) { s->someFun(); }

The more permissive behavior matches both gcc (where this is not often
observable, since in practice most things with virtual methods have a key
function, and Sema::DefineUsedVTables() skips vtables for classes with key
functions) and cl (which is my motivation for this change) – this fixes
PR20337.  See this issue and the review thread for some discussions about
optimizations.

This is similar to r213109 in spirit. r225761 was a prerequisite for this
change.

Various tests relied on "a->f()" marking a's vtable as used (in the sema
sense), switch these to just construct a on the stack. This forces
instantiation of the implicit constructor, which will mark the vtable as used.

(*) The exception is -fapple-kext mode: In this mode, qualified calls to
virtual functions (`a->Base::f()`) still go through the vtable, and since the
vtable pointer off this doesn't point to Base's vtable, this needs to reference
Base's vtable directly. To keep this working, keep referencing the vtable for
virtual calls in apple kext mode.

llvm-svn: 227073
2015-01-26 06:23:36 +00:00
Nico Weber 220b3ad598 Test that member functions of constexpr constructed templates are instantiated.
They are referenced from the vtable. (This worked fine, but I couldn't find
an existing test for this.  Maybe I didn't look hard enough.)

llvm-svn: 227072
2015-01-26 06:08:07 +00:00
Nico Weber 4a18449c2c Remove -verify from a codegen test that didn't have any expected-foo lines.
Makes the error output of the test more readable when it fails. Also allows
removing a "not" from the run line.

llvm-svn: 227071
2015-01-26 05:47:24 +00:00
Yaron Keren 3bf8462331 clang-format two Decl* code locations, NFC.
llvm-svn: 227070
2015-01-26 04:41:07 +00:00
Nico Weber fe0053eb42 Reword comment.
llvm-svn: 227069
2015-01-26 03:03:49 +00:00
Nico Weber 99e05d02cb Test that qualified virtual calls mark vtables referenced in apple kext mode.
I broke this locally while working on PR20337 and no test caught that.  Now
there's coverage for this, and a comment explaining why this is needed.

llvm-svn: 227068
2015-01-26 02:59:07 +00:00
Craig Topper 4cac1c2318 [X86] Add AVX512F integer comparision intrinsics to header file.
llvm-svn: 227067
2015-01-25 23:30:07 +00:00
Craig Topper 95b0d73cee [X86] Add immediate range checking to AVX512 integer comparision builtins.
llvm-svn: 227066
2015-01-25 23:30:05 +00:00
Craig Topper ad1766aaa0 [X86] Add AVX512 floating cmpgt and integer comparison builtins. Intrinsic header file usages coming later.
llvm-svn: 227065
2015-01-25 23:30:00 +00:00
Renato Golin b625f48862 Allows Clang to use LLVM's fixes-x18 option
This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.

This uses llvm r226664 to allow this register to be reserved.

Patch by Andrew Turner.

llvm-svn: 227062
2015-01-25 23:17:48 +00:00
NAKAMURA Takumi 1dba307c0f clang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.
llvm-svn: 227061
2015-01-25 23:10:21 +00:00
Francisco Lopes da Silva 1a4f855595 Sema: Formatting. No behavior change.
llvm-svn: 227052
2015-01-25 17:00:47 +00:00
Francisco Lopes da Silva a349a8aee9 Sema: require a complete type before lookup.
llvm-svn: 227037
2015-01-25 08:47:59 +00:00
David Blaikie 4e340b75b2 Fix the buildbots (fallout from r227028) by returning the exprloc of non-binary operator overload calls (and ->) to the start of the expression, not the location of the operator
I'll give this some further thought/discussion later, but this is enough
to unbreak the buildbots at least.

llvm-svn: 227034
2015-01-25 07:44:05 +00:00
Nico Weber a24b299c00 Rename four test files from .C to .cpp.
lit.cfg has never supported running .C files, so these tests were never
executed by check-clang.  Rename them to .cpp so that they run as part of
the test suite, and minorly tweak two of them that look like they were broken
when checked in to actually pass.

llvm-svn: 227029
2015-01-25 02:04:36 +00:00
David Blaikie 9f7ae2c948 DebugInfo: Attribute calls to overloaded operators with the operator, not the start of the whole expression
llvm-svn: 227028
2015-01-25 01:25:37 +00:00
David Blaikie 9b47966615 DebugInfo: Use the preferred location rather than the start location for expression line info
This causes things like assignment to refer to the '=' rather than the
LHS when attributing the store instruction, for example.

There were essentially 3 options for this:

* The beginning of an expression (this was the behavior prior to this
  commit). This meant that stepping through subexpressions would bounce
  around from subexpressions back to the start of the outer expression,
  etc. (eg: x + y + z would go x, y, x, z, x (the repeated 'x's would be
  where the actual addition occurred)).

* The end of an expression. This seems to be what GCC does /mostly/, and
  certainly this for function calls. This has the advantage that
  progress is always 'forwards' (never jumping backwards - except for
  independent subexpressions if they're evaluated in interesting orders,
  etc). "x + y + z" would go "x y z" with the additions occurring at y
  and z after the respective loads.
  The problem with this is that the user would still have to think
  fairly hard about precedence to realize which subexpression is being
  evaluated or which operator overload is being called in, say, an asan
  backtrace.

* The preferred location or 'exprloc'. In this case you get sort of what
  you'd expect, though it's a bit confusing in its own way due to going
  'backwards'. In this case the locations would be: "x y + z +" in
  lovely postfix arithmetic order. But this does mean that if the op+
  were an operator overload, say, and in a backtrace, the backtrace will
  point to the exact '+' that's being called, not to the end of one of
  its operands.

(actually the operator overload case doesn't work yet for other reasons,
but that's being fixed - but this at least gets scalar/complex
assignments and other plain operators right)

llvm-svn: 227027
2015-01-25 01:19:10 +00:00