diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2018-03-20 21:08:59 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2018-03-20 21:08:59 +0000 |
commit | 5e4511cfc7e04c4bff78af66843f1625832a03d5 (patch) | |
tree | e48dbf9066f3b2a012282330995d2d7bf0a2b832 /clang/lib/Driver/Action.cpp | |
parent | 0f110a88bef3b2e46c029c21d9352a120cd995dd (diff) | |
download | bcm5719-llvm-5e4511cfc7e04c4bff78af66843f1625832a03d5.tar.gz bcm5719-llvm-5e4511cfc7e04c4bff78af66843f1625832a03d5.zip |
[Driver] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 328044
Diffstat (limited to 'clang/lib/Driver/Action.cpp')
-rw-r--r-- | clang/lib/Driver/Action.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp index 85e466a4409..3e65f9e05fb 100644 --- a/clang/lib/Driver/Action.cpp +++ b/clang/lib/Driver/Action.cpp @@ -1,4 +1,4 @@ -//===--- Action.cpp - Abstract compilation steps --------------------------===// +//===- Action.cpp - Abstract compilation steps ----------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,16 +8,15 @@ //===----------------------------------------------------------------------===// #include "clang/Driver/Action.h" -#include "clang/Driver/ToolChain.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/Regex.h" #include <cassert> -using namespace clang::driver; +#include <string> + +using namespace clang; +using namespace driver; using namespace llvm::opt; -Action::~Action() {} +Action::~Action() = default; const char *Action::getClassName(ActionClass AC) { switch (AC) { @@ -102,7 +101,7 @@ std::string Action::getOffloadingKindPrefix() const { } if (!ActiveOffloadKindMask) - return ""; + return {}; std::string Res("host"); if (ActiveOffloadKindMask & OFK_Cuda) @@ -119,11 +118,11 @@ std::string Action::getOffloadingKindPrefix() const { /// for each offloading kind. std::string Action::GetOffloadingFileNamePrefix(OffloadKind Kind, - llvm::StringRef NormalizedTriple, + StringRef NormalizedTriple, bool CreatePrefixForHost) { // Don't generate prefix for host actions unless required. if (!CreatePrefixForHost && (Kind == OFK_None || Kind == OFK_Host)) - return ""; + return {}; std::string Res("-"); Res += GetOffloadKindName(Kind); @@ -134,7 +133,7 @@ Action::GetOffloadingFileNamePrefix(OffloadKind Kind, /// Return a string with the offload kind name. If that is not defined, we /// assume 'host'. -llvm::StringRef Action::GetOffloadKindName(OffloadKind Kind) { +StringRef Action::GetOffloadKindName(OffloadKind Kind) { switch (Kind) { case OFK_None: case OFK_Host: @@ -153,12 +152,11 @@ llvm::StringRef Action::GetOffloadKindName(OffloadKind Kind) { void InputAction::anchor() {} InputAction::InputAction(const Arg &_Input, types::ID _Type) - : Action(InputClass, _Type), Input(_Input) { -} + : Action(InputClass, _Type), Input(_Input) {} void BindArchAction::anchor() {} -BindArchAction::BindArchAction(Action *Input, llvm::StringRef ArchName) +BindArchAction::BindArchAction(Action *Input, StringRef ArchName) : Action(BindArchClass, Input), ArchName(ArchName) {} void OffloadAction::anchor() {} @@ -300,8 +298,7 @@ JobAction::JobAction(ActionClass Kind, Action *Input, types::ID Type) : Action(Kind, Input, Type) {} JobAction::JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type) - : Action(Kind, Inputs, Type) { -} + : Action(Kind, Inputs, Type) {} void PreprocessJobAction::anchor() {} @@ -341,20 +338,17 @@ AssembleJobAction::AssembleJobAction(Action *Input, types::ID OutputType) void LinkJobAction::anchor() {} LinkJobAction::LinkJobAction(ActionList &Inputs, types::ID Type) - : JobAction(LinkJobClass, Inputs, Type) { -} + : JobAction(LinkJobClass, Inputs, Type) {} void LipoJobAction::anchor() {} LipoJobAction::LipoJobAction(ActionList &Inputs, types::ID Type) - : JobAction(LipoJobClass, Inputs, Type) { -} + : JobAction(LipoJobClass, Inputs, Type) {} void DsymutilJobAction::anchor() {} DsymutilJobAction::DsymutilJobAction(ActionList &Inputs, types::ID Type) - : JobAction(DsymutilJobClass, Inputs, Type) { -} + : JobAction(DsymutilJobClass, Inputs, Type) {} void VerifyJobAction::anchor() {} |