forked from OSchip/llvm-project
[Mips] Remove redundant call to the unique_ptr::get() method followed
by the returned pointer dereferencing. llvm-svn: 203399
This commit is contained in:
parent
f08deab395
commit
4881a93b73
|
@ -23,18 +23,18 @@ MipsTargetHandler::MipsTargetHandler(MipsLinkingContext &context)
|
|||
_mipsRuntimeFile(new MipsRuntimeFile<Mips32ElELFType>(context)),
|
||||
_mipsTargetLayout(new MipsTargetLayout<Mips32ElELFType>(context)),
|
||||
_mipsRelocationHandler(
|
||||
new MipsTargetRelocationHandler(*_mipsTargetLayout.get())) {}
|
||||
new MipsTargetRelocationHandler(*_mipsTargetLayout)) {}
|
||||
|
||||
std::unique_ptr<Writer> MipsTargetHandler::getWriter() {
|
||||
switch (_mipsLinkingContext.getOutputELFType()) {
|
||||
case llvm::ELF::ET_EXEC:
|
||||
return std::unique_ptr<Writer>(
|
||||
new elf::MipsExecutableWriter<Mips32ElELFType>(
|
||||
_mipsLinkingContext, *_mipsTargetLayout.get()));
|
||||
_mipsLinkingContext, *_mipsTargetLayout));
|
||||
case llvm::ELF::ET_DYN:
|
||||
return std::unique_ptr<Writer>(
|
||||
new elf::MipsDynamicLibraryWriter<Mips32ElELFType>(
|
||||
_mipsLinkingContext, *_mipsTargetLayout.get()));
|
||||
_mipsLinkingContext, *_mipsTargetLayout));
|
||||
case llvm::ELF::ET_REL:
|
||||
llvm_unreachable("TODO: support -r mode");
|
||||
default:
|
||||
|
|
|
@ -73,11 +73,11 @@ public:
|
|||
MipsTargetHandler(MipsLinkingContext &context);
|
||||
|
||||
MipsTargetLayout<Mips32ElELFType> &getTargetLayout() override {
|
||||
return *(_mipsTargetLayout.get());
|
||||
return *_mipsTargetLayout;
|
||||
}
|
||||
|
||||
const MipsTargetRelocationHandler &getRelocationHandler() const override {
|
||||
return *(_mipsRelocationHandler.get());
|
||||
return *_mipsRelocationHandler;
|
||||
}
|
||||
|
||||
std::unique_ptr<Writer> getWriter() override;
|
||||
|
|
Loading…
Reference in New Issue