Skip to content

Commit 91bd6bd

Browse files
committed
clang-format
1 parent 1ef2ac5 commit 91bd6bd

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -817,18 +817,16 @@ MemorySanitizer::getOrInsertMsanMetadataFunction(Module &M, StringRef Name,
817817
std::forward<ArgsTy>(Args)...);
818818
}
819819

820-
StringRef getWarningFnName(bool TrackOrigins, bool Recover, bool EmbedFaultingInst) {
821-
StringRef warningFnName [2][2][2]
822-
= {
823-
{
824-
{"__msan_warning_noreturn", "__msan_warning_noreturn_instname"},
825-
{"__msan_warning", "__msan_warning_instname"}
826-
},
827-
{
828-
{"__msan_warning_with_origin_noreturn", "__msan_warning_with_origin_noreturn_instname"},
829-
{"__msan_warning_with_origin", "__msan_warning_with_origin_instname"},
830-
}
831-
};
820+
StringRef getWarningFnName(bool TrackOrigins, bool Recover,
821+
bool EmbedFaultingInst) {
822+
StringRef warningFnName[2][2][2] = {
823+
{{"__msan_warning_noreturn", "__msan_warning_noreturn_instname"},
824+
{"__msan_warning", "__msan_warning_instname"}},
825+
{
826+
{"__msan_warning_with_origin_noreturn",
827+
"__msan_warning_with_origin_noreturn_instname"},
828+
{"__msan_warning_with_origin", "__msan_warning_with_origin_instname"},
829+
}};
832830

833831
return warningFnName[TrackOrigins][Recover][EmbedFaultingInst];
834832
}
@@ -847,7 +845,9 @@ void MemorySanitizer::createKernelApi(Module &M, const TargetLibraryInfo &TLI) {
847845
VAArgOverflowSizeTLS = nullptr;
848846

849847
SmallVector<Type *, 4> ArgsTy = {IRB.getInt32Ty()};
850-
StringRef FnName = getWarningFnName(/*TrackOrigins=*/ false, /*Recover=*/ true, ClEmbedFaultingInst != MSanEmbedFaultingInstructionMode::None);
848+
StringRef FnName = getWarningFnName(
849+
/*TrackOrigins=*/false, /*Recover=*/true,
850+
ClEmbedFaultingInst != MSanEmbedFaultingInstructionMode::None);
851851
if (ClEmbedFaultingInst != MSanEmbedFaultingInstructionMode::None)
852852
ArgsTy.push_back(IRB.getPtrTy());
853853
WarningFn = M.getOrInsertFunction(
@@ -907,10 +907,12 @@ void MemorySanitizer::createUserspaceApi(Module &M,
907907
// Create the callback.
908908
// FIXME: this function should have "Cold" calling conv,
909909
// which is not yet implemented.
910-
StringRef WarningFnName = getWarningFnName(TrackOrigins, Recover, ClEmbedFaultingInst != MSanEmbedFaultingInstructionMode::None);
910+
StringRef WarningFnName = getWarningFnName(
911+
TrackOrigins, Recover,
912+
ClEmbedFaultingInst != MSanEmbedFaultingInstructionMode::None);
911913
SmallVector<Type *, 4> ArgsTy = {};
912914
if (TrackOrigins) {
913-
ArgsTy.push_back (IRB.getInt32Ty());
915+
ArgsTy.push_back(IRB.getInt32Ty());
914916
if (ClEmbedFaultingInst != MSanEmbedFaultingInstructionMode::None)
915917
ArgsTy.push_back(IRB.getPtrTy());
916918
WarningFn = M.getOrInsertFunction(

0 commit comments

Comments
 (0)