aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/vim
AgeCommit message (Collapse)AuthorFilesLines
9 days[Utils][vim] Match hexadecimal constants with u or s prefixes (#162613)Jim Lin1-1/+1
We can add 's' or 'u' before the hexadecimal constants to denote its signedness. See https://llvm.org/docs/LangRef.html#simple-constants for reference.
2025-10-07[AllocToken] Introduce sanitize_alloc_token attribute and alloc_token ↵Marco Elver1-0/+1
metadata (#160131) In preparation of adding the "AllocToken" pass, add the pre-requisite `sanitize_alloc_token` function attribute and `alloc_token` metadata. --- This change is part of the following series: 1. https://github.com/llvm/llvm-project/pull/160131 2. https://github.com/llvm/llvm-project/pull/156838 3. https://github.com/llvm/llvm-project/pull/162098 4. https://github.com/llvm/llvm-project/pull/162099 5. https://github.com/llvm/llvm-project/pull/156839 6. https://github.com/llvm/llvm-project/pull/156840 7. https://github.com/llvm/llvm-project/pull/156841 8. https://github.com/llvm/llvm-project/pull/156842
2025-04-24[Utils][vim] Add missing highlights for disjoint (#136801)Jim Lin1-11/+11
This patch adds the `disjoint` as keyword.
2024-12-04[vim] Improve iskeyword for LLVM IR (#117905)Fraser Cormack1-0/+8
This patch sets the 'iskeyword' variable to characters found in LLVM IR identifiers. Keywords are used in many places in vim, most notably being treated as word boundaries for commands like 'w' and '*'. The aim with this is to improve the navigability and editability of LLVM IR files as now one is able to: skip over entire identifiers with motions (e.g., `w/e/b`); yank/delete whole identifiers (e.g., `diw`); highlight/search for the identifier under the cursor (`*`), etc. More complicated LLVM identifiers including quotation marks are not supported. The 'iskeyword' variable is just a list of characters, not a regex, and including quotation marks and all the characters permitted in quoted identifiers would expand the scope to almost everything and become less usable. These types of identifiers are rare by comparison. Note that this does change how words are considered across the entire LLVM IR file, so including strings, comments, names, etc. Given that the majority of editing/navigating LLVM IR is working with and across values, this is arguably a worthwhile trade-off.
2024-07-17[Utils][vim] Match more hexadecimal float constants (#99000)Fraser Cormack1-1/+1
The `0x[KLMHR]` syntax denotes different floating-point types: various long doubles, half and bfloat. See https://llvm.org/docs/LangRef.html#simple-constants for reference.
2024-07-17[Utils][vim] Match vector 'splat' keyword (#99004)Fraser Cormack1-0/+1
2024-05-30[RemoveDIs] Update syntax highlighting to include debug records (#93660)Stephen Tozer1-0/+3
This patch updates the emacs, vim, and vscode syntax highlighters to recognize debug records.
2024-05-28[IR][AArch64][PAC] Add "ptrauth(...)" Constant to represent signed pointers. ↵Ahmed Bougacha1-0/+1
(#85738) This defines a new kind of IR Constant that represents a ptrauth signed pointer, as used in AArch64 PAuth. It allows representing most kinds of signed pointer constants used thus far in the llvm ptrauth implementations, notably those used in the Darwin and ELF ABIs being implemented for c/c++. These signed pointer constants are then lowered to ELF/MachO relocations. These can be simply thought of as a constant `llvm.ptrauth.sign`, with the interesting addition of discriminator computation: the `ptrauth` constant can also represent a combined blend, when both address and integer discriminator operands are used. Both operands are otherwise optional, with default values 0/null.
2024-02-28[vim] Fix command already exists on opening multiple mir buffers (#82410)Joe Nash1-0/+2
When using the vim syntax for mir, an error occurs in nvim when opening multiple .mir buffers. delcommand HiLink in the mir syntax file to avoid the issue. To reproduce: Open an .mir file, for example llvm/test/Codegen/X86/expand-post-ra-pseudo.mir Open another mir file from within nvim, for example peephole.mir ``` Error detected while processing function 335[30]..<SNR>43_callback[25]..function 335[30]..<SNR>43_callback: line 23: Vim(command):E174: Command already exists: add ! to replace it: HiLink hi def link <args> ```
2023-11-27[vim] set commentstring (#71838)Nick Desaulniers1-0/+1
I recently moved from using vim to lunarvim. I noticed that `gcc` (lol) wasn't able to comment out lines, because commentstring is not set. Thanks to Chase Colman for the suggestion in https://github.com/LunarVim/LunarVim/issues/4394.
2023-10-19[TableGen] Update editor modes for new keywords and bang operators. (#68897)Francesco Petrogalli1-1/+1
* `dump`, added in https://github.com/llvm/llvm-project/pull/68793 * `!repr`, added in https://github.com/llvm/llvm-project/pull/68716 The keyword `assert` was missing, so I have added that too.
2023-10-18[LLVM] Add new attribute `optdebug` to optimize for debugging (#66632)Stephen Tozer1-0/+1
This patch adds a new fn attribute, `optdebug`, that specifies that optimizations should make decisions that prioritize debug info quality, potentially at the cost of runtime performance. This patch does not add any functional changes triggered by this attribute, only the attribute itself. A subsequent patch will use this flag to disable the post-RA scheduler.
2022-03-01[SanitizerBounds] Add support for NoSanitizeBounds functionTong Zhang1-0/+1
Currently adding attribute no_sanitize("bounds") isn't disabling -fsanitize=local-bounds (also enabled in -fsanitize=bounds). The Clang frontend handles fsanitize=array-bounds which can already be disabled by no_sanitize("bounds"). However, instrumentation added by the BoundsChecking pass in the middle-end cannot be disabled by the attribute. The fix is very similar to D102772 that added the ability to selectively disable sanitizer pass on certain functions. In this patch, if no_sanitize("bounds") is provided, an additional function attribute (NoSanitizeBounds) is attached to IR to let the BoundsChecking pass know we want to disable local-bounds checking. In order to support this feature, the IR is extended (similar to D102772) to make Clang able to preserve the information and let BoundsChecking pass know bounds checking is disabled for certain function. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D119816
2021-12-20[llvm][IR] Add no_cfi constantSami Tolvanen1-0/+1
With Control-Flow Integrity (CFI), the LowerTypeTests pass replaces function references with CFI jump table references, which is a problem for low-level code that needs the address of the actual function body. For example, in the Linux kernel, the code that sets up interrupt handlers needs to take the address of the interrupt handler function instead of the CFI jump table, as the jump table may not even be mapped into memory when an interrupt is triggered. This change adds the no_cfi constant type, which wraps function references in a value that LowerTypeTestsModule::replaceCfiUses does not replace. Link: https://github.com/ClangBuiltLinux/linux/issues/1353 Reviewed By: nickdesaulniers, pcc Differential Revision: https://reviews.llvm.org/D108478
2021-06-22[Utils][vim] Add missing highlights for fast-math flagsFraser Cormack1-10/+10
This patch adds the `afn`, `contract`, and `reassoc` fast-math flags. It also fixes up `fneg`'s order in the alphabetized list. Reviewed By: MaskRay, craig.topper Differential Revision: https://reviews.llvm.org/D104541
2021-06-14[Utils] Add missing freeze and poison keyword highlightsJuneyoung Lee1-1/+1
This patch adds missing keyword highlights for freeze and poison Reviewed By: MaskRay, porglezomp Differential Revision: https://reviews.llvm.org/D104017
2021-06-09[Utils][vim] Highlight 'ptr' typeTom Stellard1-1/+1
Differential Revision: https://reviews.llvm.org/D102460
2021-05-25[SanitizeCoverage] Add support for NoSanitizeCoverage function attributeMarco Elver1-0/+1
We really ought to support no_sanitize("coverage") in line with other sanitizers. This came up again in discussions on the Linux-kernel mailing lists, because we currently do workarounds using objtool to remove coverage instrumentation. Since that support is only on x86, to continue support coverage instrumentation on other architectures, we must support selectively disabling coverage instrumentation via function attributes. Unfortunately, for SanitizeCoverage, it has not been implemented as a sanitizer via fsanitize= and associated options in Sanitizers.def, but rolls its own option fsanitize-coverage. This meant that we never got "automatic" no_sanitize attribute support. Implement no_sanitize attribute support by special-casing the string "coverage" in the NoSanitizeAttr implementation. To keep the feature as unintrusive to existing IR generation as possible, define a new negative function attribute NoSanitizeCoverage to propagate the information through to the instrumentation pass. Fixes: https://bugs.llvm.org/show_bug.cgi?id=49035 Reviewed By: vitalybuka, morehouse Differential Revision: https://reviews.llvm.org/D102772
2021-05-18[Utils][vim] Highlight CHECK-EMPTY: & CHECK-COUNT: directivesSenran Zhang1-1/+2
Reviewed By: porglezomp Differential Revision: https://reviews.llvm.org/D101135
2021-05-17IR/AArch64/X86: add "swifttailcc" calling convention.Tim Northover1-0/+1
Swift's new concurrency features are going to require guaranteed tail calls so that they don't consume excessive amounts of stack space. This would normally mean "tailcc", but there are also Swift-specific ABI desires that don't naturally go along with "tailcc" so this adds another calling convention that's the combination of "swiftcc" and "tailcc". Support is added for AArch64 and X86 for now.
2021-04-29[Utils][vim] Highlight 'vscale' constantFraser Cormack1-1/+1
Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D101466
2021-03-19[Utils][vim] Highlight `poison` keywordSenran Zhang1-1/+1
Reviewed By: awarzynski, MaskRay Differential Revision: https://reviews.llvm.org/D98927
2021-03-05[Utils] Add missing attributes in syntax filesAndrzej Warzynski1-9/+35
Added the following attributes to all LLVM syntax files: * allocsize * cold * convergent * dereferenceable_or_null * hot * inaccessiblemem_or_argmemonly * inaccessiblememonly * inalloca * jumptable * nocallback * nocf_check * noduplicate * nofree * nomerge * noprofile * nosync * null_pointer_is_valid * optforfuzzing * preallocated * safestack * sanitize_hwaddress * sanitize_memtag * shadowcallstack * speculative_load_hardening * swifterror * syncscope * tailcc * willreturn I generated that list by comparing: * Attributes.inc (generated from Attributes.td), and * the Vim syntax file: llvm/utils/vim/syntax/llvm.vim My original intention was to focus on the Vim syntax file. Since other syntax files are also out-of-date, I added these attributes (if missing) to other files as well. Note that in the other sytnax files (i.e. for Emacs, VScode and Kate), there will be other attributes missing too. I've also sorted all attributes alphabetically. Otherwise it's really hard to automate adding new attributes. And I think that it was the original intent to keep all of them ordered alphabetically. Differential Revision: https://reviews.llvm.org/D97627
2021-03-03[NFC] Add x86_amx and some missed half, bfloat keywords to llvm plugin syntaxesWang, Pengfei1-1/+1
Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D97444
2021-02-17[vim] Highlight most common MIR syntax not in LLVM IRCassie Jones1-1/+28
This adds highlighting for MIR instruction opcodes, physical registers, and MIR types. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D95553
2021-02-17[vim] Add initial syntax definition for .mir filesCassie Jones4-0/+73
This initial definition handles the yaml container and the embedding of the inner IRs. As a stopgap, this reuses the LLVM IR syntax highlighting for the MIR function bodies--even though it's not technically correct, it produces decent highlighting for a first pass. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D95552
2020-11-17Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch"Nick Desaulniers1-1/+0
This reverts commit b7926ce6d7a83cdf70c68d82bc3389c04009b841. Going with a simpler approach.
2020-10-23[IR] add fn attr for no_stack_protector; prevent inlining on mismatchNick Desaulniers1-0/+1
It's currently ambiguous in IR whether the source language explicitly did not want a stack a stack protector (in C, via function attribute no_stack_protector) or doesn't care for any given function. It's common for code that manipulates the stack via inline assembly or that has to set up its own stack canary (such as the Linux kernel) would like to avoid stack protectors in certain functions. In this case, we've been bitten by numerous bugs where a callee with a stack protector is inlined into an __attribute__((__no_stack_protector__)) caller, which generally breaks the caller's assumptions about not having a stack protector. LTO exacerbates the issue. While developers can avoid this by putting all no_stack_protector functions in one translation unit together and compiling those with -fno-stack-protector, it's generally not very ergonomic or as ergonomic as a function attribute, and still doesn't work for LTO. See also: https://lore.kernel.org/linux-pm/20200915172658.1432732-1-rkir@google.com/ https://lore.kernel.org/lkml/20200918201436.2932360-30-samitolvanen@google.com/T/#u Typically, when inlining a callee into a caller, the caller will be upgraded in its level of stack protection (see adjustCallerSSPLevel()). By adding an explicit attribute in the IR when the function attribute is used in the source language, we can now identify such cases and prevent inlining. Block inlining when the callee and caller differ in the case that one contains `nossp` when the other has `ssp`, `sspstrong`, or `sspreq`. Fixes pr/47479. Reviewed By: void Differential Revision: https://reviews.llvm.org/D87956
2020-10-19[LangRef] Define mustprogress attributeAtmn Patel1-0/+1
LLVM IR currently assumes some form of forward progress. This form is not explicitly defined anywhere, and is the cause of miscompilations in most languages that are not C++11 or later. This implicit forward progress guarantee can not be opted out of on a function level nor on a loop level. Languages such as C (C11 and later), C++ (pre-C++11), and Rust have different forward progress requirements and this needs to be evident in the IR. Specifically, C11 and onwards (6.8.5, Paragraph 6) states that "An iteration statement whose controlling expression is not a constant expression, that performs no input/output operations, does not access volatile objects, and performs no synchronization or atomic operations in its body, controlling expression, or (in the case of for statement) its expression-3, may be assumed by the implementation to terminate." C++11 and onwards does not have this assumption, and instead assumes that every thread must make progress as defined in [intro.progress] when it comes to scheduling. This was initially brought up in [0] as a bug, a solution was presented in [1] which is the current workaround, and the predecessor to this change was [2]. After defining a notion of forward progress for IR, there are two options to address this: 1) Set the default to assuming Forward Progress and provide an opt-out for functions and an opt-in for loops. 2) Set the default to not assuming Forward Progress and provide an opt-in for functions, and an opt-in for loops. Option 2) has been selected because only C++11 and onwards have a forward progress requirement and it makes sense for them to opt-into it via the defined `mustprogress` function attribute. The `mustprogress` function attribute indicates that the function is required to make forward progress as defined. This is sharply in contrast to the status quo where this is implicitly assumed. In addition, `willreturn` implies `mustprogress`. The background for why this definition was chosen is in [3] and for why the option was chosen is in [4] and the corresponding thread(s). The implementation is in D85393, the clang patch is in D86841, the LoopDeletion patch is in D86844, the Inliner patches are in D87180 and D87262, and there will be more incoming. [0] https://bugs.llvm.org/show_bug.cgi?id=965#c25 [1] https://lists.llvm.org/pipermail/llvm-dev/2017-October/118558.html [2] https://reviews.llvm.org/D65718 [3] https://lists.llvm.org/pipermail/llvm-dev/2020-September/144919.html [4] https://lists.llvm.org/pipermail/llvm-dev/2020-September/145023.html Reviewed By: jdoerfert, efriedma, nikic Differential Revision: https://reviews.llvm.org/D86233
2020-08-25[Utils] Add highlighting definition for byref IR attributeAnatoly Trosinenko1-0/+1
This patch assumes `byref` can be handled identically to `byval`. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D85768
2020-08-03[Utils] Add noundef attribute to vim/emacs/vscode syntax scriptsGui Andrade1-0/+1
Differential Revision: https://reviews.llvm.org/D84553
2020-06-18vim: add `bfloat` keywordCullen Rhodes1-1/+1
Highlight the `bfloat` type introduced in D78190.
2020-03-18[lit] Add builtin support for flaky tests in litLouis Dionne1-0/+1
This commit adds a new keyword in lit called ALLOW_RETRIES. This keyword takes a single integer as an argument, and it allows the test to fail that number of times before it first succeeds. This work attempts to make the existing test_retry_attempts more flexible by allowing by-test customization, as well as eliminate libc++'s FLAKY_TEST custom logic. Differential Revision: https://reviews.llvm.org/D76288
2020-01-14[TableGen] Update editor modes for new keywords.Simon Tatham1-1/+1
Summary: D71407 and D71474 added new keywords to the Tablegen language: `defvar`, `if`, `then` and `else`. This commit updates the various editor modes to highlight them appropriately. Some of the modes also didn't include `defset`, so I've added that too while I was there. Reviewers: MaskRay, lebedev.ri, plotfi Reviewed By: lebedev.ri Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72693
2019-10-07[X86] Add new calling convention that guarantees tail call optimizationReid Kleckner1-0/+1
When the target option GuaranteedTailCallOpt is specified, calls with the fastcc calling convention will be transformed into tail calls if they are in tail position. This diff adds a new calling convention, tailcc, currently supported only on X86, which behaves the same way as fastcc, except that the GuaranteedTailCallOpt flag does not need to enabled in order to enable tail call optimization. Patch by Dwight Guth <dwight.guth@runtimeverification.com>! Reviewed By: lebedev.ri, paquette, rnk Differential Revision: https://reviews.llvm.org/D67855 llvm-svn: 373976
2019-08-30vim: add `immarg` keywordSven van Haastregt1-0/+1
The `immarg` attribute was added in r355981. llvm-svn: 370443
2019-03-14Line wrap README fileSam Clegg1-1/+2
llvm-svn: 356204
2019-02-27vim: `swiftself` is an attributeSaleem Abdulrasool1-0/+1
Highlight the `swiftself` attribute on parameters. llvm-svn: 354934
2019-02-08Implementation of asm-goto support in LLVMCraig Topper1-1/+1
This patch accompanies the RFC posted here: http://lists.llvm.org/pipermail/llvm-dev/2018-October/127239.html This patch adds a new CallBr IR instruction to support asm-goto inline assembly like gcc as used by the linux kernel. This instruction is both a call instruction and a terminator instruction with multiple successors. Only inline assembly usage is supported today. This also adds a new INLINEASM_BR opcode to SelectionDAG and MachineIR to represent an INLINEASM block that is also considered a terminator instruction. There will likely be more bug fixes and optimizations to follow this, but we felt it had reached a point where we would like to switch to an incremental development model. Patch by Craig Topper, Alexander Ivchenko, Mikhail Dvoretckii Differential Revision: https://reviews.llvm.org/D53765 llvm-svn: 353563
2018-11-13Add fneg instruction to syntax highlighting listsMatt Arsenault1-1/+1
llvm-svn: 346785
2018-03-22vim: rename `singlethread` to `syncscope`Saleem Abdulrasool1-1/+1
SVN r307722 renamed the keyword from `singlethread` to `syncscope`. Update the syntax file accordingly. llvm-svn: 328211
2018-03-21vim: add `dso_local` and `dso_preemptable` keywordsSaleem Abdulrasool1-0/+2
Support the new keywords introduced in SVN r316668. llvm-svn: 328170
2018-02-20[vim] Recognize more FileCheck commentsMikhail Maltsev1-0/+1
Summary: Currently vim syntax highlighting recognizes 'CHECK:' as a special comment, but not CHECK-DAG, CHECK-NOT and other CHECKs. This patch adds rules for these comments. Reviewers: chandlerc, compnerd, rogfer01 Reviewed By: rogfer01 Subscribers: rogfer01, llvm-commits Differential Revision: https://reviews.llvm.org/D43289 llvm-svn: 325599
2017-08-14Add strictfp attribute to prevent unwanted optimizations of libm callsAndrew Kaylor1-0/+1
Differential Revision: https://reviews.llvm.org/D34163 llvm-svn: 310885
2017-07-17[AArch64] Extend CallingConv::X86_64_Win64 to AArch64 as wellMartin Storsjo1-1/+1
Rename the enum value from X86_64_Win64 to plain Win64. The symbol exposed in the textual IR is changed from 'x86_64_win64cc' to 'win64cc', but the numeric value is kept, keeping support for old bitcode. Differential Revision: https://reviews.llvm.org/D34474 llvm-svn: 308208
2017-07-07vim: add 'builtin', 'nobuiltin', 'nonnull', and 'speculatable' to the ↵Craig Topper1-0/+4
keyword list. llvm-svn: 307419
2017-02-10vim: add `returned` keywordSaleem Abdulrasool1-0/+1
The `returned` keyword was added in SVN r179925. Update the vim syntax rules. llvm-svn: 294808
2017-01-31[Utils] Update comment in vimrcDan Gohman1-2/+2
Fixed wrong paths in comments for *.vim files. Patch By: Bruno Rosa (brunoalr) Differential Revision: https://reviews.llvm.org/D29174 llvm-svn: 293693
2016-11-03vim: special case the CHECK prefixSaleem Abdulrasool1-0/+1
A large number of tests in the LLVM tree use the default (CHECK) prefix to indicate checked expressions via FileCheck. Highlight it as a special comment. Although this wont get all the instances of the checked patters, it is strictly better than the current state. llvm-svn: 285927
2016-10-14vim: add `norecurse` attributeSaleem Abdulrasool1-0/+1
Add missing attribute to the keyword set. llvm-svn: 284270