Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 42 additions & 40 deletions include/dxc/Support/SPIRVOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,40 @@ enum class SpirvLayoutRule {

struct SpirvCodeGenOptions {
/// Disable legalization and optimization and emit raw SPIR-V
bool codeGenHighLevel;
bool debugInfoFile;
bool debugInfoLine;
bool debugInfoSource;
bool debugInfoTool;
bool debugInfoRich;
bool codeGenHighLevel = false;
bool debugInfoFile = false;
bool debugInfoLine = false;
bool debugInfoSource = false;
bool debugInfoTool = false;
bool debugInfoRich = false;
/// Use NonSemantic.Vulkan.DebugInfo.100 debug info instead of
/// OpenCL.DebugInfo.100
bool debugInfoVulkan;
bool defaultRowMajor;
bool disableValidation;
bool enable16BitTypes;
bool finiteMathOnly;
bool enableReflect;
bool invertY; // Additive inverse
bool invertW; // Multiplicative inverse
bool noWarnEmulatedFeatures;
bool noWarnIgnoredFeatures;
bool preserveBindings;
bool preserveInterface;
bool useDxLayout;
bool useGlLayout;
bool useLegacyBufferMatrixOrder;
bool useScalarLayout;
bool flattenResourceArrays;
bool reduceLoadSize;
bool autoShiftBindings;
bool supportNonzeroBaseInstance;
bool supportNonzeroBaseVertex;
bool fixFuncCallArguments;
bool enableMaximalReconvergence;
bool useVulkanMemoryModel;
bool useUnknownImageFormat;
bool IEEEStrict;
bool debugInfoVulkan = false;
bool defaultRowMajor = false;
bool disableValidation = false;
bool enable16BitTypes = false;
bool finiteMathOnly = false;
bool enableReflect = false;
bool invertY = false; // Additive inverse
bool invertW = false; // Multiplicative inverse
bool noWarnEmulatedFeatures = false;
bool noWarnIgnoredFeatures = false;
bool preserveBindings = false;
bool preserveInterface = false;
bool useDxLayout = false;
bool useGlLayout = false;
bool useLegacyBufferMatrixOrder = false;
bool useScalarLayout = false;
bool flattenResourceArrays = false;
bool reduceLoadSize = false;
bool autoShiftBindings = false;
bool supportNonzeroBaseInstance = false;
bool supportNonzeroBaseVertex = false;
bool fixFuncCallArguments = false;
bool enableMaximalReconvergence = false;
bool useVulkanMemoryModel = false;
bool useUnknownImageFormat = false;
bool IEEEStrict = false;
/// Maximum length in words for the OpString literal containing the shader
/// source for DebugSource and DebugSourceContinued. If the source code length
/// is larger than this number, we will use DebugSourceContinued instructions
Expand All @@ -81,14 +81,14 @@ struct SpirvCodeGenOptions {
/// limitation of a single SPIR-V instruction size (0xFFFF) - 2 operand words
/// for OpString. Currently a smaller value is only used to test
/// DebugSourceContinued generation.
uint32_t debugSourceLen;
SpirvLayoutRule cBufferLayoutRule;
SpirvLayoutRule sBufferLayoutRule;
SpirvLayoutRule tBufferLayoutRule;
SpirvLayoutRule ampPayloadLayoutRule;
uint32_t debugSourceLen = 0;
SpirvLayoutRule cBufferLayoutRule = SpirvLayoutRule::Void;
SpirvLayoutRule sBufferLayoutRule = SpirvLayoutRule::Void;
SpirvLayoutRule tBufferLayoutRule = SpirvLayoutRule::Void;
SpirvLayoutRule ampPayloadLayoutRule = SpirvLayoutRule::Void;
llvm::StringRef stageIoOrder;
llvm::StringRef targetEnv;
uint32_t maxId;
uint32_t maxId = 0;
llvm::SmallVector<int32_t, 4> bShift;
llvm::SmallVector<int32_t, 4> sShift;
llvm::SmallVector<int32_t, 4> tShift;
Expand All @@ -109,9 +109,11 @@ struct SpirvCodeGenOptions {
std::optional<BindingInfo> samplerHeapBinding;
std::optional<BindingInfo> counterHeapBinding;

bool signaturePacking; ///< Whether signature packing is enabled or not
bool signaturePacking =
false; ///< Whether signature packing is enabled or not

bool printAll; // Dump SPIR-V module before each pass and after the last one.
bool printAll =
false; // Dump SPIR-V module before each pass and after the last one.

// String representation of all command line options and input file.
std::string clOptions;
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/ADT/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class Triple {
ArchType Arch;

/// The parsed subarchitecture type.
SubArchType SubArch;
SubArchType SubArch = NoSubArch;

/// The parsed vendor type.
VendorType Vendor;
Expand Down
10 changes: 6 additions & 4 deletions lib/Support/APInt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,10 @@ bool APInt::ult(const APInt& RHS) const {
bool APInt::slt(const APInt& RHS) const {
assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
if (isSingleWord()) {
int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth);
int64_t lhsSext =
int64_t(uint64_t(VAL) << (64 - BitWidth)) >> (64 - BitWidth);
int64_t rhsSext =
int64_t(uint64_t(RHS.VAL) << (64 - BitWidth)) >> (64 - BitWidth);
return lhsSext < rhsSext;
}

Expand Down Expand Up @@ -1061,8 +1063,8 @@ APInt APInt::ashr(unsigned shiftAmt) const {
return APInt(BitWidth, 0); // undefined
else {
unsigned SignBit = APINT_BITS_PER_WORD - BitWidth;
return APInt(BitWidth,
(((int64_t(VAL) << SignBit) >> SignBit) >> shiftAmt));
return APInt(BitWidth, (((int64_t(uint64_t(VAL) << SignBit) >> SignBit) >>
shiftAmt)));
}
}

Expand Down
5 changes: 3 additions & 2 deletions lib/Support/MemoryBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ MemoryBuffer::getMemBufferCopy(StringRef InputData, const Twine &BufferName) {
getNewUninitMemBuffer(InputData.size(), BufferName);
if (!Buf)
return nullptr;
memcpy(const_cast<char*>(Buf->getBufferStart()), InputData.data(),
InputData.size());
if (InputData.size())
memcpy(const_cast<char *>(Buf->getBufferStart()), InputData.data(),
InputData.size());
return Buf;
}

Expand Down
7 changes: 5 additions & 2 deletions tools/clang/include/clang/Basic/VirtualFileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ class Status {
llvm::sys::fs::perms Perms;

public:
bool IsVFSMapped; // FIXME: remove when files support multiple names
bool IsVFSMapped = false; // FIXME: remove when files support multiple names

public:
Status() : Type(llvm::sys::fs::file_type::status_error) {}
Status()
: User(0), Group(0), Size(0),
Type(llvm::sys::fs::file_type::status_error),
Perms(llvm::sys::fs::perms_not_known) {}
Status(const llvm::sys::fs::file_status &Status);
Status(StringRef Name, StringRef RealName, llvm::sys::fs::UniqueID UID,
llvm::sys::TimeValue MTime, uint32_t User, uint32_t Group,
Expand Down
2 changes: 1 addition & 1 deletion tools/clang/include/clang/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class FrontendInputFile {
bool IsSystem;

public:
FrontendInputFile() : Buffer(nullptr), Kind(IK_None) { }
FrontendInputFile() : Buffer(nullptr), Kind(IK_None), IsSystem(false) {}
FrontendInputFile(StringRef File, InputKind Kind, bool IsSystem = false)
: File(File.str()), Buffer(nullptr), Kind(Kind), IsSystem(IsSystem) { }
FrontendInputFile(llvm::MemoryBuffer *buffer, InputKind Kind,
Expand Down
2 changes: 1 addition & 1 deletion tools/clang/include/clang/Sema/Lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ class LookupResult {

// Results.
LookupResultKind ResultKind;
AmbiguityKind Ambiguity; // ill-defined unless ambiguous
AmbiguityKind Ambiguity = {}; // ill-defined unless ambiguous
UnresolvedSet<8> Decls;
CXXBasePaths *Paths;
CXXRecordDecl *NamingClass;
Expand Down