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.

globals deleted by "remove comments" when viewing LLVM IR via -emit-llvm

See original GitHub issue

I often use compiler explorer with a -emit-llvm flag to view the LLVM IR produced by Clang / LLVM’s middle-end optimizers. This generally works pretty well (and even syntax-highlights fairly nicely), but the “remove comments” option strips out lines starting with an @, which deletes all the global variables!

Some better support for viewing LLVM IR output would be great (per #288), but if that’s a long way off, something as simple as detecting -emit-llvm in the command line and not treating lines starting with @ as comments would be marvelous.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RubenRBScommented, May 7, 2020

Hi - I’ve now improved how we detect when the compiler is asked to emit the IR and we properly filter it now. Sorry that this got forgotten. The fix should hit the live site shortly 😃

0reactions
partoufcommented, May 7, 2020

This change is now live. Thanks for the reminder @nickdesaulniers and thanks @RabsRincon for fixing it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

globals deleted by "remove comments" when viewing LLVM ...
I often use compiler explorer with a -emit-llvm flag to view the LLVM IR produced by Clang / LLVM's middle-end optimizers.
Read more >
Global Dead Code Elimination for LLVM, revisited
Global Dead Code Elimination is an LLVM pass that removes unused global symbols, like a static function that got inlined and now does...
Read more >
⚙ D108872 [IR] Refactor GlobalIFunc to inherit from ... - LLVM
GlobalObject, and removes GlobalIndirectSymbol (while inlining the relevant parts into GlobalAlias and GlobalIFunc). This allows for
Read more >
⚙ D63932 [GlobalDCE] Dead Virtual Function Elimination
This patch allows unused virtual functions to be removed during LTO (and regular compilation in limited circumstances) by using type ...
Read more >
Clang Compiler User's Manual
This document describes important notes about using Clang as a compiler for an end-user, documenting the supported features, command line options, etc. If...
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