CompoundStmt::Create takes FPOptionsOverride
This commit is contained in:
parent
d5aec8274b
commit
85c348828f
@ -43,9 +43,14 @@ namespace cling {
|
||||
m_HandledDecls.insert(m_FoundDRE->getDecl());
|
||||
}
|
||||
}
|
||||
if (CS->size() != Stmts.size())
|
||||
return CompoundStmt::Create(m_Sema->getASTContext(), Stmts,
|
||||
if (CS->size() != Stmts.size()) {
|
||||
FPOptionsOverride FPFeatures;
|
||||
if (CS->hasStoredFPFeatures()) {
|
||||
FPFeatures = CS->getStoredFPFeatures();
|
||||
}
|
||||
return CompoundStmt::Create(m_Sema->getASTContext(), Stmts, FPFeatures,
|
||||
CS->getLBracLoc(), CS->getRBracLoc());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -210,8 +210,12 @@ namespace cling {
|
||||
}
|
||||
|
||||
// Create a new body.
|
||||
auto newCS = CompoundStmt::Create(*m_Context, Stmts, CS->getLBracLoc(),
|
||||
CS->getRBracLoc());
|
||||
FPOptionsOverride FPFeatures;
|
||||
if (CS->hasStoredFPFeatures()) {
|
||||
FPFeatures = CS->getStoredFPFeatures();
|
||||
}
|
||||
auto newCS = CompoundStmt::Create(*m_Context, Stmts, FPFeatures,
|
||||
CS->getLBracLoc(), CS->getRBracLoc());
|
||||
FD->setBody(newCS);
|
||||
|
||||
if (hasNoErrors && !TouchedDecls.empty()) {
|
||||
@ -268,7 +272,7 @@ namespace cling {
|
||||
|
||||
// Wrap Stmts into a function body.
|
||||
llvm::ArrayRef<Stmt*> StmtsRef(Stmts.data(), Stmts.size());
|
||||
CompoundStmt* CS = CompoundStmt::Create(*m_Context, StmtsRef, Loc, Loc);
|
||||
CompoundStmt* CS = CompoundStmt::Create(*m_Context, StmtsRef, {}, Loc, Loc);
|
||||
FD->setBody(CS);
|
||||
Emit(FD);
|
||||
|
||||
|
@ -389,7 +389,11 @@ namespace cling {
|
||||
}
|
||||
}
|
||||
|
||||
auto* NewCS = CompoundStmt::Create(*m_Context, NewChildren,
|
||||
FPOptionsOverride FPFeatures;
|
||||
if (Node->hasStoredFPFeatures()) {
|
||||
FPFeatures = Node->getStoredFPFeatures();
|
||||
}
|
||||
auto* NewCS = CompoundStmt::Create(*m_Context, NewChildren, FPFeatures,
|
||||
Node->getLBracLoc(),
|
||||
Node->getRBracLoc());
|
||||
|
||||
|
@ -671,7 +671,7 @@ static const char* BuildAndEmitVPWrapperBody(cling::Interpreter &Interp,
|
||||
return "ERROR in cling's callPrintValue(): cannot build return expression";
|
||||
|
||||
auto *Body
|
||||
= clang::CompoundStmt::Create(Ctx, {RetStmt.get()}, noSrcLoc, noSrcLoc);
|
||||
= clang::CompoundStmt::Create(Ctx, {RetStmt.get()}, {}, noSrcLoc, noSrcLoc);
|
||||
WrapperFD->setBody(Body);
|
||||
auto &Consumer = Interp.getCI()->getASTConsumer();
|
||||
Consumer.HandleTopLevelDecl(clang::DeclGroupRef(WrapperFD));
|
||||
|
@ -180,8 +180,12 @@ namespace cling {
|
||||
return 0;
|
||||
|
||||
if (CS->size() != FBody.size()) {
|
||||
auto BodyCS = CompoundStmt::Create(*m_Context, FBody, CS->getLBracLoc(),
|
||||
CS->getRBracLoc());
|
||||
FPOptionsOverride FPFeatures;
|
||||
if (CS->hasStoredFPFeatures()) {
|
||||
FPFeatures = CS->getStoredFPFeatures();
|
||||
}
|
||||
auto BodyCS = CompoundStmt::Create(*m_Context, FBody, FPFeatures,
|
||||
CS->getLBracLoc(), CS->getRBracLoc());
|
||||
FD->setBody(BodyCS);
|
||||
}
|
||||
|
||||
|
@ -150,8 +150,12 @@ namespace utils {
|
||||
newBody.insert(newBody.begin() + indexOfLastExpr, DRE);
|
||||
|
||||
// Attach a new body.
|
||||
FPOptionsOverride FPFeatures;
|
||||
if (CS->hasStoredFPFeatures()) {
|
||||
FPFeatures = CS->getStoredFPFeatures();
|
||||
}
|
||||
auto newCS = CompoundStmt::Create(S->getASTContext(), newBody,
|
||||
CS->getLBracLoc(),
|
||||
FPFeatures, CS->getLBracLoc(),
|
||||
CS->getRBracLoc());
|
||||
FD->setBody(newCS);
|
||||
if (FoundAt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user