aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp')
-rw-r--r--contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp b/contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp
index 20f98bef4887..b0baf194bafe 100644
--- a/contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp
+++ b/contrib/llvm-project/llvm/utils/TableGen/GlobalISel/CodeExpander.cpp
@@ -31,9 +31,8 @@ void CodeExpander::emit(raw_ostream &OS) const {
OS << Current.substr(0, Pos);
Current = Current.substr(Pos);
- if (Current.starts_with("\n")) {
+ if (Current.consume_front("\n")) {
OS << "\n" << Indent;
- Current = Current.drop_front(1);
continue;
}
@@ -43,10 +42,8 @@ void CodeExpander::emit(raw_ostream &OS) const {
continue;
}
- if (Current.starts_with("\\")) {
- Current = Current.drop_front(1);
+ if (Current.consume_front("\\"))
continue;
- }
if (Current.starts_with("${")) {
StringRef StartVar = Current;