History log of /llvm-project/clang/lib/Frontend/CompilerInvocation.cpp (Results 376 – 400 of 1971)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 7ab80309 12-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] Remove -f[no-]trapping-math from -cc1 command line

This patch removes the -f[no-]trapping-math flags from the -cc1 command line. These flags are ignored in the command line parser and t

[clang][cli] Remove -f[no-]trapping-math from -cc1 command line

This patch removes the -f[no-]trapping-math flags from the -cc1 command line. These flags are ignored in the command line parser and their semantics is fully handled by -ffp-exception-mode.

This patch does not remove -f[no-]trapping-math from the driver command line. The driver flags are being used and do affect compilation.

Reviewed By: dexonsmith, SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D93395

show more ...


# 97100646 08-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

Reapply "[clang][cli] Port DiagnosticOpts to new option parsing system"

This reverts commit 8e3e148c

This commit fixes two issues with the original patch:
* The sanitizer build bot reported an unin

Reapply "[clang][cli] Port DiagnosticOpts to new option parsing system"

This reverts commit 8e3e148c

This commit fixes two issues with the original patch:
* The sanitizer build bot reported an uninitialized value. This was caused by normalizeStringIntegral not returning None on failure.
* Some build bots complained about inaccessible keypaths. To mitigate that, "this->" was added back to the keypath to restore the previous behavior.

show more ...


# 1d3ebbf5 09-Jan-2021 Fangrui Song <i@maskray.me>

Add -f[no-]direct-access-external-data to supersede -mpie-copy-relocations

GCC r218397 "x86-64: Optimize access to globals in PIE with copy reloc" made
-fpie code emit R_X86_64_PC32 to reference ext

Add -f[no-]direct-access-external-data to supersede -mpie-copy-relocations

GCC r218397 "x86-64: Optimize access to globals in PIE with copy reloc" made
-fpie code emit R_X86_64_PC32 to reference external data symbols by default.
Clang adopted -mpie-copy-relocations D19996 as a flexible alternative.

The name -mpie-copy-relocations can be improved [1] and does not capture the
idea that this option can apply to -fno-pic and -fpic [2], so this patch
introduces -f[no-]direct-access-external-data and makes -mpie-copy-relocations
their aliases for compatibility.

[1]
For
```
extern int var;
int get() { return var; }
```
if var is defined in another translation unit in the link unit, there is no copy
relocation.

[2]
-fno-pic -fno-direct-access-external-data is useful to avoid copy relocations.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65888
If a shared object is linked with -Bsymbolic or --dynamic-list and exports a
data symbol, normally the data symbol cannot be accessed by -fno-pic code
(because by default an absolute relocation is produced which will lead to a copy
relocation). -fno-direct-access-external-data can prevent copy relocations.

-fpic -fdirect-access-external-data can avoid GOT indirection. This is like the
undefined counterpart of -fno-semantic-interposition. However, the user should
define var in another translation unit and link with -Bsymbolic or
--dynamic-list, otherwise the linker will error in a -shared link. Generally
the user has better tools for their goal but I want to mention that this
combination is valid.

On COFF, the behavior is like always -fdirect-access-external-data.
`__declspec(dllimport)` is needed to enable indirect access.

There is currently no plan to affect non-ELF behaviors or -fpic behaviors.

-fno-pic -fno-direct-access-external-data will be implemented in the subsequent patch.

GCC feature request https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112

Reviewed By: tmsriram

Differential Revision: https://reviews.llvm.org/D92633

show more ...


# 0e23fd67 08-Jan-2021 Hongtao Yu <hoy@fb.com>

[Driver] Add DWARF64 flag: -gdwarf64

@ikudrin enabled support for dwarf64 in D87011. Adding a clang flag so it can be used through that compilation pass.

Reviewed By: MaskRay

Differential Revisio

[Driver] Add DWARF64 flag: -gdwarf64

@ikudrin enabled support for dwarf64 in D87011. Adding a clang flag so it can be used through that compilation pass.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D90507

show more ...


# 9c4b2225 08-Jan-2021 Alexander Belyaev <pifon@google.com>

Revert "Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""""

This reverts commit 6b0ee02747ed22d41e175d15f27025183341e6f8.

Circular dep

Revert "Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""""

This reverts commit 6b0ee02747ed22d41e175d15f27025183341e6f8.

Circular dependency again.

show more ...


# 8e3e148c 08-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

Revert "[clang][cli] Port DiagnosticOpts to new option parsing system"

This reverts commit 8e3230ff


# 8e3230ff 22-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] Port DiagnosticOpts to new option parsing system

This patch introduces additional infrastructure necessary to accommodate DiagnosticOptions.

DiagnosticOptions are unique in that they a

[clang][cli] Port DiagnosticOpts to new option parsing system

This patch introduces additional infrastructure necessary to accommodate DiagnosticOptions.

DiagnosticOptions are unique in that they are parsed by the same function in cc1 AND in the Clang driver. The call to the parsing function from the driver occurs early on in the compilation process, where no proper DiagnosticEngine exists, because the diagnostic options (passed through command line) are not known yet.

To preserve the current behavior, we need to be able to selectively parse:
* all options (for -cc1),
* only diagnostic options (for driver).

This patch achieves that in the following way:
* new MacroPrefix field is added to the Option TableGen class,
* new IsDiag TableGen mixin sets MacroPrefix to "DIAG_",
* TableGen backend serializes option records into a macro with the prefix,
* CompilerInvocation parse/generate methods define the [DIAG_]OPTION_WITH_MARSHALLING macros to handle diagnostic options separately.

Depends on D93700, D93701 & D93702.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D84673

show more ...


# 6b0ee027 08-Jan-2021 Artem Dergachev <artem.dergachev@gmail.com>

Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""""

This reverts commit b12f26733a4259c90e5f387aceb9f23c35e003b8.

Fix dead include that

Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""""

This reverts commit b12f26733a4259c90e5f387aceb9f23c35e003b8.

Fix dead include that looked like another missed circular dependency.

show more ...


# b12f2673 08-Jan-2021 David Blaikie <dblaikie@gmail.com>

Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""

This reverts commit d2ddc694ff94743d9735aaf07edcaf6db8aaca04.

This still contains a circular

Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""

This reverts commit d2ddc694ff94743d9735aaf07edcaf6db8aaca04.

This still contains a circular dependency between Analysis and CrossTU:

$ grep -r include.*Analysis clang/include/clang/CrossTU
clang/include/clang/CrossTU/CrossTranslationUnit.h:
#include "clang/Analysis/CrossTUAnalysisHelper.h"
$ grep -r include.*CrossTU clang/lib/Analysis
clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp:
#include "clang/CrossTU/CrossTranslationUnit.h"
clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp:
#include "clang/Analysis/CrossTUAnalysisHelper.h"

show more ...


# fcd1e35e 06-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] NFC: Make parsing macro reusable

This is necessary for a future patch, where we start using this macro in another function.

Reviewed By: dexonsmith

Differential Revision: https://revi

[clang][cli] NFC: Make parsing macro reusable

This is necessary for a future patch, where we start using this macro in another function.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D93702

show more ...


# 75d63630 06-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] NFC: Move parseSimpleArgs

This patch moves `parseSimpleArgs` closer to `ParseDiagnosticArgs` so that sharing the parsing macro between them can be done more locally in a future patch.

[clang][cli] NFC: Move parseSimpleArgs

This patch moves `parseSimpleArgs` closer to `ParseDiagnosticArgs` so that sharing the parsing macro between them can be done more locally in a future patch.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D94172

show more ...


# e72cdc5b 22-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] NFC: Ensure non-null DiagnosticsEngine in ParseDiagnosticArgs

Before this patch, ParseDiagnosticArgs can be called with a nullptr DiagnosticsEngine *. This happens early on in the compi

[clang][cli] NFC: Ensure non-null DiagnosticsEngine in ParseDiagnosticArgs

Before this patch, ParseDiagnosticArgs can be called with a nullptr DiagnosticsEngine *. This happens early on in the compilation process, where no proper DiagnosticEngine exists, because the diagnostic options (passed through command line) are not known yet.

This patch ensures nullptr is replaced by an ignoring DiagnosticEngine in ParseDiagnosticArgs, which allows to switch from pointer to a reference in some utility functions.

Besides simplifying the code, this patch enables a future patch (D84673) that ports diagnostic options to the new marshalling infrastructure.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D93701

show more ...


# 33f90f38 22-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] Report the actual argument parsing result

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D93700


# b6ba5983 22-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] Port getAllArgumentValues to the marshalling infrastructure

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D93679


# a828fb46 21-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] Port a CommaJoined option to the marshalling infrastructure

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D93698


# 67a4c672 07-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

Reapply "[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo"

This reverts commit d0fa7a05 and fixes failing OptionMarshallingTest by adding the SHOULD_

Reapply "[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo"

This reverts commit d0fa7a05 and fixes failing OptionMarshallingTest by adding the SHOULD_PARSE macro argument

show more ...


# d0fa7a05 07-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

Revert "[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo"

This reverts commit 77db83ae


# 77db83ae 18-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo

Depends on D84189 & D93540.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org

[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo

Depends on D84189 & D93540.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D84674

show more ...


# d2ddc694 06-Jan-2021 Artem Dergachev <artem.dergachev@gmail.com>

Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""

This reverts commit 5663bf201f5c444d6fb56fb1bd471bc53c17d837.

The cyclic dependency problem is addres

Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""

This reverts commit 5663bf201f5c444d6fb56fb1bd471bc53c17d837.

The cyclic dependency problem is addressed now.
This is the ~fifth attempt to land this change.

show more ...


# ce8c59e6 05-Jan-2021 Jan Svoboda <jan_svoboda@apple.com>

Reapply multiple "[clang][cli]" patches

This reverts 7ad666798f12 and 1876a2914fe0 that reverted:

741978d727a4 [clang][cli] Port CodeGen option flags to new option parsing system
383778e2171b [clan

Reapply multiple "[clang][cli]" patches

This reverts 7ad666798f12 and 1876a2914fe0 that reverted:

741978d727a4 [clang][cli] Port CodeGen option flags to new option parsing system
383778e2171b [clang][cli] Port LangOpts option flags to new option parsing system
aec2991d083a [clang][cli] Port LangOpts simple string based options to new option parsing system
95d3cc67caac [clang][cli] Port CodeGenOpts simple string flags to new option parsing system
27b7d646886d [clang][cli] Streamline MarshallingInfoFlag description
70410a264949 [clang][cli] Let denormalizer decide how to render the option based on the option class
63a24816f561 [clang][cli] Implement `getAllArgValues` marshalling

Commit 741978d727a4 accidentally changed the `Group` attribute of `g[no_]column_info` options from `g_flags_Group` to `g_Group`, which changed the debug info options passed to cc1 by the driver.

Similar change was also present in 383778e2171b, which accidentally added `Group<f_Group>` to `f[no_]const_strings` and `f[no_]signed_wchar`.

This patch corrects all three accidental changes by replacing `Bool{G,F}Option` with `BoolCC1Option`.

show more ...


# 6cee9d0c 02-Jan-2021 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC] Support powerpcle target in Clang [3/5]

Add powerpcle support to clang.

For FreeBSD, assume a freestanding environment for now, as we only need it in the first place to build loader, whic

[PowerPC] Support powerpcle target in Clang [3/5]

Add powerpcle support to clang.

For FreeBSD, assume a freestanding environment for now, as we only need it in the first place to build loader, which runs in the OpenFirmware environment instead of the FreeBSD environment.

For Linux, recognize glibc and musl environments to match current usage in Void Linux PPC.

Adjust driver to match current binutils behavior regarding machine naming.

Adjust and expand tests.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D93919

show more ...


# d1fd7234 31-Dec-2020 Fangrui Song <i@maskray.me>

Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions

The idea is that the CC1 default for ELF should set dso_local on default
visibility externa

Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions

The idea is that the CC1 default for ELF should set dso_local on default
visibility external linkage definitions in the default -mrelocation-model pic
mode (-fpic/-fPIC) to match COFF/Mach-O and make output IR similar.

The refactoring is made available by 2820a2ca3a0e69c3f301845420e0067ffff2251b.

Currently only x86 supports local aliases. We move the decision to the driver.
There are three CC1 states:

* -fsemantic-interposition: make some linkages interposable and make default visibility external linkage definitions dso_preemptable.
* (default): selected if the target supports .Lfoo$local: make default visibility external linkage definitions dso_local
* -fhalf-no-semantic-interposition: if neither option is set or the target does not support .Lfoo$local: like -fno-semantic-interposition but local aliases are not used. So references can be interposed if not optimized out.

Add -fhalf-no-semantic-interposition to a few tests using the half-based semantic interposition behavior.

show more ...


# 1876a291 23-Dec-2020 Nico Weber <thakis@chromium.org>

Revert more changes that landed on top of 741978d727

This should've been in 7ad666798f12456d9 but wasn't.

Squashes these twoc commits:
Revert "[clang][cli] Let denormalizer decide how to render the

Revert more changes that landed on top of 741978d727

This should've been in 7ad666798f12456d9 but wasn't.

Squashes these twoc commits:
Revert "[clang][cli] Let denormalizer decide how to render the option based on the option class"
This reverts commit 70410a264949101ced3ce3458f37dd4cc2f5af85.

Revert "[clang][cli] Implement `getAllArgValues` marshalling"
This reverts commit 63a24816f561a5d8e28ca7054892bd8602618be4.

show more ...


# 7ad66679 23-Dec-2020 Nico Weber <thakis@chromium.org>

Revert 741978d727 and things that landed on top of it.

741978d727 made clang produce output that's 2x as large at least in
sanitizer builds. https://reviews.llvm.org/D83892#2470185 has a
standalone

Revert 741978d727 and things that landed on top of it.

741978d727 made clang produce output that's 2x as large at least in
sanitizer builds. https://reviews.llvm.org/D83892#2470185 has a
standalone repro.

This reverts the following commits:

Revert "[clang][cli] Port CodeGenOpts simple string flags to new option parsing system"
This reverts commit 95d3cc67caac04668ef808f65c30ced60ed14f5d.

Revert "[clang][cli] Port LangOpts simple string based options to new option parsing system"
This reverts commit aec2991d083a9c5b92f94d84a7b3a7bbed405af8.

Revert "[clang][cli] Streamline MarshallingInfoFlag description"
This reverts commit 27b7d646886d499c70dec3481dfc3c82dfc43dd7.

Revert "[clang][cli] Port LangOpts option flags to new option parsing system"
This reverts commit 383778e2171b4993f555433745466e211e713548.

Revert "[clang][cli] Port CodeGen option flags to new option parsing system"
This reverts commit 741978d727a445fa279d5952a86ea634adb7dc52.

show more ...


# bef9eb84 21-Dec-2020 Jan Svoboda <jan_svoboda@apple.com>

[clang] NFC: Refactor custom class into a lambda in CompilerInvocation

Change `makeFlagToValueNormalizer` so that one specialization converts all integral/enum arguments into `uint64_t` and forwards

[clang] NFC: Refactor custom class into a lambda in CompilerInvocation

Change `makeFlagToValueNormalizer` so that one specialization converts all integral/enum arguments into `uint64_t` and forwards them to the more generic version.

This makes it easy to replace the custom `FlagToValueNormalizer` struct with a lambda, which is the common approach in other (de)normalizers.

Finally, drop custom `is_int_convertbile` in favor of `llvm::is_integral_or_enum`.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D93628

show more ...


1...<<11121314151617181920>>...79