Add LDC-specific support for __traits(getTargetInfo)

This commit is contained in:
Martin Kinkelin 2018-10-19 23:43:41 +02:00
parent ee8f1ffa00
commit 0bd9a10234
5 changed files with 75 additions and 16 deletions

View file

@ -67,6 +67,12 @@ static cl::opt<cl::boolOrDefault>
"all system dependencies"),
cl::cat(opts::linkingCategory));
static llvm::cl::opt<std::string>
mscrtlib("mscrtlib", llvm::cl::ZeroOrMore,
llvm::cl::desc("MS C runtime library to link with"),
llvm::cl::value_desc("libcmt[d]|msvcrt[d]"),
llvm::cl::cat(opts::linkingCategory));
//////////////////////////////////////////////////////////////////////////////
// linker-gcc.cpp
@ -175,6 +181,17 @@ bool linkAgainstSharedDefaultLibs() {
//////////////////////////////////////////////////////////////////////////////
llvm::StringRef getMscrtLibName() {
llvm::StringRef name = mscrtlib;
if (name.empty()) {
// default to static release variant
name = linkFullyStatic() != llvm::cl::BOU_FALSE ? "libcmt" : "msvcrt";
}
return name;
}
//////////////////////////////////////////////////////////////////////////////
/// Insert an LLVM bitcode file into the module
static void insertBitcodeIntoModule(const char *bcFile, llvm::Module &M,
llvm::LLVMContext &Context) {