[llvm] 7ec057f - [NFC][Object] Include header `BitcodeReader.h` instead of using forward declaration for BitcodeModule
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 12:32:09 PST 2022
Author: Shilei Tian
Date: 2022-12-07T15:32:04-05:00
New Revision: 7ec057ff4a0662fea834af607b48d39b490c0aa0
URL: https://github.com/llvm/llvm-project/commit/7ec057ff4a0662fea834af607b48d39b490c0aa0
DIFF: https://github.com/llvm/llvm-project/commit/7ec057ff4a0662fea834af607b48d39b490c0aa0.diff
LOG: [NFC][Object] Include header `BitcodeReader.h` instead of using forward declaration for BitcodeModule
`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
Added:
Modified:
llvm/include/llvm/Object/IRObjectFile.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Object/IRObjectFile.h b/llvm/include/llvm/Object/IRObjectFile.h
index 6b3f2cd5671c0..ee9911025a17b 100644
--- a/llvm/include/llvm/Object/IRObjectFile.h
+++ b/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 @@ Expected<IRSymtabFile> readIRSymtab(MemoryBufferRef MBRef);
}
-}
+} // namespace llvm
#endif
More information about the llvm-commits
mailing list