]> granicus.if.org Git - clang/commitdiff
Use Backend_EmitMCNull for null codegen unit tests.
authorDavid L. Jones <dlj@google.com>
Thu, 18 Feb 2016 20:27:16 +0000 (20:27 +0000)
committerDavid L. Jones <dlj@google.com>
Thu, 18 Feb 2016 20:27:16 +0000 (20:27 +0000)
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.

Differential Revision: http://reviews.llvm.org/D17405

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261252 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Frontend/CodeGenActionTest.cpp

index 3ff6c4eb40bda3f272f61973c1eb97238189d0a5..71446fd4d79d2333904f2f68edf7f3a63159a383 100644 (file)
@@ -26,7 +26,7 @@ namespace {
 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 {