diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 430a57d7b4ec0..3306d90dc8566 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -485,7 +485,7 @@ MicrosoftMangleContextImpl::MicrosoftMangleContextImpl(ASTContext &Context, SourceManager &SM = Context.getSourceManager(); if (const FileEntry *FE = SM.getFileEntryForID(SM.getMainFileID())) { // Truncate the hash so we get 8 characters of hexadecimal. - uint32_t TruncatedHash = uint32_t(xxHash64(FE->getName())); + uint32_t TruncatedHash = uint32_t(xxh3_64bits(FE->getName())); AnonymousNamespaceHash = llvm::utohexstr(TruncatedHash); } else { // If we don't have a path to the main file, we'll just use 0. diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index b8d39371a9330..fab70b66d1d96 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -577,8 +577,8 @@ CodeGenFunction::getUBSanFunctionTypeHash(QualType Ty) const { std::string Mangled; llvm::raw_string_ostream Out(Mangled); CGM.getCXXABI().getMangleContext().mangleTypeName(Ty, Out, false); - return llvm::ConstantInt::get(CGM.Int32Ty, - static_cast(llvm::xxHash64(Mangled))); + return llvm::ConstantInt::get( + CGM.Int32Ty, static_cast(llvm::xxh3_64bits(Mangled))); } void CodeGenFunction::EmitKernelMetadata(const FunctionDecl *FD, diff --git a/clang/test/CodeGen/ubsan-function.cpp b/clang/test/CodeGen/ubsan-function.cpp index ba55ee021cc9d..1c281c8544578 100644 --- a/clang/test/CodeGen/ubsan-function.cpp +++ b/clang/test/CodeGen/ubsan-function.cpp @@ -17,7 +17,7 @@ void fun() {} // CHECK: [[LABEL1]]: // CHECK: getelementptr <{ i32, i32 }>, ptr {{.*}}, i32 -1, i32 1, !nosanitize // CHECK: load i32, ptr {{.*}}, align {{.*}}, !nosanitize -// CHECK: icmp eq i32 {{.*}}, -1522505972, !nosanitize +// CHECK: icmp eq i32 {{.*}}, 905068220, !nosanitize // CHECK: br i1 {{.*}}, label %[[LABEL3:.*]], label %[[LABEL2:[^,]*]], {{.*}}!nosanitize // CHECK: [[LABEL2]]: // 64: call void @__ubsan_handle_function_type_mismatch_abort(ptr @[[#]], i64 %[[#]]) #[[#]], !nosanitize @@ -32,4 +32,4 @@ void fun() {} // CHECK-NEXT: ret void void caller(void (*f)()) { f(); } -// CHECK: ![[FUNCSAN]] = !{i32 -1056584962, i32 -1522505972} +// CHECK: ![[FUNCSAN]] = !{i32 -1056584962, i32 905068220} diff --git a/clang/test/CodeGenCXX/catch-undef-behavior.cpp b/clang/test/CodeGenCXX/catch-undef-behavior.cpp index 9e4f0fb402c28..6fd7d16f86369 100644 --- a/clang/test/CodeGenCXX/catch-undef-behavior.cpp +++ b/clang/test/CodeGenCXX/catch-undef-behavior.cpp @@ -405,7 +405,7 @@ void indirect_function_call(void (*p)(int)) { // CalleeTypeHash check // CHECK: [[CalleeTypeHashPtr:%.+]] = getelementptr <{ i32, i32 }>, ptr [[PTR]], i32 -1, i32 1 // CHECK-NEXT: [[CalleeTypeHash:%.+]] = load i32, ptr [[CalleeTypeHashPtr]] - // CHECK-NEXT: [[CalleeTypeHashMatch:%.+]] = icmp eq i32 [[CalleeTypeHash]], 27004076 + // CHECK-NEXT: [[CalleeTypeHashMatch:%.+]] = icmp eq i32 [[CalleeTypeHash]], -1988405058 // CHECK-NEXT: br i1 [[CalleeTypeHashMatch]] p(42); @@ -740,4 +740,4 @@ void ThisAlign::this_align_lambda_2() { // CHECK: attributes [[NR_NUW]] = { noreturn nounwind } -// CHECK-FUNCSAN: ![[FUNCSAN]] = !{i32 -1056584962, i32 -1302768377} +// CHECK-FUNCSAN: ![[FUNCSAN]] = !{i32 -1056584962, i32 -1000226989}