aboutsummaryrefslogtreecommitdiff
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Support/Mustache.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/Mustache.h b/llvm/include/llvm/Support/Mustache.h
index 781ec55..ee9f406 100644
--- a/llvm/include/llvm/Support/Mustache.h
+++ b/llvm/include/llvm/Support/Mustache.h
@@ -85,6 +85,14 @@ using SectionLambda = std::function<llvm::json::Value(std::string)>;
class ASTNode;
using AstPtr = std::unique_ptr<ASTNode>;
+using EscapeMap = DenseMap<char, std::string>;
+
+struct MustacheContext {
+ StringMap<AstPtr> Partials;
+ StringMap<Lambda> Lambdas;
+ StringMap<SectionLambda> SectionLambdas;
+ EscapeMap Escapes;
+};
// A Template represents the container for the AST and the partials
// and Lambdas that are registered with it.
@@ -118,10 +126,7 @@ public:
LLVM_ABI void overrideEscapeCharacters(DenseMap<char, std::string> Escapes);
private:
- StringMap<AstPtr> Partials;
- StringMap<Lambda> Lambdas;
- StringMap<SectionLambda> SectionLambdas;
- DenseMap<char, std::string> Escapes;
+ MustacheContext Ctx;
AstPtr Tree;
};
} // namespace llvm::mustache