When modeling a call to a setter for a property that is synthesized to be
backed by an instance variable, don't invalidate the entire instance
but rather only the storage for the updated instance variable itself.
This still doesn't model the effect of the setter completely. It doesn't
bind the set value to the ivar storage location because doing so would cause
the set value to escape, removing valuable diagnostics about potential
leaks of the value from the retain count checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261243 91177308-0d34-0410-b5e6-96231b3b80d8
Llvm module object is shared between CodeGenerator and BackendConsumer,
in both classes it is stored as std::unique_ptr, which is not a good
design solution and can cause double deletion error. Usually it does
not occur because in BackendConsumer::HandleTranslationUnit the
ownership of CodeGenerator over the module is taken away. If however
this method is not called, the module is deleted twice and compiler crashes.
As the module owned by BackendConsumer is always the same as CodeGenerator
has, pointer to llvm module can be removed from BackendGenerator.
Differential Revision: http://reviews.llvm.org/D15450
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261222 91177308-0d34-0410-b5e6-96231b3b80d8
Currently we return no results when completing inside of the brackets in
a 'char foo[]' declaration. Let the generic expression completion code
handle it instead. We could get fancier here (e.g. filter non-constant
expressions in contexts where VLAs are not allowed), but it's a strict
improvement over the existing version.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261217 91177308-0d34-0410-b5e6-96231b3b80d8
Patch fixes bug with codegen for lastprivate loop counters. Also it may
improve performance for lastprivates calculations in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261209 91177308-0d34-0410-b5e6-96231b3b80d8
to force debug build and hopefully enable more precise warnings.
Static Analyzer is much more efficient when built in debug mode
(-UNDEBUG) so we advice users to enable it manually. This may be
inconvenient in case of large complex projects (think about Linux
distros e.g. Android or Tizen). This patch adds a flag to scan-build
which inserts -UNDEBUG automatically.
Differential Revision: http://reviews.llvm.org/D16200
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261204 91177308-0d34-0410-b5e6-96231b3b80d8
Our support for C++ EH is sufficiently good that it makes sense to
enable support for it out of the box.
While we are here, update the MSVCCompatibility doc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261195 91177308-0d34-0410-b5e6-96231b3b80d8
Clang implements an enable_if attribute as an extension. Hook up `-Wpedantic`
to issue an extension usage warning when __enable_if__ is used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261192 91177308-0d34-0410-b5e6-96231b3b80d8
We prematurely ended the line at the null byte which caused us to crash
down stream because we tried to reason about columns beyond the end of
the line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261171 91177308-0d34-0410-b5e6-96231b3b80d8
An optional nopartial can be placed after the platform name.
int bar() __attribute__((availability(macosx,nopartial,introduced=10.12))
When deploying back to a platform version prior to when the declaration was
introduced, with 'nopartial', Clang emits an error specifying that the function
is not introduced yet; without 'nopartial', the behavior stays the same: the
declaration is `weakly linked`.
A member is added to the end of AttributeList to save the location of the
'nopartial' keyword. A bool member is added to AvailabilityAttr.
The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as
we handle unavailable cases.
Reviewed by Doug Gregor and Jordan Rose.
rdar://23791325
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261163 91177308-0d34-0410-b5e6-96231b3b80d8
thousands of modules, each of which declares the same namespace, linearly
scanning the redecl chain looking for a visible declaration (once for each leaf
module, for each use) performs very poorly. Namespace visibility can only
decrease when we leave a module during a module build step, and we never care
*which* visible declaration of a namespace we find, so we can cache this very
effectively.
This results in a 35x speedup on one of our internal build steps (2m -> 3.5s),
but is hard to unit test because it requires a very large number of modules.
Ideas for a test appreciated! No functionality change intended other than the
speedup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261161 91177308-0d34-0410-b5e6-96231b3b80d8
The assert is triggered because isObjCRetainableType() is called on the
canonicalized return type that has been stripped of the typedefs and
attributes attached to it. To fix this assert, this commit gets the
original return type from CurCodeDecl or BlockInfo and uses it instead
of the canoicalized type.
rdar://problem/24470031
Differential Revision: http://reviews.llvm.org/D16914
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261151 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
I've got a patchset in my home directory to integrate support for
SafeStack into CloudABI's C library. All of the CloudABI unit tests
still seem to pass. Pretty sweet!
This change adds the necessary changes to Clang to make
-fsanitize=safe-stack work on CloudABI. Without it, passing this command
line flag throws an error.
Reviewers: eugenis, samsonov
Differential Revision: http://reviews.llvm.org/D17243
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261135 91177308-0d34-0410-b5e6-96231b3b80d8
OpenCL Extension v1.2 s9.5 allows half precision floating point
type literals with suffices h or H when cl_khr_fp16 is enabled.
Example: half x = 1.0h;
Patch by Liu Yaxun (Sam)!
Differential Revision: http://reviews.llvm.org/D16865
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261084 91177308-0d34-0410-b5e6-96231b3b80d8
Patch fixes possible problems with correct handling arrays as
expressions in initialization, conditions etc in loop-based constructs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261080 91177308-0d34-0410-b5e6-96231b3b80d8
This appears to be passing '-Wl,-order_file' to Linux link commands,
which then causes the linker to silently, behind the scenes, write the
output to 'rder_file' instead of somewhere else. Will work with Chris to
figure out the proper support for this, but so far there are numerous
people who can't get Clang to update when they build because of this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261054 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.
Reviewers: rsmith, rnk
Subscribers: rnk, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17214
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261005 91177308-0d34-0410-b5e6-96231b3b80d8
Tag the test with "REQUIRES: can-remove-opened-file", which is what we
use for the similar test Modules/explicit-build-missing-file.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260994 91177308-0d34-0410-b5e6-96231b3b80d8
Previously we would leave behind the old name specifier prefix, which
creates an invalid AST. Other callers of CorrectTypo update their
CXXScopeSpec objects with the correction specifier if one is present.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260993 91177308-0d34-0410-b5e6-96231b3b80d8
Like cl.exe, clang-cl allows adding system include directories via the
INCLUDE env var. Having a driver flag for this functionality is useful,
so add this too.
(In the future, we probably also want to have a flag alternative to
VCINSTALLDIR as used in MSVCToolChain::getVisualStudioBinaries(), and
a way to override the registry accesses in MSVCToolChain::getWindowsSDKDir()
-- maybe -ivcroot= and -iwinsdkroot=?).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260990 91177308-0d34-0410-b5e6-96231b3b80d8
Loop-based directives allow to use iterators as loop counters. Iterators are allowed to define their own operators. This patch allows to use compound assignment operators for iterators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260957 91177308-0d34-0410-b5e6-96231b3b80d8
Expressions inside 'schedule'|'dist_schedule' clause must be captured in
combined directives to avoid possible crash during codegen. Patch
improves handling of such constructs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260954 91177308-0d34-0410-b5e6-96231b3b80d8
r260925 introduced a version of the *trim methods which is preferable
when trimming a single kind of character. Update all users in clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260927 91177308-0d34-0410-b5e6-96231b3b80d8
I'd accidentally skipped the CMake check in a premature optimisation. I'd also
put the original test in completely the wrong place.
Thanks Jonas Hahnfeld!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260898 91177308-0d34-0410-b5e6-96231b3b80d8