mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 16:11:27 +08:00
[clang] - An update after LLVM change.
SectionRef::getName() was changed to return Expected<> (D66089) llvm-svn: 368825
This commit is contained in:
@@ -335,7 +335,11 @@ ObjectFilePCHContainerReader::ExtractPCH(llvm::MemoryBufferRef Buffer) const {
|
||||
// Find the clang AST section in the container.
|
||||
for (auto &Section : OF->sections()) {
|
||||
StringRef Name;
|
||||
Section.getName(Name);
|
||||
if (Expected<StringRef> NameOrErr = Section.getName())
|
||||
Name = *NameOrErr;
|
||||
else
|
||||
consumeError(NameOrErr.takeError());
|
||||
|
||||
if ((!IsCOFF && Name == "__clangast") || (IsCOFF && Name == "clangast")) {
|
||||
if (Expected<StringRef> E = Section.getContents())
|
||||
return *E;
|
||||
|
||||
@@ -390,7 +390,10 @@ class ObjectFileHandler final : public FileHandler {
|
||||
static bool IsOffloadSection(SectionRef CurSection,
|
||||
StringRef &OffloadTriple) {
|
||||
StringRef SectionName;
|
||||
CurSection.getName(SectionName);
|
||||
if (Expected<StringRef> NameOrErr = CurSection.getName())
|
||||
SectionName = *NameOrErr;
|
||||
else
|
||||
consumeError(NameOrErr.takeError());
|
||||
|
||||
if (SectionName.empty())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user