Skip to content

Commit dff136d

Browse files
committed
[Review] Rename CachedCommand to ClangCommand
1 parent 02d8a29 commit dff136d

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

amd/comgr/src/comgr-cache-command.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ CachedCommandAdaptor::getIdentifier() const {
170170
return Id;
171171
}
172172

173-
CachedCommand::CachedCommand(driver::Command &Command,
174-
DiagnosticOptions &DiagOpts,
175-
llvm::vfs::FileSystem &VFS,
176-
ExecuteFnTy &&ExecuteImpl)
173+
ClangCommand::ClangCommand(driver::Command &Command,
174+
DiagnosticOptions &DiagOpts,
175+
llvm::vfs::FileSystem &VFS,
176+
ExecuteFnTy &&ExecuteImpl)
177177
: Command(Command), DiagOpts(DiagOpts), VFS(VFS),
178178
ExecuteImpl(std::move(ExecuteImpl)) {}
179179

180-
Error CachedCommand::addInputIdentifier(HashAlgorithm &H) const {
180+
Error ClangCommand::addInputIdentifier(HashAlgorithm &H) const {
181181
auto Inputs(getInputFiles(Command));
182182
for (StringRef Input : Inputs) {
183183
if (Error E = addFile(H, Input)) {
@@ -188,7 +188,7 @@ Error CachedCommand::addInputIdentifier(HashAlgorithm &H) const {
188188
return Error::success();
189189
}
190190

191-
void CachedCommand::addOptionsIdentifier(HashAlgorithm &H) const {
191+
void ClangCommand::addOptionsIdentifier(HashAlgorithm &H) const {
192192
auto Inputs(getInputFiles(Command));
193193
StringRef Output = Command.getOutputFilenames().front();
194194
ArrayRef<const char *> Arguments = Command.getArguments();
@@ -230,11 +230,11 @@ void CachedCommand::addOptionsIdentifier(HashAlgorithm &H) const {
230230
}
231231
}
232232

233-
CachedCommand::ActionClass CachedCommand::getClass() const {
233+
ClangCommand::ActionClass ClangCommand::getClass() const {
234234
return Command.getSource().getKind();
235235
}
236236

237-
bool CachedCommand::canCache() const {
237+
bool ClangCommand::canCache() const {
238238
bool HasOneOutput = Command.getOutputFilenames().size() == 1;
239239
bool IsPreprocessorCommand = getClass() == driver::Action::PreprocessJobClass;
240240

@@ -248,7 +248,7 @@ bool CachedCommand::canCache() const {
248248
!hasDebugOrProfileInfo(Command.getArguments());
249249
}
250250

251-
Error CachedCommand::writeExecuteOutput(StringRef CachedBuffer) {
251+
Error ClangCommand::writeExecuteOutput(StringRef CachedBuffer) {
252252
StringRef OutputFilename = Command.getOutputFilenames().front();
253253
std::error_code EC;
254254
raw_fd_ostream Out(OutputFilename, EC);
@@ -269,7 +269,7 @@ Error CachedCommand::writeExecuteOutput(StringRef CachedBuffer) {
269269
return Error::success();
270270
}
271271

272-
Expected<StringRef> CachedCommand::readExecuteOutput() {
272+
Expected<StringRef> ClangCommand::readExecuteOutput() {
273273
StringRef OutputFilename = Command.getOutputFilenames().front();
274274
ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
275275
MemoryBuffer::getFile(OutputFilename);
@@ -282,7 +282,7 @@ Expected<StringRef> CachedCommand::readExecuteOutput() {
282282
return Output->getBuffer();
283283
}
284284

285-
amd_comgr_status_t CachedCommand::execute(llvm::raw_ostream &LogS) {
285+
amd_comgr_status_t ClangCommand::execute(llvm::raw_ostream &LogS) {
286286
return ExecuteImpl(Command, LogS, DiagOpts, VFS);
287287
}
288288
} // namespace COMGR

amd/comgr/src/comgr-cache-command.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class CachedCommandAdaptor {
8080
virtual llvm::Error addInputIdentifier(HashAlgorithm &) const = 0;
8181
};
8282

83-
class CachedCommand final : public CachedCommandAdaptor {
83+
class ClangCommand final : public CachedCommandAdaptor {
8484
public:
8585
using ExecuteFnTy = std::function<amd_comgr_status_t(
8686
clang::driver::Command &, llvm::raw_ostream &, clang::DiagnosticOptions &,
@@ -97,16 +97,16 @@ class CachedCommand final : public CachedCommandAdaptor {
9797
std::unique_ptr<llvm::MemoryBuffer> Output;
9898

9999
public:
100-
CachedCommand(clang::driver::Command &Command,
101-
clang::DiagnosticOptions &DiagOpts, llvm::vfs::FileSystem &VFS,
102-
ExecuteFnTy &&ExecuteImpl);
100+
ClangCommand(clang::driver::Command &Command,
101+
clang::DiagnosticOptions &DiagOpts, llvm::vfs::FileSystem &VFS,
102+
ExecuteFnTy &&ExecuteImpl);
103103

104104
bool canCache() const override;
105105
llvm::Error writeExecuteOutput(llvm::StringRef CachedBuffer) override;
106106
llvm::Expected<llvm::StringRef> readExecuteOutput() override;
107107
amd_comgr_status_t execute(llvm::raw_ostream &LogS) override;
108108

109-
~CachedCommand() override = default;
109+
~ClangCommand() override = default;
110110

111111
protected:
112112
ActionClass getClass() const override;

amd/comgr/src/comgr-compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ AMDGPUCompiler::executeInProcessDriver(ArrayRef<const char *> Args) {
784784

785785
auto Cache = CommandCache::get(LogS);
786786
for (auto &Job : C->getJobs()) {
787-
CachedCommand C(Job, *DiagOpts, *VFS, executeCommand);
787+
ClangCommand C(Job, *DiagOpts, *VFS, executeCommand);
788788
if (Cache) {
789789
if (auto Status = Cache->execute(C, LogS)) {
790790
return Status;

0 commit comments

Comments
 (0)