After D93264, using both -fdebug-info-for-profiling and
-fpseudo-probe-for-profiling will cause the compiler to crash.
Diagnose these conflicting options in the driver.
Also, the existing CodeGen test was using the driver when it should be
running cc1.
Differential Revision: https://reviews.llvm.org/D96354
Not all platforms accept -stdlib or -rtlib. Instead of complaining about
the wrong argument to these options, clang complains about the option
itself being present.
Pass an appropriate -target to the clang invocations.
Some Windows build bots report `FileSystemOpts` and `MigratorOpts` as undeclared. This fix renames the parameter and declares a local variable with the original name.
This patch splits out the last two option groups (`Filesystem` and `Migrator`) into their own `Parse`/`Generate` functions.
This effectively removes the need for `parseSimpleArgs` and marshalling block in `CompilerInvocation::generateCC1CommandLine`.
The two new `Parse`/`Generate` functions are not part of the round-trip, because they contain no custom code and the very next patch starts round-tripping the whole `CompilerInvocation`.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96278
This patch implements generation of remaining diagnostic options and tests it by performing parse-generate-parse round trip.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96274
This patch implements generation of remaining dependency output options and tests it by performing parse-generate-parse round trip.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96273
This patch implements generation of remaining target options and tests it by performing parse-generate-parse round trip.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96158
This patch implements generation of remaining preprocessor output options and tests it by performing parse-generate-parse round trip.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96156
Add support for the following options:
* -fopenmp
* -fopenacc
Update OpenMP and OpenACC semantics tests to use the new driver if it is built, otherwise use f18.
OpenMP tests that include `use omp_lib` or run `test_symbols.sh` have not been updated as they require options `-intrinsic-module-directory` and `-funparse-with-symbols` which are currently not implemented in the new driver.
Similarly OpenACC tests that run `test_symbols.sh` have not been updated.
This patch also moves semanticsContext to CompilerInvocation and creates it in CompilerInvocation#setSemanticsOpts so that the semantics context can use Fortran::parser::Options#features.
Summary of changes:
- Move semanticsContext to CompilerInvocation.h
- Update OpenMP and OpenACC semantics tests that do not rely on `-intrinsic-module-directory` and `-funparse-with-symbols` to use %flang
Differential Revision: https://reviews.llvm.org/D96032
Add the builtin functions brought by the
cl_khr_subgroup_non_uniform_arithmetic extension to
`-fdeclare-opencl-builtins`.
Differential Revision: https://reviews.llvm.org/D95951
This reverts commit 3500cc8d89.
This old commit was made over a completely false premise. OSSymbols
aren't different from other OSObjects and we shouldn't treat them
differently for the purposes of static analysis.
Since ToolChain::GetCXXStdlibType() is a simple getter that might emit
the "invalid library name in argument" warning, it can conceivably be
called several times while initializing the build pipeline.
Before this patch, a simple 'clang++ -stdlib=foo ./test.cpp' would print
the warning twice, -rt=lib=foo would print 6 times.
Change this and always only print the warning once. Keep the rest of the
semantics of the functions.
Differential Revision: https://reviews.llvm.org/D95915
The patch only plumbs through the option necessary for targeting sm_86 GPUs w/o
adding any new functionality.
Differential Revision: https://reviews.llvm.org/D95974
This patch implements generation of remaining frontend options and tests it by performing parse-generate-parse round trip.
Depends on D96269.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96155
Signed prefix is removed and the single word spelling is
printed for the scalar types.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D96161
This patch extracts the mapping between command line option and frontend::ActionKind into a table. The table can be reused when parsing and also generating command line options.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96269
This patch stores the `InputKind` (parsed mainly from `-x`) to `FrontendOptions`. This is necessary for command line generation.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96149
Intrinsics *reduce_add/mul_ps/pd have assumption that the elements in
the vector are reassociable. So we need to always assign the reassoc
flag when we call _mm_reduce_* intrinsics.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D96231
This patch implements generation of remaining codegen options and tests it by performing parse-generate-parse round trip.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D96056
Regular expression patterns passed through the command line are being used to create an instances of `llvm::Regex` and thrown away.
There is no API to serialize `Regex` back to the original pattern. This means we have no way to reconstruct the original pattern from command line. This is necessary for serializing `CompilerInvocation`.
This patch stores the original pattern string in `CodeGenOptions` alongside the `llvm::Regex` instance.
Reviewed By: dexonsmith, thegameg
Differential Revision: https://reviews.llvm.org/D96036
This patch implements generation of remaining language options and tests it by performing parse-generate-parse round trip (on by default for assert builds, off otherwise).
This patch also correctly reports failures in `parseSanitizerKinds`, which is necessary for emitting diagnostics when an invalid sanitizer is passed to `-fsanitize=` during round-trip.
This patch also removes TableGen marshalling classes from two options:
* `fsanitize_blacklist` When parsing: it's first initialized via the generated code, but then also changed by manually written code, which is confusing.
* `fopenmp` When parsing: it's first initialized via generated code, but then conditionally changed by manually written code. This is also confusing. Moreover, we need to do some extra checks when generating it, which would be really cumbersome in TableGen. (Specifically, not emitting it when `-fopenmp-simd` was present.)
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D95793
It is very common to check callbacks and completion handlers for null.
This patch supports such checks using built-in functions:
* __builtin_expect
* __builtin_expect_with_probablity
* __builtin_unpredictable
rdar://73455388
Differential Revision: https://reviews.llvm.org/D96268
This patch added a distinct CUID for each input file, which is represented by InputAction.
clang initially creates an InputAction for each input file for the host compilation. In CUDA/HIP action
builder, each InputAction is given a CUID and cloned for each GPU arch, and the CUID is also cloned. In this way,
we guarantee the corresponding device and host compilation for the same file shared the
same CUID. On the other hand, different compilation units have different CUID.
-fuse-cuid=random|hash|none is added to control the method to generate CUID. The default
is hash. -cuid=X is also added to specify CUID explicitly, which overrides -fuse-cuid.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D95007
during the same evaluation.
It looks like the only case for which this matters is determining
whether mutable subobjects of a heap allocation can be modified during
constant evaluation.
variable's destruction if it didn't do so during construction.
The standard doesn't give any guidance as to what to do here, but this
approach seems reasonable and conservative, and has been proposed to the
standard committee.
A module with errors would be marked as out-of-date, then the `compilerModule` action would produce it, but due to the error it would be treated as failure and the resulting PCM would not get used.
rdar://74087062
Differential Revision: https://reviews.llvm.org/D96246
Currently -fgpu-rdc is not passed to host clang -cc1.
This causes issue because -fgpu-rdc affects shadow
variable linkage in host compilation.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D96105
Link: https://lists.llvm.org/pipermail/llvm-dev/2020-October/146162.html "[RFC] FileCheck: (dis)allowing unused prefixes"
If a downstream project using lit needs time for transition,
add the following to `lit.local.cfg`:
```
from lit.llvm.subst import ToolSubst
fc = ToolSubst('FileCheck', unresolved='fatal')
config.substitutions.insert(0, (fc.regex, 'FileCheck --allow-unused-prefixes'))
```
Differential Revision: https://reviews.llvm.org/D95849
As Itanium ABI[http://itanium-cxx-abi.github.io/cxx-abi/abi.html#once-ctor]
points out:
"The size of the guard variable is 64 bits. The first byte (i.e. the byte at
the address of the full variable) shall contain the value 0 prior to
initialization of the associated variable, and 1 after initialization is complete."
Differential Revision: https://reviews.llvm.org/D95822
Pipe element type spelling for arg info metadata
should follow the same behavior as normal type spelling.
We should only use the canonical type spelling in the
base type field.
This patch also removed duplication in type handling.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D96151
This reverts commit 6039f821 and reapplies bff6d9bb.
Clang's Index/implicit-attrs.m test invokes c-index-test with -fobjc-arc. This flag is not compatible with -fobjc-runtime=gcc, which gets implied on Linux.
The original commit uncovered this by correctly reporting issues when parsing -cc1 command line.
This commit fixes the test to explicitly provide ObjectiveC runtime compatible with ARC.
Do not enforce that the expression to obtain the QualType for an
OpenCL type starts with an ASTContext. This adds the required
flexibility for handling the remaining missing argument types such as
enums.
Differential Revision: https://reviews.llvm.org/D96050