Skip to content

Commit b0ce196

Browse files
committed
[llvm] address comments
1 parent bb4ba40 commit b0ce196

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

llvm/include/llvm/Support/Mustache.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Token {
9696

9797
StringRef getRawBody() const { return RawBody; };
9898

99-
void setTokenBody(SmallString<128> NewBody) { TokenBody = NewBody; };
99+
void setTokenBody(StringRef NewBody) { TokenBody = NewBody.str(); };
100100

101101
Accessor getAccessor() const { return Accessor; };
102102

@@ -112,7 +112,7 @@ class Token {
112112
size_t Indentation;
113113
Type TokenType;
114114
// RawBody is the original string that was tokenized
115-
SmallString<128> RawBody;
115+
SmallString<0> RawBody;
116116
Accessor Accessor;
117117
// TokenBody is the original string with the identifier removed
118118
SmallString<0> TokenBody;
@@ -130,16 +130,16 @@ class ASTNode {
130130
InvertSection,
131131
};
132132

133-
ASTNode() : T(Type::Root), ParentContext(nullptr) {};
133+
ASTNode() : T(Type::Root), ParentContext(nullptr){};
134134

135135
ASTNode(StringRef Body, ASTNode *Parent)
136136
: T(Type::Text), Body(Body), Parent(Parent), ParentContext(nullptr),
137-
Indentation(0) {};
137+
Indentation(0){};
138138

139139
// Constructor for Section/InvertSection/Variable/UnescapeVariable
140140
ASTNode(Type T, Accessor Accessor, ASTNode *Parent)
141141
: T(T), Parent(Parent), Children({}), Accessor(Accessor),
142-
ParentContext(nullptr), Indentation(0) {};
142+
ParentContext(nullptr), Indentation(0){};
143143

144144
void addChild(ASTNode *Child) { Children.emplace_back(Child); };
145145

@@ -151,14 +151,12 @@ class ASTNode {
151151

152152
void render(const llvm::json::Value &Data, SmallString<0> &Output);
153153

154-
void setUpNode(llvm::BumpPtrAllocator &Alloc,
155-
StringMap<ASTNode *> &Partials,
154+
void setUpNode(llvm::BumpPtrAllocator &Alloc, StringMap<ASTNode *> &Partials,
156155
StringMap<Lambda> &Lambdas,
157156
StringMap<SectionLambda> &SectionLambdas,
158157
DenseMap<char, StringRef> &Escapes);
159-
158+
160159
private:
161-
162160
void renderLambdas(const llvm::json::Value &Contexts, SmallString<0> &Output,
163161
Lambda &L);
164162

0 commit comments

Comments
 (0)