for (const auto &CS : Checksums) {
Result->addChecksum(CS.FileName, CS.Kind, CS.ChecksumBytes.Bytes);
}
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection> YAMLLinesSubsection::toCodeViewSubsection(
}
}
}
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection>
Result->addExtraFile(EF);
}
}
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection>
auto Result = std::make_shared<DebugCrossModuleExportsSubsection>();
for (const auto &M : Exports)
Result->addMapping(M.Local, M.Global);
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection>
for (const auto Id : M.ImportIds)
Result->addImport(M.ModuleName, Id);
}
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection> YAMLSymbolsSubsection::toCodeViewSubsection(
for (const auto &Sym : Symbols)
Result->addSymbol(
Sym.toCodeViewSymbol(Allocator, CodeViewContainer::ObjectFile));
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection>
auto Result = std::make_shared<DebugStringTableSubsection>();
for (const auto &Str : this->Strings)
Result->insert(Str);
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection> YAMLFrameDataSubsection::toCodeViewSubsection(
F.FrameFunc = SC.strings()->insert(YF.FrameFunc);
Result->addFrameData(F);
}
- return std::move(Result);
+ return Result;
}
std::shared_ptr<DebugSubsection>
auto Result = llvm::make_unique<DebugSymbolRVASubsection>();
for (const auto &RVA : RVAs)
Result->addRVA(RVA);
- return std::move(Result);
+ return Result;
}
static Expected<SourceFileChecksumEntry>
auto YamlSS = Err(YAMLDebugSubsection::fromCodeViewSubection(SC, SS));
Result.push_back(YamlSS);
}
- return std::move(Result);
+ return Result;
}
void llvm::CodeViewYAML::initializeStringsAndChecksums(
using namespace llvm;
-namespace {
-template <typename T> struct WeakishPtr {
-public:
- WeakishPtr() : Ref(nullptr) {}
-
- WeakishPtr(std::unique_ptr<T> Value)
- : Ref(Value.get()), UniquePtr(std::move(Value)) {}
-
- WeakishPtr(std::unique_ptr<T> &&Value)
- : Ref(Value.get()), UniquePtr(std::move(Value)) {}
-
- WeakishPtr<T> &operator=(std::unique_ptr<T> &&Value) {
- Owned = std::move(Value);
- Ref = Owned.get();
- return *this;
- }
-
- T *get() { return Ref; }
- T &operator*() { return *Ref; }
-
- operator bool() const { return Ref != nullptr; }
-
- T *Ref;
- std::unique_ptr<T> Owned;
-};
-} // namespace
-
/// This parses a yaml stream that represents a COFF object file.
/// See docs/yaml2obj for the yaml scheema.
struct COFFParser {