From: Mitch Phillips <31459023+hctim@users.noreply.github.com> Date: Wed, 18 Dec 2019 17:05:09 +0000 (-0800) Subject: Revert "Add an -fno-temp-file flag for compilation" X-Git-Tag: llvmorg-11-init~1844 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b19d87b16f81e7c0a22a0a103c867c1b844eb8bc;p=platform%2Fupstream%2Fllvm.git Revert "Add an -fno-temp-file flag for compilation" This reverts commit d129aa1d5369781deff6c6b854cb612e160d3fb2. This broke the MSan buildbots. More information available in the original PR: https://reviews.llvm.org/D70615 --- diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 2a72b87..38504d6 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1563,9 +1563,6 @@ def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group; def fno_strict_vtable_pointers: Flag<["-"], "fno-strict-vtable-pointers">, Group; def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group; -def fno_temp_file : Flag<["-"], "fno-temp-file">, Group, - Flags<[CC1Option, CoreOption]>, HelpText< - "Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes">; def fno_threadsafe_statics : Flag<["-"], "fno-threadsafe-statics">, Group, Flags<[CC1Option]>, HelpText<"Do not emit code to make initialization of local statics thread safe">; def fno_use_cxa_atexit : Flag<["-"], "fno-use-cxa-atexit">, Group, Flags<[CC1Option]>, diff --git a/clang/include/clang/Frontend/FrontendOptions.h b/clang/include/clang/Frontend/FrontendOptions.h index 305a660..70eb342 100644 --- a/clang/include/clang/Frontend/FrontendOptions.h +++ b/clang/include/clang/Frontend/FrontendOptions.h @@ -294,9 +294,6 @@ public: /// Whether timestamps should be written to the produced PCH file. unsigned IncludeTimestamps : 1; - /// Should a temporary file be used during compilation. - unsigned UseTemporary : 1; - CodeCompleteOptions CodeCompleteOpts; /// Specifies the output format of the AST. diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 5febd55..5bf0efc 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -5029,7 +5029,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_ftime_trace_granularity_EQ); Args.AddLastArg(CmdArgs, options::OPT_ftrapv); Args.AddLastArg(CmdArgs, options::OPT_malign_double); - Args.AddLastArg(CmdArgs, options::OPT_fno_temp_file); if (Arg *A = Args.getLastArg(options::OPT_ftrapv_handler_EQ)) { CmdArgs.push_back("-ftrapv-handler"); diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 688f21d..05ecc3f 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -672,7 +672,7 @@ CompilerInstance::createDefaultOutputFile(bool Binary, StringRef InFile, StringRef Extension) { return createOutputFile(getFrontendOpts().OutputFile, Binary, /*RemoveFileOnSignal=*/true, InFile, Extension, - getFrontendOpts().UseTemporary); + /*UseTemporary=*/true); } std::unique_ptr CompilerInstance::createNullOutputFile() { diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index d68244d..8631536 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1887,7 +1887,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ModulesEmbedFiles = Args.getAllArgValues(OPT_fmodules_embed_file_EQ); Opts.ModulesEmbedAllFiles = Args.hasArg(OPT_fmodules_embed_all_files); Opts.IncludeTimestamps = !Args.hasArg(OPT_fno_pch_timestamp); - Opts.UseTemporary = !Args.hasArg(OPT_fno_temp_file); Opts.CodeCompleteOpts.IncludeMacros = Args.hasArg(OPT_code_completion_macros); diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 1dbfad0..aeea63c 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -140,7 +140,7 @@ GeneratePCHAction::CreateOutputFile(CompilerInstance &CI, StringRef InFile, std::unique_ptr OS = CI.createOutputFile(CI.getFrontendOpts().OutputFile, /*Binary=*/true, /*RemoveFileOnSignal=*/false, InFile, - /*Extension=*/"", CI.getFrontendOpts().UseTemporary); + /*Extension=*/"", /*UseTemporary=*/true); if (!OS) return nullptr; diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index ea6d10af..2e445d5 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -588,6 +588,3 @@ // CHECK-TRIVIAL-PATTERN-NOT: hasn't been enabled // CHECK-TRIVIAL-ZERO-GOOD-NOT: hasn't been enabled // CHECK-TRIVIAL-ZERO-BAD: hasn't been enabled - -// RUN: %clang -### -S -fno-temp-file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-TEMP-FILE %s -// CHECK-NO-TEMP-FILE: "-fno-temp-file" \ No newline at end of file