Переглянути джерело

Use auto for parseBitcodeFile result. (#1816)

Xiang Li 6 роки тому
батько
коміт
48595a358c
1 змінених файлів з 2 додано та 3 видалено
  1. 2 3
      lib/DXIL/DxilUtil.cpp

+ 2 - 3
lib/DXIL/DxilUtil.cpp

@@ -192,9 +192,8 @@ std::unique_ptr<llvm::Module> LoadModuleFromBitcode(llvm::MemoryBuffer *MB,
   llvm::LLVMContext &Ctx,
   std::string &DiagStr) {
   // Note: the DiagStr is not used.
-  ErrorOr<std::unique_ptr<llvm::Module>> pModule(
-    llvm::parseBitcodeFile(MB->getMemBufferRef(), Ctx));
-  if (std::error_code ec = pModule.getError()) {
+  auto pModule = llvm::parseBitcodeFile(MB->getMemBufferRef(), Ctx);
+  if (!pModule) {
     return nullptr;
   }
   return std::unique_ptr<llvm::Module>(pModule.get().release());