From 52d4fabea811bf965104a5f6e8f22a55f08b1f03 Mon Sep 17 00:00:00 2001 From: Artem Belevich Date: Fri, 5 Oct 2018 18:39:58 +0000 Subject: [PATCH] [CUDA] Use all 64 bits of GUID in __nv_module_id getGUID() returns an uint64_t and "%x" only prints 32 bits of it. Use PRIx64 format string to print all 64 bits. Differential Revision: https://reviews.llvm.org/D52938 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343875 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCUDANV.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/CGCUDANV.cpp b/lib/CodeGen/CGCUDANV.cpp index d76076326e..1c578bd151 100644 --- a/lib/CodeGen/CGCUDANV.cpp +++ b/lib/CodeGen/CGCUDANV.cpp @@ -520,7 +520,7 @@ llvm::Function *CGNVCUDARuntime::makeModuleCtorFunction() { // Generate a unique module ID. SmallString<64> ModuleID; llvm::raw_svector_ostream OS(ModuleID); - OS << ModuleIDPrefix << llvm::format("%x", FatbinWrapper->getGUID()); + OS << ModuleIDPrefix << llvm::format("%" PRIx64, FatbinWrapper->getGUID()); llvm::Constant *ModuleIDConstant = makeConstantString(ModuleID.str(), "", ModuleIDSectionName, 32); -- 2.40.0