Fix 5bb06c7cce6bdcffb3ced29fa733c0dbb1b63c41 build on windows.
authorAndrew Browne <browneee@google.com>
Mon, 12 Dec 2022 09:22:05 +0000 (01:22 -0800)
committerAndrew Browne <browneee@google.com>
Mon, 12 Dec 2022 09:23:34 +0000 (01:23 -0800)
```
C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\lib\Transforms\Instrumentation\DataFlowSanitizer.cpp(1062,37): error: call to constructor of 'llvm::APInt' is ambiguous
                                    llvm::APInt(32, dbgloc.getLine(), false));
                                    ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\include\llvm/ADT/APInt.h(108,3): note: candidate constructor
  APInt(unsigned numBits, uint64_t val, bool isSigned = false)
  ^
C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\include\llvm/ADT/APInt.h(134,3): note: candidate constructor
  APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
  ^
1 error generated.
```

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

index b62f150..d589624 100644 (file)
@@ -1054,12 +1054,12 @@ void DFSanFunction::addReachesFunctionCallbacksIfEnabled(IRBuilder<> &IRB,
   llvm::Value *FilePathPtr;
 
   if (dbgloc.get() == nullptr) {
-    CILine = llvm::ConstantInt::get(I.getContext(), llvm::APInt(32, 0, false));
+    CILine = llvm::ConstantInt::get(I.getContext(), llvm::APInt(32, 0));
     FilePathPtr = IRB.CreateGlobalStringPtr(
         I.getFunction()->getParent()->getSourceFileName());
   } else {
     CILine = llvm::ConstantInt::get(I.getContext(),
-                                    llvm::APInt(32, dbgloc.getLine(), false));
+                                    llvm::APInt(32, dbgloc.getLine()));
     FilePathPtr =
         IRB.CreateGlobalStringPtr(dbgloc->getFilename());
   }