My Project
|
#include <Format.h>
Public Types | |
enum | PHKind : char { PHKind::None, PHKind::Custom, PHKind::Builder, PHKind::Op, PHKind::Self } |
Public Member Functions | |
FmtContext ()=default | |
FmtContext & | addSubst (StringRef placeholder, Twine subst) |
FmtContext & | withBuilder (Twine subst) |
FmtContext & | withOp (Twine subst) |
FmtContext & | withSelf (Twine subst) |
Optional< StringRef > | getSubstFor (PHKind placeholder) const |
Optional< StringRef > | getSubstFor (StringRef placeholder) const |
Static Public Member Functions | |
static PHKind | getPlaceHolderKind (StringRef str) |
Format context containing substitutions for special placeholders.
This context divides special placeholders into two categories: builtin ones and custom ones.
Builtin placeholders are baked into FmtContext
and each one of them has a dedicated setter. They can be used in all dialects. Their names follow the convention of $_<name>
. The rationale of the leading underscore is to avoid confusion and name collision: op arguments/attributes/results are named as $<name>, and we can potentially support referencing those entities directly in the format template in the future. Custom ones are registered by dialect-specific TableGen backends and use the same unified setter.
|
strong |
|
default |
FmtContext & tblgen::FmtContext::addSubst | ( | StringRef | placeholder, |
Twine | subst | ||
) |
|
static |
Optional< StringRef > tblgen::FmtContext::getSubstFor | ( | FmtContext::PHKind | placeholder | ) | const |
Optional< StringRef > tblgen::FmtContext::getSubstFor | ( | StringRef | placeholder | ) | const |
FmtContext & tblgen::FmtContext::withBuilder | ( | Twine | subst | ) |
FmtContext & tblgen::FmtContext::withOp | ( | Twine | subst | ) |
FmtContext & tblgen::FmtContext::withSelf | ( | Twine | subst | ) |