question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(llvm) types and blocks are parsed incorrectly

See original GitHub issue

Describe the issue

The LLVM types and blocks are parsed incorrectly.

Which language seems to have the issue? LLVM

Are you using highlight or highlightAuto? No

Sample Code to Reproduce

;; foooo
define i32 @mul_add(i32 %x, i32 %y, i32 %z) {
  entry:
    %tmp = mul i32 %x, %y
    %tmp2 = add i32 %tmp, %z
    %tmp3 = add i32 %tmp, 0
    ret i32 %tmp3
}

Expected behavior I expect:

  • define to be a .hljs-keyword
  • i32 to be a .hljs-type (its parsed as a keyword, all types are described here: https://llvm.org/docs/LangRef.html#type-system)
  • @mul_add to be a .hljs-title (its a function name)
  • all the %... to be .hljs-symbol
  • 0 to be a .hljs-literal
  • mul, add, ret to be .hljs-built_in or .hljs-keyword (these are parsed as keywords)
  • entry: is a block, so i’d expect this to be maybe a .hljs-section ? not sure
  • ;; fooo to be a comment

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Nov 13, 2020

Fixed.

0reactions
allejocommented, Nov 13, 2020

Yea, I wouldn’t call it a literal either. That usage is the closest thing I could find to it being considered something other than a number.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LLVM Language Reference Manual
Abstract¶. This document is a reference manual for the LLVM assembly language. LLVM is a Static Single Assignment (SSA) based representation that provides ......
Read more >
How to parse llvm bitcode block 2 - Stack Overflow
Currently, I'm writing an LLVM bitcode parser just for fun, however, I've run into an issue where the parser just throws an error...
Read more >
llvm-project/ParseDecl.cpp at main - clang - GitHub
a type, it is parsed as an identifier. If the attribute actually. /// wanted an expression, it's out of luck (but it turns...
Read more >
2022 Changelog | ClickHouse Docs
In this format, ClickHouse formats/parses each row as a separate BSON document ... Fix LOGICAL_ERROR Arguments of 'plus' have incorrect data types which...
Read more >
Zig Language Reference
In Zig, a function's block of statements and expressions are surrounded by an ... Using the incorrect -target or -cflags could result in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found