diff options
Diffstat (limited to 'compiler_wrapper/compiler_wrapper.go')
-rw-r--r-- | compiler_wrapper/compiler_wrapper.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index 1386374e..dcaada99 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -151,6 +151,7 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int } } else { cSrcFile, tidyFlags, tidyMode := processClangTidyFlags(mainBuilder) + cSrcFile, iwyuFlags, iwyuMode := processIWYUFlags(mainBuilder) if mainBuilder.target.compilerType == clangType { err := prepareClangCommand(mainBuilder) if err != nil { @@ -176,6 +177,20 @@ func callCompilerInternal(env env, cfg *config, inputCmd *command) (exitCode int return 0, err } } + + if iwyuMode != iwyuModeNone { + if iwyuMode == iwyuModeError { + panic(fmt.Sprintf("Unknown IWYU mode")) + } + + allowCCache = false + clangCmdWithoutRemoteBuildAndCCache := mainBuilder.build() + err := runIWYU(env, clangCmdWithoutRemoteBuildAndCCache, cSrcFile, iwyuFlags) + if err != nil { + return 0, err + } + } + if remoteBuildUsed, err = processRemoteBuildAndCCacheFlags(allowCCache, mainBuilder); err != nil { return 0, err } |