[PATCH] D17405: Use Backend_EmitMCNull for null codegen unit tests.

David L. Jones via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 11:49:34 PST 2016


dlj created this revision.
dlj added a subscriber: cfe-commits.

Using Backend_EmitLL attemps to create a file with an empty filename.
This is problematic in certain environments: an empty filename may be
illegal, or the default output path may not be writable (in the case
where an empty filename would otherwise have some non-failing
semantics). This patch switches to use Backend_EmitMCNull, which
allows CodeGen to run, but does not attempt to create or write an
output file.

http://reviews.llvm.org/D17405

Files:
  unittests/Frontend/CodeGenActionTest.cpp

Index: unittests/Frontend/CodeGenActionTest.cpp
===================================================================
--- unittests/Frontend/CodeGenActionTest.cpp
+++ unittests/Frontend/CodeGenActionTest.cpp
@@ -26,7 +26,7 @@
 class NullCodeGenAction : public CodeGenAction {
 public:
   NullCodeGenAction(llvm::LLVMContext *_VMContext = nullptr)
-    : CodeGenAction(Backend_EmitLL, _VMContext) {}
+    : CodeGenAction(Backend_EmitMCNull, _VMContext) {}
 
   // The action does not call methods of ATContext.
   void ExecuteAction() override {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17405.48380.patch
Type: text/x-patch
Size: 543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160218/6584fded/attachment.bin>


More information about the cfe-commits mailing list