r190071 - clang-cl: Use .obj as extension for unnamed object files (PR17095)
Hans Wennborg
hans at hanshq.net
Thu Sep 5 10:05:56 PDT 2013
Author: hans
Date: Thu Sep 5 12:05:56 2013
New Revision: 190071
URL: http://llvm.org/viewvc/llvm-project?rev=190071&view=rev
Log:
clang-cl: Use .obj as extension for unnamed object files (PR17095)
We already use .obj as extension when the user provides a stem file
name (via /Fo), but were failing in the most basic case when the file
name is based on the input file.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/test/Driver/cl-outputs.c
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=190071&r1=190070&r2=190071&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Sep 5 12:05:56 2013
@@ -1670,7 +1670,7 @@ const char *Driver::GetNamedOutputPath(C
} else
NamedOutput = DefaultImageName.c_str();
} else {
- const char *Suffix = types::getTypeTempSuffix(JA.getType());
+ const char *Suffix = types::getTypeTempSuffix(JA.getType(), IsCLMode());
assert(Suffix && "All types used for output should have a suffix.");
std::string::size_type End = std::string::npos;
Modified: cfe/trunk/test/Driver/cl-outputs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-outputs.c?rev=190071&r1=190070&r2=190071&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-outputs.c (original)
+++ cfe/trunk/test/Driver/cl-outputs.c Thu Sep 5 12:05:56 2013
@@ -4,6 +4,9 @@
// Note: %s must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.
+// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
+// DEFAULT: "-o" "cl-outputs.obj"
+
// RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s
// FoNAME: "-o" "a.obj"
More information about the cfe-commits
mailing list