What is Backpatching?

1 min read In Compiler Design

While producing three address codes of if — then — else statements, we may not know the labels where control must go by following the go-to statements in a single pass. We can therefore use two passes. In the first pass, we can generate labels. Also, we can generally go to statements with unspecified destinations. In the second pass, we can fill these unspecified destinations with proper labels. This technique of filling labels is known as backpatching.

Written by

Asheesh Gupta

Leave a Reply

Your email address will not be published. Required fields are marked *