[polly] r235868 - Fix PTXGenerator after raw_pwrite_stream has been introduced

Tobias Grosser tobias at grosser.es
Mon Apr 27 05:06:33 PDT 2015


Author: grosser
Date: Mon Apr 27 07:06:32 2015
New Revision: 235868

URL: http://llvm.org/viewvc/llvm-project?rev=235868&view=rev
Log:
Fix PTXGenerator after raw_pwrite_stream has been introduced

Without this patch Polly with GPGPU support enabled did not compile any more.

Modified:
    polly/trunk/lib/CodeGen/PTXGenerator.cpp

Modified: polly/trunk/lib/CodeGen/PTXGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/PTXGenerator.cpp?rev=235868&r1=235867&r2=235868&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/PTXGenerator.cpp (original)
+++ polly/trunk/lib/CodeGen/PTXGenerator.cpp Mon Apr 27 07:06:32 2015
@@ -19,6 +19,7 @@
 
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/ADT/SetVector.h"
+#include "llvm/ADT/SmallString.h"
 #include "llvm/Analysis/TargetLibraryInfo.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/Support/Debug.h"
@@ -566,19 +567,19 @@ static bool createASMAsString(Module *Ne
   PM.add(createTargetTransformInfoWrapperPass(Target.getTargetIRAnalysis()));
 
   {
-    raw_string_ostream NameROS(ASM);
-    formatted_raw_ostream FOS(NameROS);
+    SmallString<100> ASMSmall;
+    raw_svector_ostream NameROSSmall(ASMSmall);
 
     // Ask the target to add backend passes as necessary.
     int UseVerifier = true;
-    if (Target.addPassesToEmitFile(PM, FOS, TargetMachine::CGFT_AssemblyFile,
-                                   UseVerifier)) {
+    if (Target.addPassesToEmitFile(
+            PM, NameROSSmall, TargetMachine::CGFT_AssemblyFile, UseVerifier)) {
       errs() << "The target does not support generation of this file type!\n";
       return false;
     }
 
+    ASM = ASMSmall.c_str();
     PM.run(*New);
-    FOS.flush();
   }
 
   return true;





More information about the llvm-commits mailing list