[PATCH] Remove nasty environment variables in MachineVerifier in	favor of a build option
    Chandler Carruth 
    chandlerc at gmail.com
       
    Mon Feb  2 22:05:04 PST 2015
    
    
  
So, I have no problem with this patch or this design. It seems like a nice cleanup.
However, I'll float another idea:
What about adding a getenv call to lit (and maybe a flag) to flip this flag? No rebuild required, etc. Thoughts?
REPOSITORY
  rL LLVM
================
Comment at: lib/CodeGen/MachineVerifier.cpp:278
@@ -279,17 +277,3 @@
 bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) {
-  raw_ostream *OutFile = nullptr;
-  if (OutFileName) {
-    std::error_code EC;
-    OutFile = new raw_fd_ostream(OutFileName, EC,
-                                 sys::fs::F_Append | sys::fs::F_Text);
-    if (EC) {
-      errs() << "Error opening '" << OutFileName << "': " << EC.message()
-             << '\n';
-      exit(1);
-    }
-
-    OS = OutFile;
-  } else {
-    OS = &errs();
-  }
+  OS = &errs();
 
----------------
Why not just set this in the constructor (perhaps from a defaulted argument)? It can also be a reference then.
http://reviews.llvm.org/D7365
EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
    
    
More information about the llvm-commits
mailing list