[gardening] C++ gardening: Terminate namespaces, fix argument names, ...

Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
This commit is contained in:
practicalswift
2016-12-17 00:32:42 +01:00
parent 2ff90611a8
commit 38be6125e5
165 changed files with 508 additions and 505 deletions

View File

@@ -31,7 +31,7 @@ namespace {
};
typedef std::pair<types::ID, std::string> OutputPair;
}
} // end anonymous namespace
namespace swift {
namespace json {
@@ -73,8 +73,8 @@ namespace json {
return seq[index];
}
};
}
}
} // namespace json
} // namespace swift
namespace {
@@ -140,7 +140,7 @@ public:
});
}
virtual void provideMapping(swift::json::Output &out) {
void provideMapping(swift::json::Output &out) override {
Message::provideMapping(out);
out.mapRequired("command", CommandLine);
out.mapOptional("inputs", Inputs);
@@ -154,7 +154,7 @@ public:
TaskBasedMessage(StringRef Kind, const Job &Cmd, ProcessId Pid) :
CommandBasedMessage(Kind, Cmd), Pid(Pid) {}
virtual void provideMapping(swift::json::Output &out) {
void provideMapping(swift::json::Output &out) override {
CommandBasedMessage::provideMapping(out);
out.mapRequired("pid", Pid);
}
@@ -166,7 +166,7 @@ public:
BeganMessage(const Job &Cmd, ProcessId Pid) :
DetailedCommandBasedMessage("began", Cmd), Pid(Pid) {}
virtual void provideMapping(swift::json::Output &out) {
void provideMapping(swift::json::Output &out) override {
DetailedCommandBasedMessage::provideMapping(out);
out.mapRequired("pid", Pid);
}
@@ -179,7 +179,7 @@ public:
StringRef Output) : TaskBasedMessage(Kind, Cmd, Pid),
Output(Output) {}
virtual void provideMapping(swift::json::Output &out) {
void provideMapping(swift::json::Output &out) override {
TaskBasedMessage::provideMapping(out);
out.mapOptional("output", Output, std::string());
}
@@ -193,7 +193,7 @@ public:
Output),
ExitStatus(ExitStatus) {}
virtual void provideMapping(swift::json::Output &out) {
void provideMapping(swift::json::Output &out) override {
TaskOutputMessage::provideMapping(out);
out.mapRequired("exit-status", ExitStatus);
}
@@ -207,7 +207,7 @@ public:
Pid, Output),
ErrorMsg(ErrorMsg) {}
virtual void provideMapping(swift::json::Output &out) {
void provideMapping(swift::json::Output &out) override {
TaskOutputMessage::provideMapping(out);
out.mapOptional("error-message", ErrorMsg, std::string());
}
@@ -219,7 +219,7 @@ public:
DetailedCommandBasedMessage("skipped", Cmd) {}
};
}
} // end anonymous namespace
namespace swift {
namespace json {
@@ -231,8 +231,8 @@ struct ObjectTraits<Message> {
}
};
} // end namespace yaml
} // end namespace llvm
} // namespace json
} // namespace swift
static void emitMessage(raw_ostream &os, Message &msg) {
std::string JSONString;