Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -5896,7 +5896,6 @@ def print_enabled_extensions : Flag<["-", "--"], "print-enabled-extensions">,
def : Flag<["-"], "mcpu=help">, Alias<print_supported_cpus>;
def : Flag<["-"], "mtune=help">, Alias<print_supported_cpus>;
def time : Flag<["-"], "time">,
Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
HelpText<"Time individual commands">;
def traditional_cpp : Flag<["-", "--"], "traditional-cpp">,
Visibility<[ClangOption, CC1Option]>,
Expand Down
20 changes: 0 additions & 20 deletions clang/lib/Driver/Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#include "llvm/Option/OptSpecifier.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
#include <cassert>
Expand Down Expand Up @@ -197,28 +194,11 @@ int Compilation::ExecuteCommand(const Command &C,
if (LogOnly)
return 0;

// We don't use any timers or llvm::TimeGroup's because those are tied into
// the global static timer list which, in principle, could be cleared without
// us knowing about it.
llvm::TimeRecord StartTime;
if (getArgs().hasArg(options::OPT_time))
StartTime = llvm::TimeRecord::getCurrentTime(/*Start=*/true);

std::string Error;
bool ExecutionFailed;
int Res = C.Execute(Redirects, &Error, &ExecutionFailed);
if (PostCallback)
PostCallback(C, Res);

if (getArgs().hasArg(options::OPT_time)) {
llvm::TimeRecord Time = llvm::TimeRecord::getCurrentTime(/*Start=*/false);
Time -= StartTime;
llvm::StringRef Name = llvm::sys::path::filename(C.getExecutable());
llvm::errs() << "# " << Name << " "
<< llvm::format("%0.2f", Time.getUserTime()) << " "
<< llvm::format("%0.2f", Time.getSystemTime()) << "\n";
}

if (!Error.empty()) {
assert(Res && "Error string set with 0 result code!");
getDriver().Diag(diag::err_drv_command_failure) << Error;
Expand Down
3 changes: 0 additions & 3 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,9 +1315,6 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// Ignore -pipe.
Args.ClaimAllArgs(options::OPT_pipe);

// Ignore -time.
Args.ClaimAllArgs(options::OPT_time);

// Extract -ccc args.
//
// FIXME: We need to figure out where this behavior should live. Most of it
Expand Down
33 changes: 0 additions & 33 deletions clang/test/Driver/time.c

This file was deleted.

36 changes: 0 additions & 36 deletions flang/test/Driver/time.f90

This file was deleted.

Loading