TTobias Hieta[clang] Implement -fptrauth-auth-traps. (#102417)
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[clang] Avoid 'raw_string_ostream::str' (NFC) Since raw_string_ostream doesn't own the string buffer, it is desirable (in terms of memory safety) for users to directly reference the string buffer rather than use raw_string_ostream::str(). Work towards TODO item to remove raw_string_ostream::str(). p.s. also remove some unneeded/dead code. | 1 年前 | |
[NFC] Initialize class member pointers to nullptr. Fix clang-format issues in surrounding code. Differential revision: https://reviews.llvm.org/D153892 | 2 年前 | |
[clang] Remove unused argument. NFC. (#73594) | 2 年前 | |
[NFC] [Serialization] Unify how LocalDeclID can be created Now we can create a LocalDeclID directly with an integer without verifying. It may be hard to refactor if we want to change the way we serialize DeclIDs (See https://github.com/llvm/llvm-project/pull/95897). Also it is hard for us to debug if someday someone construct a LocalDeclID with an incorrect value. So in this patch, I tried to unify the way we can construct a LocalDeclID in ASTReader, where we will construct the LocalDeclID from the serialized data. Also, now we can verify the constructed LocalDeclID sooner in the new interface. | 1 年前 | |
[InstallAPI] Set InstallAPI as a standalone tool instead of CC1 action (#82293) Installapi has important distinctions when compared to the clang driver, so much that, it doesn't make much sense to try to integrate into it. This patch partially reverts the CC1 action & driver support to replace with its own driver as a clang tool. For distribution, we could use LLVM_TOOL_LLVM_DRIVER_BUILD mechanism for integrating the functionality into clang such that the toolchain size is less impacted. | 2 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
[NFC] Make MultiplexExternalSemaSource own sources This change refactors the MuiltiplexExternalSemaSource to take ownership of the underlying sources. As a result it makes a larger cleanup of external source ownership in Sema and the ChainedIncludesSource. Reviewed By: aaron.ballman, aprantl Differential Revision: https://reviews.llvm.org/D133158 | 3 年前 | |
[clang][NFC] Further improvements to const-correctness | 2 年前 | |
[clang] Implement -fptrauth-auth-traps. (#102417) This provides -fptrauth-auth-traps, which at the frontend level only controls the addition of the "ptrauth-auth-traps" function attribute. The attribute in turn controls various aspects of backend codegen, by providing the guarantee that every "auth" operation generated will trap on failure. This can either be delegated to the hardware (if AArch64 FPAC is known to be available), in which case this attribute doesn't change codegen. Otherwise, if FPAC isn't available, this asks the backend to emit additional instructions to check and trap on auth failure. (cherry picked from commit d179acd0484bac30c5ebbbed4d29a4734d92ac93) | 1 年前 | |
[NFC][TargetParser] Replace uses of llvm/Support/Host.h The forwarding header is left in place because of its use in polly/lib/External/isl/interface/extract_interface.cc, but I have added a GCC warning about the fact it is deprecated, because it is used in isl from where it is included by Polly. | 3 年前 | |
Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802) This commit implements the entirety of the now-accepted [N3017 -Preprocessor Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and its sister C++ paper [p1967](https://wg21.link/p1967). It implements everything in the specification, and includes an implementation that drastically improves the time it takes to embed data in specific scenarios (the initialization of character type arrays). The mechanisms used to do this are used under the "as-if" rule, and in general when the system cannot detect it is initializing an array object in a variable declaration, will generate EmbedExpr AST node which will be expanded by AST consumers (CodeGen or constant expression evaluators) or expand embed directive as a comma expression. This reverts commit https://github.com/llvm/llvm-project/commit/682d461d5a231cee54d65910e6341769419a67d7. --------- Co-authored-by: The Phantom Derpstorm <phdofthehouse@gmail.com> Co-authored-by: Aaron Ballman <aaron@aaronballman.com> Co-authored-by: cor3ntin <corentinjabot@gmail.com> Co-authored-by: H. Vetinari <h.vetinari@gmx.com> | 1 年前 | |
Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (#95802) This commit implements the entirety of the now-accepted [N3017 -Preprocessor Embed](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3017.htm) and its sister C++ paper [p1967](https://wg21.link/p1967). It implements everything in the specification, and includes an implementation that drastically improves the time it takes to embed data in specific scenarios (the initialization of character type arrays). The mechanisms used to do this are used under the "as-if" rule, and in general when the system cannot detect it is initializing an array object in a variable declaration, will generate EmbedExpr AST node which will be expanded by AST consumers (CodeGen or constant expression evaluators) or expand embed directive as a comma expression. This reverts commit https://github.com/llvm/llvm-project/commit/682d461d5a231cee54d65910e6341769419a67d7. --------- Co-authored-by: The Phantom Derpstorm <phdofthehouse@gmail.com> Co-authored-by: Aaron Ballman <aaron@aaronballman.com> Co-authored-by: cor3ntin <corentinjabot@gmail.com> Co-authored-by: H. Vetinari <h.vetinari@gmx.com> | 1 年前 | |
[clang][NFC] Use llvm::count_if instead of manual loop | 3 年前 | |
[NFC] [Serialization] Merge IdentID with IdentifierID In ASTBitCodes.h, there are two type alias for the ID type of Identifiers with the same underlying type. It is confusing. This patch tries to merge the IdentID to IdentifierID to erase such confusion. | 2 年前 | |
| 1 年前 | ||
[CIR][Basic][NFC] Add the CIR language to the Language enum Add the CIR language to the Language enum and the standard usages of it. commit-id:fd12b2c2 Reviewers: bcardosolopes, AaronBallman, erichkeane Reviewed By: AaronBallman, bcardosolopes Pull Request: https://github.com/llvm/llvm-project/pull/86072 | 2 年前 | |
Reapply "[clang] NFCI: Adopt SourceManager::getFileEntryRefForID()" This reapplies ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f, except for a tiny part that was reverted separately: 65331da0032ab4253a4bc0ddcb2da67664bd86a9. That will be reapplied later on, since it turned out to be more involved. This commit is enabled by 5523fefb01c282c4cbcaf6314a9aaf658c6c145f and f0f548a65a215c450d956dbcedb03656449705b9, specifically the part that makes 'clang-tidy/checkers/misc/header-include-cycle.cpp' separator agnostic. | 2 年前 | |
[Clang] Define __cpp_pack_indexing (#101956) Following the discussion on #101448 this defines __cpp_pack_indexing. Since pack indexing is currently supported in all language modes, the feature test macro is also defined in all language modes. (cherry picked from commit c65afad9c58474a784633314e945c874ed06584a) | 1 年前 | |
| 2 年前 | ||
[Frontend] Use StringRef::drop_while (NFC) | 2 年前 | |
[Frontend] Use SmallString::operator std::string (NFC) | 2 年前 | |
[clang] Use StringRef::operator== instead of StringRef::equals (NFC) (#91844) I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator==/!= outnumber StringRef::equals by a factor of 24 under clang/ in terms of their usage. - The elimination of StringRef::equals brings StringRef closer to std::string_view, which has operator== but not equals. - S == "foo" is more readable than S.equals("foo"), especially for !Long.Expression.equals("str") vs Long.Expression != "str". | 2 年前 | |
[BPF] Fix linking issues in static map initializers (#91310) When BPF object files are linked with bpftool, every symbol must be accompanied by BTF info. Ensure that extern functions referenced by global variable initializers are included in BTF. The primary motivation is "static" initialization of PROG maps: c extern int elsewhere(struct xdp_md *); struct { __uint(type, BPF_MAP_TYPE_PROG_ARRAY); __uint(max_entries, 1); __type(key, int); __type(value, int); __array(values, int (struct xdp_md *)); } prog_map SEC(".maps") = { .values = { elsewhere } }; BPF backend needs debug info to produce BTF. Debug info is not normally generated for external variables and functions. Previously, it was solved differently for variables (collecting variable declarations in ExternalDeclarations vector) and functions (logic invoked during codegen in CGExpr.cpp). This patch generalises ExternalDefclarations to include both function and variable declarations. This change ensures that function references are not missed no matter the context. Previously external functions referenced in constant expressions lacked debug info. | 1 年前 | |
[CommandLine] Avoid ManagedStatic.h include (NFC) The two variables using ManagedStatic that are exported by this header are not actually used anywhere -- they are used through SubCommand::getTopLevel() and SubCommand::getAll() instead. Drop the extern declarations and the include. | 1 年前 | |
| 1 年前 | ||
[clang] NFCI: Use FileEntryRef in FileManager::getCanonicalName() | 2 年前 | |
[clang] Enable output of SARIF diagnostics Enables Clang to emit diagnostics in SARIF format when -fdiagnostics-format=sarif. Adds a new DiagnosticConsumer named SARIFDiagnosticPrinter and a new DiagnosticRenderer named SARIFDiagnostic to constuct and emit a SARIF object containing the run's basic diagnostic info. Reviewed By: cjdb, denik, aaron.ballman Differential Revision: https://reviews.llvm.org/D131632 | 3 年前 | |
Fix more diagnostic wording for style; NFC (#93190) This tries to fix all of the places where a diagnostic message starts with a capital letter (other than acroynyms or proper nouns) or ends with punctuation (other than a question mark). This is in support of a planned change to tablegen to start diagnosing incorrect diagnostic message styles. | 2 年前 | |
[Bitcode(Reader|Writer)] Convert Optional to std::optional | 3 年前 | |
[NFC][clang] Return underlying strings directly instead of OS.str() This avoids an unnecessary copy required by 'return OS.str()', allowing instead for NRVO or implicit move. The .str() call (which flushes the stream) is no longer required since 65b13610a5226b84889b923bae884ba395ad084d, which made raw_string_ostream unbuffered by default. Differential Revision: https://reviews.llvm.org/D115374 | 4 年前 | |
[modules] Use HashBuilder and MD5 for the module hash. Per the comments, hash_code values "are not stable to save or persist", so are unsuitable for the module hash, which must persist across compilations for the implicit module hashes to match. Note that in practice, today, hash_code are stable. But this is an implementation detail, with a clear FIXME indicating we should switch to a per-execution seed. The stability of MD5 also allows modules cross-compilation use-cases. The size_t underlying storage for hash_code varying across platforms could cause mismatching hashes when cross-compiling from a 64bit target to a 32bit target. Note that native endianness is still used for the hash computation. So hashes will differ between platforms of different endianness. Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D102943 | 4 年前 | |
[clang] Fix -Wsign-compare in 32-bit builds | 1 年前 | |
[Frontend] Use SmallString::operator std::string (NFC) | 2 年前 | |
[clang][Diagnostics] Highlight code snippets (#66514) Add some primitive syntax highlighting to our code snippet output. This adds "checkpoints" to the Preprocessor, which we can use to start lexing from. When printing a code snippet, we lex from the nearest checkpoint and highlight the tokens based on their token type. | 2 年前 | |
| 2 年前 |