[llvm] c4dad9a - [DirectX] Fix BitcodeWriter ctor after #92983
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 14:22:54 PDT 2024
Author: Fangrui Song
Date: 2024-05-30T14:22:50-07:00
New Revision: c4dad9a6b6dd048b4a8d771864ff905cbc2467af
URL: https://github.com/llvm/llvm-project/commit/c4dad9a6b6dd048b4a8d771864ff905cbc2467af
DIFF: https://github.com/llvm/llvm-project/commit/c4dad9a6b6dd048b4a8d771864ff905cbc2467af.diff
LOG: [DirectX] Fix BitcodeWriter ctor after #92983
Added:
Modified:
llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
index 87297ac86b9d2..bc7637a3e3def 100644
--- a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
+++ b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
@@ -369,9 +369,8 @@ using namespace llvm::dxil;
/// Begin dxil::BitcodeWriter Implementation
////////////////////////////////////////////////////////////////////////////////
-dxil::BitcodeWriter::BitcodeWriter(SmallVectorImpl<char> &Buffer,
- raw_fd_stream *FS)
- : Buffer(Buffer), Stream(new BitstreamWriter(Buffer, FS, 512)) {
+dxil::BitcodeWriter::BitcodeWriter(SmallVectorImpl<char> &Buffer)
+ : Buffer(Buffer), Stream(new BitstreamWriter(Buffer)) {
// Emit the file header.
Stream->Emit((unsigned)'B', 8);
Stream->Emit((unsigned)'C', 8);
@@ -394,7 +393,7 @@ void dxil::WriteDXILToFile(const Module &M, raw_ostream &Out) {
if (TT.isOSDarwin() || TT.isOSBinFormatMachO())
Buffer.insert(Buffer.begin(), BWH_HeaderSize, 0);
- BitcodeWriter Writer(Buffer, dyn_cast<raw_fd_stream>(&Out));
+ BitcodeWriter Writer(Buffer);
Writer.writeModule(M);
// Write the generated bitstream to "Out".
diff --git a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h
index cbf21485fb016..8707b084f5465 100644
--- a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h
+++ b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h
@@ -47,7 +47,7 @@ class BitcodeWriter {
public:
/// Create a BitcodeWriter that writes to Buffer.
- BitcodeWriter(SmallVectorImpl<char> &Buffer, raw_fd_stream *FS = nullptr);
+ BitcodeWriter(SmallVectorImpl<char> &Buffer);
~BitcodeWriter();
More information about the llvm-commits
mailing list