summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-02-16 11:57:43 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-02-16 11:57:43 +0000
commitf0e4ccffc5738fd585d39f9fbb38659517e3bd31 (patch)
tree953a22bd92e4c29c71525bedc097d9fde7dd755a /clang/lib
parentfc3e62675219aa78fe084c265f7bcea6f2834033 (diff)
downloadbcm5719-llvm-f0e4ccffc5738fd585d39f9fbb38659517e3bd31.tar.gz
bcm5719-llvm-f0e4ccffc5738fd585d39f9fbb38659517e3bd31.zip
Fix quoting of #pragma comment for MS compat, clang part.
For #pragma comment(linker, ...) MSVC expects the comment string to be quoted, but for #pragma comment(lib, ...) the compiler itself quotes the library name. Since this distinction disappears by the time the directive reaches the backend, move quoting for the "lib" version to the frontend. Differential Revision: http://reviews.llvm.org/D7653 llvm-svn: 229376
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index d0678214190..117767d0b36 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -1614,11 +1614,15 @@ public:
};
static std::string qualifyWindowsLibrary(llvm::StringRef Lib) {
- // If the argument does not end in .lib, automatically add the suffix. This
- // matches the behavior of MSVC.
- std::string ArgStr = Lib;
+ // If the argument does not end in .lib, automatically add the suffix.
+ // If the argument contains a space, enclose it in quotes.
+ // This matches the behavior of MSVC.
+ bool Quote = (Lib.find(" ") != StringRef::npos);
+ std::string ArgStr = Quote ? "\"" : "";
+ ArgStr += Lib;
if (!Lib.endswith_lower(".lib"))
ArgStr += ".lib";
+ ArgStr += Quote ? "\"" : "";
return ArgStr;
}
OpenPOWER on IntegriCloud