diff --git a/src/project.cc b/src/project.cc index de1b80eb..7ea4e37a 100644 --- a/src/project.cc +++ b/src/project.cc @@ -22,9 +22,61 @@ MAKE_REFLECT_STRUCT(CompileCommandsEntry, directory, file, command, args); namespace { + +static const char* kBlacklistMulti[] = { + "-MF", + "-Xclang" +}; + // Blacklisted flags which are always removed from the command line. static const char *kBlacklist[] = { - "-stdlib=libc++" + "--param", + "-M", + "-MD", + "-MG", + "-MM", + "-MMD", + "-MP", + "-MQ", + "-MT", + "-Og", + "-Wa,--32", + "-Wa,--64", + "-Wl,--incremental-full", + "-Wl,--incremental-patch,1", + "-Wl,--no-incremental", + "-fbuild-session-file=", + "-fbuild-session-timestamp=", + "-fembed-bitcode", + "-fembed-bitcode-marker", + "-fmodules-validate-once-per-build-session", + "-fno-delete-null-pointer-checks", + "-fno-use-linker-plugin" + "-fno-var-tracking", + "-fno-var-tracking-assignments", + "-fno-enforce-eh-specs", + "-fvar-tracking", + "-fvar-tracking-assignments", + "-fvar-tracking-assignments-toggle", + "-gcc-toolchain", + "-march=", + "-masm=", + "-mcpu=", + "-mfpmath=", + "-mtune=", + "-s", + + "-B", + //"-f", + //"-pipe", + //"-W", + // TODO: make sure we consume includes before stripping all path-like args. + "/work/goma/gomacc", + "../../third_party/llvm-build/Release+Asserts/bin/clang++", + "-Wno-unused-lambda-capture", + "/", + "..", + //"-stdlib=libc++" }; // Arguments which are followed by a potentially relative path. We need to make @@ -47,6 +99,12 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(const std::vector