summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/plugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/plugin.cxx')
-rw-r--r--compilerplugins/clang/plugin.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 753c548cf252..c68eceb67c32 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -251,6 +251,12 @@ StringRef Plugin::getFilenameOfLocation(SourceLocation spellingLocation) const
}
else
{
+ char const*const pCXX = getenv("CXX");
+ if (pCXX && strstr(pCXX, "sccache"))
+ { // heuristic; sccache passes file with -frewrite-directives by name
+ s_Mode = STDIN;
+ return getFilenameOfLocation(spellingLocation);
+ }
auto const fn(compiler.getSourceManager().getFilename(spellingLocation));
if (!fn.data()) // wtf? happens in sot/source/sdstor/stg.cxx
{