Vuo 2.4.4
Loading...
Searching...
No Matches
VuoPreprocessorCallbacks.cc
Go to the documentation of this file.
1
11#include "VuoCModuleCompiler.hh"
12
13using namespace clang;
14
18VuoPreprocessorCallbacks::VuoPreprocessorCallbacks(VuoCModuleCompiler *moduleCompiler, vfs::InMemoryFileSystem *inMemoryFileSystem, bool shouldDefineGenericTypes) :
19 PPCallbacks(),
20 moduleCompiler(moduleCompiler),
21 inMemoryFileSystem(inMemoryFileSystem),
22 shouldDefineGenericTypes(shouldDefineGenericTypes)
23{
24}
25
30bool VuoPreprocessorCallbacks::FileNotFound(StringRef fileName, SmallVectorImpl<char> &recoveryPath)
31{
32 string recoveryPathStr = moduleCompiler->generateVirtualFileForSpecializedHeader(inMemoryFileSystem, fileName.str(), shouldDefineGenericTypes);
33 if (! recoveryPathStr.empty())
34 {
35 recoveryPath.assign(recoveryPathStr.begin(), recoveryPathStr.end());
36 return true;
37 }
38
39 return false;
40}
41
45void VuoPreprocessorCallbacks::InclusionDirective(SourceLocation hashLoc, const Token &includeTok, StringRef fileName, bool isAngled,
46 CharSourceRange fileNameRange, const FileEntry *file, StringRef searchPath, StringRef relativePath,
47 const clang::Module *imported)
48{
49 moduleCompiler->includedHeaders.insert(fileName.str());
50}