Added an additional ctor that takes a NumOccurrenceFlag parameter for the
SourcePaths option. This frees applications from always having to pass at least
one source file, e.g., -list-checks.
http://reviews.llvm.org/D12069
Patch by Don Hinton!
llvm-svn: 245204
This enables Clang to correctly handle code such as:
struct __declspec(dllexport) S {
int x = 42;
};
where it would otherwise error due to trying to generate the default
constructor before the in-class initializer for x has been parsed.
Differential Revision: http://reviews.llvm.org/D11850
llvm-svn: 245139
Summary: Adding check to emit diagnostic for invalid tag when concept is specified and associated tests.
Reviewers: rsmith, hubert.reinterpretcast, fraggamuffin, faisalv, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D11916
llvm-svn: 245123
So, we now reject that. We also warn for any external-linkage global
variable named main in C, because it results in undefined behavior.
PR: 24309
Differential Revision: http://reviews.llvm.org/D11658
Reviewed by: rsmith
llvm-svn: 245051
blender uses statements expression in condition of the loop under control of the '#pragma omp parallel for'. This condition is used several times in different expressions required for codegen of the loop directive. If there are some variables defined in statement expression, it fires an assert during codegen because of redefinition of the same variables.
We have to rebuild several expression to be sure that all variables are unique.
llvm-svn: 245041
Fix a bug in the matcher docs where callExpr(on(...)) was in the examples,
but didn't work (on() only works for memberCallExpr).
Fix a bug in the doc dump script that was introduced in r231575 when
removing a regexp capture without adapting the code that uses the
captures.
llvm-svn: 245040
Currently, arguments are passed via the string attribute 'command',
assuming a shell-escaped / quoted command line to extract the original
arguments. This works well enough on Unix systems, but turns out to be
problematic for Windows tools to generate.
This CL adds a new attribute 'arguments', an array of strings, which
specifies the exact command line arguments. If 'arguments' is available
in the compilation database, it is preferred to 'commands'.
Currently there is no plan to retire 'commands': there are enough
different use cases where users want to create their own mechanism for
creating compilation databases, that it doesn't make sense to force them
all to implement shell command line parsing.
Patch by Daniel Dilts.
llvm-svn: 245036
file in the .pcm files. This allows a smaller set of files to be sent to a
remote build worker when building with explicit modules (for instance, module
map files need not be sent along with the corresponding precompiled modules).
This doesn't actually make the embedded files visible to header search, so
it's not useful as a packaging format for public header files.
llvm-svn: 245028
ConsumedBlockInfo objects were move assigned, but only in a state where
the dtor was a no-op anyway. Subtle and easily could've happened in ways
that wouldn't've been safe - so this change makes it safe no matter what
state the ConsumedBlockInfo object is in.
llvm-svn: 244998
We risk iterator invalidation issues if we use a DenseMap to hold the
backing storage for an APValue. Instead, BumpPtrAllocate them and
use APValue * as our DenseMap value.
Also, don't assume that MaterializedGlobalTemporaryMap won't regrow
between when we initially perform a lookup and later on when we actually
try to insert into it.
This fixes PR24289.
Differential Revision: http://reviews.llvm.org/D11629
llvm-svn: 244989
makeFilter returns Filters by value which seems to be only safe when the
copy doesn't occur and RVO kicks in. Make the object safely movable to
support this more reliably.
llvm-svn: 244983
Make the copy/move ctors defaulted in the base class and make the
derived classes final to avoid any intermediate hierarchy slicing if
these types were further derived.
llvm-svn: 244979
(return by value is in ExprEngine::processPointerEscapedOnBind and any
other call to the scanReachableSymbols function template used there)
Protect the special members in the base class to avoid slicing, and make
derived classes final so these special members don't accidentally become
public on an intermediate base which would open up the possibility of
slicing again.
llvm-svn: 244975
Turns out the one place that relied on the implicit copy ctor was safe
because it created an object in a state where the dtor was a no-op, but
that's more luck that good management.
Sure up the API by defining move construction and using it, which
implicitly disallows the unreliable copy operations.
llvm-svn: 244968
Partly addressed by r244843, but the explicit dtor in LambdaScopeInfo
was still thwarting the implicit copy ctor. This does remove the key
function from LambdaScopeInfo unfortunately, but it seems neater than
having to explicitly default any special members LambdaScopeInfo needs.
llvm-svn: 244957
files: include the .pcm file itself in the .d output, rather than including its
own input files. Other forms of module file continue to be transparent for .d
output.
Arguably, the input files for the .pcm file are still inputs to the
compilation, but that's unnecessary for make-like build systems (where the
mtime of the .pcm file is sufficient) and harmful for smarter build systems
that know about module files and want to track only the local dependencies.
llvm-svn: 244923
This preserves backwards compatibility for two hacks in the Darwin
system module map files:
1. The use of 'requires excluded' to make headers non-modular, which
should really be mapped to 'textual' now that we have this feature.
2. Silently removes a bogus cplusplus requirement from IOKit.avc.
Once we start diagnosing missing requirements and headers on
auto-imports these would have broken compatibility with existing Darwin
SDKs.
llvm-svn: 244912
Summary:
Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer,
Control Flow Integrity and others, use blacklists to specify which types / functions
should not be instrumented to avoid false positives or suppress known failures.
This change adds the blacklist filenames to the list of dependencies of the rules,
generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain
C/C++/ObjC files need to be recompiled (if a blacklist is updated).
Reviewers: pcc
Subscribers: rsmith, honggyu.kim, pcc, cfe-commits
Differential Revision: http://reviews.llvm.org/D11968
llvm-svn: 244867
All of the other docblocks for the CXCursor_* cursor kind enum values
include documentation that ends with a period. Add a period to the end
of the CXCursor_TypedefDecl documentation to follow this convention.
Patch by Brian Gesiak!
llvm-svn: 244715
emit lexical contents for a declaration for another module. Track which module
those contents came from, and ensure that we only grab the lexical contents
from a single such instantiation.
llvm-svn: 244682
This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015. Let's limit its
impact to system headers to encourage portable code.
llvm-svn: 244650
Following one of the appended options will allow the loop to be vectorized. We do not include a command line option for modifying the pointer checking threshold because there is no clang-level interface for this currently.
llvm-svn: 244526
The main purpose is to avoid errors and warnings while parsing CUDA
header files. The attributes are currently unused otherwise.
Differential version: http://reviews.llvm.org/D11690
llvm-svn: 244497
With this patch clang appends the command line options that would allow vectorization when floating-point commutativity is required. Specifically those are enabling fast-math or specifying a loop hint.
llvm-svn: 244492
This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs
the optimizer to unroll a loop fully if the trip count is known at compile time, and
unroll partially if the trip count is not known at compile time. This differs from
"llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not
known at compile time
With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than
"llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly
to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all".
The motivating example for this change was some internal code with a loop marked
with "#pragma unroll" which only sometimes had a compile-time trip count depending
on template magic. When the trip count was a compile-time constant, everything works
as expected and the loop is fully unrolled. However, when the trip count was not a
compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!).
Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable
from a performance perspective.
llvm-svn: 244467
Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:
* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.
Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.
Reviewers: djasper, klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D11837
llvm-svn: 244446
arguments because the reloaded form might have become non-canonical across the
serialization/deserialization step (this particularly happens when the
canonical form of the type involves an expression).
llvm-svn: 244409