changeset 196:ccaec67bcdbb

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 01 Jun 2021 22:16:31 +0900
parents c7eaafae97e2
children af96f86c1b6d
files clang/include/clang/Parse/Parser.h clang/lib/Parse/ParseCbC.cpp
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/clang/include/clang/Parse/Parser.h	Tue Jun 01 17:58:18 2021 +0900
+++ b/clang/include/clang/Parse/Parser.h	Tue Jun 01 22:16:31 2021 +0900
@@ -2070,7 +2070,7 @@
   StmtResult ParseGotoStatement();
 #ifndef noCbC
   StmtResult ParseCbCGotoStatement(ParsedAttributesWithRange &Attrs,StmtVector &Stmts);
-  void ExprFromString(char *src ) ;
+  void ExprFromString(const char *src ) ;
 #endif
   StmtResult ParseContinueStatement();
   StmtResult ParseBreakStatement();
--- a/clang/lib/Parse/ParseCbC.cpp	Tue Jun 01 17:58:18 2021 +0900
+++ b/clang/lib/Parse/ParseCbC.cpp	Tue Jun 01 22:16:31 2021 +0900
@@ -94,11 +94,11 @@
     };
 }
 
-void Parser::ExprFromString(char *src ) {
+void Parser::ExprFromString(const char *src ) {
     // Push the ( "string" ) tokens into the token stream.
     SmallVector<Token, 3> Tokens;
-    Token &Tok;
-    FormTokenWithChars(Tok, src, tok::unknown);
+    Token Tok ;
+    PP.CurLexer->FormTokenWithChars(Tok, src, tok::unknown);
     auto Toks = std::make_unique<Token[]>(Tokens.size());
     std::copy(Tokens.begin() + 1, Tokens.end(), Toks.get());
     Toks[Tokens.size() - 1] = Tok;
@@ -255,7 +255,7 @@
   // jmp_buf env_buf;   --> int env_buf[64];
   ExprFromString("int env_buf[64];");
   // innerRes = CreateDeclStmt(bufII, false, false, 64, DeclSpec::TST_typename, CreateIdentifierInfo("int", Loc));
-  nnerRes = ParseCompoundStatementBody();
+  innerRes = ParseCompoundStatementBody();
   if (innerRes.isUsable())
     CompoundStmts.push_back(innerRes.get());