File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,7 @@ class GlobalValue : public Constant {
360
360
// storage is shared between `G1` and `G2`.
361
361
void setSanitizerMetadata (SanitizerMetadata Meta);
362
362
void removeSanitizerMetadata ();
363
+ void setNoSanitizeMetadata ();
363
364
364
365
bool isTagged () const {
365
366
return hasSanitizerMetadata () && getSanitizerMetadata ().Memtag ;
Original file line number Diff line number Diff line change @@ -221,6 +221,12 @@ class IRBuilderBase {
221
221
AddOrRemoveMetadataToCopy (LLVMContext::MD_dbg, L.getAsMDNode ());
222
222
}
223
223
224
+ // / Set nosanitize metadata.
225
+ void SetNoSanitizeMetadata () {
226
+ AddOrRemoveMetadataToCopy (llvm::LLVMContext::MD_nosanitize,
227
+ llvm::MDNode::get (getContext (), std::nullopt));
228
+ }
229
+
224
230
// / Collect metadata with IDs \p MetadataKinds from \p Src which should be
225
231
// / added to all created instructions. Entries present in MedataDataToCopy but
226
232
// / not on \p Src will be dropped from MetadataToCopy.
Original file line number Diff line number Diff line change @@ -243,6 +243,13 @@ void GlobalValue::removeSanitizerMetadata() {
243
243
HasSanitizerMetadata = false ;
244
244
}
245
245
246
+ void GlobalValue::setNoSanitizeMetadata () {
247
+ SanitizerMetadata Meta;
248
+ Meta.NoAddress = true ;
249
+ Meta.NoHWAddress = true ;
250
+ setSanitizerMetadata (Meta);
251
+ }
252
+
246
253
StringRef GlobalObject::getSectionImpl () const {
247
254
assert (hasSection ());
248
255
return getContext ().pImpl ->GlobalObjectSections [this ];
You can’t perform that action at this time.
0 commit comments