This is a workaround for the issue in buildASTFromCodeWithArgs()
where a local buffer can be used to store the program text
referred by SourceManager.
FIXME: Fix the root issue in buildASTFromCodeWithArgs().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332256
91177308-0d34-0410-b5e6-
96231b3b80d8
struct TU {
// Buffer for the context, must live in the test scope.
- StringRef Code;
- StringRef FileName;
+ std::string Code;
+ std::string FileName;
std::unique_ptr<ASTUnit> Unit;
TranslationUnitDecl *TUDecl = nullptr;
TU(StringRef Code, StringRef FileName, ArgVector Args)