| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
Create an ConstantAggregateZero upfront if we see that it is viable.
This saves us from having to manually push_back each and every
initializer and then looping back over them to determine if they are
'null'.
llvm-svn: 224908
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes this snippet from SLi's afl fuzzer output:
class {
i (x = <, enum
This parsed i as a function, x as a paramter, and the stuff after < as a
template list. This then called TryConsumeDeclarationSpecifier() which
called TryAnnotateCXXScopeToken() without checking the preconditions of
this function. Check them before calling, like all other callers of
TryAnnotateCXXScopeToken() do.
A more readable reproducer that causes the same crash is
class {
void i(int x = MyTemplateClass<int, union int>::foo());
};
The reduced version used an eof token as surprising token, but kw_int works
just as well to repro and is easier to insert into a test file.
llvm-svn: 224906
|
|
|
|
|
|
|
| |
We correctly forbid variables but not variable templates. Diagnose this
case instead of crashing.
llvm-svn: 224905
|
|
|
|
|
|
|
|
|
| |
isDeclarationSpecifier performs error recovers which jostles the token
stream. Specifically, TryAnnotateTypeOrScopeToken will end up consuming
a typename token which will confuse the attribute parsing machinery as
we no-longer have something identifier-like.
llvm-svn: 224903
|
|
|
|
|
|
|
|
|
| |
We forgot a conversion step when initializing an atomic type with an
rvalue of the same type.
This fixes PR22043.
llvm-svn: 224902
|
|
|
|
|
|
|
|
|
| |
We expected the type of a TagDecl to be a TagType, not an
InjectedClassNameType. Introduced a helper method, Type::getAsTagDecl,
to abstract away the difference; redefine Type::getAsCXXRecordDecl to be
in terms of it.
llvm-svn: 224898
|
|
|
|
|
|
|
|
|
|
| |
We'd let annotation tokens from '#pragma pack' and the like get inside a
function-like macro. This would lead to terror and mayhem; stop the
madness early.
This fixes PR22037.
llvm-svn: 224896
|
|
|
|
| |
llvm-svn: 224893
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes PR21587, what r221933 fixed for regular programs is now also
fixed for decls coming from PCH files.
Use another bit from the count/bits uint16_t for storing the "more than one
decl" bit. This reduces the number of bits for the count from 14 to 13.
The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits
should still be plenty. Since this changes the meaning of a serialized bit
pattern, also increase clang::serialization::VERSION_MAJOR.
Storing the "more than one decl" state of only the first overload isn't quite
correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at
the state of the first overload so it's good enough for now.
llvm-svn: 224892
|
|
|
|
|
|
|
| |
intrinsic header file. Along with r224822, this should restore the build
bots to passing.
llvm-svn: 224883
|
|
|
|
| |
llvm-svn: 224882
|
|
|
|
|
|
|
| |
Don't warn when a selector has an unavailable and an available variant,
and the first also has an implementation.
llvm-svn: 224881
|
|
|
|
| |
llvm-svn: 224880
|
|
|
|
|
|
|
|
|
|
| |
intrinsic files.
This still lower to the same intrinsics as before.
This is preparation for bounds checking the immediate on the avx version of the builtin so we don't pass illegal immediates into the backend. Since SSE uses a smaller size immediate its not possible to bounds check when using a shared builtin. Rather than creating a clang specific builtin for the different immediate, I decided (after consulting with Chandler) that it was better to match gcc.
llvm-svn: 224879
|
|
|
|
| |
llvm-svn: 224877
|
|
|
|
|
|
|
|
|
|
|
| |
Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in
the low bit of the ObjCMethodDecl pointer, using a PointerIntPair.
Most of this patch is replacing ".Method" with ".getMethod()".
No intended behavior change.
llvm-svn: 224876
|
|
|
|
| |
llvm-svn: 224843
|
|
|
|
| |
llvm-svn: 224836
|
|
|
|
| |
llvm-svn: 224835
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-trigraphs is now an alias for -ftrigraphs. -fno-trigraphs makes it possible
to explicitly disable trigraphs, which couldn't be done before.
clang -std=c++11 -fno-trigraphs
now builds without GNU extensions, but with trigraphs disabled. Previously,
trigraphs were only disabled in GNU modes or with -std=c++1z.
Make the new -f flags the cc1 interface too. This requires changing -trigraphs
to -ftrigraphs in a few cc1 tests.
Related to PR21974.
llvm-svn: 224790
|
|
|
|
|
|
| |
Paired commit with LLVM.
llvm-svn: 224781
|
|
|
|
|
|
|
|
|
|
| |
r224667 broke bootstrap on Fedora 20 X86_64 (at least).
See pr22006 for the details.
r224668 depends on r224667.
llvm-svn: 224770
|
|
|
|
|
|
|
|
|
|
| |
The default value of Opts.Trigraphs now no longer depends solely on the
language input kind, so move the code out of setLangDefaults(). Also make
sure that Opts.MSVCCompat is set before the Trigraph code runs.
Related to PR21974.
llvm-svn: 224719
|
|
|
|
|
|
| |
No functional change intended.
llvm-svn: 224696
|
|
|
|
| |
llvm-svn: 224695
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reapplies r224503 along with a fix for compiling Fortran by having the
clang driver invoke gcc (see r224546, where it was reverted). I have added
a testcase for that as well.
Original commit message:
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.
This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.
Based in part on a patch by Steven Wu.
rdar://problem/18909437
llvm-svn: 224688
|
|
|
|
| |
llvm-svn: 224680
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reverts most of the changes from r168005. Since template arguments have proper
conversions now, no extending of integers is needed. Further, since the
integers are the correct size now, use APSInt::operator== instead of
APSInt::hasSameValue since operator== will check the size and signness match.
Prior to one comparison of APSInt's, check that both are valid. Previous, one
could be uninitialized. Also changed APInt to APSInt in GetInt. This
occassionally produced a sign flip, which will now be caught by operator==.
llvm-svn: 224668
|
|
|
|
|
|
|
|
|
| |
When a non-type template argument expression needs a conversion to change it
into the argument type, preserve that information by remaking the
TemplateArgument with an expression that has those conversions. Also a small
fix to template type diffing to handle the extra conversions in some cases.
llvm-svn: 224667
|
|
|
|
|
|
| |
the statement attributes (as per the standard), and function-try-blocks may not have attributes. NFC.
llvm-svn: 224662
|
|
|
|
|
|
|
| |
Remove an unnecessary conditional, hoisting the assertion. Minor style
tweaks/reflowing. NFC.
llvm-svn: 224654
|
|
|
|
|
|
|
| |
Pull out a getToolChain() into a local variable to share the call across to all
the uses. NFC.
llvm-svn: 224653
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider a template class with attributes on a method, and an explicit
specialization of that method:
template <int>
struct A {
void foo() final;
};
template <>
void A<0>::foo() {}
In this example, the attribute is `final`, but it might also be an
__attribute__((visibility("foo"))), noreturn, inline, etc. clang's current
behavior is to strip all attributes, which for some attributes is wrong
(the snippet above allows a subclass of A<0> to override the final method, for
example) and for others disagrees with gcc.
So stop dropping attributes. r95845 added this code without a test case, and
r176728 added the code for dropping attributes on parameters (with tests, but
they still pass).
As an additional wrinkle, do drop dllimport and dllexport, since that's how
these two attributes work. (This is covered by existing tests.)
Fixes PR21942.
The approach is by Richard Smith, initial analysis and typing was done by me.
With this, clang also matches GCC and EDG on all attributes Richard tested.
llvm-svn: 224651
|
|
|
|
|
|
|
| |
Turns out there will be left-over deferred inline methods if there have
been errors, because in that case HandleTopLevelDecl bails out early.
llvm-svn: 224649
|
|
|
|
|
|
| |
lambda-expression in C++11, to match the C++14 rules.
llvm-svn: 224620
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all"
can be used to disable all sanitizers for a given source file.
"-fsanitize=all" option makes no sense, and will produce an error.
This group can also be useful when we add "-fsanitize-recover=<list>"
options (patch in http://reviews.llvm.org/D6302), as it would allow
to conveniently enable/disable recovery for all specified sanitizers.
Test Plan: regression test suite
Reviewers: kcc, rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6733
llvm-svn: 224596
|
|
|
|
|
|
| |
when we diagnose this as an error.
llvm-svn: 224595
|
|
|
|
|
|
|
|
|
|
| |
implicit conversion.
The issue was produced with OpenCL C code that
called a function with a constant string literal
argument.
llvm-svn: 224592
|
|
|
|
|
|
|
|
| |
or an identifier. VariadicEnumArguments now behave consistently instead of only accepting a string literal.
This change affects the only attribute accepting a variadic enumeration: callable_when.
llvm-svn: 224582
|
|
|
|
| |
llvm-svn: 224564
|
|
|
|
| |
llvm-svn: 224562
|
|
|
|
|
|
| |
declared return type (including a trailing-return-type in C++14).
llvm-svn: 224561
|
|
|
|
|
|
| |
Fixes PR21947.
llvm-svn: 224558
|
|
|
|
| |
llvm-svn: 224557
|
|
|
|
|
|
|
|
| |
when source range is incorrect causing the warning to be
issued when it should not because expression is in a macro.
rdar://19256338
llvm-svn: 224549
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r224503.
It broke compilation of fortran through the Clang driver. Previously
`clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it
tries to call `clang -cc1 t.f` which fails for obvious reasons.
llvm-svn: 224546
|
|
|
|
|
|
|
| |
While we're here, also move the declaration of DeferredInlineMethodDefinitions
closer to the other member vars and make it a SmallVector. NFC.
llvm-svn: 224533
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r224451. It caused us to reject some valid existing
code.
This code appears to run in non-error cases as well as error cases. If
the scope of a DependentScopeDeclRefExpr is still incomplete it probably
means we still have more instantiation to do.
llvm-svn: 224526
|
|
|
|
|
|
| |
Patch by Alex Denisov. NFC.
llvm-svn: 224525
|
|
|
|
|
| |
Change-Id: I4dbfe1d97670fc4e626368ef1f91fc008778dfca
llvm-svn: 224523
|