[PATCH] D139556: [NFC][Object] Include header `BitcodeReader.h` instead of using forward declaration for BitcodeModule

Shilei Tian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 10:45:53 PST 2022


tianshilei1992 created this revision.
tianshilei1992 added reviewers: mehdi_amini, pcc, tejohnson.
Herald added a project: All.
tianshilei1992 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

`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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139556

Files:
  llvm/include/llvm/Object/IRObjectFile.h


Index: llvm/include/llvm/Object/IRObjectFile.h
===================================================================
--- llvm/include/llvm/Object/IRObjectFile.h
+++ llvm/include/llvm/Object/IRObjectFile.h
@@ -13,12 +13,12 @@
 #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 @@
 
 }
 
-}
+} // namespace llvm
 
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139556.480974.patch
Type: text/x-patch
Size: 594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/85a187b4/attachment.bin>


More information about the llvm-commits mailing list