VitaNuo updated this revision to Diff 524211.
VitaNuo added a comment.
Remove template param.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151073/new/
https://reviews.llvm.org/D151073
Files:
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriterStmt.cpp
clang/test/PCH/asm-label.cpp
Index: clang/test/PCH/asm-label.cpp
===================================================================
--- /dev/null
+++ clang/test/PCH/asm-label.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -emit-pch %s -o %t
+// RUN: %clang_cc1 -include-pch %t %s -verify
+#ifndef HEADER_H
+#define HEADER_H
+#pragma once
+void MyMethod() {
+ void *bar;
+ some_path:
+ asm goto
+ (
+ "mov %w[foo], %w[foo]"
+ : [foo] "=r"(bar)
+ : [foo2] "r"(bar)
+ :
+ : some_path
+ );
+ }
+#else
+void test() {
+ MyMethod();
+// expected-no-diagnostics
+}
+#endif
Index: clang/lib/Serialization/ASTWriterStmt.cpp
===================================================================
--- clang/lib/Serialization/ASTWriterStmt.cpp
+++ clang/lib/Serialization/ASTWriterStmt.cpp
@@ -317,7 +317,10 @@
Record.AddStmt(S->getClobberStringLiteral(I));
// Labels
- for (auto *E : S->labels()) Record.AddStmt(E);
+ for (unsigned I = 0, N = S->getNumLabels(); I != N; ++I) {
+ Record.AddIdentifierRef(S->getLabelIdentifier(I));
+ Record.AddStmt(S->getLabelExpr(I));
+ }
Code = serialization::STMT_GCCASM;
}
Index: clang/lib/Serialization/ASTReaderStmt.cpp
===================================================================
--- clang/lib/Serialization/ASTReaderStmt.cpp
+++ clang/lib/Serialization/ASTReaderStmt.cpp
@@ -400,8 +400,10 @@
Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
// Labels
- for (unsigned I = 0, N = NumLabels; I != N; ++I)
+ for (unsigned I = 0, N = NumLabels; I != N; ++I) {
+ Names.push_back(Record.readIdentifier());
Exprs.push_back(Record.readSubStmt());
+ }
S->setOutputsAndInputsAndClobbers(Record.getContext(),
Names.data(), Constraints.data(),
Index: clang/test/PCH/asm-label.cpp
===================================================================
--- /dev/null
+++ clang/test/PCH/asm-label.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -emit-pch %s -o %t
+// RUN: %clang_cc1 -include-pch %t %s -verify
+#ifndef HEADER_H
+#define HEADER_H
+#pragma once
+void MyMethod() {
+ void *bar;
+ some_path:
+ asm goto
+ (
+ "mov %w[foo], %w[foo]"
+ : [foo] "=r"(bar)
+ : [foo2] "r"(bar)
+ :
+ : some_path
+ );
+ }
+#else
+void test() {
+ MyMethod();
+// expected-no-diagnostics
+}
+#endif
Index: clang/lib/Serialization/ASTWriterStmt.cpp
===================================================================
--- clang/lib/Serialization/ASTWriterStmt.cpp
+++ clang/lib/Serialization/ASTWriterStmt.cpp
@@ -317,7 +317,10 @@
Record.AddStmt(S->getClobberStringLiteral(I));
// Labels
- for (auto *E : S->labels()) Record.AddStmt(E);
+ for (unsigned I = 0, N = S->getNumLabels(); I != N; ++I) {
+ Record.AddIdentifierRef(S->getLabelIdentifier(I));
+ Record.AddStmt(S->getLabelExpr(I));
+ }
Code = serialization::STMT_GCCASM;
}
Index: clang/lib/Serialization/ASTReaderStmt.cpp
===================================================================
--- clang/lib/Serialization/ASTReaderStmt.cpp
+++ clang/lib/Serialization/ASTReaderStmt.cpp
@@ -400,8 +400,10 @@
Clobbers.push_back(cast_or_null<StringLiteral>(Record.readSubStmt()));
// Labels
- for (unsigned I = 0, N = NumLabels; I != N; ++I)
+ for (unsigned I = 0, N = NumLabels; I != N; ++I) {
+ Names.push_back(Record.readIdentifier());
Exprs.push_back(Record.readSubStmt());
+ }
S->setOutputsAndInputsAndClobbers(Record.getContext(),
Names.data(), Constraints.data(),
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits