[NFC][Object] Include header `BitcodeReader.h` instead of using forward declaration...
authorShilei Tian <i@tianshilei.me>
Wed, 7 Dec 2022 20:28:20 +0000 (15:28 -0500)
committerShilei Tian <i@tianshilei.me>
Wed, 7 Dec 2022 20:32:04 +0000 (15:32 -0500)
`BitcodeModule` is used as element of a vector in `IRSymtabFile`, while in the
header there is only a forward declaration. It will work if the header `BitcodeReader.h`
is included before including `IRObjectFile.h`. However, it is not always the case,
causing compilation error. This patch simply includes the header and remove the
forward declaration.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D139556

llvm/include/llvm/Object/IRObjectFile.h

index 6b3f2cd..ee99110 100644 (file)
 #ifndef LLVM_OBJECT_IROBJECTFILE_H
 #define LLVM_OBJECT_IROBJECTFILE_H
 
+#include "llvm/Bitcode/BitcodeReader.h"
 #include "llvm/Object/IRSymtab.h"
 #include "llvm/Object/ModuleSymbolTable.h"
 #include "llvm/Object/SymbolicFile.h"
 
 namespace llvm {
-class BitcodeModule;
 class Module;
 
 namespace object {
@@ -82,6 +82,6 @@ Expected<IRSymtabFile> readIRSymtab(MemoryBufferRef MBRef);
 
 }
 
-}
+} // namespace llvm
 
 #endif