[llvm] 11dd508 - NFC. Clang-formatting.
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 09:51:18 PDT 2022
Author: Chris Bieneman
Date: 2022-05-24T11:51:00-05:00
New Revision: 11dd508bd43d606b8a2f52f4d0cf7471f78aca16
URL: https://github.com/llvm/llvm-project/commit/11dd508bd43d606b8a2f52f4d0cf7471f78aca16
DIFF: https://github.com/llvm/llvm-project/commit/11dd508bd43d606b8a2f52f4d0cf7471f78aca16.diff
LOG: NFC. Clang-formatting.
Since the rest of the DirectX backend is pretty well clang-format
clean, this file should be too.
Added:
Modified:
llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
index 1dbfafe87d553..260242ebeb62d 100644
--- a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
+++ b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
@@ -122,9 +122,8 @@ class DXILBitcodeWriter {
/// writing to the provided \p Buffer.
DXILBitcodeWriter(const Module &M, SmallVectorImpl<char> &Buffer,
StringTableBuilder &StrtabBuilder, BitstreamWriter &Stream)
- : Stream(Stream), StrtabBuilder(StrtabBuilder), M(M),
- VE(M, true), Buffer(Buffer),
- BitcodeStartBit(Stream.GetCurrentBitNo()) {
+ : Stream(Stream), StrtabBuilder(StrtabBuilder), M(M), VE(M, true),
+ Buffer(Buffer), BitcodeStartBit(Stream.GetCurrentBitNo()) {
GlobalValueId = VE.getValues().size();
}
@@ -342,7 +341,8 @@ using namespace llvm::dxil;
/// Begin dxil::BitcodeWriter Implementation
////////////////////////////////////////////////////////////////////////////////
-dxil::BitcodeWriter::BitcodeWriter(SmallVectorImpl<char> &Buffer, raw_fd_stream *FS)
+dxil::BitcodeWriter::BitcodeWriter(SmallVectorImpl<char> &Buffer,
+ raw_fd_stream *FS)
: Buffer(Buffer), Stream(new BitstreamWriter(Buffer, FS, 512)) {
// Emit the file header.
Stream->Emit((unsigned)'B', 8);
@@ -794,29 +794,40 @@ unsigned DXILBitcodeWriter::getEncodedLinkage(const GlobalValue &GV) {
unsigned DXILBitcodeWriter::getEncodedVisibility(const GlobalValue &GV) {
switch (GV.getVisibility()) {
- case GlobalValue::DefaultVisibility: return 0;
- case GlobalValue::HiddenVisibility: return 1;
- case GlobalValue::ProtectedVisibility: return 2;
+ case GlobalValue::DefaultVisibility:
+ return 0;
+ case GlobalValue::HiddenVisibility:
+ return 1;
+ case GlobalValue::ProtectedVisibility:
+ return 2;
}
llvm_unreachable("Invalid visibility");
}
unsigned DXILBitcodeWriter::getEncodedDLLStorageClass(const GlobalValue &GV) {
switch (GV.getDLLStorageClass()) {
- case GlobalValue::DefaultStorageClass: return 0;
- case GlobalValue::DLLImportStorageClass: return 1;
- case GlobalValue::DLLExportStorageClass: return 2;
+ case GlobalValue::DefaultStorageClass:
+ return 0;
+ case GlobalValue::DLLImportStorageClass:
+ return 1;
+ case GlobalValue::DLLExportStorageClass:
+ return 2;
}
llvm_unreachable("Invalid DLL storage class");
}
unsigned DXILBitcodeWriter::getEncodedThreadLocalMode(const GlobalValue &GV) {
switch (GV.getThreadLocalMode()) {
- case GlobalVariable::NotThreadLocal: return 0;
- case GlobalVariable::GeneralDynamicTLSModel: return 1;
- case GlobalVariable::LocalDynamicTLSModel: return 2;
- case GlobalVariable::InitialExecTLSModel: return 3;
- case GlobalVariable::LocalExecTLSModel: return 4;
+ case GlobalVariable::NotThreadLocal:
+ return 0;
+ case GlobalVariable::GeneralDynamicTLSModel:
+ return 1;
+ case GlobalVariable::LocalDynamicTLSModel:
+ return 2;
+ case GlobalVariable::InitialExecTLSModel:
+ return 3;
+ case GlobalVariable::LocalExecTLSModel:
+ return 4;
}
llvm_unreachable("Invalid TLS model");
}
More information about the llvm-commits
mailing list