mirror of
https://github.com/intel/llvm.git
synced 2026-02-04 11:38:04 +08:00
[PECOFF] Avoid C-style cast.
llvm-svn: 204855
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user