[PECOFF] Avoid C-style cast.

llvm-svn: 204855
This commit is contained in:
Rui Ueyama
2014-03-26 21:10:40 +00:00
parent 5d167dae7d
commit 69a6f0e79a
2 changed files with 6 additions and 4 deletions

View File

@@ -59,20 +59,22 @@ public:
/// \brief Represents a ELF control node
class PECOFFGroup : public Group {
public:
PECOFFGroup() : Group(0) {}
PECOFFGroup(PECOFFLinkingContext &ctx) : Group(0), _ctx(ctx) {}
bool validate() override { return true; }
bool dump(raw_ostream &) override { return true; }
/// \brief Parse the group members.
error_code parse(const LinkingContext &ctx, raw_ostream &diagnostics) override {
auto *pctx = (PECOFFLinkingContext *)(&ctx);
std::lock_guard<std::recursive_mutex> lock(pctx->getMutex());
std::lock_guard<std::recursive_mutex> lock(_ctx.getMutex());
for (auto &elem : _elements)
if (error_code ec = elem->parse(ctx, diagnostics))
return ec;
return error_code::success();
}
private:
PECOFFLinkingContext &_ctx;
};
} // namespace lld

View File

@@ -1246,7 +1246,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[],
// Add the library group to the input graph.
if (!isReadingDirectiveSection) {
auto group = std::unique_ptr<Group>(new PECOFFGroup());
auto group = std::unique_ptr<Group>(new PECOFFGroup(ctx));
ctx.setLibraryGroup(group.get());
ctx.inputGraph().addInputElement(std::move(group));
}