[IR]PATCH 1/2: Add AsmWriterContext into AsmWriter
authorMin-Yih Hsu <minyihh@uci.edu>
Sun, 12 Sep 2021 03:44:27 +0000 (20:44 -0700)
committerMin-Yih Hsu <minyihh@uci.edu>
Sun, 3 Oct 2021 04:19:51 +0000 (21:19 -0700)
commitb2d078fb0cac9e31eae616211275925a4d858f09
tree09190cd12366da4ac806983b10f30197a237ee14
parentd6a4294d1362b37f07a96c8ca6d18e260d44bcd6
[IR]PATCH 1/2: Add AsmWriterContext into AsmWriter

AsmWriterContext is a simple compound that stores TypePrinting,
SlotTracker (i.e. "Machine" in AsmWriter), and Module instances -- three
of the most commonly used objects in the AsmWriter infrastructure.
Previously these three objects are passed as separate function arguments
to most of the printer functions in this file. Tidying them up can bring
easier code refactoring on printer functions in the future (e.g. when we
want to pass additional objects to all printer functions).

NOTE: Theoritically, this patch should be NFC.

Differential Revision: https://reviews.llvm.org/D110112
llvm/lib/IR/AsmWriter.cpp