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
14 changes: 13 additions & 1 deletion include/llvm/ADT/SparseBitVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,19 @@ struct ilist_traits<SparseBitVectorElement<ElementSize> >
: public ilist_default_traits<SparseBitVectorElement<ElementSize> > {
typedef SparseBitVectorElement<ElementSize> Element;

Element *createSentinel() const { return static_cast<Element *>(&Sentinel); }
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
Element *
createSentinel() const {
return static_cast<Element *>(&Sentinel);
}
static void destroySentinel(Element *) {}

Element *provideInitialHead() const { return createSentinel(); }
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/Analysis/IVUsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,17 @@ template<> struct ilist_traits<IVStrideUse>
// the list...
// The sentinel is relative to this instance, so we use a non-static
// method.
IVStrideUse *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
IVStrideUse *
createSentinel() const {
// since i(p)lists always publicly derive from the corresponding
// traits, placing a data member in this class will augment i(p)list.
// But since the NodeTy is expected to publicly derive from
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/CodeGen/MachineBasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> {
MachineBasicBlock* Parent;

public:
MachineInstr *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
MachineInstr *
createSentinel() const {
return static_cast<MachineInstr*>(&Sentinel);
}
void destroySentinel(MachineInstr *) const {}
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/CodeGen/MachineFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ struct ilist_traits<MachineBasicBlock>
: public ilist_default_traits<MachineBasicBlock> {
mutable ilist_half_node<MachineBasicBlock> Sentinel;
public:
MachineBasicBlock *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
MachineBasicBlock *
createSentinel() const {
return static_cast<MachineBasicBlock*>(&Sentinel);
}
void destroySentinel(MachineBasicBlock *) const {}
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/CodeGen/SelectionDAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,17 @@ template<> struct ilist_traits<SDNode> : public ilist_default_traits<SDNode> {
private:
mutable ilist_half_node<SDNode> Sentinel;
public:
SDNode *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
SDNode *
createSentinel() const {
return static_cast<SDNode*>(&Sentinel);
}
static void destroySentinel(SDNode *) {}
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/CodeGen/SlotIndexes.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,17 @@ namespace llvm {
private:
mutable ilist_half_node<IndexListEntry> Sentinel;
public:
IndexListEntry *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
IndexListEntry *
createSentinel() const {
return static_cast<IndexListEntry*>(&Sentinel);
}
void destroySentinel(IndexListEntry *) const {}
Expand Down
14 changes: 12 additions & 2 deletions include/llvm/IR/BasicBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,18 @@ class BasicBlock : public Value, // Basic blocks are data objects also

// createSentinel is used to get hold of the node that marks the end of the
// list... (same trick used here as in ilist_traits<Instruction>)
inline BasicBlock *ilist_traits<BasicBlock>::createSentinel() const {
return static_cast<BasicBlock*>(&Sentinel);
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
inline BasicBlock *
ilist_traits<BasicBlock>::createSentinel() const {
return static_cast<BasicBlock *>(&Sentinel);
}

// Create wrappers for C Binding types (see CBindingWrapping.h).
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/IR/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ class LLVMContext;
template<> struct ilist_traits<Argument>
: public SymbolTableListTraits<Argument, Function> {

Argument *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
Argument *
createSentinel() const {
return static_cast<Argument*>(&Sentinel);
}
static void destroySentinel(Argument*) {}
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/IR/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,17 @@ class Instruction : public User, public ilist_node<Instruction> {
Instruction *cloneImpl() const;
};

inline Instruction *ilist_traits<Instruction>::createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
inline Instruction *
ilist_traits<Instruction>::createSentinel() const {
// Since i(p)lists always publicly derive from their corresponding traits,
// placing a data member in this class will augment the i(p)list. But since
// the NodeTy is expected to be publicly derive from ilist_node<NodeTy>,
Expand Down
48 changes: 44 additions & 4 deletions include/llvm/IR/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ template<> struct ilist_traits<Function>

// createSentinel is used to get hold of the node that marks the end of the
// list... (same trick used here as in ilist_traits<Instruction>)
Function *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
Function *
createSentinel() const {
return static_cast<Function*>(&Sentinel);
}
static void destroySentinel(Function*) {}
Expand All @@ -62,7 +72,17 @@ template<> struct ilist_traits<Function>
template<> struct ilist_traits<GlobalVariable>
: public SymbolTableListTraits<GlobalVariable, Module> {
// createSentinel is used to create a node that marks the end of the list.
GlobalVariable *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
GlobalVariable *
createSentinel() const {
return static_cast<GlobalVariable*>(&Sentinel);
}
static void destroySentinel(GlobalVariable*) {}
Expand All @@ -77,7 +97,17 @@ template<> struct ilist_traits<GlobalVariable>
template<> struct ilist_traits<GlobalAlias>
: public SymbolTableListTraits<GlobalAlias, Module> {
// createSentinel is used to create a node that marks the end of the list.
GlobalAlias *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
GlobalAlias *
createSentinel() const {
return static_cast<GlobalAlias*>(&Sentinel);
}
static void destroySentinel(GlobalAlias*) {}
Expand All @@ -93,7 +123,17 @@ template<> struct ilist_traits<NamedMDNode>
: public ilist_default_traits<NamedMDNode> {
// createSentinel is used to get hold of a node that marks the end of
// the list...
NamedMDNode *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
NamedMDNode *
createSentinel() const {
return static_cast<NamedMDNode*>(&Sentinel);
}
static void destroySentinel(NamedMDNode*) {}
Expand Down
12 changes: 11 additions & 1 deletion include/llvm/Transforms/Utils/SymbolRewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,17 @@ struct ilist_traits<SymbolRewriter::RewriteDescriptor>
// createSentinel is used to get a reference to a node marking the end of
// the list. Because the sentinel is relative to this instance, use a
// non-static method.
SymbolRewriter::RewriteDescriptor *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
SymbolRewriter::RewriteDescriptor *
createSentinel() const {
// since i[p] lists always publicly derive from the corresponding
// traits, placing a data member in this class will augment the
// i[p]list. Since the NodeTy is expected to publicly derive from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,17 @@ class BugReport : public llvm::ilist_node<BugReport> {
namespace llvm {
template<> struct ilist_traits<clang::ento::BugReport>
: public ilist_default_traits<clang::ento::BugReport> {
clang::ento::BugReport *createSentinel() const {
// HLSL Change Starts
// Temporarily disable "downcast of address" UBSAN runtime error
// https://github.com/microsoft/DirectXShaderCompiler/issues/6446
#ifdef __has_feature
#if __has_feature(undefined_behavior_sanitizer)
__attribute__((no_sanitize("undefined")))
#endif // __has_feature(address_sanitizer)
#endif // defined(__has_feature)
// HLSL Change Ends
clang::ento::BugReport *
createSentinel() const {
return static_cast<clang::ento::BugReport *>(&Sentinel);
}
void destroySentinel(clang::ento::BugReport *) const {}
Expand Down