| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[Support] Move TargetParsers to new component This is a fairly large changeset, but it can be broken into a few pieces: - llvm/Support/*TargetParser* are all moved from the LLVM Support component into a new LLVM Component called "TargetParser". This potentially enables using tablegen to maintain this information, as is shown in https://reviews.llvm.org/D137517. This cannot currently be done, as llvm-tblgen relies on LLVM's Support component. - This also moves two files from Support which use and depend on information in the TargetParser: - llvm/Support/Host.{h,cpp} which contains functions for inspecting the current Host machine for info about it, primarily to support getting the host triple, but also for -mcpu=native support in e.g. Clang. This is fairly tightly intertwined with the information in X86TargetParser.h, so keeping them in the same component makes sense. - llvm/ADT/Triple.h and llvm/Support/Triple.cpp, which contains the target triple parser and representation. This is very intertwined with the Arm target parser, because the arm architecture version appears in canonical triples on arm platforms. - I moved the relevant unittests to their own directory. And so, we end up with a single component that has all the information about the following, which to me seems like a unified component: - Triples that LLVM Knows about - Architecture names and CPUs that LLVM knows about - CPU detection logic for LLVM Given this, I have also moved RISCVISAInfo.h into this component, as it seems to me to be part of that same set of functionality. If you get link errors in your components after this patch, you likely need to add TargetParser into LLVM_LINK_COMPONENTS in CMake. Differential Revision: https://reviews.llvm.org/D137838 | 3 年前 | |
[clang][deps] Ignore import/include directives with missing filenames (#99520) Previously source input like #import resulted in infinite calls append the same token into CurDirTokens. This patch now ignores those directive lines if they won't actually end up being compiled. (e.g. macro guarded) resolves: rdar://121247565 | 1 年前 | |
[SystemZ][z/OS] Add missing strnlen function for z/OS to fix build failures (#75339) This patch adds strnlen to the zOSSupport.h file to fix build failures in multiple files. | 2 年前 | |
[Lex] Replace hash_combine with a stable hash | 2 年前 | |
Revert "[clang][Darwin] Remove legacy framework search path logic in the frontend (#75841)" This reverts commit 61999b18c407b9f5c07577e63057d41c65240e61. See comments on https://github.com/llvm/llvm-project/pull/75841. This was intended to be NFC but actually isn't. | 2 年前 | |
[Clang] Allow raw string literals in C as an extension (#88265) This enables raw R"" string literals in C in some language modes and adds an option to disable or enable them explicitly as an extension. Background: GCC supports raw string literals in C in -gnuXY modes starting with gnu99. This pr both enables raw string literals in gnu99 mode and later in C and adds an -f[no-]raw-string-literals flag to override this behaviour. The decision not to enable raw string literals in gnu89 mode, according to the GCC devs, is intentional as that mode is supposed to be used for ‘old code’ that they don’t want to break; we’ve decided to match GCC’s behaviour here as well. The -fraw-string-literals flag can additionally be used to enable raw string literals in modes where they aren’t enabled by default (such as c99—as opposed to gnu99—or even e.g. C++03); conversely, the negated flag can be used to disable them in any gnuXY modes that *do* provide them by default, or to override a previous flag. However, we do *not* support disabling raw string literals (or indeed either of these two options) in C++11 mode and later, because we don’t want to just start supporting disabling features that are actually part of the language in the general case. This fixes #85703. | 2 年前 | |
[NFC][clang] Replace unreachable code in literal processing with assert (#96579) Address static verifier concerns about dead code in DoubleUnderscore check. Replace it with an assert. | 2 年前 | |
Use CTAD on llvm::SaveAndRestore Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D139229 | 3 年前 | |
[NFC][Clang] Improve const correctness for IdentifierInfo (#79365) The IdentifierInfo isn't typically modified. Use 'const' wherever possible. | 2 年前 | |
[clang][modules] Avoid calling expensive SourceManager::translateFile() (#86216) The ASTWriter algorithm for computing affecting module maps uses SourceManager::translateFile() to get a FileID from a FileEntry. This is slow (O(n)) since the function performs a linear walk over SLocEntries until it finds one with a matching FileEntry. This patch removes this use of SourceManager::translateFile() by tracking FileID instead of FileEntry in couple of places in ModuleMap, giving ASTWriter the desired FileID directly. There are no changes required for clients that still want a FileEntry from ModuleMap: the existing APIs internally use SourceManager to perform the reverse FileID to FileEntry conversion in O(1). | 2 年前 | |
[clang] Change representation of CurLexerKind (#70381) Previous representation used an enumeration combined to a switch to dispatch to the appropriate lexer. Use function pointer so that the dispatching is just an indirect call, which is actually better because lexing is a costly task compared to a function call. This also makes the code slightly cleaner, speedup on compile time tracker are consistent and range form -0.05% to -0.20% for NewPM-O0-g, see https://llvm-compile-time-tracker.com/compare.php?from=f9906508bc4f05d3950e2219b4c56f6c078a61ef&to=608c85ec1283638db949d73e062bcc3355001ce4&stat=instructions:u Considering just the preprocessing task, preprocessing the sqlite amalgametion takes -0.6% instructions (according to valgrind --tool=callgrind) --------- Co-authored-by: serge-sans-paille <sguelton@mozilla.com> Co-authored-by: cor3ntin <corentinjabot@gmail.com> | 2 年前 | |
[Clang] Prepare for llvm::Optional becoming std::optional. The needed tweaks are mostly trivial, the one nasty bit is Clang's usage of OptionalStorage. To keep this working old Optional stays around as clang::CustomizableOptional, with the default Storage removed. Optional<File/DirectoryEntryRef> is replaced with a typedef. I tested this with GCC 7.5, the oldest supported GCC I had around. Differential Revision: https://reviews.llvm.org/D140332 | 3 年前 | |
Add support for #elifdef and #elifndef WG14 adopted N2645 and WG21 EWG has accepted P2334 in principle (still subject to full EWG vote + CWG review + plenary vote), which add support for #elifdef as shorthand for #elif defined and #elifndef as shorthand for #elif !defined. This patch adds support for the new preprocessor directives. | 5 年前 | |
[clang] Fix static analyzer concerns in #embed code (#99331) 1. Dead code in LookupEmbedFile. The loop always exited on the first iteration. This was also causing a bug of not checking all directories provided by --embed-dir. 2. Use of uninitialized variable CurTok in LexEmbedParameters. It was used to initialize the field which seems to be unused. Removed unused field, this way CurTok should be initialized by Lex method. | 2 年前 | |
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> | 2 年前 | |
| 1 年前 | ||
| 1 年前 | ||
[Lex] Fix clang -Wparentheses after #89923 | 2 年前 | |
[clang][lex] Always pass suggested module to InclusionDirective() callback (#81061) This patch provides more information to the PPCallbacks::InclusionDirective() hook. We now always pass the suggested module, regardless of whether it was actually imported or not. The extra bool ModuleImported parameter then denotes whether the header #include will be automatically translated into import the the module. The main change is in clang/lib/Lex/PPDirectives.cpp, where we take care to not modify SuggestedModule after it's been populated by LookupHeaderIncludeOrImport(). We now exclusively use the SM (ModuleToImport) variable instead, which has been equivalent to SuggestedModule until now. This allows us to use the original non-modified SuggestedModule for the callback itself. (This patch turns out to be necessary for https://github.com/apple/llvm-project/pull/8011). | 2 年前 | |
| 1 年前 | ||
[clang] NFC: Remove OptionalFileEntryRefDegradesToFileEntryPtr (#74899) | 2 年前 | |
SourceManager: Make LastLineNoContentCache and ContentCache::SourceLineCache mutable, NFC Avoid some noisy const_casts by making ContentCache::SourceLineCache and SourceManager::LastLineNoContentCache both mutable. Differential Revision: https://reviews.llvm.org/D89914 | 5 年前 | |
| 1 年前 | ||
[Lex] Fix a crash in updateConsecutiveMacroArgTokens. Fixes https://github.com/llvm/llvm-project/issues/60722. Differential Revision: https://reviews.llvm.org/D144054 | 3 年前 | |
[Clang] Update Unicode version to 15.1 (#77147) This update all of our Unicode tables to Unicode 15.1. This is a minor version so only a relatively small numbers of characters are added, mainly ideographs https://www.unicode.org/versions/Unicode15.1.0/#Appendices_nb | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 2 年前 |