summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMarcos Pividori <mpividori@google.com>2017-01-30 18:14:53 +0000
committerMarcos Pividori <mpividori@google.com>2017-01-30 18:14:53 +0000
commitd2406ea900faa58bf4d585724407a150cb073215 (patch)
treee053800aa86cca6ee391beed6daeeefd4d664908 /llvm/lib
parenta53a72243a8b3de35483aa2bd526369b9eaf8e21 (diff)
downloadbcm5719-llvm-d2406ea900faa58bf4d585724407a150cb073215.tar.gz
bcm5719-llvm-d2406ea900faa58bf4d585724407a150cb073215.zip
[libFuzzer] Implement TmpDir() for Windows.
Differential Revision: https://reviews.llvm.org/D28977 llvm-svn: 293516
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Fuzzer/FuzzerIOWindows.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
index 84941bae28f..536e1306725 100644
--- a/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
+++ b/llvm/lib/Fuzzer/FuzzerIOWindows.cpp
@@ -287,7 +287,17 @@ std::string DirName(const std::string &FileName) {
return FileName.substr(0, LocationLen + DirLen);
}
-std::string TmpDir() { return "TODO: implement TmpDir"; }
+std::string TmpDir() {
+ std::string Tmp;
+ Tmp.resize(MAX_PATH + 1);
+ DWORD Size = GetTempPathA(Tmp.size(), &Tmp[0]);
+ if (Size == 0) {
+ Printf("Couldn't get Tmp path.\n");
+ exit(1);
+ }
+ Tmp.resize(Size);
+ return Tmp;
+}
bool IsInterestingCoverageFile(const std::string &FileName) {
if (FileName.find("Program Files") != std::string::npos)
OpenPOWER on IntegriCloud