Vuo
2.4.4
Loading...
Searching...
No Matches
compiler
c
VuoPreprocessorCallbacks.cc
Go to the documentation of this file.
1
10
#include "
VuoPreprocessorCallbacks.hh
"
11
#include "
VuoCModuleCompiler.hh
"
12
13
using namespace
clang;
14
18
VuoPreprocessorCallbacks::VuoPreprocessorCallbacks
(
VuoCModuleCompiler
*moduleCompiler, vfs::InMemoryFileSystem *inMemoryFileSystem,
bool
shouldDefineGenericTypes) :
19
PPCallbacks(),
20
moduleCompiler(moduleCompiler),
21
inMemoryFileSystem(inMemoryFileSystem),
22
shouldDefineGenericTypes(shouldDefineGenericTypes)
23
{
24
}
25
30
bool
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
45
void
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
}
Generated on Thu Nov 9 2023 16:59:28 for Vuo by
1.9.8