[X86][PKU] Add {RD,WR}PKRU encoding
[oota-llvm.git] / include / llvm / Object / COFFImportFile.h
index 603a0cdfe5d1f52fe183d9d831e0946df76ba6f3..b04a44ea60d2a9f952cda1279c3216dab579efea 100644 (file)
@@ -37,7 +37,7 @@ public:
 
   std::error_code printSymbolName(raw_ostream &OS,
                                   DataRefImpl Symb) const override {
-    if (Symb.p == 1)
+    if (Symb.p == 0)
       OS << "__imp_";
     OS << StringRef(Data.getBufferStart() + sizeof(coff_import_header));
     return std::error_code();
@@ -57,11 +57,14 @@ public:
     return BasicSymbolRef(Symb, this);
   }
 
+  const coff_import_header *getCOFFImportHeader() const {
+    return reinterpret_cast<const object::coff_import_header *>(
+        Data.getBufferStart());
+  }
+
 private:
   bool isCode() const {
-    auto *Import = reinterpret_cast<const object::coff_import_header *>(
-        Data.getBufferStart());
-    return Import->getType() == COFF::IMPORT_CODE;
+    return getCOFFImportHeader()->getType() == COFF::IMPORT_CODE;
   }
 };