OpenMP 4.1 introduces optional argument '(n)' for 'ordered' clause, where 'n' is a number of loops that immediately follow the directive.
'n' must be constant positive integer expressions and it must be less or equal than the number of the loops in the resulting loop nest.
Patch adds parsing and semantic analysis for this optional argument.
llvm-svn: 243635
We currently don't canonicalize paths in the preprocessed files.
But we do when writing to PCH.
This causes a discrepancy on Windows with the test below.
This test fails even on unix if you change the test to use
`%S//preprocess.h`.
I am led to conclude that the invariant that this test was intending to
test has not been upheld for a while (and may never have been).
llvm-svn: 243602
Also fix completely broken and untested code which was hiding the
primary bug. The !LLVM_ON_UNIX branch of the ifdef was actually a no-op.
I ran into this in the wild. It was causing failures in our SDK build.
Ideally we'd have a perfect llvm::sys::fs::canonical, but at least this
is a step in the right direction, and fixes an obviously broken case.
In some sense the test case I've added here is an integration test. We
should have these routines thoroughly unit tested in llvm::sys::fs.
llvm-svn: 243597
Without DR1579 implemented, the only case for -Wredundant-move is for a
parameter being returned with the same type as the function return type. Also
include a check to verify that the move constructor will be used by matching
nodes in the AST dump.
llvm-svn: 243594
UsingShadowDecls over other declarations of the same entity in the lookup
results. This ensures that we build correct redeclaration chains for the
UsingShadowDecls (otherwise we could see assertions and other misbehavior in
modules builds, when merging combines multiple redeclaration chains for the
same entity from the same module into one chain).
llvm-svn: 243592
Dependent types can throw off the analysis for these warnings, possibly giving
conflicting warnings and fix-its. Disabling the warning in template
instantiations will prevent this problem, and will still catch the
non-dependent cases in templates.
llvm-svn: 243538
new GV (usually NAME.1) instead of the correct NAME of the old GV. Moving comdat
creation after GV replacement solves this. Patch + testcase.
Reviewed by Reid Kleckner.
http://reviews.llvm.org/D11594
llvm-svn: 243525
This commit changes the driver to save subtarget feature "+strict-align"
to the IR instead of using backend option "aarch64-strict-align". This is
needed for LTO.
rdar://problem/21529937
llvm-svn: 243518
This commit changes the driver to save subtarget feature "+strict-align" to the
IR instead of using backend option "arm-strict-align". This is needed for LTO.
Also, move the logic in ARM backend that was deciding whether strict alignment
should be forced to the front-end.
rdar://problem/21529937
http://reviews.llvm.org/D11472
llvm-svn: 243489
Host-only cuda compilation does produce valid host object
file and in some cases users do want to proceed on to the linking phase.
The change removes special case that stopped compilation pipeline at
the Assembly phase. Device-side compilation is still stopped early
by the types::getCompilationPhases().
Differential Revision: http://reviews.llvm.org/D11573
llvm-svn: 243478
Store the locations for a macro expansion in a vector, then iterate over them
instead of using recursion. This simplifies the logic around the backtrace
limit and gives easier access to the source locations. No functionality change.
Patch by Zhengkai Wu.
Differential Revision: http://reviews.llvm.org/D11542
llvm-svn: 243477
error.
If the object being moved has a move constructor and a deleted copy constructor,
std::move is required, otherwise Clang will give a deleted constructor error.
llvm-svn: 243463
(Keep -Wmsvc-include around as an alias.)
While here, also replace the one other mention of "MSVC" in diagnostics with
"Microsoft", for consistency.
llvm-svn: 243444
This will be used for old targets like Android that do not
support ELF TLS models.
Differential Revision: http://reviews.llvm.org/D10524
llvm-svn: 243441
- Use cached LLVM types
- Turn SmallVectors into Arrays/ArrayRef if the size is static
- Use ConstantInt::get's implicit splatting for vector types
No functionality change intended.
llvm-svn: 243425
Also move "pragma comment" warning from -Wmicrosoft to -Wignored-pragmas.
-Wmicrosoft currently covers many different areas, some more useful than
others. Split it into many targeted flags, so that projects can choose to
enable only a subset of these warnings. This is also useful for incrementally
fixing and turning on these warnings.
-Wno-microsoft still disables all these warnings, and -Wmicrosoft still enables
them all. After this change, it's possible to pass `-Wno-microsoft
-Wmicrosoft-unqualified-friend` to only enable -Wmicrosoft-unqualified-friend,
and `-Wmicrosoft -Wno-microsoft-unqualified-friend` to enable all other
Microsoft warnings.
I put all the template-related warnings behind -Wmicrosoft-template; if that
turns out to be too coarse we can make that finer later on. (In practice, I
haven't seen the template-related warnings fire frequently.)
Reviewed at http://reviews.llvm.org/D11504
llvm-svn: 243371
This was calling FD->hasBody(), meaning "Does the function that this
decl refers to have a body?", rather than
FD->doesThisDeclarationHaveABody(), meaning "Is this decl a
non-deleted definition?".
We might want to consider renaming these APIs :/
llvm-svn: 243360
This patch allows Clang to pass on -Wa,-mfpu, -Wa,-mhwdiv and
-Wa,-mcpu to the integrated assembler (via target-features), but
-march is still not being passed, but validated.
In case the command line has both -mxxx and -Wa,-mxxx, we warn
that the naked one will not be used in assembler mode.
llvm-svn: 243353
To be able to handle -Wa, options in the assembler (ClangAs), we need to
make the handling of options based on the value of the options, not direct
Arguments from the list, since the list is immutable.
No functional change in this patch, but this allows validating of -Wa,-mfpu
and friends in the same way we validate -mfpu and friends, *just* for the
assembler.
llvm-svn: 243352
When ‘#pragma clang loop vectorize(assume_safety)’ was specified on a loop other loop hints were lost. The problem is that CGLoopInfo attaches metadata differently than EmitCondBrHints in CGStmt. For do-loops CGLoopInfo attaches metadata to the br in the body block and for while and for loops, the inc block. EmitCondBrHints on the other hand always attaches data to the br in the cond block. When specifying assume_safety CGLoopInfo emits an empty llvm.loop metadata shadowing the metadata in the cond block. Loop transformations like rotate and unswitch would then eliminate the cond block and its non-empty metadata.
This patch unifies both approaches for adding metadata and modifies the existing safety tests to include non-assume_safety loop hints.
llvm-svn: 243315