[llvm] r338614 - Try to fix FreeBSD build.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 11:44:12 PDT 2018


Author: zturner
Date: Wed Aug  1 11:44:12 2018
New Revision: 338614

URL: http://llvm.org/viewvc/llvm-project?rev=338614&view=rev
Log:
Try to fix FreeBSD build.

It seems like perhaps because cstdio isn't directly included, the
compiler is accidentally picking up wprintf from somewhere else
and trying to call that.  Hopefully this fixes it.

Modified:
    llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp

Modified: llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp?rev=338614&r1=338613&r2=338614&view=diff
==============================================================================
--- llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp (original)
+++ llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp Wed Aug  1 11:44:12 2018
@@ -21,6 +21,7 @@
 #include "Utility.h"
 
 #include <cctype>
+#include <cstdio>
 #include <tuple>
 
 // This memory allocator is extremely fast, but it doesn't call dtors
@@ -2049,8 +2050,8 @@ void Demangler::output(const Symbol *S,
 }
 
 void Demangler::dumpBackReferences() {
-  printf("%d function parameter backreferences\n",
-         (int)FunctionParamBackRefCount);
+  std::printf("%d function parameter backreferences\n",
+              (int)FunctionParamBackRefCount);
 
   // Create an output stream so we can render each type.
   OutputStream OS = OutputStream::create(nullptr, 0, 1024);
@@ -2061,20 +2062,20 @@ void Demangler::dumpBackReferences() {
     Type::outputPre(OS, *T);
     Type::outputPost(OS, *T);
 
-    printf("  [%d] - %*s\n", (int)I, (int)OS.getCurrentPosition(),
-           OS.getBuffer());
+    std::printf("  [%d] - %*s\n", (int)I, (int)OS.getCurrentPosition(),
+                OS.getBuffer());
   }
   std::free(OS.getBuffer());
 
   if (FunctionParamBackRefCount > 0)
-    printf("\n");
-  printf("%d name backreferences\n", (int)BackRefCount);
+    std::printf("\n");
+  std::printf("%d name backreferences\n", (int)BackRefCount);
   for (size_t I = 0; I < BackRefCount; ++I) {
-    printf("  [%d] - %*s\n", (int)I, (int)BackReferences[I].size(),
-           BackReferences[I].begin());
+    std::printf("  [%d] - %*s\n", (int)I, (int)BackReferences[I].size(),
+                BackReferences[I].begin());
   }
   if (BackRefCount > 0)
-    printf("\n");
+    std::printf("\n");
 }
 
 char *llvm::microsoftDemangle(const char *MangledName, char *Buf, size_t *N,




More information about the llvm-commits mailing list