r210059 - Fix -emit-codegen-only to not generate binaries
Alp Toker
alp at nuanti.com
Mon Jun 2 19:14:20 PDT 2014
Author: alp
Date: Mon Jun 2 21:14:20 2014
New Revision: 210059
URL: http://llvm.org/viewvc/llvm-project?rev=210059&view=rev
Log:
Fix -emit-codegen-only to not generate binaries
Added:
cfe/trunk/test/Frontend/disable-output.c
Modified:
cfe/trunk/lib/CodeGen/CodeGenAction.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=210059&r1=210058&r2=210059&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Mon Jun 2 21:14:20 2014
@@ -568,6 +568,7 @@ static raw_ostream *GetOutputStream(Comp
case Backend_EmitNothing:
return nullptr;
case Backend_EmitMCNull:
+ return new raw_null_ostream();
case Backend_EmitObj:
return CI.createDefaultOutputFile(true, InFile, "o");
}
Added: cfe/trunk/test/Frontend/disable-output.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/disable-output.c?rev=210059&view=auto
==============================================================================
--- cfe/trunk/test/Frontend/disable-output.c (added)
+++ cfe/trunk/test/Frontend/disable-output.c Mon Jun 2 21:14:20 2014
@@ -0,0 +1,7 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-apple-darwin -o %t
+// RUN: not rm %t
+// RUN: %clang_cc1 %s -emit-codegen-only -triple=i386-apple-darwin -o %t
+// RUN: not rm %t
+
+// Test that output is not generated when emission is disabled.
More information about the cfe-commits
mailing list