I want to remove an UnreachableInst since a previous transformation has made it reachable. However, calling eraseFromParent() gives me a malformed BasicBlock since the UnreachableInst is the terminator of its BasicBlock. How do I fix the BasicBlock to terminate at the instruction previous to the UnreachableInst?
Related Questions in LLVM
- Get search paths for headers in the standard library in Clang?
- Build LLVM, Clang and Libfuzzer
- build boost use libc++ on linux use wrong --target
- LLD: How to Use –dll and –add-stdcall-alias Swiches
- LLVM code generation causes problems with pointer arithmetic
- How to identify call void @llvm.dbg.declare instructions in LLVM IR?
- Get all references to a C variable using llvm
- New to llvm - trying to make the files but getting collect2: fatal error
- How to fix loop not unrolled: the optimizer was unable to perform the requested transformation in clang?
- Where I can find the detail definition and use of LLVM-backend related stuff?
- Can the binary optimized by Autofdo and bolt be iteratively optimized?
- How to convert LLVM IR file (*.ll) to riscv64 assembly code? llc -march=riscv64 failed
- how to fuzz program using libfuzzer?
- How to run a single case in llvm unittest
- Building llvm and runtime
Related Questions in TERMINATOR
- COLMAP installation failing on: The string is missing the terminator: "
- What is the NEL line terminator?
- Is there a hotkey to open the grouping menu in Terminator?
- How may I inject input to a terminal with terminator?
- Errno 2: No such file or directory, but file exists
- Why is my output shifted after I listened for input?
- Enlarge active window in Kitty Terminal
- Any best practice for upgrading python version in Linux?
- _tkinter.TclError and Terminator issue
- what is a terminator error and how to fix it?
- Matching a string with whitespace character in bash
- How do I end a code using Python Turtle Module when getting a Terminator Error
- DBeaver - Statement Terminator not OK?
- How to launch ros node with gdb on terminator terminal?
- How to display Python version in 'oh-my-zsh'
Related Questions in UNREACHABLE-STATEMENT
- Question regarding unreachable statement errors
- Unreachable statement in fragemnt
- Unreachable statement and break code connecting to other blocks of code
- Why is this NOT unreachable in the if-statement?
- unreachable statement trying to set up a button that will open a new activity
- Why is it giving me a return missing error?
- Unreachable Statement while Uploading 2 Images
- Unreachable statement after conditional
- Why isn't unreachable code detected when an if condition is a constant?
- How to tell Android studio that a method does not return
- java - unreachable statement help (linked lists)
- Java error: unreachable statement when create new linked list node
- How is my simple if-else statement unreachable code?
- Trying to open new activities from NavigationDrawer, but it says unreachable statement
- Complex Conditionals and Unreachable Statements
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Every basic block must end with a terminator. I think that the most straightforward way to remove the unreachable instruction, then, is to replace it with another terminator - for example, a branch into the next basic block, a return instruction, etc.
Take a look at
llvm::ReplaceInstWithInstin BasicBlockUtils.h for a convenient way to replace one instruction with another.