Commit Graph

2758 Commits

Author SHA1 Message Date
Jennifer Chukwu 21bef4e11e [NFC] Fixed Typos
Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D100705
2021-04-17 22:02:23 +05:30
Max Sagebaum fd4e08aa8f [clang-format] Inconsistent behavior regarding line break before access modifier
Fixes https://llvm.org/PR41870.

Checks for newlines in option Style.EmptyLineBeforeAccessModifier are now based on the formatted new lines and not on the new lines in the file.

Reviewed By: HazardyKnusperkeks, curdeius

Differential Revision: https://reviews.llvm.org/D99503
2021-04-16 10:39:13 +02:00
Joshua Haberman 8344675908 Implemented [[clang::musttail]] attribute for guaranteed tail calls.
This is a Clang-only change and depends on the existing "musttail"
support already implemented in LLVM.

The [[clang::musttail]] attribute goes on a return statement, not
a function definition. There are several constraints that the user
must follow when using [[clang::musttail]], and these constraints
are verified by Sema.

Tail calls are supported on regular function calls, calls through a
function pointer, member function calls, and even pointer to member.

Future work would be to throw a warning if a users tries to pass
a pointer or reference to a local variable through a musttail call.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D99517
2021-04-15 17:12:21 -07:00
cchen 924cdff0ae [OpenMP5][DOCS] Update status of masked construct and correct the color
for omp_target_is_present, NFC.
2021-04-15 17:19:04 -05:00
Max Sagebaum dda978eef8 [clang-format] Option for empty lines after an access modifier.
The current logic for access modifiers in classes ignores the option 'MaxEmptyLinesToKeep=1'. It is therefore impossible to have a coding style that requests one empty line after an access modifier. The patch allows the user to configure how many empty lines clang-format should add after an access modifier. This will remove lines if there are to many and will add them if there are missing.

Reviewed By: MyDeveloperDay, curdeius

Differential Revision: https://reviews.llvm.org/D98237
2021-04-15 21:03:07 +02:00
Shilei Tian 2a95cb5858 [Clang][Docs] Claim the atomic compare
I'm working on the implementation of OpenMP 5.1 feature `atomic compare`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D100507
2021-04-15 11:10:15 -04:00
Sven van Haastregt 856c49d79c [OpenCL][Docs] Update OpenCL 3.0 implementation status
Reviewed-By: Anastasia Stulova
2021-04-14 13:56:26 +01:00
ThePhD 701d70d4c2 String Literal and Wide String Literal Encoding from the Preprocessor
Adds the __clang_literal_encoding__ and __clang_wide_literal_encoding__
predefined macros to expose the encoding used for string literals to
the preprocessor.
2021-04-13 14:18:07 -04:00
cchen 3d816537df [OpenMP51][DOCS] Claimed masked construct and report current patch, NFC. 2021-04-09 15:21:13 -05:00
Nikita Kniazev 2f181086b5 [ASTMatchers] Add `cxxBaseSpecifier` matcher (non-top-level)
Required for capturing base specifier in matchers:
  `cxxRecordDecl(hasDirectBase(cxxBaseSpecifier().bind("base")))`

Reviewed By: steveire, aaron.ballman

Differential Revision: https://reviews.llvm.org/D69218
2021-04-09 00:05:36 +01:00
Stanislav Mekhanoshin 189310a140 [AMDGPU] Allow -amdgpu-unsafe-fp-atomics to ignore denorm mode
Fixes: SWDEV-274276

Differential Revision: https://reviews.llvm.org/D100072
2021-04-08 12:46:36 -07:00
Anastasia Stulova 6e8601ff4a [OpenCL][Docs] Fix typo in section label 2021-04-08 10:59:44 +01:00
Cyndy Ishida 0116d04d04 [TextAPI] move source code files out of subdirectory, NFC
TextAPI/ELF has moved out into InterfaceStubs, so theres no longer a
need to seperate out TextAPI between formats.

Reviewed By: ributzka, int3, #lld-macho

Differential Revision: https://reviews.llvm.org/D99811
2021-04-05 10:24:42 -07:00
Charusso 89d210fe1a [analyzer] DynamicSize: Debug facility
This patch adds two debug functions to ExprInspectionChecker to dump out
the dynamic extent and element count of symbolic values:
dumpExtent(), dumpElementCount().
2021-04-05 19:17:52 +02:00
Aaron Ballman 4be8a26951 Use tablegen to diagnose mutually exclusive attributes
Currently, when one or more attributes are mutually exclusive, the
developer adding the attribute has to manually emit diagnostics. In
practice, this is highly error prone, especially for declaration
attributes, because such checking is not trivial. Redeclarations
require you to write a "merge" function to diagnose mutually exclusive
attributes and most attributes get this wrong.

This patch introduces a table-generated way to specify that a group of
two or more attributes are mutually exclusive:

def : MutualExclusions<[Attr1, Attr2, Attr3]>;

This works for both statement and declaration attributes (but not type
attributes) and the checking is done either from the common attribute
diagnostic checking code or from within mergeDeclAttribute() when
merging redeclarations.
2021-04-02 16:34:42 -04:00
Mike Rice 2165c0d389 [OPENMP][DOCS]Update status of the supported constructs, NFC. 2021-04-02 12:31:36 -07:00
Anastasia Stulova d4e9fe813f [OpenCL][Docs] Update links to the C++ for OpenCL documentation 2021-04-01 20:38:24 +01:00
cchen 56b39afb58 [OpenMP51][DOCS] Mark "add present modifier in defaultmap clause" as
done, NFC.
2021-04-01 11:02:23 -05:00
Anastasia Stulova 7c541a195f [OpenCL][Docs] Added a label for C++ libs section and example link 2021-04-01 13:55:23 +01:00
Chen Zheng bfcd21876a [debug-info] support new tuning debugger type DBX for XCOFF DWARF
Based on this debugger type, for now, we plan to:
1: use inline string by default for XCOFF DWARF
2: generate no column info for debug line table.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D99400
2021-04-01 00:11:30 -04:00
Richard Smith c5f174905b Delete checked-in generated copy of diagnostic reference.
The documentation build rule will generate an up-to-date version of this
if it's not checked in.
2021-03-30 16:18:55 -07:00
Aaron Ballman 581b429f7d Update the documentation for recent changes to statement attributes.
Adds more information about automated diagnostic reporting for statement
attributes and adds a bit more documentation about statement attributes
in general.
2021-03-28 09:54:36 -04:00
Anastasia Stulova 706c1dc266 [OpenCL][Docs] Minor update about C++ for OpenCL in UsersManual. 2021-03-26 19:24:07 +00:00
Anastasia Stulova a81925664b [OpenCL][Docs] Update status of OpenCL 3.0 development 2021-03-26 13:07:06 +00:00
Matt Morehouse 8e0bb21931 [HWASan] Mention x86_64 aliasing mode in design doc.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D98892
2021-03-25 14:22:20 -07:00
Yuanfang Chen 217f0f735a [Clang][Sema] Implement GCC -Wcast-function-type
```
Warn when a function pointer is cast to an incompatible function
pointer. In a cast involving function types with a variable argument
list only the types of initial arguments that are provided are
considered. Any parameter of pointer-type matches any other
pointer-type. Any benign differences in integral types are ignored, like
int vs. long on ILP32 targets. Likewise type qualifiers are ignored. The
function type void (*) (void) is special and matches everything, which
can be used to suppress this warning. In a cast involving pointer to
member types this warning warns whenever the type cast is changing the
pointer to member type. This warning is enabled by -Wextra.
```

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D97831
2021-03-24 16:04:18 -07:00
Paul Robinson e150be612b Document -fcrash-diagnostics-dir
This was added in LLVM 7.0 but without help text or other docs.

Differential Revision: https://reviews.llvm.org/D98873
2021-03-23 10:47:12 -07:00
Chuanqi Xu 55486161fa [ASTMatcher] Add AST Matcher support for C++20 coroutine keywords
Summary: Try to enable the support for C++20 coroutine keywords for AST
Matchers.

Reviewers: sammccall, njames93, aaron.ballman

Differential Revision: https://reviews.llvm.org/D96316
2021-03-22 10:27:46 +08:00
Fangrui Song f9cac39930 [Driver] Delete compatibility aliases -mpie-copy-relocations and -mno-pie-copy-relocations
They should be unused everywhere.
2021-03-19 17:47:30 -07:00
Fangrui Song 94a793f096 [docs] Improve documentation of -B and --gcc-toolchain
Differential Revision: https://reviews.llvm.org/D97902
2021-03-19 15:42:37 -07:00
Fangrui Song 4c2da86410 [Driver] Suppress GCC detection under -B
In GCC, if `-B $prefix` is specified, `$prefix` is used to find executable files and startup files.
`$prefix/include` is added as an include search directory.

Clang overloads -B with GCC installation detection semantics which make the
behavior less predictable (due to the "largest GCC version wins" rule) and
interact poorly with --gcc-toolchain (--gcc-toolchain can be overridden by -B).

* `clang++ foo.cpp` detects GCC installation under `/usr`.
* `clang++ --gcc-toolchain=Inputs foo.cpp` detects GCC installation under `Inputs`.
* `clang++ -BA --gcc-toolchain=B foo.cpp` detects GCC installation under A and B and the larger version wins. With this patch, only B is used for detection.
* `clang++ -BA foo.cpp` detects GCC installation under `A` and `/usr`, and the larger GCC version wins. With this patch `A` is not used for detection.

This patch changes -B to drop the GCC detection semantics.  Its executable
searching semantics are preserved.  --gcc-toolchain is the recommended option to
specify the GCC installation detection directory.

(
Note: Clang detects GCC installation in various target dependent directories.
`$sysroot/usr` (sysroot defaults to "") is a common directory used by most targets.
Such a directory is expected to contain something like `lib{,32,64}/gcc{,-cross}/$triple`.
Clang will then construct library/include paths from the directory.
)

Differential Revision: https://reviews.llvm.org/D97993
2021-03-19 15:42:18 -07:00
Thomas Lively 8638c897f4 [WebAssembly] Remove unimplemented-simd target feature
Now that the WebAssembly SIMD specification is finalized and engines are
generally up-to-date, there is no need for a separate target feature for gating
SIMD instructions that engines have not implemented. With this change,
v128.const is now enabled by default with the simd128 target feature.

Differential Revision: https://reviews.llvm.org/D98457
2021-03-18 10:23:12 -07:00
Nathan James 6badd3c52d
[ASTMatchers] Fix documentation for hasAnyBody matcher
Looks like a oversight when the matcher was added.

Reviewed By: steveire

Differential Revision: https://reviews.llvm.org/D98583
2021-03-15 13:06:49 +00:00
Hans Wennborg f50aef745c Revert "[InstrProfiling] Don't generate __llvm_profile_runtime_user"
This broke the check-profile tests on Mac, see comment on the code
review.

> This is no longer needed, we can add __llvm_profile_runtime directly
> to llvm.compiler.used or llvm.used to achieve the same effect.
>
> Differential Revision: https://reviews.llvm.org/D98325

This reverts commit c7712087cb.

Also reverting the dependent follow-up commit:

Revert "[InstrProfiling] Generate runtime hook for ELF platforms"

> When using -fprofile-list to selectively apply instrumentation only
> to certain files or functions, we may end up with a binary that doesn't
> have any counters in the case where no files were selected. However,
> because on Linux and Fuchsia, we pass -u__llvm_profile_runtime, the
> runtime would still be pulled in and incur some non-trivial overhead,
> especially in the case when the continuous or runtime counter relocation
> mode is being used. A better way would be to pull in the profile runtime
> only when needed by declaring the __llvm_profile_runtime symbol in the
> translation unit only when needed.
>
> This approach was already used prior to 9a041a7522, but we changed it
> to always generate the __llvm_profile_runtime due to a TAPI limitation.
> Since TAPI is only used on Mach-O platforms, we could use the early
> emission of __llvm_profile_runtime there, and on other platforms we
> could change back to the earlier approach where the symbol is generated
> later only when needed. We can stop passing -u__llvm_profile_runtime to
> the linker on Linux and Fuchsia since the generated undefined symbol in
> each translation unit that needed it serves the same purpose.
>
> Differential Revision: https://reviews.llvm.org/D98061

This reverts commit 87fd09b25f.
2021-03-12 13:53:46 +01:00
Florian Hahn 194861fa1b
[Matrix] Add missing newline to appease sphinx. 2021-03-12 09:33:36 +00:00
Florian Hahn c92ec0dd92
[Matrix] Add support for matrix-by-scalar division.
This patch extends the matrix spec to allow matrix-by-scalar division.

Originally support for `/` was left out to avoid ambiguity for the
matrix-matrix version of `/`, which could either be elementwise or
specified as matrix multiplication M1 * (1/M2).

For the matrix-scalar version, no ambiguity exists; `*` is also
an elementwise operation in that case. Matrix-by-scalar division
is commonly supported by systems including Matlab, Mathematica
or NumPy.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D97857
2021-03-11 22:21:23 +00:00
Petr Hosek 87fd09b25f [InstrProfiling] Generate runtime hook for ELF platforms
When using -fprofile-list to selectively apply instrumentation only
to certain files or functions, we may end up with a binary that doesn't
have any counters in the case where no files were selected. However,
because on Linux and Fuchsia, we pass -u__llvm_profile_runtime, the
runtime would still be pulled in and incur some non-trivial overhead,
especially in the case when the continuous or runtime counter relocation
mode is being used. A better way would be to pull in the profile runtime
only when needed by declaring the __llvm_profile_runtime symbol in the
translation unit only when needed.

This approach was already used prior to 9a041a7522, but we changed it
to always generate the __llvm_profile_runtime due to a TAPI limitation.
Since TAPI is only used on Mach-O platforms, we could use the early
emission of __llvm_profile_runtime there, and on other platforms we
could change back to the earlier approach where the symbol is generated
later only when needed. We can stop passing -u__llvm_profile_runtime to
the linker on Linux and Fuchsia since the generated undefined symbol in
each translation unit that needed it serves the same purpose.

Differential Revision: https://reviews.llvm.org/D98061
2021-03-11 12:29:01 -08:00
Anastasia Stulova bafcb4c684 [OpenCL][Docs] Add guidelines for new extensions and features.
Add documentation that explains how to extend clang with the new
extensions/features. The guidelines also detail clang's position
about the extension pragmas for the new functionality.

Differential Revision: https://reviews.llvm.org/D97072
2021-03-11 14:28:48 +00:00
zoecarver a89ac0dd18 Update __is_unsigned builtin to match the Standard.
Updates __is_unsigned to have the same behavior as the standard
specifies. This is in line with 511dbd8, which applied the same change
to __is_signed.

Refs D67897.

Differential Revision: https://reviews.llvm.org/D98104
2021-03-10 15:00:26 -08:00
Balazs Benics 57e149d386 [analyzer][docs][NFC] Fix typo in checkers.rst
Move `alpha.core.BoolAssignment` out of the `alpha.clone` enumeration.

Reviewed By: Szelethus

Differential Revision: https://reviews.llvm.org/D97936
2021-03-10 12:42:23 +01:00
Kazu Hirata 31443f8e86 [clang] Fix typos in documentation (NFC) 2021-03-06 15:52:52 -08:00
Michael Kruse 4b15b2df23 [clang][OpenMP][docs] Update loop transformation status.
Mark tiling as done and unrolling as being worked on.
2021-03-05 17:26:55 -06:00
Tim Wojtulewicz f7f9f94b2e [clang-format] Rework Whitesmiths mode to use line-level values in UnwrappedLineParser
This commit removes the old way of handling Whitesmiths mode in favor of just setting the
levels during parsing and letting the formatter handle it from there. It requires a bit of
special-casing during the parsing, but ends up a bit cleaner than before. It also removes
some of switch/case unit tests that don't really make much sense when dealing with
Whitesmiths.

Differential Revision: https://reviews.llvm.org/D94500
2021-03-05 21:42:46 +01:00
Björn Schäpers 7b02794f0a [clang-format] Rename case sorting
As discussed in D95017 the names case sensitive and insensitive should
be switched.

This amends a8105b3766.

Differential Revision: https://reviews.llvm.org/D97927
2021-03-05 21:42:45 +01:00
Kito Cheng b46a1b129f [doc] Fix description of _Float16
According to ISO/IEC TS 18661-3:2015 _FloatN is interchange floating
point type, extended floating-point type is _FloatNx.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2342.pdf

Reviewed By: SjoerdMeijer

Differential revision: https://reviews.llvm.org/D97759
2021-03-04 14:17:54 +08:00
Wang, Pengfei e7e67c930a Add Windows ehcont section support (/guard:ehcont).
Add option /guard:ehcont

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D96709
2021-03-04 11:47:29 +08:00
Stephen Kelly 243cd0afad [ASTMatchers] Make Param functors variadic
Differential Revision: https://reviews.llvm.org/D97156
2021-03-03 11:41:20 +00:00
Jan Svoboda 4545813b17 [clang][cli] NFC: Rename marshalling multiclass
The new name drops `String` from `MarshallingInfoStringInt`, which follows the naming convention of other marshalling multiclasses.
2021-03-02 11:53:40 +01:00
Jan Svoboda 5ba568f21b [clang][docs] Fix code blocks rendering
Some code blocks that render fine locally don't appear on the llvm.org website. Attempting to fix this by specifying the `text` type.
2021-03-02 11:33:10 +01:00
Krystian Kuzniarek 6ca52815fb [clang-format][PR47290] Add ShortNamespaceLines format option
clang-format documentation states that having enabled
FixNamespaceComments one may expect below code:

c++
namespace a {
foo();
}

to be turned into:

c++
namespace a {
foo();
} // namespace a

In reality, no "// namespace a" was added. The problem was too high
value of kShortNamespaceMaxLines, which is used while deciding whether
a namespace is long enough to be formatted.

As with 9163fe2, clang-format idempotence is preserved.

Differential Revision: https://reviews.llvm.org/D87587
2021-03-01 21:28:14 +01:00