comparison tools/clang/lib/Parse/ParseCbC.cpp @ 107:a03ddd01be7e

resolve warnings
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Sun, 31 Jan 2016 17:34:49 +0900
parents 596a38ee9c9e
children 1881386f7909
comparison
equal deleted inserted replaced
106:596a38ee9c9e 107:a03ddd01be7e
173 Create__CbC_envStruct(Loc, AS_none); 173 Create__CbC_envStruct(Loc, AS_none);
174 Actions.ActOnStartStmtExpr(); 174 Actions.ActOnStartStmtExpr();
175 ParseScope CompoundScope(this, Scope::DeclScope); 175 ParseScope CompoundScope(this, Scope::DeclScope);
176 PrettyStackTraceLoc CrashInfo(PP.getSourceManager(),Loc,"in compound statement ('{}')"); 176 PrettyStackTraceLoc CrashInfo(PP.getSourceManager(),Loc,"in compound statement ('{}')");
177 StmtVector CompoundStmts; 177 StmtVector CompoundStmts;
178 178 ExprResult Result(true);
179 // struct __CbC_env __CbC_environment; 179
180 // struct __CbC_env __CbC_environment;
180 innerRes = CreateDeclStmt(__CbC_envII, false, false, DeclSpec::TST_struct, structII, DeclSpec::TQ_volatile); 181 innerRes = CreateDeclStmt(__CbC_envII, false, false, DeclSpec::TST_struct, structII, DeclSpec::TQ_volatile);
181 if (innerRes.isUsable()) 182 if (innerRes.isUsable())
182 CompoundStmts.push_back(innerRes.get()); 183 CompoundStmts.push_back(innerRes.get());
183 184
184 // returnType retval; 185 // returnType retval;
211 if (innerRes.isUsable()) 212 if (innerRes.isUsable())
212 CompoundStmts.push_back(innerRes.get()); 213 CompoundStmts.push_back(innerRes.get());
213 214
214 StmtResult CompoundStmtRes = Actions.ActOnCompoundStmt(Loc,Loc,CompoundStmts,true); 215 StmtResult CompoundStmtRes = Actions.ActOnCompoundStmt(Loc,Loc,CompoundStmts,true);
215 ConsumeToken(); // eat the '__environment'. 216 ConsumeToken(); // eat the '__environment'.
216 return Actions.ActOnStmtExpr(Loc, CompoundStmtRes.get(), Loc); 217 Result = Actions.ActOnStmtExpr(Loc, CompoundStmtRes.get(), Loc);
218
219 // cast
220 ParsedType CastTy;
221 DeclSpec void_DS(AttrFactory);
222 setTST(&void_DS, DeclSpec::TST_void);
223 Declarator DeclaratorInfo(void_DS, Declarator::TypeNameContext);
224 DeclSpec star_DS(AttrFactory);
225 star_DS.Finish(Actions, Actions.getASTContext().getPrintingPolicy());
226 DeclaratorInfo.ExtendWithDeclSpec(star_DS);
227 DeclaratorInfo.SetIdentifier(nullptr, Tok.getLocation());
228 DeclaratorInfo.AddTypeInfo(DeclaratorChunk::getPointer(star_DS.getTypeQualifiers(), Loc,star_DS.getConstSpecLoc(),star_DS.getVolatileSpecLoc(),
229 star_DS.getRestrictSpecLoc(),star_DS.getAtomicSpecLoc()),star_DS.getAttributes(),SourceLocation());
230 return Actions.ActOnCastExpr(getCurScope(), Loc, DeclaratorInfo, CastTy,Loc, Result.get());
231
217 } 232 }
218 233
219 /// CreateAssignmentStmt - Create assignment statement such as "aaa = bbb;", "auaua = llll;", etc. 234 /// CreateAssignmentStmt - Create assignment statement such as "aaa = bbb;", "auaua = llll;", etc.
220 /// It can create 4 kinds of statement. 235 /// It can create 4 kinds of statement.
221 /// 1. common assignment statement: 236 /// 1. common assignment statement: