Skip to content
Merged
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
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/FunctionExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
void *StoragePtr;
size_t Size;
size_t Alignment;
} OutOfLineStorage;
} OutOfLineStorage = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: i'm still not sure what will this do (hopefully, zero-initialize) but whatever. if it silences the things, sure.

I would've done this though:

    struct OutOfLineStorageT {
      void *StoragePtr = nullptr;
      size_t Size = 0;
      size_t Alignment = 0;
    } OutOfLineStorage = {};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as void* and size_t are primitive types, {} should initialize them with zero, yes

static_assert(
sizeof(OutOfLineStorageT) <= InlineStorageSize,
"Should always use all of the out-of-line storage for inline storage!");
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/FormatProviders.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct format_provider<
private:
public:
static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
HexPrintStyle HS;
HexPrintStyle HS = HexPrintStyle::PrefixUpper;
size_t Digits = 0;
if (consumeHexStyle(Style, HS)) {
Digits = consumeNumHexDigits(Style, HS, 0);
Expand Down