| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit ensures that the switch warning "case value not in enumerated type"
isn't shown for opaque enums. We don't know the actual list of values in opaque
enums, so that warning is incorrect.
rdar://29230764
Differential Revision: https://reviews.llvm.org/D27299
llvm-svn: 289055
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function receives a callback block. The analyzer suspects that this block
may be used to take care of releasing the libdispatch object returned from
the function. In fact, it doesn't - it only releases the raw data buffer.
Inform the analyzer about that. Fixes the resulting false negatives.
rdar://problem/22280098
Differential Revision: https://reviews.llvm.org/D27409
llvm-svn: 289047
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Needed for https://reviews.llvm.org/D27166
Reviewers: sbenza, bkramer, klimek
Subscribers: aemerson, cfe-commits
Differential Revision: https://reviews.llvm.org/D27447
llvm-svn: 289042
|
|
|
|
|
|
|
| |
Tagged parameter names with \a doxygen command to display them in italics.
Formatted comments to fit into 80 chars.
llvm-svn: 289022
|
|
|
|
|
|
|
|
| |
tuple-like interpretation of decomposition declaration even if there is no
::value member. We already did this, anticipating this resolution, just update
comments and tweak a testcase.
llvm-svn: 289021
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We continue to support dynamic exception specifications in C++1z as an
extension, but produce an error-by-default warning when we encounter one. This
allows users to opt back into the feature with a warning flag, and implicitly
opts system headers back into the feature should they happen to use it.
There is one semantic change implied by P0003R5 but not implemented here:
violating a throw() exception specification should now call std::terminate
directly instead of calling std::unexpected(), but since P0003R5 also removes
std::unexpected() and std::set_unexpected, and the default unexpected handler
calls std::terminate(), a conforming C++1z program cannot tell that we are
still calling it. The upside of this strategy is perfect backwards
compatibility; the downside is that we don't get the more efficient 'noexcept'
codegen for 'throw()'.
llvm-svn: 289019
|
|
|
|
|
|
|
|
|
| |
Allows darwin targets to provide additional definitions and
implementation specifc values for float.h
rdar://problem/21961491
llvm-svn: 289018
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
On actual Windows hosts :-) , this could report something other than the
fallback, with a non-zero minor/build number.
Reviewers: rnk, llvm-commits
Differential Revision: https://reviews.llvm.org/D27554
llvm-svn: 289011
|
|
|
|
|
|
|
|
|
| |
Currently -fstack-protector is on by default when using -ffreestanding.
Change the default behavior to have it off when using -ffreestanding.
rdar://problem/14089363
llvm-svn: 289005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The MSVC toolchain and Clang driver combination currently uses a fairly complex
sequence of steps to determine the MS compatibility version to pass to cc1.
There is some oddness in this sequence currently, with some code which inspects
flags in the toolchain, and some code which inspects the triple and local
environment in the driver code.
This change is an attempt to consolidate most of this logic so that
Win32-specific code lives in MSVCToolChain.cpp. I'm not 100% happy with the
split, so any suggestions are welcome.
There are a few things you might want to watch for for specifically:
- On all platforms, if MSVC compatibility flags are provided (and valid), use
those.
- The fallback sequence should be the same as before, but is now consolidated
into MSVCToolChain::getMSVCVersion:
- Otherwise, try to use the Triple.
- Otherwise, on Windows, check the executable.
- Otherwise, on Windows or with --fms-extensions, default to 18.
- Otherwise, we can't determine the version.
- MSVCToolChain::ComputeEffectiveTriple no longer calls the base
ToolChain::ComputeEffectiveClangTriple. The only thing it would change for
Windows the architecture, which we don't care about for the compatibility
version.
- I'm not sure whether this is philosophically correct (but it should
be easy to add back to MSVCToolChain::getMSVCVersionFromTriple if not).
- Previously, Tools.cpp just called getTriple() anyhow, so it doesn't look
like the effective triple was always being used previously anyhow.
Reviewers: hans, compnerd, llvm-commits, rnk
Subscribers: amccarth
Differential Revision: https://reviews.llvm.org/D27477
llvm-svn: 288998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change adds more test cases for the default MSVC compatibility version:
1. When -fms-extensions is supplied, but -fmsc-version and
-fms-compatibility-version are not.
2. With the target triple specifies an MSVC environment, but no other
-fms* flags.
Reviewers: rnk, llvm-commits
Subscribers: hans, compnerd, amccarth
Differential Revision: https://reviews.llvm.org/D27498
llvm-svn: 288997
|
|
|
|
| |
llvm-svn: 288994
|
|
|
|
| |
llvm-svn: 288976
|
|
|
|
|
|
|
|
|
|
|
|
| |
* __host__ __device__ functions are no longer considered to be
redeclarations of __host__ or __device__ functions. This prevents
unintentional merging of target attributes across them.
* Function target attributes are not considered (and must match) during
explicit instantiation and specialization of function templates.
Differential Revision: https://reviews.llvm.org/D25809
llvm-svn: 288962
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: aaron.ballman, klimek, doug.gregor, teemperor, rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26742
llvm-svn: 288923
|
|
|
|
|
|
| |
'infered' --> 'inferred'
llvm-svn: 288922
|
|
|
|
|
|
|
|
| |
No functional change intended.
Differential Revision: https://reviews.llvm.org/D27408
llvm-svn: 288917
|
|
|
|
|
|
|
|
| |
Avoids a crash and a related false positive.
Investigation by Daniel Krupp!
llvm-svn: 288914
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes PR20796. It implements the C only -Wstrict-prototypes warning.
Clang now emits a warning for function declarations which have no parameters
specified and for K&R function definitions with more than 0 parameters that are
not preceded by a previous prototype declaration.
The patch was originally submitted by Paul Titei!
rdar://15060615
Differential Revision: https://reviews.llvm.org/D16533
llvm-svn: 288896
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
an Objective-C declaration
This commit ensures that Sema won't enter a C++ declarator scope when the
current context is an Objective-C declaration. This prevents an assertion
failure in EnterDeclaratorContext that's used to ensure that current context
will be restored correctly after exiting the declarator context.
rdar://20560175
Differential Revision: https://reviews.llvm.org/D26922
llvm-svn: 288893
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Write output from compilation database test to %T rather than the working dir.
Sometimes CWD isn't writable!
Also specify no-canonical-prefixes so that clang has 'clang' in the name.
Reviewers: bkramer
Subscribers: joerg, cfe-commits
Differential Revision: https://reviews.llvm.org/D27504
llvm-svn: 288892
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
same both in OpenCL1.2 and OpenCL2.0.
Patch by Egor Churaev (echuraev).
Reviewers: Anastasia
Subscribers: yaxunl, cfe-commits, bader
Differential Revision: https://reviews.llvm.org/D27403
llvm-svn: 288891
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Egor Churaev (echuraev).
Reviewers: Anastasia
Subscribers: bader, yaxunl, cfe-commits
Differential Revision: https://reviews.llvm.org/D27300
llvm-svn: 288890
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a first step toward removing Objective-C garbage collection from
Clang, remove support from the driver. I'm hoping this will flush out
any expected bots/configurations/whatever that might rely on it.
I've left the options behind temporarily in -cc1 to keep tests passing.
I'll kill them off entirely in a follow up when I've had a chance to
update/delete the rest of Clang.
llvm-svn: 288872
|
|
|
|
| |
llvm-svn: 288870
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ctor in window. Need add "complete object flag" check in eh cleanup code.
The problem only happen on window ( A MS-ABI issuer )
The nature of the problem is virtual base dtor called more than it is needed after exception throw in inheriting base class(with virtual bases) ctor.
The root problem is when throw happen, not all virtual base classes have been contructed, so not all virtual base dtors are need to call for ehcleanup.
clang has code to handle vbase initialization: basically add check for "complete object flag" before call to v-base ctor.
But that part is missing for cleanup code.
To fix this add similar code as v-base init to cleanup code, same algorithm.
1> Add new routine:
EmitDtorCompleteObjectHandler
With corresponding to EmitCtorCompleteObjectHandler
2> In the EmitDestructorCal
Call EmitDtorCompleteObjectHandler when generate ehcleanup inside ctor.
Just add check for "complete object flag" before call to v-base dtor.
Without my change:
ehcleanup: ; preds = %ctor.skip_vbases
%13 = cleanuppad within none [], !dbg !66
%14 = bitcast %struct.class_0* %this1 to i8*, !dbg !66
%15 = getelementptr inbounds i8, i8* %14, i64 8, !dbg !66
%16 = bitcast i8* %15 to %struct.class_2*, !dbg !66
call void @"\01??1class_2@@UEAA@XZ"(%struct.class_2* %16) #6 [ "funclet"(token
%13) ], !dbg !66
cleanupret from %13 unwind to caller, !dbg !66
with my change:
ehcleanup: ; preds = %ctor.skip_vbases
%13 = cleanuppad within none [], !dbg !66
%14 = bitcast %struct.class_0* %this1 to i8*, !dbg !66
%15 = getelementptr inbounds i8, i8* %14, i64 8, !dbg !66
%16 = bitcast i8* %15 to %struct.class_2*, !dbg !66
%is_complete_object4 = icmp ne i32 %is_most_derived2, 0, !dbg !66
br i1 %is_complete_object4, label %Dtor.dtor_vbase, label %Dtor.skip_vbase, !d
bg !66
Dtor.dtor_vbase: ; preds = %ehcleanup
call void @"\01??1class_2@@UEAA@XZ"(%struct.class_2* %16) #6 [ "funclet"(token
%13) ], !dbg !66
br label %Dtor.skip_vbase, !dbg !66
Dtor.skip_vbase: ; preds = %Dtor.dtor_vbase, %ehcleanup
cleanupret from %13 unwind to caller, !dbg !66
Please let me know you need more info.
Patch by Jennifer Yu.
Differential Revision: https://reviews.llvm.org/D27358
llvm-svn: 288869
|
|
|
|
| |
llvm-svn: 288868
|
|
|
|
|
|
|
|
| |
When an object of class type is initialized from a prvalue of the same type
(ignoring cv qualifications), use the prvalue to initialize the object directly
instead of inserting a redundant elidable call to a copy constructor.
llvm-svn: 288866
|
|
|
|
| |
llvm-svn: 288862
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our -Wweak-vtables diagnostic is powered by our key function
calculation, which checks if key functions are enabled. We won't find
any key functions in C++ ABIs that lack key functions, so -Wweak-vtables
was warning on every dynamic class before this change. So, turn off this
warning in ABIs without key functions.
Addresses PR31220
llvm-svn: 288850
|
|
|
|
| |
llvm-svn: 288838
|
|
|
|
| |
llvm-svn: 288828
|
|
|
|
|
|
|
|
| |
"-mlinker-version=264.3.102" automatically. Wiring down a target on the
other hand is problematic as this actually needs to run codegen and
doesn't work with -###.
llvm-svn: 288827
|
|
|
|
|
|
|
|
|
|
|
|
| |
We didn't implement handle corner cases like:
- lambdas used to initialize a field
- lambdas in default argument initializers
This fixes PR31197.
Differential Revision: https://reviews.llvm.org/D27226
llvm-svn: 288826
|
|
|
|
|
|
| |
Otherwise it would change when DEFAULT_SYSROOT is provided.
llvm-svn: 288823
|
|
|
|
|
|
| |
is seen, record one with the implicit default.
llvm-svn: 288822
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When integrating compilation database output into existing build
systems, two approaches dominate so far. Ad-hoc implementation of the
JSON output rules or using compiler wrappers. This patch adds a new
option "-MJ foo.json" which gives a slightly cleaned up compilation
record. The output is a fragment, i.e. you still need to add the array
markers, but it allows multiple files to be easy merged.
This way the only change in a build system is adding the option with
potentially a per-target output file and merging the files with
something like
(echo '['; cat *.o.json; echo ']' > compilation_database.json
or some additional filtering to remove the trailing comma for strict
JSON compliance.
Differential Revision: https://reviews.llvm.org/D27140
llvm-svn: 288821
|
|
|
|
| |
llvm-svn: 288818
|
|
|
|
|
|
| |
Patch by Michael Sharpe.
llvm-svn: 288813
|
|
|
|
|
|
|
|
|
|
|
| |
It should already be handled but a typo in the LANGSTANDARD() definition
was introduced in r147220.
Patch by Alexander Richardson, test case by me.
Differential Revision:https://reviews.llvm.org/D27427
llvm-svn: 288793
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Related llvm patch: https://reviews.llvm.org/D27359
Reviewers: echristo, t.p.northover, rengolin, grosbach, compnerd
Subscribers: mehdi_amini, cfe-commits, llvm-commits
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D27360
llvm-svn: 288762
|
|
|
|
|
|
|
|
|
| |
- Rename CheckMinZero to CheckMaxUnsignedZero to reflect its actual purpose.
- Remove unused parameters from CheckAbsoluteValueFunction and
CheckMaxUnsignedZero functions.
- Refactor the function name check so both functions can use the same one.
llvm-svn: 288756
|
|
|
|
|
|
| |
Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually.
llvm-svn: 288741
|
|
|
|
| |
llvm-svn: 288740
|
|
|
|
| |
llvm-svn: 288738
|
|
|
|
|
|
|
|
| |
import can't appear here" diagnostic if an already-visible module is textually
entered (because we have the module map but not the AST file) within a
function/namespace scope.
llvm-svn: 288737
|
|
|
|
|
|
|
|
|
|
|
| |
New default warning that triggers when an unsigned zero is used in a call to
std::max. For unsigned values, zero is the minimum value, so any call to
std::max is always equal to the other value. A common pattern was to take
the max of zero and the difference of two unsigned values, not taking into
account that unsigned values wrap around below zero. This warning also emits
a note with a fixit hint to remove the zero and call to std::max.
llvm-svn: 288732
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: x86 is not a valid arch for target triples, but x86_64 and i386 are.
Reviewers: rengolin, silvas
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26960
llvm-svn: 288723
|
|
|
|
|
|
|
|
|
| |
When emitting RTTI for EH only, we would mark the locally defined (LinkOnceODR)
RTTI definition as dllimport, which is incorrect. Ensure that if we are
generating the type information for EH only, it is marked as LinkOnceODR and we
do not make it dllimport.
llvm-svn: 288721
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: NoQ, dcoughlin, zaks.anna
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27365
llvm-svn: 288696
|